gimp r24891 - in branches/weskaggs: . app/actions app/widgets



Author: weskaggs
Date: Fri Feb 15 17:43:32 2008
New Revision: 24891
URL: http://svn.gnome.org/viewvc/gimp?rev=24891&view=rev

Log:
Bill Skaggs  <weskaggs primate ucdavis edu>

	Clean up code for two-column toolbox.
	
	* app/actions/dialogs-commands.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpwidgets-constructors.c
	* app/widgets/gimpsessioninfo-book.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpsessioninfo-book.h
	* app/widgets/gimpdockbook.c
	* app/widgets/gimpdockbook.h
	* app/widgets/gimpsessioninfo-dock.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdock.h
	* app/widgets/gimpdockseparator.c
	* app/widgets/gimpdockseparator.h


Modified:
   branches/weskaggs/ChangeLog
   branches/weskaggs/app/actions/dialogs-commands.c
   branches/weskaggs/app/widgets/gimpdatafactoryview.c
   branches/weskaggs/app/widgets/gimpdialogfactory.c
   branches/weskaggs/app/widgets/gimpdock.c
   branches/weskaggs/app/widgets/gimpdock.h
   branches/weskaggs/app/widgets/gimpdockable.c
   branches/weskaggs/app/widgets/gimpdockbook.c
   branches/weskaggs/app/widgets/gimpdockbook.h
   branches/weskaggs/app/widgets/gimpdockseparator.c
   branches/weskaggs/app/widgets/gimpdockseparator.h
   branches/weskaggs/app/widgets/gimpsessioninfo-book.c
   branches/weskaggs/app/widgets/gimpsessioninfo-book.h
   branches/weskaggs/app/widgets/gimpsessioninfo-dock.c
   branches/weskaggs/app/widgets/gimptoolbox.c
   branches/weskaggs/app/widgets/gimpwidgets-constructors.c

Modified: branches/weskaggs/app/actions/dialogs-commands.c
==============================================================================
--- branches/weskaggs/app/actions/dialogs-commands.c	(original)
+++ branches/weskaggs/app/actions/dialogs-commands.c	Fri Feb 15 17:43:32 2008
@@ -180,7 +180,7 @@
 
   dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
 
-  gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
+  gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0, 0);
 
   for (i = 0; i < n_tabs; i++)
     {
@@ -189,7 +189,7 @@
                                                  tabs[i], -1, TRUE);
 
       if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
-        gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
+        gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1, 0);
     }
 
   gtk_widget_show (dock);

Modified: branches/weskaggs/app/widgets/gimpdatafactoryview.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdatafactoryview.c	(original)
+++ branches/weskaggs/app/widgets/gimpdatafactoryview.c	Fri Feb 15 17:43:32 2008
@@ -43,6 +43,7 @@
 #include "gimpcontainergridview.h"
 #include "gimpcontainertreeview.h"
 #include "gimpdnd.h"
+#include "gimpdocked.h"
 #include "gimpviewrenderer.h"
 #include "gimpuimanager.h"
 #include "gimpwidgets-utils.h"
@@ -216,6 +217,9 @@
                                    str, NULL);
   g_free (str);
 
+  /* FIXME!  Kludge alert! */
+/*   gimp_docked_set_show_button_bar (GIMP_DOCKED (editor->view), FALSE); */
+
   gimp_container_view_enable_dnd (editor->view,
                                   GTK_BUTTON (factory_view->edit_button),
                                   factory->container->children_type);

