From b232782cd79a638fe4103dca4f96abcaac1d291e Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 30 Jun 2004 22:46:15 +0000 Subject: small fixes/attach buttons --- mixgtk/mixgtk.glade | 1900 +++++++++++++++++++++++++---------------------- mixgtk/mixgtk_widgets.c | 1 + mixgtk/mixgtk_widgets.h | 3 +- mixgtk/mixgtk_wm.c | 39 +- 4 files changed, 1051 insertions(+), 892 deletions(-) (limited to 'mixgtk') diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade index a7ef1b4..3b4979c 100644 --- a/mixgtk/mixgtk.glade +++ b/mixgtk/mixgtk.glade @@ -48,7 +48,7 @@ - + True gtk-open 1 @@ -71,7 +71,7 @@ - + True gtk-justify-fill 1 @@ -94,7 +94,7 @@ - + True gtk-execute 1 @@ -123,7 +123,7 @@ - + True gtk-quit 1 @@ -159,7 +159,7 @@ - + True gtk-go-forward 1 @@ -182,7 +182,7 @@ - + True gtk-goto-last 1 @@ -205,7 +205,7 @@ - + True gtk-clear 1 @@ -228,7 +228,7 @@ - + True gtk-index 1 @@ -261,7 +261,7 @@ True - + True gtk-select-font 1 @@ -333,7 +333,7 @@ - + True gtk-zoom-100 1 @@ -354,7 +354,7 @@ - + True gtk-home 1 @@ -375,7 +375,7 @@ - + True gtk-preferences 1 @@ -395,7 +395,7 @@ True - + True gtk-dnd-multiple 1 @@ -464,7 +464,7 @@ - + True gtk-save 1 @@ -2076,6 +2076,7 @@ disk7 2 True + True GTK_ORIENTATION_HORIZONTAL GTK_TOOLBAR_ICONS True @@ -2090,7 +2091,7 @@ disk7 gtk-go-forward True True - False + True @@ -2108,7 +2109,7 @@ disk7 gtk-goto-last True True - False + True @@ -2126,7 +2127,7 @@ disk7 gtk-clear True True - False + True @@ -2144,7 +2145,7 @@ disk7 gtk-index True True - False + True @@ -2175,7 +2176,7 @@ disk7 gtk-select-font True True - False + True @@ -2183,6 +2184,37 @@ disk7 True + + + + True + True + True + True + + + False + False + + + + + + True + Attach window + + True + gtk-dnd + True + True + True + + + + False + True + + 0 @@ -2251,6 +2283,7 @@ disk7 2 True + True GTK_ORIENTATION_HORIZONTAL GTK_TOOLBAR_ICONS True @@ -2283,7 +2316,7 @@ disk7 gtk-zoom-100 True True - False + True @@ -2292,6 +2325,19 @@ disk7 + + + True + True + True + True + + + False + False + + + True @@ -2301,7 +2347,7 @@ disk7 gtk-select-font True True - False + True @@ -2309,6 +2355,35 @@ disk7 True + + + + True + True + True + True + + + False + False + + + + + + True + + True + gtk-dnd + True + True + True + + + False + True + + 0 @@ -2481,7 +2556,7 @@ disk7 GTK_WIN_POS_NONE False 640 - 290 + 268 True False True @@ -2491,564 +2566,888 @@ disk7 GDK_GRAVITY_NORTH_WEST - - 5 + True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + False + 0 - + True - False - 0 + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_ICONS + True + True + + + + True + Font + True + gtk-select-font + True + True + True + + + + False + True + + + + + + True + True + True + True + + + False + False + + + + + + True + + True + gtk-dnd + True + True + True + + + False + True + + + + + 0 + False + False + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - 1 + True False - 1 + 0 - - 2 + + 1 True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + False + 1 - - 8 + + 2 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.5 + GTK_SHADOW_ETCHED_IN - - 0 - 0 + + 8 True - I1 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 2 - 3 - 0 - 1 - fill - - - + 3 + 6 + False + 6 + 11 - - - 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 + A + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + fill + + + - - - 0 - 0 - True - False - True - 0 - - True - * - False - 19 - - - - 1 - 2 - 0 - 1 - - - - + + + 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 - True - False - True - 0 - - True - * - False - 9 - - - - 3 - 4 - 1 - 2 - - - - + + + 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 - True - False - True - 0 - + 00 00 - True - * - False - 9 - - - - 3 - 4 - 0 - 1 - - - - + + + 0 + 0 + True + True + True + False + True + 0 + + True + * + False + 19 + + + + 1 + 2 + 0 + 1 + + + + - - - 0 - 0 - True - X - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - 1 - 1 - 2 - fill - - - + + + 0 + 0 + True + True + False + True + 0 + + True + * + False + 9 + + + + 3 + 4 + 1 + 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 + True + False + True + 0 + + 00 00 + True + * + False + 9 + + + + 3 + 4 + 0 + 1 + + + + - - - 0 - 0 - True - I4 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 4 - 5 - 0 - 1 - fill - - - + + + 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 - I5 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 4 - 5 - 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 + + + - - - 16 - 16 - True - I6 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + + + 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 + + - - 4 - 5 - 2 - 3 - fill - - - - 0 - 0 + True - J + Registers False False - GTK_JUSTIFY_CENTER + GTK_JUSTIFY_LEFT False False 0.5 0.5 - 0 + 2 0 - 0 - 1 - 2 - 3 - fill - + label_item + + + 5 + False + True + + - - - 0 - 0 - True - True - False - True - 0 - + 00 00 00 00 00 - True - * - False - 19 - - - - 1 - 2 - 1 - 2 - - - - + + + True + False + 0 - - 0 - 0 + + 2 True - True - False - True - 0 - - True - * - False - 9 - - - - 5 - 6 - 0 - 1 - - - - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 5 - 6 - 1 - 2 - - - - + + + 1 + True + False + 5 - - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - + + + 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 + + - 5 - 6 - 2 - 3 - - + 0 + False + False - - 0 - 0 - True - True - False - True - 0 - - True - * - False - 9 - - - - 3 - 4 - 2 - 3 - - - + - + + 2 True - False - 0 + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - 0 - 0 + + 4 True - True - False - True - 0 - - True - * - False - 9 - + 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 + + - - 0 - False - False - - + + True + Location + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 + + + label_item + - 1 - 2 - 2 - 3 - fill - fill + 0 + False + False + GTK_PACK_END - - - - - - True - Registers - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - - label_item - - - - - 5 - False - True - - - - - - True - False - 0 + + + 5 + False + True + + - + 2 True 0 @@ -3056,28 +3455,27 @@ disk7 GTK_SHADOW_ETCHED_IN - - 1 + + 5 True - False + True 5 - - 2 + 0 0 True - Greater - True - G - True - GTK_RELIEF_NORMAL - True - False - False - True - + Uptime: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 0 @@ -3087,22 +3485,20 @@ disk7 - - 2 + 0 0 True - Equal - True - E - True - GTK_RELIEF_NORMAL - True - False - False - True - greater_radio - + 00000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 0 @@ -3112,54 +3508,43 @@ disk7 - - 2 + 0 0 True - Lesser - True - L - True - GTK_RELIEF_NORMAL - True - False - False - True - greater_radio - - - - 0 - False - False - - - - - - 7 - True + Elapsed: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 - 0 + 3 False False - + + 0 + 0 True - True - Overflow - True - GTK_RELIEF_NORMAL - True - False - False - True - + 000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 0 @@ -3167,99 +3552,48 @@ disk7 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 + Program: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 - 5 + 2 False False - + + 0 + 0 True - View loc address - True - GTK_RELIEF_NORMAL - True - - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - + 000000 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 5 + 0 - 1 + 0 False False @@ -3268,12 +3602,12 @@ disk7 - + True - Location + Times False False - GTK_JUSTIFY_LEFT + GTK_JUSTIFY_CENTER False False 0.5 @@ -3287,182 +3621,58 @@ disk7 - 0 + 5 False - False - GTK_PACK_END + True - 5 + 2 False - True + False - - 2 + + 7 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 - - + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - - 0 - 0 + True - 000000 - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 5 - 0 + True + GDK_BUTTON_PRESS_MASK + True + True + False + True - - 0 - False - False - - + True - Times + Memory False False - GTK_JUSTIFY_CENTER + GTK_JUSTIFY_LEFT False False 0.5 @@ -3476,96 +3686,38 @@ disk7 - 5 - False + 3 + True True + GTK_PACK_END - - 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 - - + MIX Virtual Machine + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 2 + 0 - 3 - True - True - GTK_PACK_END + label_item - - - - - True - MIX Virtual Machine - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 2 - 0 - - label_item + 0 + True + True diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c index 80bb592..0f1f1e6 100644 --- a/mixgtk/mixgtk_widgets.c +++ b/mixgtk/mixgtk_widgets.c @@ -50,6 +50,7 @@ static const gchar * dnames_[] = { /* widget names */ static const gchar *names_[] = { "main_statusbar", + "attach_button", "main_notebook", "mixvm_widget", "mixvm_container", diff --git a/mixgtk/mixgtk_widgets.h b/mixgtk/mixgtk_widgets.h index 023c068..764385c 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 * ------------------------------------------------------------------ - * $Id: mixgtk_widgets.h,v 1.13 2004/06/30 14:07:52 jao Exp $ + * $Id: mixgtk_widgets.h,v 1.14 2004/06/30 22:46:15 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2004 Free Software Foundation, Inc. * @@ -48,6 +48,7 @@ typedef enum { /* enumeration of mixvm widget ids */ typedef enum { MIXGTK_WIDGET_STATUSBAR, + MIXGTK_WIDGET_ATTACH_BUTTON, MIXGTK_WIDGET_NOTEBOOK, /* the notebook */ MIXGTK_WIDGET_MIXVM, /* virtual machine */ MIXGTK_WIDGET_MIXVM_CONTAINER, diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c index 5d4f287..ec7c247 100644 --- a/mixgtk/mixgtk_wm.c +++ b/mixgtk/mixgtk_wm.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_wm.c : * Implementation of the functions declared in mixgtk_wm.h * ------------------------------------------------------------------ - * $Id: mixgtk_wm.c,v 1.8 2004/06/30 14:50:43 jao Exp $ + * $Id: mixgtk_wm.c,v 1.9 2004/06/30 22:46:15 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -73,7 +73,6 @@ 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); @@ -86,7 +85,7 @@ static void on_nb_switch_ (GtkNotebook *notebook, GtkWidget *page, static window_info_t_ infos_[] = { {MIXGTK_MIXVM_DIALOG, NULL, NULL, "detach_vm", "MIX.detach", - FALSE, NULL, mixvm_detach_, mixvm_attach_}, + FALSE, "mixvm_toolbar", 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", @@ -157,6 +156,7 @@ mixgtk_wm_attach_window (mixgtk_window_id_t w) mixgtk_config_update (infos_[w].config_key, DETACH_NO_); if (gtk_notebook_get_n_pages (notebook_) == 1) gtk_widget_show (GTK_WIDGET (notebook_)); + gtk_notebook_set_current_page (notebook_, -1); } } @@ -237,6 +237,13 @@ on_show_toolbars_toggled (GtkCheckMenuItem *item) mixgtk_wm_show_toolbars (item->active); } +void +on_widget_attach (GtkWidget *ign, gpointer id) +{ + mixgtk_wm_attach_window (GPOINTER_TO_INT (id)); +} + + /* about box */ void on_about_activate (GtkWidget *w, gpointer data) @@ -298,19 +305,6 @@ add_page_ (GtkWidget *page, mixgtk_window_id_t id) 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) { @@ -320,8 +314,15 @@ init_signals_ (void) GObject *dialog = G_OBJECT (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); - g_assert (dialog); + GObject *button = + G_OBJECT (mixgtk_widget_factory_get (infos_[k].dialog, + MIXGTK_WIDGET_ATTACH_BUTTON)); + g_assert (dialog != NULL); + g_assert (button != NULL); + + g_signal_connect (button, "clicked", + G_CALLBACK (on_widget_attach), GINT_TO_POINTER (k)); g_signal_connect (dialog, "destroy", G_CALLBACK (on_window_hide), NULL); g_signal_connect (dialog, "destroy_event", @@ -341,6 +342,10 @@ init_visibility_ (void) for (k = 0; k < INF_NO_; ++k) if (infos_[k].detached) gtk_widget_show (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); + + if (gtk_notebook_get_n_pages (notebook_) > 0) + gtk_notebook_set_current_page (notebook_, 0); + gtk_widget_show (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); } -- cgit v1.2.3