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.
This commit is contained in:
Emmanuele Bassi 2019-07-01 00:47:44 +01:00
parent 514de0b91a
commit d45a662679
5 changed files with 36 additions and 18 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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__ */