gdk: Dissolve gdk-autocleanup.h
authorMatthias Clasen <mclasen@redhat.com>
Fri, 23 Sep 2022 23:08:25 +0000 (19:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 23 Sep 2022 23:49:58 +0000 (19:49 -0400)
Move the autocleanup declarations into their
respective headers.

While we are at it, correct the autocleanup
declaration for GdkEvent to use gdk_event_unref,
not g_object_unref. Oops

27 files changed:
gdk/gdk-autocleanup.h [deleted file]
gdk/gdk.h
gdk/gdkapplaunchcontext.h
gdk/gdkclipboard.h
gdk/gdkcontentformats.h
gdk/gdkcontentprovider.h
gdk/gdkcursor.h
gdk/gdkdevice.h
gdk/gdkdisplay.h
gdk/gdkdisplaymanager.h
gdk/gdkdrag.h
gdk/gdkdrawcontext.h
gdk/gdkdrop.h
gdk/gdkevents.h
gdk/gdkframeclock.h
gdk/gdkframetimings.h
gdk/gdkglcontext.h
gdk/gdkgltexture.h
gdk/gdkmonitor.h
gdk/gdkpopuplayout.h
gdk/gdkrgba.h
gdk/gdkseat.h
gdk/gdksnapshot.h
gdk/gdktexture.h
gdk/gdktoplevellayout.h
gdk/gdkvulkancontext.h
gdk/meson.build

diff --git a/gdk/gdk-autocleanup.h b/gdk/gdk-autocleanup.h
deleted file mode 100644 (file)
index a7c8586..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#ifndef __GI_SCANNER__
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
-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)
-
-#endif
index 37bac5adc25c9cfc5281cf2b23aa431f5c0bbb82..a91ec39f45a5ce7b9c3260fe13269df3eba23661 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -76,8 +76,6 @@
 #include <gdk/gdkversionmacros.h>
 #include <gdk/gdkvulkancontext.h>
 
-#include <gdk/gdk-autocleanup.h>
-
 #undef __GDK_H_INSIDE__
 
 #endif /* __GDK_H__ */
index 23178483a0e1c7e067d366c6936f3c827a1c470e..b8e15a752e9dcabccd4da55e2477da24e2dee668 100644 (file)
@@ -54,6 +54,7 @@ GDK_AVAILABLE_IN_ALL
 void                 gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
                                                            const char          *icon_name);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
 
 G_END_DECLS
 
index f3b6bba1cc41bc47d012b3ec50fb999f0b69b074..f8f4178d5ed90456a3fd1cbbe678f1fde414bd51 100644 (file)
@@ -120,6 +120,8 @@ GDK_AVAILABLE_IN_ALL
 void                    gdk_clipboard_set_texture       (GdkClipboard          *clipboard,
                                                          GdkTexture            *texture);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_CLIPBOARD_H__ */
index e37238f1be5f68bef0cb4fd27f654ac28ca9a924..3fd1657675ea23436e6f110ed0e1e4980f7f8a96 100644 (file)
@@ -106,6 +106,8 @@ GDK_AVAILABLE_IN_ALL
 void                    gdk_content_formats_builder_add_gtype   (GdkContentFormatsBuilder       *builder,
                                                                  GType                           type);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
+
 /* dunno where else to put this */
 #define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
 GDK_AVAILABLE_IN_ALL
index d9c6370fedd2dcdc09cf3f4badfc25b5888b6bfa..f3e40c4ce3e4fbc6a5e76242427d9221b953fc83 100644 (file)
@@ -111,6 +111,9 @@ GDK_AVAILABLE_IN_ALL
 gboolean                gdk_content_provider_get_value                  (GdkContentProvider     *provider,
                                                                          GValue                 *value,
                                                                          GError                **error);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_CONTENT_PROVIDER_H__ */
index 1a0ea5d772f3e9f4f68883659f7cb9d5ddca6de6..66de6e531b18f92c410764755023f46c7f2b08b5 100644 (file)
@@ -64,6 +64,7 @@ int         gdk_cursor_get_hotspot_x     (GdkCursor       *cursor);
 GDK_AVAILABLE_IN_ALL
 int         gdk_cursor_get_hotspot_y     (GdkCursor       *cursor);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
 
 G_END_DECLS
 