Modified: branches/weskaggs/app/widgets/gimpdialogfactory.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdialogfactory.c	(original)
+++ branches/weskaggs/app/widgets/gimpdialogfactory.c	Fri Feb 15 17:43:32 2008
@@ -420,7 +420,7 @@
 
           gimp_dock_add_book (GIMP_DOCK (dock),
                               GIMP_DOCKBOOK (dockbook),
-                              0);
+                              0, 0);
         }
 
       /*  Create the new dialog in the appropriate context which is
@@ -457,7 +457,7 @@
               if (GIMP_IS_DOCKABLE (dialog))
                 {
                   gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dialog),
-                                 0, 0);
+                                 0, 0, 0);
 
                   gtk_widget_show (dock);
                 }

Modified: branches/weskaggs/app/widgets/gimpdock.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdock.c	(original)
+++ branches/weskaggs/app/widgets/gimpdock.c	Fri Feb 15 17:43:32 2008
@@ -164,11 +164,13 @@
 gimp_dock_init (GimpDock *dock)
 {
   GtkWidget *separator;
+  gint       sector;
 
   dock->context        = NULL;
   dock->dialog_factory = NULL;
-  dock->dockbooks      = NULL;
-  dock->dockbooks2     = NULL;
+
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
+    dock->dockbooks[sector] = NULL;
 
   gtk_window_set_role (GTK_WINDOW (dock), "gimp-dock");
   gtk_window_set_resizable (GTK_WINDOW (dock), TRUE);
@@ -181,12 +183,13 @@
   gtk_paned_add1 (GTK_PANED (dock->paned), dock->main_vbox);
   gtk_widget_show (dock->main_vbox);
 
-  dock->vbox = gtk_vbox_new (FALSE, 0);
-  gtk_container_add (GTK_CONTAINER (dock->main_vbox), dock->vbox);
-  gtk_widget_show (dock->vbox);
+  dock->vbox[0] = gtk_vbox_new (FALSE, 0);
+  gtk_container_add (GTK_CONTAINER (dock->main_vbox), dock->vbox[0]);
+  gtk_widget_show (dock->vbox[0]);
 
   separator = gimp_dock_separator_new (dock);
-  gtk_box_pack_start (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0);
+  GIMP_DOCK_SEPARATOR (separator)->sector = 0;
+  gtk_box_pack_start (GTK_BOX (dock->vbox[0]), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
 }
 
@@ -260,13 +263,13 @@
 static void
 gimp_dock_destroy (GtkObject *object)
 {
-  GimpDock *dock = GIMP_DOCK (object);
-
-  while (dock->dockbooks)
-    gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->dockbooks->data));
+  gint      sector;
+  GimpDock *dock    = GIMP_DOCK (object);
 
-  while (dock->dockbooks2)
-    gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->dockbooks2->data));
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
+    while (dock->dockbooks[sector])
+      gimp_dock_remove_book (dock,
+                             GIMP_DOCKBOOK (dock->dockbooks[sector]->data));
 
   if (dock->context)
     {
@@ -285,12 +288,11 @@
   gboolean  retval = FALSE;
   GList    *list;
   gint      n      = 0;
+  gint      sector;
 
-  for (list = dock->dockbooks; list; list = list->next)
-    n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
-
-  for (list = dock->dockbooks2; list; list = list->next)
-    n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
+    for (list = dock->dockbooks[sector]; list; list = list->next)
+      n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
 
   if (n > 1)
     {
@@ -389,8 +391,13 @@
 gimp_dock_real_book_removed (GimpDock     *dock,
                              GimpDockbook *dockbook)
 {
-  if (dock->dockbooks == NULL && dock->dockbooks2 == NULL )
-    gtk_widget_destroy (GTK_WIDGET (dock));
+  gint sector;
+
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
+    if (dock->dockbooks[sector] != NULL)
+      return;
+
+  gtk_widget_destroy (GTK_WIDGET (dock));
 }
 
 
@@ -432,24 +439,8 @@
 gimp_dock_add (GimpDock     *dock,
                GimpDockable *dockable,
                gint          section,
-               gint          position)
-{
-  GimpDockbook *dockbook;
-
-  g_return_if_fail (GIMP_IS_DOCK (dock));
-  g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
-  g_return_if_fail (dockable->dockbook == NULL);
-
-  dockbook = GIMP_DOCKBOOK (dock->dockbooks->data);
-
-  gimp_dockbook_add (dockbook, dockable, position);
-}
-
-void
-gimp_dock_add2 (GimpDock     *dock,
-                GimpDockable *dockable,
-                gint          section,
-                gint          position)
+               gint          position,
+               gint          sector)
 {
   GimpDockbook *dockbook;
 
@@ -457,7 +448,7 @@
   g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
   g_return_if_fail (dockable->dockbook == NULL);
 
-  dockbook = GIMP_DOCKBOOK (dock->dockbooks2->data);
+  dockbook = GIMP_DOCKBOOK (dock->dockbooks[sector]->data);
 
   gimp_dockbook_add (dockbook, dockable, position);
 }
@@ -477,98 +468,8 @@
 void
 gimp_dock_add_book (GimpDock     *dock,
                     GimpDockbook *dockbook,
-                    gint          index)
-{
-  gint old_length;
-
-  g_return_if_fail (GIMP_IS_DOCK (dock));
-  g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook));
-  g_return_if_fail (dockbook->dock == NULL);
-
-  old_length = g_list_length (dock->dockbooks);
-
-  if (index >= old_length || index < 0)
-    index = old_length;
-
-  dockbook->dock  = dock;
-  dockbook->pane  = 1;
-  dock->dockbooks = g_list_insert (dock->dockbooks, dockbook, index);
-
-  if (old_length == 0)
-    {
-      GtkWidget *separator;
-
-      gtk_box_pack_start (GTK_BOX (dock->vbox), GTK_WIDGET (dockbook),
-                          TRUE, TRUE, 0);
-
-      separator = gimp_dock_separator_new (dock);
-      gtk_box_pack_end (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0);
-      gtk_widget_show (separator);
-    }
-  else
-    {
-      GtkWidget *old_book;
-      GtkWidget *parent;
-      GtkWidget *paned;
-
-      if (index == 0)
-        old_book = g_list_nth_data (dock->dockbooks, index + 1);
-      else
-        old_book = g_list_nth_data (dock->dockbooks, index - 1);
-
-      parent = old_book->parent;
-
-      if ((old_length > 1) && (index > 0))
-        {
-          GtkWidget *grandparent;
-
-          grandparent = parent->parent;
-
-          old_book = parent;
-          parent   = grandparent;
-        }
-
-      g_object_ref (old_book);
-
-      gtk_container_remove (GTK_CONTAINER (parent), old_book);
-
-      paned = gtk_vpaned_new ();
-
-      if (GTK_IS_VPANED (parent))
-        gtk_paned_pack1 (GTK_PANED (parent), paned, TRUE, FALSE);
-      else
-        gtk_box_pack_start (GTK_BOX (parent), paned, TRUE, TRUE, 0);
-
-      gtk_widget_show (paned);
-
-      if (index == 0)
-        {
-          gtk_paned_pack1 (GTK_PANED (paned), GTK_WIDGET (dockbook),
-                           TRUE, FALSE);
-          gtk_paned_pack2 (GTK_PANED (paned), old_book,
-                           TRUE, FALSE);
-        }
-      else
-        {
-          gtk_paned_pack1 (GTK_PANED (paned), old_book,
-                           TRUE, FALSE);
-          gtk_paned_pack2 (GTK_PANED (paned), GTK_WIDGET (dockbook),
-                           TRUE, FALSE);
-        }
-
-      g_object_unref (old_book);
-    }
-
-  gtk_widget_show (GTK_WIDGET (dockbook));
-
-  g_signal_emit (dock, dock_signals[BOOK_ADDED], 0, dockbook);
-}
-
-/* add a book to the right pane */
-void
-gimp_dock_add2_book (GimpDock     *dock,
-                     GimpDockbook *dockbook,
-                     gint          index)
+                    gint          index,
+                    gint          sector)
 {
   gint old_length;
 
@@ -576,24 +477,27 @@
   g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook));
   g_return_if_fail (dockbook->dock == NULL);
 
