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