static void tab_panel_popup (GtkWidget* widget, GdkEventButton* event, GtkWidget* view) { GtkWidget* menu = midori_view_get_tab_menu (MIDORI_VIEW (view)); katze_widget_popup (widget, GTK_MENU (menu), event, KATZE_MENU_POSITION_CURSOR); }
static gboolean mouse_gestures_button_release_event_cb (GtkWidget* web_view, GdkEventButton* event, MidoriView* view) { /* All mouse gestures will use this mouse button */ if (gesture->last == gesture->button) { /* The initial horizontal move is between the bounds */ if ((gesture->middle.x - gesture->start.x < DEVIANCE) && (gesture->middle.x - gesture->start.x > -DEVIANCE)) { /* We initially moved down more than MINLENGTH pixels */ if (gesture->middle.y > gesture->start.y + MINLENGTH) { /* Then we the final vertical move is between the bounds and we moved right more than MINLENGTH pixels */ if ((gesture->middle.y - gesture->end.y < DEVIANCE) && (gesture->middle.y - gesture->end.y > -DEVIANCE) && (gesture->end.x > gesture->middle.x + MINLENGTH)) /* We moved down then right: close the tab */ return mouse_gestures_activate_action (view, "TabClose"); /* Then we the final vertical move is between the bounds and we moved left more than MINLENGTH pixels */ else if ((gesture->middle.y - gesture->end.y < DEVIANCE) && (gesture->middle.y - gesture->end.y > -DEVIANCE) && (gesture->end.x + MINLENGTH < gesture->middle.x)) /* We moved down then left: reload */ return mouse_gestures_activate_action (view, "Reload"); /* The end node was never updated, we only did a vertical move */ else if(gesture->end.y == 0 && gesture->end.x == 0) /* We moved down then: create a new tab */ return mouse_gestures_activate_action (view, "TabNew"); } /* We initially moved up more than MINLENGTH pixels */ else if (gesture->middle.y + MINLENGTH < gesture->start.y) { /* The end node was never updated, we only did a vertical move */ if (gesture->end.y == 0 && gesture->end.x == 0) /* We moved up: stop */ return mouse_gestures_activate_action (view, "Stop"); } } /* The initial horizontal move is between the bounds */ else if ((gesture->middle.y - gesture->start.y < DEVIANCE) && (gesture->middle.y - gesture->start.y > -DEVIANCE)) { /* We initially moved right more than MINLENGTH pixels */ if (gesture->middle.x > gesture->start.x + MINLENGTH) { /* The end node was never updated, we only did an horizontal move */ if (gesture->end.x == 0 && gesture->end.y == 0) /* We moved right: forward */ return mouse_gestures_activate_action (view, "Forward"); } /* We initially moved left more than MINLENGTH pixels */ else if (gesture->middle.x + MINLENGTH < gesture->start.x) { /* The end node was never updated, we only did an horizontal move */ if (gesture->end.x == 0 && gesture->end.y == 0) /* We moved left: back */ return mouse_gestures_activate_action (view, "Back"); } } mouse_gesture_clear (gesture); } if (event->button == 3) { GtkWidget* menu = gtk_menu_new (); midori_view_populate_popup (view, menu, TRUE); katze_widget_popup (GTK_WIDGET (web_view), GTK_MENU (menu), event, KATZE_MENU_POSITION_CURSOR); return TRUE; } return FALSE; }