index c24c0846318b5c246356d6482dcc8b0acac72114..dbf29147e493803273efb756f39c3ad5000e1f06 100644 (file)
@@ -126,6 +126,9 @@ GdkSurface *        gdk_device_get_surface_at_position  (GdkDevice *device,
 
 GDK_AVAILABLE_IN_4_2
 guint32             gdk_device_get_timestamp            (GdkDevice *device);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_DEVICE_H__ */
index 52aa502247af01fe1139bdbe250247560ed736f2..c3b1c49469d06d311a4be566b164ef71191725b5 100644 (file)
@@ -136,7 +136,7 @@ gboolean     gdk_display_get_setting (GdkDisplay *display,
                                       const char *name,
                                       GValue     *value);
 
-
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
 
 G_END_DECLS
 
index d7cbb649af189592a8577d569188f0b23d9ff7f4..c6ed7f34ad90a71f075f08ef1b59e209f9dc476a 100644 (file)
@@ -34,7 +34,6 @@
 
 G_BEGIN_DECLS
 
-
 #define GDK_TYPE_DISPLAY_MANAGER              (gdk_display_manager_get_type ())
 #define GDK_DISPLAY_MANAGER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManager))
 #define GDK_IS_DISPLAY_MANAGER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
@@ -58,6 +57,7 @@ GdkDisplay *       gdk_display_manager_open_display        (GdkDisplayManager *m
 GDK_AVAILABLE_IN_ALL
 void               gdk_set_allowed_backends                (const char        *backends);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
 
 G_END_DECLS
 
index da1e7a335445d5dcb17d5ab7cd2688f703a64cdf..0eb865a2eed794759ee305217e5dad0a6356e496 100644 (file)
@@ -99,6 +99,8 @@ GdkContentProvider *
 GDK_AVAILABLE_IN_ALL
 GdkSurface *    gdk_drag_get_surface (GdkDrag *drag);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_DND_H__ */
index e818ddd62d95b5c7e082f83596938c47aa21fb9f..e255c059e0dcf93380f7cc7cf92b175d45104ff4 100644 (file)
@@ -52,6 +52,8 @@ gboolean                gdk_draw_context_is_in_frame            (GdkDrawContext
 GDK_AVAILABLE_IN_ALL
 const cairo_region_t *  gdk_draw_context_get_frame_region       (GdkDrawContext         *context);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_DRAW_CONTEXT__ */
index 0b57e049767ab623dbb14e438cdc052f8d0be85f..6ce0e95ae3d0152a075a193729073b854de153b5 100644 (file)
@@ -31,8 +31,6 @@
 
 G_BEGIN_DECLS
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
-
 #define GDK_TYPE_DROP              (gdk_drop_get_type ())
 #define GDK_DROP(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DROP, GdkDrop))
 #define GDK_IS_DROP(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DROP))
@@ -85,6 +83,8 @@ const GValue *          gdk_drop_read_value_finish      (GdkDrop
                                                          GAsyncResult           *result,
                                                          GError                **error);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_DROP_H__ */
index 21259f172d5b982f2ce704accf1266ed1c60f010..f2b6748bfa66f78558f8d1a114913fa41ec8da7a 100644 (file)
@@ -38,7 +38,6 @@
 
 G_BEGIN_DECLS
 
-
 #define GDK_TYPE_EVENT          (gdk_event_get_type ())
 #define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
 
@@ -551,6 +550,9 @@ gboolean               gdk_key_event_get_match (GdkEvent        *event,
                                                 guint           *keyval,
                                                 GdkModifierType *modifiers);
 
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_EVENTS_H__ */
index 2579fee329a974c4a58e924a6dd9f12e46eb905d..6a1013f675b7469dbdd8d45fa5b4c28549f77ec3 100644 (file)
@@ -106,6 +106,8 @@ void gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
 GDK_AVAILABLE_IN_ALL
 double gdk_frame_clock_get_fps (GdkFrameClock *frame_clock);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_FRAME_CLOCK_H__ */
index 7ed36301b50f9c39eb445a67e8cc9952488c38ef..0bf7822ac2f6e2040ea0701d98b4ce957ee954dc 100644 (file)
@@ -51,6 +51,8 @@ gint64           gdk_frame_timings_get_refresh_interval  (GdkFrameTimings *timin
 GDK_AVAILABLE_IN_ALL
 gint64           gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_FRAME_TIMINGS_H__ */
index 5201f93cb12ec04655996b4289c60a3d4d7b4016..777bfd0117084b60f24d60c0241a09f9b71ffedf 100644 (file)
@@ -114,6 +114,8 @@ GdkGLContext *          gdk_gl_context_get_current              (void);
 GDK_AVAILABLE_IN_ALL
 void                    gdk_gl_context_clear_current            (void);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_GL_CONTEXT_H__ */
index 54e4fee7e7ed631e4d2d5566094490059cc2abfd..a692ebdd2433223b7353b171a155564d7abdb3c9 100644 (file)
@@ -36,8 +36,6 @@ G_BEGIN_DECLS
 typedef struct _GdkGLTexture            GdkGLTexture;
 typedef struct _GdkGLTextureClass       GdkGLTextureClass;
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
-
 GDK_AVAILABLE_IN_ALL
 GType                   gdk_gl_texture_get_type                (void) G_GNUC_CONST;
 
@@ -52,6 +50,7 @@ GdkTexture *            gdk_gl_texture_new                     (GdkGLContext
 GDK_AVAILABLE_IN_ALL
 void                    gdk_gl_texture_release                 (GdkGLTexture    *self);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
 
 G_END_DECLS
 
index 31f1cd148c0ed744a501f21ea8a3bac3ca7e270a..f42c999c959da3ec00d6e1503733c4d95e84e8d0 100644 (file)
@@ -87,6 +87,8 @@ GdkSubpixelLayout gdk_monitor_get_subpixel_layout (GdkMonitor   *monitor);
 GDK_AVAILABLE_IN_ALL
 gboolean          gdk_monitor_is_valid            (GdkMonitor   *monitor);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
+
 G_END_DECLS
 
 #endif  /* __GDK_MONITOR_H__ */
index b2ad4ebb58aaa786afd93ef93e7c32ee486fae3e..1243323416fe7470dca81ddc39422ea4e5fb487e 100644 (file)
@@ -146,6 +146,7 @@ void                    gdk_popup_layout_get_shadow_width       (GdkPopupLayout
                                                                  int                *top,
                                                                  int                *bottom);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
 
 G_END_DECLS
 
index 5fe5b869512a783f19861bb25cbad999d13b5e2f..4ecb4b78057d0a1e4d7fd21f54197089e1213bb7 100644 (file)
@@ -69,6 +69,7 @@ gboolean  gdk_rgba_parse     (GdkRGBA       *rgba,
 GDK_AVAILABLE_IN_ALL
 char *   gdk_rgba_to_string (const GdkRGBA *rgba) G_GNUC_MALLOC;
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
 
 G_END_DECLS
 
index 97739dc6f5e9ef95c245c4f003183f0a5e40823d..45cb9ab64f3a011fc90b993e4e294e8397124d71 100644 (file)
@@ -86,6 +86,8 @@ GdkDevice *    gdk_seat_get_pointer             (GdkSeat             *seat);
 GDK_AVAILABLE_IN_ALL
 GdkDevice *    gdk_seat_get_keyboard            (GdkSeat             *seat);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_SEAT_H__ */
index e609ea38071e412dabba345e7753088e7361d60f..615219c69af9b1218ffe02713071b305d032356e 100644 (file)
@@ -29,7 +29,6 @@
 
 G_BEGIN_DECLS
 
-
 typedef struct _GdkSnapshotClass        GdkSnapshotClass;
 
 #define GDK_TYPE_SNAPSHOT               (gdk_snapshot_get_type ())
@@ -37,11 +36,10 @@ typedef struct _GdkSnapshotClass        GdkSnapshotClass;
 #define GDK_SNAPSHOT(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_SNAPSHOT, GdkSnapshot))
 #define GDK_IS_SNAPSHOT(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_SNAPSHOT))
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSnapshot, g_object_unref)
-
 GDK_AVAILABLE_IN_ALL
 GType           gdk_snapshot_get_type   (void) G_GNUC_CONST;
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSnapshot, g_object_unref)
 
 G_END_DECLS
 
index 531ae3bbded382b22fee3fe908dd81777cb21f10..8ce4bae5b2cf83e7b718a45652175a11c32ae644 100644 (file)
@@ -34,8 +34,6 @@ G_BEGIN_DECLS
 #define GDK_TEXTURE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_TEXTURE, GdkTexture))
 #define GDK_IS_TEXTURE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_TEXTURE))
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkTexture, g_object_unref)
-
 typedef struct _GdkTextureClass        GdkTextureClass;
 
 #define GDK_TEXTURE_ERROR       (gdk_texture_error_quark ())
@@ -100,6 +98,8 @@ gboolean                gdk_texture_save_to_tiff               (GdkTexture
 GDK_AVAILABLE_IN_4_6
 GBytes *                gdk_texture_save_to_tiff_bytes         (GdkTexture      *texture);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkTexture, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_TEXTURE_H__ */
index 872581e0c69569dab319d30364aff374c4535196..f1a6dc457ac6f59ff83f0200a4b1fe9523d17235 100644 (file)
@@ -78,6 +78,8 @@ void                    gdk_toplevel_layout_set_resizable (GdkToplevelLayout *la
 GDK_AVAILABLE_IN_ALL
 gboolean                gdk_toplevel_layout_get_resizable (GdkToplevelLayout *layout);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkToplevelLayout, gdk_toplevel_layout_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_TOPLEVEL_LAYOUT_H__ */
index 7b184b81e93ad0f61b329fe5d52faad7348a3b09..8f2214f3c3d11502430b2e4b8944affe4a39ac8a 100644 (file)
@@ -77,6 +77,8 @@ VkSemaphore             gdk_vulkan_context_get_draw_semaphore       (GdkVulkanCo
 #endif /* GDK_RENDERING_VULKAN */
 #endif /* __GI_SCANNER__ */
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GDK_VULKAN_CONTEXT__ */
index f119fadf9d8d78ab5223a81e726ccac11d27f2fe..6079e821bc1ce6d8fb3c374bc37184e2810a9031 100644 (file)
@@ -58,7 +58,6 @@ gdk_public_sources = files([
 ])
 
 gdk_public_headers = files([
-  'gdk-autocleanup.h',
   'gdk.h',
   'gdkapplaunchcontext.h',
   'gdkcairo.h',