callbacks.h 3.8 KB
Newer Older
Sebastian Ramacher's avatar
Sebastian Ramacher committed
1 2 3 4 5 6 7 8
/* See LICENSE file for license and copyright information */

#ifndef GIRARA_CALLBACKS_H
#define GIRARA_CALLBACKS_H

#include "types.h"
#include <gtk/gtk.h>

9 10 11 12 13 14
/**
 * Callback definition for an inputbar key press event handler
 *
 * @param widget The widget
 * @param event Event
 * @param data Custom data
15
 * @return true if no error occurred
16
 */
17
typedef gboolean (*girara_callback_inputbar_key_press_event_t)(GtkWidget* widget,
Moritz Lipp's avatar
Moritz Lipp committed
18
    GdkEventKey* event, void* data);
19 20 21 22 23 24

/**
 * Callback definition for an inputbar key press event handler
 *
 * @param entry The inputbar
 * @param data Custom data
25
 * @return true if no error occurred
26
 */
27
typedef gboolean (*girara_callback_inputbar_activate_t)(GtkEntry* entry,
Moritz Lipp's avatar
Moritz Lipp committed
28
    void* data);
Moritz Lipp's avatar
Moritz Lipp committed
29

Sebastian Ramacher's avatar
Sebastian Ramacher committed
30 31 32 33
/**
 * Default callback for key press events in the view area
 *
 * @param widget The used widget
34
 * @param event The occurred event
Sebastian Ramacher's avatar
Sebastian Ramacher committed
35
 * @param session The used girara session
36 37
 * @return TRUE No error occurred
 * @return FALSE An error occurred
Sebastian Ramacher's avatar
Sebastian Ramacher committed
38
 */
39
gboolean girara_callback_view_key_press_event(GtkWidget* widget, GdkEventKey* event,
Moritz Lipp's avatar
Moritz Lipp committed
40
    girara_session_t* session);
Sebastian Ramacher's avatar
Sebastian Ramacher committed
41

42 43 44 45 46 47 48 49 50
/**
 * Default callback when a button (typically a mouse button) has been pressed
 *
 * @param widget The used widget
 * @param button The button that triggered the event
 * @param session The used girara session
 * @return true to stop other handlers from being invoked for the event.
 * @return false to propagate the event further.
 */
51
gboolean girara_callback_view_button_press_event(GtkWidget* widget,
Moritz Lipp's avatar
Moritz Lipp committed
52
    GdkEventButton* button, girara_session_t* session);
53 54 55 56 57 58 59 60 61 62

/**
 * Default callback when a button (typically a mouse button) has been released
 *
 * @param widget The used widget
 * @param button The button that triggered the event
 * @param session The used girara session
 * @return true to stop other handlers from being invoked for the event.
 * @return false to propagate the event further.
 */
63
gboolean girara_callback_view_button_release_event(GtkWidget* widget,
Moritz Lipp's avatar
Moritz Lipp committed
64
    GdkEventButton* button, girara_session_t* session);
65 66 67 68 69 70 71 72 73 74

/**
 * Default callback when the pointer moves over the widget
 *
 * @param widget The used widget
 * @param button The event motion that triggered the event
 * @param session The used girara session
 * @return true to stop other handlers from being invoked for the event.
 * @return false to propagate the event further.
 */
75
gboolean girara_callback_view_button_motion_notify_event(GtkWidget* widget,
Moritz Lipp's avatar
Moritz Lipp committed
76
    GdkEventMotion* button, girara_session_t* session);
77

78 79 80 81 82 83 84 85 86
/**
 * Default callback then a scroll event is triggered by the view
 *
 * @param widget The widget
 * @param event The event motion
 * @param session The girara session
 * @return true to stop other handlers from being invoked for the event.
 * @return false to propagate the event further.
 */
87
gboolean girara_callback_view_scroll_event(GtkWidget* widget, GdkEventScroll* event,
Moritz Lipp's avatar
Moritz Lipp committed
88
    girara_session_t* session);
89

Sebastian Ramacher's avatar
Sebastian Ramacher committed
90 91 92 93 94
/**
 * Default callback if the inputbar gets activated
 *
 * @param entry The inputbar entry
 * @param session The used girara session
95 96
 * @return TRUE No error occurred
 * @return FALSE An error occurred
Sebastian Ramacher's avatar
Sebastian Ramacher committed
97
 */
98
gboolean girara_callback_inputbar_activate(GtkEntry* entry,
Moritz Lipp's avatar
Moritz Lipp committed
99
    girara_session_t* session);
Sebastian Ramacher's avatar
Sebastian Ramacher committed
100 101 102 103 104

/**
 * Default callback if an key in the input bar gets pressed
 *
 * @param widget The used widget
105
 * @param event The occurred event
Sebastian Ramacher's avatar
Sebastian Ramacher committed
106
 * @param session The used girara session
107 108
 * @return TRUE No error occurred
 * @return FALSE An error occurred
Sebastian Ramacher's avatar
Sebastian Ramacher committed
109
 */
110
gboolean girara_callback_inputbar_key_press_event(GtkWidget* widget,
Moritz Lipp's avatar
Moritz Lipp committed
111
    GdkEventKey* event, girara_session_t* session);
Sebastian Ramacher's avatar
Sebastian Ramacher committed
112

113 114 115 116 117
/**
 * Default callback if the text of the input bar has changed
 *
 * @param widget The used widget
 * @param session The used girara session
118 119
 * @return TRUE No error occurred
 * @return FALSE An error occurred
120
 */
121
gboolean girara_callback_inputbar_changed_event(GtkEditable* widget,
Moritz Lipp's avatar
Moritz Lipp committed
122
    girara_session_t* session);
123

Sebastian Ramacher's avatar
Sebastian Ramacher committed
124
#endif