static void dock_item_set_shadow_type (GladeXML *xml, GtkWidget *widget, const char *name, const char *value) { bonobo_dock_item_set_shadow_type ( BONOBO_DOCK_ITEM (widget), glade_enum_from_string (GTK_TYPE_SHADOW_TYPE, value)); }
/* * Sets the properties of the widget. This is used for both applying the * properties changed in the property editor, and also for loading. */ static void gb_bonobo_dock_item_set_properties (GtkWidget * widget, GbWidgetSetArgData * data) { gboolean locked, exclusive, never_floating, never_vertical, never_horizontal; gchar *shadow, *orientation; BonoboDockItemBehavior behavior; gint i; /* This is a bit of a hack, as some of the properties are now saved as packing properties instead of normal properties. */ if (data->action == GB_LOADING) { gchar *behavior_string; data->loading_type = GB_CHILD_PROPERTIES; behavior_string = load_string (data, Behavior); behavior = glade_util_flags_from_string (BONOBO_TYPE_DOCK_ITEM_BEHAVIOR, behavior_string); data->loading_type = GB_STANDARD_PROPERTIES; } else { behavior = BONOBO_DOCK_ITEM (widget)->behavior; locked = gb_widget_input_bool (data, Locked); if (data->apply) { if (locked) behavior |= BONOBO_DOCK_ITEM_BEH_LOCKED; else behavior &= ~BONOBO_DOCK_ITEM_BEH_LOCKED; /* This avoids any problems with redrawing the selection. */ if (data->action == GB_APPLYING) editor_clear_selection (NULL); gtk_widget_queue_resize (widget); } exclusive = gb_widget_input_bool (data, Exclusive); if (data->apply) { if (exclusive) behavior |= BONOBO_DOCK_ITEM_BEH_EXCLUSIVE; else behavior &= ~BONOBO_DOCK_ITEM_BEH_EXCLUSIVE; } never_floating = gb_widget_input_bool (data, NeverFloating); if (data->apply) { if (never_floating) behavior |= BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING; else behavior &= ~BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING; } never_vertical = gb_widget_input_bool (data, NeverVertical); if (data->apply) { if (never_vertical) behavior |= BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL; else behavior &= ~BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL; } never_horizontal = gb_widget_input_bool (data, NeverHorizontal); if (data->apply) { if (never_horizontal) behavior |= BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL; else behavior &= ~BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL; } } /* BonoboDockItem has no method for setting the behavior. */ BONOBO_DOCK_ITEM (widget)->behavior = behavior; shadow = gb_widget_input_choice (data, ShadowType); if (data->apply) { for (i = 0; i < sizeof (GbShadowValues) / sizeof (GbShadowValues[0]); i++) { if (!strcmp (shadow, GbShadowChoices[i]) || !strcmp (shadow, GbShadowSymbols[i])) { bonobo_dock_item_set_shadow_type (BONOBO_DOCK_ITEM (widget), GbShadowValues[i]); break; } } } orientation = gb_widget_input_choice (data, Orientation); if (data->apply) { for (i = 0; i < GladeOrientationSize; i++) { if (!strcmp (orientation, GladeOrientationChoices[i]) || !strcmp (orientation, GladeOrientationSymbols[i])) { bonobo_dock_item_set_orientation (BONOBO_DOCK_ITEM (widget), GladeOrientationValues[i]); /* This avoids any problems with redrawing the selection. */ if (data->action == GB_APPLYING) editor_clear_selection (NULL); /* FIXME: A test to see if changing orientation works. */ if (BONOBO_DOCK_ITEM (widget)->bin.child) gtk_widget_queue_resize (BONOBO_DOCK_ITEM (widget)->bin.child); break; } } } }