-  old_length = g_list_length (dock->dockbooks2);
+  old_length = g_list_length (dock->dockbooks[sector]);
 
   if (index >= old_length || index < 0)
     index = old_length;
 
   dockbook->dock   = dock;
-  dockbook->pane   = 2;
-  dock->dockbooks2 = g_list_insert (dock->dockbooks2, dockbook, index);
+  dockbook->sector = sector;
+  dock->dockbooks[sector] = g_list_insert (dock->dockbooks[sector],
+                                           dockbook, index);
 
   if (old_length == 0)
     {
       GtkWidget *separator;
 
-      gtk_box_pack_start (GTK_BOX (dock->vbox2), GTK_WIDGET (dockbook),
+      gtk_box_pack_start (GTK_BOX (dock->vbox[sector]), GTK_WIDGET (dockbook),
                           TRUE, TRUE, 0);
 
       separator = gimp_dock_separator_new (dock);
-      gtk_box_pack_end (GTK_BOX (dock->vbox2), separator, FALSE, FALSE, 0);
+      GIMP_DOCK_SEPARATOR (separator)->sector = sector;
+      gtk_box_pack_end (GTK_BOX (dock->vbox[sector]), separator,
+                        FALSE, FALSE, 0);
       gtk_widget_show (separator);
     }
   else
@@ -603,9 +507,9 @@
       GtkWidget *paned;
 
       if (index == 0)
-        old_book = g_list_nth_data (dock->dockbooks2, index + 1);
+        old_book = g_list_nth_data (dock->dockbooks[sector], index + 1);
       else
-        old_book = g_list_nth_data (dock->dockbooks2, index - 1);
+        old_book = g_list_nth_data (dock->dockbooks[sector], index - 1);
 
       parent = old_book->parent;
 
@@ -661,72 +565,23 @@
 {
   gint old_length;
   gint index;
+  gint sector;
 
   g_return_if_fail (GIMP_IS_DOCK (dock));
   g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook));
 
   g_return_if_fail (dockbook->dock == dock);
 
