[nautilus] notebook: make the class final
- From: Răzvan-Mihai Chițu <razvanchitu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] notebook: make the class final
- Date: Thu, 30 Mar 2017 19:35:13 +0000 (UTC)
commit 0b30fe07dd22c94c97e244a3f4d1b56431f0063c
Author: Tiberiu Lepadatu <tiberiulepadatu14 gmail com>
Date: Thu Mar 30 00:01:17 2017 +0300
notebook: make the class final
The class NautilusNotebook is not extended by any other class so it
should be made final. Use the new type declarations to do so.
https://bugzilla.gnome.org/show_bug.cgi?id=780700
src/nautilus-notebook.c | 7 ++++++-
src/nautilus-notebook.h | 29 +----------------------------
2 files changed, 7 insertions(+), 29 deletions(-)
---
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index 6bf852e..3f6b946 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -53,6 +53,11 @@ enum
static guint signals[LAST_SIGNAL];
+struct _NautilusNotebook
+{
+ GtkNotebook parent_instance;
+};
+
G_DEFINE_TYPE (NautilusNotebook, nautilus_notebook, GTK_TYPE_NOTEBOOK);
static void
@@ -70,7 +75,7 @@ nautilus_notebook_class_init (NautilusNotebookClass *klass)
g_signal_new ("tab-close-request",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusNotebookClass, tab_close_request),
+ 0,
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
diff --git a/src/nautilus-notebook.h b/src/nautilus-notebook.h
index d810686..5a999f7 100644
--- a/src/nautilus-notebook.h
+++ b/src/nautilus-notebook.h
@@ -28,39 +28,12 @@
#include <glib.h>
#include <gtk/gtk.h>
-typedef struct _NautilusNotebookClass NautilusNotebookClass;
-typedef struct _NautilusNotebook NautilusNotebook;
-typedef struct _NautilusNotebookPrivate NautilusNotebookPrivate;
-
#include "nautilus-window-slot.h"
G_BEGIN_DECLS
#define NAUTILUS_TYPE_NOTEBOOK (nautilus_notebook_get_type ())
-#define NAUTILUS_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_NOTEBOOK,
NautilusNotebook))
-#define NAUTILUS_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NAUTILUS_TYPE_NOTEBOOK,
NautilusNotebookClass))
-#define NAUTILUS_IS_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_NOTEBOOK))
-#define NAUTILUS_IS_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NAUTILUS_TYPE_NOTEBOOK))
-#define NAUTILUS_NOTEBOOK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAUTILUS_TYPE_NOTEBOOK,
NautilusNotebookClass))
-
-struct _NautilusNotebook
-{
- GtkNotebook parent;
-
- /*< private >*/
- NautilusNotebookPrivate *priv;
-};
-
-struct _NautilusNotebookClass
-{
- GtkNotebookClass parent_class;
-
- /* Signals */
- void (* tab_close_request) (NautilusNotebook *notebook,
- NautilusWindowSlot *slot);
-};
-
-GType nautilus_notebook_get_type (void);
+G_DECLARE_FINAL_TYPE (NautilusNotebook, nautilus_notebook, NAUTILUS, NOTEBOOK, GtkNotebook)
int nautilus_notebook_add_tab (NautilusNotebook *nb,
NautilusWindowSlot *slot,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]