示例#1
0
void SjSee::HttpRequest_init()
{
	SEE_value temp;

	// Create the "HttpRequest.prototype" object, this is used as a template for the instances
	m_HttpRequest_prototype = (SEE_object *)alloc_httprequest_object_(m_interpr);

	SEE_native_init((SEE_native *)m_HttpRequest_prototype, m_interpr,
	                &httprequest_inst_class, m_interpr->Object_prototype);

	PUT_FUNC(m_HttpRequest_prototype, httprequest, setRequestHeader, 0);
	PUT_FUNC(m_HttpRequest_prototype, httprequest, getResponseHeader, 0);
	PUT_FUNC(m_HttpRequest_prototype, httprequest, request, 0);
	PUT_FUNC(m_HttpRequest_prototype, httprequest, abort, 0);

	// create the "HttpRequest" object
	SEE_object* HttpRequest = (SEE_object *)SEE_malloc(m_interpr, sizeof(SEE_native));

	SEE_native_init((SEE_native *)HttpRequest, m_interpr,
	                &httprequest_constructor_class, m_interpr->Object_prototype);

	PUT_OBJECT(HttpRequest, str_prototype, m_HttpRequest_prototype);

	// now we can add the globals
	PUT_OBJECT(m_interpr->Global, str_HttpRequest,   HttpRequest);
}
示例#2
0
void SjSee::Database_init()
{
	SEE_value temp;

	// Create the "Database.prototype" object, this is used as a template for the instances
	m_Database_prototype = (SEE_object *)alloc_database_object(m_interpr);

	SEE_native_init((SEE_native *)m_Database_prototype, m_interpr,
	                &database_inst_class, m_interpr->Object_prototype);

	PUT_FUNC(m_Database_prototype, database, openQuery, 0);
	PUT_FUNC(m_Database_prototype, database, nextRecord, 0);
	PUT_FUNC(m_Database_prototype, database, getFieldCount, 0);
	PUT_FUNC(m_Database_prototype, database, getField, 0);
	PUT_FUNC(m_Database_prototype, database, closeQuery, 0);
	PUT_FUNC(m_Database_prototype, database, getFile, 0);

	// create the "Database" object
	SEE_object* Database = (SEE_object *)SEE_malloc(m_interpr, sizeof(SEE_native));

	SEE_native_init((SEE_native *)Database, m_interpr,
	                &database_constructor_class, m_interpr->Object_prototype);

	PUT_OBJECT(Database, str_prototype, m_Database_prototype)
	PUT_FUNC(Database, database, update, 0); // static function

	// now we can add the globals
	PUT_OBJECT(m_interpr->Global, str_Database,  Database);
}
示例#3
0
void SjSee::Player_init()
{
	SEE_value temp;

	// Create the "Player.prototype" object, this is used as a template for the instances
	m_Player_prototype = (SEE_object *)alloc_player_object(m_interpr);

	SEE_native_init((SEE_native *)m_Player_prototype, m_interpr,
	                &player_inst_class, m_interpr->Object_prototype);

	PUT_FUNC(m_Player_prototype, player, play,              0);
	PUT_FUNC(m_Player_prototype, player, pause,             0);
	PUT_FUNC(m_Player_prototype, player, stop,              0);
	PUT_FUNC(m_Player_prototype, player, prev,              0);
	PUT_FUNC(m_Player_prototype, player, next,              0);
	PUT_FUNC(m_Player_prototype, player, isPlaying,         0);
	PUT_FUNC(m_Player_prototype, player, isPaused,          0);
	PUT_FUNC(m_Player_prototype, player, isStopped,         0);
	PUT_FUNC(m_Player_prototype, player, hasPrev,           0);
	PUT_FUNC(m_Player_prototype, player, hasNext,           0);

	PUT_FUNC(m_Player_prototype, player, getUrlAtPos,       0);
	PUT_FUNC(m_Player_prototype, player, getAutoplayAtPos,  0);
	PUT_FUNC(m_Player_prototype, player, getPlayCountAtPos, 0);
	PUT_FUNC(m_Player_prototype, player, getArtistAtPos,    0);
	PUT_FUNC(m_Player_prototype, player, getAlbumAtPos,     0);
	PUT_FUNC(m_Player_prototype, player, getTitleAtPos,     0);
	PUT_FUNC(m_Player_prototype, player, getDurationAtPos,  0);
	PUT_FUNC(m_Player_prototype, player, addAtPos,          0);
	PUT_FUNC(m_Player_prototype, player, removeAtPos,       0);
	PUT_FUNC(m_Player_prototype, player, removeAll,         0);


	// create the "Player" object
	SEE_object* Player = (SEE_object *)SEE_malloc(m_interpr, sizeof(SEE_native));

	SEE_native_init((SEE_native *)Player, m_interpr,
	                &player_constructor_class, m_interpr->Object_prototype);

	PUT_OBJECT(Player, str_prototype, m_Player_prototype)

	// now we can add the globals
	PUT_OBJECT(m_interpr->Global, str_Player,    Player);

	m_player = Player_new();
	PUT_OBJECT(m_interpr->Global, str_player,    m_player);
}
示例#4
0
SEE_object* SjSee::Player_new()
{
	player_object* obj = alloc_player_object(m_interpr);

	SEE_native_init(&obj->m_native, m_interpr,
	                &player_inst_class, m_Player_prototype);

	return (SEE_object *)obj;
}
示例#5
0
SEE_object* SjSee::HttpRequest_new()
{
	httprequest_object* obj = alloc_httprequest_object_(m_interpr);

	SEE_native_init(&obj->m_native, m_interpr,
	                &httprequest_inst_class, m_HttpRequest_prototype);

	return (SEE_object *)obj;
}
示例#6
0
SEE_object* SjSee::Database_new(const wxString& name)
{
	database_object* obj = alloc_database_object(m_interpr);

	SEE_native_init(&obj->native, m_interpr,
	                &database_inst_class, m_Database_prototype);

	if( !name.IsEmpty() )
	{
		obj->db = new wxSqltDb(name);
	}

	obj->sql = new wxSqlt(obj->db);

	return (SEE_object *)obj;
}