-  old_length = g_list_length (dock->dockbooks);
-  index      = g_list_index (dock->dockbooks, dockbook);
-
-  if (index == -1) /* book is in the right pane */
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
     {
-      old_length = g_list_length (dock->dockbooks2);
-      index      = g_list_index (dock->dockbooks2, dockbook);
-
-      dockbook->dock  = NULL;
-      dock->dockbooks2 = g_list_remove (dock->dockbooks2, dockbook);
-
-      g_object_ref (dockbook);
-
-      if (old_length == 1)
-        {
-          GtkWidget *separator;
-          GList     *children;
+      old_length = g_list_length (dock->dockbooks[sector]);
+      index      = g_list_index (dock->dockbooks[sector], dockbook);
 
-          children = gtk_container_get_children (GTK_CONTAINER (dock->vbox2));
+      if (index == -1) /* book is not in this sector */
+        continue;
 
-          separator = g_list_nth_data (children, 2);
-
-          gtk_container_remove (GTK_CONTAINER (dock->vbox2), separator);
-          gtk_container_remove (GTK_CONTAINER (dock->vbox2), GTK_WIDGET (dockbook));
-
-          g_list_free (children);
-        }
-      else
-        {
-          GtkWidget *other_book;
-          GtkWidget *parent;
-          GtkWidget *grandparent;
-
-          parent      = GTK_WIDGET (dockbook)->parent;
-          grandparent = parent->parent;
-
-          if (index == 0)
-            other_book = GTK_PANED (parent)->child2;
-          else
-            other_book = GTK_PANED (parent)->child1;
-
-          g_object_ref (other_book);
-
-          gtk_container_remove (GTK_CONTAINER (parent), other_book);
-          gtk_container_remove (GTK_CONTAINER (parent), GTK_WIDGET (dockbook));
-
-          gtk_container_remove (GTK_CONTAINER (grandparent), parent);
-
-          if (GTK_IS_VPANED (grandparent))
-            gtk_paned_pack1 (GTK_PANED (grandparent), other_book, TRUE, FALSE);
-          else
-            gtk_box_pack_start (GTK_BOX (dock->vbox2), other_book, TRUE, TRUE, 0);
-
-          g_object_unref (other_book);
-        }
-    }
-  else
-    {
       dockbook->dock  = NULL;
-      dock->dockbooks = g_list_remove (dock->dockbooks, dockbook);
+      dock->dockbooks[sector] = g_list_remove (dock->dockbooks[sector], dockbook);
 
       g_object_ref (dockbook);
 
@@ -735,12 +590,12 @@
           GtkWidget *separator;
           GList     *children;
 
-          children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
+          children = gtk_container_get_children (GTK_CONTAINER (dock->vbox[sector]));
 
           separator = g_list_nth_data (children, 2);
 
-          gtk_container_remove (GTK_CONTAINER (dock->vbox), separator);
-          gtk_container_remove (GTK_CONTAINER (dock->vbox), GTK_WIDGET (dockbook));
+          gtk_container_remove (GTK_CONTAINER (dock->vbox[sector]), separator);
+          gtk_container_remove (GTK_CONTAINER (dock->vbox[sector]), GTK_WIDGET (dockbook));
 
           g_list_free (children);
         }
