[buoh/cleanups] BuohViewZoomMode: use glib-mkenums



commit e28ed2d8b0a917f9db859096c4870f1dd2a92a6c
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Jan 22 05:54:12 2019 +0100

    BuohViewZoomMode: use glib-mkenums

 src/buoh-view.c | 19 -------------------
 src/buoh-view.h |  2 +-
 src/meson.build |  5 +++++
 3 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/src/buoh-view.c b/src/buoh-view.c
index 2dc1ddf..059b6a5 100644
--- a/src/buoh-view.c
+++ b/src/buoh-view.c
@@ -97,25 +97,6 @@ buoh_view_status_get_type (void)
         return etype;
 }
 
-GType
-buoh_view_zoom_mode_get_type (void)
-{
-        static GType etype = 0;
-
-        if (G_UNLIKELY (etype == 0)) {
-                static const GEnumValue values[] = {
-                        { VIEW_ZOOM_FREE,      "VIEW_ZOOM_FREE",      "free" },
-                        { VIEW_ZOOM_BEST_FIT,  "VIEW_ZOOM_BEST_FIT",  "best-fit" },
-                        { VIEW_ZOOM_FIT_WIDTH, "VIEW_ZOOM_FIT_WIDTH", "fit-width" },
-                        { 0, NULL, NULL }
-                };
-
-                etype = g_enum_register_static ("BuohViewZoomMode", values);
-        }
-
-        return etype;
-}
-
 static void
 buoh_view_init (BuohView *buoh_view)
 {
diff --git a/src/buoh-view.h b/src/buoh-view.h
index f5b7585..159d912 100644
--- a/src/buoh-view.h
+++ b/src/buoh-view.h
@@ -24,6 +24,7 @@
 
 #include "buoh-comic.h"
 #include "buoh-settings.h"
+#include "buoh-enums.h"
 
 G_BEGIN_DECLS
 
@@ -31,7 +32,6 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (BuohView, buoh_view, BUOH, VIEW, GtkNotebook)
 
 #define BUOH_TYPE_VIEW_STATUS buoh_view_status_get_type ()
-#define BUOH_TYPE_VIEW_ZOOM_MODE buoh_view_zoom_mode_get_type ()
 
 typedef enum {
         STATE_MESSAGE_WELCOME,
diff --git a/src/meson.build b/src/meson.build
index 86f049f..53d7a06 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -29,6 +29,11 @@ sources += gnome.compile_resources(
   export: true,
 )
 
+sources += gnome.mkenums_simple(
+  'buoh-enums',
+  sources: enum_headers,
+)
+
 cflags = [
   '-DCOMICS_DIR="@0@"'.format(comicsdir),
   '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),


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