gdk: Get rid of gdk_event_free()

Events are objects, so use g_object_unref().
This commit is contained in:
Benjamin Otte 2018-05-29 21:53:44 +02:00
parent d424837496
commit 7e574fa98c
17 changed files with 28 additions and 45 deletions

View File

@ -119,7 +119,7 @@ day_selected_cb (GtkCalendar *calendar,
gtk_widget_show (popover);
gdk_event_free (event);
g_object_unref (event);
}
GtkWidget *

View File

@ -627,7 +627,6 @@ GDK_BUTTON_SECONDARY
<SUBSECTION>
gdk_event_new
gdk_event_copy
gdk_event_free
gdk_event_get_axes
gdk_event_get_button
gdk_event_get_click_count

View File

@ -383,7 +383,7 @@ gdk_event_source_dispatch (GSource *source,
{
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
}
return TRUE;

View File

@ -39,7 +39,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSurface, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)

View File

@ -376,7 +376,7 @@ gdk_display_dispose (GObject *object)
_gdk_display_manager_remove_display (gdk_display_manager_get (), display);
g_list_free_full (display->queued_events, (GDestroyNotify) gdk_event_free);
g_list_free_full (display->queued_events, (GDestroyNotify) g_object_unref);
display->queued_events = NULL;
display->queued_tail = NULL;

View File

@ -419,7 +419,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
GDK_BUTTON4_MASK | GDK_BUTTON5_MASK)))
gdk_event_push_history (last_motion, pending_motions->data);
gdk_event_free (pending_motions->data);
g_object_unref (pending_motions->data);
display->queued_events = g_list_delete_link (display->queued_events,
pending_motions);
pending_motions = next;
@ -694,20 +694,6 @@ gdk_event_copy (const GdkEvent *event)
return new_event;
}
/**
* gdk_event_free:
* @event: a #GdkEvent.
*
* Frees a #GdkEvent, freeing or decrementing any resources associated with it.
*
* This is equivalent to g_object_unref().
*/
void
gdk_event_free (GdkEvent *event)
{
g_object_unref (event);
}
void
gdk_event_finalize (GObject *object)
{

View File

@ -377,8 +377,6 @@ GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_new (GdkEventType type);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_copy (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_event_free (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkSurface *gdk_event_get_surface (const GdkEvent *event);

View File

@ -1706,7 +1706,7 @@ gdk_surface_process_updates_recurse (GdkSurface *surface,
event->expose.region = cairo_region_reference (expose_region);
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
}
/* Process and remove any invalid area on the native surface by creating
@ -4343,7 +4343,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
{
_gdk_event_queue_remove_link (display, event_link);
g_list_free_1 (event_link);
gdk_event_free (event);
g_object_unref (event);
}
/* This does two things - first it sees if there are motions at the

View File

@ -602,7 +602,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
return NSDragOperationNone;
}
@ -633,7 +633,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
g_object_unref (current_context);
current_context = NULL;
@ -662,7 +662,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
return drag_action_to_drag_operation (current_context->action);
}
@ -690,7 +690,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
g_object_unref (current_context);
current_context = NULL;
@ -749,7 +749,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
g_object_unref (_gdk_quartz_drag_source_context);
_gdk_quartz_drag_source_context = NULL;

View File

@ -685,7 +685,7 @@ gdk_event_dispatch (GSource *source,
{
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
}
return TRUE;

View File

@ -1726,7 +1726,7 @@ _gdk_quartz_display_queue_events (GdkDisplay *display)
{
_gdk_event_queue_remove_link (display, node);
g_list_free_1 (node);
gdk_event_free (event);
g_object_unref (event);
[NSApp sendEvent:nsevent];
}

View File

@ -1781,7 +1781,7 @@ local_send_leave (GdkDragContext *context,
GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event));
_gdk_display_put_event (gdk_device_get_display (gdk_drag_context_get_device (context)), tmp_event);
gdk_event_free (tmp_event);
g_object_unref (tmp_event);
}
}
@ -1825,7 +1825,7 @@ local_send_motion (GdkDragContext *context,
GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event));
_gdk_display_put_event (gdk_device_get_display (gdk_drag_context_get_device (context)), tmp_event);
gdk_event_free (tmp_event);
g_object_unref (tmp_event);
}
}
@ -1861,7 +1861,7 @@ local_send_drop (GdkDragContext *context,
GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event));
_gdk_display_put_event (gdk_device_get_display (gdk_drag_context_get_device (context)), tmp_event);
gdk_event_free (tmp_event);
g_object_unref (tmp_event);
}
}

View File

@ -343,7 +343,7 @@ dnd_event_emit (GdkEventType type,
GDK_NOTE (EVENTS, _gdk_win32_print_event (e));
_gdk_event_emit (e);
gdk_event_free (e);
g_object_unref (e);
}
static GdkContentFormats *
@ -833,12 +833,12 @@ gdk_dropfiles_filter (GdkWin32Display *display,
GDK_NOTE (EVENTS, _gdk_win32_print_event (event));
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
DragFinish (hdrop);
gdk_display_put_event (display, event);
gdk_event_free (event);
g_object_unref (event);
*ret_valp = 0;
@ -1244,7 +1244,7 @@ _gdk_win32_local_send_enter (GdkDragContext *context,
GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event));
_gdk_display_put_event (gdk_device_get_display (gdk_drag_context_get_device (context)), tmp_event);
gdk_event_free (tmp_event);
g_object_unref (tmp_event);
}
void

View File

@ -3728,7 +3728,7 @@ gdk_event_translate (MSG *msg,
if (gdk_input_other_event (display, event, msg, window))
_gdk_win32_append_event (event);
else
gdk_event_free (event);
g_object_unref (event);
break;
}
@ -3809,7 +3809,7 @@ gdk_event_dispatch (GSource *source,
{
_gdk_event_emit (event);
gdk_event_free (event);
g_object_unref (event);
}
return TRUE;

View File

@ -51,7 +51,7 @@ _gdk_x11_event_translator_translate (GdkEventTranslator *translator,
if ((iface->translate_event) (translator, display, event, xevent))
return event;
gdk_event_free (event);
g_object_unref (event);
return NULL;
}

View File

@ -251,7 +251,7 @@ gtk_entry_icon_accessible_do_action (AtkAction *action,
event->button.y = icon_area.y;
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, event);
gdk_event_free (event);
g_object_unref (event);
return TRUE;
}

View File

@ -61,7 +61,7 @@ point_press (PointState *point,
gtk_main_do_event (ev);
gdk_event_free (ev);
g_object_unref (ev);
point->widget = widget;
}
@ -114,7 +114,7 @@ point_update (PointState *point,
gtk_main_do_event (ev);
gdk_event_free (ev);
g_object_unref (ev);
}
static void
@ -168,7 +168,7 @@ point_release (PointState *point,
gtk_main_do_event (ev);
gdk_event_free (ev);
g_object_unref (ev);
}
static const gchar *