@@ -768,7 +623,7 @@
           if (GTK_IS_VPANED (grandparent))
             gtk_paned_pack1 (GTK_PANED (grandparent), other_book, TRUE, FALSE);
           else
-            gtk_box_pack_start (GTK_BOX (dock->vbox), other_book, TRUE, TRUE, 0);
+            gtk_box_pack_start (GTK_BOX (dock->vbox[sector]), other_book, TRUE, TRUE, 0);
 
           g_object_unref (other_book);
         }

Modified: branches/weskaggs/app/widgets/gimpdock.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdock.h	(original)
+++ branches/weskaggs/app/widgets/gimpdock.h	Fri Feb 15 17:43:32 2008
@@ -22,6 +22,7 @@
 #ifndef __GIMP_DOCK_H__
 #define __GIMP_DOCK_H__
 
+#define N_DOCK_SECTORS 2
 
 #include <gtk/gtkwindow.h>
 
@@ -45,11 +46,10 @@
 
   GtkWidget         *paned;
   GtkWidget         *main_vbox;
-  GtkWidget         *vbox;
-  GtkWidget         *vbox2;
 
-  GList             *dockbooks;
-  GList             *dockbooks2;
+  GtkWidget         *vbox[N_DOCK_SECTORS];
+
+  GList             *dockbooks[N_DOCK_SECTORS];
 };
 
 struct _GimpDockClass
@@ -82,20 +82,15 @@
 void    gimp_dock_add          (GimpDock       *dock,
                                 GimpDockable   *dockable,
                                 gint            book,
-                                gint            index);
-void    gimp_dock_add2         (GimpDock       *dock,
-                                GimpDockable   *dockable,
-                                gint            book,
-                                gint            index);
+                                gint            index,
+                                gint            sector);
 void    gimp_dock_remove       (GimpDock       *dock,
                                 GimpDockable   *dockable);
 
 void    gimp_dock_add_book     (GimpDock       *dock,
                                 GimpDockbook   *dockbook,
-                                gint            index);
-void    gimp_dock_add2_book    (GimpDock       *dock,
-                                GimpDockbook   *dockbook,
-                                gint            index);
+                                gint            index,
+                                gint            sector);
 void    gimp_dock_remove_book  (GimpDock       *dock,
                                 GimpDockbook   *dockbook);
 

Modified: branches/weskaggs/app/widgets/gimpdockable.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockable.c	(original)
+++ branches/weskaggs/app/widgets/gimpdockable.c	Fri Feb 15 17:43:32 2008
@@ -840,7 +840,7 @@
 
   dockbook = gimp_dockbook_new (GIMP_DOCK (dock)->dialog_factory->menu_factory);
 
-  gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
+  gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0, 0);
 
   g_object_ref (dockable);
 

