diff options
Diffstat (limited to 'textscreen/txt_desktop.h')
-rw-r--r-- | textscreen/txt_desktop.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/textscreen/txt_desktop.h b/textscreen/txt_desktop.h index 8d4726e5..f98d4627 100644 --- a/textscreen/txt_desktop.h +++ b/textscreen/txt_desktop.h @@ -30,6 +30,8 @@ #include "txt_window.h" +typedef void (*TxtIdleCallback)(void *user_data); + void TXT_AddDesktopWindow(txt_window_t *win); void TXT_RemoveDesktopWindow(txt_window_t *win); void TXT_DrawDesktop(void); @@ -73,6 +75,41 @@ void TXT_GUIMainLoop(void); txt_window_t *TXT_GetActiveWindow(void); -#endif /* #ifndef TXT_DESKTOP_H */ +/** + * Set a callback function to be invoked periodically by the main + * loop code. + * + * @param callback The callback to invoke, or NULL to cancel + * an existing callback. + * @param user_data Extra data to pass to the callback. + * @param period Maximum time between invoking each callback. + * eg. a value of 200 will cause the callback + * to be invoked at least once every 200ms. + */ +void TXT_SetPeriodicCallback(TxtIdleCallback callback, + void *user_data, + unsigned int period); + +/** + * Raise the z-position of the given window relative to other windows. + * + * @param window The window to raise. + * @return Non-zero if the window was raised successfully, + * or zero if the window could not be raised further. + */ + +int TXT_RaiseWindow(txt_window_t *window); + +/** + * Lower the z-position of the given window relative to other windows. + * + * @param window The window to make inactive. + * @return Non-zero if the window was lowered successfully, + * or zero if the window could not be lowered further. + */ + +int TXT_LowerWindow(txt_window_t *window); + +#endif /* #ifndef TXT_DESKTOP_H */ |