grim/guifications3

Parents dc1a11140a3a
Children 516287774772
renamed GfTypeParser to GfTypeQuery and GfTypeParseContext to GfTypeQueryContext and updated all users of them
--- a/gflib/doc/gflib/gflib-sections.txt Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/doc/gflib/gflib-sections.txt Sun Oct 11 04:37:30 2009 -0500
@@ -604,25 +604,25 @@
<SECTION>
<FILE>gf_type</FILE>
<TITLE>GfType</TITLE>
-GfTypeParseContext
-GfTypeParser
+GfTypeQueryContext
+GfTypeQuery
gf_type_children
gf_type_concrete_children
gf_type_interface_implementors
-gf_type_parse_context_get_destroy_notify
-gf_type_parse_context_get_parser
-gf_type_parse_context_new
-gf_type_parse_context_parse
-gf_type_parse_context_get_user_data
+gf_type_query_context_get_destroy_notify
+gf_type_query_context_get_query
+gf_type_query_context_new
+gf_type_query_context_run
+gf_type_query_context_get_user_data
<SUBSECTION Standard>
-GF_IS_TYPE_PARSE_CONTEXT
-GF_IS_TYPE_PARSE_CONTEXT_CLASS
-GF_TYPE_PARSE_CONTEXT
-GF_TYPE_PARSE_CONTEXT_CLASS
-GF_TYPE_PARSE_CONTEXT_GET_CLASS
-GF_TYPE_TYPE_PARSE_CONTEXT
-GfTypeParseContextClass
-gf_type_parse_context_get_type
+GF_IS_TYPE_QUERY_CONTEXT
+GF_IS_TYPE_QUERY_CONTEXT_CLASS
+GF_TYPE_QUERY_CONTEXT
+GF_TYPE_QUERY_CONTEXT_CLASS
+GF_TYPE_QUERY_CONTEXT_GET_CLASS
+GF_TYPE_TYPE_QUERY_CONTEXT
+GfTypeQueryContextClass
+gf_type_query_context_get_type
</SECTION>
<SECTION>
--- a/gflib/doc/gflib/tmpl/gf_preference.sgml Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/doc/gflib/tmpl/gf_preference.sgml Sun Oct 11 04:37:30 2009 -0500
@@ -9,13 +9,11 @@
The basic preference api.
</para>
-
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
-
<!-- ##### SECTION Stability_Level ##### -->
--- a/gflib/doc/gflib/tmpl/gf_type.sgml Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/doc/gflib/tmpl/gf_type.sgml Sun Oct 11 04:37:30 2009 -0500
@@ -18,12 +18,16 @@
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### STRUCT GfTypeParseContext ##### -->
+<!-- ##### STRUCT GfTypeQueryContext ##### -->
+<para>
+
+</para>
+<!-- ##### STRUCT GfTypeQuery ##### -->
+<para>
-<!-- ##### STRUCT GfTypeParser ##### -->
-
+</para>
@start_object:
@end_object:
@@ -60,7 +64,7 @@
@Returns:
-<!-- ##### FUNCTION gf_type_parse_context_get_destroy_notify ##### -->
+<!-- ##### FUNCTION gf_type_query_context_get_destroy_notify ##### -->
<para>
</para>
@@ -69,7 +73,7 @@
@Returns:
-<!-- ##### FUNCTION gf_type_parse_context_get_parser ##### -->
+<!-- ##### FUNCTION gf_type_query_context_get_query ##### -->
<para>
</para>
@@ -78,18 +82,18 @@
@Returns:
-<!-- ##### FUNCTION gf_type_parse_context_new ##### -->
+<!-- ##### FUNCTION gf_type_query_context_new ##### -->
<para>
</para>
-@parser:
+@query:
@data:
@destroy_notify:
@Returns:
-<!-- ##### FUNCTION gf_type_parse_context_parse ##### -->
+<!-- ##### FUNCTION gf_type_query_context_run ##### -->
<para>
</para>
@@ -98,7 +102,7 @@
@type:
-<!-- ##### FUNCTION gf_type_parse_context_get_user_data ##### -->
+<!-- ##### FUNCTION gf_type_query_context_get_user_data ##### -->
<para>
</para>
--- a/gflib/gflib/gf_type.c Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/gflib/gf_type.c Sun Oct 11 04:37:30 2009 -0500
@@ -19,25 +19,25 @@
#include <gflib/gf_intl.h>
-#define GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), GF_TYPE_TYPE_PARSE_CONTEXT, GfTypeParseContextPrivate))
+#define GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), GF_TYPE_TYPE_QUERY_CONTEXT, GfTypeQueryContextPrivate))
/******************************************************************************
* structs
*****************************************************************************/
typedef struct {
- GfTypeParser *parser;
+ GfTypeQuery *query;
gpointer data;
GDestroyNotify destroy_notify;
-} GfTypeParseContextPrivate;
+} GfTypeQueryContextPrivate;
/******************************************************************************
* enums
*****************************************************************************/
enum {
PROP_ZERO,
- PROP_PARSER,
+ PROP_QUERYR,
PROP_DATA,
PROP_DESTROY_NOTIFY,
PROP_LAST,
@@ -49,10 +49,10 @@
static GObjectClass *parent_class = NULL;
/******************************************************************************
- * parse context stuff
+ * query context stuff
*****************************************************************************/
static inline void
-gf_type_parse_context_real_params(GfTypeParseContextPrivate *priv,
+gf_type_query_context_real_params(GfTypeQueryContextPrivate *priv,
GObjectClass *klass)
{
GParamSpec **pspecs = NULL;
@@ -60,14 +60,14 @@
pspecs = g_object_class_list_properties(klass, &n_pspecs);
for(p = 0; p < n_pspecs; p++)
- if(priv->parser->param)
- priv->parser->param(pspecs[p]);
+ if(priv->query->param)
+ priv->query->param(pspecs[p]);
g_free(pspecs);
}
static inline void
-gf_type_parse_context_real_signals(GfTypeParseContextPrivate *priv,
+gf_type_query_context_real_signals(GfTypeQueryContextPrivate *priv,
GType type)
{
guint *signal_ids = NULL, n_ids = 0, s = 0;
@@ -78,15 +78,15 @@
g_signal_query(signal_ids[s], &query);
- if(priv->parser->signal)
- priv->parser->signal(&query);
+ if(priv->query->signal)
+ priv->query->signal(&query);
}
g_free(signal_ids);
}
static inline void
-gf_type_parse_context_real_parse_object(GfTypeParseContextPrivate *priv,
+gf_type_query_context_real_query_object(GfTypeQueryContextPrivate *priv,
GType type)
{
GObjectClass *klass = NULL;
@@ -99,24 +99,24 @@
g_type_query(type, &query);
- if(priv->parser->start_object)
- priv->parser->start_object(&query);
+ if(priv->query->start_object)
+ priv->query->start_object(&query);
- /* if the parser doesn't have a function for params signals don't bother
+ /* if the query doesn't have a function for params signals don't bother
* with digging through them.
*/
- if(priv->parser->param)
- gf_type_parse_context_real_params(priv, klass);
+ if(priv->query->param)
+ gf_type_query_context_real_params(priv, klass);
/* ditto for signals */
- if(priv->parser->signal)
- gf_type_parse_context_real_signals(priv, type);
+ if(priv->query->signal)
+ gf_type_query_context_real_signals(priv, type);
/* we're done with this object. finish it up before moving to it's
* children.
*/
- if(priv->parser->end_object)
- priv->parser->end_object(&query);
+ if(priv->query->end_object)
+ priv->query->end_object(&query);
/* now dig through the children */
types = g_type_children(type, NULL);
@@ -125,7 +125,7 @@
child = g_type_class_ref(types[t]);
- gf_type_parse_context_real_parse_object(priv, types[t]);
+ gf_type_query_context_real_query_object(priv, types[t]);
g_type_class_unref(child);
}
@@ -135,36 +135,36 @@
}
static void
-gf_type_parse_context_real_parse(GfTypeParseContext *ctx, GType type) {
- GfTypeParseContextPrivate *priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+gf_type_query_context_real_query(GfTypeQueryContext *ctx, GType type) {
+ GfTypeQueryContextPrivate *priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
- gf_type_parse_context_real_parse_object(priv, type);
+ gf_type_query_context_real_query_object(priv, type);
}
/******************************************************************************
* helpers
*****************************************************************************/
static void
-gf_type_parse_context_set_parser(GfTypeParseContext *ctx,
- GfTypeParser *parser)
+gf_type_query_context_set_query(GfTypeQueryContext *ctx,
+ GfTypeQuery *query)
{
- GfTypeParseContextPrivate *priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+ GfTypeQueryContextPrivate *priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
- priv->parser = parser;
+ priv->query = query;
}
static void
-gf_type_parse_context_set_data(GfTypeParseContext *ctx, gpointer data) {
- GfTypeParseContextPrivate *priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+gf_type_query_context_set_data(GfTypeQueryContext *ctx, gpointer data) {
+ GfTypeQueryContextPrivate *priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
priv->data = data;
}
static void
-gf_type_parse_context_set_destroy_notify(GfTypeParseContext *ctx,
+gf_type_query_context_set_destroy_notify(GfTypeQueryContext *ctx,
GDestroyNotify destroy_notify)
{
- GfTypeParseContextPrivate *priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+ GfTypeQueryContextPrivate *priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
priv->destroy_notify = destroy_notify;
}
@@ -173,22 +173,22 @@
* object stuff
*****************************************************************************/
static void
-gf_type_parse_context_get_property(GObject *obj, guint param_id, GValue *value,
+gf_type_query_context_get_property(GObject *obj, guint param_id, GValue *value,
GParamSpec *pspec)
{
- GfTypeParseContext *ctx = GF_TYPE_PARSE_CONTEXT(obj);
+ GfTypeQueryContext *ctx = GF_TYPE_QUERY_CONTEXT(obj);
switch(param_id) {
- case PROP_PARSER:
- g_value_set_pointer(value, gf_type_parse_context_get_parser(ctx));
+ case PROP_QUERYR:
+ g_value_set_pointer(value, gf_type_query_context_get_query(ctx));
break;
case PROP_DATA:
g_value_set_pointer(value,
- gf_type_parse_context_get_user_data(ctx));
+ gf_type_query_context_get_user_data(ctx));
break;
case PROP_DESTROY_NOTIFY:
g_value_set_pointer(value,
- gf_type_parse_context_get_destroy_notify(ctx));
+ gf_type_query_context_get_destroy_notify(ctx));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -197,20 +197,20 @@
}
static void
-gf_type_parse_context_set_property(GObject *obj, guint param_id,
+gf_type_query_context_set_property(GObject *obj, guint param_id,
const GValue *value, GParamSpec *pspec)
{
- GfTypeParseContext *ctx = GF_TYPE_PARSE_CONTEXT(obj);
+ GfTypeQueryContext *ctx = GF_TYPE_QUERY_CONTEXT(obj);
switch(param_id) {
- case PROP_PARSER:
- gf_type_parse_context_set_parser(ctx, g_value_get_pointer(value));
+ case PROP_QUERYR:
+ gf_type_query_context_set_query(ctx, g_value_get_pointer(value));
break;
case PROP_DATA:
- gf_type_parse_context_set_data(ctx, g_value_get_pointer(value));
+ gf_type_query_context_set_data(ctx, g_value_get_pointer(value));
break;
case PROP_DESTROY_NOTIFY:
- gf_type_parse_context_set_destroy_notify(ctx,
+ gf_type_query_context_set_destroy_notify(ctx,
(GDestroyNotify)g_value_get_pointer(value));
break;
default:
@@ -220,8 +220,8 @@
}
static void
-gf_type_parse_context_finalize(GObject *obj) {
- GfTypeParseContextPrivate *priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(obj);
+gf_type_query_context_finalize(GObject *obj) {
+ GfTypeQueryContextPrivate *priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(obj);
if(priv->destroy_notify)
priv->destroy_notify(priv->data);
@@ -230,22 +230,22 @@
}
static void
-gf_type_parse_context_class_init(GfTypeParseContextClass *klass) {
+gf_type_query_context_class_init(GfTypeQueryContextClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
parent_class = g_type_class_peek_parent(klass);
- g_type_class_add_private(klass, sizeof(GfTypeParseContextPrivate));
+ g_type_class_add_private(klass, sizeof(GfTypeQueryContextPrivate));
- obj_class->get_property = gf_type_parse_context_get_property;
- obj_class->set_property = gf_type_parse_context_set_property;
- obj_class->finalize = gf_type_parse_context_finalize;
+ obj_class->get_property = gf_type_query_context_get_property;
+ obj_class->set_property = gf_type_query_context_set_property;
+ obj_class->finalize = gf_type_query_context_finalize;
- klass->parse = gf_type_parse_context_real_parse;
+ klass->query = gf_type_query_context_real_query;
- g_object_class_install_property(obj_class, PROP_PARSER,
- g_param_spec_pointer("parser", P_("parser"),
- P_("The GfTypeParser to use."),
+ g_object_class_install_property(obj_class, PROP_QUERYR,
+ g_param_spec_pointer("query", P_("query"),
+ P_("The GfTypeQuery to use."),
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(obj_class, PROP_DATA,
@@ -264,24 +264,24 @@
* API
*****************************************************************************/
GType
-gf_type_parse_context_get_type(void) {
+gf_type_query_context_get_type(void) {
static GType type = 0;
if(G_UNLIKELY(type == 0)) {
static const GTypeInfo info = {
- sizeof(GfTypeParseContextClass),
+ sizeof(GfTypeQueryContextClass),
NULL,
NULL,
- (GClassInitFunc)gf_type_parse_context_class_init,
+ (GClassInitFunc)gf_type_query_context_class_init,
NULL,
NULL,
- sizeof(GfTypeParseContext),
+ sizeof(GfTypeQueryContext),
0,
NULL,
};
type = g_type_register_static(G_TYPE_OBJECT,
- "GfTypeParseContext",
+ "GfTypeQueryContext",
&info, 0);
}
@@ -289,102 +289,101 @@
}
/**
- * gf_type_parse_context_new:
- * @parser: A #GfTypeParser.
- * @data: user data to pass to the #GfTypeParser functions.
+ * gf_type_query_context_new:
+ * @query: A #GfTypeQuery.
+ * @data: user data to pass to the #GfTypeQuery functions.
* @destroy_notify: A function to free @data.
*
- * Creates a new #GfTypeParseContext using @parser.
+ * Creates a new #GfTypeQueryContext using @query.
*
- * Return Value: The new #GfTypeParseContext.
+ * Return Value: The new #GfTypeQueryContext.
*/
-GfTypeParseContext *
-gf_type_parse_context_new(GfTypeParser *parser, gpointer data,
+GfTypeQueryContext *
+gf_type_query_context_new(GfTypeQuery *query, gpointer data,
GDestroyNotify destroy_notify)
{
- g_return_val_if_fail(parser, NULL);
+ g_return_val_if_fail(query, NULL);
- return g_object_new(GF_TYPE_TYPE_PARSE_CONTEXT,
- "parser", parser,
+ return g_object_new(GF_TYPE_TYPE_QUERY_CONTEXT,
+ "query", query,
"data", data,
"destroy-notify", destroy_notify,
NULL);
}
/**
- * gf_type_parse_context_parse:
- * @ctx: The #GfTypeParseContext instance.
+ * gf_type_query_context_run:
+ * @ctx: The #GfTypeQueryContext instance.
* @type: The #GType to start the parsing at.
*
- * Parses through all types descending from @type as well as @type itself.
+ * Querys through all types descending from @type as well as @type itself.
*/
void
-gf_type_parse_context_parse(GfTypeParseContext *ctx, GType type)
-{
- GfTypeParseContextClass *klass = NULL;
+gf_type_query_context_run(GfTypeQueryContext *ctx, GType type) {
+ GfTypeQueryContextClass *klass = NULL;
- g_return_if_fail(GF_IS_TYPE_PARSE_CONTEXT(ctx));
+ g_return_if_fail(GF_IS_TYPE_QUERY_CONTEXT(ctx));
g_return_if_fail(type != G_TYPE_INVALID);
- klass = GF_TYPE_PARSE_CONTEXT_GET_CLASS(ctx);
+ klass = GF_TYPE_QUERY_CONTEXT_GET_CLASS(ctx);
- if(klass && klass->parse)
- klass->parse(ctx, type);
+ if(klass && klass->query)
+ klass->query(ctx, type);
}
/**
- * gf_type_parse_context_get_parser:
- * @ctx: The #GfTypeParseContext instance.
+ * gf_type_query_context_get_query:
+ * @ctx: The #GfTypeQueryContext instance.
*
- * Gets the #GfTypeParser used in @ctx.
+ * Gets the #GfTypeQuery used in @ctx.
*
- * Return Value: The #GfTypeParser used in @ctx.
+ * Return Value: The #GfTypeQuery used in @ctx.
*/
-GfTypeParser *
-gf_type_parse_context_get_parser(const GfTypeParseContext *ctx) {
- GfTypeParseContextPrivate *priv = NULL;
+GfTypeQuery *
+gf_type_query_context_get_query(const GfTypeQueryContext *ctx) {
+ GfTypeQueryContextPrivate *priv = NULL;
- g_return_val_if_fail(GF_IS_TYPE_PARSE_CONTEXT(ctx), NULL);
+ g_return_val_if_fail(GF_IS_TYPE_QUERY_CONTEXT(ctx), NULL);
- priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+ priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
- return priv->parser;
+ return priv->query;
}
/**
- * gf_type_parse_context_get_user_data:
- * @ctx: The #GfTypeParseContext instance.
+ * gf_type_query_context_get_user_data:
+ * @ctx: The #GfTypeQueryContext instance.
*
* Gets the user data from @ctx.
*
* Return Value: The user data used from @ctx.
*/
gpointer
-gf_type_parse_context_get_user_data(const GfTypeParseContext *ctx) {
- GfTypeParseContextPrivate *priv = NULL;
+gf_type_query_context_get_user_data(const GfTypeQueryContext *ctx) {
+ GfTypeQueryContextPrivate *priv = NULL;
- g_return_val_if_fail(GF_IS_TYPE_PARSE_CONTEXT(ctx), NULL);
+ g_return_val_if_fail(GF_IS_TYPE_QUERY_CONTEXT(ctx), NULL);
- priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+ priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
return priv->data;
}
/**
- * gf_type_parse_context_get_destroy_notify:
- * @ctx: The #GfTypeParseContext instance.
+ * gf_type_query_context_get_destroy_notify:
+ * @ctx: The #GfTypeQueryContext instance.
*
* Gets the destroy notify function from @ctx.
*
* Return Value: The destroy notify function from @ctx.
*/
GDestroyNotify
-gf_type_parse_context_get_destroy_notify(const GfTypeParseContext *ctx) {
- GfTypeParseContextPrivate *priv = NULL;
+gf_type_query_context_get_destroy_notify(const GfTypeQueryContext *ctx) {
+ GfTypeQueryContextPrivate *priv = NULL;
- g_return_val_if_fail(GF_IS_TYPE_PARSE_CONTEXT(ctx), NULL);
+ g_return_val_if_fail(GF_IS_TYPE_QUERY_CONTEXT(ctx), NULL);
- priv = GF_TYPE_PARSE_CONTEXT_GET_PRIVATE(ctx);
+ priv = GF_TYPE_QUERY_CONTEXT_GET_PRIVATE(ctx);
return priv->destroy_notify;
}
--- a/gflib/gflib/gf_type.h Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/gflib/gf_type.h Sun Oct 11 04:37:30 2009 -0500
@@ -21,30 +21,32 @@
#include <glib.h>
#include <glib-object.h>
-#define GF_TYPE_TYPE_PARSE_CONTEXT (gf_type_parse_context_get_type())
-#define GF_TYPE_PARSE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GF_TYPE_TYPE_PARSE_CONTEXT, GfTypeParseContext))
-#define GF_TYPE_PARSE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GF_TYPE_TYPE_PARSE_CONTEXT, GfTypeParseContextClass))
-#define GF_IS_TYPE_PARSE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GF_TYPE_TYPE_PARSE_CONTEXT))
-#define GF_IS_TYPE_PARSE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GF_TYPE_TYPE_PARSE_CONTEXT))
-#define GF_TYPE_PARSE_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GF_TYPE_TYPE_PARSE_CONTEXT, GfTypeParseContextClass))
+#define GF_TYPE_TYPE_QUERY_CONTEXT (gf_type_query_context_get_type())
+#define GF_TYPE_QUERY_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GF_TYPE_TYPE_QUERY_CONTEXT, GfTypeQueryContext))
+#define GF_TYPE_QUERY_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GF_TYPE_TYPE_QUERY_CONTEXT, GfTypeQueryContextClass))
+#define GF_IS_TYPE_QUERY_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GF_TYPE_TYPE_QUERY_CONTEXT))
+#define GF_IS_TYPE_QUERY_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GF_TYPE_TYPE_QUERY_CONTEXT))
+#define GF_TYPE_QUERY_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GF_TYPE_TYPE_QUERY_CONTEXT, GfTypeQueryContextClass))
-typedef struct _GfTypeParseContext GfTypeParseContext;
-typedef struct _GfTypeParseContextClass GfTypeParseContextClass;
+typedef struct _GfTypeQueryContext GfTypeQueryContext;
+typedef struct _GfTypeQueryContextClass GfTypeQueryContextClass;
+
+typedef struct _GfTypeQuery GfTypeQuery;
/**
- * GfTypeParseContext:
+ * GfTypeQueryContext:
*
* A class that allows digging through the types in the type system.
*/
-struct _GfTypeParseContext {
+struct _GfTypeQueryContext {
/*< private >*/
GObject parent;
};
-struct _GfTypeParseContextClass {
+struct _GfTypeQueryContextClass {
GObjectClass parent;
- void (*parse)(GfTypeParseContext *ctx, GType type);
+ void (*query)(GfTypeQueryContext *ctx, GType type);
void (*_gf_reserved_1)(void);
void (*_gf_reserved_2)(void);
@@ -52,19 +54,17 @@
void (*_gf_reserved_4)(void);
};
-typedef struct _GfTypeParser GfTypeParser;
-
/**
- * GfTypeParser:
+ * GfTypeQuery:
* @start_object: A function to call when an object is first reached.
* @end_object: A function to call when finished with an object.
* @param: A function thats called when a param is reached.
* @signal: A function to call when a signal is found.
*
* A simple structure for functions to call during a call to
- * #gf_type_parse_context_parse.
+ * #gf_type_query_context_query.
*/
-struct _GfTypeParser {
+struct _GfTypeQuery {
void (*start_object)(const GTypeQuery *query);
void (*end_object)(const GTypeQuery *query);
@@ -74,14 +74,14 @@
G_BEGIN_DECLS
-GType gf_type_parse_context_get_type(void);
+GType gf_type_query_context_get_type(void);
-GfTypeParseContext *gf_type_parse_context_new(GfTypeParser *parser, gpointer data, GDestroyNotify destroy_notify);
-void gf_type_parse_context_parse(GfTypeParseContext *ctx, GType type);
+GfTypeQueryContext *gf_type_query_context_new(GfTypeQuery *query, gpointer data, GDestroyNotify destroy_notify);
+void gf_type_query_context_run(GfTypeQueryContext *ctx, GType type);
-GfTypeParser *gf_type_parse_context_get_parser(const GfTypeParseContext *ctx);
-gpointer gf_type_parse_context_get_user_data(const GfTypeParseContext *ctx);
-GDestroyNotify gf_type_parse_context_get_destroy_notify(const GfTypeParseContext *ctx);
+GfTypeQuery *gf_type_query_context_get_query(const GfTypeQueryContext *ctx);
+gpointer gf_type_query_context_get_user_data(const GfTypeQueryContext *ctx);
+GDestroyNotify gf_type_query_context_get_destroy_notify(const GfTypeQueryContext *ctx);
GType *gf_type_children(GType type, guint *n_children);
GType *gf_type_concrete_children(GType type, guint *n_children);
--- a/gflib/tests/genobjects.c Sun Oct 11 04:19:48 2009 -0500
+++ b/gflib/tests/genobjects.c Sun Oct 11 04:37:30 2009 -0500
@@ -51,7 +51,7 @@
}
}
-static GfTypeParser parser = {
+static GfTypeQuery query = {
gf_gen_hierarchy_start_object,
gf_gen_hierarchy_end_object,
gf_gen_hierarchy_param,
@@ -60,7 +60,7 @@
gint
main(gint argc, gchar **argv) {
- GfTypeParseContext *tctx = NULL;
+ GfTypeQueryContext *tctx = NULL;
GOptionContext *octx = NULL;
octx = g_option_context_new(NULL);
@@ -69,12 +69,12 @@
gf_lib_init(&argc, &argv);
- tctx = gf_type_parse_context_new(&parser, NULL, NULL);
+ tctx = gf_type_query_context_new(&query, NULL, NULL);
printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
printf("<objects>\n");
- gf_type_parse_context_parse(tctx, GF_TYPE_OBJECT);
+ gf_type_query_context_run(tctx, GF_TYPE_OBJECT);
g_object_unref(tctx);
printf("</objects>\n");