[gnome-panel/wip/packed-objects: 5/17] schemas, panel: Rename pack key to pack-type



commit 3ade1ed115291cdc656e1e76dfd35de57606c8c6
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Mar 30 20:11:27 2011 +0530

    schemas, panel: Rename pack key to pack-type
    
    We'll have a pack-index key soon.

 .../org.gnome.gnome-panel.object.gschema.xml.in.in |    2 +-
 data/panel-default-layout.layout                   |    6 ++--
 gnome-panel/applet.c                               |   14 ++++----
 gnome-panel/panel-enums-gsettings.h                |    2 +-
 gnome-panel/panel-layout.c                         |   30 ++++++++++----------
 gnome-panel/panel-layout.h                         |   26 ++++++++--------
 gnome-panel/panel-object-loader.c                  |   20 ++++++------
 gnome-panel/panel-schemas.h                        |    2 +-
 gnome-panel/panel-widget.c                         |   12 ++++----
 gnome-panel/panel-widget.h                         |   10 +++---
 10 files changed, 62 insertions(+), 62 deletions(-)
---
diff --git a/data/org.gnome.gnome-panel.object.gschema.xml.in.in b/data/org.gnome.gnome-panel.object.gschema.xml.in.in
index ba4a4dc..4704d34 100644
--- a/data/org.gnome.gnome-panel.object.gschema.xml.in.in
+++ b/data/org.gnome.gnome-panel.object.gschema.xml.in.in
@@ -15,7 +15,7 @@
       <_summary>Object's position on the panel</_summary>
       <_description>The position of this panel object. The position is specified by the number of pixels from the left (or top if vertical) panel edge.</_description>
     </key>
-    <key name="pack" enum="org.gnome.gnome-panel.PanelObjectPack">
+    <key name="pack-type" enum="org.gnome.gnome-panel.PanelObjectPackType">
       <default>'start'</default>
       <_summary>Interpret position relative to bottom/right edge</_summary>
       <_description>If set to 'end', the position of the object is interpreted relative to the right (or bottom if vertical) edge of the panel.</_description>
diff --git a/data/panel-default-layout.layout b/data/panel-default-layout.layout
index 73b0978..60cf3fe 100644
--- a/data/panel-default-layout.layout
+++ b/data/panel-default-layout.layout
@@ -18,13 +18,13 @@ position=0
 object-iid=ClockAppletFactory::ClockApplet
 toplevel-id=top-panel
 position=0
-pack=end
+pack-type=end
 
 [Object notification-area]
 object-iid=NotificationAreaAppletFactory::NotificationArea
 toplevel-id=top-panel
 position=1
-pack=end
+pack-type=end
 
 [Object window-list]
 object-iid=WnckletFactory::WindowListApplet
@@ -35,4 +35,4 @@ position=0
 object-iid=WnckletFactory::WorkspaceSwitcherApplet
 toplevel-id=bottom-panel
 position=0
-pack=end
+pack-type=end
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 85a740c..5a08e34 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -866,7 +866,7 @@ panel_applet_save_position (AppletInfo *applet_info,
 			       PANEL_OBJECT_TOPLEVEL_ID_KEY,
 			       toplevel_id);
 	g_settings_set_enum (applet_info->settings,
-			     PANEL_OBJECT_PACK_KEY,
+			     PANEL_OBJECT_PACK_TYPE_KEY,
 			     right_stick ? PANEL_OBJECT_PACK_END : PANEL_OBJECT_PACK_START);
 	g_settings_set_int (applet_info->settings,
 			    PANEL_OBJECT_POSITION_KEY,
@@ -950,9 +950,9 @@ panel_applet_register (GtkWidget       *applet,
 		       gpointer         data,
 		       GDestroyNotify   data_destroy)
 {
-	AppletInfo      *info;
-	int              pos;
-	PanelObjectPack  pack;
+	AppletInfo          *info;
+	int                  pos;
+	PanelObjectPackType  pack_type;
 	
 	g_return_val_if_fail (applet != NULL && panel != NULL, NULL);
 
@@ -979,10 +979,10 @@ panel_applet_register (GtkWidget       *applet,
 
 	/* Find where to insert the applet */
         pos = g_settings_get_int (info->settings, PANEL_OBJECT_POSITION_KEY);
-        pack = g_settings_get_enum (info->settings, PANEL_OBJECT_PACK_KEY);
+        pack_type = g_settings_get_enum (info->settings, PANEL_OBJECT_PACK_TYPE_KEY);
 
 	/* Insert it */
-	if (panel_widget_add (panel, applet, pos, pack, TRUE) == -1 &&
+	if (panel_widget_add (panel, applet, pos, pack_type, TRUE) == -1 &&
 	    panel_widget_add (panel, applet, 0, PANEL_OBJECT_PACK_START, FALSE) == -1) {
 		GSList *l;
 
@@ -1066,5 +1066,5 @@ panel_applet_can_freely_move (AppletInfo *applet)
 	        g_settings_is_writable (applet->settings,
 					PANEL_OBJECT_POSITION_KEY) &&
 	        g_settings_is_writable (applet->settings,
-					PANEL_OBJECT_PACK_KEY));
+					PANEL_OBJECT_PACK_TYPE_KEY));
 }
diff --git a/gnome-panel/panel-enums-gsettings.h b/gnome-panel/panel-enums-gsettings.h
index 4a422ad..0fb14c1 100644
--- a/gnome-panel/panel-enums-gsettings.h
+++ b/gnome-panel/panel-enums-gsettings.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 typedef enum {
 	PANEL_OBJECT_PACK_START = 0,
 	PANEL_OBJECT_PACK_END   = 1
-} PanelObjectPack;
+} PanelObjectPackType;
 
 typedef enum { /*< flags=0 >*/
 	PANEL_ORIENTATION_TOP    = 1 << 0,
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index e966d27..8aec416 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -112,7 +112,7 @@ static PanelLayoutKeyDefinition panel_layout_object_keys[] = {
         { PANEL_OBJECT_IID_KEY,         G_TYPE_STRING   },
         { PANEL_OBJECT_TOPLEVEL_ID_KEY, G_TYPE_STRING   },
         { PANEL_OBJECT_POSITION_KEY,    G_TYPE_INT      },
-        { PANEL_OBJECT_PACK_KEY,        G_TYPE_STRING   }
+        { PANEL_OBJECT_PACK_TYPE_KEY,   G_TYPE_STRING   }
 };
 
 static gboolean
@@ -597,16 +597,16 @@ panel_layout_toplevel_create (GdkScreen *screen)
 }
 
 void
