Search
lxdream.org :: lxdream/src/gui/gtkui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/gtkui.h
changeset 477:9a373f2ff009
prev470:e09a16196693
next480:d28c2992f5ee
author nkeynes
date Wed Oct 31 09:10:23 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Add save/restore of render buffers in save states
Gzip memory blocks in save states
Move front-buffer management back to pvr2
Add screenshot preview when loading save states
Various minor fixes and cleanups
file annotate diff log raw
nkeynes@435
     1
/**
nkeynes@477
     2
 * $Id: gtkui.h,v 1.9 2007-10-31 09:10:23 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@435
    23
#include "gui.h"
nkeynes@435
    24
#include "cpu.h"
nkeynes@435
    25
nkeynes@435
    26
/********************* Top-level windows *********************/
nkeynes@435
    27
nkeynes@435
    28
typedef struct main_window_info *main_window_t;
nkeynes@435
    29
typedef struct debug_window_info *debug_window_t;
nkeynes@435
    30
typedef struct mmio_window_info *mmio_window_t;
nkeynes@457
    31
typedef struct dump_window_info *dump_window_t;
nkeynes@435
    32
nkeynes@435
    33
/**
nkeynes@435
    34
 * Construct and show the main window, returning an 
nkeynes@435
    35
 * opaque pointer to the window.
nkeynes@435
    36
 */
nkeynes@455
    37
main_window_t main_window_new( const gchar *title, GtkWidget *menubar, 
nkeynes@455
    38
			       GtkWidget *toolbar, GtkAccelGroup *accel );
nkeynes@447
    39
GtkWindow *main_window_get_frame( main_window_t win );
nkeynes@435
    40
GtkWidget *main_window_get_renderarea( main_window_t win );
nkeynes@435
    41
void main_window_set_running( main_window_t win, gboolean running );
nkeynes@435
    42
void main_window_set_framerate( main_window_t win, float rate );
nkeynes@437
    43
void main_window_set_speed( main_window_t win, double speed );
nkeynes@435
    44
nkeynes@455
    45
debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
nkeynes@455
    46
				 GtkWidget *toolbar, GtkAccelGroup *accel );
nkeynes@435
    47
void debug_window_show( debug_window_t win, gboolean show );
nkeynes@435
    48
void debug_window_set_running( debug_window_t win, gboolean running );
nkeynes@435
    49
void debug_window_update(debug_window_t win);
nkeynes@455
    50
void debug_window_single_step( debug_window_t data );
nkeynes@455
    51
void debug_window_set_oneshot_breakpoint( debug_window_t data, int row );
nkeynes@455
    52
void debug_window_toggle_breakpoint( debug_window_t data, int row );
nkeynes@435
    53
nkeynes@455
    54
nkeynes@455
    55
mmio_window_t mmio_window_new( const gchar *title );
nkeynes@450
    56
void mmio_window_show( mmio_window_t win, gboolean show );
nkeynes@435
    57
nkeynes@457
    58
dump_window_t dump_window_new( const gchar *title );
nkeynes@455
    59
nkeynes@455
    60
void maple_dialog_run();
nkeynes@450
    61
void path_dialog_run();
nkeynes@450
    62
nkeynes@455
    63
main_window_t gtk_gui_get_main();
nkeynes@455
    64
debug_window_t gtk_gui_get_debugger();
nkeynes@455
    65
mmio_window_t gtk_gui_get_mmio();
nkeynes@464
    66
void gtk_gui_show_debugger();
nkeynes@455
    67
nkeynes@450
    68
/********************* Helper functions **********************/
nkeynes@450
    69
nkeynes@455
    70
typedef void (*gtk_dialog_done_fn)(GtkWidget *panel, gboolean isOK);
nkeynes@455
    71
void gtk_gui_enable_action( const gchar *action, gboolean enabled );
nkeynes@455
    72
gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
nkeynes@435
    73
nkeynes@477
    74
/**
nkeynes@477
    75
 * Construct a new pixbuf that takes ownership of the frame buffer
nkeynes@477
    76
 */
nkeynes@477
    77
GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t );
nkeynes@477
    78
nkeynes@470
    79
void gdrom_menu_init();
nkeynes@470
    80
GtkWidget *gdrom_menu_new();
nkeynes@470
    81
nkeynes@435
    82
/******************** Video driver hooks *********************/
nkeynes@435
    83
nkeynes@435
    84
GtkWidget *gtk_gui_get_renderarea();
nkeynes@435
    85
nkeynes@435
    86
/******************* Callback declarations *******************/
nkeynes@435
    87
nkeynes@435
    88
void mount_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    89
void reset_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    90
void pause_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    91
void resume_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    92
void load_state_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    93
void save_state_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    94
void about_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    95
void exit_action_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    96
nkeynes@447
    97
void path_settings_callback( GtkAction *action, gpointer user_data);
nkeynes@435
    98
void audio_settings_callback( GtkAction *action, gpointer user_data);
nkeynes@455
    99
void maple_settings_callback( GtkAction *action, gpointer user_data);
nkeynes@435
   100
void network_settings_callback( GtkAction *action, gpointer user_data);
nkeynes@435
   101
void video_settings_callback( GtkAction *action, gpointer user_data);
nkeynes@435
   102
void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
nkeynes@435
   103
nkeynes@455
   104
void debugger_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   105
void debug_memory_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   106
void debug_mmio_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   107
void save_scene_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   108
void debug_step_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   109
void debug_runto_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   110
void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
nkeynes@455
   111
nkeynes@464
   112
void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
nkeynes@464
   113
nkeynes@435
   114
/*************** Constant colour/font values *****************/
nkeynes@435
   115
extern PangoFontDescription *gui_fixed_font;
nkeynes@435
   116
extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
nkeynes@435
   117
extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
nkeynes@435
   118
extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
nkeynes@435
   119
extern GdkColor gui_colour_white;
nkeynes@435
   120
nkeynes@435
   121
#endif /* __lxdream_gtkui_H */
.