[gnome-logs] Use G_DECLARE_FINAL_TYPE throughout



commit a8ca8c79f349d70a825051b965c35b10cf0cd915
Author: David King <davidk gnome org>
Date:   Mon Apr 13 16:43:35 2015 +0100

    Use G_DECLARE_FINAL_TYPE throughout

 src/gl-application.c     |    8 +++++++-
 src/gl-application.h     |   17 ++---------------
 src/gl-eventtoolbar.c    |    8 +++++++-
 src/gl-eventtoolbar.h    |   17 ++---------------
 src/gl-eventview.c       |    8 +++++++-
 src/gl-eventview.h       |   17 ++---------------
 src/gl-eventviewdetail.c |    6 ++++++
 src/gl-eventviewdetail.h |   17 ++---------------
 src/gl-eventviewlist.c   |    8 +++++++-
 src/gl-eventviewlist.h   |   17 ++---------------
 src/gl-eventviewrow.c    |    8 +++++++-
 src/gl-eventviewrow.h    |   17 ++---------------
 src/gl-window.c          |    8 +++++++-
 src/gl-window.h          |   17 ++---------------
 14 files changed, 62 insertions(+), 111 deletions(-)
---
diff --git a/src/gl-application.c b/src/gl-application.c
index a4649c4..a6f2e64 100644
--- a/src/gl-application.c
+++ b/src/gl-application.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -28,6 +28,12 @@
 #include "gl-util.h"
 #include "gl-window.h"
 
+struct _GlApplication
+{
+    /*< private >*/
+    GtkApplication parent_instance;
+};
+
 typedef struct
 {
     GSettings *desktop;
diff --git a/src/gl-application.h b/src/gl-application.h
index af23ae9..b254113 100644
--- a/src/gl-application.h
+++ b/src/gl-application.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,18 +23,6 @@
 
 G_BEGIN_DECLS
 
-typedef struct
-{
-    /*< private >*/
-    GtkApplication parent_instance;
-} GlApplication;
-
-typedef struct
-{
-    /*< private >*/
-    GtkApplicationClass parent_class;
-} GlApplicationClass;
-
 /* Types of sorting. See the GSettings key "sort-order". */
 typedef enum
 {
@@ -43,9 +31,8 @@ typedef enum
 } GlSortOrder;
 
 #define GL_TYPE_APPLICATION (gl_application_get_type ())
-#define GL_APPLICATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_APPLICATION, GlApplication))
+G_DECLARE_FINAL_TYPE (GlApplication, gl_application, GL, APPLICATION, GtkApplication)
 
-GType gl_application_get_type (void);
 GtkApplication * gl_application_new (void);
 
 G_END_DECLS
diff --git a/src/gl-eventtoolbar.c b/src/gl-eventtoolbar.c
index 50f1351..35a286d 100644
--- a/src/gl-eventtoolbar.c
+++ b/src/gl-eventtoolbar.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013, 2014  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -30,6 +30,12 @@ enum
     N_PROPERTIES
 };
 
