bool Kernel::isNCWMWindow(Window window) { return isRootWindow(window) || #ifdef SLOT_SUPPORT slotWindow(window) || #endif // SLOT_SUPPORT menuWindow(window) || barWindow(window) || boxWindow(window) || thingWindow(window); }
void Kernel::handleButtonPress(XButtonEvent *event) { event->state &= Binder::instance()->validModMask(); if (event->state != 0) { // no AnyModifier, so this seems to be shortcut Binder::instance()->handleButton(event->root, event); return; } Menu *menu = menuWindow(event->window); if (menu) { menu->handleButtonPress(event); return; } Bar *bar = barWindow(event->window); if (bar) { bar->handleButtonPress(event); return; } #ifdef SLOT_SUPPORT Slot *slot = slotWindow(event->window); if (slot) { slot->handleButtonPress(event); return; } #endif Thing *thing = thingWindow(event->window); if (thing) { thing->handleButtonPress(event); } Client *client = clientForWindow(event->window); if (client) { client->handleButtonPress(event); } }
void Kernel::handleExpose(XExposeEvent *event) { Bar *bar = barWindow(event->window); if (bar) { bar->illuminate(); return; } #ifdef SLOT_SUPPORT Slot *slot = slotWindow(event->window); if (slot) { slot->illuminate(); return; } #endif // SLOT_SUPPORT Thing *thing = thingWindow(event->window); if (thing) { thing->illuminate(); } }
void MainWindow::createActions() { if(opt.arg_debug) printf("createActions\n"); if(opt.arg_disable == 0) { optionAct = new QAction(QIcon(":/images/option.png"), l_options, this); #ifndef USE_MAEMO optionAct->setShortcut(tr("Ctrl+O")); #endif optionAct->setStatusTip(l_status_options); connect(optionAct, SIGNAL(triggered()), this, SLOT(slotFileOpt())); } if(opt.arg_disable == 0) { windowAct = new QAction(QIcon(":/images/window.png"), l_new_window, this); windowAct->setShortcut(tr("Ctrl+N")); windowAct->setStatusTip(l_status_new_window); connect(windowAct, SIGNAL(triggered()), this, SLOT(slotWindow())); newtabAct = new QAction(QIcon(":/images/newtab.png"), l_new_tab, this); //newtabAct->setShortcut(tr("Ctrl+N")); newtabAct->setStatusTip(l_status_new_tab); connect(newtabAct, SIGNAL(triggered()), this, SLOT(slotNewTab())); } reconnectAct = new QAction(QIcon(":/images/view-refresh.png"), l_reconnect, this); reconnectAct->setShortcut(tr("Ctrl+R")); reconnectAct->setStatusTip(l_status_reconnect); connect(reconnectAct, SIGNAL(triggered()), this, SLOT(slotReconnect())); storebmpAct = new QAction(QIcon(":/images/storebmp.png"), l_save_as_bmp, this); storebmpAct->setShortcut(tr("Ctrl+B")); storebmpAct->setStatusTip(l_status_save_as_bmp); connect(storebmpAct, SIGNAL(triggered()), this, SLOT(slotStorebmp())); gohomeAct = new QAction(QIcon(":/images/gohome.png"), opt.initialhost, this); gohomeAct->setStatusTip(opt.initialhost); connect(gohomeAct, SIGNAL(triggered()), this, SLOT(slotGohome())); logbmpAct = new QAction(QIcon(":/images/logbmp.png"), l_log_as_bmp, this); logbmpAct->setStatusTip(l_status_log_as_bmp); connect(logbmpAct, SIGNAL(triggered()), this, SLOT(slotLogbmp())); logpvmAct = new QAction(QIcon(":/images/logpvm.png"), l_log_as_pvm, this); logpvmAct->setStatusTip(l_status_log_as_pvm); connect(logpvmAct, SIGNAL(triggered()), this, SLOT(slotLogpvm())); printAct = new QAction(QIcon(":/images/print.png"), l_print, this); printAct->setShortcut(tr("Ctrl+P")); printAct->setStatusTip(l_status_print); connect(printAct, SIGNAL(triggered()), this, SLOT(slotPrint())); newtabActToolBar = new QAction(QIcon(":/images/newtab.png"), l_new_tab, this); newtabActToolBar->setStatusTip(l_status_new_tab); connect(newtabActToolBar, SIGNAL(triggered()), this, SLOT(slotNewTab())); exitAct = new QAction(QIcon(":/images/exit.png"), l_exit, this); exitAct->setShortcut(tr("Ctrl+Q")); exitAct->setStatusTip(l_status_exit); connect(exitAct, SIGNAL(triggered()), this, SLOT(slotExit())); copyAct = new QAction(QIcon(":/images/copy.png"), l_copy, this); copyAct->setShortcut(tr("Ctrl+C")); copyAct->setStatusTip(l_status_copy); connect(copyAct, SIGNAL(triggered()), this, SLOT(slotCopy())); if(opt.arg_disable == 0) { editmenuAct = new QAction(l_editmenu, this); editmenuAct->setShortcut(tr("Ctrl+E")); editmenuAct->setStatusTip(l_status_editmenu); connect(editmenuAct, SIGNAL(triggered()), this, SLOT(slotEditmenu())); addAction(editmenuAct); toolbarAct = new QAction(QIcon(":/images/toolbar.png"), l_toolbar, this); toolbarAct->setShortcut(tr("Ctrl+T")); toolbarAct->setStatusTip(l_status_toolbar); connect(toolbarAct, SIGNAL(triggered()), this, SLOT(slotToolbar())); addAction(toolbarAct); statusbarAct = new QAction(QIcon(":/images/statusbar.png"), l_statusbar, this); statusbarAct->setShortcut(tr("Ctrl+S")); statusbarAct->setStatusTip(l_status_statusbar); connect(statusbarAct, SIGNAL(triggered()), this, SLOT(slotStatusbar())); addAction(statusbarAct); maximizedAct = new QAction(l_maximized, this); maximizedAct->setShortcut(tr("Ctrl+M")); maximizedAct->setStatusTip(l_status_toggle_maximized); connect(maximizedAct, SIGNAL(triggered()), this, SLOT(slotMaximized())); addAction(maximizedAct); fullscreenAct = new QAction(QIcon(":/images/fullscreen.png"), l_fullscreen, this); fullscreenAct->setShortcut(tr("Ctrl+F")); fullscreenAct->setStatusTip(l_status_toggle_full_screen); connect(fullscreenAct, SIGNAL(triggered()), this, SLOT(slotFullscreen())); addAction(fullscreenAct); } manualAct = new QAction(l_manual, this); manualAct->setShortcut(tr("Ctrl+H")); manualAct->setStatusTip(l_status_manual); connect(manualAct, SIGNAL(triggered()), this, SLOT(slotManual())); aboutAct = new QAction(l_about, this); aboutAct->setStatusTip(l_status_about); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); aboutQtAct = new QAction("About &Qt", this); aboutQtAct->setStatusTip("About Qt library"); connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); logoAct = new QAction(QIcon(":/images/app.png"),"pvbrowser", this); logoAct->setStatusTip(tr("About pvbrowser")); connect(logoAct, SIGNAL(triggered()), this, SLOT(about())); }