nkeynes@435: /** nkeynes@561: * $Id$ nkeynes@435: * nkeynes@435: * Public GUI declarations (used from elsewhere in the system) nkeynes@435: * nkeynes@435: * Copyright (c) 2005 Nathan Keynes. nkeynes@435: * nkeynes@435: * This program is free software; you can redistribute it and/or modify nkeynes@435: * it under the terms of the GNU General Public License as published by nkeynes@435: * the Free Software Foundation; either version 2 of the License, or nkeynes@435: * (at your option) any later version. nkeynes@435: * nkeynes@435: * This program is distributed in the hope that it will be useful, nkeynes@435: * but WITHOUT ANY WARRANTY; without even the implied warranty of nkeynes@435: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nkeynes@435: * GNU General Public License for more details. nkeynes@435: */ nkeynes@435: nkeynes@736: #ifndef lxdream_gui_H nkeynes@736: #define lxdream_gui_H nkeynes@435: nkeynes@435: #include nkeynes@435: nkeynes@736: #ifdef __cplusplus nkeynes@736: extern "C" { nkeynes@736: #endif nkeynes@736: nkeynes@678: /* Base GUI clock is 10ms */ nkeynes@678: #define GUI_TICK_PERIOD 10000000 nkeynes@678: nkeynes@435: /** nkeynes@435: * GUI-provided method to scan the command line for standard arguments, nkeynes@435: * invoked prior to regular command line processing. The command line nkeynes@435: * is modified to remove any arguments handled by the UI. nkeynes@435: * @return TRUE on success, FALSE on failure. nkeynes@435: */ nkeynes@435: gboolean gui_parse_cmdline( int *argc, char **argv[] ); nkeynes@435: nkeynes@435: /** nkeynes@435: * Initialize the GUI system and create any windows needed. This method nkeynes@435: * should also register the GUI module with the module manager (if the nkeynes@435: * GUI has one). nkeynes@435: * nkeynes@435: * @param debug TRUE if the system should start in debugging mode. nkeynes@1015: * @param fullscreen TRUE if the system should start in fullscreen mode. nkeynes@435: */ nkeynes@1015: gboolean gui_init( gboolean debug, gboolean fullscreen ); nkeynes@435: nkeynes@435: /** nkeynes@435: * Enter the GUI main loop. If this method ever returns, the system will nkeynes@435: * exit normally. nkeynes@681: * nkeynes@681: * @param run TRUE if the system should start running immediately, otherwise nkeynes@435: */ nkeynes@681: void gui_main_loop( gboolean run ); nkeynes@435: nkeynes@447: gboolean gui_error_dialog( const char *fmt, ... ); nkeynes@447: nkeynes@435: typedef enum { IO_IDE, IO_NETWORK } io_activity_type; nkeynes@435: nkeynes@435: /** nkeynes@545: * Notify the GUI of state changes (eg binary was loaded and PC changed) nkeynes@545: */ nkeynes@545: void gui_update_state(); nkeynes@545: nkeynes@545: /** nkeynes@839: * Notify the GUI to enable/disable mouse grabs according to the flag value. nkeynes@839: * If the parameter is FALSE and the grab is currently active, the GUI should nkeynes@839: * immediately cancel the grab. nkeynes@839: */ nkeynes@839: void gui_set_use_grab( gboolean grab ); nkeynes@839: nkeynes@839: /** nkeynes@435: * Notify the GUI of I/O activity. nkeynes@435: * @param activity the type of IO activity being reported. nkeynes@435: * @param active TRUE if the I/O device is becoming active, FALSE if inactive. nkeynes@435: */ nkeynes@435: void gui_update_io_activity( io_activity_type activity, gboolean active ); nkeynes@435: nkeynes@1019: typedef void (*do_later_callback_t)(void); nkeynes@1015: /** nkeynes@1019: * Queue an event to call a function at the next opportunity (used to nkeynes@1019: * avoid invoking eg dreamcast_run directly from the middle of other processing). nkeynes@1015: */ nkeynes@1019: void gui_do_later( do_later_callback_t func ); nkeynes@1015: nkeynes@736: #ifdef __cplusplus nkeynes@736: } nkeynes@736: #endif nkeynes@736: nkeynes@736: #endif /* lxdream_gui_H */