+struct _GlEventToolbar
+{
+    /*< private >*/
+    GtkHeaderBar parent_instance;
+};
+
 typedef struct
 {
     GtkWidget *back_button;
diff --git a/src/gl-eventtoolbar.h b/src/gl-eventtoolbar.h
index 9accb93..56f59ce 100644
--- a/src/gl-eventtoolbar.h
+++ b/src/gl-eventtoolbar.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,18 +23,6 @@
 
 G_BEGIN_DECLS
 
-typedef struct
-{
-    /*< private >*/
-    GtkHeaderBar parent_instance;
-} GlEventToolbar;
-
-typedef struct
-{
-    /*< private >*/
-    GtkListBoxClass parent_class;
-} GlEventToolbarClass;
-
 /*
  * GlEventToolbarMode:
  * @GL_EVENT_TOOLBAR_MODE_LIST:
@@ -49,9 +37,8 @@ typedef enum
 } GlEventToolbarMode;
 
 #define GL_TYPE_EVENT_TOOLBAR (gl_event_toolbar_get_type ())
-#define GL_EVENT_TOOLBAR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_EVENT_TOOLBAR, 
GlEventToolbar))
+G_DECLARE_FINAL_TYPE (GlEventToolbar, gl_event_toolbar, GL, EVENT_TOOLBAR, GtkHeaderBar)
 
-GType gl_event_toolbar_get_type (void);
 GtkWidget * gl_event_toolbar_new (void);
 gboolean gl_event_toolbar_handle_back_button_event (GlEventToolbar *toolbar,
                                                     GdkEventKey *event);
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index 772b160..2238a9f 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2014  Red Hat, Inc.
+ *  Copyright (C) 2014, 2015  Red Hat, Inc.
  *  Copyright (C) 2014  Jonathan Kang
  *
  *  This program is free software: you can redistribute it and/or modify
@@ -38,6 +38,12 @@ enum
     N_PROPERTIES
 };
 
+struct _GlEventView
+{
+    /*< private >*/
+    GtkStack parent_instance;
+};
+
 typedef struct
 {
     GtkWidget *events;
diff --git a/src/gl-eventview.h b/src/gl-eventview.h
index 53a7627..a90906f 100644
--- a/src/gl-eventview.h
+++ b/src/gl-eventview.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2014  Red Hat, Inc.
+ *  Copyright (C) 2014, 2015  Red Hat, Inc.
  *  Copyright (C) 2014  Jonathan Kang
  *
  *  This program is free software: you can redistribute it and/or modify
@@ -26,18 +26,6 @@
 
 G_BEGIN_DECLS
 
-typedef struct
-{
-    /*< private >*/
-    GtkStack parent_instance;
-} GlEventView;
-
-typedef struct
-{
-    /*< private >*/
-    GtkStackClass parent_class;
-} GlEventViewClass;
-
 /*
  * GlEventViewMode:
  * @GL_EVENT_VIEW_MODE_LIST:
@@ -52,9 +40,8 @@ typedef enum
 } GlEventViewMode;
 
 #define GL_TYPE_EVENT_VIEW (gl_event_view_get_type ())
-#define GL_EVENT_VIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_EVENT_VIEW, GlEventView))
+G_DECLARE_FINAL_TYPE (GlEventView, gl_event_view, GL, EVENT_VIEW, GtkStack)
 
-GType gl_event_view_get_type (void);
 GtkWidget * gl_event_view_new (void);
 void gl_event_view_search (GlEventView *view, const gchar *needle);
 void gl_event_view_set_mode (GlEventView *view, GlEventViewMode mode);
diff --git a/src/gl-eventviewdetail.c b/src/gl-eventviewdetail.c
index 12c24ec..bf5906c 100644
--- a/src/gl-eventviewdetail.c
+++ b/src/gl-eventviewdetail.c
@@ -31,6 +31,12 @@ enum
     N_PROPERTIES
 };
 
+struct _GlEventViewDetail
+{
+    /*< private >*/
+    GtkBin parent_instance;
+};
+
 typedef struct
 {
     GlJournalEntry *entry;
diff --git a/src/gl-eventviewdetail.h b/src/gl-eventviewdetail.h
index 0e4d7a5..7998b9d 100644
--- a/src/gl-eventviewdetail.h
+++ b/src/gl-eventviewdetail.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -26,22 +26,9 @@ G_BEGIN_DECLS
 #include "gl-journal.h"
 #include "gl-util.h"
 
-typedef struct
-{
-    /*< private >*/
-    GtkBin parent_instance;
-} GlEventViewDetail;
-
-typedef struct
-{
-    /*< private >*/
-    GtkBinClass parent_class;
-} GlEventViewDetailClass;
-
 #define GL_TYPE_EVENT_VIEW_DETAIL (gl_event_view_detail_get_type ())
-#define GL_EVENT_VIEW_DETAIL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_EVENT_VIEW_DETAIL, 
GlEventViewDetail))
+G_DECLARE_FINAL_TYPE (GlEventViewDetail, gl_event_view_detail, GL, EVENT_VIEW_DETAIL, GtkBin)
 
-GType gl_event_view_detail_get_type (void);
 GtkWidget * gl_event_view_detail_new (GlJournalEntry *result, GlUtilClockFormat clock_format);
 
 G_END_DECLS
diff --git a/src/gl-eventviewlist.c b/src/gl-eventviewlist.c
index 753a7d0..5f50440 100644
--- a/src/gl-eventviewlist.c
+++ b/src/gl-eventviewlist.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013, 2014  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -31,6 +31,12 @@
 #include "gl-journal-model.h"
 #include "gl-util.h"
 
