gdk: Replace GDK_NONE with NULL

This commit is contained in:
Benjamin Otte 2017-11-15 18:13:31 +01:00
parent cb941956d3
commit 4c4e914806
44 changed files with 181 additions and 190 deletions

View File

@ -421,7 +421,6 @@ gdk_selection_send_notify_for_display
GdkAtom GdkAtom
GDK_ATOM_TO_POINTER GDK_ATOM_TO_POINTER
GDK_POINTER_TO_ATOM GDK_POINTER_TO_ATOM
GDK_NONE
gdk_text_property_to_utf8_list_for_display gdk_text_property_to_utf8_list_for_display
gdk_utf8_to_string_target gdk_utf8_to_string_target
gdk_atom_intern gdk_atom_intern

View File

@ -91,8 +91,8 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
device = GDK_DEVICE (device_core); device = GDK_DEVICE (device_core);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1);
} }
static gboolean static gboolean

View File

@ -184,9 +184,9 @@ _gdk_broadway_window_register_dnd (GdkWindow *window)
static GdkAtom static GdkAtom
gdk_broadway_drag_context_get_selection (GdkDragContext *context) gdk_broadway_drag_context_get_selection (GdkDragContext *context)
{ {
g_return_val_if_fail (context != NULL, GDK_NONE); g_return_val_if_fail (context != NULL, NULL);
return GDK_NONE; return NULL;
} }
static gboolean static gboolean

View File

