Search
lxdream.org :: lxdream/src/gtkui/gtkui.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/gtkui.h
changeset 537:d924be49e192
prev508:ccd2c10edfe6
next543:361ec0a70cf2
author nkeynes
date Tue Nov 20 10:27:58 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Move gtk UI into gtkui subdir (prep for non-gtk builds), and protect with
an automake conditional
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/gtkui/gtkui.h Tue Nov 20 10:27:58 2007 +0000
1.3 @@ -0,0 +1,133 @@
1.4 +/**
1.5 + * $Id: gtkui.h,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
1.6 + *
1.7 + * Core GTK-based user interface
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#ifndef __lxdream_gtkui_H
1.23 +#define __lxdream_gtkui_H
1.24 +
1.25 +#include "lxdream.h"
1.26 +#include <gtk/gtk.h>
1.27 +#include <glib/gi18n.h>
1.28 +#include "gui.h"
1.29 +#include "cpu.h"
1.30 +
1.31 +/********************* Top-level windows *********************/
1.32 +
1.33 +typedef struct main_window_info *main_window_t;
1.34 +typedef struct debug_window_info *debug_window_t;
1.35 +typedef struct mmio_window_info *mmio_window_t;
1.36 +typedef struct dump_window_info *dump_window_t;
1.37 +
1.38 +/**
1.39 + * Construct and show the main window, returning an
1.40 + * opaque pointer to the window.
1.41 + */
1.42 +main_window_t main_window_new( const gchar *title, GtkWidget *menubar,
1.43 + GtkWidget *toolbar, GtkAccelGroup *accel );
1.44 +GtkWindow *main_window_get_frame( main_window_t win );
1.45 +GtkWidget *main_window_get_renderarea( main_window_t win );
1.46 +void main_window_set_running( main_window_t win, gboolean running );
1.47 +void main_window_set_framerate( main_window_t win, float rate );
1.48 +void main_window_set_speed( main_window_t win, double speed );
1.49 +void main_window_set_fullscreen( main_window_t win, gboolean fullscreen );
1.50 +
1.51 +debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
1.52 + GtkWidget *toolbar, GtkAccelGroup *accel );
1.53 +void debug_window_show( debug_window_t win, gboolean show );
1.54 +void debug_window_set_running( debug_window_t win, gboolean running );
1.55 +void debug_window_update(debug_window_t win);
1.56 +void debug_window_single_step( debug_window_t data );
1.57 +void debug_window_set_oneshot_breakpoint( debug_window_t data, int row );
1.58 +void debug_window_toggle_breakpoint( debug_window_t data, int row );
1.59 +
1.60 +
1.61 +mmio_window_t mmio_window_new( const gchar *title );
1.62 +void mmio_window_show( mmio_window_t win, gboolean show );
1.63 +void mmio_window_update(mmio_window_t win);
1.64 +
1.65 +dump_window_t dump_window_new( const gchar *title );
1.66 +void dump_window_update_all();
1.67 +
1.68 +void maple_dialog_run();
1.69 +void path_dialog_run();
1.70 +
1.71 +void gtk_gui_update( void );
1.72 +main_window_t gtk_gui_get_main();
1.73 +debug_window_t gtk_gui_get_debugger();
1.74 +mmio_window_t gtk_gui_get_mmio();
1.75 +void gtk_gui_show_mmio();
1.76 +void gtk_gui_show_debugger();
1.77 +
1.78 +/********************* Helper functions **********************/
1.79 +
1.80 +typedef void (*gtk_dialog_done_fn)(GtkWidget *panel, gboolean isOK);
1.81 +void gtk_gui_enable_action( const gchar *action, gboolean enabled );
1.82 +gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
1.83 +
1.84 +
1.85 +typedef gboolean (*file_callback_t)( const gchar *filename );
1.86 +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
1.87 + gchar const *initial_dir );
1.88 +
1.89 +/**
1.90 + * Construct a new pixbuf that takes ownership of the frame buffer
1.91 + */
1.92 +GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer );
1.93 +
1.94 +void gdrom_menu_init();
1.95 +GtkWidget *gdrom_menu_new();
1.96 +
1.97 +/******************** Video driver hooks *********************/
1.98 +
1.99 +GtkWidget *gtk_gui_get_renderarea();
1.100 +
1.101 +/******************* Callback declarations *******************/
1.102 +
1.103 +void mount_action_callback( GtkAction *action, gpointer user_data);
1.104 +void reset_action_callback( GtkAction *action, gpointer user_data);
1.105 +void pause_action_callback( GtkAction *action, gpointer user_data);
1.106 +void resume_action_callback( GtkAction *action, gpointer user_data);
1.107 +void load_state_action_callback( GtkAction *action, gpointer user_data);
1.108 +void save_state_action_callback( GtkAction *action, gpointer user_data);
1.109 +void about_action_callback( GtkAction *action, gpointer user_data);
1.110 +void exit_action_callback( GtkAction *action, gpointer user_data);
1.111 +
1.112 +void path_settings_callback( GtkAction *action, gpointer user_data);
1.113 +void audio_settings_callback( GtkAction *action, gpointer user_data);
1.114 +void maple_settings_callback( GtkAction *action, gpointer user_data);
1.115 +void network_settings_callback( GtkAction *action, gpointer user_data);
1.116 +void video_settings_callback( GtkAction *action, gpointer user_data);
1.117 +void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
1.118 +
1.119 +void debugger_action_callback( GtkAction *action, gpointer user_data);
1.120 +void debug_memory_action_callback( GtkAction *action, gpointer user_data);
1.121 +void debug_mmio_action_callback( GtkAction *action, gpointer user_data);
1.122 +void save_scene_action_callback( GtkAction *action, gpointer user_data);
1.123 +void debug_step_action_callback( GtkAction *action, gpointer user_data);
1.124 +void debug_runto_action_callback( GtkAction *action, gpointer user_data);
1.125 +void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
1.126 +
1.127 +void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
1.128 +
1.129 +/*************** Constant colour/font values *****************/
1.130 +extern PangoFontDescription *gui_fixed_font;
1.131 +extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
1.132 +extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
1.133 +extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
1.134 +extern GdkColor gui_colour_white;
1.135 +
1.136 +#endif /* __lxdream_gtkui_H */
.