diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2005-08-31 17:58:55 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-08-31 17:58:55 +0000 |
commit | f4bbe8f0deb8d1c36829acfc791d632d27805f30 (patch) | |
tree | e4a31ea96cd58ccccd9f762d48d6ac320ee826c8 | |
parent | c09cc89317d222e54e98d4e2e9f2792de13897ec (diff) | |
download | gtk+-f4bbe8f0deb8d1c36829acfc791d632d27805f30.tar.gz |
Also intern static strings passed to g_object_set_data()
50 files changed, 145 insertions, 133 deletions
@@ -1,4 +1,7 @@ 2005-08-31 Matthias Clasen <mclasen@redhat.com> + + * gtk/*.c: Also intern static strings passed to + g_object_set_data(). * gdk/Makefile.am: * gtk/Makefile.am: Intern type names in code generated by diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cfec62bc8d..fcaa747507 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,4 +1,7 @@ 2005-08-31 Matthias Clasen <mclasen@redhat.com> + + * gtk/*.c: Also intern static strings passed to + g_object_set_data(). * gdk/Makefile.am: * gtk/Makefile.am: Intern type names in code generated by diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index b276f1193d..c1cfb59bc5 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -1139,7 +1139,8 @@ gtk_about_dialog_set_website (GtkAboutDialog *about, if (activate_url_hook != NULL) { g_object_set_data_full (G_OBJECT (priv->website_button), - "url", g_strdup (website), g_free); + g_intern_static_string ("url"), + g_strdup (website), g_free); if (priv->website_label == NULL) gtk_about_dialog_set_website_label (about, website); } @@ -1156,7 +1157,8 @@ gtk_about_dialog_set_website (GtkAboutDialog *about, else { priv->website = NULL; - g_object_set_data (G_OBJECT (priv->website_button), "url", NULL); + g_object_set_data (G_OBJECT (priv->website_button), + g_intern_static_string ("url"), NULL); gtk_widget_hide (priv->website_button); } g_free (tmp); @@ -1693,7 +1695,9 @@ create_link_button (GtkWidget *about, GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); - g_object_set_data_full (G_OBJECT (button), "url", g_strdup (url), g_free); + g_object_set_data_full (G_OBJECT (button), + g_intern_static_string ("url"), + g_strdup (url), g_free); set_link_button_text (about, button, text); g_signal_connect (button, "clicked", callback, data); @@ -1987,10 +1991,10 @@ add_credits_page (GtkAboutDialog *about, { q1++; q0++; - link_type = "email"; + link_type = g_intern_static_string ("email"); } else - link_type = "url"; + link_type = g_intern_static_string ("url"); link = g_strndup (q1, q2 - q1); tag = gtk_text_buffer_create_tag (buffer, NULL, @@ -2292,7 +2296,8 @@ gtk_show_about_dialog (GtkWindow *parent, { gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); - g_object_set_data_full (G_OBJECT (parent), "gtk-about-dialog", + g_object_set_data_full (G_OBJECT (parent), + g_intern_static_string ("gtk-about-dialog"), dialog, g_object_unref); } else diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index 8b694fe399..c4f67d1e50 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -798,7 +798,7 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) { g_object_ref (action); - g_object_set_data_full (G_OBJECT (proxy), "gtk-action", action, + g_object_set_data_full (G_OBJECT (proxy), g_intern_static_string ("gtk-action"), action, g_object_unref); /* add this widget to the list of proxies */ @@ -982,7 +982,7 @@ static void disconnect_proxy (GtkAction *action, GtkWidget *proxy) { - g_object_set_data (G_OBJECT (proxy), "gtk-action", NULL); + g_object_set_data (G_OBJECT (proxy), g_intern_static_string ("gtk-action"), NULL); /* remove proxy from list of proxies */ g_signal_handlers_disconnect_by_func (proxy, diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 6f93343ddc..8e7db584b3 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -1797,7 +1797,7 @@ gtk_button_screen_changed (GtkWidget *widget, g_signal_connect (settings, "notify::gtk-button-images", G_CALLBACK (gtk_button_setting_changed), 0); g_object_set_data (G_OBJECT (settings), - "gtk-button-connection", + g_intern_static_string ("gtk-button-connection"), GUINT_TO_POINTER (show_image_connection)); show_image_change_notify (GTK_BUTTON (widget)); diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index e49fe9f930..1b4b03d927 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -2886,7 +2886,7 @@ set_status_pending (GdkDragContext *context, GdkDragAction suggested_action) { g_object_set_data (G_OBJECT (context), - "gtk-calendar-status-pending", + g_intern_static_string ("gtk-calendar-status-pending"), GINT_TO_POINTER (suggested_action)); } diff --git a/gtk/gtkcellrenderercombo.c b/gtk/gtkcellrenderercombo.c index 6bc871f536..c47cc3360c 100644 --- a/gtk/gtkcellrenderercombo.c +++ b/gtk/gtkcellrenderercombo.c @@ -378,7 +378,7 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell, g_object_set (combo, "has-frame", FALSE, NULL); g_object_set_data_full (G_OBJECT (combo), - GTK_CELL_RENDERER_COMBO_PATH, + g_intern_static_string (GTK_CELL_RENDERER_COMBO_PATH), g_strdup (path), g_free); gtk_widget_show (combo); diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index 26ee3eb49b..0c090b3e40 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -1806,7 +1806,7 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell, if (celltext->text) gtk_entry_set_text (GTK_ENTRY (priv->entry), celltext->text); - g_object_set_data_full (G_OBJECT (priv->entry), GTK_CELL_RENDERER_TEXT_PATH, g_strdup (path), g_free); + g_object_set_data_full (G_OBJECT (priv->entry), g_intern_static_string (GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free); gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1); diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index 72ed7cc55f..fd8790ce01 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -208,7 +208,7 @@ gtk_clipboard_finalize (GObject *object) clipboards = g_object_get_data (G_OBJECT (clipboard->display), "gtk-clipboard-list"); clipboards = g_slist_remove (clipboards, clipboard); - g_object_set_data (G_OBJECT (clipboard->display), "gtk-clipboard-list", clipboards); + g_object_set_data (G_OBJECT (clipboard->display), g_intern_static_string ("gtk-clipboard-list"), clipboards); if (g_main_loop_is_running (clipboard->store_loop)) { @@ -237,7 +237,7 @@ clipboard_display_closed (GdkDisplay *display, clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list"); g_object_run_dispose (G_OBJECT (clipboard)); clipboards = g_slist_remove (clipboards, clipboard); - g_object_set_data (G_OBJECT (display), "gtk-clipboard-list", clipboards); + g_object_set_data (G_OBJECT (display), g_intern_static_string ("gtk-clipboard-list"), clipboards); g_object_unref (clipboard); } @@ -372,7 +372,7 @@ get_clipboard_widget (GdkDisplay *display) if (!clip_widget) { clip_widget = make_clipboard_widget (display, TRUE); - g_object_set_data (G_OBJECT (display), "gtk-clipboard-widget", clip_widget); + g_object_set_data (G_OBJECT (display), g_intern_static_string ("gtk-clipboard-widget"), clip_widget); } return clip_widget; @@ -1502,7 +1502,7 @@ clipboard_peek (GdkDisplay *display, clipboard->n_cached_targets = -1; clipboard->n_storable_targets = -1; clipboards = g_slist_prepend (clipboards, clipboard); - g_object_set_data (G_OBJECT (display), "gtk-clipboard-list", clipboards); + g_object_set_data (G_OBJECT (display), g_intern_static_string ("gtk-clipboard-list"), clipboards); g_signal_connect (display, "closed", G_CALLBACK (clipboard_display_closed), clipboard); gdk_display_request_selection_notification (display, selection); diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index fb130a8089..1617bf9c9e 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -297,7 +297,7 @@ color_sample_drag_end (GtkWidget *widget, GdkDragContext *context, gpointer data) { - g_object_set_data (G_OBJECT (widget), "gtk-color-selection-drag-window", NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("gtk-color-selection-drag-window"), NULL); } static void @@ -732,7 +732,7 @@ palette_drag_end (GtkWidget *widget, GdkDragContext *context, gpointer data) { - g_object_set_data (G_OBJECT (widget), "gtk-color-selection-drag-window", NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("gtk-color-selection-drag-window"), NULL); } static GdkColor * @@ -871,7 +871,7 @@ palette_set_color (GtkWidget *drawing_area, G_CALLBACK (palette_drag_handle), colorsel); - g_object_set_data (G_OBJECT (drawing_area), "color_set", + g_object_set_data (G_OBJECT (drawing_area), g_intern_static_string ("color_set"), GINT_TO_POINTER (1)); } @@ -880,7 +880,7 @@ palette_set_color (GtkWidget *drawing_area, new_color[2] = color[2]; new_color[3] = 1.0; - g_object_set_data_full (G_OBJECT (drawing_area), "color_val", new_color, (GDestroyNotify)g_free); + g_object_set_data_full (G_OBJECT (drawing_area), g_intern_static_string ("color_val"), new_color, (GDestroyNotify)g_free); } static gboolean @@ -953,7 +953,7 @@ do_popup (GtkColorSelection *colorsel, GtkWidget *mi; g_object_set_data (G_OBJECT (drawing_area), - "gtk-color-sel", + g_intern_static_string ("gtk-color-sel"), colorsel); menu = gtk_menu_new (); @@ -980,7 +980,7 @@ palette_enter (GtkWidget *drawing_area, gpointer data) { g_object_set_data (G_OBJECT (drawing_area), - "gtk-colorsel-have-pointer", + g_intern_static_string ("gtk-colorsel-have-pointer"), GUINT_TO_POINTER (TRUE)); return FALSE; @@ -992,7 +992,7 @@ palette_leave (GtkWidget *drawing_area, gpointer data) { g_object_set_data (G_OBJECT (drawing_area), - "gtk-colorsel-have-pointer", + g_intern_static_string ("gtk-colorsel-have-pointer"), NULL); return FALSE; @@ -1127,7 +1127,7 @@ palette_new (GtkColorSelection *colorsel) GTK_WIDGET_SET_FLAGS (retval, GTK_CAN_FOCUS); - g_object_set_data (G_OBJECT (retval), "color_set", GINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (retval), g_intern_static_string ("color_set"), GINT_TO_POINTER (0)); gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_EXPOSURE_MASK @@ -1644,7 +1644,7 @@ make_label_spinbutton (GtkColorSelection *colorsel, { adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 1.0)); } - g_object_set_data (G_OBJECT (adjust), "COLORSEL", colorsel); + g_object_set_data (G_OBJECT (adjust), g_intern_static_string ("COLORSEL"), colorsel); *spinbutton = gtk_spin_button_new (adjust, 10.0, 0); gtk_tooltips_set_tip (priv->tooltips, *spinbutton, tooltip, NULL); @@ -1965,7 +1965,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel) button = gtk_button_new (); gtk_widget_set_events (button, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); - g_object_set_data (G_OBJECT (button), "COLORSEL", colorsel); + g_object_set_data (G_OBJECT (button), g_intern_static_string ("COLORSEL"), colorsel); g_signal_connect (button, "clicked", G_CALLBACK (get_screen_color), NULL); picker_image = gtk_image_new_from_stock (GTK_STOCK_COLOR_PICKER, GTK_ICON_SIZE_BUTTON); @@ -2003,7 +2003,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel) gtk_misc_set_alignment (GTK_MISC (priv->opacity_label), 1.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_label, 0, 1, 4, 5); adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0)); - g_object_set_data (G_OBJECT (adjust), "COLORSEL", colorsel); + g_object_set_data (G_OBJECT (adjust), g_intern_static_string ("COLORSEL"), colorsel); priv->opacity_slider = gtk_hscale_new (adjust); gtk_tooltips_set_tip (priv->tooltips, priv->opacity_slider, diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 0468049a3a..e7963f9609 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -366,7 +366,7 @@ gtk_combo_func (GtkListItem * li) GtkWidget *label; gchar *ltext = NULL; - ltext = g_object_get_data (G_OBJECT (li), gtk_combo_string_key); + ltext = g_object_get_data (G_OBJECT (li), g_intern_static_string (gtk_combo_string_key)); if (!ltext) { label = GTK_BIN (li)->child; @@ -1151,7 +1151,7 @@ gtk_combo_set_item_string (GtkCombo * combo, GtkItem * item, const gchar * item_ g_return_if_fail (GTK_IS_COMBO (combo)); g_return_if_fail (item != NULL); - g_object_set_data_full (G_OBJECT (item), gtk_combo_string_key, + g_object_set_data_full (G_OBJECT (item), g_intern_static_string (gtk_combo_string_key), g_strdup (item_value), g_free); } diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 3b2f52a132..8c9b87cf53 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -2544,7 +2544,7 @@ gtk_combo_box_menu_fill_level (GtkComboBox *combo_box, item = gtk_separator_menu_item_new (); path = gtk_tree_model_get_path (model, &iter); g_object_set_data_full (G_OBJECT (item), - "gtk-combo-box-item-path", + g_intern_static_string ("gtk-combo-box-item-path"), gtk_tree_row_reference_new (model, path), (GDestroyNotify)gtk_tree_row_reference_free); gtk_tree_path_free (path); @@ -3065,7 +3065,7 @@ gtk_combo_box_menu_row_inserted (GtkTreeModel *model, { item = gtk_separator_menu_item_new (); g_object_set_data_full (G_OBJECT (item), - "gtk-combo-box-item-path", + g_intern_static_string ("gtk-combo-box-item-path"), gtk_tree_row_reference_new (model, path), (GDestroyNotify)gtk_tree_row_reference_free); } diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 71d791a366..a92a5291e4 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -2072,7 +2072,7 @@ chain_widget_destroyed (GtkWidget *widget, user_data); g_object_set_data (G_OBJECT (container), - "gtk-container-focus-chain", + g_intern_static_string ("gtk-container-focus-chain"), chain); } @@ -2129,7 +2129,7 @@ gtk_container_set_focus_chain (GtkContainer *container, chain = g_list_reverse (chain); g_object_set_data (G_OBJECT (container), - "gtk-container-focus-chain", + g_intern_static_string ("gtk-container-focus-chain"), chain); } @@ -2188,7 +2188,8 @@ gtk_container_unset_focus_chain (GtkContainer *container) container->has_focus_chain = FALSE; - g_object_set_data (G_OBJECT (container), "gtk-container-focus-chain", + g_object_set_data (G_OBJECT (container), + g_intern_static_string ("gtk-container-focus-chain"), NULL); tmp_list = chain; diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 13509d3035..f16e6cde80 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -539,7 +539,7 @@ get_response_data (GtkWidget *widget, ad = g_new (ResponseData, 1); g_object_set_data_full (G_OBJECT (widget), - "gtk-dialog-response-data", + g_intern_static_string ("gtk-dialog-response-data"), ad, g_free); } diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index beaa498929..c4611f496e 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -316,7 +316,7 @@ set_can_change_screen (GtkWidget *widget, { can_change_screen = can_change_screen != FALSE; - g_object_set_data (G_OBJECT (widget), "gtk-dnd-can-change-screen", + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("gtk-dnd-can-change-screen"), GUINT_TO_POINTER (can_change_screen)); } @@ -349,7 +349,7 @@ gtk_drag_get_ipc_widget (GdkScreen *screen) result = drag_widgets->data; drag_widgets = drag_widgets->next; g_object_set_data (G_OBJECT (screen), - "gtk-dnd-ipc-widgets", + g_intern_static_string ("gtk-dnd-ipc-widgets"), drag_widgets); g_slist_free_1 (tmp); } @@ -378,7 +378,7 @@ gtk_drag_release_ipc_widget (GtkWidget *widget) "gtk-dnd-ipc-widgets"); drag_widgets = g_slist_prepend (drag_widgets, widget); g_object_set_data (G_OBJECT (screen), - "gtk-dnd-ipc-widgets", + g_intern_static_string ("gtk-dnd-ipc-widgets"), drag_widgets); } @@ -796,7 +796,7 @@ gtk_drag_get_data (GtkWidget *widget, g_signal_connect (selection_widget, "selection_received", G_CALLBACK (gtk_drag_selection_received), widget); - g_object_set_data (G_OBJECT (selection_widget), "drag-context", context); + g_object_set_data (G_OBJECT (selection_widget), g_intern_static_string ("drag-context"), context); gtk_selection_convert (selection_widget, gdk_drag_get_selection (context), @@ -883,7 +883,7 @@ gtk_drag_finish (GdkDragContext *context, g_object_ref (context); - g_object_set_data (G_OBJECT (selection_widget), "drag-context", context); + g_object_set_data (G_OBJECT (selection_widget), g_intern_static_string ("drag-context"), context); g_signal_connect (selection_widget, "selection_received", G_CALLBACK (gtk_drag_selection_received), NULL); @@ -1019,7 +1019,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget, g_signal_connect (widget, "hierarchy_changed", G_CALLBACK (gtk_drag_dest_hierarchy_changed), site); - g_object_set_data_full (G_OBJECT (widget), "gtk-drag-dest", + g_object_set_data_full (G_OBJECT (widget), g_intern_static_string ("gtk-drag-dest"), site, gtk_drag_dest_site_destroy); } @@ -1115,7 +1115,7 @@ gtk_drag_dest_unset (GtkWidget *widget) { g_return_if_fail (GTK_IS_WIDGET (widget)); - g_object_set_data (G_OBJECT (widget), "gtk-drag-dest", NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("gtk-drag-dest"), NULL); } /** @@ -1511,7 +1511,7 @@ gtk_drag_selection_received (GtkWidget *widget, gtk_drag_selection_received, data); - g_object_set_data (G_OBJECT (widget), "drag-context", NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("drag-context"), NULL); g_object_unref (context); gtk_drag_release_ipc_widget (widget); @@ -2124,7 +2124,7 @@ gtk_drag_begin_internal (GtkWidget *widget, info = gtk_drag_get_source_info (context, TRUE); info->ipc_widget = ipc_widget; - g_object_set_data (G_OBJECT (info->ipc_widget), "gtk-info", info); + g_object_set_data (G_OBJECT (info->ipc_widget), g_intern_static_string ("gtk-info"), info); info->widget = gtk_widget_ref (widget); @@ -2324,7 +2324,7 @@ gtk_drag_source_set (GtkWidget *widget, site); g_object_set_data_full (G_OBJECT (widget), - "gtk-site-data", + g_intern_static_string ("gtk-site-data"), site, gtk_drag_source_site_destroy); } @@ -2357,7 +2357,7 @@ gtk_drag_source_unset (GtkWidget *widget) g_signal_handlers_disconnect_by_func (widget, gtk_drag_source_event_cb, site); - g_object_set_data (G_OBJECT (widget), "gtk-site-data", NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string ("gtk-site-data"), NULL); } } @@ -3647,7 +3647,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info) info); gtk_selection_remove_all (info->ipc_widget); - g_object_set_data (G_OBJECT (info->ipc_widget), "gtk-info", NULL); + g_object_set_data (G_OBJECT (info->ipc_widget), g_intern_static_string ("gtk-info"), NULL); source_widgets = g_slist_remove (source_widgets, info->ipc_widget); gtk_drag_release_ipc_widget (info->ipc_widget); diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 1c3fc1cd44..9b8be65477 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -4465,7 +4465,7 @@ append_action_signal (GtkEntry *entry, { GtkWidget *menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); - g_object_set_data (G_OBJECT (menuitem), "gtk-signal", (char *)signal); + g_object_set_data (G_OBJECT (menuitem), g_intern_static_string ("gtk-signal"), (char *)signal); g_signal_connect (menuitem, "activate", G_CALLBACK (activate_cb), entry); @@ -5426,7 +5426,7 @@ gtk_entry_set_completion (GtkEntry *entry, if (!completion) { - g_object_set_data (G_OBJECT (entry), GTK_ENTRY_COMPLETION_KEY, NULL); + g_object_set_data (G_OBJECT (entry), g_intern_static_string (GTK_ENTRY_COMPLETION_KEY), NULL); return; } @@ -5435,7 +5435,7 @@ gtk_entry_set_completion (GtkEntry *entry, connect_completion_signals (entry, completion); completion->priv->entry = GTK_WIDGET (entry); - g_object_set_data (G_OBJECT (entry), GTK_ENTRY_COMPLETION_KEY, completion); + g_object_set_data (G_OBJECT (entry), g_intern_static_string (GTK_ENTRY_COMPLETION_KEY), completion); } /** diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 5ca14371e2..45e4a74c43 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -3713,7 +3713,7 @@ create_file_list (GtkFileChooserDefault *impl) /* Tree/list view */ impl->browse_files_tree_view = gtk_tree_view_new (); - g_object_set_data (G_OBJECT (impl->browse_files_tree_view), "GtkFileChooserDefault", impl); + g_object_set_data (G_OBJECT (impl->browse_files_tree_view), g_intern_static_string ("GtkFileChooserDefault"), impl); atk_object_set_name (gtk_widget_get_accessible (impl->browse_files_tree_view), _("Files")); gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (impl->browse_files_tree_view), TRUE); diff --git a/gtk/gtkfilechooserembed.c b/gtk/gtkfilechooserembed.c index dc114905bf..8fc3719809 100644 --- a/gtk/gtkfilechooserembed.c +++ b/gtk/gtkfilechooserembed.c @@ -76,7 +76,7 @@ _gtk_file_chooser_embed_set_delegate (GtkFileChooserEmbed *receiver, g_return_if_fail (GTK_IS_FILE_CHOOSER_EMBED (receiver)); g_return_if_fail (GTK_IS_FILE_CHOOSER_EMBED (delegate)); - g_object_set_data (G_OBJECT (receiver), "gtk-file-chooser-embed-delegate", delegate); + g_object_set_data (G_OBJECT (receiver), g_intern_static_string ("gtk-file-chooser-embed-delegate"), delegate); g_signal_connect (delegate, "default_size_changed", G_CALLBACK (delegate_default_size_changed), receiver); diff --git a/gtk/gtkfilechooserutils.c b/gtk/gtkfilechooserutils.c index c8d303dab0..40bdd1a07f 100644 --- a/gtk/gtkfilechooserutils.c +++ b/gtk/gtkfilechooserutils.c @@ -168,7 +168,7 @@ _gtk_file_chooser_set_delegate (GtkFileChooser *receiver, g_return_if_fail (GTK_IS_FILE_CHOOSER (receiver)); g_return_if_fail (GTK_IS_FILE_CHOOSER (delegate)); - g_object_set_data (G_OBJECT (receiver), "gtk-file-chooser-delegate", delegate); + g_object_set_data (G_OBJECT (receiver), g_intern_static_string ("gtk-file-chooser-delegate"), delegate); g_signal_connect (delegate, "notify", G_CALLBACK (delegate_notify), receiver); g_signal_connect (delegate, "current-folder-changed", diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 108c2795a0..8cfe382b1a 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -985,7 +985,7 @@ filenames_dropped (GtkWidget *widget, "Are you sure that you want to select it?"), filename_utf8, hostname); g_free (filename_utf8); - g_object_set_data_full (G_OBJECT (dialog), "gtk-fs-dnd-filename", g_strdup (filename), g_free); + g_object_set_data_full (G_OBJECT (dialog), g_intern_static_string ("gtk-fs-dnd-filename"), g_strdup (filename), g_free); g_signal_connect_data (dialog, "response", (GCallback) dnd_really_drop, diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index 2b1c5b4dc9..7d37afb3df 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -1493,7 +1493,7 @@ file_model_node_get_children (GtkFileSystemModel *model, g_signal_connect (node->folder, "files-removed", G_CALLBACK (files_removed_callback), node); - g_object_set_data (G_OBJECT (node->folder), "model-node", node); + g_object_set_data (G_OBJECT (node->folder), g_intern_static_string ("model-node"), node); } if (is_folder && !has_children) diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index 64ebca3a73..1c3abcdeb5 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -716,7 +716,7 @@ icon_theme_changed (GtkIconTheme *icon_theme) cache = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)icon_cache_element_free); - g_object_set_data_full (G_OBJECT (icon_theme), "gtk-file-icon-cache", + g_object_set_data_full (G_OBJECT (icon_theme), g_intern_static_string ("gtk-file-icon-cache"), cache, (GDestroyNotify)g_hash_table_destroy); } @@ -735,7 +735,7 @@ get_cached_icon (GtkWidget *widget, (GDestroyNotify)g_free, (GDestroyNotify)icon_cache_element_free); - g_object_set_data_full (G_OBJECT (icon_theme), "gtk-file-icon-cache", + g_object_set_data_full (G_OBJECT (icon_theme), g_intern_static_string ("gtk-file-icon-cache"), cache, (GDestroyNotify)g_hash_table_destroy); g_signal_connect (icon_theme, "changed", G_CALLBACK (icon_theme_changed), NULL); diff --git a/gtk/gtkgamma.c b/gtk/gtkgamma.c index 2574d209f0..65aba0f6b8 100644 --- a/gtk/gtkgamma.c +++ b/gtk/gtkgamma.c @@ -274,7 +274,7 @@ gtk_gamma_curve_init (GtkGammaCurve *curve) for (i = 0; i < 3; ++i) { curve->button[i] = gtk_toggle_button_new (); - g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", + g_object_set_data (G_OBJECT (curve->button[i]), g_intern_static_string ("_GtkGammaCurveIndex"), GINT_TO_POINTER (i)); gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); g_signal_connect (curve->button[i], "realize", @@ -288,7 +288,7 @@ gtk_gamma_curve_init (GtkGammaCurve *curve) for (i = 3; i < 5; ++i) { curve->button[i] = gtk_button_new (); - g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", + g_object_set_data (G_OBJECT (curve->button[i]), g_intern_static_string ("_GtkGammaCurveIndex"), GINT_TO_POINTER (i)); gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); g_signal_connect (curve->button[i], "realize", diff --git a/gtk/gtkgc.c b/gtk/gtkgc.c index 09c5a62123..b53bcaaedf 100644 --- a/gtk/gtkgc.c +++ b/gtk/gtkgc.c @@ -116,7 +116,7 @@ gtk_gc_get_drawable_ht (GdkScreen *screen) (GEqualFunc) gtk_gc_drawable_equal, NULL, free_gc_drawable); g_object_set_data_full (G_OBJECT (screen), - "gtk-gc-drawable-ht", ht, + g_intern_static_string ("gtk-gc-drawable-ht"), ht, (GDestroyNotify)g_hash_table_destroy); } diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index feb64cbeda..f600284ccb 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -119,7 +119,7 @@ gtk_icon_factory_get_type (void) }; icon_factory_type = - g_type_register_static (G_TYPE_OBJECT, "GtkIconFactory", + g_type_register_static (G_TYPE_OBJECT, g_intern_static_string ("GtkIconFactory"), &icon_factory_info, 0); } diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index b0d98b285e..299b02900c 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -339,7 +339,7 @@ gtk_icon_theme_get_for_screen (GdkScreen *screen) priv = icon_theme->priv; priv->is_screen_singleton = TRUE; - g_object_set_data (G_OBJECT (screen), "gtk-icon-theme", icon_theme); + g_object_set_data (G_OBJECT (screen), g_intern_static_string ("gtk-icon-theme"), icon_theme); } return icon_theme; @@ -389,7 +389,7 @@ display_closed (GdkDisplay *display, if (was_screen_singleton) { - g_object_set_data (G_OBJECT (screen), "gtk-icon-theme", NULL); + g_object_set_data (G_OBJECT (screen), g_intern_static_string ("gtk-icon-theme"), NULL); priv->is_screen_singleton = FALSE; } diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 7d87781877..6d1b962d57 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -5579,7 +5579,7 @@ set_status_pending (GdkDragContext *context, GdkDragAction suggested_action) { g_object_set_data (G_OBJECT (context), - "gtk-icon-view-status-pending", + g_intern_static_string ("gtk-icon-view-status-pending"), GINT_TO_POINTER (suggested_action)); } @@ -5627,12 +5627,12 @@ set_source_row (GdkDragContext *context, { if (source_row) g_object_set_data_full (G_OBJECT (context), - "gtk-icon-view-source-row", + g_intern_static_string ("gtk-icon-view-source-row"), gtk_tree_row_reference_new (model, source_row), (GDestroyNotify) gtk_tree_row_reference_free); else g_object_set_data_full (G_OBJECT (context), - "gtk-icon-view-source-row", + g_intern_static_string ("gtk-icon-view-source-row"), NULL, NULL); } @@ -5677,7 +5677,7 @@ set_dest_row (GdkDragContext *context, if (!dest_row) { g_object_set_data_full (G_OBJECT (context), - "gtk-icon-view-dest-row", + g_intern_static_string ("gtk-icon-view-dest-row"), NULL, NULL); return; } @@ -5688,7 +5688,7 @@ set_dest_row (GdkDragContext *context, dr->empty_view_drop = empty_view_drop; dr->drop_append_mode = drop_append_mode; g_object_set_data_full (G_OBJECT (context), - "gtk-icon-view-dest-row", + g_intern_static_string ("gtk-icon-view-dest-row"), dr, (GDestroyNotify) dest_row_free); } diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c index 5b02969d79..8e75ca9082 100644 --- a/gtk/gtkimagemenuitem.c +++ b/gtk/gtkimagemenuitem.c @@ -650,7 +650,7 @@ gtk_image_menu_item_screen_changed (GtkWidget *widget, g_signal_connect (settings, "notify::gtk-menu-images", G_CALLBACK (gtk_image_menu_item_setting_changed), 0); g_object_set_data (G_OBJECT (settings), - "gtk-image-menu-item-connection", + g_intern_static_string ("gtk-image-menu-item-connection"), GUINT_TO_POINTER (show_image_connection)); show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c index e8315b55ad..8a0d50428e 100644 --- a/gtk/gtkimcontext.c +++ b/gtk/gtkimcontext.c @@ -209,7 +209,7 @@ gtk_im_context_real_get_surrounding (GtkIMContext *context, if (!info) { info = &local_info; - g_object_set_data (G_OBJECT (context), "gtk-im-surrounding-info", info); + g_object_set_data (G_OBJECT (context), g_intern_static_string ("gtk-im-surrounding-info"), info); info_is_local = TRUE; } @@ -231,7 +231,7 @@ gtk_im_context_real_get_surrounding (GtkIMContext *context, if (info_is_local) { g_free (info->text); - g_object_set_data (G_OBJECT (context), "gtk-im-surrounding-info", NULL); + g_object_set_data (G_OBJECT (context), g_intern_static_string ("gtk-im-surrounding-info"), NULL); } return result; diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index db173d7021..96934f9d97 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -555,7 +555,7 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); - g_object_set_data (G_OBJECT (menuitem), "gtk-context-id", + g_object_set_data (G_OBJECT (menuitem), g_intern_static_string ("gtk-context-id"), (char *)contexts[i]->context_id); g_signal_connect (menuitem, "activate", G_CALLBACK (activate_cb), context); diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index ad0645cf56..71c8aa16df 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -919,7 +919,7 @@ gtk_label_setup_mnemonic (GtkLabel *label, } done: - g_object_set_data (G_OBJECT (label), "gtk-mnemonic-menu", mnemonic_menu); + g_object_set_data (G_OBJECT (label), g_intern_static_string ("gtk-mnemonic-menu"), mnemonic_menu); } static void @@ -1749,7 +1749,7 @@ get_label_wrap_width (GtkLabel *label) if (!wrap_width) { wrap_width = g_new0 (LabelWrapWidth, 1); - g_object_set_data_full (G_OBJECT (style), "gtk-label-wrap-width", + g_object_set_data_full (G_OBJECT (style), g_intern_static_string ("gtk-label-wrap-width"), wrap_width, label_wrap_width_free); } @@ -3889,7 +3889,7 @@ append_action_signal (GtkLabel *label, { GtkWidget *menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); - g_object_set_data (G_OBJECT (menuitem), "gtk-signal", (char *)signal); + g_object_set_data (G_OBJECT (menuitem), g_intern_static_string ("gtk-signal"), (char *)signal); g_signal_connect (menuitem, "activate", G_CALLBACK (activate_cb), label); diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 5059afa0a3..3ca1ab3797 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -319,7 +319,7 @@ get_attach_info (GtkWidget *child) if (!ai) { ai = g_new0 (AttachInfo, 1); - g_object_set_data_full (object, ATTACH_INFO_KEY, ai, g_free); + g_object_set_data_full (object, g_intern_static_string (ATTACH_INFO_KEY), ai, g_free); } return ai; @@ -1053,13 +1053,13 @@ gtk_menu_attach_to_widget (GtkMenu *menu, attach_widget_screen_changed (attach_widget, NULL, menu); data->detacher = detacher; - g_object_set_data (G_OBJECT (menu), attach_data_key, data); + g_object_set_data (G_OBJECT (menu), g_intern_static_string (attach_data_key), data); list = g_object_steal_data (G_OBJECT (attach_widget), ATTACHED_MENUS); if (!g_list_find (list, menu)) { list = g_list_prepend (list, menu); } - g_object_set_data_full (G_OBJECT (attach_widget), ATTACHED_MENUS, list, (GtkDestroyNotify) g_list_free); + g_object_set_data_full (G_OBJECT (attach_widget), g_intern_static_string (ATTACHED_MENUS), list, (GtkDestroyNotify) g_list_free); if (GTK_WIDGET_STATE (menu) != GTK_STATE_NORMAL) gtk_widget_set_state (GTK_WIDGET (menu), GTK_STATE_NORMAL); @@ -1101,7 +1101,7 @@ gtk_menu_detach (GtkMenu *menu) g_warning ("gtk_menu_detach(): menu is not attached"); return; } - g_object_set_data (G_OBJECT (menu), attach_data_key, NULL); + g_object_set_data (G_OBJECT (menu), g_intern_static_string (attach_data_key), NULL); g_signal_handlers_disconnect_by_func (data->attach_widget, (gpointer) attach_widget_screen_changed, @@ -1111,9 +1111,9 @@ gtk_menu_detach (GtkMenu *menu) list = g_object_steal_data (G_OBJECT (data->attach_widget), ATTACHED_MENUS); list = g_list_remove (list, menu); if (list) - g_object_set_data_full (G_OBJECT (data->attach_widget), ATTACHED_MENUS, list, (GtkDestroyNotify) g_list_free); + g_object_set_data_full (G_OBJECT (data->attach_widget), g_intern_static_string (ATTACHED_MENUS), list, (GtkDestroyNotify) g_list_free); else - g_object_set_data (G_OBJECT (data->attach_widget), ATTACHED_MENUS, NULL); + g_object_set_data (G_OBJECT (data->attach_widget), g_intern_static_string (ATTACHED_MENUS), NULL); if (GTK_WIDGET_REALIZED (menu)) gtk_widget_unrealize (GTK_WIDGET (menu)); @@ -1148,7 +1148,7 @@ gtk_menu_remove (GtkContainer *container, } GTK_CONTAINER_CLASS (parent_class)->remove (container, widget); - g_object_set_data (G_OBJECT (widget), ATTACH_INFO_KEY, NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string (ATTACH_INFO_KEY), NULL); menu_queue_resize (menu); } @@ -1935,10 +1935,10 @@ gtk_menu_set_title (GtkMenu *menu, g_return_if_fail (GTK_IS_MENU (menu)); if (title) - g_object_set_data_full (G_OBJECT (menu), "gtk-menu-title", + g_object_set_data_full (G_OBJECT (menu), g_intern_static_string ("gtk-menu-title"), g_strdup (title), (GtkDestroyNotify) g_free); else - g_object_set_data (G_OBJECT (menu), "gtk-menu-title", NULL); + g_object_set_data (G_OBJECT (menu), g_intern_static_string ("gtk-menu-title"), NULL); gtk_menu_update_title (menu); g_object_notify (G_OBJECT (menu), "tearoff-title"); @@ -2121,7 +2121,7 @@ menu_grab_transfer_window_get (GtkMenu *menu) gdk_window_show (window); - g_object_set_data (G_OBJECT (menu), "gtk-menu-transfer-window", window); + g_object_set_data (G_OBJECT (menu), g_intern_static_string ("gtk-menu-transfer-window"), window); } return window; @@ -2135,7 +2135,7 @@ menu_grab_transfer_window_destroy (GtkMenu *menu) { gdk_window_set_user_data (window, NULL); gdk_window_destroy (window); - g_object_set_data (G_OBJECT (menu), "gtk-menu-transfer-window", NULL); + g_object_set_data (G_OBJECT (menu), g_intern_static_string ("gtk-menu-transfer-window"), NULL); } } @@ -3965,7 +3965,7 @@ gtk_menu_set_screen (GtkMenu *menu, g_return_if_fail (GTK_IS_MENU (menu)); g_return_if_fail (!screen || GDK_IS_SCREEN (screen)); - g_object_set_data (G_OBJECT (menu), "gtk-menu-explicit-screen", screen); + g_object_set_data (G_OBJECT (menu), g_intern_static_string ("gtk-menu-explicit-screen"), screen); if (screen) { diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index fb6b378c6b..8e9aedc977 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -608,7 +608,7 @@ static void set_menu_bars (GtkWindow *window, GList *menubars) { - g_object_set_data (G_OBJECT (window), "gtk-menu-bar-list", menubars); + g_object_set_data (G_OBJECT (window), g_intern_static_string ("gtk-menu-bar-list"), menubars); } static gboolean diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c index e80a13ab61..ff4ff921eb 100644 --- a/gtk/gtkmodules.c +++ b/gtk/gtkmodules.c @@ -428,7 +428,7 @@ display_closed_cb (GdkDisplay *display, settings = gtk_settings_get_for_screen (screen); g_object_set_data_full (G_OBJECT (settings), - "gtk-modules", + g_intern_static_string ("gtk-modules"), NULL, NULL); } } @@ -535,7 +535,7 @@ _gtk_modules_settings_changed (GtkSettings *settings, new_modules = load_modules (modules); g_object_set_data_full (G_OBJECT (settings), - "gtk-modules", + g_intern_static_string ("gtk-modules"), new_modules, settings_destroy_notify); } diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index 58281fc8b4..6c5e18ab6e 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -422,7 +422,7 @@ gtk_object_set_property (GObject *object, switch (property_id) { case PROP_USER_DATA: - g_object_set_data (G_OBJECT (object), "user_data", g_value_get_pointer (value)); + g_object_set_data (G_OBJECT (object), g_intern_static_string ("user_data"), g_value_get_pointer (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index e7ef8443d5..739ff38c00 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -682,7 +682,7 @@ gtk_selection_target_list_get (GtkWidget *widget, sellist->list = gtk_target_list_new (NULL, 0); lists = g_list_prepend (lists, sellist); - g_object_set_data (G_OBJECT (widget), gtk_selection_handler_key, lists); + g_object_set_data (G_OBJECT (widget), g_intern_static_string (gtk_selection_handler_key), lists); return sellist->list; } @@ -708,7 +708,7 @@ gtk_selection_target_list_remove (GtkWidget *widget) } g_list_free (lists); - g_object_set_data (G_OBJECT (widget), gtk_selection_handler_key, NULL); + g_object_set_data (G_OBJECT (widget), g_intern_static_string (gtk_selection_handler_key), NULL); } /** @@ -748,7 +748,7 @@ gtk_selection_clear_targets (GtkWidget *widget, tmp_list = tmp_list->next; } - g_object_set_data (G_OBJECT (widget), gtk_selection_handler_key, lists); + g_object_set_data (G_OBJECT (widget), g_intern_static_string (gtk_selection_handler_key), lists); } /** diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 6a4e4823c7..af3b741737 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -426,7 +426,7 @@ gtk_settings_get_for_screen (GdkScreen *screen) { settings = g_object_new (GTK_TYPE_SETTINGS, NULL); settings->screen = screen; - g_object_set_data (G_OBJECT (screen), "gtk-settings", settings); + g_object_set_data (G_OBJECT (screen), g_intern_static_string ("gtk-settings"), settings); gtk_rc_reparse_all_for_settings (settings, TRUE); settings_update_double_click (settings); diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index 47e46688aa..74e219d74e 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -225,7 +225,7 @@ gtk_socket_init (GtkSocket *socket) socket->active = FALSE; socket->accel_group = gtk_accel_group_new (); - g_object_set_data (G_OBJECT (socket->accel_group), "gtk-socket", socket); + g_object_set_data (G_OBJECT (socket->accel_group), g_intern_static_string ("gtk-socket"), socket); } /** diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index 3cf0094bce..85b08f0989 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -6541,7 +6541,7 @@ style_unrealize_cursor_gcs (GtkStyle *style) gtk_gc_release (cursor_info->secondary_gc); g_free (cursor_info); - g_object_set_data (G_OBJECT (style), "gtk-style-cursor-info", NULL); + g_object_set_data (G_OBJECT (style), g_intern_static_string ("gtk-style-cursor-info"), NULL); } } @@ -6579,7 +6579,7 @@ get_insertion_cursor_gc (GtkWidget *widget, if (!cursor_info) { cursor_info = g_new (CursorInfo, 1); - g_object_set_data (G_OBJECT (widget->style), "gtk-style-cursor-info", cursor_info); + g_object_set_data (G_OBJECT (widget->style), g_intern_static_string ("gtk-style-cursor-info"), cursor_info); cursor_info->primary_gc = NULL; cursor_info->secondary_gc = NULL; cursor_info->for_type = G_TYPE_INVALID; diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index d40fa29a6f..29a41cb0e7 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -2811,7 +2811,7 @@ create_clipboard_contents_buffer (GtkTextBuffer *buffer) contents = gtk_text_buffer_new (gtk_text_buffer_get_tag_table (buffer)); - g_object_set_data (G_OBJECT (contents), "gtk-text-buffer-clipboard", GINT_TO_POINTER (1)); + g_object_set_data (G_OBJECT (contents), g_intern_static_string ("gtk-text-buffer-clipboard"), GINT_TO_POINTER (1)); return contents; } diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index c06361938e..7f7c73d240 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -299,7 +299,7 @@ _gtk_anchored_child_set_layout (GtkWidget *child, GtkTextLayout *layout) { g_object_set_data (G_OBJECT (child), - "gtk-text-child-anchor-layout", + g_intern_static_string ("gtk-text-child-anchor-layout"), layout); } diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 4cb52c63fd..47be831749 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -651,7 +651,7 @@ on_renderer_display_closed (GdkDisplay *display, g_signal_handlers_disconnect_by_func (text_renderer->screen, (gpointer)on_renderer_display_closed, text_renderer); - g_object_set_data (G_OBJECT (text_renderer->screen), "gtk-text-renderer", NULL); + g_object_set_data (G_OBJECT (text_renderer->screen), g_intern_static_string ("gtk-text-renderer"), NULL); } static GtkTextRenderer * @@ -667,7 +667,7 @@ get_text_renderer (GdkScreen *screen) text_renderer = g_object_new (GTK_TYPE_TEXT_RENDERER, "screen", screen, NULL); text_renderer->screen = screen; - g_object_set_data_full (G_OBJECT (screen), "gtk-text-renderer", text_renderer, + g_object_set_data_full (G_OBJECT (screen), g_intern_static_string ("gtk-text-renderer"), text_renderer, (GDestroyNotify)g_object_unref); g_signal_connect (gdk_screen_get_display (screen), "closed", diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 945a561c74..440e30be09 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -110,7 +110,7 @@ _gtk_text_util_append_special_char_menuitems (GtkMenuShell *menushe info->data = data; menuitem = gtk_menu_item_new_with_mnemonic (_(bidi_menu_entries[i].label)); - g_object_set_data (G_OBJECT (menuitem), "gtk-unicode-menu-entry", + g_object_set_data (G_OBJECT (menuitem), g_intern_static_string ("gtk-unicode-menu-entry"), (gpointer)&bidi_menu_entries[i]); g_signal_connect_data (menuitem, "activate", diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 722277297d..d950170415 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -6899,7 +6899,7 @@ append_action_signal (GtkTextView *text_view, { GtkWidget *menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); - g_object_set_data (G_OBJECT (menuitem), "gtk-signal", (char *)signal); + g_object_set_data (G_OBJECT (menuitem), g_intern_static_string ("gtk-signal"), (char *)signal); g_signal_connect (menuitem, "activate", G_CALLBACK (activate_cb), text_view); @@ -8087,7 +8087,7 @@ text_view_child_new_anchored (GtkWidget *child, g_object_ref (vc->anchor); g_object_set_data (G_OBJECT (child), - "gtk-text-view-child", + g_intern_static_string ("gtk-text-view-child"), vc); gtk_text_child_anchor_register_child (anchor, child, layout); @@ -8118,7 +8118,7 @@ text_view_child_new_window (GtkWidget *child, vc->y = y; g_object_set_data (G_OBJECT (child), - "gtk-text-view-child", + g_intern_static_string ("gtk-text-view-child"), vc); return vc; @@ -8128,7 +8128,7 @@ static void text_view_child_free (GtkTextViewChild *child) { g_object_set_data (G_OBJECT (child->widget), - "gtk-text-view-child", NULL); + g_intern_static_string ("gtk-text-view-child"), NULL); if (child->anchor) { diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index b8ba8d4062..12a2761dc7 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -148,7 +148,7 @@ gtk_tooltips_destroy_data (GtkTooltipsData *tooltipsdata) gtk_tooltips_widget_remove, tooltipsdata); - g_object_set_data (G_OBJECT (tooltipsdata->widget), tooltips_data_key, NULL); + g_object_set_data (G_OBJECT (tooltipsdata->widget), g_intern_static_string (tooltips_data_key), NULL); g_object_unref (tooltipsdata->widget); g_free (tooltipsdata); } @@ -361,7 +361,7 @@ gtk_tooltips_set_tip (GtkTooltips *tooltips, G_CALLBACK (gtk_tooltips_event_handler), tooltipsdata); - g_object_set_data (G_OBJECT (widget), tooltips_data_key, + g_object_set_data (G_OBJECT (widget), g_intern_static_string (tooltips_data_key), tooltipsdata); g_signal_connect (widget, "unmap", @@ -415,7 +415,7 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips) style = tooltips->tip_window->style; widget = tooltips->active_tips_data->widget; - g_object_set_data (G_OBJECT (tooltips->tip_window), tooltips_info_key, + g_object_set_data (G_OBJECT (tooltips->tip_window), g_intern_static_string (tooltips_info_key), tooltips); keyboard_mode = get_keyboard_mode (widget); @@ -588,7 +588,7 @@ start_keyboard_mode (GtkWidget *widget) { GtkWidget *focus = GTK_WINDOW (toplevel)->focus_widget; - g_object_set_data (G_OBJECT (toplevel), "gtk-tooltips-keyboard-mode", GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (toplevel), g_intern_static_string ("gtk-tooltips-keyboard-mode"), GUINT_TO_POINTER (TRUE)); if (focus) gtk_tooltips_show_tip (focus); @@ -605,7 +605,7 @@ stop_keyboard_mode (GtkWidget *widget) if (focus) gtk_tooltips_hide_tip (focus); - g_object_set_data (G_OBJECT (toplevel), "gtk-tooltips-keyboard-mode", GUINT_TO_POINTER (FALSE)); + g_object_set_data (G_OBJECT (toplevel), g_intern_static_string ("gtk-tooltips-keyboard-mode"), GUINT_TO_POINTER (FALSE)); } } diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 5178dbbc72..967793aaad 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -1913,7 +1913,7 @@ gtk_tree_row_reference_new_proxy (GObject *proxy, refs->list = NULL; g_object_set_data_full (G_OBJECT (proxy), - ROW_REF_DATA_STRING, + g_intern_static_string (ROW_REF_DATA_STRING), refs, release_row_references); } @@ -2027,7 +2027,7 @@ gtk_tree_row_reference_free (GtkTreeRowReference *reference) if (refs->list == NULL) { g_object_set_data (G_OBJECT (reference->proxy), - ROW_REF_DATA_STRING, + g_intern_static_string (ROW_REF_DATA_STRING), NULL); } diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 2db0cb9549..f92feee66c 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -5491,7 +5491,7 @@ set_source_row (GdkDragContext *context, GtkTreePath *source_row) { g_object_set_data_full (G_OBJECT (context), - "gtk-tree-view-source-row", + g_intern_static_string ("gtk-tree-view-source-row"), source_row ? gtk_tree_row_reference_new (model, source_row) : NULL, (GDestroyNotify) (source_row ? gtk_tree_row_reference_free : NULL)); } @@ -5539,7 +5539,7 @@ set_dest_row (GdkDragContext *context, if (!dest_row) { - g_object_set_data_full (G_OBJECT (context), "gtk-tree-view-dest-row", + g_object_set_data_full (G_OBJECT (context), g_intern_static_string ("gtk-tree-view-dest-row"), NULL, NULL); return; } @@ -5551,7 +5551,7 @@ set_dest_row (GdkDragContext *context, dr->empty_view_drop = empty_view_drop; dr->drop_append_mode = drop_append_mode; - g_object_set_data_full (G_OBJECT (context), "gtk-tree-view-dest-row", + g_object_set_data_full (G_OBJECT (context), g_intern_static_string ("gtk-tree-view-dest-row"), dr, (GDestroyNotify) dest_row_free); } @@ -5594,7 +5594,7 @@ set_status_pending (GdkDragContext *context, GdkDragAction suggested_action) { g_object_set_data (G_OBJECT (context), - "gtk-tree-view-status-pending", + g_intern_static_string ("gtk-tree-view-status-pending"), GINT_TO_POINTER (suggested_action)); } @@ -5649,7 +5649,7 @@ ensure_info (GtkTreeView *tree_view) di = g_new0 (TreeViewDragInfo, 1); g_object_set_data_full (G_OBJECT (tree_view), - "gtk-tree-view-drag-info", + g_intern_static_string ("gtk-tree-view-drag-info"), di, (GDestroyNotify) destroy_info); } @@ -5660,7 +5660,7 @@ ensure_info (GtkTreeView *tree_view) static void remove_info (GtkTreeView *tree_view) { - g_object_set_data (G_OBJECT (tree_view), "gtk-tree-view-drag-info", NULL); + g_object_set_data (G_OBJECT (tree_view), g_intern_static_string ("gtk-tree-view-drag-info"), NULL); } #if 0 diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c index f28f048a12..957f1cd361 100644 --- a/gtk/gtkuimanager.c +++ b/gtk/gtkuimanager.c @@ -2271,7 +2271,7 @@ update_node (GtkUIManager *self, gtk_menu_shell_append (GTK_MENU_SHELL (menu), tearoff); filler = gtk_menu_item_new_with_label (_("Empty")); g_object_set_data (G_OBJECT (filler), - "gtk-empty-menu-item", + g_intern_static_string ("gtk-empty-menu-item"), GINT_TO_POINTER (TRUE)); gtk_widget_set_sensitive (filler, FALSE); gtk_widget_set_no_show_all (filler, TRUE); @@ -2371,7 +2371,7 @@ update_node (GtkUIManager *self, g_object_ref (info->proxy); gtk_object_sink (GTK_OBJECT (info->proxy)); g_object_set_data (G_OBJECT (info->proxy), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (SEPARATOR_MODE_HIDDEN)); gtk_widget_set_no_show_all (info->proxy, TRUE); gtk_menu_shell_insert (GTK_MENU_SHELL (menushell), @@ -2381,7 +2381,7 @@ update_node (GtkUIManager *self, g_object_ref (info->extra); gtk_object_sink (GTK_OBJECT (info->extra)); g_object_set_data (G_OBJECT (info->extra), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (SEPARATOR_MODE_HIDDEN)); gtk_widget_set_no_show_all (info->extra, TRUE); gtk_menu_shell_insert (GTK_MENU_SHELL (menushell), @@ -2424,7 +2424,7 @@ update_node (GtkUIManager *self, g_object_ref (info->proxy); gtk_object_sink (GTK_OBJECT (info->proxy)); g_object_set_data (G_OBJECT (info->proxy), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (SEPARATOR_MODE_HIDDEN)); gtk_widget_set_no_show_all (info->proxy, TRUE); @@ -2434,7 +2434,7 @@ update_node (GtkUIManager *self, g_object_ref (info->extra); gtk_object_sink (GTK_OBJECT (info->extra)); g_object_set_data (G_OBJECT (info->extra), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (SEPARATOR_MODE_HIDDEN)); gtk_widget_set_no_show_all (info->extra, TRUE); } @@ -2574,7 +2574,7 @@ update_node (GtkUIManager *self, separator_mode = SEPARATOR_MODE_SMART; g_object_set_data (G_OBJECT (info->proxy), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (separator_mode)); gtk_widget_show (info->proxy); } @@ -2599,7 +2599,7 @@ update_node (GtkUIManager *self, gtk_object_sink (GTK_OBJECT (info->proxy)); gtk_widget_set_no_show_all (info->proxy, TRUE); g_object_set_data (G_OBJECT (info->proxy), - "gtk-separator-mode", + g_intern_static_string ("gtk-separator-mode"), GINT_TO_POINTER (SEPARATOR_MODE_SMART)); gtk_menu_shell_insert (GTK_MENU_SHELL (menushell), info->proxy, pos); diff --git a/gtk/gtkwindow-decorate.c b/gtk/gtkwindow-decorate.c index 60ef4b3278..31dddfe3ff 100644 --- a/gtk/gtkwindow-decorate.c +++ b/gtk/gtkwindow-decorate.c @@ -148,7 +148,7 @@ gtk_decorated_window_init (GtkWindow *window) deco->maximizable = FALSE; deco->real_inner_move = FALSE; - g_object_set_data_full (G_OBJECT (window), "gtk-window-decoration", deco, + g_object_set_data_full (G_OBJECT (window), g_intern_static_string ("gtk-window-decoration"), deco, (GDestroyNotify) gtk_decoration_free); gtk_window_set_has_frame (window, TRUE); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index d4ab6c51a3..c5279a7ec9 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1731,7 +1731,7 @@ gtk_window_add_embedded_xid (GtkWindow *window, guint xid) embedded_windows = g_list_prepend (embedded_windows, GUINT_TO_POINTER (xid)); - g_object_set_data_full (G_OBJECT (window), "gtk-embedded", + g_object_set_data_full (G_OBJECT (window), g_intern_static_string ("gtk-embedded"), embedded_windows, embedded_windows ? (GDestroyNotify) g_list_free : NULL); @@ -1757,7 +1757,7 @@ gtk_window_remove_embedded_xid (GtkWindow *window, guint xid) g_list_free_1 (node); } - g_object_set_data_full (G_OBJECT (window), "gtk-embedded", + g_object_set_data_full (G_OBJECT (window), g_intern_static_string ("gtk-embedded"), embedded_windows, embedded_windows ? (GDestroyNotify) g_list_free : NULL); @@ -2558,7 +2558,7 @@ ensure_icon_info (GtkWindow *window) { info = g_new0 (GtkWindowIconInfo, 1); g_object_set_data_full (G_OBJECT (window), - "gtk-window-icon-info", + g_intern_static_string ("gtk-window-icon-info"), info, (GDestroyNotify)free_icon_info); } @@ -2580,7 +2580,7 @@ get_screen_icon_info (GdkScreen *screen) if (!info) { info = g_new0 (ScreenIconInfo, 1); - g_object_set_data (G_OBJECT (screen), "gtk-window-default-icon-pixmap", info); + g_object_set_data (G_OBJECT (screen), g_intern_static_string ("gtk-window-default-icon-pixmap"), info); } if (info->serial != default_icon_serial) @@ -7523,7 +7523,7 @@ gtk_window_get_key_hash (GtkWindow *window) key_hash = _gtk_key_hash_new (gdk_keymap_get_for_display (gdk_screen_get_display (screen)), (GDestroyNotify)g_free); _gtk_window_keys_foreach (window, add_to_key_hash, key_hash); - g_object_set_data (G_OBJECT (window), "gtk-window-key-hash", key_hash); + g_object_set_data (G_OBJECT (window), g_intern_static_string ("gtk-window-key-hash"), key_hash); return key_hash; } |