Author: sh-sh-sh Date: Wed Nov 7 13:59:16 2007 New Revision: 41848 URL: http://svn.opensuse.org/viewcvs/yast?rev=41848&view=rev Log: generated code notice Modified: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc Modified: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h?rev=41848&r1=41847&r2=41848&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h Wed Nov 7 13:59:16 2007 @@ -1,3 +1,8 @@ +// +// Generated by generateYCPWrappers +// +// DO NOT CHANGE! +// case 0: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} return m_instance->SetLanguage (m_param1->asString()); case 1: if (m_param1->isVoid()) {y2error("ERROR: Parameter 1 is nil, String is required"); return YCPVoid();} if (m_param2->isVoid()) {y2error("ERROR: Parameter 2 is nil, String is required"); return YCPVoid();} return m_instance->SetLanguage (m_param1->asString(), m_param2->asString()); case 2: return m_instance->GetProductName (); Modified: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h?rev=41848&r1=41847&r2=41848&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinTable.h Wed Nov 7 13:59:16 2007 @@ -1,4 +1,10 @@ - enterSymbol (new SymbolEntry (this, 0, "SetLanguage", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) ); +// +// Generated by generateYCPWrappers +// +// DO NOT CHANGE! +// + + enterSymbol (new SymbolEntry (this, 0, "SetLanguage", SymbolEntry::c_function, Type::fromSignature ("void (string)") ) ); _registered_functions.push_back ("SetLanguage"); enterSymbol (new SymbolEntry (this, 1, "SetLanguage", SymbolEntry::c_function, Type::fromSignature ("void (string, string)") ) ); _registered_functions.push_back ("SetLanguage"); Modified: branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc?rev=41848&r1=41847&r2=41848&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/Y2UINamespace.cc Wed Nov 7 13:59:16 2007 @@ -618,11 +618,11 @@ { switch (position) { - case 0: m_param1 = arg; break; - case 1: m_param2 = arg; break; - case 2: m_param3 = arg; break; - case 3: m_param4 = arg; break; - case 4: m_param5 = arg; break; + case 0: m_param1 = arg; break; + case 1: m_param2 = arg; break; + case 2: m_param3 = arg; break; + case 3: m_param4 = arg; break; + case 4: m_param5 = arg; break; default: return false; } @@ -751,32 +751,38 @@ } -Y2UIOverloadedFunction::Y2UIOverloadedFunction ( - Y2UINamespace* instance, YUIComponent* comp, - unsigned pos_offset, - vector<SymbolEntryPtr>::iterator candidates_b, - vector<SymbolEntryPtr>::iterator candidates_e, - bool play_macro_blocks) : - Y2UIFunction (instance, comp, pos_offset, play_macro_blocks), - m_candidates_b (candidates_b), - m_candidates_e (candidates_e) +Y2UIOverloadedFunction::Y2UIOverloadedFunction ( Y2UINamespace* instance, YUIComponent* comp, + unsigned pos_offset, + vector<SymbolEntryPtr>::iterator candidates_b, + vector<SymbolEntryPtr>::iterator candidates_e, + bool play_macro_blocks ) + : Y2UIFunction (instance, comp, pos_offset, play_macro_blocks) + , m_candidates_b (candidates_b) + , m_candidates_e (candidates_e) { // still to do: m_position is just the first candidate } -bool Y2UIOverloadedFunction::finishParameters() + +bool +Y2UIOverloadedFunction::finishParameters() { FunctionTypePtr real_tp = new FunctionType (Type::Unspec); //return type - if (!m_param1.isNull()) { + if (!m_param1.isNull()) + { real_tp->concat (Type::vt2type (m_param1->valuetype())); - if (!m_param2.isNull()) { + if (!m_param2.isNull()) + { real_tp->concat (Type::vt2type (m_param2->valuetype())); - if (!m_param3.isNull()) { + if (!m_param3.isNull()) + { real_tp->concat (Type::vt2type (m_param3->valuetype())); - if (!m_param4.isNull()) { + if (!m_param4.isNull()) + { real_tp->concat (Type::vt2type (m_param4->valuetype())); - if (!m_param5.isNull()) { + if (!m_param5.isNull()) + { real_tp->concat (Type::vt2type (m_param5->valuetype())); } } @@ -784,48 +790,50 @@ } } y2debug ("Actual type: %s", real_tp->toString().c_str()); - + vector<SymbolEntryPtr>::iterator b = m_candidates_b, e = m_candidates_e, it; - for (it = b; it != e; ++it) { + for (it = b; it != e; ++it) + { SymbolEntryPtr se_p = *it; constFunctionTypePtr cand_type = se_p->type(); int m = real_tp->match (cand_type); - y2debug ("Candidate: %s MATCH: %d", - se_p->toString().c_str(), m); + y2debug ("Candidate: %s MATCH: %d", se_p->toString().c_str(), m); + if (m == 0) break; } - if (it == e) { + if (it == e) + { // any candidate has a good name. report actual used signature. no_match ((*b)->name(), real_tp, b, e); return false; } + // found m_position += (it - b); return true; } -/** - * Constructor. - */ + Y2UINamespace::Y2UINamespace (YUIComponent* comp) { m_comp = comp; registerFunctions(); } -/** - * Destructor. - */ + Y2UINamespace::~Y2UINamespace() -{} +{ + // NOP +} + -Y2Function* Y2UINamespace::createFunctionCall (const string name, constFunctionTypePtr type) +Y2Function* Y2UINamespace::createFunctionCall( const string name, constFunctionTypePtr type ) { #if VERBOSE_UI_CALLS y2debug ("Creating function call for %s", name.c_str()); @@ -840,31 +848,37 @@ it = b; SymbolEntryPtr p; - // 1: find start of range of overloaded functions - for ( ; it != e; it++) + // + // 1: Find start of range of overloaded functions + // + + for ( ; it != e; it++ ) { p = (*it); if ( p->name() == name ) break; } - if (it == e) + if ( it == e ) { y2error ("No such function %s", name.c_str()); return NULL; } bool play_macro_blocks = (name == "UserInput" || name == "TimeoutUserInput" || name == "WaitForEvent"); - + symbols_t::iterator rb = it; // 2: find end of range of overloaded functions or the exact match - for ( ; it != e; it++) + + for ( ; it != e; it++ ) { - p = (*it); + p = (*it); if ( p->name() != name ) break; + // type comparison, ugh, use match - if (type && p->type() == type) + + if ( type && p->type() == type ) { // found exact match // BTW, p->position() may change as we go, don't get confused. @@ -875,10 +889,11 @@ return new Y2UIFunction (this, m_comp, it - b, play_macro_blocks); } } + symbols_t::iterator re = it; // [rb, re) have matching name - if (type) + if ( type ) { // we have exhausted the candidates without finding a match y2error ("Incompatible yast2-core?"); @@ -890,6 +905,7 @@ return new Y2UIOverloadedFunction (this, m_comp, rb - b, rb, re, play_macro_blocks); } + void Y2UINamespace::registerFunctions() { #include "UIBuiltinTable.h" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org