]> git.sur5r.net Git - i3/i3/blob - include/handlers.h
b4b2c99aa7d803ce874d7ed5d2928f95a271be7b
[i3/i3] / include / handlers.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * (c) 2009 Michael Stapelberg and contributors
7  *
8  * See file LICENSE for license information.
9  *
10  */
11 #ifndef _HANDLERS_H
12 #define _HANDLERS_H
13
14 /**
15  * Due to bindings like Mode_switch + <a>, we need to bind some keys in XCB_GRAB_MODE_SYNC.
16  * Therefore, we just replay all key presses.
17  *
18  */
19 int handle_key_release(void *ignored, xcb_connection_t *conn, xcb_key_release_event_t *event);
20
21 /**
22  * There was a key press. We compare this key code with our bindings table and pass
23  * the bound action to parse_command().
24  *
25  */
26 int handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_press_event_t *event);
27
28 /**
29  * When the user moves the mouse pointer onto a window, this callback gets called.
30  *
31  */
32 int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_event_t *event);
33
34 /**
35  * Checks if the button press was on a stack window, handles focus setting and returns true
36  * if so, or false otherwise.
37  *
38  */
39 int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_event_t *event);
40
41 /**
42  * A new window appeared on the screen (=was mapped), so let’s manage it.
43  *
44  */
45 int handle_map_request(void *prophs, xcb_connection_t *conn, xcb_map_request_event_t *event);
46
47 /**
48  * Configuration notifies are only handled because we need to set up ignore for the following
49  * enter notify events
50  *
51  */
52 int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event);
53
54 /**
55  * Configure requests are received when the application wants to resize windows on their own.
56  *
57  * We generate a synthethic configure notify event to signalize the client its "new" position.
58  *
59  */
60 int handle_configure_request(void *prophs, xcb_connection_t *conn, xcb_configure_request_event_t *event);
61
62 /**
63  * Our window decorations were unmapped. That means, the window will be killed now,
64  * so we better clean up before.
65  *
66  */
67 int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event);
68
69 /**
70  * Called when a window changes its title
71  *
72  */
73 int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
74                              xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop);
75
76 /**
77  * We handle legacy window names (titles) which are in COMPOUND_TEXT encoding. However, we
78  * just pass them along, so when containing non-ASCII characters, those will be rendering
79  * incorrectly. In order to correctly render unicode window titles in i3, an application
80  * has to set _NET_WM_NAME, which is in UTF-8 encoding.
81  *
82  * On every update, a message is put out to the user, so he may improve the situation and
83  * update applications which display filenames in their title to correctly use
84  * _NET_WM_NAME and therefore support unicode.
85  *
86  */
87 int handle_windowname_change_legacy(void *data, xcb_connection_t *conn, uint8_t state,
88                                     xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop);
89
90 /**
91  * Store the window classes for jumping to them later.
92  *
93  */
94 int handle_windowclass_change(void *data, xcb_connection_t *conn, uint8_t state,
95                               xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop);
96
97
98 /**
99  * Expose event means we should redraw our windows (= title bar)
100  *
101  */
102 int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *event);
103
104 /**
105  * Handle client messages (EWMH)
106  *
107  */
108 int handle_client_message(void *data, xcb_connection_t *conn, xcb_client_message_event_t *event);
109
110 /**
111  * Handles _NET_WM_WINDOW_TYPE changes
112  *
113  */
114 int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
115                        xcb_atom_t atom, xcb_get_property_reply_t *property);
116
117 /**
118  * Handles the size hints set by a window, but currently only the part necessary for displaying
119  * clients proportionally inside their frames (mplayer for example)
120  *
121  * See ICCCM 4.1.2.3 for more details
122  *
123  */
124 int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
125                         xcb_atom_t name, xcb_get_property_reply_t *reply);
126
127 /**
128  * Handles the transient for hints set by a window, signalizing that this window is a popup window
129  * for some other window.
130  *
131  * See ICCCM 4.1.2.6 for more details
132  *
133  */
134 int handle_transient_for(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
135                          xcb_atom_t name, xcb_get_property_reply_t *reply);
136
137 #endif