From 0e432d00a2ef323edf48960fbce2c087ee2023c6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 30 Jun 2004 14:07:51 +0000 Subject: detachable windows in gtk+2 --- mixgtk/mixgtk.c | 81 +- mixgtk/mixgtk.glade | 5433 ++++++++++++++++++++--------------------------- mixgtk/mixgtk.h | 14 +- mixgtk/mixgtk_config.c | 30 +- mixgtk/mixgtk_config.h | 18 +- mixgtk/mixgtk_device.c | 49 +- mixgtk/mixgtk_device.h | 4 +- mixgtk/mixgtk_mixal.c | 87 +- mixgtk/mixgtk_mixal.h | 17 +- mixgtk/mixgtk_mixvm.c | 69 +- mixgtk/mixgtk_mixvm.h | 31 +- mixgtk/mixgtk_widgets.c | 74 +- mixgtk/mixgtk_widgets.h | 14 +- mixgtk/mixgtk_wm.c | 559 ++++- mixgtk/mixgtk_wm.h | 18 +- 15 files changed, 2899 insertions(+), 3599 deletions(-) diff --git a/mixgtk/mixgtk.c b/mixgtk/mixgtk.c index 97f6a16..8526390 100644 --- a/mixgtk/mixgtk.c +++ b/mixgtk/mixgtk.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk.c : * Main functions of the mix gtk front-end * ------------------------------------------------------------------ - * $Id: mixgtk.c,v 1.17 2004/06/24 01:40:48 jao Exp $ + * $Id: mixgtk.c,v 1.18 2004/06/30 14:07:54 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -25,102 +25,43 @@ #include #include "mixgtk_widgets.h" + #include "mixgtk_cmd_dispatcher.h" -#include "mixgtk_device.h" -#include "mixgtk_mixvm.h" -#include "mixgtk_mixal.h" #include "mixgtk_input.h" -#include "mixgtk_fontsel.h" #include "mixgtk_config.h" #include "mixgtk_wm.h" #include "mixgtk.h" -static const gchar *SPLIT_ARG_ = "-s"; -static const gchar *SPLIT_LONG_ARG_ = "--split"; - +/* initialise the app */ gboolean -mixgtk_restart (void) +mixgtk_init (int argc, char *argv[]) { - mix_vm_t *vm; - - if (!mixgtk_widget_factory_init ()) - { - g_error (_("Unable to initialise application: missing glade file")); - return FALSE; - } - - if (!mixgtk_cmd_dispatcher_init (MIXGTK_MAIN)) - { - g_error (_("Unable to initialise application (command dispatcher)\n")); - return FALSE; - } - - vm = mixgtk_cmd_dispatcher_get_vm (); + mix_init_lib (); - if (!mixgtk_mixvm_init (vm, MIXGTK_MIXVM_DIALOG)) - { - g_error (_("Unable to initialise application (mixvm widgets)\n")); - return FALSE; - } + gtk_init (&argc, &argv); - if (!mixgtk_mixal_init (vm, MIXGTK_MIXAL_DIALOG)) + if (!mixgtk_config_load ()) { - g_error (_("Unable to initialise application (mixal widgets)\n")); - return FALSE; + g_error (_("Unable to load gmixvm configuration")); } - if (!mixgtk_device_init (GTK_CONTAINER - (mixgtk_widget_factory_get - (MIXGTK_DEVICES_DIALOG, MIXGTK_WIDGET_DEVICES)), - vm)) + if (!mixgtk_widget_factory_init ()) { - g_error (_("Unable to initialise application (devices)\n")); + g_error (_("Unable to initialise application: missing glade file")); return FALSE; } if (!mixgtk_wm_init ()) { - g_error (_("Unable to initialise application (visibility)\n")); + g_error (_("Unable to initialise application\n")); return FALSE; } mixgtk_input_init (); - gtk_widget_show (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); - mixgtk_mixvm_update_vm_widgets (); - return TRUE; } -/* initialise the app */ -gboolean -mixgtk_init (int argc, char *argv[]) -{ - gboolean split = FALSE; - gint k; - - mix_init_lib (); - - if (!mixgtk_config_load ()) - { - g_error ("Unable to read configuration\n"); - return FALSE; - } - - for (k = 0; k < argc; ++k) - if (!strcmp (argv[k], SPLIT_ARG_) || !strcmp (argv[k], SPLIT_LONG_ARG_)) - { - split = TRUE; - break; - } - if (!split && mixgtk_config_is_split ()) split = TRUE; - mixgtk_config_set_split (split); - - gtk_init (&argc, &argv); - - return mixgtk_restart (); -} - /* main loop */ void mixgtk_main (void) diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade index a73dfc6..a7ef1b4 100644 --- a/mixgtk/mixgtk.glade +++ b/mixgtk/mixgtk.glade @@ -17,7 +17,6 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - @@ -49,7 +48,7 @@ - + True gtk-open 1 @@ -72,7 +71,7 @@ - + True gtk-justify-fill 1 @@ -95,7 +94,7 @@ - + True gtk-execute 1 @@ -124,7 +123,7 @@ - + True gtk-quit 1 @@ -141,45 +140,6 @@ - - - True - Vie_w - True - - - - - - - True - _Toolbar - True - False - - - - - - - - True - - - - - - True - Split _windows - True - - - - - - - - True @@ -199,7 +159,7 @@ - + True gtk-go-forward 1 @@ -222,7 +182,7 @@ - + True gtk-goto-last 1 @@ -245,7 +205,7 @@ - + True gtk-clear 1 @@ -268,7 +228,7 @@ - + True gtk-index 1 @@ -301,7 +261,7 @@ True - + True gtk-select-font 1 @@ -373,7 +333,7 @@ - + True gtk-zoom-100 1 @@ -394,7 +354,7 @@ - + True gtk-home 1 @@ -415,7 +375,7 @@ - + True gtk-preferences 1 @@ -428,6 +388,67 @@ + + + True + Detached _windows + True + + + + True + gtk-dnd-multiple + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + _Virtual machine + True + False + + + + + + True + _Source + True + False + + + + + + True + _Devices + True + False + + + + + + + + + + True + Show toolbars + True + False + + + True @@ -443,7 +464,7 @@ - + True gtk-save 1 @@ -512,6 +533,8 @@ True Load MIX program + Open + True gtk-open True True @@ -528,6 +551,8 @@ True Compile MIXAL source + Compile + True gtk-execute True True @@ -698,7 +723,7 @@ - + True True True @@ -711,16 +736,16 @@ - + True - Split windows - + Detach window + Detach True - splitw.xpm + gtk-dnd-multiple True True - True - + False + False @@ -736,1697 +761,201 @@ - + True - False - 0 + True + 0 - 2 True True True True GTK_POS_TOP False - True - + False + + + + + + + + + + + False + False + + + + + + True + False + 0 - + True - False - 0 + GTK_POLICY_AUTOMATIC + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - - 1 + True - False - 1 - - - - 2 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + False + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + - - - 8 - True - 3 - 6 - False - 6 - 11 + + + True + Enter MIXVM command here + True + True + True + True + 0 + + True + * + False + + + + + 0 + False + False + + + + + True + True + + + + + 0 + True + True + + - - - 0 - 0 - True - A - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - 1 - 0 - 1 - fill - - - + + + True + True + + + 0 + False + False + + + + + - - - 0 - 0 - True - I1 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 2 - 3 - 0 - 1 - fill - - - + + Enter value + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + - - - 0 - 0 - True - I2 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 2 - 3 - 1 - 2 - fill - - - + + + True + False + 0 - - - 0 - 0 - True - False - True - 0 - - True - * - False - 19 - - - - 1 - 2 - 0 - 1 - - - - + + + True + GTK_BUTTONBOX_END - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 3 - 4 - 1 - 2 - - - - + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 10 - - - 0 - 0 - True - True - False - True - 0 - + 00 00 - True - * - False - 9 - - - - 3 - 4 - 0 - 1 - - - - + + + True + True + True + gtk-clear + True + GTK_RELIEF_NORMAL + True + + + - - - 0 - 0 - True - X - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - 16 - 16 - True - I3 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 2 - 3 - 2 - 3 - fill - - - - - - - 0 - 0 - True - I4 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 4 - 5 - 0 - 1 - fill - - - - - - - 16 - 16 - True - I5 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 4 - 5 - 1 - 2 - fill - - - - - - - 16 - 16 - True - I6 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 4 - 5 - 2 - 3 - fill - - - - - - - 0 - 0 - True - J - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - 0 - 0 - True - True - False - True - 0 - + 00 00 00 00 00 - True - * - False - 19 - - - - 1 - 2 - 1 - 2 - - - - - - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 5 - 6 - 0 - 1 - - - - - - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 5 - 6 - 1 - 2 - - - - - - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 5 - 6 - 2 - 3 - - - - - - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 3 - 4 - 2 - 3 - - - - - - - - True - False - 0 - - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 0 - False - False - - - - - - - - - 1 - 2 - 2 - 3 - fill - fill - - - - - - - - True - Registers - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 5 - False - True - - - - - - True - False - 0 - - - - 2 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 1 - True - False - 5 - - - - 2 - 0 - 0 - True - Greater - True - G - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - 2 - 0 - 0 - True - Equal - True - E - True - GTK_RELIEF_NORMAL - True - False - False - True - greater_radio - - - - 0 - False - False - - - - - - 2 - 0 - 0 - True - Lesser - True - L - True - GTK_RELIEF_NORMAL - True - False - False - True - greater_radio - - - - 0 - False - False - - - - - - 7 - True - - - 0 - False - False - - - - - - True - True - Overflow - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - - - True - Flags - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 0 - False - False - - - - - - - - - - 2 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 4 - True - False - 1 - - - - 0 - 0 - True - True - False - True - 4 - 0 - True - * - False - 6 - - - 5 - False - False - - - - - - True - View loc address - True - GTK_RELIEF_NORMAL - True - - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 1 - False - False - - - - - - - - True - Location - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 0 - False - False - GTK_PACK_END - - - - - 5 - False - True - - - - - - 2 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 5 - True - True - 5 - - - - 0 - 0 - True - Uptime: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - 0 - 0 - True - 00000000 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 5 - 0 - - - 0 - False - False - - - - - - 0 - 0 - True - Elapsed: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 3 - False - False - - - - - - 0 - 0 - True - 000000 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 5 - 0 - - - 0 - False - False - - - - - - 0 - 0 - True - Program: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 2 - False - False - - - - - - 0 - 0 - True - 000000 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 5 - 0 - - - 0 - False - False - - - - - - - - True - Times - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 5 - False - True - - - - - 2 - False - False - - - - - - 7 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 5 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - GDK_BUTTON_PRESS_MASK - True - True - False - True - - - - - - - - True - Memory - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 3 - True - True - GTK_PACK_END - - - - - False - True - - - - - - True - _Virtual machine - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - tab - - - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - Click to toggle breakpoint - True - GDK_POINTER_MOTION_MASK - True - True - False - True - - - - - False - True - - - - - - True - _Source - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - GTK_SHADOW_IN - - - - - - - - - False - True - - - - - - True - _Devices - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - 2 - False - True - - - - - - 2 - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - GTK_SHADOW_IN - - - - True - False - 0 - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - True - Enter MIXVM command here - True - True - True - True - 0 - - True - * - False - - - - - 0 - False - False - - - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - True - - - 0 - False - False - - - - - - - - gmixvm - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 570 - 235 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - - 2 - True - False - 2 - - - - True - - - - True - _File - True - - - - True - - - - True - Load a MIX file - _Load... - True - - - - - - - - True - Edit a MIXAL source file - _Edit... - True - - - - - - - - True - Compile a MIXAL source file - _Compile... - True - - - - - - - - True - - - - - - True - Exit application - E_xit - True - - - - - - - - - - - - True - _View - True - - - - True - - - - True - _MIX - True - False - - - - - - - True - MI_XAL - True - False - - - - - - - True - _Devices - True - False - - - - - - - True - _Toolbars - True - False - - - - - - - True - - - - - - True - One _window - True - - - - - - - - - - - True - D_ebug - True - - - - True - - - - True - Run program - _Run - True - - - - - - - - True - Execute next instruction - _Next - True - - - - - - - - True - Clear all set breakpoints - _Clear breakpoints - True - - - - - - - - True - Show the symbol table - _Symbols... - True - - - - - - - - - - - - True - _Settings - True - - - - True - - - - True - Change colors of MIXAL - _Colors... - True - - - - - - - True - Change _font - True - - - - True - - - - True - _MIX - True - - - - - - - True - MI_XAL - True - - - - - - - True - Command _prompt - True - - - - - - - True - Command l_og - True - - - - - - - True - De_vices - True - - - - - - - - - - - True - Change format of binary devices output - _Device output... - True - - - - - - - True - De_vices dir... - True - - - - - - - True - E_xternal programs... - True - - - - - - - True - - - - - - True - Save current settings - _Save - True - - - - - - - True - Toogle save settings on exit - Save on _exit - True - True - - - - - - - - - - - True - _Help - True + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + - + True - - - - True - _About... - True - - - + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + - - 0 - False - True - - - - - - True - True - 0 False @@ -2436,354 +965,350 @@ - + + 5 True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - True - True - - - - True - Load MIX program - Load - True - gtk-open - True - True - False - - - - False - True - - - - - - True - Compile MIXAL source - Build - True - gtk-execute - True - True - False - - - - False - True - - - - - - True - Edit MIXAL source - Edit - True - gtk-justify-fill - True - True - False - - - - False - True - - - - - - True - True - True - False - - - - True - - - - - False - False - - - - - - True - True - True - True - - - False - False - - - + + 0 + 0 True - Run - Run - True - gtk-go-forward - True - True - False - + True + True + GDK_KEY_PRESS_MASK + True + True + 0 + 0 + True + * + False + 28 + - False - True + 88 + 64 - + + 0 + 0 True - Next - Step - True - gtk-goto-last - True - True - False - + True + GDK_KEY_PRESS_MASK + True + True + 2 + 0 + True + * + False + 3 + - False - True + 144 + 32 - + + 0 + 0 True - Clear breakpoints - Clear - True - gtk-clear - True - True - False - + True + GDK_BUTTON_PRESS_MASK + True + True + 2 + 0 + True + * + False + 3 + - False - True + 176 + 32 - + + 0 + 0 True - Symbol table - Symbols - True - gtk-index - True - True - False - + True + GDK_KEY_PRESS_MASK + True + True + 2 + 0 + True + * + False + 3 + - False - True + 208 + 32 - + + 0 + 0 True - True - True - True + True + GDK_KEY_PRESS_MASK + True + True + 2 + 0 + True + * + False + 3 + - False - False + 238 + 32 - + + 0 + 0 True - Command log font - Font - True - gtk-select-color - True - True - False - + True + GDK_KEY_PRESS_MASK + True + True + 2 + 0 + True + * + False + 3 + - False - True + 112 + 32 - + + 0 + 0 True - Command prompt font - Font - True - gtk-home - True - True - False - + True + GDK_KEY_PRESS_MASK + True + True + 1 + + + True + * + False + 2 + - False - True + 88 + 32 - + + 0 + 0 True - External programs - Extern - True - gtk-convert - True - True - False - + Decimal + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 - False - True + 14 + 68 - + + 0 + 0 True - True - True - True + Bytes + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 - False - False + 15 + 36 - + + 0 + 0 True - One window - One window - True - onew.xpm - True - True - False - + Enter value + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 - False - True + 112 + 8 0 - False - False + True + True + + + + + + MDK + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + True + 250 + 150 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + + + True + 250 + 150 + 0 0 250 0 209.7 233 + 0 0 150 0 111.6 124 - + + 0 + 0 True - False - 0 - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + GNU MIX Development Kit + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 56 + 24 + + - - - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - + + + 52 + 16 + True + label223 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 96 + 48 + + - - - True - Enter MIXVM command here - True - True - True - True - 0 - - True - * - False - - - - 0 - False - False - - + + + 0 + 0 + True + Copyright (C) 2001, 2002, 2003 , 2004 +Free Software Foundation, Inc. + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 - 0 - True - True + 24 + 88 - - Enter value + + Go to memory cell GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True - False + True False True False @@ -2791,42 +1316,42 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True - + - + True False 0 - + True GTK_BUTTONBOX_END - + True GTK_BUTTONBOX_DEFAULT_STYLE - 10 + 30 - + True True True - gtk-clear + gtk-cancel True GTK_RELIEF_NORMAL True - + - + True True True @@ -2834,20 +1359,7 @@ True GTK_RELIEF_NORMAL True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - + @@ -2856,184 +1368,237 @@ 0 False - False + True GTK_PACK_END - - 5 + + 12 True + False + 0 - - 0 - 0 + True - True - True - GDK_KEY_PRESS_MASK - True - True - 0 - 0 - True - * - False - 28 - + Go to address: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 - 88 - 64 + 0 + True + True - - 0 - 0 + True True - GDK_KEY_PRESS_MASK + True True True - 2 - 0 + 0 + True * False - 3 - + - 144 - 32 + 10 + False + False + + + 0 + False + False + + + + + - - - 0 - 0 - True - True - GDK_BUTTON_PRESS_MASK - True - True - 2 - 0 - True - * - False - 3 - - - - 176 - 32 - - + + 4 + Select Font + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + + + + + + 4 + True + abcdefghijk ABCDEFGHIJK + + + 0 + True + True + + + + + + Device output format + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + 320 + 140 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END - - 0 - 0 + True + True True - GDK_KEY_PRESS_MASK - True - True - 2 - 0 - True - * - False - 3 - + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 - - 208 - 32 - - - 0 - 0 + True + True True - GDK_KEY_PRESS_MASK - True - True - 2 - 0 - True - * - False - 3 - + gtk-apply + True + GTK_RELIEF_NORMAL + True + -10 - - 238 - 32 - - - 0 - 0 + True + True True - GDK_KEY_PRESS_MASK - True - True - 2 - 0 - True - * - False - 3 - + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 - - 112 - 32 - + + + 0 + False + True + GTK_PACK_END + + + + + + True - + 0 0 True + Set all devices to current format True - GDK_KEY_PRESS_MASK - True - True - 1 - + - True - * - False - 2 - + S_et all + True + GTK_RELIEF_NORMAL + True + - 88 - 32 + 233 + 31 - + 0 0 True - Decimal + Device False False GTK_JUSTIFY_CENTER @@ -3045,17 +1610,17 @@ 0 - 14 - 68 + 24 + 10 - + 0 0 True - Bytes + Format False False GTK_JUSTIFY_CENTER @@ -3067,141 +1632,97 @@ 0 - 15 - 36 + 24 + 38 - - 0 - 0 + + 183 + 25 True - Enter value - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + tape0 +tape1 +tape2 +tape3 +tape4 +tape5 +tape6 +tape7 +disk0 +disk1 +disk2 +disk3 +disk4 +disk5 +disk6 +disk7 + - 112 - 8 + 90 + 2 - - - 0 - True - True - - - - - - - - MDK - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - True - 250 - 150 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - - - - True - 250 - 150 - 0 0 250 0 209.7 233 - 0 0 150 0 111.6 124 - - - - 0 - 0 - True - GNU MIX Development Kit - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 56 - 24 - - - - - - 52 - 16 - True - label223 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 96 - 48 - - - - - 0 - 0 - True - Copyright (C) 2001, 2002, 2003 , 2004 -Free Software Foundation, Inc. - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 + + + 0 + 0 + True + Show output as MIX words + True + Word + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 89 + 34 + + + + + + 0 + 0 + True + Show output as decimal numbers + True + Decimal + True + GTK_RELIEF_NORMAL + True + False + False + True + wordradio + + + + 154 + 34 + + - 24 - 88 + 0 + True + False + GTK_PACK_END - - Go to memory cell + + External programs GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True @@ -3213,29 +1734,29 @@ Free Software Foundation, Inc. GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True - + - + True False 0 - + True GTK_BUTTONBOX_END - + True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 + GTK_BUTTONBOX_SPREAD + 10 - + True True True @@ -3243,12 +1764,12 @@ Free Software Foundation, Inc. True GTK_RELIEF_NORMAL True - + - + True True True @@ -3256,7 +1777,238 @@ Free Software Foundation, Inc. True GTK_RELIEF_NORMAL True - + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + True + 0 + + + + True + + + + 0 + 0 + True + True + True + True + 0 + xterm -e vi %s + True + * + False + + + 256 + 12 + + + + + + 0 + 0 + True + Editor command (e.g xterm -e vi %s) + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 8 + 15 + + + + + 0 + True + True + + + + + + True + + + + 0 + 0 + True + True + True + True + 0 + mixasm -g %s + True + * + False + + + 255 + 4 + + + + + + 0 + 0 + True + MIX sssembler command (e.g. mixasm -g %s) + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 8 + 8 + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + Symbol table + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 245 + 265 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + GTK_RELIEF_NORMAL + True + 0 + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-close + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Close + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + @@ -3271,358 +2023,325 @@ Free Software Foundation, Inc. - - 12 + True - False - 0 - - - - True - Go to address: - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + True True - True - True - True - 0 - - True - * - False - + False + True + True + True - - 10 - False - False - 0 - False - False + True + True - - 4 - Select Font - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - - - - - - 4 - True - abcdefghijk ABCDEFGHIJK - - - 0 - True - True - - - - - - Device output format + + MIXAL source GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - True - 320 - 140 + False + 570 + 225 True False True False False - GDK_WINDOW_TYPE_HINT_DIALOG + GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - True - - - - - + + True False 0 - - + + + 2 True - GTK_BUTTONBOX_END + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_ICONS + True + True - + True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 + Run + Run + True + gtk-go-forward + True + True + False + + + False + True + - + True - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - True - -10 + Next + Step + True + gtk-goto-last + True + True + False + + + False + True + - + True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 + Clear breakpoints + Clear + True + gtk-clear + True + True + False + + + False + True + - - - 0 - False - True - GTK_PACK_END - - - - - - True - - 0 - 0 + True - Set all devices to current format - True - S_et all + Symbol table + Symbols True - GTK_RELIEF_NORMAL - True - + gtk-index + True + True + False + - 233 - 31 + False + True - - 0 - 0 + True - Device - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + True + True + True - 24 - 10 + False + False - - 0 - 0 + True - Format - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + Source code font + Font + True + gtk-select-font + True + True + False + - 24 - 38 + False + True + + + 0 + False + False + + + + + + True + False + 0 - - 183 - 25 + + + + + 0 + True + True + + + + + + True + True + + + 0 + False + False + + + + + + + + Devices + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 550 + 250 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + + + True + False + 0 + + + + 2 + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_ICONS + True + True + + + True - tape0 -tape1 -tape2 -tape3 -tape4 -tape5 -tape6 -tape7 -disk0 -disk1 -disk2 -disk3 -disk4 -disk5 -disk6 -disk7 - + Device directory + Directory + True + gtk-home + True + True + True + - 90 - 2 + False + True - - 0 - 0 + True - Show output as MIX words - True - Word + Output format + Output True - GTK_RELIEF_NORMAL - True - False - False - True + gtk-zoom-100 + True + True + False + - 89 - 34 + False + True - - 0 - 0 + True - Show output as decimal numbers - True - Decimal + Output font + Font True - GTK_RELIEF_NORMAL - True - False - False - True - wordradio - + gtk-select-font + True + True + False + - 154 - 34 + False + True 0 - True + False False - GTK_PACK_END + + + + + + True + False + 0 + + + + + + + 0 + True + True - - External programs + + Devices directory GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - True + False True False True @@ -3636,109 +2355,91 @@ disk7 - + True False 0 - + True GTK_BUTTONBOX_END - + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True - GTK_BUTTONBOX_SPREAD - 10 - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + 0 False - True + False GTK_PACK_END - + + 25 True - True - 0 + False + 11 - + True + Directory + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + - - - 0 - 0 - True - True - True - True - 0 - xterm -e vi %s - True - * - False - - - 256 - 12 - - - - - - 0 - 0 - True - Editor command (e.g xterm -e vi %s) - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 8 - 15 - - + + + True + True + False + True + 0 + + True + * + False 0 @@ -3748,61 +2449,25 @@ disk7 - + True - - - - 0 - 0 - True - True - True - True - 0 - mixasm -g %s - True - * - False - - - 255 - 4 - - - - - - 0 - 0 - True - MIX sssembler command (e.g. mixasm -g %s) - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 8 - 8 - - + True + gtk-open + True + GTK_RELIEF_NORMAL + True + 0 - True - True + False + False 0 - True + False True @@ -3810,87 +2475,302 @@ disk7 - - Symbol table + + Virtual machine GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 245 - 265 + 640 + 290 True False True False False - GDK_WINDOW_TYPE_HINT_DIALOG + GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - True - - - - - - True - False - 0 + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + 1 + True + False + 1 + + + + 2 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 8 + True + 3 + 6 + False + 6 + 11 + + + + 0 + 0 + True + A + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + 0 + 0 + True + I1 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + 0 + 0 + True + I2 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + 0 + 0 + True + False + True + 0 + + True + * + False + 19 + + + + 1 + 2 + 0 + 1 + + + + - - - True - GTK_BUTTONBOX_END + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 3 + 4 + 1 + 2 + + + + - - - True - True - GTK_RELIEF_NORMAL - True - 0 - + + + 0 + 0 + True + True + False + True + 0 + + 00 00 + True + * + False + 9 + + + + 3 + 4 + 0 + 1 + + + + - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 + + + 0 + 0 + True + X + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + fill + + + - - - True - False - 2 + + + 16 + 16 + True + I3 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 2 + 3 + 2 + 3 + fill + + + - + + 0 + 0 True - gtk-close - 4 + I4 + False + False + GTK_JUSTIFY_CENTER + False + False 0.5 0.5 0 0 - 0 - False - False + 4 + 5 + 0 + 1 + fill + - + + 16 + 16 True - _Close - True + I5 + False False - GTK_JUSTIFY_LEFT + GTK_JUSTIFY_CENTER False False 0.5 @@ -3899,548 +2779,775 @@ disk7 0 - 0 - False - False + 4 + 5 + 1 + 2 + fill + - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + + + 16 + 16 + True + I6 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 4 + 5 + 2 + 3 + fill + + + - - - True - True - False - True - True - True - - - - - 0 - True - True - - - - - + + + 0 + 0 + True + J + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + 1 + 2 + 3 + fill + + + - - MIXAL source - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 570 - 225 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - + + + 0 + 0 + True + True + False + True + 0 + + 00 00 00 00 00 + True + * + False + 19 + + + + 1 + 2 + 1 + 2 + + + + + + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 5 + 6 + 0 + 1 + + + + + + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 5 + 6 + 1 + 2 + + + + + + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 5 + 6 + 2 + 3 + + + + - - - True - False - 0 + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 3 + 4 + 2 + 3 + + + + - - - 2 - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - True - True + + + True + False + 0 - - - True - True - True - False + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 0 + False + False + + - - - True + + + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + + + True + Registers + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + + + + 5 + False + True + - - - False - False - - - - - True - Run - Run - True - gtk-go-forward - True - True - False - - - - False - True - - + + + True + False + 0 - - - True - Next - Step - True - gtk-goto-last - True - True - False - - - - False - True - - + + + 2 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - True - Clear breakpoints - Clear - True - gtk-clear - True - True - False - - - - False - True - - + + + 1 + True + False + 5 - - - True - Symbol table - Symbols - True - gtk-index - True - True - False - - - - False - True - - + + + 2 + 0 + 0 + True + Greater + True + G + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + - - - True - True - True - True - - - False - False - - + + + 2 + 0 + 0 + True + Equal + True + E + True + GTK_RELIEF_NORMAL + True + False + False + True + greater_radio + + + + 0 + False + False + + - - - True - Source code font - Font - True - gtk-select-font - True - True - False - - - - False - True - - - - - 0 - False - False - - + + + 2 + 0 + 0 + True + Lesser + True + L + True + GTK_RELIEF_NORMAL + True + False + False + True + greater_radio + + + + 0 + False + False + + - - - True - GTK_POLICY_ALWAYS - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + + + 7 + True + + + 0 + False + False + + - - - True - Click to toggle breakpoint - True - GDK_POINTER_MOTION_MASK - True - False - False - True - - - - - - - - 0 - True - True - - + + + True + True + Overflow + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + - - - True - True - - - 0 - False - False - - - - - + + + True + Flags + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + + + + + 0 + False + False + + - - Devices - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 550 - 250 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - + + + - - - True - False - 0 + + + 2 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - 2 - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - True - True + + + 4 + True + False + 1 - - - True - Device directory - Directory - True - gtk-home - True - True - True - - - - False - True - - + + + 0 + 0 + True + True + False + True + 4 + 0 + True + * + False + 6 + + + 5 + False + False + + - - - True - Output format - Output - True - gtk-find-and-replace - True - True - False - - - - False - True - - + + + True + View loc address + True + GTK_RELIEF_NORMAL + True + - - - True - Output font - Font - True - gtk-select-font - True - True - False - - - - False - True - - - - - 0 - False - False - - + + + True + gtk-jump-to + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 1 + False + False + + + + - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT + + + True + Location + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + + + + + 0 + False + False + GTK_PACK_END + + + + + 5 + False + True + + - - - - - - 0 - True - True - - - - - + + + 2 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - Devices directory - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - + + + 5 + True + True + 5 - - - True - False - 0 + + + 0 + 0 + True + Uptime: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + - - - True - GTK_BUTTONBOX_END + + + 0 + 0 + True + 00000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 + + + 0 + False + False + + - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - + + + 0 + 0 + True + Elapsed: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 3 + False + False + + - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - 0 - False - False - GTK_PACK_END - - + + + 0 + 0 + True + 000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 + + + 0 + False + False + + - - - 25 - True - False - 11 + + + 0 + 0 + True + Program: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 2 + False + False + + - - - True - Directory - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + + + 0 + 0 + True + 000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 + + + 0 + False + False + + + + + + + + True + Times + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + + + + + 5 + False + True + + - 0 + 2 False False - + + 7 True - True - False - True - 0 - - True - * - False + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + GDK_BUTTON_PRESS_MASK + True + True + False + True + + + + + + + + True + Memory + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + + - 0 + 3 True True - - - - - - True - True - gtk-open - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False + GTK_PACK_END - - 0 - False - True - - - - - - - - Virtual machine - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 640 - 290 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - diff --git a/mixgtk/mixgtk.h b/mixgtk/mixgtk.h index e4a16b6..7898d9e 100644 --- a/mixgtk/mixgtk.h +++ b/mixgtk/mixgtk.h @@ -3,22 +3,22 @@ * ------------------------------------------------------------------ * Last change: Time-stamp: <2001-04-29 12:06:48 jao> * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ @@ -35,10 +35,6 @@ extern gboolean mixgtk_init (int argc, char *argv[]); -/* restart the gui */ -extern gboolean -mixgtk_restart (void); - /* enter the main mixgtk loop */ extern void mixgtk_main (void); diff --git a/mixgtk/mixgtk_config.c b/mixgtk/mixgtk_config.c index ccd1216..58a1a25 100644 --- a/mixgtk/mixgtk_config.c +++ b/mixgtk/mixgtk_config.c @@ -1,24 +1,24 @@ /* -*-c-*- -------------- mixgtk_config.c : * Implementation of the functions declared in mixgtk_config.h * ------------------------------------------------------------------ - * $Id: mixgtk_config.c,v 1.8 2002/03/29 16:30:49 jao Exp $ + * $Id: mixgtk_config.c,v 1.9 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ #include @@ -32,9 +32,6 @@ #include "mixgtk_config.h" static const gchar *MIXGTK_CONFIG_FILE_ = "gmixvm.config"; -static const gchar *SPLIT_KEY = "Split"; -static const gchar *SPLIT_YES = "Yes"; -static const gchar *SPLIT_NO = "No"; static const gchar *SHOW_TB_KEY = "Toolbars"; static const gchar *TB_YES = "Yes"; static const gchar *TB_NO = "No"; @@ -103,20 +100,7 @@ mixgtk_config_save (void) } gboolean -mixgtk_config_is_split (void) -{ - const gchar *split = mixgtk_config_get (SPLIT_KEY); - return (split && !strcmp (split, SPLIT_YES)); -} - -void -mixgtk_config_set_split (gboolean split) -{ - mixgtk_config_update (SPLIT_KEY, split? SPLIT_YES : SPLIT_NO); -} - -gboolean -mixgtk_config_show_toolbars (void) +mixgtk_config_show_toolbars (void) { const gchar *show = mixgtk_config_get (SHOW_TB_KEY); return (!show || !strcmp (show, TB_YES)); diff --git a/mixgtk/mixgtk_config.h b/mixgtk/mixgtk_config.h index ee09045..519698a 100644 --- a/mixgtk/mixgtk_config.h +++ b/mixgtk/mixgtk_config.h @@ -1,24 +1,24 @@ /* -*-c-*- ---------------- mixgtk_config.h : * Configuration functions declarations. * ------------------------------------------------------------------ - * $Id: mixgtk_config.h,v 1.5 2001/09/18 22:50:30 jao Exp $ + * $Id: mixgtk_config.h,v 1.6 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ @@ -60,12 +60,6 @@ extern void mixgtk_config_save (void); /* shared config params */ -extern gboolean -mixgtk_config_is_split (void); - -extern void -mixgtk_config_set_split (gboolean split); - extern gboolean mixgtk_config_show_toolbars (void); diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c index e701728..885c19c 100644 --- a/mixgtk/mixgtk_device.c +++ b/mixgtk/mixgtk_device.c @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_device.c : * actual types for mixgtk devices * ------------------------------------------------------------------ - * $Id: mixgtk_device.c,v 1.22 2004/06/24 01:40:47 jao Exp $ + * $Id: mixgtk_device.c,v 1.23 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -42,7 +42,6 @@ static const gchar *DEV_FORMAT_KEY_ = "Device.format"; /* device container */ -static GtkContainer *container_ = NULL; static GtkNotebook *dev_nb_ = NULL; /* devdir dialog */ static GtkWidget *devdir_dlg_ = NULL; @@ -284,6 +283,7 @@ mixgtk_device_construct_gui_ (struct mixgtk_device_t *dev) gtk_tree_view_new_with_model (GTK_TREE_MODEL (bindev->store)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (dev->widget), FALSE); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (dev->widget), TRUE); for (k = 0; k < BIN_DEV_COL_; ++k) { @@ -293,14 +293,14 @@ mixgtk_device_construct_gui_ (struct mixgtk_device_t *dev) "text", k, NULL)); } + g_free (types); } g_assert (dev->widget); gtk_container_add (GTK_CONTAINER (dev->scroll), dev->widget); + mixgtk_fontsel_set_font (MIX_FONT_DEVICES, dev->widget); gtk_notebook_append_page (dev_nb_, dev->scroll, label); - gtk_widget_set_style (dev->widget, - gtk_widget_get_style (GTK_WIDGET (dev_nb_))); gtk_widget_show (label); gtk_widget_show (dev->scroll); gtk_widget_show (dev->widget); @@ -368,11 +368,11 @@ mixgtk_device_new_ (mix_device_type_t type) } /* init default devices */ -gboolean -mixgtk_device_init (GtkContainer *container, mix_vm_t *vm) +GtkWidget * +mixgtk_device_init (mix_vm_t *vm) { - g_return_val_if_fail (container != NULL, FALSE); - g_return_val_if_fail (vm != NULL, FALSE); + g_assert (vm != NULL); + vm_ = vm; devdlg_ = NULL; devdir_dlg_ = NULL; @@ -392,22 +392,12 @@ mixgtk_device_init (GtkContainer *container, mix_vm_t *vm) dev_nb_ = GTK_NOTEBOOK (gtk_notebook_new ()); gtk_notebook_set_tab_pos (dev_nb_, GTK_POS_RIGHT); - gtk_notebook_set_scrollable (dev_nb_, TRUE); - gtk_container_add (container, GTK_WIDGET (dev_nb_)); - } - else if (container_) - { - gtk_widget_reparent (GTK_WIDGET (dev_nb_), GTK_WIDGET (container)); + gtk_notebook_set_scrollable (dev_nb_, FALSE); } - container_ = container; - - gtk_widget_show (GTK_WIDGET (dev_nb_)); - gtk_widget_show (GTK_WIDGET (container_)); - mixgtk_fontsel_set_font (MIX_FONT_DEVICES, GTK_WIDGET (dev_nb_)); - return TRUE; + return GTK_WIDGET (dev_nb_); } void @@ -584,19 +574,20 @@ void on_devices_font_activate () { gint no = gtk_notebook_get_n_pages (dev_nb_); - GtkWidget **w = g_new (GtkWidget *, 2 * no + 1); - gint k; + GtkWidget **w = g_new (GtkWidget *, no + 1); + gint k, j; - w[2 * no] = GTK_WIDGET (dev_nb_); - for (k = 0; k < no; ++k) + for (k = 0, j = 0; k < no && j < mix_dev_INVALID; ++j) { - w[k] = gtk_notebook_get_nth_page (dev_nb_, k); - w[k + no] = gtk_bin_get_child (GTK_BIN (w[k])); - g_assert (w[k]); - g_assert (w[k + no]); + struct mixgtk_device_t * dev = + (struct mixgtk_device_t *) mix_vm_get_device (vm_, j); + if (dev != NULL) w[k++] = dev->widget; } - mixgtk_fontsel_query_font (MIX_FONT_DEVICES, w, 2 * no + 1); + g_assert (k == no); + w[k] = GTK_WIDGET (dev_nb_); + + mixgtk_fontsel_query_font (MIX_FONT_DEVICES, w, no + 1); g_free (w); } diff --git a/mixgtk/mixgtk_device.h b/mixgtk/mixgtk_device.h index dde8a5c..b15cbb4 100644 --- a/mixgtk/mixgtk_device.h +++ b/mixgtk/mixgtk_device.h @@ -30,8 +30,8 @@ #include /* init default devices */ -extern gboolean -mixgtk_device_init (GtkContainer *container, mix_vm_t *vm); +extern GtkWidget * +mixgtk_device_init (mix_vm_t *vm); /* change the output format of a device */ extern void diff --git a/mixgtk/mixgtk_mixal.c b/mixgtk/mixgtk_mixal.c index 17f726f..1ee9475 100644 --- a/mixgtk/mixgtk_mixal.c +++ b/mixgtk/mixgtk_mixal.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_mixal.c : * Implementation of the functions declared in mixgtk_mixal.h * ------------------------------------------------------------------ - * $Id: mixgtk_mixal.c,v 1.18 2004/06/24 01:40:47 jao Exp $ + * $Id: mixgtk_mixal.c,v 1.19 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -30,17 +30,13 @@ #include "mixgtk_fontsel.h" #include "mixgtk_mixal.h" - -#define MIXAL_TAB_POS_ 2 - static mix_vm_t *vm_ = NULL; static GtkTreeView *clist_ = NULL; static GtkListStore *clist_store_ = NULL; static gulong lineno_; -static const gchar *LOCAL_STATUS_BAR_ = "mixal_statusbar"; -static GtkStatusbar *status_; -static gint status_context_; +static GtkStatusbar *status_ = NULL; +static gint status_context_ = 0; static GPtrArray *tips_text_ = NULL; static GtkWidget *symbols_dlg_ = NULL; @@ -149,18 +145,15 @@ fill_symbols_ (const mix_symbol_table_t *table) insert_symbol_, NULL); } -static gboolean -init_clist_ (mixgtk_dialog_id_t top) +static void +init_clist_ (void) { GtkStockItem item; GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GtkCellRenderer *bprenderer = gtk_cell_renderer_pixbuf_new (); - clist_ = GTK_TREE_VIEW - (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_MIXAL)); - - g_assert (clist_); + clist_ = GTK_TREE_VIEW (gtk_tree_view_new ()); clist_store_ = gtk_list_store_new (CLIST_COL_NO, G_TYPE_STRING, @@ -173,6 +166,7 @@ init_clist_ (mixgtk_dialog_id_t top) gtk_tree_view_set_model (clist_, GTK_TREE_MODEL (clist_store_)); g_object_unref (G_OBJECT (clist_store_)); + gtk_tree_view_set_rules_hint (clist_, TRUE); gtk_tree_view_append_column (clist_, @@ -206,44 +200,51 @@ init_clist_ (mixgtk_dialog_id_t top) pc_stock_id_ = item.stock_id; } - return TRUE; -} + symbols_dlg_ = NULL; + symbols_view_ = NULL; + g_signal_connect (G_OBJECT (clist_), "event", + G_CALLBACK (mixal_event_), NULL); -/* initialise the mixal widgets */ -gboolean -mixgtk_mixal_init (mix_vm_t *vm, mixgtk_dialog_id_t top) -{ - static gboolean restart = FALSE; - g_return_val_if_fail (vm != NULL, FALSE); - vm_ = vm; + mixgtk_fontsel_set_font (MIX_FONT_MIXAL, GTK_WIDGET (clist_)); - if (!init_clist_ (top)) return FALSE; + g_object_ref (clist_); - if (!mixgtk_config_is_split ()) - status_ = GTK_STATUSBAR - (mixgtk_widget_factory_get (MIXGTK_MAIN, MIXGTK_WIDGET_STATUSBAR)); - else - status_ = GTK_STATUSBAR - (mixgtk_widget_factory_get_child_by_name (top, LOCAL_STATUS_BAR_)); + gtk_widget_show (GTK_WIDGET (clist_)); - g_return_val_if_fail (status_ != NULL, FALSE); - status_context_ = gtk_statusbar_get_context_id (status_, "MIXAL status"); +} - symbols_dlg_ = NULL; - symbols_view_ = NULL; - g_signal_connect (G_OBJECT (clist_), "event", - G_CALLBACK (mixal_event_), NULL); +/* initialise the mixal widgets */ +GtkWidget * +mixgtk_mixal_init (mix_vm_t *vm) +{ + if (vm != NULL) vm_ = vm; - mixgtk_fontsel_set_font (MIX_FONT_MIXAL, GTK_WIDGET (clist_)); + if (vm_ == NULL) return FALSE; + + if (clist_ == NULL) init_clist_ (); - if (restart) mixgtk_mixal_load_file (); - else restart = TRUE; + status_ = NULL; + return GTK_WIDGET (clist_); +} + +void +mixgtk_mixal_reparent (GtkStatusbar *status) +{ + g_assert (status != NULL); + mixgtk_mixal_pop_status (); + status_ = status; + status_context_ = gtk_statusbar_get_context_id (status_, "MIXAL status"); +} - return TRUE; +void +mixgtk_mixal_pop_status (void) +{ + if (status_ != NULL) + gtk_statusbar_pop (status_, status_context_); } /* load the corresponding mixal file */ @@ -549,15 +550,15 @@ on_symbols_activate () void on_notebook_switch_page (GtkNotebook *notebook) { - gint p = gtk_notebook_get_current_page (notebook); - if (p != MIXAL_TAB_POS_) gtk_statusbar_pop (status_, status_context_); - if (p == MIXAL_TAB_POS_) mixgtk_mixal_update (); +/* gint p = gtk_notebook_get_current_page (notebook); */ +/* if (p != MIXAL_TAB_POS_) gtk_statusbar_pop (status_, status_context_); */ +/* if (p == MIXAL_TAB_POS_) mixgtk_mixal_update (); */ } void on_mixal_leave_notify_event () { - gtk_statusbar_pop (status_, status_context_); + if (status_ != NULL) gtk_statusbar_pop (status_, status_context_); } void diff --git a/mixgtk/mixgtk_mixal.h b/mixgtk/mixgtk_mixal.h index ccf3b61..248cf64 100644 --- a/mixgtk/mixgtk_mixal.h +++ b/mixgtk/mixgtk_mixal.h @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_mixal.h : * Declarations for functions displaying the mixal source file * ------------------------------------------------------------------ - * Last change: Time-stamp: <2001-04-21 23:54:18 jao> + * $Id: mixgtk_mixal.h,v 1.6 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2004 Free Software Foundation, Inc. * @@ -31,8 +31,11 @@ /* initialise the mixal widget */ -extern gboolean -mixgtk_mixal_init (mix_vm_t *vm, mixgtk_dialog_id_t top); +extern GtkWidget * +mixgtk_mixal_init (mix_vm_t *vm); + +extern void +mixgtk_mixal_reparent (GtkStatusbar *stat); /* load the corresponding mixal file */ extern void @@ -42,6 +45,9 @@ mixgtk_mixal_load_file (void); extern void mixgtk_mixal_update (void); +extern void +mixgtk_mixal_pop_status (void); + /* breakpoints */ extern void mixgtk_mixal_update_bp_at_address (guint addr); @@ -53,10 +59,5 @@ extern void mixgtk_mixal_update_bp_all (void); -/* callbacks */ -extern void -on_mixal_select_row (GtkWidget *w, gint row, gint col, GdkEventButton *e, - gpointer data); - #endif /* MIXGTK_MIXAL_H */ diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c index ca4b482..2a34367 100644 --- a/mixgtk/mixgtk_mixvm.c +++ b/mixgtk/mixgtk_mixvm.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_mixvm.c : * Implementation of the functions declared in mixgtk_mixvm.h * ------------------------------------------------------------------ - * $Id: mixgtk_mixvm.c,v 1.12 2004/06/24 01:40:47 jao Exp $ + * $Id: mixgtk_mixvm.c,v 1.13 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -48,13 +48,11 @@ static GtkLabel *progtime_; static GtkLabel *uptime_; static mix_vm_t *vm_; -#define GOTO_ENTRY_NAME_ "goto_entry" - /* Static function prototypes */ static void init_goto_ (void); static void update_register_ (mixgtk_widget_id_t reg); -static gboolean init_mem_ (mixgtk_dialog_id_t top); +static gboolean init_mem_ (void); enum { @@ -66,11 +64,12 @@ enum { /* initialise the mixvm widgets */ gboolean -mixgtk_mixvm_init (mix_vm_t *vm, mixgtk_dialog_id_t top) +mixgtk_mixvm_init (mix_vm_t *vm) { int k; - g_return_val_if_fail (vm != NULL, FALSE); + g_assert (vm != NULL); + vm_ = vm; if (!tips_) tips_ = gtk_tooltips_new (); @@ -78,39 +77,49 @@ mixgtk_mixvm_init (mix_vm_t *vm, mixgtk_dialog_id_t top) for (k = 0; k < REGISTER_NO_; ++k) { reg_entries_[k] = - GTK_ENTRY (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_rA + k)); - g_return_val_if_fail (reg_entries_[k] != NULL, FALSE); - mixgtk_fontsel_set_font (MIX_FONT_MIXVM, GTK_WIDGET (reg_entries_[k])); + GTK_ENTRY (mixgtk_widget_factory_get(MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_rA + k)); + g_assert (reg_entries_[k] != NULL); + mixgtk_fontsel_set_font (MIX_FONT_MIXVM, + GTK_WIDGET (reg_entries_[k])); } - loc_entry_ = GTK_ENTRY (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_LOC)); - g_return_val_if_fail (loc_entry_ != NULL, FALSE); + loc_entry_ = + GTK_ENTRY (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_LOC)); + g_assert (loc_entry_ != NULL); mixgtk_fontsel_set_font (MIX_FONT_MIXVM, GTK_WIDGET (loc_entry_)); - uptime_ = GTK_LABEL (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_UPTIME)); - g_return_val_if_fail (uptime_ != NULL, FALSE); + uptime_ = + GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_UPTIME)); + g_assert (uptime_ != NULL); progtime_ = - GTK_LABEL (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_PROGTIME)); - g_return_val_if_fail (progtime_ != NULL, FALSE); + GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_PROGTIME)); + g_assert (progtime_ != NULL); - laptime_ = GTK_LABEL (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_LAPTIME)); - g_return_val_if_fail (laptime_ != NULL, FALSE); + laptime_ = + GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_LAPTIME)); + g_assert (laptime_ != NULL); over_button_ = - GTK_TOGGLE_BUTTON (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_OVER)); - g_return_val_if_fail (over_button_ != NULL, FALSE); + GTK_TOGGLE_BUTTON + (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, MIXGTK_WIDGET_OVER)); + g_assert (over_button_ != NULL); for (k = 0; k < 3; ++k) { cmp_buttons_[k] = GTK_TOGGLE_BUTTON - (mixgtk_widget_factory_get (top, MIXGTK_WIDGET_CMP_L +k)); - g_return_val_if_fail (cmp_buttons_[k] != NULL, FALSE); + (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_CMP_L +k)); + g_assert (cmp_buttons_[k] != NULL); } + init_mem_ (); - goto_ = NULL; - - return init_mem_ (top); + return TRUE; } /* update register widgets */ @@ -359,8 +368,8 @@ init_goto_ (void) goto_ = mixgtk_widget_factory_get_dialog (MIXGTK_GOTO_DIALOG); g_assert (goto_ != NULL); goto_entry_ = - GTK_ENTRY (mixgtk_widget_factory_get_child_by_name (MIXGTK_GOTO_DIALOG, - GOTO_ENTRY_NAME_)); + GTK_ENTRY (mixgtk_widget_factory_get (MIXGTK_GOTO_DIALOG, + MIXGTK_WIDGET_GOTO_ENTRY)); g_assert (goto_entry_ != NULL); } @@ -447,7 +456,7 @@ cont_clicked_ (GtkWidget *w, GdkEvent *event, gpointer data) static gboolean -init_mem_ (mixgtk_dialog_id_t top) +init_mem_ (void) { gint k; GtkTreeIter iter; @@ -469,12 +478,12 @@ init_mem_ (mixgtk_dialog_id_t top) -1); } - /* view */ renderer = gtk_cell_renderer_text_new (); - memory_ = GTK_TREE_VIEW (mixgtk_widget_factory_get (top, - MIXGTK_WIDGET_CELLS)); + memory_ = + GTK_TREE_VIEW (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_CELLS)); g_assert (memory_); g_assert (renderer); diff --git a/mixgtk/mixgtk_mixvm.h b/mixgtk/mixgtk_mixvm.h index f74b409..2288715 100644 --- a/mixgtk/mixgtk_mixvm.h +++ b/mixgtk/mixgtk_mixvm.h @@ -1,24 +1,24 @@ /* -*-c-*- ---------------- mixgtk_mixvm.h : * Functions dealing with the mixvm widgets * ------------------------------------------------------------------ - * Last change: Time-stamp: <01/03/09 22:12:04 jose> + * $Id: mixgtk_mixvm.h,v 1.4 2004/06/30 14:07:53 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ @@ -31,7 +31,7 @@ /* initialise the mixvm widgets */ extern gboolean -mixgtk_mixvm_init (mix_vm_t *vm, mixgtk_dialog_id_t top); +mixgtk_mixvm_init (mix_vm_t *vm); /* update register widgets */ extern void @@ -64,23 +64,6 @@ mixgtk_mixvm_update_times (void); extern void mixgtk_mixvm_update_vm_widgets (void); -/* callbacks */ -extern void -on_cmp_e_toggled (GtkWidget *widget, gpointer data); - -extern void -on_cmp_g_toggled (GtkWidget *widget, gpointer data); - -extern void -on_cmp_l_toggled (GtkWidget *widget, gpointer data); - -extern void -on_overflow_toggled (GtkWidget *widget, gpointer data); - -extern void -on_loc_arrow_clicked (GtkWidget *widget, gpointer data); - - #endif /* MIXGTK_MIXVM_H */ diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c index 6ffff1e..80bb592 100644 --- a/mixgtk/mixgtk_widgets.c +++ b/mixgtk/mixgtk_widgets.c @@ -37,8 +37,6 @@ static const gchar * dnames_[] = { "word_dialog", "about_dialog", "goto_dialog", - "color_dialog", - "colorsel_dialog", "fontsel_dialog", "devform_dialog", "external_dialog", @@ -47,18 +45,19 @@ static const gchar * dnames_[] = { "devdir_dialog" }; -const gchar *SPLIT_MAIN_NAME_ = "split_main_window"; -const gchar *MAIN_NAME_ = "main_window"; - #define DLG_NO_ (sizeof (dnames_) / sizeof(dnames_[0])) /* widget names */ static const gchar *names_[] = { "main_statusbar", + "main_notebook", "mixvm_widget", + "mixvm_container", "command_prompt", "command_log", - "mixal_clist", + "dev_container", + "mixal_container", + "mixal_statusbar", "rA_entry", "rX_entry", "rJ_entry", @@ -76,24 +75,16 @@ static const gchar *names_[] = { "elapsed_label", "program_label", "uptime_label", - "memory_scroll", "devices_container", "loc_entry", + "goto_entry", NULL }; #define WIDGET_NO_ (sizeof (names_) / sizeof (names_[0])) -#define VERSION_LABEL_ "version_label" -#define GPL_TEXT_ "gpl_text" -#define AUTOSAVE_ITEM_ "save_on_exit" - -static gboolean split_; - /* the glade specs */ static GladeXML *xml_[DLG_NO_] = {NULL}; -/* the about dialog */ -static GtkWidget *about_ = NULL; /* the xml file name */ static const gchar *file_ = NULL; @@ -105,39 +96,10 @@ static void init_xml_ (mixgtk_dialog_id_t dlg) g_assert (xml_[dlg] != NULL); } -static void -init_autosave_ (void) -{ - GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM - (mixgtk_widget_factory_get_child_by_name - (MIXGTK_MAIN, AUTOSAVE_ITEM_)); - if (item) - { - gtk_check_menu_item_set_active (item, mixgtk_config_is_autosave ()); - } -} - -static void -init_about_ (void) -{ - GtkWidget *label; - about_ = mixgtk_widget_factory_get_dialog (MIXGTK_ABOUT_DIALOG); - g_assert (about_ != NULL); - label = mixgtk_widget_factory_get_child_by_name (MIXGTK_ABOUT_DIALOG, - VERSION_LABEL_); - g_assert (label != NULL); - gtk_label_set_text (GTK_LABEL(label), VERSION); - gtk_widget_show (label); -} - /* create a new factory from an xml glade file */ gboolean mixgtk_widget_factory_init (void) { - gboolean split = mixgtk_config_is_split (); - - about_ = NULL; - if (!file_) { const gchar *glade_file = GLADE_FILE; @@ -154,12 +116,7 @@ mixgtk_widget_factory_init (void) for (k = 0; k < DLG_NO_; ++k) if (xml_[k]) xml_[k] = NULL; } - split_ = split; - - dnames_[MIXGTK_MAIN] = split_? SPLIT_MAIN_NAME_ : MAIN_NAME_; - init_xml_ (MIXGTK_MAIN); - init_autosave_ (); return TRUE; } @@ -167,8 +124,8 @@ mixgtk_widget_factory_init (void) GtkWidget * mixgtk_widget_factory_get (mixgtk_dialog_id_t dlg, mixgtk_widget_id_t widget) { - g_return_val_if_fail (widget < WIDGET_NO_, NULL); - if (!split_ && dlg < MIXGTK_WORD_DIALOG) dlg = MIXGTK_MAIN; + g_assert (widget < WIDGET_NO_); + return mixgtk_widget_factory_get_child_by_name (dlg, names_[widget]); } @@ -176,7 +133,8 @@ mixgtk_widget_factory_get (mixgtk_dialog_id_t dlg, mixgtk_widget_id_t widget) GtkWidget * mixgtk_widget_factory_get_dialog (mixgtk_dialog_id_t dlg) { - if (!split_ && dlg < MIXGTK_WORD_DIALOG) dlg = MIXGTK_MAIN; + g_assert (dlg < DLG_NO_); + if (!xml_[dlg]) init_xml_ (dlg); return glade_xml_get_widget (xml_[dlg], dnames_[dlg]); } @@ -185,18 +143,10 @@ GtkWidget * mixgtk_widget_factory_get_child_by_name (mixgtk_dialog_id_t dlg, const gchar *name) { - g_return_val_if_fail (dlg < DLG_NO_, NULL); - g_return_val_if_fail (name != NULL, NULL); - if (!split_ && dlg < MIXGTK_WORD_DIALOG) dlg = MIXGTK_MAIN; + g_assert (dlg < DLG_NO_); + g_assert (name != NULL); if (!xml_[dlg]) init_xml_ (dlg); return glade_xml_get_widget (xml_[dlg], name); } -/* about box */ -void -on_about_activate (GtkWidget *w, gpointer data) -{ - if (!about_) init_about_ (); - gtk_widget_show (about_); -} diff --git a/mixgtk/mixgtk_widgets.h b/mixgtk/mixgtk_widgets.h index 5be3fb6..023c068 100644 --- a/mixgtk/mixgtk_widgets.h +++ b/mixgtk/mixgtk_widgets.h @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_widgets.h : * glade-based factory of mixvm widgets * ------------------------------------------------------------------ - * Last change: Time-stamp: <2001-04-27 23:32:16 jao> + * $Id: mixgtk_widgets.h,v 1.13 2004/06/30 14:07:52 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2004 Free Software Foundation, Inc. * @@ -37,23 +37,25 @@ typedef enum { MIXGTK_WORD_DIALOG, /* input dialog for a mix word */ MIXGTK_ABOUT_DIALOG, MIXGTK_GOTO_DIALOG, - MIXGTK_COLOR_DIALOG, /* color customization dialog */ - MIXGTK_COLORSEL_DIALOG, /* color selection dialog */ MIXGTK_FONTSEL_DIALOG, /* font selection dialog */ MIXGTK_DEVFORM_DIALOG, /* device format config dialog */ MIXGTK_EXTERNPROG_DIALOG, /* external programs dialog */ MIXGTK_SYMBOLS_DIALOG, /* symbol table dialog */ MIXGTK_INPUT_DIALOG, /* console input dialog */ - MIXGTK_DEVDIR_DIALOG + MIXGTK_DEVDIR_DIALOG /* devices directory chooser */ } mixgtk_dialog_id_t; /* enumeration of mixvm widget ids */ typedef enum { MIXGTK_WIDGET_STATUSBAR, + MIXGTK_WIDGET_NOTEBOOK, /* the notebook */ MIXGTK_WIDGET_MIXVM, /* virtual machine */ + MIXGTK_WIDGET_MIXVM_CONTAINER, MIXGTK_WIDGET_PROMPT, /* command prompt */ MIXGTK_WIDGET_LOG, /* command output */ - MIXGTK_WIDGET_MIXAL, /* mixal source file */ + MIXGTK_WIDGET_DEV_CONTAINER, + MIXGTK_WIDGET_MIXAL_CONTAINER, + MIXGTK_WIDGET_MIXAL_STATUSBAR, MIXGTK_WIDGET_rA, MIXGTK_WIDGET_rX, MIXGTK_WIDGET_rJ, @@ -71,9 +73,9 @@ typedef enum { MIXGTK_WIDGET_LAPTIME, MIXGTK_WIDGET_PROGTIME, MIXGTK_WIDGET_UPTIME, - MIXGTK_WIDGET_CELLS_SCROLL, MIXGTK_WIDGET_DEVICES, MIXGTK_WIDGET_LOC, + MIXGTK_WIDGET_GOTO_ENTRY, MIXGTK_WIDGET_NONE } mixgtk_widget_id_t; diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c index 9a7e2ef..76072a8 100644 --- a/mixgtk/mixgtk_wm.c +++ b/mixgtk/mixgtk_wm.c @@ -1,32 +1,40 @@ /* -*-c-*- -------------- mixgtk_wm.c : * Implementation of the functions declared in mixgtk_wm.h * ------------------------------------------------------------------ - * $Id: mixgtk_wm.c,v 1.6 2002/03/29 16:30:49 jao Exp $ + * $Id: mixgtk_wm.c,v 1.7 2004/06/30 14:07:52 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ #include +#include "mixgtk_wm.h" + #include "mixgtk_widgets.h" #include "mixgtk_config.h" -#include "mixgtk_wm.h" +#include "mixgtk_device.h" +#include "mixgtk_mixvm.h" +#include "mixgtk_mixal.h" +#include "mixgtk_widgets.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk.h" + typedef struct window_info_t_ { mixgtk_dialog_id_t dialog; @@ -34,93 +42,121 @@ typedef struct window_info_t_ GtkCheckMenuItem *menu; const gchar *menu_name; const gchar *config_key; - gboolean visible; + gboolean detached; const gchar *toolbar_name; + void (*detach) (void); + void (*attach) (void); } window_info_t_; -static window_info_t_ infos_[] = { - {MIXGTK_MIXVM_DIALOG, NULL, NULL, "mix_view", "MIX.view", FALSE, NULL}, - {MIXGTK_MIXAL_DIALOG, NULL, NULL, "mixal_view", "MIXAL.view", FALSE, - "mixal_toolbar"}, - {MIXGTK_DEVICES_DIALOG, NULL, NULL, "devices_view", "Devices.view", - FALSE, "devices_toolbar"} -}; +static const gchar *DETACH_YES_ = "Yes"; +static const gchar *DETACH_NO_ = "No"; +static GtkWidget *about_ = NULL; -static size_t INF_NO_ = sizeof (infos_) / sizeof (infos_[0]); +static GtkContainer *mixvm_container_ = NULL; +static GtkContainer *mixal_container_ = NULL; +static GtkContainer *dev_container_ = NULL; -static gboolean split_ = FALSE; static const gchar *TB_MENU_NAME_ = "show_toolbars"; static GtkCheckMenuItem *tb_menu_ = NULL; +static GtkNotebook *notebook_ = NULL; + +static mix_vm_t *vm_ = NULL; + +static void init_info_ (void); +static void init_notebook_ (void); +static void init_dispatcher_ (void); +static void init_mixvm_ (void); +static void init_mixal_ (void); +static void init_dev_ (void); +static void init_signals_ (void); +static void init_visibility_ (void); +static void init_tb_ (void); +static void init_about_ (void); +static void init_autosave_ (void); +static void remove_page_ (gint page); +static void add_page_ (GtkWidget *w, mixgtk_window_id_t id); +static void mixvm_attach_ (void); +static void mixvm_detach_ (void); +static void mixal_attach_ (void); +static void mixal_detach_ (void); +static void dev_attach_ (void); +static void dev_detach_ (void); +static void on_nb_switch_ (GtkNotebook *notebook, GtkNotebookPage *page, + guint page_num, gpointer user_data); -static const gchar *VIEW_YES_ = "Yes"; -static const gchar *VIEW_NO_ = "No"; +static window_info_t_ infos_[] = { + {MIXGTK_MIXVM_DIALOG, NULL, NULL, "detach_vm", "MIX.detach", + FALSE, NULL, mixvm_detach_, mixvm_attach_}, + {MIXGTK_MIXAL_DIALOG, NULL, NULL, "detach_source", "MIXAL.detach", + FALSE, "mixal_toolbar", mixal_detach_, mixal_attach_}, + {MIXGTK_DEVICES_DIALOG, NULL, NULL, "detach_dev", "Devices.detach", + FALSE, "devices_toolbar", dev_detach_, dev_attach_} +}; -/* flag marking that we are inside a restart process */ -static gboolean restart_ = FALSE; +static size_t INF_NO_ = sizeof (infos_) / sizeof (infos_[0]); + gboolean mixgtk_wm_init (void) { - split_ = mixgtk_config_is_split (); - if (split_) - { - gint i; - for (i = 0; i < INF_NO_; ++i) - { - const gchar *view = mixgtk_config_get (infos_[i].config_key); - infos_[i].visible = !view || !strcmp (VIEW_YES_, view); - if (!view) mixgtk_config_update (infos_[i].config_key, VIEW_YES_); - infos_[i].widget = - mixgtk_widget_factory_get_dialog (infos_[i].dialog); - g_return_val_if_fail (infos_[i].widget, FALSE); - infos_[i].menu = GTK_CHECK_MENU_ITEM - (mixgtk_widget_factory_get_child_by_name - (MIXGTK_MAIN, infos_[i].menu_name)); - g_return_val_if_fail (infos_[i].menu, FALSE); - if (infos_[i].visible) gtk_widget_show (infos_[i].widget); - gtk_check_menu_item_set_active (infos_[i].menu, infos_[i].visible); - } - } - else + gint k; + + init_info_ (); + init_notebook_ (); + init_dispatcher_ (); + init_mixvm_ (); + init_mixal_ (); + init_dev_ (); + + for (k = 0; k < INF_NO_; ++k) { - gint k; - for (k = 0; k < INF_NO_; ++k) - if (infos_[k].widget) gtk_widget_destroy (infos_[k].widget); + if (infos_[k].detached) + mixgtk_wm_detach_window (k); + else + mixgtk_wm_attach_window (k); } - tb_menu_ = GTK_CHECK_MENU_ITEM - (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, - TB_MENU_NAME_)); - g_return_val_if_fail (tb_menu_, FALSE); - gtk_check_menu_item_set_active (tb_menu_, mixgtk_config_show_toolbars ()); - mixgtk_wm_show_toolbars (mixgtk_config_show_toolbars ()); + init_tb_ (); + init_about_ (); + init_autosave_ (); + init_visibility_ (); + init_signals_ (); return TRUE; } void -mixgtk_wm_show_window (mixgtk_window_id_t w) +mixgtk_wm_detach_window (mixgtk_window_id_t w) { - g_return_if_fail (w < INF_NO_); - if (!infos_[w].visible) + if (w < INF_NO_) { - infos_[w].visible = TRUE; + (*(infos_[w].detach)) (); + infos_[w].detached = TRUE; gtk_check_menu_item_set_active (infos_[w].menu, TRUE); - mixgtk_config_update (infos_[w].config_key, VIEW_YES_); - gtk_widget_show (infos_[w].widget); + mixgtk_config_update (infos_[w].config_key, DETACH_YES_); + if (infos_[w].widget != NULL) gtk_widget_show (infos_[w].widget); + if (gtk_notebook_get_n_pages (notebook_) < 1) + gtk_widget_hide (GTK_WIDGET (notebook_)); + gtk_widget_show (mixgtk_widget_factory_get_dialog (infos_[w].dialog)); } } void -mixgtk_wm_hide_window (mixgtk_window_id_t w) +mixgtk_wm_attach_window (mixgtk_window_id_t w) { - g_return_if_fail (w < INF_NO_); - if (infos_[w].visible && !restart_) + if (w < INF_NO_) { - infos_[w].visible = FALSE; + gint page = gtk_notebook_page_num (notebook_, infos_[w].widget); + + gtk_widget_hide (mixgtk_widget_factory_get_dialog (infos_[w].dialog)); + + if (page < 0) (*(infos_[w].attach)) (); + + infos_[w].detached = FALSE; gtk_check_menu_item_set_active (infos_[w].menu, FALSE); - mixgtk_config_update (infos_[w].config_key, VIEW_NO_); - gtk_widget_hide (infos_[w].widget); + mixgtk_config_update (infos_[w].config_key, DETACH_NO_); + if (gtk_notebook_get_n_pages (notebook_) == 1) + gtk_widget_show (GTK_WIDGET (notebook_)); } } @@ -128,92 +164,397 @@ void mixgtk_wm_show_toolbars (gboolean show) { static const gchar *MAIN_TB_NAME = "main_toolbar"; + int k; + GtkWidget *toolbar = mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, MAIN_TB_NAME); + if (toolbar != NULL) { if (show) gtk_widget_show (toolbar); else gtk_widget_hide (toolbar); } - - if (split_) + + for (k = 0; k < INF_NO_; ++k) { - int k; - for (k = 0; k < INF_NO_; ++k) - { - if (infos_[k].toolbar_name != NULL) - { - GtkWidget *tb = mixgtk_widget_factory_get_child_by_name - (infos_[k].dialog, infos_[k].toolbar_name); - if (show && tb) gtk_widget_show (tb); - else if (tb) gtk_widget_hide (tb); + if (infos_[k].toolbar_name != NULL) + { + GtkWidget *tb = mixgtk_widget_factory_get_child_by_name + (infos_[k].dialog, infos_[k].toolbar_name); + if (tb) + { + if (show) gtk_widget_show (tb); else gtk_widget_hide (tb); } } } - + mixgtk_config_set_show_toolbars (show); } + /* callbacks */ void -on_view_toggled (GtkCheckMenuItem *item) +on_detach_clicked (GtkWidget *ignored) { - if (!restart_) + gint page = gtk_notebook_get_current_page (notebook_); + if (page >= 0) { gint k; + GtkWidget *w = gtk_notebook_get_nth_page (notebook_, page); + for (k = 0; k < INF_NO_; ++k) - if (item == infos_[k].menu) break; - g_return_if_fail (k < INF_NO_); - if (item->active) - mixgtk_wm_show_window (k); - else - mixgtk_wm_hide_window (k); - mixgtk_config_update (infos_[k].config_key, - (item->active)? VIEW_YES_ : VIEW_NO_); - infos_[k].visible = item->active; + if (infos_[k].widget == w) mixgtk_wm_detach_window (k); } } void -on_one_window_activate () +on_attach_toggled (GtkCheckMenuItem *item) { - mixgtk_config_set_split (FALSE); - restart_ = TRUE; - gtk_widget_destroy (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); + gint k; + for (k = 0; k < INF_NO_; ++k) + if (item == infos_[k].menu) break; + g_return_if_fail (k < INF_NO_); + if (item->active) mixgtk_wm_detach_window (k); + else mixgtk_wm_attach_window (k); + mixgtk_config_update (infos_[k].config_key, + (item->active)? DETACH_YES_ : DETACH_NO_); } void -on_split_windows_activate () +on_window_hide (GtkWidget *w) { - mixgtk_config_set_split (TRUE); - restart_ = TRUE; - gtk_widget_destroy (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); + gint k; + for (k = 0; k < INF_NO_; ++k) + if (w == mixgtk_widget_factory_get_dialog (infos_[k].dialog)) break; + g_return_if_fail (k < INF_NO_); + mixgtk_wm_attach_window (k); } void -on_window_hide (GtkWidget *w) +on_show_toolbars_toggled (GtkCheckMenuItem *item) +{ + if (item->active != mixgtk_config_show_toolbars ()) + mixgtk_wm_show_toolbars (item->active); +} + +/* about box */ +void +on_about_activate (GtkWidget *w, gpointer data) +{ + if (!about_) init_about_ (); + gtk_widget_show (about_); +} + + +static void +init_info_ (void) { gint k; for (k = 0; k < INF_NO_; ++k) - if (w == infos_[k].widget) break; - g_return_if_fail (k < INF_NO_); - mixgtk_wm_hide_window (k); + { + const gchar *txt; + + infos_[k].menu = + GTK_CHECK_MENU_ITEM + (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, + infos_[k].menu_name)); + g_assert (infos_[k].menu != NULL); + txt = mixgtk_config_get (infos_[k].config_key); + infos_[k].detached = txt && !g_ascii_strcasecmp (txt, DETACH_YES_); + } } - -void -on_main_window_destroy (GtkWidget *w, gpointer data) + +static void +init_notebook_ (void) +{ + notebook_ = + GTK_NOTEBOOK (mixgtk_widget_factory_get (MIXGTK_MAIN, + MIXGTK_WIDGET_NOTEBOOK)); + g_assert (notebook_ != NULL); + + gtk_notebook_set_tab_pos (notebook_, GTK_POS_TOP); + gtk_notebook_popup_disable (notebook_); + gtk_notebook_remove_page (notebook_, 0); + + gtk_widget_show (GTK_WIDGET (notebook_)); +} + +static void +add_page_ (GtkWidget *page, mixgtk_window_id_t id) { - if (restart_) + static const gchar *LABELS[] = { + N_("_Virtual machine"), N_("_Source"), N_("_Devices") + }; + + g_assert (page != NULL); + g_assert (id < INF_NO_); + g_assert (notebook_ != NULL); + + gtk_notebook_append_page (notebook_, page, + gtk_label_new_with_mnemonic (LABELS[id])); + gtk_notebook_set_show_tabs (notebook_, + gtk_notebook_get_n_pages (notebook_) > 1); + gtk_widget_show (page); + gtk_widget_show (GTK_WIDGET (notebook_)); +} + +static void +remove_page_ (gint page) +{ + gint pages; + + g_assert (notebook_ != NULL); + gtk_notebook_remove_page (notebook_, page); + + pages = gtk_notebook_get_n_pages (notebook_); + if (pages < 1) gtk_widget_hide (GTK_WIDGET (notebook_)); + else gtk_notebook_set_show_tabs (notebook_, pages > 1); +} + +static void +init_signals_ (void) +{ + gint k; + for (k = 0; k < INF_NO_; ++k) { - mixgtk_restart (); - restart_ = FALSE; + GObject *dialog = + G_OBJECT (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); + + g_assert (dialog); + + g_signal_connect (dialog, "destroy", + G_CALLBACK (on_window_hide), NULL); + g_signal_connect (dialog, "destroy_event", + G_CALLBACK (on_window_hide), NULL); + g_signal_connect (dialog, "delete_event", + G_CALLBACK (on_window_hide), NULL); + g_signal_connect (G_OBJECT (infos_[k].menu), "toggled", + G_CALLBACK (on_attach_toggled), NULL); } - else gtk_main_quit (); + + g_signal_connect (G_OBJECT (notebook_), "switch-page", + G_CALLBACK (on_nb_switch_), NULL); } -void -on_show_toolbars_toggled (GtkCheckMenuItem *item) +static void +init_visibility_ (void) { - if (!restart_ && item->active != mixgtk_config_show_toolbars ()) - mixgtk_wm_show_toolbars (item->active); + gint k; + for (k = 0; k < INF_NO_; ++k) + if (infos_[k].detached) + gtk_widget_show (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); + gtk_widget_show (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); +} + +static void +init_dispatcher_ (void) +{ + if (!mixgtk_cmd_dispatcher_init (MIXGTK_MAIN)) + g_assert (FALSE); + vm_ = mixgtk_cmd_dispatcher_get_vm (); + g_assert (vm_ != NULL); +} + +static void +init_mixvm_ (void) +{ + GtkContainer *vm = + GTK_CONTAINER + (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, MIXGTK_WIDGET_MIXVM)); + + mixvm_container_ = + GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, + MIXGTK_WIDGET_MIXVM_CONTAINER)); + + g_assert (mixvm_container_ != NULL); + + g_assert (vm != NULL); + g_object_ref (G_OBJECT (vm)); + infos_[MIXGTK_MIXVM_WINDOW].widget = GTK_WIDGET (vm); + + mixgtk_mixvm_init (vm_); + mixgtk_mixvm_update_vm_widgets (); + + gtk_widget_show (GTK_WIDGET (vm)); + +} + +static void +init_mixal_ (void) +{ + GtkWidget *page = gtk_scrolled_window_new (NULL, NULL); + GtkWidget *mixal = mixgtk_mixal_init (vm_); + + g_assert (page != NULL); + g_assert (mixal != NULL); + + g_object_ref (page); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (page), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_container_add (GTK_CONTAINER (page), mixal); + + infos_[MIXGTK_MIXAL_WINDOW].widget = page; + + mixal_container_ = + GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_MIXAL_DIALOG, + MIXGTK_WIDGET_MIXAL_CONTAINER)); + + g_assert (mixal_container_ != NULL); + + gtk_container_add (mixal_container_, page); + + gtk_widget_show (mixal); + gtk_widget_show (page); +} + +static void +init_dev_ (void) +{ + GtkWidget *page = gtk_scrolled_window_new (NULL, NULL); + GtkWidget *devs = mixgtk_device_init (vm_); + + g_assert (page != NULL); + g_assert (devs != NULL); + + g_object_ref (page); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (page), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (page), devs); + + infos_[MIXGTK_DEVICES_WINDOW].widget = page; + + dev_container_ = + GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_DEVICES_DIALOG, + MIXGTK_WIDGET_DEV_CONTAINER)); + + g_assert (dev_container_ != NULL); + + gtk_container_add (dev_container_, page); + + gtk_widget_show (devs); + gtk_widget_show (page); +} + +static void +init_tb_ (void) +{ + tb_menu_ = GTK_CHECK_MENU_ITEM + (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, + TB_MENU_NAME_)); + g_assert (tb_menu_ != NULL); + + gtk_check_menu_item_set_active (tb_menu_, mixgtk_config_show_toolbars ()); + mixgtk_wm_show_toolbars (mixgtk_config_show_toolbars ()); + + g_signal_connect (G_OBJECT (tb_menu_), "toggled", + G_CALLBACK (on_show_toolbars_toggled), NULL); +} + +static void +init_autosave_ (void) +{ +#define AUTOSAVE_ITEM_ "save_on_exit" + + GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM + (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, AUTOSAVE_ITEM_)); + if (item) + { + gtk_check_menu_item_set_active (item, mixgtk_config_is_autosave ()); + } +} + +static void +init_about_ (void) +{ +#define VERSION_LABEL_ "version_label" +#define GPL_TEXT_ "gpl_text" + GtkWidget *label; + about_ = mixgtk_widget_factory_get_dialog (MIXGTK_ABOUT_DIALOG); + g_assert (about_ != NULL); + label = mixgtk_widget_factory_get_child_by_name (MIXGTK_ABOUT_DIALOG, + VERSION_LABEL_); + g_assert (label != NULL); + gtk_label_set_text (GTK_LABEL (label), VERSION); + gtk_widget_show (label); +} + +static void +mixvm_attach_ (void) +{ + gtk_container_remove (mixvm_container_, infos_[MIXGTK_MIXVM_WINDOW].widget); + add_page_ (infos_[MIXGTK_MIXVM_WINDOW].widget, MIXGTK_MIXVM_WINDOW); +} + +static void +mixvm_detach_ (void) +{ + gtk_widget_reparent (infos_[MIXGTK_MIXVM_WINDOW].widget, + GTK_WIDGET (mixvm_container_)); +} + +static void +mixal_attach_ (void) +{ + static GtkStatusbar *stat = NULL; + + if (stat == NULL) + { + stat = + GTK_STATUSBAR + (mixgtk_widget_factory_get (MIXGTK_MAIN, MIXGTK_WIDGET_STATUSBAR)); + g_assert (stat); + + } + + mixgtk_mixal_reparent (stat); + gtk_container_remove (mixal_container_, infos_[MIXGTK_MIXAL_WINDOW].widget); + add_page_ (infos_[MIXGTK_MIXAL_WINDOW].widget, MIXGTK_MIXAL_WINDOW); +} + +static void +mixal_detach_ (void) +{ + static GtkStatusbar *stat = NULL; + + if (stat == NULL) + { + stat = + GTK_STATUSBAR + (mixgtk_widget_factory_get (MIXGTK_MIXAL_DIALOG, + MIXGTK_WIDGET_MIXAL_STATUSBAR)); + g_assert (stat); + } + else + gtk_widget_reparent (infos_[MIXGTK_MIXAL_WINDOW].widget, + GTK_WIDGET (mixal_container_)); + + mixgtk_mixal_reparent (stat); +} + +static void +dev_attach_ (void) +{ + gtk_container_remove (dev_container_, infos_[MIXGTK_DEVICES_WINDOW].widget); + add_page_ (infos_[MIXGTK_DEVICES_WINDOW].widget, MIXGTK_DEVICES_WINDOW); +} + +static void +dev_detach_ (void) +{ + gtk_widget_reparent (infos_[MIXGTK_DEVICES_WINDOW].widget, + GTK_WIDGET (dev_container_)); +} + +static void +on_nb_switch_ (GtkNotebook *notebook, GtkNotebookPage *page, + guint page_num, gpointer user_data) +{ + if (!infos_[MIXGTK_MIXAL_WINDOW].detached + && page != NULL + && GTK_WIDGET (page) != infos_[MIXGTK_MIXAL_WINDOW].widget) + mixgtk_mixal_pop_status (); } diff --git a/mixgtk/mixgtk_wm.h b/mixgtk/mixgtk_wm.h index 6a51b9f..c186b33 100644 --- a/mixgtk/mixgtk_wm.h +++ b/mixgtk/mixgtk_wm.h @@ -1,24 +1,24 @@ /* -*-c-*- ---------------- mixgtk_wm.h : - * FUnctions for window management + * Functions for window management * ------------------------------------------------------------------ - * Last change: Time-stamp: <01/02/12 00:23:41 jose> + * $Id: mixgtk_wm.h,v 1.3 2004/06/30 14:07:51 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ @@ -37,10 +37,10 @@ extern gboolean mixgtk_wm_init (void); extern void -mixgtk_wm_show_window (mixgtk_window_id_t w); +mixgtk_wm_attach_window (mixgtk_window_id_t w); extern void -mixgtk_wm_hide_window (mixgtk_window_id_t w); +mixgtk_wm_detach_window (mixgtk_window_id_t w); extern void mixgtk_wm_show_toolbars (gboolean show); -- cgit v1.2.3