Commit f4bbe8f0 authored by Matthias Clasen's avatar Matthias Clasen

Also intern static strings passed to g_object_set_data()

parent c09cc893
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
......
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
......
......@@ -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
......
......@@ -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,
......
......@@ -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));
......
......@@ -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));
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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,
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
}
/**
......
......@@ -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);
......
......@@ -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);
......
......@@ -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",
......
......@@ -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,
......
......@@ -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)
......
......@@ -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);
......
......@@ -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",
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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));
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);