+struct _GlEventViewList
+{
+    /*< private >*/
+    GtkBox parent_instance;
+};
+
 typedef struct
 {
     GlJournalModel *journal_model;
diff --git a/src/gl-eventviewlist.h b/src/gl-eventviewlist.h
index bd3b023..a9b6d66 100644
--- a/src/gl-eventviewlist.h
+++ b/src/gl-eventviewlist.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -26,22 +26,9 @@
 
 G_BEGIN_DECLS
 
-typedef struct
-{
-    /*< private >*/
-    GtkBox parent_instance;
-} GlEventViewList;
-
-typedef struct
-{
-    /*< private >*/
-    GtkBoxClass parent_class;
-} GlEventViewListClass;
-
 #define GL_TYPE_EVENT_VIEW_LIST (gl_event_view_list_get_type ())
-#define GL_EVENT_VIEW_LIST(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_EVENT_VIEW_LIST, 
GlEventViewList))
+G_DECLARE_FINAL_TYPE (GlEventViewList, gl_event_view_list, GL, EVENT_VIEW_LIST, GtkListBox)
 
-GType gl_event_view_list_get_type (void);
 GtkWidget * gl_event_view_list_new (void);
 void gl_event_view_list_search (GlEventViewList *view, const gchar *needle);
 GlJournalEntry *gl_event_view_list_get_detail_entry (GlEventViewList *view);
diff --git a/src/gl-eventviewrow.c b/src/gl-eventviewrow.c
index ce9aac3..b177773 100644
--- a/src/gl-eventviewrow.c
+++ b/src/gl-eventviewrow.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013, 2014  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,6 +33,12 @@ enum
     N_PROPERTIES
 };
 
+struct _GlEventViewRow
+{
+    /*< private >*/
+    GtkListBoxRow parent_instance;
+};
+
 typedef struct
 {
     GlUtilClockFormat clock_format;
diff --git a/src/gl-eventviewrow.h b/src/gl-eventviewrow.h
index 33559e6..219e36f 100644
--- a/src/gl-eventviewrow.h
+++ b/src/gl-eventviewrow.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -26,18 +26,6 @@ G_BEGIN_DECLS
 #include "gl-journal.h"
 #include "gl-util.h"
 
-typedef struct
-{
-    /*< private >*/
-    GtkListBoxRow parent_instance;
-} GlEventViewRow;
-
-typedef struct
-{
-    /*< private >*/
-    GtkListBoxRowClass parent_class;
-} GlEventViewRowClass;
-
 /*
  * GlEventViewRowStyle:
  * @GL_EVENT_VIEW_ROW_STYLE_CMDLINE: show the command-line in bold, if it
@@ -53,9 +41,8 @@ typedef enum
 } GlEventViewRowStyle;
 
 #define GL_TYPE_EVENT_VIEW_ROW (gl_event_view_row_get_type ())
-#define GL_EVENT_VIEW_ROW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_EVENT_VIEW_ROW, 
GlEventViewRow))
+G_DECLARE_FINAL_TYPE (GlEventViewRow, gl_event_view_row, GL, EVENT_VIEW_ROW, GtkListBoxRow)
 
-GType gl_event_view_row_get_type (void);
 GtkWidget * gl_event_view_row_new (GlJournalEntry *entry, GlEventViewRowStyle style, GlUtilClockFormat 
clock_format);
 GlJournalEntry * gl_event_view_row_get_entry (GlEventViewRow *row);
 
diff --git a/src/gl-window.c b/src/gl-window.c
index 5c51009..5478032 100644
--- a/src/gl-window.c
+++ b/src/gl-window.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -27,6 +27,12 @@
 #include "gl-enums.h"
 #include "gl-util.h"
 
+struct _GlWindow
+{
+    /*< private >*/
+    GtkApplicationWindow parent_instance;
+};
+
 typedef struct
 {
     GtkWidget *event_toolbar;
diff --git a/src/gl-window.h b/src/gl-window.h
index 0e9da24..3c052e7 100644
--- a/src/gl-window.h
+++ b/src/gl-window.h
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014, 2015  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -25,22 +25,9 @@
 
 G_BEGIN_DECLS
 
-typedef struct
-{
-    /*< private >*/
-    GtkApplicationWindow parent_instance;
-} GlWindow;
-
-typedef struct
-{
-    /*< private >*/
-    GtkApplicationWindowClass parent_class;
-} GlWindowClass;
-
 #define GL_TYPE_WINDOW (gl_window_get_type ())
-#define GL_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GL_TYPE_WINDOW, GlWindow))
+G_DECLARE_FINAL_TYPE (GlWindow, gl_window, GL, WINDOW, GtkApplicationWindow)
 
-GType gl_window_get_type (void);
 GtkWidget * gl_window_new (GtkApplication *application);
 void gl_window_set_sort_order (GlWindow *window, GlSortOrder sort_order);
 


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