Use gdk_atom_intern_static_string() where appropriate.

* gtk/*.c:  Use gdk_atom_intern_static_string() where
	appropriate.
This commit is contained in:
Matthias Clasen 2005-09-11 05:48:27 +00:00
parent d715dcaf40
commit af89d145f7
20 changed files with 86 additions and 98 deletions

View File

@ -6,14 +6,9 @@
New function to avoid pointless strdups when creating atoms
from static strings.
* gdk/x11/gdkdisplay-x11.c:
* gdk/x11/gdkdnd-x11.c:
* gdk/x11/gdkevents-x11.c:
* gdk/x11/gdkmain-x11.c:
* gdk/x11/gdkproperty-x11.c:
* gdk/x11/gdkselection-x11.c:
* gdk/x11/gdkwindow-x11.c: Use gdk_atom_intern_static_string()
where appropriate.
* gdk/x11/*.c:
* gtk/*.c: Use gdk_atom_intern_static_string() where
appropriate.
2005-09-09 Matthias Clasen <mclasen@redhat.com>

View File

@ -6,14 +6,9 @@
New function to avoid pointless strdups when creating atoms
from static strings.
* gdk/x11/gdkdisplay-x11.c:
* gdk/x11/gdkdnd-x11.c:
* gdk/x11/gdkevents-x11.c:
* gdk/x11/gdkmain-x11.c:
* gdk/x11/gdkproperty-x11.c:
* gdk/x11/gdkselection-x11.c:
* gdk/x11/gdkwindow-x11.c: Use gdk_atom_intern_static_string()
where appropriate.
* gdk/x11/*.c:
* gtk/*.c: Use gdk_atom_intern_static_string() where
appropriate.
2005-09-09 Matthias Clasen <mclasen@redhat.com>

View File

@ -934,14 +934,14 @@ request_text_received_func (GtkClipboard *clipboard,
* if we asked for compound_text and didn't get it, try string;
* If we asked for anything else and didn't get it, give up.
*/
if (selection_data->target == gdk_atom_intern ("UTF8_STRING", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("UTF8_STRING"))
{
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("COMPOUND_TEXT", FALSE),
gdk_atom_intern_static_string ("COMPOUND_TEXT"),
request_text_received_func, info);
return;
}
else if (selection_data->target == gdk_atom_intern ("COMPOUND_TEXT", FALSE))
else if (selection_data->target == gdk_atom_intern_static_string ("COMPOUND_TEXT"))
{
gtk_clipboard_request_contents (clipboard,
GDK_TARGET_STRING,
@ -986,7 +986,7 @@ gtk_clipboard_request_text (GtkClipboard *clipboard,
info->callback = callback;
info->user_data = user_data;
gtk_clipboard_request_contents (clipboard, gdk_atom_intern ("UTF8_STRING", FALSE),
gtk_clipboard_request_contents (clipboard, gdk_atom_intern_static_string ("UTF8_STRING"),
request_text_received_func,
info);
}
@ -1008,24 +1008,24 @@ request_image_received_func (GtkClipboard *clipboard,
* if we asked for image/gif and didn't get it, try image/bmp;
* If we asked for anything else and didn't get it, give up.
*/
if (selection_data->target == gdk_atom_intern ("image/png", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("image/png"))
{
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("image/jpeg", FALSE),
gdk_atom_intern_static_string ("image/jpeg"),
request_image_received_func, info);
return;
}
else if (selection_data->target == gdk_atom_intern ("image/jpeg", FALSE))
else if (selection_data->target == gdk_atom_intern_static_string ("image/jpeg"))
{
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("image/gif", FALSE),
gdk_atom_intern_static_string ("image/gif"),
request_image_received_func, info);
return;
}
else if (selection_data->target == gdk_atom_intern ("image/gif", FALSE))
else if (selection_data->target == gdk_atom_intern_static_string ("image/gif"))
{
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("image/bmp", FALSE),
gdk_atom_intern_static_string ("image/bmp"),
request_image_received_func, info);
return;
}
@ -1071,7 +1071,7 @@ gtk_clipboard_request_image (GtkClipboard *clipboard,
info->user_data = user_data;
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("image/png", FALSE),
gdk_atom_intern_static_string ("image/png"),
request_image_received_func,
info);
}
@ -1131,7 +1131,7 @@ gtk_clipboard_request_targets (GtkClipboard *clipboard,
info->callback = callback;
info->user_data = user_data;
gtk_clipboard_request_contents (clipboard, gdk_atom_intern ("TARGETS", FALSE),
gtk_clipboard_request_contents (clipboard, gdk_atom_intern_static_string ("TARGETS"),
request_targets_received_func,
info);
}
@ -1348,7 +1348,7 @@ gtk_clipboard_wait_is_text_available (GtkClipboard *clipboard)
GtkSelectionData *data;
gboolean result = FALSE;
data = gtk_clipboard_wait_for_contents (clipboard, gdk_atom_intern ("TARGETS", FALSE));
data = gtk_clipboard_wait_for_contents (clipboard, gdk_atom_intern_static_string ("TARGETS"));
if (data)
{
result = gtk_selection_data_targets_include_text (data);
@ -1383,7 +1383,7 @@ gtk_clipboard_wait_is_image_available (GtkClipboard *clipboard)
gboolean result = FALSE;
data = gtk_clipboard_wait_for_contents (clipboard,
gdk_atom_intern ("TARGETS", FALSE));
gdk_atom_intern_static_string ("TARGETS"));
if (data)
{
result = gtk_selection_data_targets_include_image (data, FALSE);
@ -1441,7 +1441,7 @@ gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
if (targets)
*targets = NULL;
data = gtk_clipboard_wait_for_contents (clipboard, gdk_atom_intern ("TARGETS", FALSE));
data = gtk_clipboard_wait_for_contents (clipboard, gdk_atom_intern_static_string ("TARGETS"));
if (data)
{
@ -1657,7 +1657,7 @@ gtk_clipboard_selection_notify (GtkWidget *widget,
GdkEventSelection *event,
GtkClipboard *clipboard)
{
if (event->selection == gdk_atom_intern ("CLIPBOARD_MANAGER", FALSE) &&
if (event->selection == gdk_atom_intern_static_string ("CLIPBOARD_MANAGER") &&
clipboard->storing_selection)
g_main_loop_quit (clipboard->store_loop);

View File

@ -7520,7 +7520,7 @@ gtk_clist_drag_leave (GtkWidget *widget,
gtk_drag_get_source_widget (context) == widget)
{
GList *list;
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
list = context->targets;
while (list)
@ -7575,7 +7575,7 @@ gtk_clist_drag_motion (GtkWidget *widget,
if (GTK_CLIST_REORDERABLE (clist))
{
GList *list;
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
list = context->targets;
while (list)
@ -7651,7 +7651,7 @@ gtk_clist_drag_drop (GtkWidget *widget,
gtk_drag_get_source_widget (context) == widget)
{
GList *list;
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
list = context->targets;
while (list)
@ -7684,7 +7684,7 @@ gtk_clist_drag_data_received (GtkWidget *widget,
if (GTK_CLIST_REORDERABLE (clist) &&
gtk_drag_get_source_widget (context) == widget &&
selection_data->target ==
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE) &&
gdk_atom_intern_static_string ("gtk-clist-drag-reorder") &&
selection_data->format == 8 &&
selection_data->length == sizeof (GtkCListCellInfo))
{
@ -7720,8 +7720,7 @@ gtk_clist_drag_data_get (GtkWidget *widget,
g_return_if_fail (context != NULL);
g_return_if_fail (selection_data != NULL);
if (selection_data->target ==
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("gtk-clist-drag-reorder"))
{
GtkCListCellInfo *info;

View File

@ -374,7 +374,7 @@ color_sample_drag_handle (GtkWidget *widget,
vals[3] = priv->has_opacity ? colsrc[COLORSEL_OPACITY] * 0xffff : 0xffff;
gtk_selection_data_set (selection_data,
gdk_atom_intern ("application/x-color", FALSE),
gdk_atom_intern_static_string ("application/x-color"),
16, (guchar *)vals, 8);
}
@ -723,7 +723,7 @@ palette_drag_handle (GtkWidget *widget,
vals[3] = 0xffff;
gtk_selection_data_set (selection_data,
gdk_atom_intern ("application/x-color", FALSE),
gdk_atom_intern_static_string ("application/x-color"),
16, (guchar *)vals, 8);
}

View File

@ -5969,7 +5969,7 @@ gtk_ctree_drag_motion (GtkWidget *widget,
if (GTK_CLIST_REORDERABLE (clist))
{
GList *list;
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder");
list = context->targets;
while (list)
@ -6057,7 +6057,7 @@ gtk_ctree_drag_data_received (GtkWidget *widget,
if (GTK_CLIST_REORDERABLE (clist) &&
gtk_drag_get_source_widget (context) == widget &&
selection_data->target ==
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE) &&
gdk_atom_intern_static_string ("gtk-clist-drag-reorder") &&
selection_data->format == 8 &&
selection_data->length == sizeof (GtkCListCellInfo))
{

View File

@ -868,14 +868,13 @@ gtk_drag_finish (GdkDragContext *context,
if (success && del)
{
target = gdk_atom_intern ("DELETE", FALSE);
target = gdk_atom_intern_static_string ("DELETE");
}
else if (context->protocol == GDK_DRAG_PROTO_MOTIF)
{
target = gdk_atom_intern (success ?
target = gdk_atom_intern_static_string (success ?
"XmTRANSFER_SUCCESS" :
"XmTRANSFER_FAILURE",
FALSE);
"XmTRANSFER_FAILURE");
}
if (target != GDK_NONE)
@ -1455,12 +1454,12 @@ gtk_drag_selection_received (GtkWidget *widget,
return;
}
if (selection_data->target == gdk_atom_intern ("DELETE", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("DELETE"))
{
gtk_drag_finish (context, TRUE, FALSE, time);
}
else if ((selection_data->target == gdk_atom_intern ("XmTRANSFER_SUCCESS", FALSE)) ||
(selection_data->target == gdk_atom_intern ("XmTRANSFER_FAILURE", FALSE)))
else if ((selection_data->target == gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS")) ||
(selection_data->target == gdk_atom_intern_static_string ("XmTRANSFER_FAILURE")))
{
/* Do nothing */
}
@ -3256,17 +3255,17 @@ gtk_drag_source_check_selection (GtkDragSourceInfo *info,
{
gtk_selection_add_target (info->ipc_widget,
selection,
gdk_atom_intern ("XmTRANSFER_SUCCESS", FALSE),
gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS"),
TARGET_MOTIF_SUCCESS);
gtk_selection_add_target (info->ipc_widget,
selection,
gdk_atom_intern ("XmTRANSFER_FAILURE", FALSE),
gdk_atom_intern_static_string ("XmTRANSFER_FAILURE"),
TARGET_MOTIF_FAILURE);
}
gtk_selection_add_target (info->ipc_widget,
selection,
gdk_atom_intern ("DELETE", FALSE),
gdk_atom_intern_static_string ("DELETE"),
TARGET_DELETE);
}
@ -3366,8 +3365,8 @@ gtk_drag_drop (GtkDragSourceInfo *info,
/* GTK+ traditionally has used application/x-rootwin-drop, but the
* XDND spec specifies x-rootwindow-drop.
*/
GdkAtom target1 = gdk_atom_intern ("application/x-rootwindow-drop", FALSE);
GdkAtom target2 = gdk_atom_intern ("application/x-rootwin-drop", FALSE);
GdkAtom target1 = gdk_atom_intern_static_string ("application/x-rootwindow-drop");
GdkAtom target2 = gdk_atom_intern_static_string ("application/x-rootwin-drop");
tmp_list = info->target_list->list;
while (tmp_list)
@ -3495,7 +3494,7 @@ gtk_drag_selection_get (GtkWidget *widget,
guint target_info;
if (!null_atom)
null_atom = gdk_atom_intern ("NULL", FALSE);
null_atom = gdk_atom_intern_static_string ("NULL");
switch (sel_info)
{

View File

@ -4672,7 +4672,7 @@ gtk_entry_do_popup (GtkEntry *entry,
}
gtk_clipboard_request_contents (gtk_widget_get_clipboard (GTK_WIDGET (entry), GDK_SELECTION_CLIPBOARD),
gdk_atom_intern ("TARGETS", FALSE),
gdk_atom_intern_static_string ("TARGETS"),
popup_targets_received,
info);
}

View File

@ -2969,9 +2969,9 @@ shortcuts_drag_data_received_cb (GtkWidget *widget,
g_assert (position >= bookmarks_index);
position -= bookmarks_index;
if (selection_data->target == gdk_atom_intern ("text/uri-list", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("text/uri-list"))
shortcuts_drop_uris (impl, selection_data->data, position);
else if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
else if (selection_data->target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
shortcuts_reorder (impl, position);
g_signal_stop_emission_by_name (widget, "drag-data-received");

View File

@ -660,7 +660,7 @@ drag_source_drag_data_get (GtkTreeDragSource *drag_source,
uris = g_strconcat (uri, "\r\n", NULL);
gtk_selection_data_set (selection_data,
gdk_atom_intern ("text/uri-list", FALSE),
gdk_atom_intern_static_string ("text/uri-list"),
8,
uris,
strlen (uris) + 1);

View File

@ -1150,7 +1150,7 @@ ensure_valid_themes (GtkIconTheme *icon_theme)
int i;
if (!atom_iconthemes)
atom_iconthemes = gdk_atom_intern ("_GTK_LOAD_ICONTHEMES", FALSE);
atom_iconthemes = gdk_atom_intern_static_string ("_GTK_LOAD_ICONTHEMES");
for (i = 0; i < 5; i++)
event->client.data.l[i] = 0;

View File

@ -6113,7 +6113,7 @@ gtk_icon_view_drag_data_get (GtkWidget *widget,
goto done;
/* If drag_data_get does nothing, try providing row data. */
if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
gtk_tree_set_row_drag_data (selection_data,
model,
source_row);
@ -6209,7 +6209,7 @@ gtk_icon_view_drag_motion (GtkWidget *widget,
g_timeout_add (50, drag_scroll_timeout, icon_view);
}
if (target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
{
/* Request data so we can use the source row when
* determining whether to accept the drop

View File

@ -681,14 +681,14 @@ gtk_old_editable_selection_received (GtkWidget *widget,
* for text and didn't get it, try string. If we asked for
* anything else and didn't get it, give up.
*/
if (selection_data->target == gdk_atom_intern ("UTF8_STRING", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("UTF8_STRING"))
{
gtk_selection_convert (widget, GDK_SELECTION_PRIMARY,
gdk_atom_intern ("TEXT", FALSE),
gdk_atom_intern_static_string ("TEXT"),
time);
return;
}
else if (selection_data->target == gdk_atom_intern ("TEXT", FALSE))
else if (selection_data->target == gdk_atom_intern_static_string ("TEXT"))
{
gtk_selection_convert (widget, GDK_SELECTION_PRIMARY,
GDK_TARGET_STRING,

View File

@ -295,17 +295,17 @@ init_atoms (void)
if (!utf8_atom)
{
utf8_atom = gdk_atom_intern ("UTF8_STRING", FALSE);
text_atom = gdk_atom_intern ("TEXT", FALSE);
ctext_atom = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
text_plain_atom = gdk_atom_intern ("text/plain", FALSE);
text_plain_utf8_atom = gdk_atom_intern ("text/plain;charset=utf-8", FALSE);
utf8_atom = gdk_atom_intern_static_string ("UTF8_STRING");
text_atom = gdk_atom_intern_static_string ("TEXT");
ctext_atom = gdk_atom_intern_static_string ("COMPOUND_TEXT");
text_plain_atom = gdk_atom_intern_static_string ("text/plain");
text_plain_utf8_atom = gdk_atom_intern_static_string ("text/plain;charset=utf-8");
g_get_charset (&charset);
tmp = g_strdup_printf ("text/plain;charset=%s", charset);
text_plain_locale_atom = gdk_atom_intern (tmp, FALSE);
g_free (tmp);
text_uri_list_atom = gdk_atom_intern ("text/uri-list", FALSE);
text_uri_list_atom = gdk_atom_intern_static_string ("text/uri-list");
}
}
@ -1793,10 +1793,10 @@ gtk_selection_data_targets_include_uri (GtkSelectionData *selection_data)
static void
gtk_selection_init (void)
{
gtk_selection_atoms[INCR] = gdk_atom_intern ("INCR", FALSE);
gtk_selection_atoms[MULTIPLE] = gdk_atom_intern ("MULTIPLE", FALSE);
gtk_selection_atoms[TIMESTAMP] = gdk_atom_intern ("TIMESTAMP", FALSE);
gtk_selection_atoms[TARGETS] = gdk_atom_intern ("TARGETS", FALSE);
gtk_selection_atoms[INCR] = gdk_atom_intern_static_string ("INCR");
gtk_selection_atoms[MULTIPLE] = gdk_atom_intern_static_string ("MULTIPLE");
gtk_selection_atoms[TIMESTAMP] = gdk_atom_intern_static_string ("TIMESTAMP");
gtk_selection_atoms[TARGETS] = gdk_atom_intern_static_string ("TARGETS");
initialize = FALSE;
}
@ -1941,7 +1941,7 @@ _gtk_selection_request (GtkWidget *widget,
*/
#ifdef GDK_WINDOWING_X11
if (type != GDK_SELECTION_TYPE_ATOM &&
type != gdk_atom_intern ("ATOM_PAIR", FALSE))
type != gdk_atom_intern_static_string ("ATOM_PAIR"))
{
info->num_conversions = length / (2*sizeof (glong));
info->conversions = g_new (GtkIncrConversion, info->num_conversions);
@ -2073,7 +2073,7 @@ _gtk_selection_request (GtkWidget *widget,
}
gdk_property_change (info->requestor, event->property,
gdk_atom_intern ("ATOM_PAIR", FALSE), 32,
gdk_atom_intern_static_string ("ATOM_PAIR"), 32,
GDK_PROP_MODE_REPLACE,
(guchar *)mult_atoms, 2*info->num_conversions);
g_free (mult_atoms);
@ -2407,7 +2407,7 @@ _gtk_selection_property_notify (GtkWidget *widget,
#if defined(GDK_WINDOWING_WIN32) || defined(GDK_WINDOWING_X11)
if ((event->state != GDK_PROPERTY_NEW_VALUE) || /* property was deleted */
(event->atom != gdk_atom_intern ("GDK_SELECTION", FALSE))) /* not the right property */
(event->atom != gdk_atom_intern_static_string ("GDK_SELECTION"))) /* not the right property */
#endif
return FALSE;

View File

@ -1749,7 +1749,7 @@ gtk_text_button_press (GtkWidget *widget,
}
gtk_selection_convert (widget, GDK_SELECTION_PRIMARY,
gdk_atom_intern ("UTF8_STRING", FALSE),
gdk_atom_intern_static_string ("UTF8_STRING"),
event->time);
}
else

View File

@ -2782,13 +2782,13 @@ clipboard_get_selection_cb (GtkClipboard *clipboard,
if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
{
if (selection_data->target ==
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
{
/* Provide the address of the buffer; this will only be
* used within-process
*/
gtk_selection_data_set (selection_data,
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE),
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"),
8, /* bytes */
(void*)&buffer,
sizeof (buffer));
@ -2830,13 +2830,13 @@ clipboard_get_contents_cb (GtkClipboard *clipboard,
g_assert (contents); /* This should never be called unless we own the clipboard */
if (selection_data->target ==
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
{
/* Provide the address of the clipboard buffer; this will only
* be used within-process. OK to supply a NULL value for contents.
*/
gtk_selection_data_set (selection_data,
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE),
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"),
8, /* bytes */
(void*)&contents,
sizeof (contents));
@ -2987,7 +2987,7 @@ selection_data_get_buffer (GtkSelectionData *selection_data,
if (gdk_window_get_window_type (owner) == GDK_WINDOW_FOREIGN)
return NULL;
if (selection_data->type != gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
if (selection_data->type != gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
return NULL;
if (selection_data->length != sizeof (src_buffer))
@ -3310,7 +3310,7 @@ gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer,
data->replace_selection = TRUE;
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE),
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"),
clipboard_clipboard_buffer_received, data);
}

View File

@ -6088,12 +6088,12 @@ gtk_text_view_drag_data_get (GtkWidget *widget,
text_view = GTK_TEXT_VIEW (widget);
if (selection_data->target == gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
{
GtkTextBuffer *buffer = gtk_text_view_get_buffer (text_view);
gtk_selection_data_set (selection_data,
gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE),
gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"),
8, /* bytes */
(void*)&buffer,
sizeof (buffer));
@ -6340,7 +6340,7 @@ gtk_text_view_drag_data_received (GtkWidget *widget,
gtk_text_buffer_begin_user_action (buffer);
if (selection_data->target == gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
{
GtkTextBuffer *src_buffer = NULL;
GtkTextIter start, end;
@ -7218,7 +7218,7 @@ gtk_text_view_do_popup (GtkTextView *text_view,
gtk_clipboard_request_contents (gtk_widget_get_clipboard (GTK_WIDGET (text_view),
GDK_SELECTION_CLIPBOARD),
gdk_atom_intern ("TARGETS", FALSE),
gdk_atom_intern_static_string ("TARGETS"),
popup_targets_received,
info);
}

View File

@ -249,7 +249,7 @@ gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
g_return_val_if_fail (GTK_IS_TREE_MODEL (tree_model), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
if (selection_data->target != gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (selection_data->target != gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
return FALSE;
path_str = gtk_tree_path_to_string (path);
@ -269,7 +269,7 @@ gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
trd->model = tree_model;
gtk_selection_data_set (selection_data,
gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE),
gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"),
8, /* bytes */
(void*)trd,
struct_size);
@ -313,7 +313,7 @@ gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
if (path)
*path = NULL;
if (selection_data->target != gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (selection_data->target != gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
return FALSE;
if (selection_data->length < 0)

View File

@ -6156,7 +6156,7 @@ gtk_tree_view_drag_data_get (GtkWidget *widget,
goto done;
/* If drag_data_get does nothing, try providing row data. */
if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (selection_data->target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
{
gtk_tree_set_row_drag_data (selection_data,
model,
@ -6266,7 +6266,7 @@ gtk_tree_view_drag_motion (GtkWidget *widget,
g_timeout_add (150, scroll_row_timeout, tree_view);
}
if (target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
{
/* Request data so we can use the source row when
* determining whether to accept the drop

View File

@ -1827,7 +1827,7 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent,
{
if (GTK_WIDGET_REALIZED (window))
gdk_property_delete (window->window,
gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE));
gdk_atom_intern_static_string ("WM_TRANSIENT_FOR"));
}
static void
@ -4788,8 +4788,8 @@ gtk_window_client_event (GtkWidget *widget,
{
if (!atom_rcfiles)
{
atom_rcfiles = gdk_atom_intern ("_GTK_READ_RCFILES", FALSE);
atom_iconthemes = gdk_atom_intern ("_GTK_LOAD_ICONTHEMES", FALSE);
atom_rcfiles = gdk_atom_intern_static_string ("_GTK_READ_RCFILES");
atom_iconthemes = gdk_atom_intern_static_string ("_GTK_LOAD_ICONTHEMES");
}
if (event->message_type == atom_rcfiles)