diff options
44 files changed, 181 insertions, 190 deletions
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 4eb5c43318..259c875193 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -421,7 +421,6 @@ gdk_selection_send_notify_for_display GdkAtom GDK_ATOM_TO_POINTER GDK_POINTER_TO_ATOM -GDK_NONE gdk_text_property_to_utf8_list_for_display gdk_utf8_to_string_target gdk_atom_intern diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c index 28028f341a..3a50d6ed75 100644 --- a/gdk/broadway/gdkdevice-broadway.c +++ b/gdk/broadway/gdkdevice-broadway.c @@ -91,8 +91,8 @@ gdk_broadway_device_init (GdkBroadwayDevice *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, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } static gboolean diff --git a/gdk/broadway/gdkdnd-broadway.c b/gdk/broadway/gdkdnd-broadway.c index abbd7150f9..d280a26758 100644 --- a/gdk/broadway/gdkdnd-broadway.c +++ b/gdk/broadway/gdkdnd-broadway.c @@ -184,9 +184,9 @@ _gdk_broadway_window_register_dnd (GdkWindow *window) static GdkAtom 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 diff --git a/gdk/broadway/gdkselection-broadway.c b/gdk/broadway/gdkselection-broadway.c index 1f3813bc23..b7a37bc787 100644 --- a/gdk/broadway/gdkselection-broadway.c +++ b/gdk/broadway/gdkselection-broadway.c @@ -147,7 +147,7 @@ _gdk_broadway_display_get_selection_property (GdkDisplay *display, gint *ret_format) { if (ret_type) - *ret_type = GDK_NONE; + *ret_type = NULL; if (ret_format) *ret_format = 0; if (data) diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 15f0cab30a..72e972a96f 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -570,12 +570,12 @@ gdk_drag_drop_succeeded (GdkDragContext *context) * * 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 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); } diff --git a/gdk/gdkproperty.c b/gdk/gdkproperty.c index bdd6d708c3..fa8df1a2a2 100644 --- a/gdk/gdkproperty.c +++ b/gdk/gdkproperty.c @@ -60,7 +60,7 @@ * gdk_atom_intern: * @atom_name: a string. * @only_if_exists: if %TRUE, GDK is allowed to not create a new atom, but - * just return %GDK_NONE if the requested atom doesn’t already + * just return %NULL if the requested atom doesn’t already * exists. Currently, the flag is ignored, since checking the * existance of an atom is as expensive as creating it. * @@ -72,7 +72,7 @@ GdkAtom gdk_atom_intern (const gchar *atom_name, 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); } @@ -99,7 +99,7 @@ gdk_atom_intern (const gchar *atom_name, GdkAtom 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); } diff --git a/gdk/gdkselection.c b/gdk/gdkselection.c index 9eb60f57f8..91bb4aed5b 100644 --- a/gdk/gdkselection.c +++ b/gdk/gdkselection.c @@ -115,7 +115,7 @@ gdk_selection_owner_get (GdkAtom selection) * @selection: selection that was requested. * @target: target that was selected. * @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. * @time_: timestamp. * @@ -160,7 +160,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display, gboolean send_event) { 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) ->set_selection_owner (display, owner, selection, time, send_event); @@ -189,7 +189,7 @@ gdk_selection_owner_get_for_display (GdkDisplay *display, GdkAtom selection) { 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); } @@ -201,7 +201,7 @@ gdk_selection_owner_get_for_display (GdkDisplay *display, * @selection: selection that was requested * @target: target that was selected * @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 * * Send a response to SelectionRequest event. @@ -266,7 +266,7 @@ gdk_selection_convert (GdkWindow *requestor, { GdkDisplay *display; - g_return_if_fail (selection != GDK_NONE); + g_return_if_fail (selection != NULL); display = gdk_window_get_display (requestor); diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 8373b321e0..923cc50c07 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -118,14 +118,6 @@ typedef const char *GdkAtom; */ #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 */ typedef struct _GdkRGBA GdkRGBA; typedef struct _GdkCursor GdkCursor; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index efd979f5d8..810243f3be 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -7174,7 +7174,7 @@ gdk_drag_begin_from_point (GdkWindow *window, * gdk_property_get: * @window: a #GdkWindow * @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 * type, then @actual_format and @actual_length will * 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 * 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() * uses has a very confusing and complicated set of semantics. diff --git a/gdk/mir/gdkmirdisplay.c b/gdk/mir/gdkmirdisplay.c index 3c54109711..bedb1524a9 100644 --- a/gdk/mir/gdkmirdisplay.c +++ b/gdk/mir/gdkmirdisplay.c @@ -547,7 +547,7 @@ gdk_mir_display_get_selection_property (GdkDisplay *display, gdk_property_get (requestor, gdk_atom_intern_static_string ("GDK_SELECTION"), - GDK_NONE, + NULL, 0, G_MAXULONG, FALSE, @@ -639,7 +639,7 @@ get_best_format_index (const gchar * const *formats, if (!out_size) out_size = &best_size; - *out_type = GDK_NONE; + *out_type = NULL; *out_size = 0; for (i = 0; i < n_formats; i++) diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 1c55ce3171..e71f19cd92 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -1723,7 +1723,7 @@ gdk_mir_window_impl_get_property (GdkWindow *window, if (!actual_length) actual_length = &dummy_actual_length; - *actual_type = GDK_NONE; + *actual_type = NULL; *actual_format = 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")) *actual_format = 32; - if (type != GDK_NONE && type != mir_property->type) + if (type != NULL && type != mir_property->type) return FALSE; offset *= 4; @@ -1851,7 +1851,7 @@ create_paste (GdkWindow *window, for (i = 0; i < n_requested_targets; i++) { - if (requested_targets[i] == GDK_NONE) + if (requested_targets[i] == NULL) continue; mir_property = g_hash_table_lookup (impl->properties, requested_targets[i]); diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c index 8e5683a41e..333d9f35fc 100644 --- a/gdk/quartz/gdkdevice-core-quartz.c +++ b/gdk/quartz/gdkdevice-core-quartz.c @@ -106,8 +106,8 @@ gdk_quartz_device_core_init (GdkQuartzDeviceCore *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, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } static gboolean diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c index ac2beb9fa1..ee187041e7 100644 --- a/gdk/quartz/gdkdnd-quartz.c +++ b/gdk/quartz/gdkdnd-quartz.c @@ -130,7 +130,7 @@ static GdkAtom gdk_quartz_drag_context_get_selection (GdkDragContext *context) { /* FIXME: Implement */ - return GDK_NONE; + return NULL; } static gboolean diff --git a/gdk/quartz/gdkproperty-quartz.c b/gdk/quartz/gdkproperty-quartz.c index cfc62a389c..ae66342105 100644 --- a/gdk/quartz/gdkproperty-quartz.c +++ b/gdk/quartz/gdkproperty-quartz.c @@ -133,7 +133,7 @@ intern_atom_internal (const gchar *atom_name, gboolean allocate) { gpointer result; gchar *name; - g_return_val_if_fail (atom_name != NULL, GDK_NONE); + g_return_val_if_fail (atom_name != NULL, NULL); ensure_atom_tables (); diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index cf3ea74877..c2bba21a2b 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -876,8 +876,8 @@ gdk_wayland_device_init (GdkWaylandDevice *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, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } static gint @@ -1892,11 +1892,11 @@ keyboard_handle_enter (void *data, _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, 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)); _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, GDK_NONE, GDK_AXIS_Y, 0, 0, 0); + _gdk_device_add_axis (tablet->current_device, NULL, GDK_AXIS_X, 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)) { - 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); 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); tablet->axis_indices[GDK_AXIS_YTILT] = axis_pos; } 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); tablet->axis_indices[GDK_AXIS_DISTANCE] = axis_pos; } 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); tablet->axis_indices[GDK_AXIS_PRESSURE] = axis_pos; } 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); tablet->axis_indices[GDK_AXIS_ROTATION] = axis_pos; } 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); 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->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_set_user_data (seat->wl_seat, seat); diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index 6110dc0dfa..9bb980f961 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -795,7 +795,7 @@ gdk_wayland_selection_source_handles_target (GdkWaylandSelection *wayland_select GdkAtom atom; guint i; - if (target == GDK_NONE) + if (target == NULL) return FALSE; 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.selection = selection; event->selection.target = target; - event->selection.property = GDK_NONE; + event->selection.property = NULL; event->selection.time = GDK_CURRENT_TIME; 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); - wayland_selection->requested_target = GDK_NONE; + wayland_selection->requested_target = NULL; g_array_set_size (wayland_selection->source_targets, 0); gdk_wayland_selection_unset_data_source (display, selection); } diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c index c8c02dde0d..b2ad705d99 100644 --- a/gdk/win32/gdkdevice-win32.c +++ b/gdk/win32/gdkdevice-win32.c @@ -309,6 +309,6 @@ gdk_device_win32_init (GdkDeviceWin32 *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, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index 69a3da6b83..eef0453f2b 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -583,7 +583,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager) if (device->pktdata & PK_X) { _gdk_device_add_axis (GDK_DEVICE (device), - GDK_NONE, + NULL, GDK_AXIS_X, axis_x.axMin, axis_x.axMax, @@ -594,7 +594,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager) if (device->pktdata & PK_Y) { _gdk_device_add_axis (GDK_DEVICE (device), - GDK_NONE, + NULL, GDK_AXIS_Y, axis_y.axMin, axis_y.axMax, @@ -606,7 +606,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager) if (device->pktdata & PK_NORMAL_PRESSURE) { _gdk_device_add_axis (GDK_DEVICE (device), - GDK_NONE, + NULL, GDK_AXIS_PRESSURE, axis_npressure.axMin, 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 */ _gdk_device_add_axis (GDK_DEVICE (device), - GDK_NONE, + NULL, GDK_AXIS_XTILT, -1000, 1000, 1000); _gdk_device_add_axis (GDK_DEVICE (device), - GDK_NONE, + NULL, GDK_AXIS_YTILT, -1000, 1000, diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index 3219df248d..5d20b8889a 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -350,7 +350,7 @@ cf_to_atom (CLIPFORMAT cf) if (cf == _cf_html_format || cf == _cf_text_html) return _text_html; - return GDK_NONE; + return NULL; } #endif @@ -2445,7 +2445,7 @@ gdk_win32_drag_context_get_selection (GdkDragContext *context) case GDK_DRAG_PROTO_OLE2: return _gdk_ole2_dnd; default: - return GDK_NONE; + return NULL; } } diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index 24e778d60e..ff902375e5 100644 --- a/gdk/win32/gdkproperty-win32.c +++ b/gdk/win32/gdkproperty-win32.c @@ -92,7 +92,7 @@ _gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager, ATOM win32_atom; 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_SECONDARY == atom) return g_strdup ("SECONDARY"); else if (GDK_SELECTION_CLIPBOARD == atom) return g_strdup ("CLIPBOARD"); diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c index 9de722691f..9f70386f9f 100644 --- a/gdk/win32/gdkselection-win32.c +++ b/gdk/win32/gdkselection-win32.c @@ -261,7 +261,7 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display, HWND hwnd; GdkEvent tmp_event; - g_return_val_if_fail (selection != GDK_NONE, FALSE); + g_return_val_if_fail (selection != NULL, FALSE); GDK_NOTE (DND, { gchar *sel_name = gdk_atom_name (selection); @@ -336,7 +336,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display, { GdkWindow *window; - g_return_val_if_fail (selection != GDK_NONE, NULL); + g_return_val_if_fail (selection != NULL, NULL); if (selection == GDK_SELECTION_CLIPBOARD) { @@ -394,7 +394,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, HGLOBAL hdata; GdkAtom property = _gdk_selection; - g_return_if_fail (selection != GDK_NONE); + g_return_if_fail (selection != NULL); g_return_if_fail (requestor != NULL); if (GDK_WINDOW_DESTROYED (requestor)) @@ -515,7 +515,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, 32, (guchar *) targets, ntargets * sizeof (GdkAtom)); else - property = GDK_NONE; + property = NULL; } else if (selection == GDK_SELECTION_CLIPBOARD && target == _utf8_string) { @@ -562,7 +562,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, } } else - property = GDK_NONE; + property = NULL; API_CALL (CloseClipboard, ()); } @@ -802,11 +802,11 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, } } else - property = GDK_NONE; + property = NULL; /* Generate a selection notify message so that we actually fetch the * data (if property == _gdk_selection) or indicating failure (if - * property == GDK_NONE). + * property == NULL). */ 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. */ if (encoding) - *encoding = GDK_NONE; + *encoding = NULL; if (format) *format = 0; @@ -1110,7 +1110,7 @@ gdk_utf8_to_compound_text_for_display (GdkDisplay *display, /* Always fail on Win32. No COMPOUND_TEXT support. */ if (encoding) - *encoding = GDK_NONE; + *encoding = NULL; if (format) *format = 0; diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c index b166ba83f0..bba4d4fd34 100644 --- a/gdk/x11/gdkdevice-core-x11.c +++ b/gdk/x11/gdkdevice-core-x11.c @@ -108,8 +108,8 @@ gdk_x11_device_core_init (GdkX11DeviceCore *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, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } static gboolean diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 0a19caae36..aafc040eef 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -192,7 +192,7 @@ translate_valuator_class (GdkDisplay *display, if (valuator_label != None) label = gdk_x11_xatom_to_atom_for_display (display, valuator_label); else - label = GDK_NONE; + label = NULL; _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)")); diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index dad2c23ca8..222432025a 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -2521,7 +2521,7 @@ gdk_x11_drag_context_get_selection (GdkDragContext *context) if (context->protocol == GDK_DRAG_PROTO_XDND) return gdk_atom_intern_static_string ("XdndSelection"); else - return GDK_NONE; + return NULL; } static gboolean diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index 21cecce786..88cbcd2a00 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -74,10 +74,10 @@ lookup_cached_xatom (GdkDisplay *display, /** * gdk_x11_atom_to_xatom_for_display: * @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 - * with the same string value. The special value %GDK_NONE + * with the same string value. The special value %NULL * is converted to %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); - if (atom == GDK_NONE) + if (atom == NULL) return None; if (gdk_display_is_closed (display)) @@ -184,15 +184,15 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display, Atom xatom) { 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) - return GDK_NONE; + return NULL; if (gdk_display_is_closed (display)) - return GDK_NONE; + return NULL; display_x11 = GDK_X11_DISPLAY (display); @@ -379,7 +379,7 @@ _gdk_x11_window_get_property (GdkWindow *window, display = gdk_window_get_display (window); xproperty = gdk_x11_atom_to_xatom_for_display (display, property); - if (type == GDK_NONE) + if (type == NULL) xtype = AnyPropertyType; else xtype = gdk_x11_atom_to_xatom_for_display (display, type); diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c index fe977aef97..ef4602bf1d 100644 --- a/gdk/x11/gdkselection-x11.c +++ b/gdk/x11/gdkselection-x11.c @@ -190,7 +190,7 @@ _gdk_x11_display_convert_selection (GdkDisplay *display, GdkAtom target, 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)) return; @@ -303,7 +303,7 @@ _gdk_x11_display_get_selection_property (GdkDisplay *display, err: if (ret_type) - *ret_type = GDK_NONE; + *ret_type = NULL; if (ret_format) *ret_format = 0; if (data) @@ -343,7 +343,7 @@ _gdk_x11_display_send_selection_notify (GdkDisplay *display, xevent.requestor = GDK_WINDOW_XID (requestor); xevent.selection = gdk_x11_atom_to_xatom_for_display (display, selection); xevent.target = gdk_x11_atom_to_xatom_for_display (display, target); - if (property == GDK_NONE) + if (property == NULL) xevent.property = None; else xevent.property = gdk_x11_atom_to_xatom_for_display (display, property); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index c91ef8e845..84273f4019 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -2061,7 +2061,7 @@ gdk_x11_window_set_modal_hint (GdkWindow *window, if (GDK_WINDOW_IS_MAPPED (window)) gdk_wmspec_change_state (modal, window, gdk_atom_intern_static_string ("_NET_WM_STATE_MODAL"), - GDK_NONE); + NULL); } static void @@ -2082,7 +2082,7 @@ gdk_x11_window_set_skip_taskbar_hint (GdkWindow *window, if (GDK_WINDOW_IS_MAPPED (window)) gdk_wmspec_change_state (skips_taskbar, window, gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"), - GDK_NONE); + NULL); } static void @@ -2103,7 +2103,7 @@ gdk_x11_window_set_skip_pager_hint (GdkWindow *window, if (GDK_WINDOW_IS_MAPPED (window)) gdk_wmspec_change_state (skips_pager, window, gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"), - GDK_NONE); + NULL); } static void @@ -3331,7 +3331,7 @@ gdk_x11_window_iconify (GdkWindow *window) GDK_WINDOW_STATE_ICONIFIED); gdk_wmspec_change_state (TRUE, window, 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_wmspec_change_state (FALSE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"), - GDK_NONE); + NULL); } else { @@ -3357,7 +3357,7 @@ gdk_x11_window_deiconify (GdkWindow *window) 0); gdk_wmspec_change_state (FALSE, window, 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 */ gdk_wmspec_change_state (TRUE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"), - GDK_NONE); + NULL); /* Request desktop 0xFFFFFFFF */ memset (&xclient, 0, sizeof (xclient)); @@ -3421,7 +3421,7 @@ gdk_x11_window_unstick (GdkWindow *window) /* Request unstick from viewport */ gdk_wmspec_change_state (FALSE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"), - GDK_NONE); + NULL); move_to_current_desktop (window); } @@ -3572,7 +3572,7 @@ gdk_x11_window_fullscreen (GdkWindow *window) { gdk_wmspec_change_state (TRUE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), - GDK_NONE); + NULL); /* Actual XRandR layout may have change since we computed the fullscreen * monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode. */ @@ -3612,7 +3612,7 @@ gdk_x11_window_unfullscreen (GdkWindow *window) if (GDK_WINDOW_IS_MAPPED (window)) gdk_wmspec_change_state (FALSE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), - GDK_NONE); + NULL); else gdk_synthesize_window_state (window, @@ -3635,10 +3635,10 @@ gdk_x11_window_set_keep_above (GdkWindow *window, if (setting) gdk_wmspec_change_state (FALSE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"), - GDK_NONE); + NULL); gdk_wmspec_change_state (setting, window, gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"), - GDK_NONE); + NULL); } else gdk_synthesize_window_state (window, @@ -3660,10 +3660,10 @@ gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting) if (setting) gdk_wmspec_change_state (FALSE, window, gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"), - GDK_NONE); + NULL); gdk_wmspec_change_state (setting, window, gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"), - GDK_NONE); + NULL); } else gdk_synthesize_window_state (window, diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 7d4d07de82..aaf2293670 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -2948,7 +2948,7 @@ gtk_calendar_drag_motion (GtkWidget *widget, } 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); else { @@ -2969,7 +2969,7 @@ gtk_calendar_drag_drop (GtkWidget *widget, GdkAtom target; target = gtk_drag_dest_find_target (widget, context, NULL); - if (target != GDK_NONE) + if (target != NULL) { gtk_drag_get_data (widget, context, target, diff --git a/gtk/gtkclipboard-quartz.c b/gtk/gtkclipboard-quartz.c index 46cbca9606..6f0f72d9c0 100644 --- a/gtk/gtkclipboard-quartz.c +++ b/gtk/gtkclipboard-quartz.c @@ -945,7 +945,7 @@ clipboard_peek (GdkDisplay *display, GSList *clipboards; GSList *tmp_list; - if (selection == GDK_NONE) + if (selection == NULL) selection = GDK_SELECTION_CLIPBOARD; clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list"); @@ -1122,7 +1122,7 @@ _gtk_clipboard_store_all (void) GdkAtom 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; } diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index 5379be87da..0eb6c1635b 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -315,7 +315,7 @@ clipboard_display_closed (GdkDisplay *display, * Returns the clipboard object for the given selection. * Cut/copy/paste menu items and keyboard shortcuts should use * 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.) * The currently-selected object or text should be provided on the clipboard * 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 * 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)`. * * See the @@ -995,7 +995,7 @@ gtk_clipboard_request_contents (GtkClipboard *clipboard, gpointer user_data) { 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); GTK_CLIPBOARD_GET_CLASS (clipboard)->request_contents (clipboard, @@ -1428,7 +1428,7 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard, WaitResults results; 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.loop = g_main_loop_new (NULL, TRUE); @@ -1988,7 +1988,7 @@ clipboard_peek (GdkDisplay *display, GSList *clipboards; GSList *tmp_list; - if (selection == GDK_NONE) + if (selection == NULL) selection = GDK_SELECTION_CLIPBOARD; clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list"); @@ -2298,7 +2298,7 @@ _gtk_clipboard_store_all (void) GdkAtom 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; } diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index e6162fbd61..7718989ae1 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -113,7 +113,7 @@ struct _GtkDragFindData guint target_info; GtkSelectionData selection_data; - selection_data.selection = GDK_NONE; + selection_data.selection = NULL; selection_data.data = NULL; selection_data.length = -1; 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); - if (target == GDK_NONE) + if (target == NULL) { gtk_drag_finish (context, FALSE, FALSE, time); return TRUE; @@ -992,8 +992,8 @@ gtk_drag_dest_find_target (GtkWidget *widget, GList *tmp_source = NULL; GList *source_targets; - g_return_val_if_fail (GTK_IS_WIDGET (widget), GDK_NONE); - g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE); + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context); pasteboard = [dragging_info draggingPasteboard]; @@ -1004,7 +1004,7 @@ gtk_drag_dest_find_target (GtkWidget *widget, target_list = gtk_drag_dest_get_target_list (widget); if (target_list == NULL) - return GDK_NONE; + return NULL; source_targets = _gtk_quartz_pasteboard_types_to_atom_list ([pasteboard types]); tmp_target = target_list->list; @@ -1031,7 +1031,7 @@ gtk_drag_dest_find_target (GtkWidget *widget, } g_list_free (source_targets); - return GDK_NONE; + return NULL; } static gboolean diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 3caf43a375..412e57cd46 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -632,7 +632,7 @@ gtk_drag_finish (GdkDragContext *context, gboolean del, guint32 time) { - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; 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"); } - 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))); @@ -1142,7 +1142,7 @@ gtk_drag_dest_drop (GtkWidget *widget, { GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL); - if (target == GDK_NONE) + if (target == NULL) { gtk_drag_finish (context, FALSE, FALSE, time); return TRUE; @@ -1882,7 +1882,7 @@ gtk_drag_drop (GtkDragSourceInfo *info, if (pair->target == target1 || pair->target == target2) { - selection_data.selection = GDK_NONE; + selection_data.selection = NULL; selection_data.target = pair->target; selection_data.data = NULL; selection_data.length = -1; @@ -1926,7 +1926,7 @@ gtk_drag_selection_get (GtkWidget *widget, gpointer data) { GtkDragSourceInfo *info = data; - static GdkAtom null_atom = GDK_NONE; + static GdkAtom null_atom = NULL; guint target_info; if (!null_atom) diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c index ccbc7b6690..fa2ac1b8ad 100644 --- a/gtk/gtkdragdest.c +++ b/gtk/gtkdragdest.c @@ -397,14 +397,14 @@ gtk_drag_dest_get_track_motion (GtkWidget *widget) * * Looks for a match between the supported targets of @context and the * @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 * have different valid targets for different parts of the widget; in * that case, they will have to implement a drag_motion handler that * passes the correct target list to this function. * - * Returns: (transfer none): first target that the source offers - * and the dest can accept, or %GDK_NONE + * Returns: (transfer none) (nullable): first target that the source offers + * and the dest can accept, or %NULL */ GdkAtom gtk_drag_dest_find_target (GtkWidget *widget, @@ -415,15 +415,15 @@ gtk_drag_dest_find_target (GtkWidget *widget, GList *tmp_source = NULL; GtkWidget *source_widget; - g_return_val_if_fail (GTK_IS_WIDGET (widget), GDK_NONE); - g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE); + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); source_widget = gtk_drag_get_source_widget (context); if (target_list == NULL) target_list = gtk_drag_dest_get_target_list (widget); if (target_list == NULL) - return GDK_NONE; + return NULL; tmp_target = target_list->list; while (tmp_target) @@ -447,6 +447,6 @@ gtk_drag_dest_find_target (GtkWidget *widget, tmp_target = tmp_target->next; } - return GDK_NONE; + return NULL; } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 9f5decaf0c..400ac1f05d 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -8870,12 +8870,12 @@ gtk_entry_drag_drop (GtkWidget *widget, { GtkEntry *entry = GTK_ENTRY (widget); GtkEntryPrivate *priv = entry->priv; - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; if (priv->editable) target = gtk_drag_dest_find_target (widget, context, NULL); - if (target != GDK_NONE) + if (target != NULL) gtk_drag_get_data (widget, context, target, time); else 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); 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); suggested_action = gdk_drag_context_get_suggested_action (context); diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 48771e5dc4..2e073e6224 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -6003,7 +6003,7 @@ set_destination (GtkIconView *icon_view, widget = GTK_WIDGET (icon_view); *suggested_action = 0; - *target = GDK_NONE; + *target = NULL; if (!icon_view->priv->dest_set) { @@ -6022,7 +6022,7 @@ set_destination (GtkIconView *icon_view, *target = gtk_drag_dest_find_target (widget, context, gtk_drag_dest_get_target_list (widget)); - if (*target == GDK_NONE) + if (*target == NULL) return FALSE; 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; GtkTreePath *path; GdkDragAction suggested_action = 0; - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; GtkTreeModel *model; gboolean drop_append_mode; @@ -6439,7 +6439,7 @@ gtk_icon_view_drag_drop (GtkWidget *widget, 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 * treat drag data receives as a drop. @@ -6455,7 +6455,7 @@ gtk_icon_view_drag_drop (GtkWidget *widget, /* Unset this thing */ 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); return TRUE; diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index e758d2a1ec..c49ea3b019 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -1635,7 +1635,7 @@ get_drag_data (GtkWidget *list_box, target = gtk_drag_dest_find_target (list_box, context, NULL); - if (target == GDK_NONE) + if (target == NULL) return FALSE; 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 (gtk_selection_data_get_target (selection_data) != GDK_NONE && + if (gtk_selection_data_get_target (selection_data) != NULL && info == DND_TEXT_URI_LIST) { gchar **uris; diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index c72f695dc0..8d6f503aa1 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -733,7 +733,7 @@ gtk_selection_owner_set_for_display (GdkDisplay *display, GdkWindow *window; 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_display (widget) == display, FALSE); @@ -826,7 +826,7 @@ gtk_selection_owner_set (GtkWidget *widget, GdkDisplay *display; 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) display = gtk_widget_get_display (widget); @@ -919,7 +919,7 @@ gtk_selection_clear_targets (GtkWidget *widget, GList *lists; 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); @@ -963,7 +963,7 @@ gtk_selection_add_target (GtkWidget *widget, GtkTargetList *list; 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); gtk_target_list_add (list, target, 0, info); @@ -990,7 +990,7 @@ gtk_selection_add_targets (GtkWidget *widget, guint n_targets; 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); list = gtk_selection_target_list_get (widget, selection); @@ -1092,7 +1092,7 @@ gtk_selection_convert (GtkWidget *widget, guint id; 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) gtk_selection_init (); @@ -2449,7 +2449,7 @@ _gtk_selection_request (GtkWidget *widget, mult_atoms = NULL; 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, &type, &format, &length, &mult_atoms)) { @@ -2457,7 +2457,7 @@ _gtk_selection_request (GtkWidget *widget, requestor, selection, target, - GDK_NONE, + NULL, time); g_free (mult_atoms); g_slice_free (GtkIncrInfo, info); @@ -2534,7 +2534,7 @@ _gtk_selection_request (GtkWidget *widget, gtk_selection_invoke_handler (widget, &data, time); if (data.length < 0) { - info->conversions[i].property = GDK_NONE; + info->conversions[i].property = NULL; continue; } @@ -2625,14 +2625,14 @@ _gtk_selection_request (GtkWidget *widget, } if (info->num_conversions == 1 && - info->conversions[0].property == GDK_NONE) + info->conversions[0].property == NULL) { /* Reject the entire conversion */ gdk_selection_send_notify_for_display (gtk_widget_get_display (widget), requestor, selection, target, - GDK_NONE, + NULL, time); } else @@ -2885,18 +2885,18 @@ _gtk_selection_notify (GtkWidget *widget, if (!tmp_list) /* no retrieval in progress */ return FALSE; - if (property != GDK_NONE) + if (property != NULL) length = gdk_selection_property_get (window, &buffer, &type, &format); else 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); g_list_free (tmp_list); /* 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; } @@ -3002,15 +3002,15 @@ _gtk_selection_property_notify (GtkWidget *widget, doing memory allocation at every step. But its only guaranteed to 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 */ current_retrievals = g_list_remove_link (current_retrievals, tmp_list); g_list_free (tmp_list); gtk_selection_retrieval_report (info, type, format, - (type == GDK_NONE) ? NULL : info->buffer, - (type == GDK_NONE) ? -1 : info->offset, + (type == NULL) ? NULL : info->buffer, + (type == NULL) ? -1 : info->offset, info->notify_time); } 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); 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); diff --git a/gtk/gtktextbufferrichtext.c b/gtk/gtktextbufferrichtext.c index 110f182dc6..4286d8b846 100644 --- a/gtk/gtktextbufferrichtext.c +++ b/gtk/gtktextbufferrichtext.c @@ -79,9 +79,9 @@ gtk_text_buffer_register_serialize_format (GtkTextBuffer *buffer, GList *formats; GdkAtom atom; - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); - g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', GDK_NONE); - g_return_val_if_fail (function != NULL, GDK_NONE); + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); + g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', NULL); + g_return_val_if_fail (function != NULL, NULL); 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; GdkAtom format; - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); - g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', GDK_NONE); + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); + g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', NULL); if (tagset_name) { @@ -182,9 +182,9 @@ gtk_text_buffer_register_deserialize_format (GtkTextBuffer *buffe GList *formats; GdkAtom atom; - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); - g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', GDK_NONE); - g_return_val_if_fail (function != NULL, GDK_NONE); + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); + g_return_val_if_fail (mime_type != NULL && *mime_type != '\0', NULL); + g_return_val_if_fail (function != NULL, NULL); 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; GdkAtom format; - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), GDK_NONE); - g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', GDK_NONE); + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); + g_return_val_if_fail (tagset_name == NULL || *tagset_name != '\0', NULL); if (tagset_name) { @@ -263,7 +263,7 @@ gtk_text_buffer_unregister_serialize_format (GtkTextBuffer *buffer, GList *formats; 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 ()); @@ -293,7 +293,7 @@ gtk_text_buffer_unregister_deserialize_format (GtkTextBuffer *buffer, GList *formats; 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 ()); @@ -341,7 +341,7 @@ gtk_text_buffer_deserialize_set_can_create_tags (GtkTextBuffer *buffer, gchar *format_name; 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 ()); @@ -384,7 +384,7 @@ gtk_text_buffer_deserialize_get_can_create_tags (GtkTextBuffer *buffer, gchar *format_name; 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 ()); @@ -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 (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 (end != 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 (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 (data != NULL, FALSE); g_return_val_if_fail (length > 0, FALSE); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index f322a204b6..613e95bde8 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -7970,7 +7970,7 @@ gtk_text_view_drag_motion (GtkWidget *widget, target = gtk_drag_dest_find_target (widget, context, gtk_drag_dest_get_target_list (widget)); - if (target == GDK_NONE) + if (target == NULL) { /* can't accept any of the offered targets */ } @@ -8048,7 +8048,7 @@ gtk_text_view_drag_drop (GtkWidget *widget, GtkTextView *text_view; GtkTextViewPrivate *priv; GtkTextIter drop_point; - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; text_view = GTK_TEXT_VIEW (widget); 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)) target = gtk_drag_dest_find_target (widget, context, NULL); - if (target != GDK_NONE) + if (target != NULL) gtk_drag_get_data (widget, context, target, time); else gtk_drag_finish (context, FALSE, FALSE, time); @@ -8154,7 +8154,7 @@ gtk_text_view_drag_data_received (GtkWidget *widget, GdkAtom *atoms; gint n_atoms; GList *list; - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; copy_tags = FALSE; @@ -8174,7 +8174,7 @@ gtk_text_view_drag_data_received (GtkWidget *widget, g_free (atoms); - if (target != GDK_NONE) + if (target != NULL) { gtk_drag_get_data (widget, context, target, time); gtk_text_buffer_end_user_action (buffer); diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index b2d85c3f18..3e784f0802 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -181,8 +181,8 @@ struct _GtkToolPaletteDragData GtkWidget *item; }; -static GdkAtom dnd_target_atom_item = GDK_NONE; -static GdkAtom dnd_target_atom_group = GDK_NONE; +static GdkAtom dnd_target_atom_item = NULL; +static GdkAtom dnd_target_atom_group = NULL; 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); - 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_group = gdk_atom_intern_static_string (dnd_targets[1].target); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index d623415cfa..c0c082ba5d 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -7258,7 +7258,7 @@ set_destination_row (GtkTreeView *tree_view, gboolean can_drop = FALSE; *suggested_action = 0; - *target = GDK_NONE; + *target = NULL; widget = GTK_WIDGET (tree_view); @@ -7282,7 +7282,7 @@ set_destination_row (GtkTreeView *tree_view, *target = gtk_drag_dest_find_target (widget, context, gtk_drag_dest_get_target_list (widget)); - if (*target == GDK_NONE) + if (*target == NULL) { return FALSE; } @@ -7755,7 +7755,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget, GtkTreeView *tree_view; GtkTreePath *path; GdkDragAction suggested_action = 0; - GdkAtom target = GDK_NONE; + GdkAtom target = NULL; TreeViewDragInfo *di; GtkTreeModel *model; 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); - if (target != GDK_NONE && path != NULL) + if (target != NULL && path != NULL) { /* in case a motion had requested drag data, change things so we * treat drag data receives as a drop. @@ -7800,7 +7800,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget, NULL, GTK_TREE_VIEW_DROP_BEFORE); - if (target != GDK_NONE) + if (target != NULL) { gtk_drag_get_data (widget, context, target, time); return TRUE; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index df727ddca1..ac09c77de9 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2754,7 +2754,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) * } * * target = gtk_drag_dest_find_target (widget, context, NULL); - * if (target == GDK_NONE) + * if (target == NULL) * gdk_drag_status (context, 0, time); * else * { diff --git a/tests/testgtk.c b/tests/testgtk.c index 4aaba2dd1d..254a5dd72e 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -7102,7 +7102,7 @@ selection_test_received (GtkWidget *tree_view, void 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) { @@ -7110,7 +7110,7 @@ selection_test_get_targets (GtkWidget *dialog, gint response, GtkWidget *tree_vi return; } - if (targets_atom == GDK_NONE) + if (targets_atom == NULL) targets_atom = gdk_atom_intern ("TARGETS", FALSE); gtk_selection_convert (tree_view, GDK_SELECTION_PRIMARY, targets_atom, diff --git a/tests/testselection.c b/tests/testselection.c index c6a8e41d8a..67b213faa2 100644 --- a/tests/testselection.c +++ b/tests/testselection.c @@ -114,7 +114,7 @@ init_atoms (void) { int i; - seltypes[SEL_TYPE_NONE] = GDK_NONE; + seltypes[SEL_TYPE_NONE] = NULL; seltypes[APPLE_PICT] = gdk_atom_intern ("APPLE_PICT",FALSE); seltypes[ATOM] = gdk_atom_intern ("ATOM",FALSE); seltypes[ATOM_PAIR] = gdk_atom_intern ("ATOM_PAIR",FALSE); @@ -167,7 +167,7 @@ selection_get (GtkWidget *widget, { guchar *buffer; gint len; - GdkAtom type = GDK_NONE; + GdkAtom type = NULL; if (!selection_string) { @@ -368,7 +368,7 @@ paste (GtkWidget *dialog, gint response, GtkWidget *entry) name = gtk_entry_get_text (GTK_ENTRY(entry)); atom = gdk_atom_intern (name, FALSE); - if (atom == GDK_NONE) + if (atom == NULL) { g_print("Could not create atom: \"%s\"\n",name); return; |