[gtk/wip/ebassi/constraint-layout] Move the VFL error domain to a public header
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/constraint-layout] Move the VFL error domain to a public header
- Date: Mon, 1 Jul 2019 00:18:49 +0000 (UTC)
commit d45a662679d0a1c83dfb4fd238de81ca2fafdd20
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Jul 1 00:47:44 2019 +0100
Move the VFL error domain to a public header
Since the public API will use it to fill out GErrors, it needs to be
publicly available.
gtk/gtkconstraintlayout.c | 6 ++++++
gtk/gtkconstraintlayout.h | 4 ++++
gtk/gtkconstraintvflparser.c | 11 ++++++-----
gtk/gtkconstraintvflparserprivate.h | 13 -------------
gtk/gtkenums.h | 20 ++++++++++++++++++++
5 files changed, 36 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkconstraintlayout.c b/gtk/gtkconstraintlayout.c
index 658298d35e..aacc55dcde 100644
--- a/gtk/gtkconstraintlayout.c
+++ b/gtk/gtkconstraintlayout.c
@@ -1214,6 +1214,12 @@ attribute_from_name (const char *name)
return GTK_CONSTRAINT_ATTRIBUTE_NONE;
}
+GQuark
+gtk_constraint_vfl_parser_error_quark (void)
+{
+ return g_quark_from_static_string ("gtk-constraint-vfl-parser-error-quark");
+}
+
/**
* gtk_constraint_layout_add_constraints_from_descriptionv: (rename-to
gtk_constraint_layout_add_constraints_from_description)
* @layout: a #GtkConstraintLayout
diff --git a/gtk/gtkconstraintlayout.h b/gtk/gtkconstraintlayout.h
index 3297662dea..b57404cb3f 100644
--- a/gtk/gtkconstraintlayout.h
+++ b/gtk/gtkconstraintlayout.h
@@ -26,6 +26,7 @@ G_BEGIN_DECLS
#define GTK_TYPE_CONSTRAINT_LAYOUT (gtk_constraint_layout_get_type ())
#define GTK_TYPE_CONSTRAINT_LAYOUT_CHILD (gtk_constraint_layout_child_get_type ())
+#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
/**
* GtkConstraintLayoutChild:
@@ -44,6 +45,9 @@ G_DECLARE_FINAL_TYPE (GtkConstraintLayoutChild, gtk_constraint_layout_child, GTK
GDK_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (GtkConstraintLayout, gtk_constraint_layout, GTK, CONSTRAINT_LAYOUT, GtkLayoutManager)
+GDK_AVAILABLE_IN_ALL
+GQuark gtk_constraint_vfl_parser_error_quark (void);
+
GDK_AVAILABLE_IN_ALL
GtkLayoutManager * gtk_constraint_layout_new (void);
diff --git a/gtk/gtkconstraintvflparser.c b/gtk/gtkconstraintvflparser.c
index 0d46784991..79be0b0037 100644
--- a/gtk/gtkconstraintvflparser.c
+++ b/gtk/gtkconstraintvflparser.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "gtkconstraintvflparserprivate.h"
+#include "gtkenums.h"
#include <string.h>
@@ -101,11 +102,11 @@ struct _GtkConstraintVflParser
VflView *views;
};
-GQuark
-gtk_constraint_vfl_parser_error_quark (void)
-{
- return g_quark_from_static_string ("gtk-constraint-vfl-parser-error-quark");
-}
+/* NOTE: These two symbols are defined in gtkconstraintlayout.h, but we
+ * cannot include that header here
+ */
+#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
+GQuark gtk_constraint_vfl_parser_error_quark (void);
GtkConstraintVflParser *
gtk_constraint_vfl_parser_new (void)
diff --git a/gtk/gtkconstraintvflparserprivate.h b/gtk/gtkconstraintvflparserprivate.h
index a89b474893..dd214f5049 100644
--- a/gtk/gtkconstraintvflparserprivate.h
+++ b/gtk/gtkconstraintvflparserprivate.h
@@ -25,17 +25,6 @@
G_BEGIN_DECLS
-#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
-
-typedef enum {
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
- GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION
-} VflError;
-
typedef struct _GtkConstraintVflParser GtkConstraintVflParser;
typedef struct {
@@ -49,8 +38,6 @@ typedef struct {
double strength;
} GtkConstraintVfl;
-GQuark gtk_constraint_vfl_parser_error_quark (void);
-
GtkConstraintVflParser *
gtk_constraint_vfl_parser_new (void);
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index e5ea331172..6c226382f4 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -1127,4 +1127,24 @@ typedef enum {
GTK_CONSTRAINT_ATTRIBUTE_BASELINE
} GtkConstraintAttribute;
+/**
+ * GtkConstraintVflParserError:
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: Invalid or unknown symbol
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: Invalid or unknown attribute
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: Invalid or unknown view
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: Invalid or unknown metric
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: Invalid or unknown priority
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: Invalid or unknown relation
+ *
+ * Domain for VFL parsing errors.
+ */
+typedef enum {
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
+ GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION
+} GtkConstraintVflParserError;
+
#endif /* __GTK_ENUMS_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]