LComponent::LComponent(lua_State *Ls, Component* child_, const String& name_) : LBase(Ls, "LComponent", false), child(child_), currentLookAndFeel(0), animator(Desktop::getInstance().getAnimator()) { L = Ls; if ( lua_isstring(L, 2) ) myName( LUA::getString(2) ); else myName(name_); //LBase::name( myName ); }
int LComponent::setName ( lua_State* ) { String newName = LUA::getString(2); myName( newName ); if (child) child->setName(newName); return 0; }
LTreeView::LTreeView(lua_State *L) : LComponent(L, this), TreeView( /* TODO: add args */ ) { TreeView::setName(myName()); REGISTER_CLASS( LTreeView ); }
int main() { DatasimDate myBirthday(29, 8, 1952); string myName ("Daniel J. Duffy"); Person dd(myName, myBirthday); dd.print(); DatasimDate bBirthday(06, 8, 1994); string bName ("Brendan Duffy"); Person bd(bName, bBirthday); bd.print(); Employee dde (myName, myBirthday, string("Cuchulainn Chief"), 0.01, 65); dde.print(); cout << "Working with pointers I\n"; // Non-polymorphic function Person* p = &dde; p -> print(); cout << "Working with pointers II\n"; // Polymorphic function p -> DeepPrint(); return 0; }
puck_init () { register int i; State *ps = (State *) myState; ps->action_id = 0; for (i = 0; i < MAX_PLANS; i++) ps->plans[i].available = TRUE; for (i = 0; i < MAX_SECTORS; i++) ps->sectors[i].available = TRUE; ps->Initialized = FALSE; myName ( ps->my_name ); ps->my_number = ( ps->my_name[4] - '0' ) * 1000 + ( ps->my_name[5] - '0' ) * 100 + ( ps->my_name[6] - '0' ) * 10 + ( ps->my_name[7] - '0' ) * 1; #ifdef THERMAL_LOG ps->Last_Log_Time = newVTime ( -30.0, 0, 0); /* PJH Arbitrary */ ps->Thermal_Record_Count = 0; #endif THERMAL_LOG }
bool DSN::equalName(const DSN& other) const { std::string myName(m_name), otherName(other.getName()); stringToLowercase(myName); stringToLowercase(otherName); return myName.compare(otherName) == 0; }
LAffineTransform::LAffineTransform(lua_State *L, const AffineTransform& class_) : LBase(L, "LAffineTransform", true), AffineTransform( class_ ) { if ( lua_isstring(L, 2) ) myName( lua_tostring(L, 2) ); }
LAffineTransform::LAffineTransform(lua_State *L) : LBase(L, "LAffineTransform", true), AffineTransform() { if ( lua_isstring(L, 2) ) myName( lua_tostring(L, 2) ); }
QString QgsOptions::getEllipsoidName( QString theEllipsoidAcronym ) { sqlite3 *myDatabase; const char *myTail; sqlite3_stmt *myPreparedStatement; int myResult; QString myName( ELLIPS_FLAT_DESC ); //check the db is available myResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().data(), &myDatabase ); if ( myResult ) { QgsDebugMsg( QString( "Can't open database: %1" ).arg( sqlite3_errmsg( myDatabase ) ) ); // XXX This will likely never happen since on open, sqlite creates the // database if it does not exist. Q_ASSERT( myResult == 0 ); } // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list QString mySql = "select name from tbl_ellipsoid where acronym='" + theEllipsoidAcronym + "'"; myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail ); // XXX Need to free memory from the error msg if one is set if ( myResult == SQLITE_OK ) { if ( sqlite3_step( myPreparedStatement ) == SQLITE_ROW ) myName = QString(( const char * )sqlite3_column_text( myPreparedStatement, 0 ) ); } // close the sqlite3 statement sqlite3_finalize( myPreparedStatement ); sqlite3_close( myDatabase ); return myName; }
LListBox::LListBox(lua_State *L) : LComponent(L, this), ListBox("LListBox", this) { ListBox::setName(myName()); REGISTER_CLASS(LListBox); }
LTextButton::LTextButton(lua_State *L) : LButton(L, this), TextButton() { TextButton::setName(myName()); TextButton::addListener(this); REGISTER_CLASS(LTextButton); }
LHyperlinkButton::LHyperlinkButton(lua_State *L) : LButton(L, this), HyperlinkButton() { HyperlinkButton::setName(myName()); HyperlinkButton::addListener(this); REGISTER_CLASS(LHyperlinkButton); }
int main(int argc, char* argv[]) { if (argc < 2) { std::cerr << "Usage:" << "\n\t" << argv[0] << " [name]" << std::endl; return -1; } for (int i = 1; i <= argc-1; ++i) { MyString myName(argv[i]); std::cout << "Your name is " << myName.GetString() << std::endl; } return 0; }
bool SharedPortClient::sendSharedPortID(char const *shared_port_id,Sock *sock) { // NOTE: Even platforms that do not support USE_SHARED_PORT // for their own daemons support the remote client protocol // for accessing daemons on other platforms that are using // shared ports. This function does that. It doesn't depend // on anything platform-dependent. sock->encode(); sock->put(SHARED_PORT_CONNECT); sock->put(shared_port_id); // for debugging sock->put(myName().Value()); int deadline = sock->get_deadline(); if( deadline ) { deadline -= time(NULL); if( deadline < 0 ) { deadline = 0; } } else { deadline = sock->get_timeout_raw(); if( deadline == 0 ) { deadline = -1; } } sock->put(deadline); // for possible future use int more_args = 0; sock->put(more_args); if( !sock->end_of_message() ) { dprintf(D_ALWAYS, "SharedPortClient: failed to send target id %s to %s.\n", shared_port_id, sock->peer_description()); return false; } dprintf(D_FULLDEBUG, "SharedPortClient: sent connection request to %s for shared port id %s\n", sock->peer_description(), shared_port_id); return true; }
LOpenGLComponent::LOpenGLComponent(lua_State *L) : LComponent(L, this), Component() { Component::setName(myName()); Component::setOpaque(true); // test perfs without openGLContext.setRenderer(this); openGLContext.setComponentPaintingEnabled(true); openGLContext.setMultisamplingEnabled(true); openGLContext.setContinuousRepainting(true); openGLContext.attachTo(*this); //openGLContext.attachTo(*Component::getTopLevelComponent()); REGISTER_CLASS(LOpenGLComponent); }
LJComponent::LJComponent(lua_State *L) : LComponent(L, this) { Component::setName( myName() ); REGISTER_CLASS(LJComponent); }
std::string classInfo() const{ return myName(); }
CheckThrowNull(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger): Check(myName(), tokenizer, settings, errorLogger){}
CheckThrowNull(): Check(myName()){}
int main() { MyString myName("Chris"); std::cout << "My name is: " << myName.getString() << '\n'; return 0; } // myName destroyed here, so ~MyString() destructor called here
LMouseInputSource::LMouseInputSource(lua_State *L, const MouseInputSource& e) : LBase(L), MouseInputSource( e ) { myName("LMouseInputSource (dynamic)"); }