//----------------------------------------------------------------// void MOAISim::SendFinalizeEvent () { MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( this->PushListener ( EVENT_FINALIZE, state )) { state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAISim::SendResumeEvent () { MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( this->PushListener ( EVENT_RESUME, state )) { state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIHarness::ReceiveEvaluate(lua_State *L, json_t* node) { // Get the evaluation. json_t* np_eval = json_object_get(node, "Evaluation"); if (np_eval == NULL || json_typeof(np_eval) != JSON_STRING) return; // Get the current stack index so we know how many // positions to clear afterward. int top = lua_gettop(L); // Load the string from the message MOAIScopedLuaState state ( L ); int status = luaL_loadstring ( state, json_string_value(np_eval) ); if ( state.PrintErrors ( ZLLog::CONSOLE, status )) return; // Call the string state.DebugCall ( 0, 0 ); // Now unload all of the things we just put on the stack // until the stack is the same size. std::string indent = " "; json_t* result = MOAIHarness::ConvertStackPartialToJSON(L, top + 1, lua_gettop(L)); lua_pop(L, lua_gettop(L) - top); // Send the message back to the IDE. MOAIHarness::SendResult(result); }
//----------------------------------------------------------------// extern "C" JNIEXPORT void JNICALL Java_com_ziplinegames_moai_MoaiTapjoy_AKUInvokeListenerWithCode ( JNIEnv* env, jclass obj, jint eventID, jint code ) { ZLLog::LogF ( ZLLog::CONSOLE, "Java_com_ziplinegames_moai_MoaiTapjoy_AKUInvokeListenerWithCode\n" ); MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( MOAITapjoyAndroid::Get ().PushListener ( eventID, state )) { state.Push ( code ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAIGooglePlayServicesAndroid::NotifyConnectionComplete () { MOAILuaRef& callback = this->mListeners [ CONNECTION_COMPLETE ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAITstoreGamecenterAndroid::AKUNotifyUserInfoResponse ( cc8* jsonData ) { MOAILuaRef& callback = this->mListeners [ GET_USERINFO_RESPONSE ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); lua_pushstring ( state, jsonData ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAITstoreGamecenterAndroid::AKUNotifyDisableSuccessResponse () { MOAILuaRef& callback = this->mListeners [ DISABLE_GAMECENTER_RESPONSE ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAITstoreGamecenterAndroid::AKUNotifyAuthSuccessResponse () { MOAILuaRef& callback = this->mListeners [ AUTH_RESPONSE_SUCCESS ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIScriptNode::OnDepNodeUpdate () { if ( this->mOnUpdate ) { MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( this->mOnUpdate.PushRef ( state )) { this->PushLuaUserdata ( state ); state.DebugCall ( 1, 0 ); } } }
//----------------------------------------------------------------// void MOAIWheelSensor::ParseEvent ( ZLStream& eventStream ) { this->mDelta = eventStream.Read < float >( 0.0f ); this->mValue += this->mDelta; if ( this->mCallback ) { MOAIScopedLuaState state = this->mCallback.GetSelf (); lua_pushnumber ( state, this->mDelta ); state.DebugCall ( 1, 0 ); } }
//================================================================// // MOAIAdColonyAndroid //================================================================// //----------------------------------------------------------------// void MOAIAdColonyAndroid::NotifyVideoComplete () { MOAILuaRef& callback = this->mListeners [ VIDEO_ENDED_IN_ZONE ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIChartBoostAndroid::NotifyInterstitialDismissed () { MOAILuaRef& callback = this->mListeners [ INTERSTITIAL_DISMISSED ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIChartBoostAndroid::NotifyInterstitialLoadFailed () { MOAILuaRef& callback = this->mListeners [ INTERSTITIAL_LOAD_FAILED ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIMoviePlayerAndroid::NotifyMoviePlayerCompleted () { MOAILuaRef& callback = this->mListeners [ MOVIE_PLAYER_COMPLETED ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIMoviePlayerAndroid::NotifyMoviePlayerReady () { MOAILuaRef& callback = this->mListeners [ MOVIE_PLAYER_READY ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIAppAndroid::NotifyWillEndSession () { MOAILuaRef& callback = this->mListeners [ SESSION_END ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIAppAndroid::NotifyDidStartSession ( bool resumed ) { MOAILuaRef& callback = this->mListeners [ SESSION_START ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); lua_pushboolean ( state, resumed ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAITstoreWallAndroid::NotifyCurrencyAwarded ( int amount ) { MOAILuaRef& callback = this->mListeners [ TSTORE_CURRENCY_AWARDED ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); lua_pushinteger ( state, amount ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAIDialogAndroid::NotifyDialogDismissed ( int dialogResult ) { if ( !mDialogCallback.IsNil ()) { MOAIScopedLuaState state = mDialogCallback.GetSelf (); lua_pushinteger ( state, dialogResult ); state.DebugCall ( 1, 0 ); mDialogCallback.Clear (); } }
//----------------------------------------------------------------// void MOAIMotionSensor::HandleEvent ( ZLStream& eventStream ) { this->mX = eventStream.Read < float >( 0.0f ); this->mY = eventStream.Read < float >( 0.0f ); this->mZ = eventStream.Read < float >( 0.0f ); if ( this->mCallback ) { MOAIScopedLuaState state = this->mCallback.GetSelf (); lua_pushnumber ( state, this->mX ); lua_pushnumber ( state, this->mY ); lua_pushnumber ( state, this->mZ ); state.DebugCall ( 3, 0 ); } }
//----------------------------------------------------------------// void MOAIDataIOTask::Publish () { if ( this->mInflateOnLoad && ( !this->mInflateOnTaskThread )) { this->mData->Inflate ( this->mWindowBits ); } if ( this->mOnFinish ) { MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); this->PushLocal ( state, this->mOnFinish ); this->mData->PushLuaUserdata ( state ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAIFacebookAndroid::NotifyLoginComplete ( int code ) { MOAILuaRef& callback = this->mListeners [ SESSION_DID_NOT_LOGIN ]; if ( code == DIALOG_RESULT_SUCCESS ) { callback = this->mListeners [ SESSION_DID_LOGIN ]; } if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAIFacebookAndroid::NotifyDialogComplete ( int code ) { MOAILuaRef& callback = this->mListeners [ DIALOG_DID_NOT_COMPLETE ]; if ( code == DIALOG_RESULT_SUCCESS ) { callback = this->mListeners [ DIALOG_DID_COMPLETE ]; } if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// void MOAITwitterAndroid::NotifyTweetComplete ( int code ) { MOAILuaRef& callback = this->mListeners [ TWEET_CANCELLED ]; if ( code == RESULT_SUCCESS ) { callback = this->mListeners [ TWEET_SUCCESSFUL ]; } if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 0 ); } }
//----------------------------------------------------------------// bool MOAIAppAndroid::NotifyBackButtonPressed () { MOAILuaRef& callback = this->mListeners [ BACK_BUTTON_PRESSED ]; if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); state.DebugCall ( 0, 1 ); return lua_toboolean ( state, -1 ); } else { return false; } }
//----------------------------------------------------------------// void MOAINode::DepNodeUpdate () { if ( this->mState == STATE_SCHEDULED ) { this->mState = STATE_UPDATING; this->PullAttributes (); MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( this->PushListenerAndSelf ( EVENT_UPDATE, state )) { state.DebugCall ( 1, 0 ); } this->OnDepNodeUpdate (); } this->mState = STATE_ACTIVE; }
//----------------------------------------------------------------// void MOAIButtonSensor::HandleEvent ( ZLStream& eventStream ) { bool down = eventStream.Read < bool >( false ); if ( down ) { this->mState |= IS_DOWN | DOWN; } else { this->mState &= ~IS_DOWN; this->mState |= UP; } if ( this->mOnButton ) { MOAIScopedLuaState state = this->mOnButton.GetSelf (); lua_pushboolean ( state, down ); state.DebugCall ( 1, 0 ); } }
//----------------------------------------------------------------// void MOAITwitterAndroid::NotifyLoginComplete ( int code, cc8* token, cc8* tokenSecret ) { MOAILuaRef& callback = this->mListeners [ SESSION_DID_NOT_LOGIN ]; if ( code == RESULT_SUCCESS ) { callback = this->mListeners [ SESSION_DID_LOGIN ]; } if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); lua_pushstring ( state, token ); lua_pushstring ( state, tokenSecret ); state.DebugCall ( 2, 0 ); } }
//----------------------------------------------------------------// void AKUSetViewSize ( int width, int height ) { MOAIGfxDevice& device = MOAIGfxDevice::Get (); u32 currentWidth = device.GetWidth (); u32 currentHeight = device.GetHeight (); if (( currentWidth != ( u32 )width ) || ( currentHeight != ( u32 )height )) { MOAIGfxDevice::Get ().SetBufferSize ( width, height ); MOAIScopedLuaState state = MOAILuaRuntime::Get ().State (); if ( device.PushListener ( MOAIGfxDevice::EVENT_RESIZE, state )) { lua_pushnumber ( state, width ); lua_pushnumber ( state, height ); state.DebugCall ( 2, 0 ); } } }
//----------------------------------------------------------------// void MOAIApp::PaymentQueueUpdatedTransactions ( int transactionResult, const char *extraInfo ) { //UNUSED ( queue ); MOAILuaRef& callback = this->mListeners [ PAYMENT_QUEUE_TRANSACTION ]; //for ( SKPaymentTransaction* transaction in transactions ) { if ( callback ) { MOAIScopedLuaState state = callback.GetSelf (); this->PushPaymentTransaction ( transactionResult, state ); state.DebugCall ( 1, 0 ); } //if ( transaction.transactionState != SKPaymentTransactionStatePurchasing ) { // [[ SKPaymentQueue defaultQueue ] finishTransaction:transaction ]; //} //} }