/*! * This method does some common actions before given handle to the * current menu instance via handleLeave(). */ void Menu::leave() { // Reset focus if an action widget had one. if (focusedWgId_ != -1) { ActionWidget *pAction = getActionWidget(focusedWgId_); pAction->handleFocusLost(); focusedWgId_ = -1; } // Reset capture if (pCaptureInput_ != NULL) { pCaptureInput_->handleCaptureLost(); pCaptureInput_ = NULL; } // Give control to menu instance handleLeave(); }
void Menu::leave(bool playAnim) { handleLeave(); if (leaveAnim_.size() && playAnim) { FliPlayer fliPlayer; uint8 *data; int size; data = File::loadFile(leaveAnim_.c_str(), size); fliPlayer.loadFliData(data); g_App.gameSounds().sound(Sound::MENU_CHANGE)->play(); fliPlayer.play(); delete[] data; } if (background_) { g_Screen.scale2x(clear_x_, clear_y_, clear_w_ / 2, clear_h_ / 2, background_ + (clear_x_ / 2) + (clear_y_ / 2) * 320, 320); } }
void XWaylandManager::wmEvents() { // Uncomment if you want to be flooded by messages //qCDebug(XWAYLAND_TRACE) << "WM event"; xcb_generic_event_t *event; while ((event = xcb_poll_for_event(Xcb::connection()))) { //handle selection event //handle dnd event int type = event->response_type & ~0x80; switch (type) { case XCB_BUTTON_PRESS: case XCB_BUTTON_RELEASE: handleButton((xcb_button_press_event_t *)event); break; case XCB_ENTER_NOTIFY: handleEnter((xcb_enter_notify_event_t *)event); break; case XCB_LEAVE_NOTIFY: handleLeave((xcb_leave_notify_event_t *)event); break; case XCB_MOTION_NOTIFY: handleMotion((xcb_motion_notify_event_t *)event); break; case XCB_CREATE_NOTIFY: handleCreateNotify((xcb_create_notify_event_t *)event); break; case XCB_MAP_REQUEST: handleMapRequest((xcb_map_request_event_t *)event); break; case XCB_MAP_NOTIFY: handleMapNotify((xcb_map_notify_event_t *)event); break; case XCB_UNMAP_NOTIFY: handleUnmapNotify((xcb_unmap_notify_event_t *)event); break; case XCB_REPARENT_NOTIFY: handleReparentNotify((xcb_reparent_notify_event_t *)event); break; case XCB_CONFIGURE_REQUEST: handleConfigureRequest((xcb_configure_request_event_t *)event); break; case XCB_CONFIGURE_NOTIFY: handleConfigureNotify((xcb_configure_notify_event_t *)event); break; case XCB_DESTROY_NOTIFY: handleDestroyNotify((xcb_destroy_notify_event_t *)event); break; case XCB_MAPPING_NOTIFY: break; case XCB_PROPERTY_NOTIFY: handlePropertyNotify((xcb_property_notify_event_t *)event); break; case XCB_CLIENT_MESSAGE: handleClientMessage((xcb_client_message_event_t *)event); break; default: break; } free(event); } xcb_flush(Xcb::connection()); }