@ -147,7 +147,7 @@ _gdk_broadway_display_get_selection_property (GdkDisplay *display,
gint *ret_format) gint *ret_format)
{ {
if (ret_type) if (ret_type)
*ret_type = GDK_NONE; *ret_type = NULL;
if (ret_format) if (ret_format)
*ret_format = 0; *ret_format = 0;
if (data) if (data)

View File

@ -570,12 +570,12 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
* *
* Returns the selection atom for the current source window. * Returns the selection atom for the current source window.
* *
* Returns: (transfer none): the selection atom, or %GDK_NONE * Returns: (transfer none): the selection atom, or %NULL
*/ */
GdkAtom GdkAtom
gdk_drag_get_selection (GdkDragContext *context) gdk_drag_get_selection (GdkDragContext *context)
{ {
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_selection (context); return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_selection (context);
} }

View File

@ -60,7 +60,7 @@
* gdk_atom_intern: * gdk_atom_intern:
* @atom_name: a string. * @atom_name: a string.
* @only_if_exists: if %TRUE, GDK is allowed to not create a new atom, but * @only_if_exists: if %TRUE, GDK is allowed to not create a new atom, but
* just return %GDK_NONE if the requested atom doesnt already * just return %NULL if the requested atom doesnt already
* exists. Currently, the flag is ignored, since checking the * exists. Currently, the flag is ignored, since checking the
* existance of an atom is as expensive as creating it. * existance of an atom is as expensive as creating it.
* *
@ -72,7 +72,7 @@ GdkAtom
gdk_atom_intern (const gchar *atom_name, gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists) gboolean only_if_exists)
{ {
g_return_val_if_fail (atom_name != NULL, GDK_NONE); g_return_val_if_fail (atom_name != NULL, NULL);
return g_intern_string (atom_name); return g_intern_string (atom_name);
} }
@ -99,7 +99,7 @@ gdk_atom_intern (const gchar *atom_name,
GdkAtom GdkAtom
gdk_atom_intern_static_string (const gchar *atom_name) gdk_atom_intern_static_string (const gchar *atom_name)
{ {
g_return_val_if_fail (atom_name != NULL, GDK_NONE); g_return_val_if_fail (atom_name != NULL, NULL);
return g_intern_static_string (atom_name); return g_intern_static_string (atom_name);
} }

View File

@ -115,7 +115,7 @@ gdk_selection_owner_get (GdkAtom selection)
* @selection: selection that was requested. * @selection: selection that was requested.
* @target: target that was selected. * @target: target that was selected.
* @property: property in which the selection owner stored the * @property: property in which the selection owner stored the
* data, or %GDK_NONE to indicate that the request * data, or %NULL to indicate that the request
* was rejected. * was rejected.
* @time_: timestamp. * @time_: timestamp.
* *
@ -160,7 +160,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
gboolean send_event) gboolean send_event)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (selection != NULL, FALSE);
return GDK_DISPLAY_GET_CLASS (display) return GDK_DISPLAY_GET_CLASS (display)
->set_selection_owner (display, owner, selection, time, send_event); ->set_selection_owner (display, owner, selection, time, send_event);
@ -189,7 +189,7 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
GdkAtom selection) GdkAtom selection)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (selection != GDK_NONE, NULL); g_return_val_if_fail (selection != NULL, NULL);
return GDK_DISPLAY_GET_CLASS (display)->get_selection_owner (display, selection); return GDK_DISPLAY_GET_CLASS (display)->get_selection_owner (display, selection);
} }
@ -201,7 +201,7 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
* @selection: selection that was requested * @selection: selection that was requested
* @target: target that was selected * @target: target that was selected
* @property: property in which the selection owner stored the data, * @property: property in which the selection owner stored the data,
* or %GDK_NONE to indicate that the request was rejected * or %NULL to indicate that the request was rejected
* @time_: timestamp * @time_: timestamp
* *
* Send a response to SelectionRequest event. * Send a response to SelectionRequest event.
@ -266,7 +266,7 @@ gdk_selection_convert (GdkWindow *requestor,
{ {
GdkDisplay *display; GdkDisplay *display;
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
display = gdk_window_get_display (requestor); display = gdk_window_get_display (requestor);

View File

@ -118,14 +118,6 @@ typedef const char *GdkAtom;
*/ */
#define GDK_POINTER_TO_ATOM(ptr) ((GdkAtom)(ptr)) #define GDK_POINTER_TO_ATOM(ptr) ((GdkAtom)(ptr))
/**
* GDK_NONE:
*
* A null value for #GdkAtom, used in a similar way as
* `None` in the Xlib API.
*/
#define GDK_NONE NULL
/* Forward declarations of commonly used types */ /* Forward declarations of commonly used types */
typedef struct _GdkRGBA GdkRGBA; typedef struct _GdkRGBA GdkRGBA;
typedef struct _GdkCursor GdkCursor; typedef struct _GdkCursor GdkCursor;

View File

@ -7174,7 +7174,7 @@ gdk_drag_begin_from_point (GdkWindow *window,
* gdk_property_get: * gdk_property_get:
* @window: a #GdkWindow * @window: a #GdkWindow
* @property: the property to retrieve * @property: the property to retrieve
* @type: the desired property type, or %GDK_NONE, if any type of data * @type: the desired property type, or %NULL, if any type of data
* is acceptable. If this does not match the actual * is acceptable. If this does not match the actual
* type, then @actual_format and @actual_length will * type, then @actual_format and @actual_length will
* be filled in, a warning will be printed to stderr * be filled in, a warning will be printed to stderr
@ -7204,7 +7204,7 @@ gdk_drag_begin_from_point (GdkWindow *window,
* *
* Retrieves a portion of the contents of a property. If the * Retrieves a portion of the contents of a property. If the
* property does not exist, then the function returns %FALSE, * property does not exist, then the function returns %FALSE,
* and %GDK_NONE will be stored in @actual_property_type. * and %NULL will be stored in @actual_property_type.
* *
* The XGetWindowProperty() function that gdk_property_get() * The XGetWindowProperty() function that gdk_property_get()
* uses has a very confusing and complicated set of semantics. * uses has a very confusing and complicated set of semantics.

View File

@ -547,7 +547,7 @@ gdk_mir_display_get_selection_property (GdkDisplay *display,
gdk_property_get (requestor, gdk_property_get (requestor,
gdk_atom_intern_static_string ("GDK_SELECTION"), gdk_atom_intern_static_string ("GDK_SELECTION"),
GDK_NONE, NULL,
0, 0,
G_MAXULONG, G_MAXULONG,
FALSE, FALSE,
@ -639,7 +639,7 @@ get_best_format_index (const gchar * const *formats,
if (!out_size) if (!out_size)
out_size = &best_size; out_size = &best_size;
*out_type = GDK_NONE; *out_type = NULL;
*out_size = 0; *out_size = 0;
for (i = 0; i < n_formats; i++) for (i = 0; i < n_formats; i++)

View File

@ -1723,7 +1723,7 @@ gdk_mir_window_impl_get_property (GdkWindow *window,
if (!actual_length) if (!actual_length)
actual_length = &dummy_actual_length; actual_length = &dummy_actual_length;
*actual_type = GDK_NONE; *actual_type = NULL;
*actual_format = 0; *actual_format = 0;
*actual_length = 0; *actual_length = 0;
@ -1743,7 +1743,7 @@ gdk_mir_window_impl_get_property (GdkWindow *window,
if (*actual_type == GDK_SELECTION_TYPE_ATOM || *actual_type == gdk_atom_intern_static_string ("ATOM_PAIR")) if (*actual_type == GDK_SELECTION_TYPE_ATOM || *actual_type == gdk_atom_intern_static_string ("ATOM_PAIR"))
*actual_format = 32; *actual_format = 32;
if (type != GDK_NONE && type != mir_property->type) if (type != NULL && type != mir_property->type)
return FALSE; return FALSE;
offset *= 4; offset *= 4;
@ -1851,7 +1851,7 @@ create_paste (GdkWindow *window,
for (i = 0; i < n_requested_targets; i++) for (i = 0; i < n_requested_targets; i++)
{ {
if (requested_targets[i] == GDK_NONE) if (requested_targets[i] == NULL)
continue; continue;
mir_property = g_hash_table_lookup (impl->properties, requested_targets[i]); mir_property = g_hash_table_lookup (impl->properties, requested_targets[i]);

View File

@ -106,8 +106,8 @@ gdk_quartz_device_core_init (GdkQuartzDeviceCore *quartz_device_core)
device = GDK_DEVICE (quartz_device_core); device = GDK_DEVICE (quartz_device_core);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1);
} }
static gboolean static gboolean

View File

@ -130,7 +130,7 @@ static GdkAtom
gdk_quartz_drag_context_get_selection (GdkDragContext *context) gdk_quartz_drag_context_get_selection (GdkDragContext *context)
{ {
/* FIXME: Implement */ /* FIXME: Implement */
return GDK_NONE; return NULL;
} }
static gboolean static gboolean

View File

@ -133,7 +133,7 @@ intern_atom_internal (const gchar *atom_name, gboolean allocate)
{ {
gpointer result; gpointer result;
gchar *name; gchar *name;
g_return_val_if_fail (atom_name != NULL, GDK_NONE); g_return_val_if_fail (atom_name != NULL, NULL);
ensure_atom_tables (); ensure_atom_tables ();

View File

@ -876,8 +876,8 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
device = GDK_DEVICE (device_core); device = GDK_DEVICE (device_core);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1);
} }
static gint static gint
@ -1892,11 +1892,11 @@ keyboard_handle_enter (void *data,
_gdk_wayland_display_deliver_event (seat->display, event); _gdk_wayland_display_deliver_event (seat->display, event);
if (seat->pending_selection != GDK_NONE) if (seat->pending_selection != NULL)
{ {
emit_selection_owner_change (seat->keyboard_focus, emit_selection_owner_change (seat->keyboard_focus,
seat->pending_selection); seat->pending_selection);
seat->pending_selection = GDK_NONE; seat->pending_selection = NULL;
} }
} }
@ -3485,42 +3485,42 @@ gdk_wayland_device_tablet_clone_tool_axes (GdkWaylandTabletData *tablet,
g_object_freeze_notify (G_OBJECT (tablet->current_device)); g_object_freeze_notify (G_OBJECT (tablet->current_device));
_gdk_device_reset_axes (tablet->current_device); _gdk_device_reset_axes (tablet->current_device);
_gdk_device_add_axis (tablet->current_device, GDK_NONE, GDK_AXIS_X, 0, 0, 0); _gdk_device_add_axis (tablet->current_device, NULL, GDK_AXIS_X, 0, 0, 0);
_gdk_device_add_axis (tablet->current_device, GDK_NONE, GDK_AXIS_Y, 0, 0, 0); _gdk_device_add_axis (tablet->current_device, NULL, GDK_AXIS_Y, 0, 0, 0);
if (tool->tool_axes & (GDK_AXIS_FLAG_XTILT | GDK_AXIS_FLAG_YTILT)) if (tool->tool_axes & (GDK_AXIS_FLAG_XTILT | GDK_AXIS_FLAG_YTILT))
{ {
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_XTILT, -90, 90, 0); GDK_AXIS_XTILT, -90, 90, 0);
tablet->axis_indices[GDK_AXIS_XTILT] = axis_pos; tablet->axis_indices[GDK_AXIS_XTILT] = axis_pos;
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_YTILT, -90, 90, 0); GDK_AXIS_YTILT, -90, 90, 0);
tablet->axis_indices[GDK_AXIS_YTILT] = axis_pos; tablet->axis_indices[GDK_AXIS_YTILT] = axis_pos;
} }
if (tool->tool_axes & GDK_AXIS_FLAG_DISTANCE) if (tool->tool_axes & GDK_AXIS_FLAG_DISTANCE)
{ {
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_DISTANCE, 0, 65535, 0); GDK_AXIS_DISTANCE, 0, 65535, 0);
tablet->axis_indices[GDK_AXIS_DISTANCE] = axis_pos; tablet->axis_indices[GDK_AXIS_DISTANCE] = axis_pos;
} }
if (tool->tool_axes & GDK_AXIS_FLAG_PRESSURE) if (tool->tool_axes & GDK_AXIS_FLAG_PRESSURE)
{ {
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_PRESSURE, 0, 65535, 0); GDK_AXIS_PRESSURE, 0, 65535, 0);
tablet->axis_indices[GDK_AXIS_PRESSURE] = axis_pos; tablet->axis_indices[GDK_AXIS_PRESSURE] = axis_pos;
} }
if (tool->tool_axes & GDK_AXIS_FLAG_ROTATION) if (tool->tool_axes & GDK_AXIS_FLAG_ROTATION)
{ {
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_ROTATION, 0, 360, 0); GDK_AXIS_ROTATION, 0, 360, 0);
tablet->axis_indices[GDK_AXIS_ROTATION] = axis_pos; tablet->axis_indices[GDK_AXIS_ROTATION] = axis_pos;
} }
if (tool->tool_axes & GDK_AXIS_FLAG_SLIDER) if (tool->tool_axes & GDK_AXIS_FLAG_SLIDER)
{ {
axis_pos = _gdk_device_add_axis (tablet->current_device, GDK_NONE, axis_pos = _gdk_device_add_axis (tablet->current_device, NULL,
GDK_AXIS_SLIDER, -65535, 65535, 0); GDK_AXIS_SLIDER, -65535, 65535, 0);
tablet->axis_indices[GDK_AXIS_SLIDER] = axis_pos; tablet->axis_indices[GDK_AXIS_SLIDER] = axis_pos;
} }
@ -4944,7 +4944,7 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
seat->foreign_dnd_window = create_foreign_dnd_window (display); seat->foreign_dnd_window = create_foreign_dnd_window (display);
seat->wl_seat = wl_seat; seat->wl_seat = wl_seat;
seat->pending_selection = GDK_NONE; seat->pending_selection = NULL;
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat); wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
wl_seat_set_user_data (seat->wl_seat, seat); wl_seat_set_user_data (seat->wl_seat, seat);

View File

@ -795,7 +795,7 @@ gdk_wayland_selection_source_handles_target (GdkWaylandSelection *wayland_select
GdkAtom atom; GdkAtom atom;
guint i; guint i;
if (target == GDK_NONE) if (target == NULL)
return FALSE; return FALSE;
for (i = 0; i < wayland_selection->source_targets->len; i++) for (i = 0; i < wayland_selection->source_targets->len; i++)
@ -1270,7 +1270,7 @@ emit_empty_selection_notify (GdkWindow *requestor,
event->selection.send_event = FALSE; event->selection.send_event = FALSE;
event->selection.selection = selection; event->selection.selection = selection;
event->selection.target = target; event->selection.target = target;
event->selection.property = GDK_NONE; event->selection.property = NULL;
event->selection.time = GDK_CURRENT_TIME; event->selection.time = GDK_CURRENT_TIME;
event->selection.requestor = g_object_ref (requestor); event->selection.requestor = g_object_ref (requestor);
@ -1537,7 +1537,7 @@ gdk_wayland_display_clear_selection_targets (GdkDisplay *display,
{ {
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display); GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
wayland_selection->requested_target = GDK_NONE; wayland_selection->requested_target = NULL;
g_array_set_size (wayland_selection->source_targets, 0); g_array_set_size (wayland_selection->source_targets, 0);
gdk_wayland_selection_unset_data_source (display, selection); gdk_wayland_selection_unset_data_source (display, selection);
} }

View File

@ -309,6 +309,6 @@ gdk_device_win32_init (GdkDeviceWin32 *device_win32)
device = GDK_DEVICE (device_win32); device = GDK_DEVICE (device_win32);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1);
} }

