[gtksourceview/wip/chergert/gsv-gtk4: 76/192] style: use G_DECLARE_FINAL_TYPE()




commit 11c42fd2cb1c1739620abffbd1ed7d18c0ab7dcf
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 9 15:05:48 2020 -0800

    style: use G_DECLARE_FINAL_TYPE()
    
    The GtkSourceStyle class was already effectively final.

 gtksourceview/gtksourcestyle.c | 38 ++++++++++++++++----------------------
 gtksourceview/gtksourcestyle.h | 18 +++++-------------
 2 files changed, 21 insertions(+), 35 deletions(-)
---
diff --git a/gtksourceview/gtksourcestyle.c b/gtksourceview/gtksourcestyle.c
index e35dbca73..65048c84c 100644
--- a/gtksourceview/gtksourcestyle.c
+++ b/gtksourceview/gtksourcestyle.c
@@ -33,20 +33,14 @@
  * which are set when given style is used.
  */
 
-static void    gtk_source_style_set_property   (GObject      *object,
-                                                guint         prop_id,
-                                                const GValue *value,
-                                                GParamSpec   *pspec);
-
-static void    gtk_source_style_get_property   (GObject      *object,
-                                                guint         prop_id,
-                                                GValue       *value,
-                                                GParamSpec   *pspec);
-
-struct _GtkSourceStyleClass
-{
-       GObjectClass parent_class;
-};
+static void gtk_source_style_set_property (GObject      *object,
+                                           guint         prop_id,
+                                           const GValue *value,
+                                           GParamSpec   *pspec);
+static void gtk_source_style_get_property (GObject      *object,
+                                           guint         prop_id,
+                                           GValue       *value,
+                                           GParamSpec   *pspec);
 
 G_DEFINE_TYPE (GtkSourceStyle, gtk_source_style, G_TYPE_OBJECT)
 
@@ -255,9 +249,9 @@ G_STMT_START {                                      \
 
 static void
 gtk_source_style_set_property (GObject      *object,
-                              guint         prop_id,
-                              const GValue *value,
-                              GParamSpec   *pspec)
+                               guint         prop_id,
+                               const GValue *value,
+                               GParamSpec   *pspec)
 {
        GtkSourceStyle *style = GTK_SOURCE_STYLE (object);
        const gchar *string;
@@ -397,10 +391,10 @@ gtk_source_style_set_property (GObject      *object,
 }
 
 static void
-gtk_source_style_get_property (GObject      *object,
-                              guint         prop_id,
-                              GValue       *value,
-                              GParamSpec   *pspec)
+gtk_source_style_get_property (GObject    *object,
+                               guint       prop_id,
+                               GValue     *value,
+                               GParamSpec *pspec)
 {
        GtkSourceStyle *style = GTK_SOURCE_STYLE (object);
 
@@ -536,7 +530,7 @@ gtk_source_style_copy (const GtkSourceStyle *style)
  */
 void
 gtk_source_style_apply (const GtkSourceStyle *style,
-                       GtkTextTag           *tag)
+                        GtkTextTag           *tag)
 {
        g_return_if_fail (GTK_IS_TEXT_TAG (tag));
 
diff --git a/gtksourceview/gtksourcestyle.h b/gtksourceview/gtksourcestyle.h
index 6e8ece45b..3ae95dc88 100644
--- a/gtksourceview/gtksourcestyle.h
+++ b/gtksourceview/gtksourcestyle.h
@@ -30,23 +30,15 @@
 
 G_BEGIN_DECLS
 
-#define GTK_SOURCE_TYPE_STYLE             (gtk_source_style_get_type ())
-#define GTK_SOURCE_STYLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_STYLE, 
GtkSourceStyle))
-#define GTK_SOURCE_IS_STYLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_SOURCE_TYPE_STYLE))
-#define GTK_SOURCE_STYLE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_SOURCE_TYPE_STYLE, 
GtkSourceStyleClass))
-#define GTK_SOURCE_IS_STYLE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_SOURCE_TYPE_STYLE))
-#define GTK_SOURCE_STYLE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_SOURCE_TYPE_STYLE, 
GtkSourceStyleClass))
-
-typedef struct _GtkSourceStyleClass GtkSourceStyleClass;
+#define GTK_SOURCE_TYPE_STYLE (gtk_source_style_get_type ())
 
 GTK_SOURCE_AVAILABLE_IN_ALL
-GType           gtk_source_style_get_type      (void) G_GNUC_CONST;
+G_DECLARE_FINAL_TYPE (GtkSourceStyle, gtk_source_style, GTK_SOURCE, STYLE, GObject)
 
 GTK_SOURCE_AVAILABLE_IN_ALL
-GtkSourceStyle *gtk_source_style_copy          (const GtkSourceStyle *style);
-
+GtkSourceStyle *gtk_source_style_copy  (const GtkSourceStyle *style);
 GTK_SOURCE_AVAILABLE_IN_3_22
-void            gtk_source_style_apply         (const GtkSourceStyle *style,
-                                                GtkTextTag           *tag);
+void            gtk_source_style_apply (const GtkSourceStyle *style,
+                                        GtkTextTag           *tag);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]