[libgit2-glib] Port GgitBlame to G_DECLARE_FINAL_TYPE macro
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Port GgitBlame to G_DECLARE_FINAL_TYPE macro
- Date: Tue, 14 Jul 2015 10:55:42 +0000 (UTC)
commit 1ee53a31b9b6cab1b853141dcbd34a8e6f1b563b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jul 14 12:44:10 2015 +0200
Port GgitBlame to G_DECLARE_FINAL_TYPE macro
libgit2-glib/ggit-autocleanup.h | 1 -
libgit2-glib/ggit-blame.c | 10 ++++++++++
libgit2-glib/ggit-blame.h | 28 ++--------------------------
libgit2-glib/ggit-types.h | 7 -------
4 files changed, 12 insertions(+), 34 deletions(-)
---
diff --git a/libgit2-glib/ggit-autocleanup.h b/libgit2-glib/ggit-autocleanup.h
index f407c5d..2144ab6 100644
--- a/libgit2-glib/ggit-autocleanup.h
+++ b/libgit2-glib/ggit-autocleanup.h
@@ -57,7 +57,6 @@ G_BEGIN_DECLS
#ifndef __GI_SCANNER__
#if GLIB_CHECK_VERSION (2, 44, 0)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitBlame, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitBlameHunk, ggit_blame_hunk_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitBlameOptions, ggit_blame_options_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitBlob, g_object_unref)
diff --git a/libgit2-glib/ggit-blame.c b/libgit2-glib/ggit-blame.c
index 6891991..1890005 100644
--- a/libgit2-glib/ggit-blame.c
+++ b/libgit2-glib/ggit-blame.c
@@ -23,6 +23,16 @@
#include "ggit-signature.h"
#include "ggit-error.h"
+/**
+ * GgitBlame:
+ *
+ * Represents a blame.
+ */
+struct _GgitBlame
+{
+ GgitNative parent_instance;
+};
+
struct _GgitBlameHunk
{
guint16 lines_in_hunk;
diff --git a/libgit2-glib/ggit-blame.h b/libgit2-glib/ggit-blame.h
index 2eb3f02..4746084 100644
--- a/libgit2-glib/ggit-blame.h
+++ b/libgit2-glib/ggit-blame.h
@@ -28,30 +28,8 @@
G_BEGIN_DECLS
-#define GGIT_TYPE_BLAME (ggit_blame_get_type ())
-#define GGIT_BLAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_BLAME,
GgitBlame))
-#define GGIT_BLAME_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_BLAME, GgitBlame const))
-#define GGIT_BLAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GGIT_TYPE_BLAME,
GgitBlameClass))
-#define GGIT_IS_BLAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GGIT_TYPE_BLAME))
-#define GGIT_IS_BLAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GGIT_TYPE_BLAME))
-#define GGIT_BLAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GGIT_TYPE_BLAME, GgitBlameClass))
-
-typedef struct _GgitBlameClass GgitBlameClass;
-
-struct _GgitBlame
-{
- /*< private >*/
- GgitNative parent;
-
- /* priv padding */
- gpointer priv;
-};
-
-struct _GgitBlameClass
-{
- /*< private >*/
- GgitNativeClass parent_class;
-};
+#define GGIT_TYPE_BLAME (ggit_blame_get_type ())
+G_DECLARE_FINAL_TYPE (GgitBlame, ggit_blame, GGIT, BLAME, GgitNative)
GType ggit_blame_hunk_get_type (void) G_GNUC_CONST;
GgitBlameHunk *ggit_blame_hunk_ref (GgitBlameHunk *blame_hunk);
@@ -70,8 +48,6 @@ const gchar *ggit_blame_hunk_get_orig_path (GgitBlameHunk *blame
gboolean ggit_blame_hunk_is_boundary (GgitBlameHunk *blame_hunk);
-GType ggit_blame_get_type (void) G_GNUC_CONST;
-
GgitBlame *_ggit_blame_wrap (git_blame *blame);
guint32 ggit_blame_get_hunk_count (GgitBlame *blame);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 25233e8..8ac742a 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -194,13 +194,6 @@ typedef struct _GgitDiffOptions GgitDiffOptions;
typedef struct _GgitDiffSimilarityMetric GgitDiffSimilarityMetric;
/**
- * GgitBlame:
- *
- * Represents a blame.
- */
-typedef struct _GgitBlame GgitBlame;
-
-/**
* GgitBlameHunk:
*
* Represents a blame hunk.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]