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); girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL);
/* mouse events */ /* 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, NORMAL, GIRARA_EVENT_SCROLL_UP, 0, NULL);
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL, 0, NULL); girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, 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, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_DOWN, 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, 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, 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, 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); 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 */ /* scroll event */
if (event->type == GIRARA_EVENT_SCROLL) { if (event->type == GIRARA_EVENT_SCROLL_UP) {
switch (event->direction) { argument->n = UP;
case GIRARA_SCROLL_UP: return sc_scroll(session, argument, NULL, t);
argument->n = UP; } else if (event->type == GIRARA_EVENT_SCROLL_DOWN) {
break; argument->n = DOWN;
case GIRARA_SCROLL_DOWN: return sc_scroll(session, argument, NULL, t);
argument->n = DOWN; } else if (event->type == GIRARA_EVENT_SCROLL_LEFT) {
break; argument->n = LEFT;
case GIRARA_SCROLL_LEFT: return sc_scroll(session, argument, NULL, t);
argument->n = LEFT; } else if (event->type == GIRARA_EVENT_SCROLL_RIGHT) {
break; argument->n = RIGHT;
case GIRARA_SCROLL_RIGHT:
argument->n = RIGHT;
break;
}
return sc_scroll(session, argument, NULL, t); return sc_scroll(session, argument, NULL, t);
} else if (event->type == GIRARA_EVENT_BUTTON_PRESS) { } else if (event->type == GIRARA_EVENT_BUTTON_PRESS) {
x = event->x; x = event->x;
@ -257,22 +252,18 @@ sc_mouse_zoom(girara_session_t* session, girara_argument_t* argument, girara_eve
} }
/* scroll event */ /* scroll event */
if (event->type == GIRARA_EVENT_SCROLL) { switch (event->type) {
switch (event->direction) { case GIRARA_EVENT_SCROLL_UP:
case GIRARA_SCROLL_UP: argument->n = ZOOM_IN;
argument->n = ZOOM_IN; break;
break; case GIRARA_EVENT_SCROLL_DOWN:
case GIRARA_SCROLL_DOWN: argument->n = ZOOM_OUT;
argument->n = ZOOM_OUT; break;
break; default:
default: return false;
return false;
}
return sc_zoom(session, argument, NULL, t);
} }
return false; return sc_zoom(session, argument, NULL, t);
} }
bool bool