Search
lxdream.org :: lxdream/src/gui/gtkui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/gtkui.h
changeset 486:9af294489aad
prev480:d28c2992f5ee
next508:ccd2c10edfe6
author nkeynes
date Fri Nov 02 08:22:33 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Implement (fairly naive) fullscreen mode
view annotate diff log raw
     1 /**
     2  * $Id: gtkui.h,v 1.11 2007-11-02 08:22:32 nkeynes Exp $
     3  *
     4  * Core GTK-based user interface
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #ifndef __lxdream_gtkui_H
    20 #define __lxdream_gtkui_H
    22 #include <gtk/gtk.h>
    23 #include "lxdream.h"
    24 #include "gui.h"
    25 #include "cpu.h"
    27 /********************* Top-level windows *********************/
    29 typedef struct main_window_info *main_window_t;
    30 typedef struct debug_window_info *debug_window_t;
    31 typedef struct mmio_window_info *mmio_window_t;
    32 typedef struct dump_window_info *dump_window_t;
    34 /**
    35  * Construct and show the main window, returning an 
    36  * opaque pointer to the window.
    37  */
    38 main_window_t main_window_new( const gchar *title, GtkWidget *menubar, 
    39 			       GtkWidget *toolbar, GtkAccelGroup *accel );
    40 GtkWindow *main_window_get_frame( main_window_t win );
    41 GtkWidget *main_window_get_renderarea( main_window_t win );
    42 void main_window_set_running( main_window_t win, gboolean running );
    43 void main_window_set_framerate( main_window_t win, float rate );
    44 void main_window_set_speed( main_window_t win, double speed );
    45 void main_window_set_fullscreen( main_window_t win, gboolean fullscreen );
    47 debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
    48 				 GtkWidget *toolbar, GtkAccelGroup *accel );
    49 void debug_window_show( debug_window_t win, gboolean show );
    50 void debug_window_set_running( debug_window_t win, gboolean running );
    51 void debug_window_update(debug_window_t win);
    52 void debug_window_single_step( debug_window_t data );
    53 void debug_window_set_oneshot_breakpoint( debug_window_t data, int row );
    54 void debug_window_toggle_breakpoint( debug_window_t data, int row );
    57 mmio_window_t mmio_window_new( const gchar *title );
    58 void mmio_window_show( mmio_window_t win, gboolean show );
    59 void mmio_window_update(mmio_window_t win);
    61 dump_window_t dump_window_new( const gchar *title );
    62 void dump_window_update_all();
    64 void maple_dialog_run();
    65 void path_dialog_run();
    67 void gtk_gui_update( void );
    68 main_window_t gtk_gui_get_main();
    69 debug_window_t gtk_gui_get_debugger();
    70 mmio_window_t gtk_gui_get_mmio();
    71 void gtk_gui_show_mmio();
    72 void gtk_gui_show_debugger();
    74 /********************* Helper functions **********************/
    76 typedef void (*gtk_dialog_done_fn)(GtkWidget *panel, gboolean isOK);
    77 void gtk_gui_enable_action( const gchar *action, gboolean enabled );
    78 gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
    81 typedef gboolean (*file_callback_t)( const gchar *filename );
    82 void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
    83 		       gchar const *initial_dir );
    85 /**
    86  * Construct a new pixbuf that takes ownership of the frame buffer
    87  */
    88 GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer );
    90 void gdrom_menu_init();
    91 GtkWidget *gdrom_menu_new();
    93 /******************** Video driver hooks *********************/
    95 GtkWidget *gtk_gui_get_renderarea();
    97 /******************* Callback declarations *******************/
    99 void mount_action_callback( GtkAction *action, gpointer user_data);
   100 void reset_action_callback( GtkAction *action, gpointer user_data);
   101 void pause_action_callback( GtkAction *action, gpointer user_data);
   102 void resume_action_callback( GtkAction *action, gpointer user_data);
   103 void load_state_action_callback( GtkAction *action, gpointer user_data);
   104 void save_state_action_callback( GtkAction *action, gpointer user_data);
   105 void about_action_callback( GtkAction *action, gpointer user_data);
   106 void exit_action_callback( GtkAction *action, gpointer user_data);
   108 void path_settings_callback( GtkAction *action, gpointer user_data);
   109 void audio_settings_callback( GtkAction *action, gpointer user_data);
   110 void maple_settings_callback( GtkAction *action, gpointer user_data);
   111 void network_settings_callback( GtkAction *action, gpointer user_data);
   112 void video_settings_callback( GtkAction *action, gpointer user_data);
   113 void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
   115 void debugger_action_callback( GtkAction *action, gpointer user_data);
   116 void debug_memory_action_callback( GtkAction *action, gpointer user_data);
   117 void debug_mmio_action_callback( GtkAction *action, gpointer user_data);
   118 void save_scene_action_callback( GtkAction *action, gpointer user_data);
   119 void debug_step_action_callback( GtkAction *action, gpointer user_data);
   120 void debug_runto_action_callback( GtkAction *action, gpointer user_data);
   121 void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
   123 void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
   125 /*************** Constant colour/font values *****************/
   126 extern PangoFontDescription *gui_fixed_font;
   127 extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
   128 extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
   129 extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
   130 extern GdkColor gui_colour_white;
   132 #endif /* __lxdream_gtkui_H */
.