Modified: branches/weskaggs/app/widgets/gimpdockbook.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockbook.c	(original)
+++ branches/weskaggs/app/widgets/gimpdockbook.c	Fri Feb 15 17:43:32 2008
@@ -188,7 +188,7 @@
 {
   dockbook->dock       = NULL;
   dockbook->ui_manager = NULL;
-  dockbook->pane       = 0;
+  dockbook->sector     = 0;
 
   gtk_notebook_popup_enable (GTK_NOTEBOOK (dockbook));
   gtk_notebook_set_scrollable (GTK_NOTEBOOK (dockbook), TRUE);

Modified: branches/weskaggs/app/widgets/gimpdockbook.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockbook.h	(original)
+++ branches/weskaggs/app/widgets/gimpdockbook.h	Fri Feb 15 17:43:32 2008
@@ -46,7 +46,7 @@
   guint          tab_hover_timeout;
   GimpDockable  *tab_hover_dockable;
 
-  gint           pane;
+  gint           sector;
 };
 
 struct _GimpDockbookClass

Modified: branches/weskaggs/app/widgets/gimpdockseparator.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockseparator.c	(original)
+++ branches/weskaggs/app/widgets/gimpdockseparator.c	Fri Feb 15 17:43:32 2008
@@ -95,7 +95,7 @@
   separator->dock  = NULL;
   separator->label = NULL;
 
-  separator->pane = 1;
+  separator->sector = 0;
 
   separator->frame = gtk_frame_new (NULL);
   gtk_frame_set_shadow_type (GTK_FRAME (separator->frame), GTK_SHADOW_OUT);
@@ -239,11 +239,8 @@
 
           dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory);
 
-          if (separator->pane == 2)
-            gimp_dock_add2_book (dock, GIMP_DOCKBOOK (dockbook), index);
-          else
-            gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index);
-
+          gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index,
+                              separator->sector);
 
           gimp_dockbook_add (GIMP_DOCKBOOK (dockbook), dockable, -1);
 

Modified: branches/weskaggs/app/widgets/gimpdockseparator.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockseparator.h	(original)
+++ branches/weskaggs/app/widgets/gimpdockseparator.h	Fri Feb 15 17:43:32 2008
@@ -45,7 +45,7 @@
   GtkWidget   *frame;
   GtkWidget   *label;
 
-  gint         pane;
+  gint         sector;
 };
 
 struct _GimpDockSeparatorClass

