gboolean glade_gtk_action_bar_verify_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { if (!strcmp (id, "size")) return glade_gtk_action_bar_verify_size (object, value); else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property) return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object, id, value); return TRUE; }
GtkWidget * glade_gtk_widget_action_submenu (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * action_path) { GladeWidget *gwidget = glade_widget_get_from_gobject (object); GList *groups, *list; if (strcmp (action_path, "sizegroup_add") == 0) { GtkWidget *menu = gtk_menu_new (); GtkWidget *separator, *item; GladeWidget *group; if ((groups = list_sizegroups (gwidget)) != NULL) { for (list = groups; list; list = list->next) { group = list->data; item = gtk_menu_item_new_with_label (glade_widget_get_name (group)); g_object_set_data (G_OBJECT (item), "glade-group-widget", group); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (glade_gtk_widget_add2group_cb), gwidget); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); } g_list_free (groups); separator = gtk_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), separator); gtk_widget_show (separator); } /* Add trailing new... item */ item = gtk_menu_item_new_with_label (_("New Size Group")); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (glade_gtk_widget_add2group_cb), gwidget); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); return menu; } else if (GWA_GET_CLASS (G_TYPE_OBJECT)->action_submenu) return GWA_GET_CLASS (G_TYPE_OBJECT)->action_submenu (adaptor, object, action_path); return NULL; }
void glade_gtk_image_set_property (GladeWidgetAdaptor *adaptor, GObject *object, const gchar *id, const GValue *value) { if (!strcmp (id, "image-mode")) glade_gtk_image_set_image_mode (object, value); else if (!strcmp (id, "icon-size")) { /* Make the enum an int... */ GValue int_value = { 0, }; g_value_init (&int_value, G_TYPE_INT); g_value_set_int (&int_value, g_value_get_enum (value)); GWA_GET_CLASS (GTK_TYPE_WIDGET)->set_property (adaptor, object, id, &int_value); g_value_unset (&int_value); } else { GladeWidget *widget = glade_widget_get_from_gobject (object); GladeImageEditMode mode = 0; glade_widget_property_get (widget, "image-mode", &mode); /* avoid setting properties in the wrong mode... */ switch (mode) { case GLADE_IMAGE_MODE_STOCK: if (!strcmp (id, "icon-name") || !strcmp (id, "pixbuf")) return; break; case GLADE_IMAGE_MODE_ICON: if (!strcmp (id, "stock") || !strcmp (id, "pixbuf")) return; break; case GLADE_IMAGE_MODE_FILENAME: if (!strcmp (id, "stock") || !strcmp (id, "icon-name")) return; case GLADE_IMAGE_MODE_RESOURCE: /* Screw the resource mode here, we can't apply them at Glade's runtime anyway */ default: break; } GWA_GET_CLASS (GTK_TYPE_WIDGET)->set_property (adaptor, object, id, value); } }
gboolean glade_gtk_table_verify_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { if (!strcmp (id, "n-rows")) return glade_gtk_table_verify_n_common (object, value, TRUE); else if (!strcmp (id, "n-columns")) return glade_gtk_table_verify_n_common (object, value, FALSE); else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property) GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object, id, value); return TRUE; }
void glade_gtk_menu_item_action_activate (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * action_path) { GObject *obj = NULL, *shell = NULL; GladeWidget *w = glade_widget_get_from_gobject (object); while ((w = glade_widget_get_parent (w))) { obj = glade_widget_get_object (w); if (GTK_IS_MENU_SHELL (obj)) shell = obj; } if (strcmp (action_path, "launch_editor") == 0) { if (shell) object = shell; if (GTK_IS_MENU_BAR (object)) glade_gtk_menu_shell_launch_editor (object, _("Edit Menu Bar")); else if (GTK_IS_MENU (object)) glade_gtk_menu_shell_launch_editor (object, _("Edit Menu")); } else GWA_GET_CLASS (GTK_TYPE_CONTAINER)->action_activate (adaptor, object, action_path); if (shell) gtk_menu_shell_deactivate (GTK_MENU_SHELL (shell)); }
void glade_gtk_widget_read_widget (GladeWidgetAdaptor * adaptor, GladeWidget * widget, GladeXmlNode * node) { const gchar *tooltip_markup = NULL; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the normal properties.. */ GWA_GET_CLASS (G_TYPE_OBJECT)->read_widget (adaptor, widget, node); /* Read in accelerators */ glade_gtk_read_accels (widget, node, TRUE); /* Read in atk props */ glade_gtk_widget_read_atk_props (widget, node); /* Read in the style classes */ glade_gtk_widget_read_style_classes (widget, node); /* Resolve the virtual tooltip use markup property */ glade_widget_property_get (widget, "tooltip-markup", &tooltip_markup); if (tooltip_markup != NULL) glade_widget_property_set (widget, "glade-tooltip-markup", TRUE); }
void glade_gtk_file_filter_write_widget (GladeWidgetAdaptor *adaptor, GladeWidget *widget, GladeXmlContext *context, GladeXmlNode *node) { GladeXmlNode *strings_node; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the normal properties.. */ GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node); strings_node = glade_xml_node_new (context, GLADE_TAG_MIME_TYPES); glade_gtk_filter_write_strings (widget, context, strings_node, FILTER_MIME, "glade-mime-types"); if (!glade_xml_node_get_children (strings_node)) glade_xml_node_delete (strings_node); else glade_xml_node_append_child (node, strings_node); strings_node = glade_xml_node_new (context, GLADE_TAG_PATTERNS); glade_gtk_filter_write_strings (widget, context, strings_node, FILTER_PATTERN, "glade-patterns"); if (!glade_xml_node_get_children (strings_node)) glade_xml_node_delete (strings_node); else glade_xml_node_append_child (node, strings_node); }
void glade_gtk_size_group_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * property_name, const GValue * value) { if (!strcmp (property_name, "widgets")) { GSList *sg_widgets, *slist; GList *widgets, *list; /* remove old widgets */ if ((sg_widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (object))) != NULL) { /* copy since we are modifying an internal list */ sg_widgets = g_slist_copy (sg_widgets); for (slist = sg_widgets; slist; slist = slist->next) gtk_size_group_remove_widget (GTK_SIZE_GROUP (object), GTK_WIDGET (slist->data)); g_slist_free (sg_widgets); } /* add new widgets */ if ((widgets = g_value_get_boxed (value)) != NULL) { for (list = widgets; list; list = list->next) gtk_size_group_add_widget (GTK_SIZE_GROUP (object), GTK_WIDGET (list->data)); } } else GWA_GET_CLASS (G_TYPE_OBJECT)->set_property (adaptor, object, property_name, value); }
void glade_gtk_combo_box_text_write_widget (GladeWidgetAdaptor *adaptor, GladeWidget *widget, GladeXmlContext *context, GladeXmlNode *node) { GladeXmlNode *attrs_node; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the normal properties.. */ GWA_GET_CLASS (GTK_TYPE_COMBO_BOX)->write_widget (adaptor, widget, context, node); attrs_node = glade_xml_node_new (context, GLADE_TAG_ITEMS); glade_gtk_combo_box_text_write_items (widget, context, attrs_node); if (!glade_xml_node_get_children (attrs_node)) glade_xml_node_delete (attrs_node); else glade_xml_node_append_child (node, attrs_node); }
void glade_gtk_progress_bar_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { GladeWidget *widget = glade_widget_get_from_gobject (object); GladeProperty *property = glade_widget_get_property (widget, id); if (strcmp (id, "show-text") == 0) { if (g_value_get_boolean (value)) { glade_widget_property_set_sensitive (widget, "text", TRUE, NULL); glade_widget_property_set_sensitive (widget, "ellipsize", TRUE, NULL); } else { glade_widget_property_set_sensitive (widget, "text", FALSE, TEXT_DISABLED_MSG); glade_widget_property_set_sensitive (widget, "ellipsize", FALSE, TEXT_DISABLED_MSG); } } if (GPC_VERSION_CHECK (glade_property_get_class (property), gtk_major_version, gtk_minor_version + 1)) GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_color_button_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { GladeProperty *property; GladeWidget *gwidget = glade_widget_get_from_gobject (object); if (!strcmp (id, "color")) { if ((property = glade_widget_get_property (gwidget, "color")) != NULL && glade_property_get_enabled (property) && g_value_get_boxed (value)) { GdkColor *color = g_value_get_boxed (value); GdkRGBA copy; copy.red = color->red / 65535.0; copy.green = color->green / 65535.0; copy.blue = color->blue / 65535.0; copy.alpha = 1.0; gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (object), ©); } } else if (!strcmp (id, "rgba")) { if ((property = glade_widget_get_property (gwidget, "rgba")) != NULL && glade_property_get_enabled (property) && g_value_get_boxed (value)) gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (object), (GdkRGBA *) g_value_get_boxed (value)); } else GWA_GET_CLASS (GTK_TYPE_BUTTON)->set_property (adaptor, object, id, value); }
void glade_gtk_button_read_widget (GladeWidgetAdaptor * adaptor, GladeWidget * widget, GladeXmlNode * node) { GObject *object; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the normal properties.. */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->read_widget (adaptor, widget, node); glade_gtk_button_update_stock (widget); /* Fold "font-name" property into the "font" propery */ object = glade_widget_get_object (widget); if (GTK_IS_FONT_BUTTON (object)) { gchar *font_prop_value = NULL; glade_widget_property_get (widget, "font-name", &font_prop_value); if (font_prop_value != NULL) { glade_widget_property_set (widget, "font", font_prop_value); glade_widget_property_set (widget, "font-name", NULL); } } }
void glade_gtk_tool_palette_get_child_property (GladeWidgetAdaptor * adaptor, GObject * container, GObject * child, const gchar * property_name, GValue * value) { g_return_if_fail (GTK_IS_TOOL_PALETTE (container)); if (GTK_IS_TOOL_ITEM_GROUP (child) == FALSE) return; if (strcmp (property_name, "position") == 0) { g_value_set_int (value, gtk_tool_palette_get_group_position (GTK_TOOL_PALETTE (container), GTK_TOOL_ITEM_GROUP (child))); } else { /* Chain Up */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_get_property (adaptor, container, child, property_name, value); } }
gchar * glade_gtk_icon_factory_string_from_value (GladeWidgetAdaptor *adaptor, GladePropertyClass *klass, const GValue *value) { GString *string; GParamSpec *pspec; pspec = glade_property_class_get_pspec (klass); if (pspec->value_type == GLADE_TYPE_ICON_SOURCES) { GladeIconSources *sources = g_value_get_boxed (value); if (!sources) return g_strdup (""); string = g_string_new (""); g_hash_table_foreach (sources->sources, (GHFunc) serialize_icon_sources, string); return g_string_free (string, FALSE); } else return GWA_GET_CLASS (G_TYPE_OBJECT)->string_from_value (adaptor, klass, value); }
void glade_gtk_treeview_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { GladeWidget *widget = glade_widget_get_from_gobject (object); GladeProperty *property = glade_widget_get_property (widget, id); if (strcmp (id, "enable-search") == 0) { if (g_value_get_boolean (value)) glade_widget_property_set_sensitive (widget, "search-column", TRUE, NULL); else glade_widget_property_set_sensitive (widget, "search-column", FALSE, _("Search is disabled")); } else if (strcmp (id, "headers-visible") == 0) { if (g_value_get_boolean (value)) glade_widget_property_set_sensitive (widget, "headers-clickable", TRUE, NULL); else glade_widget_property_set_sensitive (widget, "headers-clickable", FALSE, _("Headers are invisible")); } else if (strcmp (id, "show-expanders") == 0) { if (g_value_get_boolean (value)) glade_widget_property_set_sensitive (widget, "expander-column", TRUE, NULL); else glade_widget_property_set_sensitive (widget, "expander-column", FALSE, _("Expanders are not shown")); } if (GPC_VERSION_CHECK (glade_property_get_class (property), gtk_major_version, gtk_minor_version + 1)) GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_header_bar_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { if (!strcmp (id, "use-custom-title")) glade_gtk_header_bar_set_use_custom_title (object, g_value_get_boolean (value)); else if (!strcmp (id, "show-close-button")) { GladeWidget *gwidget = glade_widget_get_from_gobject (object); /* We don't set the property to 'ignore' so that we catch this in the adaptor, * but we also do not apply the property to the runtime object here, thus * avoiding showing the close button which would in turn close glade itself * when clicked. */ glade_widget_property_set_sensitive (gwidget, "decoration-layout", g_value_get_boolean (value), _("The decoration layout does not apply to header bars " "which do no show window controls")); } else if (!strcmp (id, "size")) glade_gtk_header_bar_set_size (object, value); else GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_combo_box_text_set_property (GladeWidgetAdaptor *adaptor, GObject *object, const gchar *id, const GValue *value) { if (!strcmp (id, "glade-items")) { GList *string_list, *l; GladeString *string; gint active; string_list = g_value_get_boxed (value); active = gtk_combo_box_get_active (GTK_COMBO_BOX (object)); /* Update comboboxtext items */ gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (object)); for (l = string_list; l; l = l->next) { string = l->data; gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (object), string->id, string->string); } gtk_combo_box_set_active (GTK_COMBO_BOX (object), CLAMP (active, 0, g_list_length (string_list) - 1)); } else GWA_GET_CLASS (GTK_TYPE_COMBO_BOX)->set_property (adaptor, object, id, value); }
void glade_gtk_header_bar_add_child (GladeWidgetAdaptor *adaptor, GObject *parent, GObject *child) { GladeWidget *gbox, *gchild; gint size; gchar *special_child_type; gchild = glade_widget_get_from_gobject (child); if (gchild) glade_widget_set_pack_action_visible (gchild, "remove_slot", FALSE); special_child_type = g_object_get_data (child, "special-child-type"); d(g_message ("Add %s %p (special: %s)", GLADE_IS_PLACEHOLDER (child) ? "placeholder" : "child", child, special_child_type)); if (special_child_type && !strcmp (special_child_type, "title")) { gtk_header_bar_set_custom_title (GTK_HEADER_BAR (parent), GTK_WIDGET (child)); return; } GWA_GET_CLASS (GTK_TYPE_CONTAINER)->add (adaptor, parent, child); gbox = glade_widget_get_from_gobject (parent); if (!glade_widget_superuser ()) { glade_widget_property_get (gbox, "size", &size); glade_widget_property_set (gbox, "size", size); } }
void glade_gtk_listbox_get_child_property (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, GValue *value) { g_return_if_fail (GTK_IS_LIST_BOX (container)); g_return_if_fail (GTK_IS_LIST_BOX_ROW (child)); if (strcmp (property_name, "position") == 0) { gint position = gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (child)); g_value_set_int (value, position); } else { /* Chain Up */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_get_property (adaptor, container, child, property_name, value); } }
void glade_gtk_listbox_child_action_activate (GladeWidgetAdaptor *adaptor, GObject *container, GObject *object, const gchar *action_path) { if (strcmp (action_path, "insert_after") == 0) { glade_gtk_listbox_child_insert_action (adaptor, container, object, _("Insert Row on %s"), TRUE); } else if (strcmp (action_path, "insert_before") == 0) { glade_gtk_listbox_child_insert_action (adaptor, container, object, _("Insert Row on %s"), FALSE); } else { GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_action_activate (adaptor, container, object, action_path); } }
GList * glade_gtk_container_get_children (GladeWidgetAdaptor *adaptor, GObject *container) { GList *parent_children, *children; children = glade_util_container_get_all_children (GTK_CONTAINER (container)); /* Chain up */ if (GWA_GET_CLASS (GTK_TYPE_WIDGET)->get_children) parent_children = GWA_GET_CLASS (GTK_TYPE_WIDGET)->get_children (adaptor, container); else parent_children = NULL; return glade_util_purify_list (g_list_concat (children, parent_children)); }
void glade_gtk_action_bar_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { if (!strcmp (id, "use-center-child")) { GtkWidget *child; if (g_value_get_boolean (value)) { child = gtk_action_bar_get_center_widget (GTK_ACTION_BAR (object)); if (!child) child = glade_placeholder_new (); g_object_set_data (G_OBJECT (child), "special-child-type", "center"); } else child = NULL; gtk_action_bar_set_center_widget (GTK_ACTION_BAR (object), child); } else if (!strcmp (id, "size")) glade_gtk_action_bar_set_size (object, value); else GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_grid_set_child_property (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, GValue *value) { g_return_if_fail (GTK_IS_GRID (container)); g_return_if_fail (GTK_IS_WIDGET (child)); g_return_if_fail (property_name != NULL && value != NULL); GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_set_property (adaptor, container, child, property_name, value); if (strcmp (property_name, "left-attach") == 0 || strcmp (property_name, "top-attach") == 0 || strcmp (property_name, "width") == 0 || strcmp (property_name, "height") == 0) { /* Refresh placeholders */ glade_gtk_grid_refresh_placeholders (GTK_GRID (container), FALSE); } }
void glade_gtk_assistant_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * property_name, const GValue * value) { if (strcmp (property_name, "n-pages") == 0) { GtkAssistant *assistant = GTK_ASSISTANT (object); gint size, i; for (i = gtk_assistant_get_n_pages (GTK_ASSISTANT (object)), size = g_value_get_int (value); i < size; i++) { g_message ("aaaa %d %d", i,size); gtk_assistant_append_page (assistant, glade_placeholder_new ()); } glade_gtk_assistant_update_page_type (assistant); return; } /* Chain Up */ GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object, property_name, value); }
void glade_gtk_grid_replace_child (GladeWidgetAdaptor *adaptor, GObject *container, GObject *current, GObject *new_widget) { g_return_if_fail (GTK_IS_GRID (container)); g_return_if_fail (GTK_IS_WIDGET (current)); g_return_if_fail (GTK_IS_WIDGET (new_widget)); /* Chain Up */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->replace_child (adaptor, container, current, new_widget); /* If we are replacing a GladeWidget, we must refresh placeholders * because the widget may have spanned multiple rows/columns, we must * not do so in the case we are pasting multiple widgets into a grid, * where destroying placeholders results in default packing properties * (since the remaining placeholder templates no longer exist, only the * first pasted widget would have proper packing properties). */ if (!GLADE_IS_PLACEHOLDER (new_widget)) glade_gtk_grid_refresh_placeholders (GTK_GRID (container), FALSE); }
GladeEditable * glade_gtk_window_create_editable (GladeWidgetAdaptor * adaptor, GladeEditorPageType type) { GladeEditable *editable; if (type == GLADE_PAGE_GENERAL && /* Don't show all the GtkWindow properties for offscreen windows. * * We spoof the offscreen window type instead of using the real GType, * so don't check it by GType but use strcmp() instead. */ strcmp (glade_widget_adaptor_get_name (adaptor), "GtkOffscreenWindow") != 0) { GType window_type = glade_widget_adaptor_get_object_type (adaptor); if (g_type_is_a (window_type, GTK_TYPE_ABOUT_DIALOG)) editable = (GladeEditable *) glade_about_dialog_editor_new (); else if (g_type_is_a (window_type, GTK_TYPE_FILE_CHOOSER_DIALOG)) editable = (GladeEditable *) glade_file_chooser_dialog_editor_new (); else if (g_type_is_a (window_type, GTK_TYPE_FONT_CHOOSER_DIALOG)) editable = (GladeEditable *) glade_font_chooser_dialog_editor_new (); else if (g_type_is_a (window_type, GTK_TYPE_RECENT_CHOOSER_DIALOG)) editable = (GladeEditable *) glade_recent_chooser_dialog_editor_new (); else if (g_type_is_a (window_type, GTK_TYPE_MESSAGE_DIALOG)) editable = (GladeEditable *) glade_message_dialog_editor_new (); else editable = (GladeEditable *) glade_window_editor_new (); } else editable = GWA_GET_CLASS (GTK_TYPE_WIDGET)->create_editable (adaptor, type); return editable; }
void glade_gtk_scale_set_property (GladeWidgetAdaptor *adaptor, GObject *object, const gchar *id, const GValue *value) { GladeWidget *widget = glade_widget_get_from_gobject (object); GladeProperty *property = glade_widget_get_property (widget, id); if (strcmp (id, "draw-value") == 0) { if (g_value_get_boolean (value)) { glade_widget_property_set_sensitive (widget, "digits", TRUE, NULL); glade_widget_property_set_sensitive (widget, "value-pos", TRUE, NULL); } else { glade_widget_property_set_sensitive (widget, "digits", FALSE, DRAW_VALUE_DISABLED_MSG); glade_widget_property_set_sensitive (widget, "value-pos", FALSE, DRAW_VALUE_DISABLED_MSG); } } if (GPC_VERSION_CHECK (glade_property_get_class (property), gtk_major_version, gtk_minor_version + 1)) GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_button_set_property (GladeWidgetAdaptor * adaptor, GObject * object, const gchar * id, const GValue * value) { GladeWidget *widget = glade_widget_get_from_gobject (object); GladeProperty *property = glade_widget_get_property (widget, id); if (strcmp (id, "custom-child") == 0) { GtkWidget *child = gtk_bin_get_child (GTK_BIN (object)); gboolean custom_child = g_value_get_boolean (value); /* Avoid removing a child if we already have a custom child */ if (custom_child && (child && glade_widget_get_from_gobject (child))) return; if (custom_child) { if (child) gtk_container_remove (GTK_CONTAINER (object), child); gtk_container_add (GTK_CONTAINER (object), glade_placeholder_new ()); } else if (child && GLADE_IS_PLACEHOLDER (child)) gtk_container_remove (GTK_CONTAINER (object), child); } else if (strcmp (id, "stock") == 0) { gboolean use_stock = FALSE; glade_widget_property_get (widget, "use-stock", &use_stock); if (use_stock) gtk_button_set_label (GTK_BUTTON (object), g_value_get_string (value)); } else if (strcmp (id, "use-stock") == 0) { /* I guess its my bug in GTK+, we need to resync the appearance property * on GtkButton when the GtkButton:use-stock property changes. */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); glade_gtk_sync_use_appearance (widget); } else if (GPC_VERSION_CHECK (glade_property_get_class (property), gtk_major_version, gtk_minor_version + 1)) GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value); }
void glade_gtk_widget_destroy_object (GladeWidgetAdaptor * adaptor, GObject *object) { gtk_widget_destroy (GTK_WIDGET (object)); GWA_GET_CLASS (G_TYPE_OBJECT)->destroy_object (adaptor, object); }
void glade_psppire_dialog_set_property (GladeWidgetAdaptor *adaptor, GObject *object, const gchar *id, const GValue *value) { #if DEBUGGING g_print ("%s(%p) Type=\"%s\" Id=\"%s\"\n", __FUNCTION__, object, G_OBJECT_TYPE_NAME( object ), id); #endif assert ( GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property ); GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object, id, value); }