-panel_layout_object_create (PanelObjectType  type,
-                            const char      *type_detail,
-                            const char      *toplevel_id,
-                            int              position,
-                            PanelObjectPack  pack)
+panel_layout_object_create (PanelObjectType      type,
+                            const char          *type_detail,
+                            const char          *toplevel_id,
+                            int                  position,
+                            PanelObjectPackType  pack_type)
 {
         char *id;
 
         id = panel_layout_object_create_start (type, type_detail,
-                                               toplevel_id, position, pack,
+                                               toplevel_id, position, pack_type,
                                                NULL);
 
         if (!id)
@@ -657,12 +657,12 @@ panel_layout_get_instance_settings (GSettings  *settings_object,
 }
 
 char *
-panel_layout_object_create_start (PanelObjectType   type,
-                                  const char       *type_detail,
-                                  const char       *toplevel_id,
-                                  int               position,
-                                  PanelObjectPack   pack,
-                                  GSettings       **settings)
+panel_layout_object_create_start (PanelObjectType       type,
+                                  const char           *type_detail,
+                                  const char           *toplevel_id,
+                                  int                   position,
+                                  PanelObjectPackType   pack_type,
+                                  GSettings           **settings)
 {
         char      *unique_id;
         char      *path;
@@ -695,8 +695,8 @@ panel_layout_object_create_start (PanelObjectType   type,
                             PANEL_OBJECT_POSITION_KEY,
                             position);
         g_settings_set_enum (settings_object,
-                             PANEL_OBJECT_PACK_KEY,
-                             pack);
+                             PANEL_OBJECT_PACK_TYPE_KEY,
+                             pack_type);
 
         g_free (iid);
 
diff --git a/gnome-panel/panel-layout.h b/gnome-panel/panel-layout.h
index 915047e..205fc3d 100644
--- a/gnome-panel/panel-layout.h
+++ b/gnome-panel/panel-layout.h
@@ -39,24 +39,24 @@ gboolean panel_layout_load         (void);
 
 gboolean panel_layout_is_writable  (void);
 
-void  panel_layout_toplevel_create      (GdkScreen        *screen);
-void  panel_layout_object_create        (PanelObjectType   type,
-					 const char       *type_detail,
-					 const char       *toplevel_id,
-					 int               position,
-					 PanelObjectPack   pack);
+void  panel_layout_toplevel_create      (GdkScreen            *screen);
+void  panel_layout_object_create        (PanelObjectType       type,
+                                         const char           *type_detail,
+                                         const char           *toplevel_id,
+                                         int                   position,
+                                         PanelObjectPackType   pack_type);
 
 char      *panel_layout_object_get_gconf_path (const char *object_id);
 GSettings *panel_layout_get_instance_settings (GSettings  *settings_object,
                                                const char *schema);
 
-char *panel_layout_object_create_start  (PanelObjectType   type,
-					 const char       *type_detail,
-					 const char       *toplevel_id,
-					 int               position,
-					 PanelObjectPack   pack,
-					 GSettings       **settings);
-void  panel_layout_object_create_finish (const char       *object_id);
+char *panel_layout_object_create_start  (PanelObjectType       type,
+                                         const char           *type_detail,
+                                         const char           *toplevel_id,
+                                         int                   position,
+                                         PanelObjectPackType   pack_type,
+                                         GSettings           **settings);
+void  panel_layout_object_create_finish (const char           *object_id);
 
 void panel_layout_delete_toplevel (const char *toplevel_id);
 void panel_layout_delete_object   (const char *object_id);
diff --git a/gnome-panel/panel-object-loader.c b/gnome-panel/panel-object-loader.c
index 0f0c1f6..504edb1 100644
--- a/gnome-panel/panel-object-loader.c
+++ b/gnome-panel/panel-object-loader.c
@@ -48,12 +48,12 @@
 #include "panel-object-loader.h"
 
 typedef struct {
-        char            *id;
-        char            *settings_path;
-        GSettings       *settings;
-        char            *toplevel_id;
-        int              position;
-        PanelObjectPack  pack;
+        char                *id;
+        char                *settings_path;
+        GSettings           *settings;
+        char                *toplevel_id;
+        int                  position;
+        PanelObjectPackType  pack_type;
 } PanelObjectToLoad;
 
 /* Each time those lists get both empty,
@@ -268,8 +268,8 @@ panel_object_loader_queue (const char *id,
         object->toplevel_id   = toplevel_id;
         object->position      = g_settings_get_int (settings,
                                                     PANEL_OBJECT_POSITION_KEY);
-        object->pack          = g_settings_get_enum (settings,
-                                                     PANEL_OBJECT_PACK_KEY);
+        object->pack_type     = g_settings_get_enum (settings,
+                                                     PANEL_OBJECT_PACK_TYPE_KEY);
 
         panel_objects_to_load = g_slist_prepend (panel_objects_to_load, object);
 
@@ -284,8 +284,8 @@ panel_object_compare (const PanelObjectToLoad *a,
 
         if ((c = g_strcmp0 (a->toplevel_id, b->toplevel_id)))
                 return c;
-        else if (a->pack != b->pack)
-                return a->pack - b->pack; /* start < center < end */
+        else if (a->pack_type != b->pack_type)
+                return a->pack_type - b->pack_type; /* start < center < end */
         else
                 return a->position - b->position;
 }
