mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-27 14:06:00 +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
bb774d8c4f
commit
6b852bec6d
1 changed files with 17 additions and 2 deletions
19
zathura.c
19
zathura.c
|
@ -355,6 +355,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"
|
||||||
|
@ -466,8 +468,10 @@ init_zathura()
|
||||||
gtk_box_set_spacing(Zathura.UI.continuous, 5);
|
gtk_box_set_spacing(Zathura.UI.continuous, 5);
|
||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
|
@ -3304,6 +3308,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