void Resource::open(const ustring & filename) { mytemplatefile = filename; url_structure = resource_url_get (resource_get_url_constructor(filename), mytemplatefile); book_renderer = resource_get_books(filename); book_renderer2 = resource_get_books2(filename); homepage = resource_url_get(resource_get_home_page(filename), mytemplatefile); focus(); }
void QOpenKODEWindow::lower() { if (!m_kdWindow) return; KDboolean focus(false); if (kdSetWindowPropertybv(m_kdWindow, KD_WINDOWPROPERTY_FOCUS, &focus)) { qErrnoWarning(kdGetError(), "Could not set focus"); } }
void view(View *ov, int index) { Monitor *cm, *om; Client *c; View *cv; if (!ov) { EPRINTF("Null view pointer.\n"); return; } if (0 > index || index >= scr->ntags) { XPRINTF("WARNING: bad index %d\n", index); return; } if (ov->index == index) { XPRINTF("WARNING: view already index %d\n", index); return; } if (!(cm = ov->curmon)) { XPRINTF("WARNING: view %d has no monitor\n", ov->index); return; } XPRINTF("VIEW: disassociating monitor %d from view %d\n", cm->num, ov->index); ov->curmon = NULL; XPRINTF("VIEW: setting previous view for monitor %d to view %d\n", cm->num, ov->index); cm->preview = ov; XPRINTF("VIEW: new view is %d\n", index); cv = scr->views + index; XPRINTF("VIEW: associating monitor %d with view %d\n", cm->num, cv->index); cv->curmon = cm; XPRINTF("VIEW: associating view %d with monitor %d\n", cv->index, cm->num); cm->curview = cv; for (om = scr->monitors; om; om = om->next) { if (om == cm) continue; if (om->curview == cv) { XPRINTF("VIEW: switching monitor %d from view %d to %d\n", om->num, om->curview->index, ov->index); om->curview = ov; ov->curmon = om; updategeom(om); XPRINTF("VIEW: arranging view %d\n", ov->index); arrange(ov); /* only one can match */ break; } } updategeom(cm); XPRINTF("VIEW: arranging view %d\n", cv->index); arrange(cv); c = lastselected(cv); focus(c); focuslockclient(c); ewmh_update_net_current_desktop(); }
//----------------------------------------------------------------------- // o n M o u s e D o w n //----------------------------------------------------------------------- void TGButton::onMouseDown(int x, int y, int b) { focus(); if (b == LeftButton) { setMouseTrackingControl(this); m_pushed = true; redraw(); } }
/* zpracuje udalost predani focusu, vola focus() */ void ArchiveViewer::focusInEvent(QFocusEvent *) { emit(focused()); if(model()){ if(selectedIndexes().empty()){ // na zacatku QPersistentModelIndex sel_idx = indexAt(QPoint(0, 0)); setCurrentIndex(sel_idx); } } focus(); }
void Il2cfgSuifPass::do_file_block(FileBlock *fb) { claim(has_note(fb, k_target_lib), "expected target_lib annotation on file block"); focus(fb); il2cfg.initialize(); }
/** * Adds a new client with some basic initial state. */ void ClientModel::add_client(Window client, InitialState state, Dimension2D location, Dimension2D size, bool autofocus) { if (DIM2D_WIDTH(size) <= 0 || DIM2D_HEIGHT(size) <= 0) return; // Special care is given to honor the initial state, since it is // mandated by the ICCCM switch (state) { case IS_VISIBLE: m_desktops.add_member(m_current_desktop, client); m_changes.push(new ChangeClientDesktop(client, 0, m_current_desktop)); break; case IS_HIDDEN: m_desktops.add_member(ICON_DESKTOP, client); m_changes.push(new ChangeClientDesktop(client, 0, ICON_DESKTOP)); break; } m_layers.add_member(DEF_LAYER, client); m_changes.push(new ChangeLayer(client, DEF_LAYER)); // Since the size and locations are already current, don't put out // an event now that they're set m_location[client] = location; m_size[client] = size; m_cps_mode[client] = CPS_FLOATING; Crt *current_screen = m_crt_manager.screen_of_coord(DIM2D_X(location), DIM2D_Y(location)); if (!current_screen) { // No monitor ever contains a negative screen const Box invalid_box(-1, -1, 0, 0); m_screen.insert(std::pair<Window, const Box>(client, invalid_box)); } else { const Box &screen_box = m_crt_manager.box_of_screen(current_screen); m_screen.insert(std::pair<Window, const Box>(client, screen_box)); } if (autofocus) { m_current_desktop->focus_cycle.add(client); set_autofocus(client, true); focus(client); } else set_autofocus(client, false); m_children[client] = new std::set<Window>(); }
void palette_manager::handle_event(const SDL_Event& event) { gui::widget::handle_event(event); if (event.type == SDL_MOUSEMOTION) { // If the mouse is inside the palette, give it focus. if (sdl::point_in_rect(event.button.x, event.button.y, location())) { if (!focus(&event)) set_focus(true); } // If the mouse is outside, remove focus. else if (focus(&event)) set_focus(false); } if (!focus(&event)) { return; } const SDL_MouseButtonEvent &mouse_button_event = event.button; if (event.type == SDL_MOUSEWHEEL) { if (event.wheel.y > 0) { scroll_up(); } else if (event.wheel.y < 0) { scroll_down(); } if (event.wheel.x < 0) { active_palette().prev_group(); scroll_top(); } else if (event.wheel.x > 0) { active_palette().next_group(); scroll_top(); } } if (mouse_button_event.type == SDL_MOUSEBUTTONUP) { //set_dirty(true); // draw(true); // set_dirty(active_palette().mouse_click()); // gui_.invalidate_game_status(); } }
/** * Handles an existing client that was unmapped, and is now being re-mapped. */ void ClientModel::remap_client(Window client) { if (!is_client(client)) return; std::vector<Window> children; get_children_of(client, children); Desktop *desktop = find_desktop(client); if (desktop->is_user_desktop()) { UserDesktop *user_desktop = dynamic_cast<UserDesktop*>(desktop); user_desktop->focus_cycle.add(client); for (std::vector<Window>::iterator child = children.begin(); child != children.end(); child++) { user_desktop->focus_cycle.add(*child); } focus(client); } else if (desktop->is_all_desktop()) { AllDesktops *all_desktop = dynamic_cast<AllDesktops*>(ALL_DESKTOPS); all_desktop->focus_cycle.add(client); for (std::vector<Window>::iterator child = children.begin(); child != children.end(); child++) { all_desktop->focus_cycle.add(*child); } focus(client); } // The event processor also needs to know that it should update the current // layering, since the window could have been raised since it was remapped Layer current_layer = m_layers.get_category_of(client); m_changes.push(new ChangeLayer(client, current_layer)); }
void M2aSuifPass::do_file_block(FileBlock* fb) { debug(2, "Processing file %s", get_name(fb).chars()); claim(has_note(fb, k_target_lib), "expected target_lib annotation on file block"); focus(fb); m2a.do_file_block(fb); }
void WebAppBase::relaunch(const char* args, const char* launchingAppId, const char* launchingProcId) { bool ret = false; if (m_page) ret = m_page->relaunch(args, launchingAppId, launchingProcId); if (!ret && isWindowed()) { // relaunch failed. if windowed, bring window to foreground focus(); } }
void CWebKitActiveScroller::FinishCreate() { if(debug) printf("CWebKitActiveScroller::FinishCreate()\n"); StFocusAndClipIfHidden focus(mControlPane); WindowPtr macWindowP = mControlPane->GetMacWindow(); HIRect cgr; if (macWindowP == nil) { if(debug) printf("macWindowP is nil...\n"); macWindowP = UQDGlobals::GetCurrentWindowPort(); } // Check if there is a root control // ControlHandle rootControl; OSErr err = ::GetRootControl(macWindowP, &rootControl); if(debug) printf("Defined the Window control in 'rootControl'\n"); HIViewRef viewRef = NULL; if(debug) printf("Create the HiWebView\n"); OSStatus status = ::CreateHIWebView(&viewRef); // Get the current Bounds... HIViewGetBounds(rootControl, &cgr); if(debug) { printf("Actual windows rect: height=%f, width=%f, origin_x=%f, origin_y=%f\n", cgr.size.height, cgr.size.width, cgr.origin.x, cgr.origin.y); } // cgr.origin.x=0.0; // cgr.origin.y=0.0; HIViewSetFrame( viewRef, &cgr ); // HIViewMoveBy(viewRef, -10000, 10000); if (status != noErr) throw "HIWebViewCreate failed"; // the rootControl is the Windows that have to contain the Views. But // status = ::HIViewAddSubview(rootControl, viewRef); if (status != noErr) throw "HIWebViewCreate failed"; }
void focused_write(int wid, const char *buf) { (void) wid; errno = 0; long id = strtol(buf, NULL, 16); int errsv = errno; if ( errsv ) { syslog(LOG_ERR, "failed to parse id to focus in %s: %s\n", __func__, strerror(errsv)); } focus(id); }
void attach(Arg *arg) { Client *c; for(c = clients; c && c->view == view; c = c->next); if(!c) return; c->view = !c->view; pop(c); focus(c); arrange(); }
void tagonly(Client *c, int index) { if (!c) return; if (!c->can.tag && c->is.managed) return; if (with_transients(c, &_tagonly, index)) { arrangeneeded(); focus(sel); } }
void test_all_coordinates_should_be_mapped_in_the_visual_area() { sc::gra::Focus focus( m_xResolution, m_yResolution ); sc::phi::Coordinate outsideMinusXMinusY{ -100.0, -1.0 }; sc::phi::Coordinate outsidePlusXPlusY{ 2.0 * m_xResolution, 1.5 * m_yResolution }; focus.inFocus( outsideMinusXMinusY ); focus.inFocus( outsidePlusXPlusY ); focus.updateFocus(); TS_ASSERT( isInsideVisibleArea( focus.mapCoordinate( outsideMinusXMinusY ) ) ); TS_ASSERT( isInsideVisibleArea( focus.mapCoordinate( outsidePlusXPlusY ) ) ); }
void HTMLElementImp::handleClick(events::Event event) { events::MouseEvent mouse = interface_cast<events::MouseEvent>(event); switch (mouse.getButton()) { case 0: moveX = mouse.getScreenX(); moveY = mouse.getScreenY(); focus(); break; default: break; } }
void focusnext(Arg *arg) { Client *c; if(!sel) return; if(!(c = getnext(sel->next))) c = getnext(clients); if(c) { focus(c); restack(); } }
void tilemovemouse(const Arg *arg) { /* Could EnterNotify events be used instead? */ Client *c, *d; Monitor *m; XEvent ev; int x, y; Bool after; if(!(c = selmon->sel)) return; if((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { sendmon(c, m); selmon = m; focus(NULL); } if(c->isfloating || !selmon->lt[selmon->sellt]->arrange){ movemouse(NULL); return; } if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, cursor[CurMove], CurrentTime) != GrabSuccess) return; do { XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); switch (ev.type) { case ConfigureRequest: case Expose: case MapRequest: handler[ev.type](&ev); break; case MotionNotify: x = ev.xmotion.x; y = ev.xmotion.y; after = False; for(d = nexttiled(m->clients); d; d = nexttiled(d->next)){ if(d == c) after = True; else if(INRECT(x, y, d->x, d->y, d->w+2*borderpx, d->h+2*borderpx)){ detach(c); after ? insertafter(c, d) : insertbefore(c,d); arrange(c->mon); break; } } } } while(ev.type != ButtonRelease); XUngrabPointer(dpy, CurrentTime); }
static void focusurgent(const Arg *arg) { Client *c; int i; for(c=selmon->cl->clients; c && !c->isurgent; c=c->next); if(c) { for(i=0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); if(i < LENGTH(tags)) { const Arg a = {.ui = 1 << i}; view(&a); focus(c); } } }
void SkyMap::keyReleaseEvent( QKeyEvent *e ) { switch ( e->key() ) { case Qt::Key_Plus: //Zoom in case Qt::Key_Equal: case Qt::Key_Minus: //Zoom out case Qt::Key_Underscore: case Qt::Key_Left : //no break; continue to Qt::Key_Down case Qt::Key_Right : //no break; continue to Qt::Key_Down case Qt::Key_Up : //no break; continue to Qt::Key_Down case Qt::Key_Down : slewing = false; if ( Options::useAltAz() ) setDestinationAltAz( focus()->alt(), focus()->az() ); else setDestination( *focus() ); showFocusCoords(); forceUpdate(); // Need a full update to draw faint objects that are not drawn while slewing. break; } }
void manage(Window w, XWindowAttributes *wa) { Client *c, *t; Window trans; c = emallocz(sizeof(Client)); c->win = w; c->x = wa->x; c->y = wa->y; c->w = wa->width; c->h = wa->height; if(c->w == sw && c->h == sh) { c->border = 0; c->x = sx; c->y = sy; } else { c->border = BORDERPX; if(c->x + c->w + 2 * c->border > sx + sw) c->x = sx + sw - c->w - 2 * c->border; if(c->y + c->h + 2 * c->border > sy + sh) c->y = sy + sh - c->h - 2 * c->border; if(c->x < sx) c->x = sx; if(c->y < sy) c->y = sy; } updatesizehints(c); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans); XSetWindowBorder(dpy, c->win, normcol); updatetitle(c); if((t = getclient(trans))) c->view = t->view; else c->view = view; if(clients) clients->prev = c; c->next = clients; c->snext = stack; stack = clients = c; XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); XMapWindow(dpy, c->win); setclientstate(c, NormalState); if(c->view == view) focus(c); arrange(); }
void UIWidget::setFocusable(bool focusable) { if(m_focusable != focusable) { m_focusable = focusable; // make parent focus another child if(UIWidgetPtr parent = getParent()) { if(!focusable && isFocused()) { parent->focusPreviousChild(Fw::ActiveFocusReason, true); } else if(focusable && !parent->getFocusedChild() && parent->getAutoFocusPolicy() != Fw::AutoFocusNone) { focus(); } } } }
void jump(char * markName) { fprintf(stderr, "Finding a node"); Mark *n = NULL; for(n = markTail; n; n = n -> previous) { if (!strcmp(n -> name, markName)) { fprintf(stderr, "Going to focus mark %p", n -> node); unmapNode(viewNode); viewNode = n -> node; placeNode(n -> node, rootX, rootY, rootWidth, rootHeight); focusNode(n -> node, NULL, True, True); while (!isClient(focusedNode)) focus("pc", "1"); } } }
void term() { if(fork() == 0) { if(fork() == 0) { if(dpy) { close(ConnectionNumber(dpy)); } setsid(); execl("/usr/bin/urxvt", "urxvt", 0); } exit(0); } focus(); }
void focusprev(Arg *arg) { Client *c; if(!sel) return; if(!(c = getprev(sel->prev))) { for(c = clients; c && c->next; c = c->next); c = getprev(c); } if(c) { focus(c); restack(); } }
bool KexiView::eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut) {// && o->inherits("QWidget")) { // //hp==true if currently focused widget is a child of this table view // const bool hp = Kexi::hasParent( static_cast<QWidget*>(o), focusWidget()); kDebug() << "this=[" << o->metaObject()->className() << objectName() << "] o=[" << o->metaObject()->className() << o->objectName() << "] focusWidget=[" << (qApp->focusWidget() ? qApp->focusWidget()->metaObject()->className() : QString()) << (qApp->focusWidget() ? qApp->focusWidget()->objectName() : QString()) << "] ev.type=" << e->type(); if (KexiUtils::hasParent(this, o)) { if (e->type() == QEvent::FocusOut && qApp->focusWidget() && !KexiUtils::hasParent(this, qApp->focusWidget())) { //focus out: when currently focused widget is not a parent of this view emit focus(false); } else if (e->type() == QEvent::FocusIn) { emit focus(true); } if (e->type() == QEvent::FocusOut) { // kDebug() << focusWidget()->className() << " " << focusWidget()->name(); // kDebug() << o->className() << " " << o->name(); KexiView *v = KexiUtils::findParent<KexiView*>(o); if (v) { while (v->d->parentView) v = v->d->parentView; if (KexiUtils::hasParent(this, static_cast<QWidget*>(v->focusWidget()))) v->d->lastFocusedChildBeforeFocusOut = static_cast<QWidget*>(v->focusWidget()); } } if (e->type() == QEvent::FocusIn && m_actionProxyParent) { m_actionProxyParent->m_focusedChild = this; } } } return false; }
/** * Stops resizing a window, and fixes its position. */ void ClientModel::stop_resizing(Window client, Dimension2D size) { Desktop* old_desktop = m_desktops.get_category_of(client); if (!old_desktop->is_resizing_desktop()) return; if (m_was_stuck[client]) move_to_desktop(client, ALL_DESKTOPS, false); else move_to_desktop(client, m_current_desktop, false); change_size(client, DIM2D_WIDTH(size), DIM2D_HEIGHT(size)); focus(client); }
/** * Hides the client and moves it onto the icon desktop. */ void ClientModel::deiconify(Window client) { Desktop* old_desktop = m_desktops.get_category_of(client); if (!old_desktop->is_icon_desktop()) return; // If the client was stuck before it was iconified, then respect that // when deiconifying it if (m_was_stuck[client]) move_to_desktop(client, ALL_DESKTOPS, false); else move_to_desktop(client, m_current_desktop, false); focus(client); }
/** * Stops moving a window, and fixes its position. */ void ClientModel::stop_moving(Window client, Dimension2D location) { Desktop* old_desktop = m_desktops.get_category_of(client); if (!old_desktop->is_moving_desktop()) return; if (m_was_stuck[client]) move_to_desktop(client, ALL_DESKTOPS, false); else move_to_desktop(client, m_current_desktop, false); change_location(client, DIM2D_X(location), DIM2D_Y(location)); focus(client); }