View File

@ -583,7 +583,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
if (device->pktdata & PK_X) if (device->pktdata & PK_X)
{ {
_gdk_device_add_axis (GDK_DEVICE (device), _gdk_device_add_axis (GDK_DEVICE (device),
GDK_NONE, NULL,
GDK_AXIS_X, GDK_AXIS_X,
axis_x.axMin, axis_x.axMin,
axis_x.axMax, axis_x.axMax,
@ -594,7 +594,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
if (device->pktdata & PK_Y) if (device->pktdata & PK_Y)
{ {
_gdk_device_add_axis (GDK_DEVICE (device), _gdk_device_add_axis (GDK_DEVICE (device),
GDK_NONE, NULL,
GDK_AXIS_Y, GDK_AXIS_Y,
axis_y.axMin, axis_y.axMin,
axis_y.axMax, axis_y.axMax,
@ -606,7 +606,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
if (device->pktdata & PK_NORMAL_PRESSURE) if (device->pktdata & PK_NORMAL_PRESSURE)
{ {
_gdk_device_add_axis (GDK_DEVICE (device), _gdk_device_add_axis (GDK_DEVICE (device),
GDK_NONE, NULL,
GDK_AXIS_PRESSURE, GDK_AXIS_PRESSURE,
axis_npressure.axMin, axis_npressure.axMin,
axis_npressure.axMax, axis_npressure.axMax,
@ -623,14 +623,14 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
* we convert to x and y tilt in the -1000..1000 range * we convert to x and y tilt in the -1000..1000 range
*/ */
_gdk_device_add_axis (GDK_DEVICE (device), _gdk_device_add_axis (GDK_DEVICE (device),
GDK_NONE, NULL,
GDK_AXIS_XTILT, GDK_AXIS_XTILT,
-1000, -1000,
1000, 1000,
1000); 1000);
_gdk_device_add_axis (GDK_DEVICE (device), _gdk_device_add_axis (GDK_DEVICE (device),
GDK_NONE, NULL,
GDK_AXIS_YTILT, GDK_AXIS_YTILT,
-1000, -1000,
1000, 1000,

View File

@ -350,7 +350,7 @@ cf_to_atom (CLIPFORMAT cf)
if (cf == _cf_html_format || cf == _cf_text_html) if (cf == _cf_html_format || cf == _cf_text_html)
return _text_html; return _text_html;
return GDK_NONE; return NULL;
} }
#endif #endif
@ -2445,7 +2445,7 @@ gdk_win32_drag_context_get_selection (GdkDragContext *context)
case GDK_DRAG_PROTO_OLE2: case GDK_DRAG_PROTO_OLE2:
return _gdk_ole2_dnd; return _gdk_ole2_dnd;
default: default:
return GDK_NONE; return NULL;
} }
} }

View File

@ -92,7 +92,7 @@ _gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
ATOM win32_atom; ATOM win32_atom;
gchar name[256]; gchar name[256];
if (GDK_NONE == atom) return g_strdup ("<none>"); if (NULL == atom) return g_strdup ("<none>");
else if (GDK_SELECTION_PRIMARY == atom) return g_strdup ("PRIMARY"); else if (GDK_SELECTION_PRIMARY == atom) return g_strdup ("PRIMARY");
else if (GDK_SELECTION_SECONDARY == atom) return g_strdup ("SECONDARY"); else if (GDK_SELECTION_SECONDARY == atom) return g_strdup ("SECONDARY");
else if (GDK_SELECTION_CLIPBOARD == atom) return g_strdup ("CLIPBOARD"); else if (GDK_SELECTION_CLIPBOARD == atom) return g_strdup ("CLIPBOARD");

View File

@ -261,7 +261,7 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display,
HWND hwnd; HWND hwnd;
GdkEvent tmp_event; GdkEvent tmp_event;
g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (selection != NULL, FALSE);
GDK_NOTE (DND, { GDK_NOTE (DND, {
gchar *sel_name = gdk_atom_name (selection); gchar *sel_name = gdk_atom_name (selection);
@ -336,7 +336,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display,
{ {
GdkWindow *window; GdkWindow *window;
g_return_val_if_fail (selection != GDK_NONE, NULL); g_return_val_if_fail (selection != NULL, NULL);
if (selection == GDK_SELECTION_CLIPBOARD) if (selection == GDK_SELECTION_CLIPBOARD)
{ {
@ -394,7 +394,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
HGLOBAL hdata; HGLOBAL hdata;
GdkAtom property = _gdk_selection; GdkAtom property = _gdk_selection;
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
g_return_if_fail (requestor != NULL); g_return_if_fail (requestor != NULL);
if (GDK_WINDOW_DESTROYED (requestor)) if (GDK_WINDOW_DESTROYED (requestor))
@ -515,7 +515,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
32, (guchar *) targets, 32, (guchar *) targets,
ntargets * sizeof (GdkAtom)); ntargets * sizeof (GdkAtom));
else else
property = GDK_NONE; property = NULL;
} }
else if (selection == GDK_SELECTION_CLIPBOARD && target == _utf8_string) else if (selection == GDK_SELECTION_CLIPBOARD && target == _utf8_string)
{ {
@ -562,7 +562,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
} }
} }
else else
property = GDK_NONE; property = NULL;
API_CALL (CloseClipboard, ()); API_CALL (CloseClipboard, ());
} }
@ -802,11 +802,11 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
} }
} }
else else
property = GDK_NONE; property = NULL;
/* Generate a selection notify message so that we actually fetch the /* Generate a selection notify message so that we actually fetch the
* data (if property == _gdk_selection) or indicating failure (if * data (if property == _gdk_selection) or indicating failure (if
* property == GDK_NONE). * property == NULL).
*/ */
generate_selection_notify (requestor, selection, target, property, time); generate_selection_notify (requestor, selection, target, property, time);
} }
@ -1074,7 +1074,7 @@ gdk_string_to_compound_text_for_display (GdkDisplay *display,
/* Always fail on Win32. No COMPOUND_TEXT support. */ /* Always fail on Win32. No COMPOUND_TEXT support. */
if (encoding) if (encoding)
*encoding = GDK_NONE; *encoding = NULL;
if (format) if (format)
*format = 0; *format = 0;
@ -1110,7 +1110,7 @@ gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
/* Always fail on Win32. No COMPOUND_TEXT support. */ /* Always fail on Win32. No COMPOUND_TEXT support. */
if (encoding) if (encoding)
*encoding = GDK_NONE; *encoding = NULL;
if (format) if (format)
*format = 0; *format = 0;

View File

@ -108,8 +108,8 @@ gdk_x11_device_core_init (GdkX11DeviceCore *device_core)
device = GDK_DEVICE (device_core); device = GDK_DEVICE (device_core);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1);
} }
static gboolean static gboolean

View File

@ -192,7 +192,7 @@ translate_valuator_class (GdkDisplay *display,
if (valuator_label != None) if (valuator_label != None)
label = gdk_x11_xatom_to_atom_for_display (display, valuator_label); label = gdk_x11_xatom_to_atom_for_display (display, valuator_label);
else else
label = GDK_NONE; label = NULL;
_gdk_device_add_axis (device, label, use, min, max, resolution); _gdk_device_add_axis (device, label, use, min, max, resolution);
GDK_NOTE (INPUT, g_message ("\n\taxis: %s %s", gdk_atom_name (label), use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)")); GDK_NOTE (INPUT, g_message ("\n\taxis: %s %s", gdk_atom_name (label), use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)"));

View File

@ -2521,7 +2521,7 @@ gdk_x11_drag_context_get_selection (GdkDragContext *context)
if (context->protocol == GDK_DRAG_PROTO_XDND) if (context->protocol == GDK_DRAG_PROTO_XDND)
return gdk_atom_intern_static_string ("XdndSelection"); return gdk_atom_intern_static_string ("XdndSelection");
else else
return GDK_NONE; return NULL;
} }
static gboolean static gboolean

View File

