Update to new girara event definitions

This commit is contained in:
Moritz Lipp 2012-02-15 00:21:51 +01:00
parent fc2e97e917
commit b815fa6ecf
2 changed files with 29 additions and 34 deletions

View file

@ -169,10 +169,14 @@ config_load_default(zathura_t* zathura)
girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL);
/* mouse events */
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, NORMAL, GIRARA_EVENT_SCROLL, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, FULLSCREEN, GIRARA_EVENT_SCROLL, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_DOWN, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_DOWN, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, NORMAL, GIRARA_EVENT_SCROLL_UP, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, NORMAL, GIRARA_EVENT_SCROLL_DOWN, 0, NULL);
girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, FULLSCREEN, GIRARA_EVENT_SCROLL_DOWN, 0, NULL);
girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, NORMAL, GIRARA_EVENT_BUTTON_PRESS, 0, NULL);
girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, NORMAL, GIRARA_EVENT_BUTTON_RELEASE, 0, NULL);
girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_MOTION_NOTIFY, 0, NULL);

View file

@ -200,22 +200,17 @@ sc_mouse_scroll(girara_session_t* session, girara_argument_t* argument, girara_e
}
/* scroll event */
if (event->type == GIRARA_EVENT_SCROLL) {
switch (event->direction) {
case GIRARA_SCROLL_UP:
argument->n = UP;
break;
case GIRARA_SCROLL_DOWN:
argument->n = DOWN;
break;
case GIRARA_SCROLL_LEFT:
argument->n = LEFT;
break;
case GIRARA_SCROLL_RIGHT:
argument->n = RIGHT;
break;
}
if (event->type == GIRARA_EVENT_SCROLL_UP) {
argument->n = UP;
return sc_scroll(session, argument, NULL, t);
} else if (event->type == GIRARA_EVENT_SCROLL_DOWN) {
argument->n = DOWN;
return sc_scroll(session, argument, NULL, t);
} else if (event->type == GIRARA_EVENT_SCROLL_LEFT) {
argument->n = LEFT;
return sc_scroll(session, argument, NULL, t);
} else if (event->type == GIRARA_EVENT_SCROLL_RIGHT) {
argument->n = RIGHT;
return sc_scroll(session, argument, NULL, t);
} else if (event->type == GIRARA_EVENT_BUTTON_PRESS) {
x = event->x;
@ -257,22 +252,18 @@ sc_mouse_zoom(girara_session_t* session, girara_argument_t* argument, girara_eve
}
/* scroll event */
if (event->type == GIRARA_EVENT_SCROLL) {
switch (event->direction) {
case GIRARA_SCROLL_UP:
argument->n = ZOOM_IN;
break;
case GIRARA_SCROLL_DOWN:
argument->n = ZOOM_OUT;
break;
default:
return false;
}
return sc_zoom(session, argument, NULL, t);
switch (event->type) {
case GIRARA_EVENT_SCROLL_UP:
argument->n = ZOOM_IN;
break;
case GIRARA_EVENT_SCROLL_DOWN:
argument->n = ZOOM_OUT;
break;
default:
return false;
}
return false;
return sc_zoom(session, argument, NULL, t);
}
bool