void Expose_AssetReferenceList(duk_context* ctx) { duk_push_c_function(ctx, AssetReferenceList_Ctor_Selector, DUK_VARARGS); duk_push_object(ctx); duk_put_function_list(ctx, -1, AssetReferenceList_Functions); DefineProperty(ctx, "refs", AssetReferenceList_Get_refs, AssetReferenceList_Set_refs); DefineProperty(ctx, "type", AssetReferenceList_Get_type, AssetReferenceList_Set_type); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, AssetReferenceList_ID); }
void Expose_Line(duk_context* ctx) { duk_push_c_function(ctx, Line_Ctor_Selector, DUK_VARARGS); duk_put_function_list(ctx, -1, Line_StaticFunctions); duk_push_object(ctx); duk_put_function_list(ctx, -1, Line_Functions); DefineProperty(ctx, "pos", Line_Get_pos, Line_Set_pos); DefineProperty(ctx, "dir", Line_Get_dir, Line_Set_dir); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, Line_ID); }
void Expose_EntityReference(duk_context* ctx) { duk_push_c_function(ctx, EntityReference_Ctor_Selector, DUK_VARARGS); duk_push_object(ctx); duk_put_function_list(ctx, -1, EntityReference_Functions); DefineProperty(ctx, "ref", EntityReference_Get_ref, EntityReference_Set_ref); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, EntityReference_ID); }
void Expose_PhysicsWorld(duk_context* ctx) { duk_push_object(ctx); duk_push_object(ctx); duk_put_function_list(ctx, -1, PhysicsWorld_Functions); DefineProperty(ctx, "PhysicsCollision", PhysicsWorld_Get_PhysicsCollision, nullptr); DefineProperty(ctx, "NewPhysicsCollision", PhysicsWorld_Get_NewPhysicsCollision, nullptr); DefineProperty(ctx, "AboutToUpdate", PhysicsWorld_Get_AboutToUpdate, nullptr); DefineProperty(ctx, "Updated", PhysicsWorld_Get_Updated, nullptr); DefineProperty(ctx, "physicsUpdatePeriod", PhysicsWorld_PhysicsUpdatePeriod, PhysicsWorld_SetPhysicsUpdatePeriod_float); DefineProperty(ctx, "maxSubSteps", PhysicsWorld_MaxSubSteps, PhysicsWorld_SetMaxSubSteps_int); DefineProperty(ctx, "gravity", PhysicsWorld_Gravity, PhysicsWorld_SetGravity_float3); DefineProperty(ctx, "debugGeometryEnabled", PhysicsWorld_IsDebugGeometryEnabled, PhysicsWorld_SetDebugGeometryEnabled_bool); DefineProperty(ctx, "running", PhysicsWorld_IsRunning, PhysicsWorld_SetRunning_bool); DefineProperty(ctx, "client", PhysicsWorld_IsClient, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, PhysicsWorld_ID); }
void Expose_IAsset(duk_context* ctx) { duk_push_object(ctx); duk_push_number(ctx, 0); duk_put_prop_string(ctx, -2, "Original"); duk_push_number(ctx, 1); duk_put_prop_string(ctx, -2, "Cached"); duk_push_number(ctx, 2); duk_put_prop_string(ctx, -2, "Programmatic"); duk_push_number(ctx, 3); duk_put_prop_string(ctx, -2, "Bundle"); duk_push_object(ctx); duk_put_function_list(ctx, -1, IAsset_Functions); DefineProperty(ctx, "Unloaded", IAsset_Get_Unloaded, nullptr); DefineProperty(ctx, "Loaded", IAsset_Get_Loaded, nullptr); DefineProperty(ctx, "PropertyStatusChanged", IAsset_Get_PropertyStatusChanged, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, IAsset_ID); }
// ----------------------------------------------------------------------------- // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CSatSystemState::ConstructL( MSatMultiModeApi& aPhone ) { LOG( SIMPLE, "SATSYSTEMSTATE: CSatSystemState::ConstructL calling" ) // Define policies TSecurityPolicy readPolicy( ECapabilityReadUserData ); TSecurityPolicy writePolicy( ECapabilityWriteUserData ); DefineProperty( KPSUidSatServerInternal, KSatIdleModeText, RProperty::ELargeText, readPolicy, writePolicy ); DefineProperty( KPSUidSatServerInternal, KSatIdleModeTextIconId, RProperty::EInt, readPolicy, writePolicy ); DefineProperty( KPSUidSatServerInternal, KSatIdleModeTextIconQualifier, RProperty::EInt, readPolicy, writePolicy ); // Set default (empty) values WriteSetIdleModeText( KNullDesC, KErrNotFound, RSat::ENoIconId ); DefineProperty( KPSUidSatServer, KSatLanguageSelectionTimeBeforeReboot, RProperty::EInt, readPolicy, writePolicy ); // Create Network Registration Status Monitor. iNetworkRegStatusMonitor = CSatNetworkRegStatusMonitor::NewL( aPhone ); // Start Network Registration Status Monitor. iNetworkRegStatusMonitor->Start(); LOG( SIMPLE, "SATSYSTEMSTATE: CSatSystemState::ConstructL exiting" ) }
void Expose_IAssetTransfer(duk_context* ctx) { duk_push_object(ctx); duk_push_object(ctx); duk_put_function_list(ctx, -1, IAssetTransfer_Functions); DefineProperty(ctx, "asset", IAssetTransfer_Get_asset, IAssetTransfer_Set_asset); DefineProperty(ctx, "source", IAssetTransfer_Get_source, IAssetTransfer_Set_source); DefineProperty(ctx, "assetType", IAssetTransfer_Get_assetType, IAssetTransfer_Set_assetType); DefineProperty(ctx, "internalResourceName", IAssetTransfer_Get_internalResourceName, IAssetTransfer_Set_internalResourceName); DefineProperty(ctx, "Downloaded", IAssetTransfer_Get_Downloaded, nullptr); DefineProperty(ctx, "Succeeded", IAssetTransfer_Get_Succeeded, nullptr); DefineProperty(ctx, "Failed", IAssetTransfer_Get_Failed, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, IAssetTransfer_ID); }
void Expose_IAssetStorage(duk_context* ctx) { duk_push_object(ctx); duk_put_function_list(ctx, -1, IAssetStorage_StaticFunctions); duk_push_number(ctx, 0); duk_put_prop_string(ctx, -2, "AssetCreate"); duk_push_number(ctx, 1); duk_put_prop_string(ctx, -2, "AssetModify"); duk_push_number(ctx, 2); duk_put_prop_string(ctx, -2, "AssetDelete"); duk_push_number(ctx, 0); duk_put_prop_string(ctx, -2, "StorageUntrusted"); duk_push_number(ctx, 1); duk_put_prop_string(ctx, -2, "StorageTrusted"); duk_push_number(ctx, 2); duk_put_prop_string(ctx, -2, "StorageAskTrust"); duk_push_object(ctx); duk_put_function_list(ctx, -1, IAssetStorage_Functions); DefineProperty(ctx, "AssetChanged", IAssetStorage_Get_AssetChanged, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, IAssetStorage_ID); }
void Expose_Terrain(duk_context* ctx) { duk_push_object(ctx); duk_put_function_list(ctx, -1, Terrain_StaticFunctions); duk_push_object(ctx); duk_put_function_list(ctx, -1, Terrain_Functions); DefineProperty(ctx, "TerrainRegenerated", Terrain_Get_TerrainRegenerated, nullptr); DefineProperty(ctx, "ComponentNameChanged", Terrain_Get_ComponentNameChanged, nullptr); DefineProperty(ctx, "ParentEntitySet", Terrain_Get_ParentEntitySet, nullptr); DefineProperty(ctx, "ParentEntityAboutToBeDetached", Terrain_Get_ParentEntityAboutToBeDetached, nullptr); DefineProperty(ctx, "typeName", Terrain_TypeName, nullptr); DefineProperty(ctx, "typeId", Terrain_TypeId, nullptr); DefineProperty(ctx, "name", Terrain_Name, Terrain_SetName_String); DefineProperty(ctx, "replicated", Terrain_IsReplicated, Terrain_SetReplicated_bool); DefineProperty(ctx, "local", Terrain_IsLocal, nullptr); DefineProperty(ctx, "unacked", Terrain_IsUnacked, nullptr); DefineProperty(ctx, "updateMode", Terrain_UpdateMode, Terrain_SetUpdateMode_AttributeChange__Type); DefineProperty(ctx, "id", Terrain_Id, nullptr); DefineProperty(ctx, "temporary", Terrain_IsTemporary, Terrain_SetTemporary_bool); DefineProperty(ctx, "viewEnabled", Terrain_ViewEnabled, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, Terrain_ID); }
void JSObjectBuilder::DefineProperty(JS::HandleObject aObject, const char *name, const char *value) { DefineProperty(aObject, name, value, strlen(value)); }
void JSObjectBuilder::DefineProperty(JSCustomObject *aObject, const char *name, const char *value) { DefineProperty(aObject, name, value, strlen(value)); }
void JSObjectBuilder::DefineProperty(JSCustomObject *aObject, const char *name, JSCustomArray *aValue) { DefineProperty(aObject, name, (JSCustomObject*)aValue); }
void Expose_Light(duk_context* ctx) { duk_push_object(ctx); duk_put_function_list(ctx, -1, Light_StaticFunctions); duk_push_number(ctx, 0); duk_put_prop_string(ctx, -2, "PointLight"); duk_push_number(ctx, 1); duk_put_prop_string(ctx, -2, "Spotlight"); duk_push_number(ctx, 2); duk_put_prop_string(ctx, -2, "DirectionalLight"); duk_push_object(ctx); duk_put_function_list(ctx, -1, Light_Functions); DefineProperty(ctx, "ComponentNameChanged", Light_Get_ComponentNameChanged, nullptr); DefineProperty(ctx, "ParentEntitySet", Light_Get_ParentEntitySet, nullptr); DefineProperty(ctx, "ParentEntityAboutToBeDetached", Light_Get_ParentEntityAboutToBeDetached, nullptr); DefineProperty(ctx, "typeName", Light_TypeName, nullptr); DefineProperty(ctx, "typeId", Light_TypeId, nullptr); DefineProperty(ctx, "name", Light_Name, Light_SetName_String); DefineProperty(ctx, "replicated", Light_IsReplicated, Light_SetReplicated_bool); DefineProperty(ctx, "local", Light_IsLocal, nullptr); DefineProperty(ctx, "unacked", Light_IsUnacked, nullptr); DefineProperty(ctx, "updateMode", Light_UpdateMode, Light_SetUpdateMode_AttributeChange__Type); DefineProperty(ctx, "id", Light_Id, nullptr); DefineProperty(ctx, "temporary", Light_IsTemporary, Light_SetTemporary_bool); DefineProperty(ctx, "viewEnabled", Light_ViewEnabled, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, Light_ID); }
void Expose_RigidBody(duk_context* ctx) { duk_push_object(ctx); duk_put_function_list(ctx, -1, RigidBody_StaticFunctions); duk_push_number(ctx, 0); duk_put_prop_string(ctx, -2, "Box"); duk_push_number(ctx, 1); duk_put_prop_string(ctx, -2, "Sphere"); duk_push_number(ctx, 2); duk_put_prop_string(ctx, -2, "Cylinder"); duk_push_number(ctx, 3); duk_put_prop_string(ctx, -2, "Capsule"); duk_push_number(ctx, 4); duk_put_prop_string(ctx, -2, "TriMesh"); duk_push_number(ctx, 5); duk_put_prop_string(ctx, -2, "HeightField"); duk_push_number(ctx, 6); duk_put_prop_string(ctx, -2, "ConvexHull"); duk_push_number(ctx, 7); duk_put_prop_string(ctx, -2, "Cone"); duk_push_object(ctx); duk_put_function_list(ctx, -1, RigidBody_Functions); DefineProperty(ctx, "PhysicsCollision", RigidBody_Get_PhysicsCollision, nullptr); DefineProperty(ctx, "NewPhysicsCollision", RigidBody_Get_NewPhysicsCollision, nullptr); DefineProperty(ctx, "ComponentNameChanged", RigidBody_Get_ComponentNameChanged, nullptr); DefineProperty(ctx, "ParentEntitySet", RigidBody_Get_ParentEntitySet, nullptr); DefineProperty(ctx, "ParentEntityAboutToBeDetached", RigidBody_Get_ParentEntityAboutToBeDetached, nullptr); DefineProperty(ctx, "typeName", RigidBody_TypeName, nullptr); DefineProperty(ctx, "typeId", RigidBody_TypeId, nullptr); DefineProperty(ctx, "name", RigidBody_Name, RigidBody_SetName_String); DefineProperty(ctx, "replicated", RigidBody_IsReplicated, RigidBody_SetReplicated_bool); DefineProperty(ctx, "local", RigidBody_IsLocal, nullptr); DefineProperty(ctx, "unacked", RigidBody_IsUnacked, nullptr); DefineProperty(ctx, "updateMode", RigidBody_UpdateMode, RigidBody_SetUpdateMode_AttributeChange__Type); DefineProperty(ctx, "id", RigidBody_Id, nullptr); DefineProperty(ctx, "temporary", RigidBody_IsTemporary, RigidBody_SetTemporary_bool); DefineProperty(ctx, "viewEnabled", RigidBody_ViewEnabled, nullptr); duk_put_prop_string(ctx, -2, "prototype"); duk_put_global_string(ctx, RigidBody_ID); }