[patch] Layout manager for Anjuta2
- From: "Gustavo M. Giráldez" <gustavo giraldez gmx net>
- To: Gnome DevTools list <gnome-devtools gnome org>
- Cc: JP Rosevear <jpr ximian com>, Naba Kumar <kh_naba yahoo com>
- Subject: [patch] Layout manager for Anjuta2
- Date: Sun, 9 Dec 2001 15:56:16 -0300
Hi,
This patch adds a layout managment dialog to anjuta2. It allows the showing or hidding of individual docking items, and loading and saving of different named layouts. I uploaded some screenshots to see how it looks:
http://www.dynaweb.com.ar/gustavo/layout1.png
http://www.dynaweb.com.ar/gustavo/layout2.png
The dialog is implemented with libglade, so the glade file needs to be added (in the src directory).
For this patch to work you need the latest cvs version of gdl, as I added an API call. Also, earlier today I commited a small patch to anjuta2 due to a change in GdlDock API, so it continued to work.
So, may I commit?
Gustavo
? src/layout.glade
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/anjuta2/ChangeLog,v
retrieving revision 1.156
diff -u -r1.156 ChangeLog
--- ChangeLog 2001/12/09 18:34:38 1.156
+++ ChangeLog 2001/12/09 18:38:45
@@ -1,5 +1,30 @@
2001-12-09 Gustavo Giráldez <gustavo giraldez gmx net>
+ * src/layout.glade: New file, layout dialog
+
+ * src/Makefile.am: Install new glade file. Define ANJUTA_GLADEDIR.
+
+ * src/anjuta.xml: Added layout managment UI entries.
+
+ * src/window.c (anjuta_window_load_layout)
+ (anjuta_window_save_layout): Changed API, adding the name of the
+ layout to load/save.
+ (find_layout_name): New support function to implement named layout
+ loading/saving.
+ (anjuta_window_add_widget): Call
+ gdl_dock_item_set_default_position with passed loc.
+ (layout_manager): New function callback implementing layout
+ managment dialog.
+ Changed calls to anjuta_window_{load,save}_layout in several places.
+
+ * src/anjuta-windows.c (anjuta_new_window): Changed
+ anjuta_window_load_layout call.
+
+ * src/tools.c (update_plugins): Changed anjuta_window_save_layout
+ call.
+
+2001-12-09 Gustavo Giráldez <gustavo giraldez gmx net>
+
* src/window.c (anjuta_window_load_layout): Fix
gdl_dock_layout_load call due to API change in GdlDock.
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/anjuta2/src/Makefile.am,v
retrieving revision 1.52
diff -u -r1.52 Makefile.am
--- src/Makefile.am 2001/11/04 01:55:56 1.52
+++ src/Makefile.am 2001/12/09 18:38:46
@@ -3,6 +3,7 @@
CFLAGS += \
-DANJUTA_IMAGES=\""$(datadir)/anjuta2/images"\" \
+ -DANJUTA_GLADEDIR=\""$(datadir)/anjuta2/glade"\" \
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGNOME_DATADIR=\""$(datadir)"\" \
@@ -51,7 +52,10 @@
anjutadatadir = $(datadir)/anjuta2
anjutadata_DATA = layout.xml
+gladedir = $(datadir)/anjuta2/glade
+glade_DATA = layout.glade
+
@XML_I18N_MERGE_OAF_RULE@
-EXTRA_DIST = anjuta.xml $(images_DATA) $(oaf_DATA) $(anjutadata_DATA)
+EXTRA_DIST = anjuta.xml $(images_DATA) $(oaf_DATA) $(anjutadata_DATA) $(glade_DATA)
Index: src/anjuta-windows.c
===================================================================
RCS file: /cvs/gnome/anjuta2/src/anjuta-windows.c,v
retrieving revision 1.10
diff -u -r1.10 anjuta-windows.c
--- src/anjuta-windows.c 2001/11/04 01:55:56 1.10
+++ src/anjuta-windows.c 2001/12/09 18:38:46
@@ -36,7 +36,7 @@
tools_init (window, splash);
- anjuta_window_load_layout (window);
+ anjuta_window_load_layout (window, NULL);
gtk_widget_show (GTK_WIDGET (window));
Index: src/anjuta.xml
===================================================================
RCS file: /cvs/gnome/anjuta2/src/anjuta.xml,v
retrieving revision 1.10
diff -u -r1.10 anjuta.xml
--- src/anjuta.xml 2001/11/16 02:34:12 1.10
+++ src/anjuta.xml 2001/12/09 18:38:47
@@ -21,6 +21,9 @@
_tip="Customize toolbars"
pixtype="stock" pixname="Preferences"/>
+ <cmd name="ViewLayout" _label="Layout..."
+ _tip="Manage dock items layout"/>
+
</commands>
<menu>
@@ -50,6 +53,8 @@
<submenu name="View" _label="_View">
+ <menuitem name="ViewLayout" verb=""/>
+
<menuitem name="ViewFullscreen" verb=""/>
<placeholder/>
Index: src/tools.c
===================================================================
RCS file: /cvs/gnome/anjuta2/src/tools.c,v
retrieving revision 1.14
diff -u -r1.14 tools.c
--- src/tools.c 2001/11/10 14:53:52 1.14
+++ src/tools.c 2001/12/09 18:38:48
@@ -317,7 +317,7 @@
}
if (save_layout)
- anjuta_window_save_layout (shell->window);
+ anjuta_window_save_layout (shell->window, NULL);
CORBA_exception_free (&ev);
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/anjuta2/src/window.c,v
retrieving revision 1.46
diff -u -r1.46 window.c
--- src/window.c 2001/12/09 18:34:41 1.46
+++ src/window.c 2001/12/09 18:38:49
@@ -28,11 +28,42 @@
#include "window.h"
#include "tools.h"
#include <gdl/gdl-dock.h>
+#include <glade/glade.h>
+#include <gnome-xml/parser.h>
+#include <gal/e-table/e-table-simple.h>
+#include <gal/e-table/e-table.h>
+#include <gdl/gdl-tools.h>
#include <libanjuta/libanjuta.h>
-#include <gnome-xml/parser.h>
+#define DEFAULT_LAYOUT "Default"
+#define LAYOUT_GLADE_FILE "layout.glade"
+
+#define LAYOUT_SPEC "<ETableSpecification cursor-mode=\"line\" selection-mode=\"browse\" draw-focus=\"true\"> \
+ <ETableColumn model_col=\"0\" _title=\"Dock Item\" expansion=\"1.0\" minimum_width=\"100\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"1\" _title=\"Show\" expansion=\"1.0\" minimum_width=\"30\" resizable=\"true\" cell=\"checkbox\" compare=\"integer\"/> \
+ <ETableState> \
+ <column source=\"0\"/> \
+ <column source=\"1\"/> \
+ <grouping> <leaf column=\"0\" ascending=\"true\"/> </grouping> \
+ </ETableState> \
+</ETableSpecification>"
+
+#define DOCKITEM_COLUMN 0
+#define SHOW_COLUMN 1
+
+typedef struct {
+ gchar *name;
+ GdlDockItem *item;
+} ItemModelData;
+
+
+/* ---- Private prototypes ----- */
+
+static void layout_manager (GtkWidget *w, AnjutaWindow *window);
+
+
static void
tmp_exit (GtkWidget *w, AnjutaWindow *window)
{
@@ -127,6 +158,7 @@
/* Menu verbs */
static BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("FileExit", tmp_exit),
+ BONOBO_UI_UNSAFE_VERB ("ViewLayout", layout_manager),
BONOBO_UI_UNSAFE_VERB ("SettingsPlugins", tools_plugin_manager),
#if 0
BONOBO_UI_UNSAFE_VERB ("SettingsSettings", dialog_prefs_cb),
@@ -177,7 +209,7 @@
static gint
save_layout_idle_cb (gpointer data)
{
- anjuta_window_save_layout (ANJUTA_WINDOW (data));
+ anjuta_window_save_layout (ANJUTA_WINDOW (data), NULL);
return FALSE;
}
@@ -249,6 +281,8 @@
gtk_widget_queue_draw (GTK_WIDGET(window));
gtk_widget_queue_resize (GTK_WIDGET(window));
+
+ window->layouts = NULL;
}
GtkWidget *
@@ -270,12 +304,34 @@
GNOME_Development_Environment_Shell_WindowLocation loc)
{
GtkWidget *item;
+ GdlDockPlacement pos = GDL_DOCK_FLOATING;
+
item = gdl_dock_item_new (id, name, GDL_DOCK_ITEM_BEH_NORMAL);
gtk_container_add (GTK_CONTAINER (item), w);
gdl_dock_bind_item (GDL_DOCK (window->dock), GDL_DOCK_ITEM (item));
gtk_object_set_data (GTK_OBJECT (w), "dockitem", item);
+ switch (loc) {
+ case ANJUTA_WINDOW_LOC_TOP:
+ pos = GDL_DOCK_TOP;
+ break;
+ case ANJUTA_WINDOW_LOC_BOTTOM:
+ pos = GDL_DOCK_BOTTOM;
+ break;
+ case ANJUTA_WINDOW_LOC_LEFT:
+ pos = GDL_DOCK_LEFT;
+ break;
+ case ANJUTA_WINDOW_LOC_RIGHT:
+ pos = GDL_DOCK_RIGHT;
+ break;
+ default:
+ pos = GDL_DOCK_FLOATING;
+ break;
+ };
+
+ gdl_dock_item_set_default_position (GDL_DOCK_ITEM (item), pos, NULL);
+
gtk_widget_show_all (item);
}
@@ -288,26 +344,67 @@
gdl_dock_unbind_item (GDL_DOCK (window->dock), GDL_DOCK_ITEM (item));
}
+static xmlNodePtr
+find_layout_name (xmlDocPtr doc, const gchar *name)
+{
+ xmlNodePtr ret = NULL, node;
+
+ g_return_val_if_fail (doc != NULL, NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ node = doc->root;
+ if (strcmp (node->name, "dock-layout")) {
+ /* malformed xml file */
+ g_warning (_("Malformed XML layout file"));
+ return NULL;
+ };
+
+ for (node = node->childs; node && !ret; node = node->next) {
+ if (!strcmp (node->name, "layout")) {
+ xmlChar *layout_name = xmlGetProp (node, "name");
+ if (strcmp (name, layout_name) == 0)
+ ret = node;
+ free (layout_name);
+ };
+ };
+ return ret;
+}
+
void
-anjuta_window_save_layout (AnjutaWindow *window)
+anjuta_window_save_layout (AnjutaWindow *window, const gchar *name)
{
char *dir;
char *filename;
- xmlDocPtr doc;
xmlNodePtr node;
FILE *f;
+
+ if (!name)
+ name = DEFAULT_LAYOUT;
- doc = xmlNewDoc ("1.0");
- doc->root = xmlNewDocNode (doc, NULL, "dock-layout", NULL);
- node = xmlNewChild (doc->root, NULL, "layout", NULL);
- xmlSetProp (node, "name", "Default");
+ if (!window->layouts) {
+ /* create XML document if necessary */
+ window->layouts = xmlNewDoc ("1.0");
+ window->layouts->root = xmlNewDocNode (window->layouts, NULL,
+ "dock-layout", NULL);
+ };
+
+ node = find_layout_name (window->layouts, name);
+ if (node) {
+ /* node is already there, so first delete it */
+ xmlUnlinkNode (node);
+ xmlFreeNode (node);
+ };
+
+ /* create the new node layout */
+ node = xmlNewChild (window->layouts->root, NULL, "layout", NULL);
+ xmlSetProp (node, "name", name);
gdl_dock_layout_save (GDL_DOCK (window->dock), node);
dir = gnome_util_prepend_user_home (".anjuta2");
-
+
if (!g_file_test (dir, G_FILE_TEST_ISDIR)) {
mkdir (dir, 0755);
if (!g_file_test (dir, G_FILE_TEST_ISDIR)) {
@@ -320,12 +417,11 @@
filename = gnome_util_prepend_user_home (".anjuta2/layout.xml");
f = fopen (filename, "w");
if (f) {
- xmlDocDump (f, doc);
+ xmlDocDump (f, window->layouts);
fclose (f);
} else {
anjuta_error_dialog ("Could not save layout.");
}
- xmlFreeDoc (doc);
}
static xmlDocPtr
@@ -348,27 +444,32 @@
}
void
-anjuta_window_load_layout (AnjutaWindow *window)
+anjuta_window_load_layout (AnjutaWindow *window, const gchar *name)
{
char *filename;
- xmlDocPtr doc;
- xmlNodePtr node;
- filename = gnome_util_prepend_user_home (".anjuta2/layout.xml");
- if (!(doc = load_layout_from_file (window, filename))) {
- g_free (filename);
- filename = g_concat_dir_and_file (GNOME_DATADIR "/anjuta2",
- "layout.xml");
- if (!(doc = load_layout_from_file (window, filename))) {
+ if (!name)
+ name = DEFAULT_LAYOUT;
+
+ /* load layouts from xml file if necessary */
+ if (!window->layouts) {
+ filename = gnome_util_prepend_user_home (".anjuta2/layout.xml");
+ if (!(window->layouts = load_layout_from_file (window, filename))) {
+ g_free (filename);
+ filename = g_concat_dir_and_file (GNOME_DATADIR "/anjuta2",
+ "layout.xml");
+ window->layouts = load_layout_from_file (
+ window, filename);
}
- }
- g_free (filename);
+ g_free (filename);
+ };
- if (doc) {
- if (doc->root->childs->childs)
- gdl_dock_layout_load (GDL_DOCK (window->dock),
- doc->root->childs);
- xmlFreeDoc (doc);
+ if (window->layouts) {
+ xmlNodePtr node;
+
+ node = find_layout_name (window->layouts, name);
+ if (node)
+ gdl_dock_layout_load (GDL_DOCK (window->dock), node);
}
}
@@ -438,4 +539,286 @@
alloc = gtk_object_get_data (GTK_OBJECT (window), "windowpos");
g_free (alloc);
+
+ if (window->layouts)
+ xmlFreeDoc (window->layouts);
+}
+
+
+/* ---- ETableModel functions ----- */
+
+static int
+layout_col_count (ETableModel *etm, void *data)
+{
+ return 2;
+}
+
+static int
+layout_row_count (ETableModel *etm, void *data)
+{
+ GArray *items = (GArray *) data;
+ return items->len;
+}
+
+static void *
+layout_value_at (ETableModel *etm, int col, int row, void *data)
+{
+ ItemModelData *imd;
+ GArray *items = (GArray *) data;
+
+ imd = &g_array_index (items, ItemModelData, row);
+ switch (col) {
+ case DOCKITEM_COLUMN:
+ return (void *) imd->name;
+ case SHOW_COLUMN:
+ return (void *) GDL_DOCK_ITEM_IS_SHOWN (imd->item);
+ default:
+ return NULL;
+ };
+}
+
+static void
+layout_set_value_at (ETableModel *etm, int col, int row, const void *val, void *data)
+{
+ GArray *items = (GArray *) data;
+ ItemModelData *imd = &g_array_index (items, ItemModelData, row);
+
+ if (col == SHOW_COLUMN) {
+ gboolean shown;
+ shown = (gboolean) val;
+ if (shown)
+ gdl_dock_item_show (imd->item);
+ else
+ gdl_dock_item_hide (imd->item);
+ gtk_object_set_user_data (GTK_OBJECT (etm), GINT_TO_POINTER (TRUE));
+ };
+}
+
+static gboolean
+layout_is_cell_editable (ETableModel *etm, int col, int row, void *data)
+{
+ return (col == SHOW_COLUMN);
+}
+
+/* ----- Dialog callbacks ----- */
+
+static void
+destroy_layout_list_item (GtkObject *object, gpointer data)
+{
+ gpointer user_data = gtk_object_get_user_data (object);
+ g_free (user_data);
+ gtk_object_set_user_data (object, NULL);
+}
+
+static GtkWidget *
+create_layout_list_item (const gchar *layout_name)
+{
+ GtkWidget *li;
+
+ li = gtk_list_item_new_with_label (layout_name);
+ gtk_object_set_user_data (GTK_OBJECT (li), g_strdup (layout_name));
+ gtk_signal_connect (GTK_OBJECT (li), "destroy", destroy_layout_list_item, NULL);
+
+ return li;
+}
+
+static void
+save_layout_cb (GtkWidget *w, gpointer data)
+{
+ GladeXML *gui = (GladeXML *) data;
+ GtkWidget *newlayout_entry;
+ gchar *layout_name;
+ xmlNodePtr node;
+ AnjutaWindow *window;
+
+ newlayout_entry = glade_xml_get_widget (gui, "newlayout_entry");
+ layout_name = gtk_editable_get_chars (GTK_EDITABLE (newlayout_entry), 0, -1);
+ if (anjuta_is_empty_string (layout_name)) {
+ g_free (layout_name);
+ anjuta_error_dialog (_("You must provide a name for the layout"));
+ return;
+ };
+
+ window = ANJUTA_WINDOW (gtk_object_get_user_data (GTK_OBJECT (gui)));
+ node = find_layout_name (window->layouts, layout_name);
+ if (!node) {
+ /* the layout is new, so add the list item */
+ GtkWidget *li, *layouts_list;
+
+ layouts_list = glade_xml_get_widget (gui, "layouts_list");
+ li = create_layout_list_item (layout_name);
+ gtk_container_add (GTK_CONTAINER (layouts_list), li);
+ gtk_widget_show (li);
+ };
+ anjuta_window_save_layout (window, layout_name);
+ g_free (layout_name);
+}
+
+static void
+set_layout_entry_cb (GtkWidget *list, GtkWidget *child, gpointer data)
+{
+ GladeXML *gui = (GladeXML *) data;
+ GtkWidget *newlayout_entry = glade_xml_get_widget (gui, "newlayout_entry");
+ gchar *layout_name;
+
+ /* save the selected layout name in entry and as list's user_data */
+ layout_name = gtk_object_get_user_data (GTK_OBJECT (child));
+ gtk_entry_set_text (GTK_ENTRY (newlayout_entry), layout_name);
+ gtk_object_set_user_data (GTK_OBJECT (list), child);
+}
+
+static void
+load_layout_cb (GtkWidget *w, gpointer data)
+{
+ GladeXML *gui = (GladeXML *) data;
+ GtkWidget *layouts_list = glade_xml_get_widget (gui, "layouts_list");
+ GtkWidget *li;
+ gchar *layout_name;
+ AnjutaWindow *window;
+
+ li = gtk_object_get_user_data (GTK_OBJECT (layouts_list));
+ if (li) {
+ layout_name = gtk_object_get_user_data (GTK_OBJECT (li));
+ window = ANJUTA_WINDOW (gtk_object_get_user_data (GTK_OBJECT (gui)));
+
+ /* load selected layout and save it as default */
+ anjuta_window_load_layout (window, layout_name);
+ anjuta_window_save_layout (window, NULL);
+ };
+}
+
+static void
+delete_layout_cb (GtkWidget *w, gpointer data)
+{
+ GladeXML *gui = (GladeXML *) data;
+ GtkWidget *layouts_list = glade_xml_get_widget (gui, "layouts_list");
+ GtkWidget *li;
+
+ li = gtk_object_get_user_data (GTK_OBJECT (layouts_list));
+ if (li) {
+ xmlNodePtr node;
+ AnjutaWindow *window;
+ gchar *layout_name;
+
+ layout_name = gtk_object_get_user_data (GTK_OBJECT (li));
+ window = ANJUTA_WINDOW (gtk_object_get_user_data (GTK_OBJECT (gui)));
+ node = find_layout_name (window->layouts, layout_name);
+ if (node) {
+ xmlUnlinkNode (node);
+ xmlFreeNode (node);
+ /* this is necessary to insure layout file saving */
+ anjuta_window_save_layout (window, NULL);
+ };
+ gtk_container_remove (GTK_CONTAINER (layouts_list), li);
+ gtk_object_set_user_data (GTK_OBJECT (layouts_list), NULL);
+ };
+}
+
+static void
+layout_manager (GtkWidget *w,
+ AnjutaWindow *window)
+{
+ GladeXML *gui;
+ GtkWidget *dialog, *dockitems_ph;
+ GtkWidget *layouts_list;
+
+ GtkWidget *e_table;
+ ETableModel *e_table_model = NULL;
+
+ GdlDock *dock;
+ GList *items, *l;
+ GArray *data;
+ gint count, i;
+
+ g_return_if_fail (IS_ANJUTA_WINDOW (window));
+
+ /* load ui */
+ gui = glade_xml_new (ANJUTA_GLADEDIR "/" LAYOUT_GLADE_FILE, NULL);
+ if (!gui) {
+ g_warning (_("Could not load layout user interface file '%s'"),
+ LAYOUT_GLADE_FILE);
+ return;
+ };
+
+ /* build item array for faster, constant time, access */
+ dock = GDL_DOCK (window->dock);
+ items = gdl_dock_get_named_items (dock);
+ count = g_list_length (items);
+ data = g_array_new (FALSE, FALSE, sizeof (ItemModelData));
+ g_array_set_size (data, count);
+ for (l = items, i = 0; l; l = l->next, i++) {
+ ItemModelData *imd = &g_array_index (data, ItemModelData, i);
+
+ imd->item = GDL_DOCK_ITEM (l->data);
+ gtk_object_get (GTK_OBJECT (l->data), "long_name", &imd->name, NULL);
+ };
+ g_list_free (items);
+
+ /* get ui widget references and placeholders */
+ dialog = glade_xml_get_widget (gui, "layout_dialog");
+ dockitems_ph = glade_xml_get_widget (gui, "dockitems_ph");
+
+ /* build dock item table */
+ e_table_model = e_table_simple_new (
+ layout_col_count, layout_row_count, NULL,
+ layout_value_at, layout_set_value_at, layout_is_cell_editable,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ data);
+ gtk_object_set_user_data (GTK_OBJECT (e_table_model), GINT_TO_POINTER (TRUE));
+
+ e_table = e_table_new (e_table_model, NULL, LAYOUT_SPEC, NULL);
+ gtk_widget_set_usize (e_table, 200, 200);
+ gtk_container_add (GTK_CONTAINER (dockitems_ph), e_table);
+ gtk_widget_show (e_table);
+
+ /* layouts page construction */
+ gtk_object_set_user_data (GTK_OBJECT (gui), window);
+ glade_xml_signal_connect_data (gui, "on_newlayout_entry_activate",
+ save_layout_cb, gui);
+ glade_xml_signal_connect_data (gui, "on_save_button_clicked",
+ save_layout_cb, gui);
+ glade_xml_signal_connect_data (gui, "on_load_button_clicked",
+ load_layout_cb, gui);
+ glade_xml_signal_connect_data (gui, "on_delete_button_clicked",
+ delete_layout_cb, gui);
+ glade_xml_signal_connect_data (gui, "on_layouts_list_select_child",
+ set_layout_entry_cb, gui);
+
+ /* build layouts list */
+ layouts_list = glade_xml_get_widget (gui, "layouts_list");
+ if (window->layouts) {
+ xmlNodePtr node;
+ GList *litems = NULL;
+ GtkWidget *li;
+ xmlChar *layout_name;
+
+ node = window->layouts->root;
+ for (node = node->childs; node; node = node->next) {
+ if (!strcmp (node->name, "layout")) {
+ layout_name = xmlGetProp (node, "name");
+ /* don't add the default layout */
+ if (strcmp (layout_name, DEFAULT_LAYOUT)) {
+ li = create_layout_list_item (layout_name);
+ gtk_widget_show (li);
+ litems = g_list_append (litems, li);
+ };
+ free (layout_name);
+ };
+ };
+ gtk_list_append_items (GTK_LIST (layouts_list), litems);
+ };
+
+ /* finally run the dialog */
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ /* save layout to keep changes */
+ if (GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (e_table_model))))
+ anjuta_window_save_layout (window, NULL);
+
+ for (i = 0; i < data->len; i++)
+ g_free (g_array_index (data, ItemModelData, i).name);
+ g_array_free (data, TRUE);
+
+ gtk_object_unref (GTK_OBJECT (e_table_model));
+ gtk_object_unref (GTK_OBJECT (gui));
}
Index: src/window.h
===================================================================
RCS file: /cvs/gnome/anjuta2/src/window.h,v
retrieving revision 1.20
diff -u -r1.20 window.h
--- src/window.h 2001/11/04 01:55:57 1.20
+++ src/window.h 2001/12/09 18:38:49
@@ -42,7 +42,8 @@
BonoboUIContainer *ui_container;
GtkWidget *dock;
-
+ xmlDocPtr layouts;
+
gint timeout_id;
};
@@ -60,8 +61,8 @@
void anjuta_window_remove_widget (AnjutaWindow *window,
GtkWidget *w);
-void anjuta_window_save_layout (AnjutaWindow *window);
-void anjuta_window_load_layout (AnjutaWindow *window);
+void anjuta_window_save_layout (AnjutaWindow *window, const gchar *name);
+void anjuta_window_load_layout (AnjutaWindow *window, const gchar *name);
#endif
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>Layout-mgr</name>
<program_name>layout-mgr</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>layout</translatable_strings_file>
</project>
<widget>
<class>GnomeDialog</class>
<name>layout_dialog</name>
<title>Layout Managment</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox1</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area1</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button5</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
</widget>
</widget>
<widget>
<class>GtkNotebook</class>
<name>notebook1</name>
<can_focus>True</can_focus>
<show_tabs>True</show_tabs>
<show_border>True</show_border>
<tab_pos>GTK_POS_TOP</tab_pos>
<scrollable>False</scrollable>
<tab_hborder>2</tab_hborder>
<tab_vborder>2</tab_vborder>
<popup_enable>False</popup_enable>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox2</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>dockitems_ph</name>
<border_width>5</border_width>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label1</name>
<label>Dock items</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<widget>
<class>GtkHBox</class>
<name>hbox3</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<name>newlayout_entry</name>
<can_focus>True</can_focus>
<signal>
<name>activate</name>
<handler>on_newlayout_entry_activate</handler>
<last_modification_time>Sun, 09 Dec 2001 13:57:51 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>save_button</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_save_button_clicked</handler>
<last_modification_time>Sun, 09 Dec 2001 13:58:34 GMT</last_modification_time>
</signal>
<label>Save</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkViewport</class>
<name>viewport1</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkList</class>
<name>layouts_list</name>
<signal>
<name>select_child</name>
<handler>on_layouts_list_select_child</handler>
<last_modification_time>Sun, 09 Dec 2001 16:43:52 GMT</last_modification_time>
</signal>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox2</name>
<homogeneous>True</homogeneous>
<spacing>10</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>load_button</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_load_button_clicked</handler>
<last_modification_time>Sun, 09 Dec 2001 14:02:18 GMT</last_modification_time>
</signal>
<label>Load</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>delete_button</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_delete_button_clicked</handler>
<last_modification_time>Sun, 09 Dec 2001 14:02:25 GMT</last_modification_time>
</signal>
<label>Delete</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label2</name>
<label>Layouts</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]