/* This function may also be called by the main thread if a game is not loaded. */ static void GameThread_HandleEvents(void) { SDL_Event gtevents_temp[gtevents_size]; int numevents = 0; SDL_mutexP(EVMutex); while(gte_read != gte_write) { memcpy(>events_temp[numevents], (void *)>events[gte_read], sizeof(SDL_Event)); numevents++; gte_read = (gte_read + 1) & (gtevents_size - 1); } SDL_mutexV(EVMutex); for(int i = 0; i < numevents; i++) { SDL_Event *event = >events_temp[i]; if(EventHook) EventHook(event); NetplayEventHook_GT(event); } SDL_mutexV(EVMutex); }
void sp_kde_init (int argc, char **argv, const char *appName, const char *programName, const char *version, const char *shortDescription, const char *copyrightStatement, const char *homePageAddress, const char *bugsEmailAddress) { KDEAbout = new KAboutData(appName, programName, version, shortDescription, KAboutData::License_GPL, copyrightStatement, NULL, homePageAddress, bugsEmailAddress); KCmdLineArgs::init(argc, argv, KDEAbout); KDESodipodi = new KApplication; Bridge = new SPKDEBridge ("KDE Bridge"); DCOPInterface = new TiEmuDCOP (); QObject::connect (KDESodipodi, SIGNAL (guiThreadAwake ()), Bridge, SLOT (EventHook ())); gdk_event_handler_set ((GdkEventFunc) sp_kde_gdk_event_handler, NULL, NULL); }