Beispiel #1
0
void WindowManager::manageNextWindow() {
    if (!m_nextWindow) {
        return;
    }

    switch (m_nextAction) {
        case NextWindowAction::Replace: {
            popWindow();
            pushWindow(m_nextWindow);
            break;
        }
        case NextWindowAction::ReplaceAll: {
            for (Window* win : m_windows) {
                removeWindow(win);
            }
            m_windows.clear();

            pushWindow(m_nextWindow);
            break;
        }
        case NextWindowAction::None:
        default:
            LOG(ERROR) << "Invalid window action for next window" << std::endl;
            break;
    }
    m_nextWindow = nullptr;
    m_nextAction = NextWindowAction::None;
}
Beispiel #2
0
int resetWindows(DictionaryIterator *rdi) {
  MyWindow *mw;
  int rh;
  objects *tmpWindows;
  APP_LOG(APP_LOG_LEVEL_DEBUG, "resetWindows");
  
  // Doesn't currently work once windows exist.
  if (myWindows != NULL) {
    return 0;
  }
  
  tmpWindows = myWindows;
  myWindows = NULL;
  
  APP_LOG(APP_LOG_LEVEL_DEBUG, "About to create windows structure.");
  myWindows = createObjects(MyWindowDestructor);
  
  APP_LOG(APP_LOG_LEVEL_DEBUG, "objects created. ");
  // Need to create a window to keep the app from
  // exiting, so we might as well make it available.
  rh = allocWindow(NULL);
  APP_LOG(APP_LOG_LEVEL_DEBUG, "root window handle = %d", rh);
  if (rh != 0) {
    APP_LOG(APP_LOG_LEVEL_ERROR, "Root window handle %d != 0", rh);
  }
  mw = getWindowByHandle(rh);
  if (mw == NULL) {
    APP_LOG(APP_LOG_LEVEL_ERROR, "Root window null");
  }
  
  pushWindow(mw, rdi);
  
  if (tmpWindows) {
    freeObjects(tmpWindows);
  }

  return 0;
}