[gnome-calendar] enums: Generate enums with standard GLib syntax
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] enums: Generate enums with standard GLib syntax
- Date: Sun, 28 Jan 2018 12:06:36 +0000 (UTC)
commit 79987734cdd494e096326515d5158a67ba3fab35
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Jan 28 00:55:58 2018 -0200
enums: Generate enums with standard GLib syntax
data/org.gnome.calendar.gschema.xml | 2 +-
src/gcal-enum-types.h.template | 2 +-
src/gcal-enums.h | 2 +-
src/gcal-window.c | 13 +++++--------
4 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/data/org.gnome.calendar.gschema.xml b/data/org.gnome.calendar.gschema.xml
index 395ec0ce..95732710 100644
--- a/data/org.gnome.calendar.gschema.xml
+++ b/data/org.gnome.calendar.gschema.xml
@@ -16,7 +16,7 @@
<summary>Window position</summary>
<description>Window position (x and y).</description>
</key>
- <key name="active-view" enum="org.gnome.calendar.GcalWindowViewType">
+ <key name="active-view" enum="org.gnome.calendar.GcalWindowView">
<default>'month'</default>
<summary>Type of the active view</summary>
<description>Type of the active window view, default value is: monthly view</description>
diff --git a/src/gcal-enum-types.h.template b/src/gcal-enum-types.h.template
index 8c36d18b..476f3d0c 100644
--- a/src/gcal-enum-types.h.template
+++ b/src/gcal-enum-types.h.template
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN enumeration-production ***/
-#define GCAL_@ENUMSHORT@ (@enum_name@_get_type())
+#define GCAL_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
GType @enum_name@_get_type (void) G_GNUC_CONST;
/*** END enumeration-production ***/
diff --git a/src/gcal-enums.h b/src/gcal-enums.h
index b682fd51..c1bcf160 100644
--- a/src/gcal-enums.h
+++ b/src/gcal-enums.h
@@ -38,7 +38,7 @@ typedef enum
GCAL_WINDOW_VIEW_YEAR,
GCAL_WINDOW_VIEW_LIST,
GCAL_WINDOW_VIEW_SEARCH,
-} GcalWindowViewType;
+} GcalWindowView;
typedef enum
{
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 4f609c78..93e70b89 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -22,7 +22,6 @@
#include "gcal-debug.h"
#include "gcal-edit-dialog.h"
#include "gcal-enums.h"
-#include "gcal-enum-types.h"
#include "gcal-event-widget.h"
#include "gcal-manager.h"
#include "gcal-month-view.h"
@@ -140,7 +139,7 @@ struct _GcalWindow
GtkWidget *edit_dialog;
GcalManager *manager;
- GcalWindowViewType active_view;
+ GcalWindowView active_view;
icaltimetype *active_date;
gboolean rtl;
@@ -584,7 +583,7 @@ view_changed (GObject *object,
GcalWindow *window;
GEnumClass *eklass;
GEnumValue *eval;
- GcalWindowViewType view_type;
+ GcalWindowView view_type;
window = GCAL_WINDOW (user_data);
@@ -592,10 +591,8 @@ view_changed (GObject *object,
if (!gtk_widget_get_visible (window->views_stack))
return;
- eklass = g_type_class_ref (gcal_window_view_type_get_type ());
- eval = g_enum_get_value_by_nick (
- eklass,
- gtk_stack_get_visible_child_name (GTK_STACK (window->views_stack)));
+ eklass = g_type_class_ref (GCAL_TYPE_WINDOW_VIEW);
+ eval = g_enum_get_value_by_nick (eklass, gtk_stack_get_visible_child_name (GTK_STACK
(window->views_stack)));
view_type = eval->value;
@@ -1447,7 +1444,7 @@ gcal_window_class_init (GcalWindowClass *klass)
properties[PROP_ACTIVE_VIEW] = g_param_spec_enum ("active-view",
"Active View",
"The active view, eg: month, week, etc.",
- GCAL_WINDOW_VIEW_TYPE,
+ GCAL_TYPE_WINDOW_VIEW,
GCAL_WINDOW_VIEW_MONTH,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]