patch to handle all dockitem behavior possibilities
- From: "John Sullivan" <sullivan eazel com>
- To: gnome-components-list <gnome-components-list gnome org>
- Subject: patch to handle all dockitem behavior possibilities
- Date: Fri, 06 Oct 2000 10:54:02 -0700
Michael and I discussed this yesterday, so I took the liberty of checking
this patch in already. This changes the "behavior" attribute of dockitems so
that it accepts a comma-separated string of choices. Formerly it only
handled "detachable", now it handles all the other gnome dock item choices
also (exclusive, never floating, never vertical, never horizontal).
John
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.566
diff -u -p -u -r1.566 ChangeLog
--- ChangeLog 2000/10/06 07:07:36 1.566
+++ ChangeLog 2000/10/06 17:47:00
@@ -1,3 +1,12 @@
+2000-10-06 John Sullivan <sullivan eazel com>
+
+ * bonobo/bonobo-win.c:
+ (update_menus): removed unused variable
+ (string_array_contains): new helper function
+ (create_dockitem): made behavior attribute be a comma-separated
+ set of choices, matching all the GNOME_DOCK_ITEM_BEH_* ones.
+ * doc/ui-xml.txt: explained behavior attribute
+
2000-10-06 Ramiro Estrugo <ramiro eazel com>
* bonobo.spec.in:
Index: bonobo/bonobo-win.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-win.c,v
retrieving revision 1.41
diff -u -p -u -r1.41 bonobo-win.c
--- bonobo/bonobo-win.c 2000/10/05 21:55:45 1.41
+++ bonobo/bonobo-win.c 2000/10/06 17:47:06
@@ -1390,7 +1390,6 @@ static void
update_menus (BonoboWinPrivate *priv, BonoboUINode *node)
{
BonoboUINode *l;
- gboolean hide = FALSE;
NodeInfo *info = bonobo_ui_xml_get_data (priv->tree, node);
if (info->widget)
@@ -1589,6 +1588,19 @@ build_toolbar_control (BonoboWinPrivate
BONOBO_UI_TOOLBAR_ITEM (item), -1);
}
+static gboolean
+string_array_contains (char **str_array, const char *match)
+{
+ int i = 0;
+ char *string;
+
+ while ((string = str_array[i++]) != NULL)
+ if (strcmp (string, match) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
static GnomeDockItem *
create_dockitem (BonoboWinPrivate *priv,
BonoboUINode *node,
@@ -1597,6 +1609,7 @@ create_dockitem (BonoboWinPrivate *priv,
GnomeDockItem *item;
GnomeDockItemBehavior beh = 0;
char *prop;
+ char **behavior_array;
gboolean force_detachable = FALSE;
GnomeDockPlacement placement = GNOME_DOCK_TOP;
@@ -1606,9 +1619,25 @@ create_dockitem (BonoboWinPrivate *priv,
gboolean in_new_band = TRUE;
if ((prop = bonobo_ui_node_get_attr (node, "behavior"))) {
- if (!strcmp (prop, "detachable"))
- force_detachable = TRUE;
+ behavior_array = g_strsplit (prop, ",", -1);
bonobo_ui_node_free_string (prop);
+
+ if (string_array_contains (behavior_array, "detachable"))
+ force_detachable = TRUE;
+
+ if (string_array_contains (behavior_array, "exclusive"))
+ beh |= GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
+
+ if (string_array_contains (behavior_array, "never vertical"))
+ beh |= GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL;
+
+ if (string_array_contains (behavior_array, "never floating"))
+ beh |= GNOME_DOCK_ITEM_BEH_NEVER_FLOATING;
+
+ if (string_array_contains (behavior_array, "never horizontal"))
+ beh |= GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL;
+
+ g_strfreev (behavior_array);
}
if (!force_detachable && !gnome_preferences_get_toolbar_detachable())
Index: doc/ui-xml.txt
===================================================================
RCS file: /cvs/gnome/bonobo/doc/ui-xml.txt,v
retrieving revision 1.5
diff -u -p -u -r1.5 ui-xml.txt
--- doc/ui-xml.txt 2000/10/05 22:50:01 1.5
+++ doc/ui-xml.txt 2000/10/06 17:47:06
@@ -82,7 +82,17 @@ Verbs are actions to be taken when an it
* The following items have effect only at dockitem creation.
placement="top" - where to put the band; top, bottom, right,
left, floating
- behavior="detachable" - force user detachable
+
+ behavior is a comma-delimited set of phrases that match the features
+ in GnomeDockItem. The supported values are:
+ "detachable" - force user detachable (overrides gnome
preference)
+ "exclusive" - one dockitem per row (fills entire row of dock)
+ "never vertical" - prevent dockitem from ever becoming vertical
+ "never horizontal" - prevent dockitem from ever becoming horizontal
+ "never floating" - prevent dockitem from ever becoming floating
+
+ e.g. behavior = "detachable,exclusive,never vertical"
+
band_num="1" - band number
position="0" - set the dockitem position
offset="0" - offset into band
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]