summaryrefslogtreecommitdiff
path: root/src/window/window.h
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-10-24 23:56:18 -0500
committersanine-a <sanine.not@pm.me>2020-10-24 23:56:18 -0500
commit9699a814395dd6344c0f2fab1965b8bed30967b2 (patch)
tree3fde9359241fb13cf1f84072c3642e0591ad92e0 /src/window/window.h
parentc2079561359aa6a3f658dd34b1b32dfd0761d730 (diff)
add window focus callback functions
Diffstat (limited to 'src/window/window.h')
-rw-r--r--src/window/window.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/window/window.h b/src/window/window.h
index 7b12156..fae32c1 100644
--- a/src/window/window.h
+++ b/src/window/window.h
@@ -18,6 +18,8 @@ typedef struct {
extern int honey_window_info_ref;
extern int honey_window_resize_callback_ref;
extern int honey_window_resize_callback_data_ref;
+extern int honey_window_focus_callback_ref;
+extern int honey_window_focus_callback_data_ref;
/** @brief Push the various honey.window table to the stack.
*
@@ -74,4 +76,24 @@ int honey_window_resize_bind(lua_State* L);
*/
int honey_window_resize_unbind(lua_State* L);
+/** @brief Bind a callback to the window changing focus.
+ *
+ * The supplied callback function should be of the form
+ * function(boolean, data). The boolean is true if the window
+ * is gaining focus, and false if it is losing focus. The data is
+ * just the data parameter passed to this function.
+ *
+ * @param callback The callback function to call on a window resize.
+ * @param data Data to send to the callback.
+ *
+ * @returns Nothing.
+ */
+int honey_window_focus_bind(lua_State* L);
+
+/** @brief Unbind any callback that may be attached to the window focus.
+ *
+ * @returns Nothing.
+ */
+int honey_window_focus_unbind(lua_State* L);
+
#endif