@ -74,10 +74,10 @@ lookup_cached_xatom (GdkDisplay *display,
/** /**
* gdk_x11_atom_to_xatom_for_display: * gdk_x11_atom_to_xatom_for_display:
* @display: (type GdkX11Display): A #GdkDisplay * @display: (type GdkX11Display): A #GdkDisplay
* @atom: A #GdkAtom, or %GDK_NONE * @atom: A #GdkAtom, or %NULL
* *
* Converts from a #GdkAtom to the X atom for a #GdkDisplay * Converts from a #GdkAtom to the X atom for a #GdkDisplay
* with the same string value. The special value %GDK_NONE * with the same string value. The special value %NULL
* is converted to %None. * is converted to %None.
* *
* Returns: the X atom corresponding to @atom, or %None * Returns: the X atom corresponding to @atom, or %None
@ -92,7 +92,7 @@ gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), None); g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
if (atom == GDK_NONE) if (atom == NULL)
return None; return None;
if (gdk_display_is_closed (display)) if (gdk_display_is_closed (display))
@ -184,15 +184,15 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
Atom xatom) Atom xatom)
{ {
GdkX11Display *display_x11; GdkX11Display *display_x11;
GdkAtom virtual_atom = GDK_NONE; GdkAtom virtual_atom = NULL;
g_return_val_if_fail (GDK_IS_DISPLAY (display), GDK_NONE); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
if (xatom == None) if (xatom == None)
return GDK_NONE; return NULL;
if (gdk_display_is_closed (display)) if (gdk_display_is_closed (display))
return GDK_NONE; return NULL;
display_x11 = GDK_X11_DISPLAY (display); display_x11 = GDK_X11_DISPLAY (display);
@ -379,7 +379,7 @@ _gdk_x11_window_get_property (GdkWindow *window,
display = gdk_window_get_display (window); display = gdk_window_get_display (window);
xproperty = gdk_x11_atom_to_xatom_for_display (display, property); xproperty = gdk_x11_atom_to_xatom_for_display (display, property);
if (type == GDK_NONE) if (type == NULL)
xtype = AnyPropertyType; xtype = AnyPropertyType;
else else
xtype = gdk_x11_atom_to_xatom_for_display (display, type); xtype = gdk_x11_atom_to_xatom_for_display (display, type);

View File

@ -190,7 +190,7 @@ _gdk_x11_display_convert_selection (GdkDisplay *display,
GdkAtom target, GdkAtom target,
guint32 time) guint32 time)
{ {
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor)) if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor))
return; return;
@ -303,7 +303,7 @@ _gdk_x11_display_get_selection_property (GdkDisplay *display,
err: err:
if (ret_type) if (ret_type)
*ret_type = GDK_NONE; *ret_type = NULL;
if (ret_format) if (ret_format)
*ret_format = 0; *ret_format = 0;
if (data) if (data)
@ -343,7 +343,7 @@ _gdk_x11_display_send_selection_notify (GdkDisplay *display,
xevent.requestor = GDK_WINDOW_XID (requestor); xevent.requestor = GDK_WINDOW_XID (requestor);
xevent.selection = gdk_x11_atom_to_xatom_for_display (display, selection); xevent.selection = gdk_x11_atom_to_xatom_for_display (display, selection);
xevent.target = gdk_x11_atom_to_xatom_for_display (display, target); xevent.target = gdk_x11_atom_to_xatom_for_display (display, target);
if (property == GDK_NONE) if (property == NULL)
xevent.property = None; xevent.property = None;
else else
xevent.property = gdk_x11_atom_to_xatom_for_display (display, property); xevent.property = gdk_x11_atom_to_xatom_for_display (display, property);

View File

@ -2061,7 +2061,7 @@ gdk_x11_window_set_modal_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window)) if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (modal, window, gdk_wmspec_change_state (modal, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_MODAL"), gdk_atom_intern_static_string ("_NET_WM_STATE_MODAL"),
GDK_NONE); NULL);
} }
static void static void
@ -2082,7 +2082,7 @@ gdk_x11_window_set_skip_taskbar_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window)) if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_taskbar, window, gdk_wmspec_change_state (skips_taskbar, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"), gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
GDK_NONE); NULL);
} }
static void static void
@ -2103,7 +2103,7 @@ gdk_x11_window_set_skip_pager_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window)) if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_pager, window, gdk_wmspec_change_state (skips_pager, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"), gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"),
GDK_NONE); NULL);
} }
static void static void
@ -3331,7 +3331,7 @@ gdk_x11_window_iconify (GdkWindow *window)
GDK_WINDOW_STATE_ICONIFIED); GDK_WINDOW_STATE_ICONIFIED);
gdk_wmspec_change_state (TRUE, window, gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"), gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE); NULL);
} }
} }
@ -3347,7 +3347,7 @@ gdk_x11_window_deiconify (GdkWindow *window)
gdk_window_show (window); gdk_window_show (window);
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"), gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE); NULL);
} }
else else
{ {
@ -3357,7 +3357,7 @@ gdk_x11_window_deiconify (GdkWindow *window)
0); 0);
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"), gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE); NULL);
} }
} }
@ -3379,7 +3379,7 @@ gdk_x11_window_stick (GdkWindow *window)
/* Request stick during viewport scroll */ /* Request stick during viewport scroll */
gdk_wmspec_change_state (TRUE, window, gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"), gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
GDK_NONE); NULL);
/* Request desktop 0xFFFFFFFF */ /* Request desktop 0xFFFFFFFF */
memset (&xclient, 0, sizeof (xclient)); memset (&xclient, 0, sizeof (xclient));
@ -3421,7 +3421,7 @@ gdk_x11_window_unstick (GdkWindow *window)
/* Request unstick from viewport */ /* Request unstick from viewport */
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"), gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
GDK_NONE); NULL);
move_to_current_desktop (window); move_to_current_desktop (window);
} }
@ -3572,7 +3572,7 @@ gdk_x11_window_fullscreen (GdkWindow *window)
{ {
gdk_wmspec_change_state (TRUE, window, gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
GDK_NONE); NULL);
/* Actual XRandR layout may have change since we computed the fullscreen /* Actual XRandR layout may have change since we computed the fullscreen
* monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode. * monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode.
*/ */
@ -3612,7 +3612,7 @@ gdk_x11_window_unfullscreen (GdkWindow *window)
if (GDK_WINDOW_IS_MAPPED (window)) if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
GDK_NONE); NULL);
else else
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
@ -3635,10 +3635,10 @@ gdk_x11_window_set_keep_above (GdkWindow *window,
if (setting) if (setting)
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"), gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
GDK_NONE); NULL);
gdk_wmspec_change_state (setting, window, gdk_wmspec_change_state (setting, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"), gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"),
GDK_NONE); NULL);
} }
else else
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
@ -3660,10 +3660,10 @@ gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting)
if (setting) if (setting)
gdk_wmspec_change_state (FALSE, window, gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"), gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"),
GDK_NONE); NULL);
gdk_wmspec_change_state (setting, window, gdk_wmspec_change_state (setting, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"), gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
GDK_NONE); NULL);
} }
else else
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,

View File