Modified: branches/weskaggs/app/widgets/gimpsessioninfo-book.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-book.c	(original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-book.c	Fri Feb 15 17:43:32 2008
@@ -38,7 +38,7 @@
 enum
 {
   SESSION_INFO_BOOK_POSITION,
-  SESSION_INFO_BOOK_PANE,
+  SESSION_INFO_BOOK_SECTOR,
   SESSION_INFO_BOOK_CURRENT_PAGE,
   SESSION_INFO_BOOK_DOCKABLE
 };
@@ -99,8 +99,8 @@
   gimp_config_writer_printf (writer, "%d", current_page);
   gimp_config_writer_close (writer);
 
-  gimp_config_writer_open (writer, "pane");
-  gimp_config_writer_printf (writer, "%d", dockbook->pane);
+  gimp_config_writer_open (writer, "sector");
+  gimp_config_writer_printf (writer, "%d", dockbook->sector);
   gimp_config_writer_close (writer);
 
   children = gtk_container_get_children (GTK_CONTAINER (dockbook));
@@ -126,8 +126,8 @@
 
   g_scanner_scope_add_symbol (scanner, scope, "position",
                               GINT_TO_POINTER (SESSION_INFO_BOOK_POSITION));
-  g_scanner_scope_add_symbol (scanner, scope, "pane",
-                              GINT_TO_POINTER (SESSION_INFO_BOOK_PANE));
+  g_scanner_scope_add_symbol (scanner, scope, "sector",
+                              GINT_TO_POINTER (SESSION_INFO_BOOK_SECTOR));
   g_scanner_scope_add_symbol (scanner, scope, "current-page",
                               GINT_TO_POINTER (SESSION_INFO_BOOK_CURRENT_PAGE));
   g_scanner_scope_add_symbol (scanner, scope, "dockable",
@@ -135,9 +135,6 @@
 
   book = gimp_session_info_book_new ();
 
-  /* FIXME */
-  book->pane = 1;
-
   token = G_TOKEN_LEFT_PAREN;
 
   while (g_scanner_peek_next_token (scanner) == token)
@@ -159,9 +156,9 @@
                 goto error;
               break;
 
-            case SESSION_INFO_BOOK_PANE:
+            case SESSION_INFO_BOOK_SECTOR:
               token = G_TOKEN_INT;
-              if (! gimp_scanner_parse_int (scanner, &book->pane))
+              if (! gimp_scanner_parse_int (scanner, &book->sector))
                 goto error;
               break;
 
@@ -202,7 +199,7 @@
   info->books = g_list_append (info->books, book);
 
   g_scanner_scope_remove_symbol (scanner, scope, "position");
-  g_scanner_scope_remove_symbol (scanner, scope, "pane");
+  g_scanner_scope_remove_symbol (scanner, scope, "sector");
   g_scanner_scope_remove_symbol (scanner, scope, "current-page");
   g_scanner_scope_remove_symbol (scanner, scope, "dockable");
 
@@ -226,11 +223,7 @@
 
   dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory);
 
-  if (info->pane == 1)
-    gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), -1);
-  else
-    gimp_dock_add2_book (dock, GIMP_DOCKBOOK (dockbook), -1);
-
+  gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), -1, info->sector);
 
   info->widget = dockbook;
 

Modified: branches/weskaggs/app/widgets/gimpsessioninfo-book.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-book.h	(original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-book.h	Fri Feb 15 17:43:32 2008
@@ -28,7 +28,7 @@
   gint       position;
   gint       current_page;
 
-  gint       pane;
+  gint       sector;
 
   GtkWidget *widget;
 

Modified: branches/weskaggs/app/widgets/gimpsessioninfo-dock.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-dock.c	(original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-dock.c	Fri Feb 15 17:43:32 2008
@@ -50,6 +50,7 @@
                                   GimpDock         *dock)
 {
   GList *books;
+  gint   sector;
 
   g_return_if_fail (writer != NULL);
   g_return_if_fail (GIMP_IS_DOCK (dock));
@@ -65,11 +66,9 @@
       gimp_config_writer_close (writer);
     }
 
-  for (books = dock->dockbooks; books; books = g_list_next (books))
-    gimp_session_info_book_serialize (writer, books->data);
-
-  for (books = dock->dockbooks2; books; books = g_list_next (books))
-    gimp_session_info_book_serialize (writer, books->data);
+  for (sector = 0; sector < N_DOCK_SECTORS; sector++)
+    for (books = dock->dockbooks[sector]; books; books = g_list_next (books))
+      gimp_session_info_book_serialize (writer, books->data);
 
   gimp_config_writer_close (writer);
 }

Modified: branches/weskaggs/app/widgets/gimptoolbox.c
==============================================================================
--- branches/weskaggs/app/widgets/gimptoolbox.c	(original)
+++ branches/weskaggs/app/widgets/gimptoolbox.c	Fri Feb 15 17:43:32 2008
@@ -166,14 +166,14 @@
   GimpDock  *dock       = GIMP_DOCK (toolbox);
   GtkWidget *separator;
 
-  dock->vbox2 = gtk_vbox_new (FALSE, 0);
-  gtk_paned_add2 (GTK_PANED (dock->paned), dock->vbox2);
-  gtk_widget_show (dock->vbox2);
+  dock->vbox[1] = gtk_vbox_new (FALSE, 0);
+  gtk_paned_add2 (GTK_PANED (dock->paned), dock->vbox[1]);
+  gtk_widget_show (dock->vbox[1]);
 
   separator = gimp_dock_separator_new (dock);
