char *output_dir = NULL;
+static char file_sep = '-';
+
static int signals = 0; /* number of signals */
static int set_properties = 0; /* number of named (set) properties */
static int get_properties = 0; /* number of named (get) properties */
static void
make_bases (void)
{
- filebase = replace_sep (((Class *)class)->otype, '-');
+ filebase = replace_sep (((Class *)class)->otype, file_sep);
gob_strdown (filebase);
if (output_dir != NULL &&
static void
make_property (Property *p)
{
- GString *flags;
- GList *l;
char *s;
- char *argflags[] = {
- "CONSTRUCT",
- "CONSTRUCT_ONLY",
- "CHILD_ARG",
- "MASK",
- NULL
- };
-
- flags = g_string_new ("(GParamFlags)(");
-
- if (p->get != NULL && p->set != NULL)
- g_string_append (flags, "G_PARAM_READABLE | G_PARAM_WRITABLE");
- else if (p->get != NULL)
- g_string_append (flags, "G_PARAM_READABLE");
- else
- g_string_append (flags, "G_PARAM_WRITABLE");
if (p->get == NULL && p->set == NULL) {
error_print (GOB_ERROR, p->line_no,
"Property has no getter nor setter");
}
- for (l = p->flags; l != NULL; l = l->next) {
- char *flag = l->data;
- int i;
- if(strcmp (flag, "READABLE") == 0 ||
- strcmp (flag, "WRITABLE") == 0) {
- error_print(GOB_WARN, p->line_no,
- "READABLE and "
- "WRITABLE argument flags are "
- "set automatically");
- continue;
- }
- for(i = 0; argflags[i]; i++) {
- if(strcmp(argflags[i], flag)==0)
- break;
+ if (p->override) {
+ if (p->flags != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, flags ignored");
+ if (p->nick != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, nick ignored");
+ if (p->blurb != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, blurb ignored");
+ if (p->minimum != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, minimum ignored");
+ if (p->maximum != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, maximum ignored");
+ if (p->default_value != NULL)
+ error_print (GOB_WARN, p->line_no,
+ "Overriden property, default_value ignored");
+
+ s = g_strdup (p->name);
+ gob_strup (s);
+ out_printf (out, "\tg_object_class_override_property (g_object_class,\n"
+ "\t\tPROP_%s,\n"
+ "\t\t\"%s\");\n", s, p->name);
+ g_free (s);
+ } else {
+ GString *flags;
+ GList *l;
+ char *argflags[] = {
+ "CONSTRUCT",
+ "CONSTRUCT_ONLY",
+ "CHILD_ARG",
+ "MASK",
+ NULL
+ };
+
+ flags = g_string_new ("(GParamFlags)(");
+
+ if (p->get != NULL && p->set != NULL)
+ g_string_append (flags, "G_PARAM_READABLE | G_PARAM_WRITABLE");
+ else if (p->get != NULL)
+ g_string_append (flags, "G_PARAM_READABLE");
+ else
+ g_string_append (flags, "G_PARAM_WRITABLE");
+
+
+ for (l = p->flags; l != NULL; l = l->next) {
+ char *flag = l->data;
+ int i;
+ if(strcmp (flag, "READABLE") == 0 ||
+ strcmp (flag, "WRITABLE") == 0) {
+ error_print(GOB_WARN, p->line_no,
+ "READABLE and "
+ "WRITABLE argument flags are "
+ "set automatically");
+ continue;
+ }
+ for(i = 0; argflags[i]; i++) {
+ if(strcmp(argflags[i], flag)==0)
+ break;
+ }
+ /* if we haven't found it in our list */
+ if( ! argflags[i]) {
+ error_printf(GOB_WARN, p->line_no,
+ "Unknown flag '%s' used, "
+ "perhaps it was misspelled", flag);
+ }
+ g_string_sprintfa(flags, " | G_PARAM_%s", flag);
}
- /* if we haven't found it in our list */
- if( ! argflags[i]) {
- error_printf(GOB_WARN, p->line_no,
- "Unknown flag '%s' used, "
- "perhaps it was misspelled", flag);
+
+ g_string_append (flags, ")");
+
+ if (strcmp (p->gtktype, "CHAR") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_char\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "-128"),
+ value_for_print (p->maximum, "127"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "UCHAR") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_uchar\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "0"),
+ value_for_print (p->maximum, "0xFF"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "BOOLEAN") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_boolean\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->default_value, "FALSE"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "INT") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_int\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "G_MININT"),
+ value_for_print (p->maximum, "G_MAXINT"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "UINT") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_uint\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "0"),
+ value_for_print (p->maximum, "G_MAXUINT"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "LONG") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_long\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "G_MINLONG"),
+ value_for_print (p->maximum, "G_MAXLONG"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "ULONG") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_ulong\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "0"),
+ value_for_print (p->maximum, "G_MAXULONG"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "INT64") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_int64\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "G_MININT64"),
+ value_for_print (p->maximum, "G_MAXINT64"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "UINT64") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_uint64\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "0"),
+ value_for_print (p->maximum, "G_MAXUINT64"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "UNICHAR") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_unichar\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "ENUM") == 0) {
+ char *type = make_me_type (p->extra_gtktype,
+ "G_TYPE_ENUM");
+ out_printf (out, "\tparam_spec = g_param_spec_enum\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* enum_type */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ type,
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ g_free (type);
+ } else if (strcmp (p->gtktype, "FLAGS") == 0) {
+ char *type = make_me_type (p->extra_gtktype,
+ "G_TYPE_FLAGS");
+ out_printf (out, "\tparam_spec = g_param_spec_flags\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* flags_type */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ type,
+ value_for_print (p->default_value, "0"),
+ flags->str);
+ g_free (type);
+ } else if (strcmp (p->gtktype, "FLOAT") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_float\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "G_MINFLOAT"),
+ value_for_print (p->maximum, "G_MAXFLOAT"),
+ value_for_print (p->default_value, "0.0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "DOUBLE") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_double\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* minimum */,\n"
+ "\t\t %s /* maximum */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->minimum, "G_MINDOUBLE"),
+ value_for_print (p->maximum, "G_MAXDOUBLE"),
+ value_for_print (p->default_value, "0.0"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "STRING") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_string\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* default_value */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ value_for_print (p->default_value, "NULL"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "PARAM") == 0) {
+ char *type = make_me_type (p->extra_gtktype,
+ "G_TYPE_PARAM");
+ out_printf (out, "\tparam_spec = g_param_spec_param\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* param_type */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ type,
+ flags->str);
+ g_free (type);
+ } else if (strcmp (p->gtktype, "BOXED") == 0) {
+ char *type = make_me_type (p->extra_gtktype,
+ "G_TYPE_BOXED");
+ out_printf (out, "\tparam_spec = g_param_spec_boxed\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* boxed_type */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ type,
+ flags->str);
+ g_free (type);
+ } else if (strcmp (p->gtktype, "POINTER") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_pointer\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ flags->str);
+ /* FIXME: VALUE_ARRAY */
+ } else if (strcmp (p->gtktype, "CLOSURE") == 0) {
+ out_printf (out, "\tparam_spec = g_param_spec_pointer\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ flags->str);
+ } else if (strcmp (p->gtktype, "OBJECT") == 0) {
+ char *type = make_me_type (p->extra_gtktype,
+ "G_TYPE_BOXED");
+ out_printf (out, "\tparam_spec = g_param_spec_object\n"
+ "\t\t(\"%s\" /* name */,\n"
+ "\t\t %s /* nick */,\n"
+ "\t\t %s /* blurb */,\n"
+ "\t\t %s /* object_type */,\n"
+ "\t\t %s);\n",
+ p->name,
+ value_for_print (p->nick, "NULL"),
+ value_for_print (p->blurb, "NULL"),
+ type,
+ flags->str);
+ g_free (type);
+ } else {
+ error_printf (GOB_ERROR, p->line_no,
+ "%s type is not supported by properties",
+ p->gtktype);
}
- g_string_sprintfa(flags, " | G_PARAM_%s", flag);
- }
- g_string_append (flags, ")");
+ s = g_strdup (p->name);
+ gob_strup (s);
+ out_printf (out, "\tg_object_class_install_property (g_object_class,\n"
+ "\t\tPROP_%s,\n"
+ "\t\tparam_spec);\n", s);
+ g_free (s);
- if (strcmp (p->gtktype, "CHAR") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_char\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "-128"),
- value_for_print (p->maximum, "127"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "UCHAR") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_uchar\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "0"),
- value_for_print (p->maximum, "0xFF"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "BOOLEAN") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_boolean\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->default_value, "FALSE"),
- flags->str);
- } else if (strcmp (p->gtktype, "INT") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_int\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "G_MININT"),
- value_for_print (p->maximum, "G_MAXINT"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "UINT") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_uint\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "0"),
- value_for_print (p->maximum, "G_MAXUINT"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "LONG") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_long\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "G_MINLONG"),
- value_for_print (p->maximum, "G_MAXLONG"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "ULONG") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_ulong\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "0"),
- value_for_print (p->maximum, "G_MAXULONG"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "INT64") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_int64\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "G_MININT64"),
- value_for_print (p->maximum, "G_MAXINT64"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "UINT64") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_uint64\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "0"),
- value_for_print (p->maximum, "G_MAXUINT64"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "UNICHAR") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_unichar\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->default_value, "0"),
- flags->str);
- } else if (strcmp (p->gtktype, "ENUM") == 0) {
- char *type = make_me_type (p->extra_gtktype,
- "G_TYPE_ENUM");
- out_printf (out, "\tparam_spec = g_param_spec_enum\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* enum_type */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- type,
- value_for_print (p->default_value, "0"),
- flags->str);
- g_free (type);
- } else if (strcmp (p->gtktype, "FLAGS") == 0) {
- char *type = make_me_type (p->extra_gtktype,
- "G_TYPE_FLAGS");
- out_printf (out, "\tparam_spec = g_param_spec_flags\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* flags_type */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- type,
- value_for_print (p->default_value, "0"),
- flags->str);
- g_free (type);
- } else if (strcmp (p->gtktype, "FLOAT") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_float\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "G_MINFLOAT"),
- value_for_print (p->maximum, "G_MAXFLOAT"),
- value_for_print (p->default_value, "0.0"),
- flags->str);
- } else if (strcmp (p->gtktype, "DOUBLE") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_double\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* minimum */,\n"
- "\t\t %s /* maximum */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->minimum, "G_MINDOUBLE"),
- value_for_print (p->maximum, "G_MAXDOUBLE"),
- value_for_print (p->default_value, "0.0"),
- flags->str);
- } else if (strcmp (p->gtktype, "STRING") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_string\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* default_value */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- value_for_print (p->default_value, "NULL"),
- flags->str);
- } else if (strcmp (p->gtktype, "PARAM") == 0) {
- char *type = make_me_type (p->extra_gtktype,
- "G_TYPE_PARAM");
- out_printf (out, "\tparam_spec = g_param_spec_param\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* param_type */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- type,
- flags->str);
- g_free (type);
- } else if (strcmp (p->gtktype, "BOXED") == 0) {
- char *type = make_me_type (p->extra_gtktype,
- "G_TYPE_BOXED");
- out_printf (out, "\tparam_spec = g_param_spec_boxed\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* boxed_type */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- type,
- flags->str);
- g_free (type);
- } else if (strcmp (p->gtktype, "POINTER") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_pointer\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- flags->str);
- /* FIXME: VALUE_ARRAY */
- } else if (strcmp (p->gtktype, "CLOSURE") == 0) {
- out_printf (out, "\tparam_spec = g_param_spec_pointer\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- flags->str);
- } else if (strcmp (p->gtktype, "OBJECT") == 0) {
- char *type = make_me_type (p->extra_gtktype,
- "G_TYPE_BOXED");
- out_printf (out, "\tparam_spec = g_param_spec_object\n"
- "\t\t(\"%s\" /* name */,\n"
- "\t\t %s /* nick */,\n"
- "\t\t %s /* blurb */,\n"
- "\t\t %s /* object_type */,\n"
- "\t\t %s);\n",
- p->name,
- value_for_print (p->nick, "NULL"),
- value_for_print (p->blurb, "NULL"),
- type,
- flags->str);
- g_free (type);
- } else {
- error_printf (GOB_ERROR, p->line_no,
- "%s type is not supported by properties",
- p->gtktype);
+ g_string_free (flags, TRUE);
}
-
- s = g_strdup (p->name);
- gob_strup (s);
- out_printf (out, "\tg_object_class_install_property (g_object_class,\n"
- "\t\tPROP_%s,\n"
- "\t\tparam_spec);\n", s);
- g_free (s);
-
- g_string_free (flags, TRUE);
}
static void
out_printf(out, "\tg_object_class->get_property = ___object_get_property;\n");
if (set_properties > 0)
out_printf(out, "\tg_object_class->set_property = ___object_set_property;\n");
- out_printf (out, " {\n"
- "\tGParamSpec *param_spec;\n\n");
+ out_printf (out, " {\n");
+ for (li = c->nodes; li != NULL; li = li->next) {
+ Node *n = li->data;
+ if ((n->type == PROPERTY_NODE && ! ((Property *) n)->override)
+ || n->type == ARGUMENT_NODE) {
+ out_printf(out, "\tGParamSpec *param_spec;\n\n");
+ break;
+ }
+ }
for (li = c->nodes; li != NULL; li = li->next) {
Node *n = li->data;
if(v->destructor_line > 0)
out_addline_infile(out, v->destructor_line);
- out_printf(out, "\tif(%s->%s) { "
- "((*(void (*)(void *))%s)) (%s->%s); "
- "%s->%s = NULL; }\n",
- root, v->id, v->destructor, root, v->id,
- root, v->id);
+ if (for_cpp) {
+ out_printf(out, "\tif(%s->%s) { "
+ "(reinterpret_cast<void (*)(void *)>(%s)) ((gpointer)%s->%s); "
+ "%s->%s = NULL; }\n",
+ root, v->id, v->destructor, root, v->id,
+ root, v->id);
+ } else {
+ out_printf(out, "\tif(%s->%s) { "
+ "%s ((gpointer) %s->%s); "
+ "%s->%s = NULL; }\n",
+ root, v->id, v->destructor, root, v->id,
+ root, v->id);
+ }
if(v->destructor_line > 0)
out_addline_outfile(out);
const char *unused = "";
if ( ! no_gnu)
unused = " G_GNUC_UNUSED";
- out_printf(out, "\t%s *self %s = %s (obj_self);\n",
+ out_printf(out, "\t%s *self%s = %s (obj_self);\n",
typebase, unused, macrobase);
}
if (privates > 0) {
- out_printf(out, "\tgpointer priv = self->_priv;\n");
+ const char *unused = "";
+ if ( ! no_gnu)
+ unused = " G_GNUC_UNUSED";
+ out_printf(out, "\tgpointer priv%s = self->_priv;\n",
+ unused);
}
if(finalize_handler) {
}
}
- if (privates > 0) {
- out_printf(out, "\tg_free (priv);\n");
- }
-
out_printf(out, "}\n"
"#undef __GOB_FUNCTION__\n\n");
}
out_printf(out, "{\n"
"#define __GOB_FUNCTION__ \"%s::init\"\n",
c->otype);
- if(privates > 0) {
+ if (privates > 0) {
out_printf(out, "\t%s->_priv = "
- "g_new0 (%sPrivate, 1);\n",
- ((FuncArg *)m->args->data)->name,
- typebase);
+ "G_TYPE_INSTANCE_GET_PRIVATE(%s,TYPE_SELF,%sPrivate);\n",
+ ((FuncArg *)m->args->data)->name,
+ ((FuncArg *)m->args->data)->name,
+ typebase);
} else if(always_private_struct) {
out_printf(out, "\t%s->_priv = NULL;\n",
((FuncArg *)m->args->data)->name);
did_base_obj = TRUE;
}
+ if (privates > 0)
+ out_printf (out,
+ "\n\tg_type_class_add_private(%s,sizeof(%sPrivate));\n",
+ ((FuncArg *)m->args->data)->name,
+ typebase);
+
if (overrides > 0)
add_overrides (c,
((FuncArg *)m->args->data)->name,
if ((privates > 0 || protecteds > 0 ||
private_header == PRIVATE_HEADER_ALWAYS) &&
- private_header != PRIVATE_HEADER_NEVER)
- outfileph = g_strconcat (fullfilebase, "-private.h", NULL);
- else
+ private_header != PRIVATE_HEADER_NEVER) {
+ char sep[2] = {0,0};
+ if (file_sep != 0)
+ sep[0] = file_sep;
+ outfileph = g_strconcat (fullfilebase, sep, "private.h", NULL);
+ } else {
outfileph = NULL;
+ }
if (no_write) {
char *p;
/* We may need string.h for memset */
- if(destructors > 0 &&
- ! g_list_find_custom(include_files, "string.h", (GCompareFunc)strcmp)) {
+ if ( ! g_list_find_custom(include_files, "string.h", (GCompareFunc)strcmp)) {
out_printf(out, "#include <string.h> /* memset() */\n\n");
}
"aliases\n"
"\t--no-kill-underscores Ignored for compatibility\n"
"\t-o,--output-dir The directory where output "
- "should be placed\n");
+ "should be placed\n"
+ "\t--file-sep[=c] replace default \'-\' file "
+ "name separator\n");
}
static void
char *p = strchr (argv[i], '=');
g_assert (p != NULL);
output_dir = g_strdup (p+1);
+ } else if (strncmp (argv[i], "--file-sep=",
+ strlen ("--file-sep=")) == 0) {
+ char *p = strchr (argv[i], '=');
+ g_assert (p != NULL);
+ file_sep = *(p+1);
+ } else if (strncmp (argv[i], "--file-sep",
+ strlen ("--file-sep")) == 0) {
+ if (i+1 < argc) {
+ file_sep = (argv[i+1])[0];
+ i++;
+ } else {
+ file_sep = 0;
+ }
} else if(strcmp(argv[i], "--")==0) {
/*further arguments are files*/
no_opts = TRUE;
setcast = "(gint) ";
getcast = to_free =
get_prop_enum_flag_cast (prop);
+ } else if (strcmp (prop->gtktype, "POINTER") == 0) {
+ setcast = "(gpointer) ";
+ getcast = g_strdup_printf ("(%s%s) ",
+ prop->ptype->name,
+ prop->ptype->pointer ? prop->ptype->pointer : "");
}
}
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 623 "parse.y"
+#line 628 "parse.y"
typedef union YYSTYPE {
char *id;
GString *cbuf;
int sigtype;
} YYSTYPE;
/* Line 191 of yacc.c. */
-#line 788 "parse.c"
+#line 793 "parse.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
/* Line 214 of yacc.c. */
-#line 800 "parse.c"
+#line 805 "parse.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short yyrline[] =
{
- 0, 644, 644, 645, 646, 647, 650, 659, 668, 677,
- 686, 695, 706, 707, 708, 709, 710, 711, 712, 713,
- 716, 721, 728, 742, 743, 755, 764, 778, 779, 782,
- 783, 792, 804, 805, 806, 807, 810, 811, 812, 813,
- 816, 836, 860, 864, 872, 873, 874, 875, 876, 882,
- 885, 890, 958, 1012, 1101, 1109, 1114, 1162, 1198, 1214,
- 1215, 1218, 1219, 1222, 1223, 1235, 1236, 1239, 1245, 1251,
- 1257, 1263, 1269, 1275, 1282, 1288, 1294, 1300, 1306, 1312,
- 1318, 1324, 1330, 1336, 1342, 1362, 1371, 1377, 1378, 1381,
- 1384, 1390, 1397, 1406, 1409, 1412, 1416, 1420, 1424, 1429,
- 1437, 1441, 1446, 1450, 1453, 1457, 1460, 1465, 1466, 1467,
- 1468, 1469, 1470, 1471, 1472, 1473, 1476, 1477, 1478, 1481,
- 1482, 1483, 1487, 1494, 1506, 1512, 1524, 1536, 1539, 1545,
- 1550, 1553, 1558, 1559, 1563, 1579, 1595, 1611, 1627, 1638,
- 1644, 1654, 1677, 1688, 1707, 1713, 1714, 1720, 1721, 1732,
- 1743, 1754, 1764, 1774, 1784, 1787, 1788, 1791, 1792, 1795,
- 1798, 1801, 1809, 1819, 1820, 1823, 1840, 1847, 1854, 1861,
- 1868, 1875, 1884, 1893, 1904, 1905, 1908, 1928, 1938, 1947,
- 1958, 1961, 1966, 1975, 1986, 1989, 1995, 1996, 2000, 2001
+ 0, 649, 649, 650, 651, 652, 655, 664, 673, 682,
+ 691, 700, 711, 712, 713, 714, 715, 716, 717, 718,
+ 721, 726, 733, 747, 748, 760, 769, 783, 784, 787,
+ 788, 797, 809, 810, 811, 812, 815, 816, 817, 818,
+ 821, 841, 865, 869, 877, 878, 879, 880, 881, 887,
+ 890, 895, 963, 1017, 1106, 1114, 1119, 1167, 1203, 1219,
+ 1220, 1223, 1224, 1227, 1228, 1240, 1241, 1244, 1250, 1256,
+ 1262, 1268, 1274, 1280, 1287, 1293, 1299, 1305, 1311, 1317,
+ 1323, 1329, 1335, 1341, 1347, 1372, 1381, 1387, 1388, 1391,
+ 1394, 1400, 1407, 1416, 1419, 1422, 1426, 1430, 1434, 1439,
+ 1447, 1451, 1456, 1460, 1463, 1467, 1470, 1475, 1476, 1477,
+ 1478, 1479, 1480, 1481, 1482, 1483, 1486, 1487, 1488, 1491,
+ 1492, 1493, 1497, 1504, 1516, 1522, 1534, 1546, 1549, 1555,
+ 1560, 1563, 1568, 1569, 1573, 1589, 1605, 1621, 1637, 1648,
+ 1654, 1664, 1687, 1698, 1717, 1723, 1724, 1730, 1731, 1742,
+ 1753, 1764, 1774, 1784, 1794, 1797, 1798, 1801, 1802, 1805,
+ 1808, 1811, 1819, 1829, 1830, 1833, 1850, 1857, 1864, 1871,
+ 1878, 1885, 1894, 1903, 1914, 1915, 1918, 1938, 1948, 1957,
+ 1968, 1971, 1976, 1985, 1996, 1999, 2005, 2006, 2010, 2011
};
#endif
switch (yyn)
{
case 2:
-#line 644 "parse.y"
+#line 649 "parse.y"
{ ; }
break;
case 3:
-#line 645 "parse.y"
+#line 650 "parse.y"
{ ; }
break;
case 4:
-#line 646 "parse.y"
+#line 651 "parse.y"
{ ; }
break;
case 5:
-#line 647 "parse.y"
+#line 652 "parse.y"
{ ; }
break;
case 6:
-#line 650 "parse.y"
+#line 655 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", C_CCODE,
break;
case 7:
-#line 659 "parse.y"
+#line 664 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", H_CCODE,
break;
case 8:
-#line 668 "parse.y"
+#line 673 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", HT_CCODE,
break;
case 9:
-#line 677 "parse.y"
+#line 682 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", PH_CCODE,
break;
case 10:
-#line 686 "parse.y"
+#line 691 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", A_CCODE,
break;
case 11:
-#line 695 "parse.y"
+#line 700 "parse.y"
{
Node *node = node_new (CCODE_NODE,
"cctype", AT_CCODE,
break;
case 12:
-#line 706 "parse.y"
+#line 711 "parse.y"
{ ; }
break;
case 13:
-#line 707 "parse.y"
+#line 712 "parse.y"
{ ; }
break;
case 14:
-#line 708 "parse.y"
+#line 713 "parse.y"
{ ; }
break;
case 15:
-#line 709 "parse.y"
+#line 714 "parse.y"
{ ; }
break;
case 16:
-#line 710 "parse.y"
+#line 715 "parse.y"
{ ; }
break;
case 17:
-#line 711 "parse.y"
+#line 716 "parse.y"
{ ; }
break;
case 18:
-#line 712 "parse.y"
+#line 717 "parse.y"
{ ; }
break;
case 19:
-#line 713 "parse.y"
+#line 718 "parse.y"
{ ; }
break;
case 20:
-#line 716 "parse.y"
+#line 721 "parse.y"
{
((Class *)class)->nodes = class_nodes;
class_nodes = NULL;
break;
case 21:
-#line 721 "parse.y"
+#line 726 "parse.y"
{
((Class *)class)->nodes = NULL;
class_nodes = NULL;
break;
case 22:
-#line 728 "parse.y"
+#line 733 "parse.y"
{
class = node_new (CLASS_NODE,
"otype:steal", yyvsp[-3].id,
break;
case 24:
-#line 743 "parse.y"
+#line 748 "parse.y"
{
if(strcmp(yyvsp[-3].id,"chunks") == 0) {
g_free (chunk_size);
break;
case 25:
-#line 755 "parse.y"
+#line 760 "parse.y"
{
if (strcmp (yyvsp[-3].id, "interface") == 0) {
interfaces = g_list_append (interfaces,
break;
case 26:
-#line 764 "parse.y"
+#line 769 "parse.y"
{
if(strcmp(yyvsp[-3].id,"chunks") == 0) {
g_free (chunk_size);
break;
case 27:
-#line 778 "parse.y"
+#line 783 "parse.y"
{ ; }
break;
case 28:
-#line 779 "parse.y"
+#line 784 "parse.y"
{ ; }
break;
case 29:
-#line 782 "parse.y"
+#line 787 "parse.y"
{ ; }
break;
case 30:
-#line 783 "parse.y"
+#line 788 "parse.y"
{
if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
g_free (yyvsp[-1].id);
break;
case 31:
-#line 792 "parse.y"
+#line 797 "parse.y"
{
if (strcmp (yyvsp[-2].id, "interface") != 0) {
g_free (yyvsp[-2].id);
break;
case 32:
-#line 804 "parse.y"
+#line 809 "parse.y"
{ ; }
break;
case 33:
-#line 805 "parse.y"
+#line 810 "parse.y"
{ ; }
break;
case 34:
-#line 806 "parse.y"
+#line 811 "parse.y"
{ ; }
break;
case 35:
-#line 807 "parse.y"
+#line 812 "parse.y"
{ ; }
break;
case 36:
-#line 810 "parse.y"
+#line 815 "parse.y"
{ the_scope = PUBLIC_SCOPE; }
break;
case 37:
-#line 811 "parse.y"
+#line 816 "parse.y"
{ the_scope = PRIVATE_SCOPE; }
break;
case 38:
-#line 812 "parse.y"
+#line 817 "parse.y"
{ the_scope = PROTECTED_SCOPE; }
break;
case 39:
-#line 813 "parse.y"
+#line 818 "parse.y"
{ the_scope = CLASS_SCOPE; }
break;
case 40:
-#line 816 "parse.y"
+#line 821 "parse.y"
{
if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
g_free (yyvsp[-1].id);
break;
case 41:
-#line 836 "parse.y"
+#line 841 "parse.y"
{
if (strcmp (yyvsp[-2].id, "destroy") == 0) {
g_free(yyvsp[-2].id);
break;
case 42:
-#line 860 "parse.y"
+#line 865 "parse.y"
{
initializer = yyvsp[0].id;
initializer_line = ccode_line;
break;
case 43:
-#line 864 "parse.y"
+#line 869 "parse.y"
{
initializer = (yyvsp[0].cbuf)->str;
initializer_line = ccode_line;
break;
case 44:
-#line 872 "parse.y"
+#line 877 "parse.y"
{ ; }
break;
case 45:
-#line 873 "parse.y"
+#line 878 "parse.y"
{ ; }
break;
case 46:
-#line 874 "parse.y"
+#line 879 "parse.y"
{ destructor = NULL; }
break;
case 47:
-#line 875 "parse.y"
+#line 880 "parse.y"
{ initializer = NULL; }
break;
case 48:
-#line 876 "parse.y"
+#line 881 "parse.y"
{
destructor = NULL;
initializer = NULL;
break;
case 49:
-#line 882 "parse.y"
+#line 887 "parse.y"
{
push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
}
break;
case 50:
-#line 885 "parse.y"
+#line 890 "parse.y"
{
push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
}
break;
case 51:
-#line 890 "parse.y"
+#line 895 "parse.y"
{
Node *node = NULL;
if(strcmp(yyvsp[-6].id,"get")==0 &&
break;
case 52:
-#line 958 "parse.y"
+#line 963 "parse.y"
{
Node *node = NULL;
if(strcmp(yyvsp[-3].id, "get") == 0) {
break;
case 53:
-#line 1012 "parse.y"
+#line 1017 "parse.y"
{
Node *node;
char *get, *set = NULL;
break;
case 54:
-#line 1101 "parse.y"
+#line 1106 "parse.y"
{
if (strcmp (yyvsp[-1].id, "export")!=0) {
g_free (yyvsp[-1].id);
break;
case 55:
-#line 1109 "parse.y"
+#line 1114 "parse.y"
{
yyval.id = NULL;
}
break;
case 56:
-#line 1114 "parse.y"
+#line 1119 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 57:
-#line 1162 "parse.y"
+#line 1167 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 58:
-#line 1198 "parse.y"
+#line 1203 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 59:
-#line 1214 "parse.y"
+#line 1219 "parse.y"
{ ; }
break;
case 60:
-#line 1215 "parse.y"
+#line 1220 "parse.y"
{ ; }
break;
case 61:
-#line 1218 "parse.y"
+#line 1223 "parse.y"
{ ; }
break;
case 62:
-#line 1219 "parse.y"
+#line 1224 "parse.y"
{ ; }
break;
case 63:
-#line 1222 "parse.y"
+#line 1227 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 64:
-#line 1223 "parse.y"
+#line 1228 "parse.y"
{
if (strcmp (yyvsp[-3].id, "_") != 0) {
g_free (yyvsp[-3].id);
break;
case 65:
-#line 1235 "parse.y"
+#line 1240 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 66:
-#line 1236 "parse.y"
+#line 1241 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 67:
-#line 1239 "parse.y"
+#line 1244 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 68:
-#line 1245 "parse.y"
+#line 1250 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 69:
-#line 1251 "parse.y"
+#line 1256 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 70:
-#line 1257 "parse.y"
+#line 1262 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 71:
-#line 1263 "parse.y"
+#line 1268 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 72:
-#line 1269 "parse.y"
+#line 1274 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 73:
-#line 1275 "parse.y"
+#line 1280 "parse.y"
{
Type *type = pop_type ();
ensure_property ();
break;
case 74:
-#line 1282 "parse.y"
+#line 1287 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 75:
-#line 1288 "parse.y"
+#line 1293 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 76:
-#line 1294 "parse.y"
+#line 1299 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 77:
-#line 1300 "parse.y"
+#line 1305 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 78:
-#line 1306 "parse.y"
+#line 1311 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 79:
-#line 1312 "parse.y"
+#line 1317 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 80:
-#line 1318 "parse.y"
+#line 1323 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 81:
-#line 1324 "parse.y"
+#line 1329 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 82:
-#line 1330 "parse.y"
+#line 1335 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 83:
-#line 1336 "parse.y"
+#line 1341 "parse.y"
{
ensure_property ();
node_set ((Node *)property,
break;
case 84:
-#line 1342 "parse.y"
+#line 1347 "parse.y"
{
ensure_property ();
- if (strcmp (yyvsp[0].id, "link") == 0) {
+ if (strcmp (yyvsp[0].id, "override") == 0) {
+ g_free(yyvsp[0].id);
+ node_set ((Node *)property,
+ "override", TRUE,
+ NULL);
+ } else if (strcmp (yyvsp[0].id, "link") == 0) {
g_free(yyvsp[0].id);
node_set ((Node *)property,
"link", TRUE,
break;
case 85:
-#line 1362 "parse.y"
+#line 1372 "parse.y"
{
if(strcmp(yyvsp[-2].id,"type")!=0) {
g_free(yyvsp[-4].id);
break;
case 86:
-#line 1371 "parse.y"
+#line 1381 "parse.y"
{
yyval.id = debool (yyvsp[0].id);
typestack = g_list_prepend(typestack,NULL);
break;
case 87:
-#line 1377 "parse.y"
+#line 1387 "parse.y"
{ yyval.list = yyvsp[-1].list; }
break;
case 88:
-#line 1378 "parse.y"
+#line 1388 "parse.y"
{ yyval.list = NULL; }
break;
case 89:
-#line 1381 "parse.y"
+#line 1391 "parse.y"
{
yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
}
break;
case 90:
-#line 1384 "parse.y"
+#line 1394 "parse.y"
{
yyval.list = g_list_append(NULL,yyvsp[0].id);
}
break;
case 91:
-#line 1390 "parse.y"
+#line 1400 "parse.y"
{
Node *node = node_new (TYPE_NODE,
"name:steal", yyvsp[-1].id,
break;
case 92:
-#line 1397 "parse.y"
+#line 1407 "parse.y"
{
Node *node = node_new (TYPE_NODE,
"name:steal", yyvsp[0].id,
break;
case 93:
-#line 1406 "parse.y"
+#line 1416 "parse.y"
{
yyval.id = yyvsp[0].id;
}
break;
case 94:
-#line 1409 "parse.y"
+#line 1419 "parse.y"
{
yyval.id = yyvsp[0].id;
}
break;
case 95:
-#line 1412 "parse.y"
+#line 1422 "parse.y"
{
yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 96:
-#line 1416 "parse.y"
+#line 1426 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
g_free(yyvsp[-1].id);
break;
case 97:
-#line 1420 "parse.y"
+#line 1430 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 98:
-#line 1424 "parse.y"
+#line 1434 "parse.y"
{
yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
yyvsp[0].id, NULL);
break;
case 99:
-#line 1429 "parse.y"
+#line 1439 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-2].id, " ",
yyvsp[-1].id, " const", NULL);
break;
case 100:
-#line 1437 "parse.y"
+#line 1447 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 101:
-#line 1441 "parse.y"
+#line 1451 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
g_free(yyvsp[-1].id);
break;
case 102:
-#line 1446 "parse.y"
+#line 1456 "parse.y"
{
yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 103:
-#line 1450 "parse.y"
+#line 1460 "parse.y"
{
yyval.id = yyvsp[0].id;
}
break;
case 104:
-#line 1453 "parse.y"
+#line 1463 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
g_free(yyvsp[-1].id);
break;
case 105:
-#line 1457 "parse.y"
+#line 1467 "parse.y"
{
yyval.id = g_strdup(yyvsp[0].id);
}
break;
case 106:
-#line 1460 "parse.y"
+#line 1470 "parse.y"
{
yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
}
break;
case 107:
-#line 1465 "parse.y"
+#line 1475 "parse.y"
{ yyval.id = "void"; }
break;
case 108:
-#line 1466 "parse.y"
+#line 1476 "parse.y"
{ yyval.id = "char"; }
break;
case 109:
-#line 1467 "parse.y"
+#line 1477 "parse.y"
{ yyval.id = "short"; }
break;
case 110:
-#line 1468 "parse.y"
+#line 1478 "parse.y"
{ yyval.id = "int"; }
break;
case 111:
-#line 1469 "parse.y"
+#line 1479 "parse.y"
{ yyval.id = "long"; }
break;
case 112:
-#line 1470 "parse.y"
+#line 1480 "parse.y"
{ yyval.id = "float"; }
break;
case 113:
-#line 1471 "parse.y"
+#line 1481 "parse.y"
{ yyval.id = "double"; }
break;
case 114:
-#line 1472 "parse.y"
+#line 1482 "parse.y"
{ yyval.id = "signed"; }
break;
case 115:
-#line 1473 "parse.y"
+#line 1483 "parse.y"
{ yyval.id = "unsigned"; }
break;
case 116:
-#line 1476 "parse.y"
+#line 1486 "parse.y"
{ yyval.id = "struct"; }
break;
case 117:
-#line 1477 "parse.y"
+#line 1487 "parse.y"
{ yyval.id = "union"; }
break;
case 118:
-#line 1478 "parse.y"
+#line 1488 "parse.y"
{ yyval.id = "enum"; }
break;
case 119:
-#line 1481 "parse.y"
+#line 1491 "parse.y"
{ yyval.id = g_strdup("*"); }
break;
case 120:
-#line 1482 "parse.y"
+#line 1492 "parse.y"
{ yyval.id = g_strdup("* const"); }
break;
case 121:
-#line 1483 "parse.y"
+#line 1493 "parse.y"
{
yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 122:
-#line 1487 "parse.y"
+#line 1497 "parse.y"
{
yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
g_free(yyvsp[0].id);
break;
case 123:
-#line 1494 "parse.y"
+#line 1504 "parse.y"
{
if(strcmp(yyvsp[-1].id, "first")==0)
yyval.sigtype = SIGNAL_FIRST_METHOD;
break;
case 124:
-#line 1506 "parse.y"
+#line 1516 "parse.y"
{
yyval.sigtype = SIGNAL_LAST_METHOD;
}
break;
case 125:
-#line 1512 "parse.y"
+#line 1522 "parse.y"
{
if(strcmp(yyvsp[-1].id,"first")==0)
yyval.sigtype = SIGNAL_FIRST_METHOD;
break;
case 126:
-#line 1524 "parse.y"
+#line 1534 "parse.y"
{
if(strcmp(yyvsp[-2].id,"first")==0)
yyval.sigtype = SIGNAL_FIRST_METHOD;
break;
case 127:
-#line 1536 "parse.y"
+#line 1546 "parse.y"
{
yyval.sigtype = SIGNAL_LAST_METHOD;
}
break;
case 128:
-#line 1539 "parse.y"
+#line 1549 "parse.y"
{
/* the_scope was default thus public */
the_scope = PUBLIC_SCOPE;
break;
case 129:
-#line 1545 "parse.y"
+#line 1555 "parse.y"
{
gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
}
break;
case 130:
-#line 1550 "parse.y"
+#line 1560 "parse.y"
{
gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
}
break;
case 131:
-#line 1553 "parse.y"
+#line 1563 "parse.y"
{
gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
}
break;
case 132:
-#line 1558 "parse.y"
+#line 1568 "parse.y"
{ yyval.cbuf = yyvsp[0].cbuf; }
break;
case 133:
-#line 1559 "parse.y"
+#line 1569 "parse.y"
{ yyval.cbuf = NULL; }
break;
case 134:
-#line 1563 "parse.y"
+#line 1573 "parse.y"
{
if(!has_self) {
yyerror(_("signal without 'self' as "
break;
case 135:
-#line 1579 "parse.y"
+#line 1589 "parse.y"
{
if(!has_self) {
yyerror(_("signal without 'self' as "
break;
case 136:
-#line 1595 "parse.y"
+#line 1605 "parse.y"
{
if(!has_self) {
yyerror(_("virtual method without 'self' as "
break;
case 137:
-#line 1611 "parse.y"
+#line 1621 "parse.y"
{
if(!has_self) {
yyerror(_("virtual method without 'self' as "
break;
case 138:
-#line 1627 "parse.y"
+#line 1637 "parse.y"
{
if(!has_self) {
yyerror(_("virtual method without 'self' as "
break;
case 139:
-#line 1638 "parse.y"
+#line 1648 "parse.y"
{
push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
yyvsp[-5].id, yyvsp[0].cbuf,
break;
case 140:
-#line 1644 "parse.y"
+#line 1654 "parse.y"
{
if(the_scope == CLASS_SCOPE) {
yyerror(_("a method cannot be of class scope"));
break;
case 141:
-#line 1654 "parse.y"
+#line 1664 "parse.y"
{
if(strcmp(yyvsp[-4].id, "init")==0) {
push_init_arg(yyvsp[-2].id,FALSE);
break;
case 142:
-#line 1677 "parse.y"
+#line 1687 "parse.y"
{
g_free(onerror); onerror = NULL;
g_free(defreturn); defreturn = NULL;
break;
case 143:
-#line 1688 "parse.y"
+#line 1698 "parse.y"
{
g_free(onerror); onerror = NULL;
g_free(defreturn); defreturn = NULL;
break;
case 144:
-#line 1707 "parse.y"
+#line 1717 "parse.y"
{
g_free(onerror); onerror = NULL;
g_free(defreturn); defreturn = NULL;
break;
case 145:
-#line 1713 "parse.y"
+#line 1723 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 146:
-#line 1714 "parse.y"
+#line 1724 "parse.y"
{
yyval.id = (yyvsp[0].cbuf)->str;
g_string_free(yyvsp[0].cbuf, FALSE);
break;
case 147:
-#line 1720 "parse.y"
+#line 1730 "parse.y"
{ vararg = FALSE; has_self = FALSE; }
break;
case 148:
-#line 1721 "parse.y"
+#line 1731 "parse.y"
{
vararg = FALSE;
has_self = TRUE;
break;
case 149:
-#line 1732 "parse.y"
+#line 1742 "parse.y"
{
vararg = FALSE;
has_self = TRUE;
break;
case 150:
-#line 1743 "parse.y"
+#line 1753 "parse.y"
{
vararg = FALSE;
has_self = TRUE;
break;
case 151:
-#line 1754 "parse.y"
+#line 1764 "parse.y"
{
has_self = TRUE;
if(strcmp(yyvsp[-2].id,"self")==0)
break;
case 152:
-#line 1764 "parse.y"
+#line 1774 "parse.y"
{
has_self = TRUE;
if(strcmp(yyvsp[-3].id,"self")==0)
break;
case 153:
-#line 1774 "parse.y"
+#line 1784 "parse.y"
{
has_self = TRUE;
if(strcmp(yyvsp[-2].id,"self")==0)
break;
case 154:
-#line 1784 "parse.y"
+#line 1794 "parse.y"
{ has_self = FALSE; }
break;
case 155:
-#line 1787 "parse.y"
+#line 1797 "parse.y"
{ vararg = TRUE; }
break;
case 156:
-#line 1788 "parse.y"
+#line 1798 "parse.y"
{ vararg = FALSE; }
break;
case 157:
-#line 1791 "parse.y"
+#line 1801 "parse.y"
{ ; }
break;
case 158:
-#line 1792 "parse.y"
+#line 1802 "parse.y"
{ ; }
break;
case 159:
-#line 1795 "parse.y"
+#line 1805 "parse.y"
{
push_funcarg(yyvsp[0].id,NULL);
}
break;
case 160:
-#line 1798 "parse.y"
+#line 1808 "parse.y"
{
push_funcarg(yyvsp[-1].id,yyvsp[0].id);
}
break;
case 161:
-#line 1801 "parse.y"
+#line 1811 "parse.y"
{
if(strcmp(yyvsp[-2].id,"check")!=0) {
yyerror(_("parse error"));
break;
case 162:
-#line 1809 "parse.y"
+#line 1819 "parse.y"
{
if(strcmp(yyvsp[-2].id,"check")!=0) {
yyerror(_("parse error"));
break;
case 163:
-#line 1819 "parse.y"
+#line 1829 "parse.y"
{ ; }
break;
case 164:
-#line 1820 "parse.y"
+#line 1830 "parse.y"
{ ; }
break;
case 165:
-#line 1823 "parse.y"
+#line 1833 "parse.y"
{
if(strcmp(yyvsp[0].id,"type")==0) {
Node *node = node_new (CHECK_NODE,
break;
case 166:
-#line 1840 "parse.y"
+#line 1850 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", GT_CHECK,
break;
case 167:
-#line 1847 "parse.y"
+#line 1857 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", LT_CHECK,
break;
case 168:
-#line 1854 "parse.y"
+#line 1864 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", GE_CHECK,
break;
case 169:
-#line 1861 "parse.y"
+#line 1871 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", LE_CHECK,
break;
case 170:
-#line 1868 "parse.y"
+#line 1878 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", EQ_CHECK,
break;
case 171:
-#line 1875 "parse.y"
+#line 1885 "parse.y"
{
Node *node = node_new (CHECK_NODE,
"chtype", NE_CHECK,
break;
case 172:
-#line 1884 "parse.y"
+#line 1894 "parse.y"
{
Node *node = node_new (ENUMDEF_NODE,
"etype:steal", yyvsp[-1].id,
break;
case 173:
-#line 1893 "parse.y"
+#line 1903 "parse.y"
{
Node *node = node_new (ENUMDEF_NODE,
"etype:steal", yyvsp[-1].id,
break;
case 174:
-#line 1904 "parse.y"
+#line 1914 "parse.y"
{;}
break;
case 175:
-#line 1905 "parse.y"
+#line 1915 "parse.y"
{;}
break;
case 176:
-#line 1908 "parse.y"
+#line 1918 "parse.y"
{
Node *node;
char *num = yyvsp[0].id;
break;
case 177:
-#line 1928 "parse.y"
+#line 1938 "parse.y"
{
Node *node;
break;
case 178:
-#line 1938 "parse.y"
+#line 1948 "parse.y"
{
Node *node = node_new (FLAGS_NODE,
"ftype:steal", yyvsp[-1].id,
break;
case 179:
-#line 1947 "parse.y"
+#line 1957 "parse.y"
{
Node *node = node_new (FLAGS_NODE,
"ftype:steal", yyvsp[-1].id,
break;
case 180:
-#line 1958 "parse.y"
+#line 1968 "parse.y"
{
flag_vals = g_list_append (flag_vals, yyvsp[0].id);
}
break;
case 181:
-#line 1961 "parse.y"
+#line 1971 "parse.y"
{
flag_vals = g_list_append (flag_vals, yyvsp[0].id);
}
break;
case 182:
-#line 1966 "parse.y"
+#line 1976 "parse.y"
{
Node *node = node_new (ERROR_NODE,
"etype:steal", yyvsp[-1].id,
break;
case 183:
-#line 1975 "parse.y"
+#line 1985 "parse.y"
{
Node *node = node_new (ERROR_NODE,
"etype:steal", yyvsp[-1].id,
break;
case 184:
-#line 1986 "parse.y"
+#line 1996 "parse.y"
{
error_vals = g_list_append (error_vals, yyvsp[0].id);
}
break;
case 185:
-#line 1989 "parse.y"
+#line 1999 "parse.y"
{
error_vals = g_list_append (error_vals, yyvsp[0].id);
}
break;
case 186:
-#line 1995 "parse.y"
+#line 2005 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 187:
-#line 1996 "parse.y"
+#line 2006 "parse.y"
{
yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
g_free(yyvsp[0].id);
break;
case 188:
-#line 2000 "parse.y"
+#line 2010 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
case 189:
-#line 2001 "parse.y"
+#line 2011 "parse.y"
{ yyval.id = yyvsp[0].id; }
break;
}
/* Line 1000 of yacc.c. */
-#line 4074 "parse.c"
+#line 4084 "parse.c"
\f
yyvsp -= yylen;
yyssp -= yylen;
}
-#line 2004 "parse.y"
+#line 2014 "parse.y"