[gtksourceview/wip/chergert/gsv-gtk4: 28/118] map: modernize GtkSourceMap
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/gsv-gtk4: 28/118] map: modernize GtkSourceMap
- Date: Wed, 29 Jan 2020 18:59:53 +0000 (UTC)
commit 31bb171427bc8b6a915cf43bf07e2a0d00154997
Author: Christian Hergert <chergert redhat com>
Date: Thu Jan 9 09:52:38 2020 -0800
map: modernize GtkSourceMap
- Use G_DECLARE_ macros
gtksourceview/gtksourceautocleanups.h | 1 -
gtksourceview/gtksourcemap.h | 32 +++++++++-----------------------
2 files changed, 9 insertions(+), 24 deletions(-)
---
diff --git a/gtksourceview/gtksourceautocleanups.h b/gtksourceview/gtksourceautocleanups.h
index 7f6959b7..919b484f 100644
--- a/gtksourceview/gtksourceautocleanups.h
+++ b/gtksourceview/gtksourceautocleanups.h
@@ -28,7 +28,6 @@ G_BEGIN_DECLS
#ifndef __GI_SCANNER__
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSourceMap, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSourcePrintCompositor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSourceSearchContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSourceSearchSettings, g_object_unref)
diff --git a/gtksourceview/gtksourcemap.h b/gtksourceview/gtksourcemap.h
index d22d85a8..5de357ac 100644
--- a/gtksourceview/gtksourcemap.h
+++ b/gtksourceview/gtksourcemap.h
@@ -29,39 +29,25 @@
G_BEGIN_DECLS
-#define GTK_SOURCE_TYPE_MAP (gtk_source_map_get_type())
-#define GTK_SOURCE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_MAP,
GtkSourceMap))
-#define GTK_SOURCE_MAP_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_MAP, GtkSourceMap
const))
-#define GTK_SOURCE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_SOURCE_TYPE_MAP,
GtkSourceMapClass))
-#define GTK_SOURCE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_SOURCE_TYPE_MAP))
-#define GTK_SOURCE_IS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_SOURCE_TYPE_MAP))
-#define GTK_SOURCE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_SOURCE_TYPE_MAP,
GtkSourceMapClass))
+#define GTK_SOURCE_TYPE_MAP (gtk_source_map_get_type())
-typedef struct _GtkSourceMapClass GtkSourceMapClass;
-
-struct _GtkSourceMap
-{
- GtkSourceView parent_instance;
-};
+GTK_SOURCE_AVAILABLE_IN_3_18
+G_DECLARE_DERIVABLE_TYPE (GtkSourceMap, gtk_source_map, GTK_SOURCE, MAP, GtkSourceView)
struct _GtkSourceMapClass
{
GtkSourceViewClass parent_class;
- gpointer padding[10];
+ /*< private >*/
+ gpointer _reserved[10];
};
GTK_SOURCE_AVAILABLE_IN_3_18
-GType gtk_source_map_get_type (void);
-
-GTK_SOURCE_AVAILABLE_IN_3_18
-GtkWidget *gtk_source_map_new (void);
-
+GtkWidget *gtk_source_map_new (void);
GTK_SOURCE_AVAILABLE_IN_3_18
-void gtk_source_map_set_view (GtkSourceMap *map,
- GtkSourceView *view);
-
+void gtk_source_map_set_view (GtkSourceMap *map,
+ GtkSourceView *view);
GTK_SOURCE_AVAILABLE_IN_3_18
-GtkSourceView *gtk_source_map_get_view (GtkSourceMap *map);
+GtkSourceView *gtk_source_map_get_view (GtkSourceMap *map);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]