@ -2948,7 +2948,7 @@ gtk_calendar_drag_motion (GtkWidget *widget,
} }
target = gtk_drag_dest_find_target (widget, context, NULL); target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE || gdk_drag_context_get_suggested_action (context) == 0) if (target == NULL || gdk_drag_context_get_suggested_action (context) == 0)
gdk_drag_status (context, 0, time); gdk_drag_status (context, 0, time);
else else
{ {
@ -2969,7 +2969,7 @@ gtk_calendar_drag_drop (GtkWidget *widget,
GdkAtom target; GdkAtom target;
target = gtk_drag_dest_find_target (widget, context, NULL); target = gtk_drag_dest_find_target (widget, context, NULL);
if (target != GDK_NONE) if (target != NULL)
{ {
gtk_drag_get_data (widget, context, gtk_drag_get_data (widget, context,
target, target,

View File

@ -945,7 +945,7 @@ clipboard_peek (GdkDisplay *display,
GSList *clipboards; GSList *clipboards;
GSList *tmp_list; GSList *tmp_list;
if (selection == GDK_NONE) if (selection == NULL)
selection = GDK_SELECTION_CLIPBOARD; selection = GDK_SELECTION_CLIPBOARD;
clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list"); clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list");
@ -1122,7 +1122,7 @@ _gtk_clipboard_store_all (void)
GdkAtom GdkAtom
gtk_clipboard_get_selection (GtkClipboard *clipboard) gtk_clipboard_get_selection (GtkClipboard *clipboard)
{ {
g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), GDK_NONE); g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), NULL);
return clipboard->selection; return clipboard->selection;
} }

View File

@ -315,7 +315,7 @@ clipboard_display_closed (GdkDisplay *display,
* Returns the clipboard object for the given selection. * Returns the clipboard object for the given selection.
* Cut/copy/paste menu items and keyboard shortcuts should use * Cut/copy/paste menu items and keyboard shortcuts should use
* the default clipboard, returned by passing %GDK_SELECTION_CLIPBOARD for @selection. * the default clipboard, returned by passing %GDK_SELECTION_CLIPBOARD for @selection.
* (%GDK_NONE is supported as a synonym for GDK_SELECTION_CLIPBOARD * (%NULL is supported as a synonym for GDK_SELECTION_CLIPBOARD
* for backwards compatibility reasons.) * for backwards compatibility reasons.)
* The currently-selected object or text should be provided on the clipboard * The currently-selected object or text should be provided on the clipboard
* identified by #GDK_SELECTION_PRIMARY. Cut/copy/paste menu items * identified by #GDK_SELECTION_PRIMARY. Cut/copy/paste menu items
@ -323,7 +323,7 @@ clipboard_display_closed (GdkDisplay *display,
* to the default clipboard, i.e. they copy the selection to what the * to the default clipboard, i.e. they copy the selection to what the
* user sees as the clipboard. * user sees as the clipboard.
* *
* (Passing #GDK_NONE is the same as using `gdk_atom_intern * (Passing #NULL is the same as using `gdk_atom_intern
* ("CLIPBOARD", FALSE)`. * ("CLIPBOARD", FALSE)`.
* *
* See the * See the
@ -995,7 +995,7 @@ gtk_clipboard_request_contents (GtkClipboard *clipboard,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (clipboard != NULL); g_return_if_fail (clipboard != NULL);
g_return_if_fail (target != GDK_NONE); g_return_if_fail (target != NULL);
g_return_if_fail (callback != NULL); g_return_if_fail (callback != NULL);
GTK_CLIPBOARD_GET_CLASS (clipboard)->request_contents (clipboard, GTK_CLIPBOARD_GET_CLASS (clipboard)->request_contents (clipboard,
@ -1428,7 +1428,7 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
WaitResults results; WaitResults results;
g_return_val_if_fail (clipboard != NULL, NULL); g_return_val_if_fail (clipboard != NULL, NULL);
g_return_val_if_fail (target != GDK_NONE, NULL); g_return_val_if_fail (target != NULL, NULL);
results.data = NULL; results.data = NULL;
results.loop = g_main_loop_new (NULL, TRUE); results.loop = g_main_loop_new (NULL, TRUE);
@ -1988,7 +1988,7 @@ clipboard_peek (GdkDisplay *display,
GSList *clipboards; GSList *clipboards;
GSList *tmp_list; GSList *tmp_list;
if (selection == GDK_NONE) if (selection == NULL)
selection = GDK_SELECTION_CLIPBOARD; selection = GDK_SELECTION_CLIPBOARD;
clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list"); clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list");
@ -2298,7 +2298,7 @@ _gtk_clipboard_store_all (void)
GdkAtom GdkAtom
gtk_clipboard_get_selection (GtkClipboard *clipboard) gtk_clipboard_get_selection (GtkClipboard *clipboard)
{ {
g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), GDK_NONE); g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), NULL);
return clipboard->selection; return clipboard->selection;
} }

View File

@ -113,7 +113,7 @@ struct _GtkDragFindData
guint target_info; guint target_info;
GtkSelectionData selection_data; GtkSelectionData selection_data;
selection_data.selection = GDK_NONE; selection_data.selection = NULL;
selection_data.data = NULL; selection_data.data = NULL;
selection_data.length = -1; selection_data.length = -1;
selection_data.target = gdk_quartz_pasteboard_type_to_atom_libgtk_only (type); selection_data.target = gdk_quartz_pasteboard_type_to_atom_libgtk_only (type);
@ -834,7 +834,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
{ {
GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL); GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE) if (target == NULL)
{ {
gtk_drag_finish (context, FALSE, FALSE, time); gtk_drag_finish (context, FALSE, FALSE, time);
return TRUE; return TRUE;
@ -992,8 +992,8 @@ gtk_drag_dest_find_target (GtkWidget *widget,
GList *tmp_source = NULL; GList *tmp_source = NULL;
GList *source_targets; GList *source_targets;
g_return_val_if_fail (GTK_IS_WIDGET (widget), GDK_NONE); g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context); dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context);
pasteboard = [dragging_info draggingPasteboard]; pasteboard = [dragging_info draggingPasteboard];
@ -1004,7 +1004,7 @@ gtk_drag_dest_find_target (GtkWidget *widget,
target_list = gtk_drag_dest_get_target_list (widget); target_list = gtk_drag_dest_get_target_list (widget);
if (target_list == NULL) if (target_list == NULL)
return GDK_NONE; return NULL;
source_targets = _gtk_quartz_pasteboard_types_to_atom_list ([pasteboard types]); source_targets = _gtk_quartz_pasteboard_types_to_atom_list ([pasteboard types]);
tmp_target = target_list->list; tmp_target = target_list->list;
@ -1031,7 +1031,7 @@ gtk_drag_dest_find_target (GtkWidget *widget,
} }
g_list_free (source_targets); g_list_free (source_targets);
return GDK_NONE; return NULL;
} }
static gboolean static gboolean

View File

@ -632,7 +632,7 @@ gtk_drag_finish (GdkDragContext *context,
gboolean del, gboolean del,
guint32 time) guint32 time)
{ {
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
@ -641,7 +641,7 @@ gtk_drag_finish (GdkDragContext *context,
target = gdk_atom_intern_static_string ("DELETE"); target = gdk_atom_intern_static_string ("DELETE");
} }
if (target != GDK_NONE) if (target != NULL)
{ {
GtkWidget *selection_widget = gtk_drag_get_ipc_widget_for_display (gdk_window_get_display (gdk_drag_context_get_source_window (context))); GtkWidget *selection_widget = gtk_drag_get_ipc_widget_for_display (gdk_window_get_display (gdk_drag_context_get_source_window (context)));
@ -1142,7 +1142,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
{ {
GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL); GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE) if (target == NULL)
{ {
gtk_drag_finish (context, FALSE, FALSE, time); gtk_drag_finish (context, FALSE, FALSE, time);
return TRUE; return TRUE;
@ -1882,7 +1882,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
if (pair->target == target1 || pair->target == target2) if (pair->target == target1 || pair->target == target2)
{ {
selection_data.selection = GDK_NONE; selection_data.selection = NULL;
selection_data.target = pair->target; selection_data.target = pair->target;
selection_data.data = NULL; selection_data.data = NULL;
selection_data.length = -1; selection_data.length = -1;
@ -1926,7 +1926,7 @@ gtk_drag_selection_get (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GtkDragSourceInfo *info = data; GtkDragSourceInfo *info = data;
static GdkAtom null_atom = GDK_NONE; static GdkAtom null_atom = NULL;
guint target_info; guint target_info;
if (!null_atom) if (!null_atom)

View File

@ -397,14 +397,14 @@ gtk_drag_dest_get_track_motion (GtkWidget *widget)
* *
* Looks for a match between the supported targets of @context and the * Looks for a match between the supported targets of @context and the
* @dest_target_list, returning the first matching target, otherwise * @dest_target_list, returning the first matching target, otherwise
* returning %GDK_NONE. @dest_target_list should usually be the return * returning %NULL. @dest_target_list should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may * value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in * have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that * that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function. * passes the correct target list to this function.
* *
* Returns: (transfer none): first target that the source offers * Returns: (transfer none) (nullable): first target that the source offers
* and the dest can accept, or %GDK_NONE * and the dest can accept, or %NULL
*/ */
GdkAtom GdkAtom
gtk_drag_dest_find_target (GtkWidget *widget, gtk_drag_dest_find_target (GtkWidget *widget,
@ -415,15 +415,15 @@ gtk_drag_dest_find_target (GtkWidget *widget,
GList *tmp_source = NULL; GList *tmp_source = NULL;
GtkWidget *source_widget; GtkWidget *source_widget;
g_return_val_if_fail (GTK_IS_WIDGET (widget), GDK_NONE); g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
source_widget = gtk_drag_get_source_widget (context); source_widget = gtk_drag_get_source_widget (context);
if (target_list == NULL) if (target_list == NULL)
target_list = gtk_drag_dest_get_target_list (widget); target_list = gtk_drag_dest_get_target_list (widget);
if (target_list == NULL) if (target_list == NULL)
return GDK_NONE; return NULL;
tmp_target = target_list->list; tmp_target = target_list->list;
while (tmp_target) while (tmp_target)
@ -447,6 +447,6 @@ gtk_drag_dest_find_target (GtkWidget *widget,
tmp_target = tmp_target->next; tmp_target = tmp_target->next;
} }
return GDK_NONE; return NULL;
} }

View File

@ -8870,12 +8870,12 @@ gtk_entry_drag_drop (GtkWidget *widget,
{ {
GtkEntry *entry = GTK_ENTRY (widget); GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = entry->priv; GtkEntryPrivate *priv = entry->priv;
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
if (priv->editable) if (priv->editable)
target = gtk_drag_dest_find_target (widget, context, NULL); target = gtk_drag_dest_find_target (widget, context, NULL);
if (target != GDK_NONE) if (target != NULL)
gtk_drag_get_data (widget, context, target, time); gtk_drag_get_data (widget, context, target, time);
else else
gtk_drag_finish (context, FALSE, FALSE, time); gtk_drag_finish (context, FALSE, FALSE, time);
@ -8901,7 +8901,7 @@ gtk_entry_drag_motion (GtkWidget *widget,
new_position = gtk_entry_find_position (entry, x + priv->scroll_offset); new_position = gtk_entry_find_position (entry, x + priv->scroll_offset);
if (priv->editable && if (priv->editable &&
gtk_drag_dest_find_target (widget, context, NULL) != GDK_NONE) gtk_drag_dest_find_target (widget, context, NULL) != NULL)
{ {
source_widget = gtk_drag_get_source_widget (context); source_widget = gtk_drag_get_source_widget (context);
suggested_action = gdk_drag_context_get_suggested_action (context); suggested_action = gdk_drag_context_get_suggested_action (context);

View File

@ -6003,7 +6003,7 @@ set_destination (GtkIconView *icon_view,
widget = GTK_WIDGET (icon_view); widget = GTK_WIDGET (icon_view);
*suggested_action = 0; *suggested_action = 0;
*target = GDK_NONE; *target = NULL;
if (!icon_view->priv->dest_set) if (!icon_view->priv->dest_set)
{ {
@ -6022,7 +6022,7 @@ set_destination (GtkIconView *icon_view,
*target = gtk_drag_dest_find_target (widget, context, *target = gtk_drag_dest_find_target (widget, context,
gtk_drag_dest_get_target_list (widget)); gtk_drag_dest_get_target_list (widget));
if (*target == GDK_NONE) if (*target == NULL)
return FALSE; return FALSE;
if (!gtk_icon_view_get_dest_item_at_pos (icon_view, x, y, &path, &pos)) if (!gtk_icon_view_get_dest_item_at_pos (icon_view, x, y, &path, &pos))
@ -6419,7 +6419,7 @@ gtk_icon_view_drag_drop (GtkWidget *widget,
GtkIconView *icon_view; GtkIconView *icon_view;
GtkTreePath *path; GtkTreePath *path;
GdkDragAction suggested_action = 0; GdkDragAction suggested_action = 0;
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
GtkTreeModel *model; GtkTreeModel *model;
gboolean drop_append_mode; gboolean drop_append_mode;
@ -6439,7 +6439,7 @@ gtk_icon_view_drag_drop (GtkWidget *widget,
path = get_logical_destination (icon_view, &drop_append_mode); path = get_logical_destination (icon_view, &drop_append_mode);
if (target != GDK_NONE && path != NULL) if (target != NULL && path != NULL)
{ {
/* in case a motion had requested drag data, change things so we /* in case a motion had requested drag data, change things so we
* treat drag data receives as a drop. * treat drag data receives as a drop.
@ -6455,7 +6455,7 @@ gtk_icon_view_drag_drop (GtkWidget *widget,
/* Unset this thing */ /* Unset this thing */
gtk_icon_view_set_drag_dest_item (icon_view, NULL, GTK_ICON_VIEW_DROP_LEFT); gtk_icon_view_set_drag_dest_item (icon_view, NULL, GTK_ICON_VIEW_DROP_LEFT);
if (target != GDK_NONE) if (target != NULL)
{ {
gtk_drag_get_data (widget, context, target, time); gtk_drag_get_data (widget, context, target, time);
return TRUE; return TRUE;

View File

@ -1635,7 +1635,7 @@ get_drag_data (GtkWidget *list_box,
target = gtk_drag_dest_find_target (list_box, context, NULL); target = gtk_drag_dest_find_target (list_box, context, NULL);
if (target == GDK_NONE) if (target == NULL)
return FALSE; return FALSE;
gtk_drag_get_data (list_box, context, target, time); gtk_drag_get_data (list_box, context, target, time);
@ -2009,7 +2009,7 @@ drag_data_received_callback (GtkWidget *list_box,
if (!sidebar->drag_data_received) if (!sidebar->drag_data_received)
{ {
if (gtk_selection_data_get_target (selection_data) != GDK_NONE && if (gtk_selection_data_get_target (selection_data) != NULL &&
info == DND_TEXT_URI_LIST) info == DND_TEXT_URI_LIST)
{ {
gchar **uris; gchar **uris;

View File

@ -733,7 +733,7 @@ gtk_selection_owner_set_for_display (GdkDisplay *display,
GdkWindow *window; GdkWindow *window;
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (selection != NULL, FALSE);
g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE); g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (widget == NULL || gtk_widget_get_display (widget) == display, FALSE); g_return_val_if_fail (widget == NULL || gtk_widget_get_display (widget) == display, FALSE);
@ -826,7 +826,7 @@ gtk_selection_owner_set (GtkWidget *widget,
GdkDisplay *display; GdkDisplay *display;
g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE); g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (selection != NULL, FALSE);
if (widget) if (widget)
display = gtk_widget_get_display (widget); display = gtk_widget_get_display (widget);
@ -919,7 +919,7 @@ gtk_selection_clear_targets (GtkWidget *widget,
GList *lists; GList *lists;
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
gdk_selection_clear_targets (gtk_widget_get_display (widget), selection); gdk_selection_clear_targets (gtk_widget_get_display (widget), selection);
@ -963,7 +963,7 @@ gtk_selection_add_target (GtkWidget *widget,
GtkTargetList *list; GtkTargetList *list;
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
list = gtk_selection_target_list_get (widget, selection); list = gtk_selection_target_list_get (widget, selection);
gtk_target_list_add (list, target, 0, info); gtk_target_list_add (list, target, 0, info);
@ -990,7 +990,7 @@ gtk_selection_add_targets (GtkWidget *widget,
guint n_targets; guint n_targets;
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (selection != GDK_NONE); g_return_if_fail (selection != NULL);
g_return_if_fail (targets != NULL); g_return_if_fail (targets != NULL);
list = gtk_selection_target_list_get (widget, selection); list = gtk_selection_target_list_get (widget, selection);
@ -1092,7 +1092,7 @@ gtk_selection_convert (GtkWidget *widget,
guint id; guint id;
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (selection != NULL, FALSE);
if (initialize) if (initialize)
gtk_selection_init (); gtk_selection_init ();
@ -2449,7 +2449,7 @@ _gtk_selection_request (GtkWidget *widget,
mult_atoms = NULL; mult_atoms = NULL;
gdk_error_trap_push (); gdk_error_trap_push ();
if (!gdk_property_get (info->requestor, property, GDK_NONE, /* AnyPropertyType */ if (!gdk_property_get (info->requestor, property, NULL, /* AnyPropertyType */
0, selection_max_size, FALSE, 0, selection_max_size, FALSE,
&type, &format, &length, &mult_atoms)) &type, &format, &length, &mult_atoms))
{ {
@ -2457,7 +2457,7 @@ _gtk_selection_request (GtkWidget *widget,
requestor, requestor,
selection, selection,
target, target,
GDK_NONE, NULL,
time); time);
g_free (mult_atoms); g_free (mult_atoms);
g_slice_free (GtkIncrInfo, info); g_slice_free (GtkIncrInfo, info);
@ -2534,7 +2534,7 @@ _gtk_selection_request (GtkWidget *widget,
gtk_selection_invoke_handler (widget, &data, time); gtk_selection_invoke_handler (widget, &data, time);
if (data.length < 0) if (data.length < 0)
{ {
info->conversions[i].property = GDK_NONE; info->conversions[i].property = NULL;
continue; continue;
} }
@ -2625,14 +2625,14 @@ _gtk_selection_request (GtkWidget *widget,
} }
if (info->num_conversions == 1 && if (info->num_conversions == 1 &&
info->conversions[0].property == GDK_NONE) info->conversions[0].property == NULL)
{ {
/* Reject the entire conversion */ /* Reject the entire conversion */
gdk_selection_send_notify_for_display (gtk_widget_get_display (widget), gdk_selection_send_notify_for_display (gtk_widget_get_display (widget),
requestor, requestor,
selection, selection,
target, target,
GDK_NONE, NULL,
time); time);
} }
else else
@ -2885,18 +2885,18 @@ _gtk_selection_notify (GtkWidget *widget,
if (!tmp_list) /* no retrieval in progress */ if (!tmp_list) /* no retrieval in progress */
return FALSE; return FALSE;
if (property != GDK_NONE) if (property != NULL)
length = gdk_selection_property_get (window, &buffer, length = gdk_selection_property_get (window, &buffer,
&type, &format); &type, &format);
else else
length = 0; /* silence gcc */ length = 0; /* silence gcc */
if (property == GDK_NONE || buffer == NULL) if (property == NULL || buffer == NULL)
{ {
current_retrievals = g_list_remove_link (current_retrievals, tmp_list); current_retrievals = g_list_remove_link (current_retrievals, tmp_list);
g_list_free (tmp_list); g_list_free (tmp_list);
/* structure will be freed in timeout */ /* structure will be freed in timeout */
gtk_selection_retrieval_report (info, GDK_NONE, 0, NULL, -1, time); gtk_selection_retrieval_report (info, NULL, 0, NULL, -1, time);
return TRUE; return TRUE;
} }
@ -3002,15 +3002,15 @@ _gtk_selection_property_notify (GtkWidget *widget,
doing memory allocation at every step. But its only guaranteed to doing memory allocation at every step. But its only guaranteed to
be a _lower bound_ (pretty useless!) */ be a _lower bound_ (pretty useless!) */
if (length == 0 || type == GDK_NONE) /* final zero length portion */ if (length == 0 || type == NULL) /* final zero length portion */
{ {
/* Info structure will be freed in timeout */ /* Info structure will be freed in timeout */
current_retrievals = g_list_remove_link (current_retrievals, tmp_list); current_retrievals = g_list_remove_link (current_retrievals, tmp_list);
g_list_free (tmp_list); g_list_free (tmp_list);
gtk_selection_retrieval_report (info, gtk_selection_retrieval_report (info,
type, format, type, format,
(type == GDK_NONE) ? NULL : info->buffer, (type == NULL) ? NULL : info->buffer,
(type == GDK_NONE) ? -1 : info->offset, (type == NULL) ? -1 : info->offset,
info->notify_time); info->notify_time);
} }
else /* append on newly arrived data */ else /* append on newly arrived data */
@ -3074,7 +3074,7 @@ gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
{ {
current_retrievals = g_list_remove_link (current_retrievals, tmp_list); current_retrievals = g_list_remove_link (current_retrievals, tmp_list);
g_list_free (tmp_list); g_list_free (tmp_list);
gtk_selection_retrieval_report (info, GDK_NONE, 0, NULL, -1, GDK_CURRENT_TIME); gtk_selection_retrieval_report (info, NULL, 0, NULL, -1, GDK_CURRENT_TIME);
} }
g_free (info->buffer); g_free (info->buffer);

View File

@ -79,9 +79,9 @@ gtk_text_buffer_register_serialize_format (GtkTextBuffer *buffer,
GList *formats; GList *formats;
GdkAtom atom; GdkAtom atom;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', GDK_NONE); g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', NULL);
g_return_val_if_fail (function != NULL, GDK_NONE); g_return_val_if_fail (function != NULL, NULL);
formats = g_object_steal_qdata (G_OBJECT (buffer), serialize_quark ()); formats = g_object_steal_qdata (G_OBJECT (buffer), serialize_quark ());
@ -133,8 +133,8 @@ gtk_text_buffer_register_serialize_tagset (GtkTextBuffer *buffer,
gchar *mime_type; gchar *mime_type;
GdkAtom format; GdkAtom format;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', GDK_NONE); g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', NULL);
if (tagset_name) if (tagset_name)
{ {
@ -182,9 +182,9 @@ gtk_text_buffer_register_deserialize_format (GtkTextBuffer *buffe
GList *formats; GList *formats;
GdkAtom atom; GdkAtom atom;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', GDK_NONE); g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', NULL);
g_return_val_if_fail (function != NULL, GDK_NONE); g_return_val_if_fail (function != NULL, NULL);
formats = g_object_steal_qdata (G_OBJECT (buffer), deserialize_quark ()); formats = g_object_steal_qdata (G_OBJECT (buffer), deserialize_quark ());
@ -222,8 +222,8 @@ gtk_text_buffer_register_deserialize_tagset (GtkTextBuffer *buffer,
gchar *mime_type; gchar *mime_type;
GdkAtom format; GdkAtom format;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', GDK_NONE); g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', NULL);
if (tagset_name) if (tagset_name)
{ {
@ -263,7 +263,7 @@ gtk_text_buffer_unregister_serialize_format (GtkTextBuffer *buffer,
GList *formats; GList *formats;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (format != GDK_NONE); g_return_if_fail (format != NULL);
formats = g_object_steal_qdata (G_OBJECT (buffer), serialize_quark ()); formats = g_object_steal_qdata (G_OBJECT (buffer), serialize_quark ());
@ -293,7 +293,7 @@ gtk_text_buffer_unregister_deserialize_format (GtkTextBuffer *buffer,
GList *formats; GList *formats;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (format != GDK_NONE); g_return_if_fail (format != NULL);
formats = g_object_steal_qdata (G_OBJECT (buffer), deserialize_quark ()); formats = g_object_steal_qdata (G_OBJECT (buffer), deserialize_quark ());
@ -341,7 +341,7 @@ gtk_text_buffer_deserialize_set_can_create_tags (GtkTextBuffer *buffer,
gchar *format_name; gchar *format_name;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (format != GDK_NONE); g_return_if_fail (format != NULL);
formats = g_object_get_qdata (G_OBJECT (buffer), deserialize_quark ()); formats = g_object_get_qdata (G_OBJECT (buffer), deserialize_quark ());
@ -384,7 +384,7 @@ gtk_text_buffer_deserialize_get_can_create_tags (GtkTextBuffer *buffer,
gchar *format_name; gchar *format_name;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
g_return_val_if_fail (format != GDK_NONE, FALSE); g_return_val_if_fail (format != NULL, FALSE);
formats = g_object_get_qdata (G_OBJECT (buffer), deserialize_quark ()); formats = g_object_get_qdata (G_OBJECT (buffer), deserialize_quark ());
@ -497,7 +497,7 @@ gtk_text_buffer_serialize (GtkTextBuffer *register_buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (register_buffer), NULL); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (register_buffer), NULL);
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (content_buffer), NULL); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (content_buffer), NULL);
g_return_val_if_fail (format != GDK_NONE, NULL); g_return_val_if_fail (format != NULL, NULL);
g_return_val_if_fail (start != NULL, NULL); g_return_val_if_fail (start != NULL, NULL);
g_return_val_if_fail (end != NULL, NULL); g_return_val_if_fail (end != NULL, NULL);
g_return_val_if_fail (length != NULL, NULL); g_return_val_if_fail (length != NULL, NULL);
@ -558,7 +558,7 @@ gtk_text_buffer_deserialize (GtkTextBuffer *register_buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (register_buffer), FALSE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (register_buffer), FALSE);
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (content_buffer), FALSE); g_return_val_if_fail (GTK_IS_TEXT_BUFFER (content_buffer), FALSE);
g_return_val_if_fail (format != GDK_NONE, FALSE); g_return_val_if_fail (format != NULL, FALSE);
g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (data != NULL, FALSE); g_return_val_if_fail (data != NULL, FALSE);
g_return_val_if_fail (length > 0, FALSE); g_return_val_if_fail (length > 0, FALSE);

View File

@ -7970,7 +7970,7 @@ gtk_text_view_drag_motion (GtkWidget *widget,
target = gtk_drag_dest_find_target (widget, context, target = gtk_drag_dest_find_target (widget, context,
gtk_drag_dest_get_target_list (widget)); gtk_drag_dest_get_target_list (widget));
if (target == GDK_NONE) if (target == NULL)
{ {
/* can't accept any of the offered targets */ /* can't accept any of the offered targets */
} }
@ -8048,7 +8048,7 @@ gtk_text_view_drag_drop (GtkWidget *widget,
GtkTextView *text_view; GtkTextView *text_view;
GtkTextViewPrivate *priv; GtkTextViewPrivate *priv;
GtkTextIter drop_point; GtkTextIter drop_point;
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
text_view = GTK_TEXT_VIEW (widget); text_view = GTK_TEXT_VIEW (widget);
priv = text_view->priv; priv = text_view->priv;
@ -8067,7 +8067,7 @@ gtk_text_view_drag_drop (GtkWidget *widget,
if (gtk_text_iter_can_insert (&drop_point, priv->editable)) if (gtk_text_iter_can_insert (&drop_point, priv->editable))
target = gtk_drag_dest_find_target (widget, context, NULL); target = gtk_drag_dest_find_target (widget, context, NULL);
if (target != GDK_NONE) if (target != NULL)
gtk_drag_get_data (widget, context, target, time); gtk_drag_get_data (widget, context, target, time);
else else
gtk_drag_finish (context, FALSE, FALSE, time); gtk_drag_finish (context, FALSE, FALSE, time);
@ -8154,7 +8154,7 @@ gtk_text_view_drag_data_received (GtkWidget *widget,
GdkAtom *atoms; GdkAtom *atoms;
gint n_atoms; gint n_atoms;
GList *list; GList *list;
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
copy_tags = FALSE; copy_tags = FALSE;
@ -8174,7 +8174,7 @@ gtk_text_view_drag_data_received (GtkWidget *widget,
g_free (atoms); g_free (atoms);
if (target != GDK_NONE) if (target != NULL)
{ {
gtk_drag_get_data (widget, context, target, time); gtk_drag_get_data (widget, context, target, time);
gtk_text_buffer_end_user_action (buffer); gtk_text_buffer_end_user_action (buffer);

View File

@ -181,8 +181,8 @@ struct _GtkToolPaletteDragData
GtkWidget *item; GtkWidget *item;
}; };
static GdkAtom dnd_target_atom_item = GDK_NONE; static GdkAtom dnd_target_atom_item = NULL;
static GdkAtom dnd_target_atom_group = GDK_NONE; static GdkAtom dnd_target_atom_group = NULL;
static const GtkTargetEntry dnd_targets[] = static const GtkTargetEntry dnd_targets[] =
{ {
@ -218,7 +218,7 @@ gtk_tool_palette_init (GtkToolPalette *palette)
palette->priv->text_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH); palette->priv->text_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
if (dnd_target_atom_item == GDK_NONE) if (dnd_target_atom_item == NULL)
{ {
dnd_target_atom_item = gdk_atom_intern_static_string (dnd_targets[0].target); dnd_target_atom_item = gdk_atom_intern_static_string (dnd_targets[0].target);
dnd_target_atom_group = gdk_atom_intern_static_string (dnd_targets[1].target); dnd_target_atom_group = gdk_atom_intern_static_string (dnd_targets[1].target);

View File

@ -7258,7 +7258,7 @@ set_destination_row (GtkTreeView *tree_view,
gboolean can_drop = FALSE; gboolean can_drop = FALSE;
*suggested_action = 0; *suggested_action = 0;
*target = GDK_NONE; *target = NULL;
widget = GTK_WIDGET (tree_view); widget = GTK_WIDGET (tree_view);
@ -7282,7 +7282,7 @@ set_destination_row (GtkTreeView *tree_view,
*target = gtk_drag_dest_find_target (widget, context, *target = gtk_drag_dest_find_target (widget, context,
gtk_drag_dest_get_target_list (widget)); gtk_drag_dest_get_target_list (widget));
if (*target == GDK_NONE) if (*target == NULL)
{ {
return FALSE; return FALSE;
} }
@ -7755,7 +7755,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget,
GtkTreeView *tree_view; GtkTreeView *tree_view;
GtkTreePath *path; GtkTreePath *path;
GdkDragAction suggested_action = 0; GdkDragAction suggested_action = 0;
GdkAtom target = GDK_NONE; GdkAtom target = NULL;
TreeViewDragInfo *di; TreeViewDragInfo *di;
GtkTreeModel *model; GtkTreeModel *model;
gboolean path_down_mode; gboolean path_down_mode;
@ -7781,7 +7781,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget,
path = get_logical_dest_row (tree_view, &path_down_mode, &drop_append_mode); path = get_logical_dest_row (tree_view, &path_down_mode, &drop_append_mode);
if (target != GDK_NONE && path != NULL) if (target != NULL && path != NULL)
{ {
/* in case a motion had requested drag data, change things so we /* in case a motion had requested drag data, change things so we
* treat drag data receives as a drop. * treat drag data receives as a drop.
@ -7800,7 +7800,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget,
NULL, NULL,
GTK_TREE_VIEW_DROP_BEFORE); GTK_TREE_VIEW_DROP_BEFORE);
if (target != GDK_NONE) if (target != NULL)
{ {
gtk_drag_get_data (widget, context, target, time); gtk_drag_get_data (widget, context, target, time);
return TRUE; return TRUE;

View File

@ -2754,7 +2754,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* } * }
* *
* target = gtk_drag_dest_find_target (widget, context, NULL); * target = gtk_drag_dest_find_target (widget, context, NULL);
* if (target == GDK_NONE) * if (target == NULL)
* gdk_drag_status (context, 0, time); * gdk_drag_status (context, 0, time);
* else * else
* { * {

View File

@ -7102,7 +7102,7 @@ selection_test_received (GtkWidget *tree_view,
void void
selection_test_get_targets (GtkWidget *dialog, gint response, GtkWidget *tree_view) selection_test_get_targets (GtkWidget *dialog, gint response, GtkWidget *tree_view)
{ {
static GdkAtom targets_atom = GDK_NONE; static GdkAtom targets_atom = NULL;
if (response != GTK_RESPONSE_APPLY) if (response != GTK_RESPONSE_APPLY)
{ {
@ -7110,7 +7110,7 @@ selection_test_get_targets (GtkWidget *dialog, gint response, GtkWidget *tree_vi
return; return;
} }
if (targets_atom == GDK_NONE) if (targets_atom == NULL)
targets_atom = gdk_atom_intern ("TARGETS", FALSE); targets_atom = gdk_atom_intern ("TARGETS", FALSE);
gtk_selection_convert (tree_view, GDK_SELECTION_PRIMARY, targets_atom, gtk_selection_convert (tree_view, GDK_SELECTION_PRIMARY, targets_atom,

View File

@ -114,7 +114,7 @@ init_atoms (void)
{ {
int i; int i;
seltypes[SEL_TYPE_NONE] = GDK_NONE; seltypes[SEL_TYPE_NONE] = NULL;
seltypes[APPLE_PICT] = gdk_atom_intern ("APPLE_PICT",FALSE); seltypes[APPLE_PICT] = gdk_atom_intern ("APPLE_PICT",FALSE);
seltypes[ATOM] = gdk_atom_intern ("ATOM",FALSE); seltypes[ATOM] = gdk_atom_intern ("ATOM",FALSE);
seltypes[ATOM_PAIR] = gdk_atom_intern ("ATOM_PAIR",FALSE); seltypes[ATOM_PAIR] = gdk_atom_intern ("ATOM_PAIR",FALSE);
@ -167,7 +167,7 @@ selection_get (GtkWidget *widget,
{ {
guchar *buffer; guchar *buffer;
gint len; gint len;
GdkAtom type = GDK_NONE; GdkAtom type = NULL;
if (!selection_string) if (!selection_string)
{ {
@ -368,7 +368,7 @@ paste (GtkWidget *dialog, gint response, GtkWidget *entry)
name = gtk_entry_get_text (GTK_ENTRY(entry)); name = gtk_entry_get_text (GTK_ENTRY(entry));
atom = gdk_atom_intern (name, FALSE); atom = gdk_atom_intern (name, FALSE);
if (atom == GDK_NONE) if (atom == NULL)
{ {
g_print("Could not create atom: \"%s\"\n",name); g_print("Could not create atom: \"%s\"\n",name);
return; return;