diff --git a/gnome-panel/panel-schemas.h b/gnome-panel/panel-schemas.h
index aa41eb0..e3b8e77 100644
--- a/gnome-panel/panel-schemas.h
+++ b/gnome-panel/panel-schemas.h
@@ -64,7 +64,7 @@
 #define PANEL_OBJECT_IID_KEY            "object-iid"
 #define PANEL_OBJECT_TOPLEVEL_ID_KEY    "toplevel-id"
 #define PANEL_OBJECT_POSITION_KEY       "position"
-#define PANEL_OBJECT_PACK_KEY           "pack"
+#define PANEL_OBJECT_PACK_TYPE_KEY      "pack-type"
 
 #define PANEL_LAUNCHER_SCHEMA      "org.gnome.gnome-panel.launcher"
 #define PANEL_LOCATION_KEY         "location"
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 1e60549..3f33e80 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -2228,18 +2228,18 @@ panel_widget_find_empty_pos(PanelWidget *panel, int pos)
 }
 
 int
-panel_widget_add (PanelWidget     *panel,
-		  GtkWidget       *applet,
-		  int              pos,
-		  PanelObjectPack  pack,
-		  gboolean         insert_at_pos)
+panel_widget_add (PanelWidget         *panel,
+		  GtkWidget           *applet,
+		  int                  pos,
+		  PanelObjectPackType  pack_type,
+		  gboolean             insert_at_pos)
 {
 	AppletData *ad = NULL;
 
 	g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1);
 	g_return_val_if_fail (GTK_IS_WIDGET (applet), -1);
 
-	if (pack == PANEL_OBJECT_PACK_END) {
+	if (pack_type == PANEL_OBJECT_PACK_END) {
 		if (!panel->packed)
 			pos = panel->size - pos;
 		else
diff --git a/gnome-panel/panel-widget.h b/gnome-panel/panel-widget.h
index 1890522..99aa7d7 100644
--- a/gnome-panel/panel-widget.h
+++ b/gnome-panel/panel-widget.h
@@ -145,11 +145,11 @@ GtkWidget *	panel_widget_new		(PanelToplevel  *toplevel,
 						 int             sz);
 /*add an applet to the panel, preferably at position pos, if insert_at_pos
   is on, we REALLY want to insert at the pos given by pos*/
-int		panel_widget_add		(PanelWidget     *panel,
-						 GtkWidget       *applet,
-						 int              pos,
-						 PanelObjectPack  pack,
-						 gboolean         insert_at_pos);
+int		panel_widget_add		(PanelWidget         *panel,
+						 GtkWidget           *applet,
+						 int                  pos,
+						 PanelObjectPackType  pack_style,
+						 gboolean             insert_at_pos);
 
 /*move applet to a different panel*/
 int		panel_widget_reparent		(PanelWidget *old_panel,



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