qulogic/libgnt

Hide and macro-ify GntTextView.

2019-04-08, Elliott Sales de Andrade
c6d5cec316eb
Parents 88af6d66548b
Children 858c3c05b218
Hide and macro-ify GntTextView.
--- a/gnttextview.c Mon Apr 08 22:42:52 2019 -0400
+++ b/gnttextview.c Mon Apr 08 23:04:01 2019 -0400
@@ -32,9 +32,15 @@
#include <string.h>
#include <unistd.h>
-enum
+struct _GntTextView
{
- SIGS = 1,
+ GntWidget parent;
+
+ GString *string;
+ GList *list; /* List of GntTextLine */
+
+ GList *tags; /* A list of tags */
+ GntTextViewFlag flags;
};
typedef struct
--- a/gnttextview.h Mon Apr 08 22:42:52 2019 -0400
+++ b/gnttextview.h Mon Apr 08 23:04:01 2019 -0400
@@ -34,15 +34,7 @@
#include "gntcolors.h"
#include "gntkeys.h"
-#define GNT_TYPE_TEXT_VIEW (gnt_text_view_get_type())
-#define GNT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TEXT_VIEW, GntTextView))
-#define GNT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_TEXT_VIEW, GntTextViewClass))
-#define GNT_IS_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_TEXT_VIEW))
-#define GNT_IS_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TEXT_VIEW))
-#define GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXT_VIEW, GntTextViewClass))
-
-typedef struct _GntTextView GntTextView;
-typedef struct _GntTextViewClass GntTextViewClass;
+#define GNT_TYPE_TEXT_VIEW gnt_text_view_get_type()
typedef enum
{
@@ -51,17 +43,6 @@
GNT_TEXT_VIEW_TOP_ALIGN = 1 << 2,
} GntTextViewFlag;
-struct _GntTextView
-{
- GntWidget parent;
-
- GString *string;
- GList *list; /* List of GntTextLine */
-
- GList *tags; /* A list of tags */
- GntTextViewFlag flags;
-};
-
typedef enum
{
GNT_TEXT_FLAG_NORMAL = 0,
@@ -72,17 +53,6 @@
GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4,
} GntTextFormatFlags;
-struct _GntTextViewClass
-{
- GntWidgetClass parent;
-
- /*< private >*/
- void (*gnt_reserved1)(void);
- void (*gnt_reserved2)(void);
- void (*gnt_reserved3)(void);
- void (*gnt_reserved4)(void);
-};
-
G_BEGIN_DECLS
/**
@@ -90,7 +60,7 @@
*
* Returns: GType for GntTextView.
*/
-GType gnt_text_view_get_type(void);
+G_DECLARE_FINAL_TYPE(GntTextView, gnt_text_view, GNT, TEXT_VIEW, GntWidget)
/**
* gnt_text_view_new: