QDataStream& luaEvent::getState(QDataStream& in, Subject *, int observerId, QStringList & attribs) #endif { int obsCurrentState = 0; //serverSession->getState(observerId); QString content; switch (obsCurrentState) { case 0: #ifdef TME_BLACK_BOARD content = getAll(in, observerId, observedAttribs); #else content = getAll(in, observerId, attribs); #endif break; case 1: #ifdef TME_BLACK_BOARD content = getChanges(in, observerId, observedAttribs); #else content = getChanges(in, observerId, attribs); #endif break; } in << content; return in; }
QDataStream& luaNeighborhood::getState(QDataStream& in, Subject *, int observerId, QStringList &attribs) { #ifdef DEBUG_OBSERVER printf("\ngetState\n\nobsAttribs.size(): %i\n", obsAttribs.size()); luaStackToQString(12); #endif int obsCurrentState = 0; //serverSession->getState(observerId); QString content; switch(obsCurrentState) { case 0: content = getAll(in, observerId, attribs); // serverSession->setState(observerId, 1); // qWarning(QString("Observer %1 passou ao estado %2").arg(observerId).arg(1).toAscii().constData()); break; case 1: content = getChanges(in, observerId, attribs); // serverSession->setState(observerId, 0); // qWarning(QString("Observer %1 passou ao estado %2").arg(observerId).arg(0).toAscii().constData()); break; } // cleans the stack // lua_settop(L, 0); in << content; return in; }
SyncItem* WebOsCalendarSyncSource::getNextDeletedItem() { LOG.info("=========== GET NEXT DELETED ITEM CALLED =================="); if(!mGetChangesCalled) { getChanges(); } std::vector<WString> result = BlockingServiceCall("getDeletedEvent",TEXT("")); if(result.empty()) { LOG.error("GetDeleted failed."); } else { if(result.front() != "finished") { SyncItem* item = new SyncItem(); item->setDataType(TEXT("text/calendar")); //item->setData(e.second.c_str(),e.second.length()); no data for deleted items.. item->setKey(result.front().c_str()); LOG.debug("Added %s as deleted.",result.front().c_str()); return item; } } return NULL; }
SyncItem* WebOsCalendarSyncSource::getNextUpdatedItem() { LOG.info("=========== GET NEXT UPDATED ITEM CALLED =================="); if(!mGetChangesCalled) { getChanges(); } if(!mEvents.empty()) { //take first event and convert into item of correct type. std::pair<WString,WString>& e = mEvents.front(); SyncItem* item = new SyncItem(); item->setDataType(TEXT("text/calendar")); item->setData(e.second.c_str(),e.second.length()); item->setKey(e.first.c_str()); LOG.debug("Received %s from JS.",e.second.c_str()); mEvents.pop_front(); return item; } else return NULL; return NULL; }
//get first/next deleted item SyncItem* WebOsCalendarSyncSource::getFirstDeletedItem() { LOG.info("=========== GET FIRST DELETED ITEM CALLED =================="); if(!mGetChangesCalled) { getChanges(); } return getNextDeletedItem(); }
SyncItem* WebOsCalendarSyncSource::getNextNewItem() { LOG.info("=========== GET NEXT NEW ITEM CALLED =================="); if(!mGetChangesCalled) { getChanges(); } return NULL; }
static void leftSuperThrottle(void) { if (nowSuperThrottle) { nowSuperThrottle=0; getChanges(); check_prefs_changed_cpu(); check_prefs_changed_audio(); check_prefs_changed_custom(); } }
QDataStream& luaLocalAgent::getState(QDataStream& in, Subject *, int observerId, QStringList & attribs) #endif { int obsCurrentState = 0; //serverSession->getState(observerId); QString content; switch (obsCurrentState) { case 0: #ifdef TME_BLACK_BOARD content = getAll(in, observerId, observedAttribs); #else content = getAll(in, observerId, attribs); #endif // serverSession->setState(observerId, 1); // if (execModes == Quiet) // qWarning(QString("Observer %1 passou ao estado %2").arg(observerId).arg(1).toAscii().constData()); break; case 1: #ifdef TME_BLACK_BOARD content = getChanges(in, observerId, observedAttribs); #else content = getChanges(in, observerId, attribs); #endif // serverSession->setState(observerId, 0); // if (execModes == Quiet) // qWarning(QString("Observer %1 passou ao estado %2").arg(observerId).arg(0).toAscii().constData()); break; } // cleans the stack // lua_settop(L, 0); in << content; return in; }
static void goMenu(void) { int exitmode=0; int autosave=mainMenu_autosave; if (quit_program != 0) return; #ifdef PROFILER_UAE4ALL uae4all_prof_show(); #endif #ifdef DEBUG_FRAMERATE uae4all_show_time(); #endif emulating=1; vkbd_quit(); init_text(0); pause_sound(); menu_raise(); exitmode=run_mainMenu(); notice_screen_contents_lost(); resume_sound(); if ((!(strcmp(prefs_df[0],uae4all_image_file0))) || ((!(strcmp(prefs_df[1],uae4all_image_file1))))) menu_unraise(); quit_text(); vkbd_init(); #ifdef DREAMCAST SDL_DC_EmulateKeyboard(SDL_FALSE); #endif getChanges(); vkbd_init_button2(); if (exitmode==1 || exitmode==2) { extern char *savestate_filename; extern int saveMenu_n_savestate; for(int i=0;i<mainMenu_drives;i++) { if (i==0 && strcmp(changed_df[0],uae4all_image_file0)) { strcpy(changed_df[0],uae4all_image_file0); real_changed_df[0]=1; } else if (i==1 && strcmp(changed_df[1],uae4all_image_file1)) { strcpy(changed_df[1],uae4all_image_file1); real_changed_df[1]=1; } else if (i==2 && strcmp(changed_df[2],uae4all_image_file2)) { strcpy(changed_df[2],uae4all_image_file2); real_changed_df[2]=1; } else if (i==3 && strcmp(changed_df[3],uae4all_image_file3)) { strcpy(changed_df[3],uae4all_image_file3); real_changed_df[3]=1; } } strcpy(savestate_filename,uae4all_image_file0); switch(saveMenu_n_savestate) { case 1: strcat(savestate_filename,"-1.asf"); break; case 2: strcat(savestate_filename,"-2.asf"); break; case 3: strcat(savestate_filename,"-3.asf"); break; default: strcat(savestate_filename,".asf"); } } if (exitmode==3) { extern char *savestate_filename; extern int saveMenu_n_savestate; for(int i=0;i<mainMenu_drives;i++) { changed_df[i][0]=0; if (i==0) { uae4all_image_file0[0]=0; if (strcmp(changed_df[0],uae4all_image_file0)) { strcpy(changed_df[0],uae4all_image_file0); real_changed_df[0]=1; } } else if (i==1) { uae4all_image_file1[0]=0; if (strcmp(changed_df[1],uae4all_image_file1)) { strcpy(changed_df[1],uae4all_image_file1); real_changed_df[1]=1; } } else if (i==2) { uae4all_image_file2[0]=0; if (strcmp(changed_df[2],uae4all_image_file2)) { strcpy(changed_df[2],uae4all_image_file2); real_changed_df[2]=1; } } else if (i==3) { uae4all_image_file3[0]=0; if (strcmp(changed_df[3],uae4all_image_file3)) { strcpy(changed_df[3],uae4all_image_file3); real_changed_df[3]=1; } } disk_eject(i); } strcpy(savestate_filename,uae4all_image_file0); switch(saveMenu_n_savestate) { case 1: strcat(savestate_filename,"-1.asf"); break; case 2: strcat(savestate_filename,"-2.asf"); break; case 3: strcat(savestate_filename,"-3.asf"); break; default: strcat(savestate_filename,".asf"); } } if (exitmode==2) { if (autosave!=mainMenu_autosave) { prefs_df[0][0]=0; prefs_df[1][0]=0; prefs_df[2][0]=0; prefs_df[3][0]=0; } if(gp2xButtonRemappingOn) togglemouse(); int gp2xMouseEmuOn=0; int gp2xButtonRemappingOn=0; uae_reset (); } check_all_prefs(); gui_purge_events(); notice_screen_contents_lost(); #ifdef DEBUG_FRAMERATE uae4all_update_time(); #endif #ifdef PROFILER_UAE4ALL uae4all_prof_init(); #endif }
int gui_init (void) { //Se ejecuta justo despues del MAIN if (prSDLScreen==NULL) #ifdef DREAMCAST prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS); #else #ifdef PANDORA if(hwScaled) prSDLScreen = SDL_SetVideoMode(320, gfxHeight, 16, VIDEO_FLAGS); else { prSDLScreen = SDL_CreateRGBSurface(SDL_SWSURFACE,320,240,16,0,0,0,0); prSDLScaleScreen = SDL_SetVideoMode(640, 480, 16, VIDEO_FLAGS); } #else prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS); #endif #endif SDL_ShowCursor(SDL_DISABLE); SDL_JoystickEventState(SDL_ENABLE); SDL_JoystickOpen(0); if (prSDLScreen!=NULL) { emulating=0; #if !defined(DEBUG_UAE4ALL) && !defined(PROFILER_UAE4ALL) && !defined(AUTO_RUN) && !defined(AUTO_FRAMERATE) //uae4all_image_file[0]=0; //uae4all_image_file2[0]=0; #else //strcpy(uae4all_image_file,"prueba.adz"); //strcpy(uae4all_image_file2,"prueba2.adz"); #endif init_text(1); if (!uae4all_image_file0[0]) run_mainMenu(); quit_text(); vkbd_init(); #ifdef GP2X inputmode_init(); #if !defined(PANDORA) && !defined(GCW0) volumecontrol_init(); #endif #endif printf("4\n"); #if defined (PSP) || defined (GIZMONDO) inputmode_init(); #endif uae4all_pause_music(); printf("5\n"); emulating=1; getChanges(); printf("6\n"); check_all_prefs(); printf("7\n"); reset_frameskip(); printf("8\n"); #ifdef DEBUG_FRAMERATE uae4all_update_time(); #endif #ifdef PROFILER_UAE4ALL uae4all_prof_init(); uae4all_prof_add("M68K"); // 0 uae4all_prof_add("EVENTS"); // 1 uae4all_prof_add("HSync"); // 2 uae4all_prof_add("Copper"); // 3 uae4all_prof_add("Audio"); // 4 uae4all_prof_add("CIA"); // 5 uae4all_prof_add("Blitter"); // 6 uae4all_prof_add("Vsync"); // 7 uae4all_prof_add("update_fetch"); // 8 uae4all_prof_add("linetoscr"); // 9 uae4all_prof_add("do_long_fetch"); // 10 uae4all_prof_add("pfield_doline"); // 11 uae4all_prof_add("draw_sprites_ecs"); // 12 uae4all_prof_add("flush_block"); // 13 uae4all_prof_add("SET_INTERRUPT"); // 14 /* uae4all_prof_add("15"); // 15 uae4all_prof_add("16"); // 16 uae4all_prof_add("17"); // 17 uae4all_prof_add("18"); // 18 uae4all_prof_add("19"); // 19 uae4all_prof_add("20"); // 20 uae4all_prof_add("21"); // 21 uae4all_prof_add("22"); // 22 */ #endif #ifdef DREAMCAST SDL_DC_EmulateKeyboard(SDL_FALSE); #endif /*int test = pnd_evdev_open(pnd_evdev_nub1); printf("nub1 open: %d\n", test); test = pnd_evdev_open(pnd_evdev_nub2); printf("nub2 open: %d\n", test);*/ return 0; } return -1; }