-  gtk_box_pack_start (GTK_BOX (dock->vbox2), separator, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (dock->vbox[1]), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
-  GIMP_DOCK_SEPARATOR (separator)->pane = 2;
+  GIMP_DOCK_SEPARATOR (separator)->sector = 1;
 
   gtk_window_set_role (GTK_WINDOW (toolbox), "gimp-toolbox");
 
@@ -378,7 +378,7 @@
             n_tools++;
         }
 
-      alloc2 = &GIMP_DOCK (toolbox)->vbox->allocation;
+      alloc2 = &GIMP_DOCK (toolbox)->vbox[0]->allocation;
 
       tool_columns = MAX (1, (alloc2->width / button_requisition.width));
       tool_rows    = n_tools / tool_columns;
@@ -493,7 +493,7 @@
 gimp_toolbox_book_added (GimpDock     *dock,
                          GimpDockbook *dockbook)
 {
-  if (g_list_length (dock->dockbooks) == 1)
+  if (g_list_length (dock->dockbooks[0]) == 1)
     {
       gimp_toolbox_set_geometry (GIMP_TOOLBOX (dock));
       toolbox_separator_collapse (GIMP_TOOLBOX (dock));
@@ -504,7 +504,7 @@
 gimp_toolbox_book_removed (GimpDock     *dock,
                            GimpDockbook *dockbook)
 {
-  if (g_list_length (dock->dockbooks) == 0 &&
+  if (g_list_length (dock->dockbooks[0]) == 0 &&
       ! (GTK_OBJECT_FLAGS (dock) & GTK_IN_DESTRUCTION))
     {
       gimp_toolbox_set_geometry (GIMP_TOOLBOX (dock));
@@ -585,11 +585,11 @@
   GList     *children;
   GtkWidget *separator;
 
-  children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
+  children = gtk_container_get_children (GTK_CONTAINER (dock->vbox[0]));
   separator = children->data;
   g_list_free (children);
 
-  gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
+  gtk_box_set_child_packing (GTK_BOX (dock->vbox[0]), separator,
                              TRUE, TRUE, 0, GTK_PACK_START);
   gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (separator), TRUE);
 }
@@ -601,11 +601,11 @@
   GList     *children;
   GtkWidget *separator;
 
-  children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
+  children = gtk_container_get_children (GTK_CONTAINER (dock->vbox[0]));
   separator = children->data;
   g_list_free (children);
 
-  gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
+  gtk_box_set_child_packing (GTK_BOX (dock->vbox[0]), separator,
                              FALSE, FALSE, 0, GTK_PACK_START);
   gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (separator), FALSE);
 }

Modified: branches/weskaggs/app/widgets/gimpwidgets-constructors.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpwidgets-constructors.c	(original)
+++ branches/weskaggs/app/widgets/gimpwidgets-constructors.c	Fri Feb 15 17:43:32 2008
@@ -130,14 +130,14 @@
                                            GIMP_COLOR_MODE,
                                            GIMP_VALUE_MODE);
 
-  gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
-                                         GIMP_DISSOLVE_MODE, -1);
-  gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
-                                         GIMP_OVERLAY_MODE, -1);
-  gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
-                                         GIMP_GRAIN_MERGE_MODE, -1);
-  gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
-                                         GIMP_LIGHTEN_ONLY_MODE, -1);
+/*   gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), */
+/*                                          GIMP_DISSOLVE_MODE, -1); */
+/*   gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), */
+/*                                          GIMP_OVERLAY_MODE, -1); */
+/*   gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), */
+/*                                          GIMP_GRAIN_MERGE_MODE, -1); */
+/*   gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), */
+/*                                          GIMP_LIGHTEN_ONLY_MODE, -1); */
 
   if (with_behind_mode)
     {
@@ -165,6 +165,8 @@
   combo = gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (store));
   g_object_unref (store);
 
+  gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 2);
+
   gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo),
                                         gimp_paint_mode_menu_separator_func,
                                         GINT_TO_POINTER (-1),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]