diff options
author | Simon Howard | 2011-09-18 14:16:27 +0000 |
---|---|---|
committer | Simon Howard | 2011-09-18 14:16:27 +0000 |
commit | 96f7da6adf5d4b6eb7b6ab66bd1758a2b14d1efa (patch) | |
tree | 4ae7dd32a8ce3da3f44c67b31c12b1ea242dad62 /textscreen/txt_desktop.c | |
parent | 4dc7b33e17069c6559e9b1b7cc1ecd878162f629 (diff) | |
download | chocolate-doom-96f7da6adf5d4b6eb7b6ab66bd1758a2b14d1efa.tar.gz chocolate-doom-96f7da6adf5d4b6eb7b6ab66bd1758a2b14d1efa.tar.bz2 chocolate-doom-96f7da6adf5d4b6eb7b6ab66bd1758a2b14d1efa.zip |
Hook query code into setup tool, and add search results window.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2383
Diffstat (limited to 'textscreen/txt_desktop.c')
-rw-r--r-- | textscreen/txt_desktop.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/textscreen/txt_desktop.c b/textscreen/txt_desktop.c index c497f0e3..31c3921e 100644 --- a/textscreen/txt_desktop.c +++ b/textscreen/txt_desktop.c @@ -39,6 +39,10 @@ static txt_window_t *all_windows[MAXWINDOWS]; static int num_windows = 0; static int main_loop_running = 0; +static TxtIdleCallback periodic_callback = NULL; +static void *periodic_callback_data; +static unsigned int periodic_callback_period; + void TXT_AddDesktopWindow(txt_window_t *win) { all_windows[num_windows] = win; @@ -197,6 +201,15 @@ void TXT_DrawASCIITable(void) TXT_UpdateScreen(); } +void TXT_SetPeriodicCallback(TxtIdleCallback callback, + void *user_data, + unsigned int period) +{ + periodic_callback = callback; + periodic_callback_data = user_data; + periodic_callback_period = period; +} + void TXT_GUIMainLoop(void) { main_loop_running = 1; @@ -211,10 +224,20 @@ void TXT_GUIMainLoop(void) { TXT_ExitMainLoop(); } - + TXT_DrawDesktop(); // TXT_DrawASCIITable(); - TXT_Sleep(0); + + if (periodic_callback == NULL) + { + TXT_Sleep(0); + } + else + { + TXT_Sleep(periodic_callback_period); + + periodic_callback(periodic_callback_data); + } } } |