コード例 #1
0
ファイル: LComponent.cpp プロジェクト: swc4848a/luce
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 );

}
コード例 #2
0
ファイル: LComponent.cpp プロジェクト: swc4848a/luce
int LComponent::setName ( lua_State* ) {
    String newName = LUA::getString(2);
    myName( newName ); 
    if (child)
        child->setName(newName);
    return 0;
}
コード例 #3
0
ファイル: LTreeView.cpp プロジェクト: blueantst/luce
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;
}
コード例 #5
0
ファイル: puck.c プロジェクト: ivan-gimenez/timewarp
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

}
コード例 #6
0
bool DSN::equalName(const DSN& other) const
{
	std::string myName(m_name), otherName(other.getName());
	stringToLowercase(myName);
	stringToLowercase(otherName);
	return myName.compare(otherName) == 0;
}
コード例 #7
0
ファイル: LAffineTransform.cpp プロジェクト: blueantst/luce
LAffineTransform::LAffineTransform(lua_State *L, const AffineTransform& class_)
    : LBase(L, "LAffineTransform", true),
      AffineTransform( class_ )
{
    if ( lua_isstring(L, 2) )
        myName( lua_tostring(L, 2) );
}
コード例 #8
0
ファイル: LAffineTransform.cpp プロジェクト: blueantst/luce
LAffineTransform::LAffineTransform(lua_State *L)
    : LBase(L, "LAffineTransform", true),
      AffineTransform()
{
    if ( lua_isstring(L, 2) )
        myName( lua_tostring(L, 2) );
}
コード例 #9
0
ファイル: qgsoptions.cpp プロジェクト: mmubangizi/qgis
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;

}
コード例 #10
0
ファイル: LListBox.cpp プロジェクト: riverfor/luce
LListBox::LListBox(lua_State *L)
    : LComponent(L, this),
      ListBox("LListBox", this)
{
    ListBox::setName(myName());
    REGISTER_CLASS(LListBox);
}
コード例 #11
0
ファイル: LTextButton.cpp プロジェクト: blueantst/luce
LTextButton::LTextButton(lua_State *L)
    : LButton(L, this),
      TextButton()
{
    TextButton::setName(myName());
    TextButton::addListener(this);
    REGISTER_CLASS(LTextButton);
}
コード例 #12
0
ファイル: LHyperlinkButton.cpp プロジェクト: peersuasive/luce
LHyperlinkButton::LHyperlinkButton(lua_State *L)
    : LButton(L, this),
      HyperlinkButton()
{
    HyperlinkButton::setName(myName());
    HyperlinkButton::addListener(this);

    REGISTER_CLASS(LHyperlinkButton);
}
コード例 #13
0
ファイル: main.cpp プロジェクト: Grayninja/General
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;
}
コード例 #14
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;
}
コード例 #15
0
ファイル: LOpenGLComponent.cpp プロジェクト: blueantst/luce
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);
}
コード例 #16
0
ファイル: LJComponent.cpp プロジェクト: blueantst/luce
LJComponent::LJComponent(lua_State *L) 
    : LComponent(L, this)
{
    Component::setName( myName() );
    REGISTER_CLASS(LJComponent);
}
コード例 #17
0
 std::string classInfo() const{
     return myName();
 }
コード例 #18
0
 CheckThrowNull(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger): Check(myName(), tokenizer, settings, errorLogger){}
コード例 #19
0
 CheckThrowNull(): Check(myName()){}
コード例 #20
0
ファイル: 16.cpp プロジェクト: chrismp/learning-c-plus-plus
int main()
{
	MyString	myName("Chris");
	std::cout << "My name is: " << myName.getString() << '\n';
	return 0;
} // myName destroyed here, so ~MyString() destructor called here
コード例 #21
0
LMouseInputSource::LMouseInputSource(lua_State *L, const MouseInputSource& e)
    : LBase(L),
      MouseInputSource( e )
{
    myName("LMouseInputSource (dynamic)");
}