mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 14:35:59 +01:00
Scroll and click event callbacks defined
Two callbacks for "scroll" and "click" events has been defined and connected to the view.
This commit is contained in:
parent
e5afcbd01e
commit
8394bd8dcc
1 changed files with 17 additions and 2 deletions
15
zathura.c
15
zathura.c
|
@ -339,6 +339,8 @@ gboolean cb_inputbar_activate(GtkEntry*, gpointer);
|
||||||
gboolean cb_inputbar_form_activate(GtkEntry*, gpointer);
|
gboolean cb_inputbar_form_activate(GtkEntry*, gpointer);
|
||||||
gboolean cb_view_kb_pressed(GtkWidget*, GdkEventKey*, gpointer);
|
gboolean cb_view_kb_pressed(GtkWidget*, GdkEventKey*, gpointer);
|
||||||
gboolean cb_view_resized(GtkWidget*, GtkAllocation*, gpointer);
|
gboolean cb_view_resized(GtkWidget*, GtkAllocation*, gpointer);
|
||||||
|
gboolean cb_view_button_pressed(GtkWidget*, GdkEventButton*, gpointer);
|
||||||
|
gboolean cb_view_scrolled(GtkWidget*, GdkEventScroll*, gpointer);
|
||||||
|
|
||||||
/* configuration */
|
/* configuration */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -447,6 +449,8 @@ init_zathura()
|
||||||
/* view */
|
/* view */
|
||||||
g_signal_connect(G_OBJECT(Zathura.UI.view), "key-press-event", G_CALLBACK(cb_view_kb_pressed), NULL);
|
g_signal_connect(G_OBJECT(Zathura.UI.view), "key-press-event", G_CALLBACK(cb_view_kb_pressed), NULL);
|
||||||
g_signal_connect(G_OBJECT(Zathura.UI.view), "size-allocate", G_CALLBACK(cb_view_resized), NULL);
|
g_signal_connect(G_OBJECT(Zathura.UI.view), "size-allocate", G_CALLBACK(cb_view_resized), NULL);
|
||||||
|
g_signal_connect(G_OBJECT(Zathura.UI.view), "button-press-event", G_CALLBACK(cb_view_button_pressed), NULL);
|
||||||
|
g_signal_connect(G_OBJECT(Zathura.UI.view), "scroll-event", G_CALLBACK(cb_view_scrolled), NULL);
|
||||||
gtk_container_add(GTK_CONTAINER(Zathura.UI.view), GTK_WIDGET(Zathura.UI.viewport));
|
gtk_container_add(GTK_CONTAINER(Zathura.UI.view), GTK_WIDGET(Zathura.UI.viewport));
|
||||||
gtk_viewport_set_shadow_type(Zathura.UI.viewport, GTK_SHADOW_NONE);
|
gtk_viewport_set_shadow_type(Zathura.UI.viewport, GTK_SHADOW_NONE);
|
||||||
|
|
||||||
|
@ -3061,6 +3065,17 @@ cb_view_resized(GtkWidget* widget, GtkAllocation* allocation, gpointer data)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cb_view_button_pressed(GtkWidget* widget, GdkEventButton* event, gpointer data)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cb_view_scrolled(GtkWidget* widget, GdkEventScroll* event, gpointer data)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* main function */
|
/* main function */
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
|
|
Loading…
Reference in a new issue