+ is_none = (strcmp(m->gtktypes->next->data, "NONE")==0);
+
+ sig = g_strdup (m->id);
+ gob_strup (sig);
+ flags = make_run_signal_flags (m, last);
+ out_printf (out, "\tobject_signals[%s_SIGNAL] =\n"
+ "\t\tg_signal_new (\"%s\",\n"
+ "\t\t\tG_TYPE_FROM_CLASS (g_object_class),\n"
+ "\t\t\t(GSignalFlags)(%s),\n"
+ "\t\t\tG_STRUCT_OFFSET (%sClass, %s),\n"
+ "\t\t\tNULL, NULL,\n"
+ "\t\t\t%s,\n"
+ "\t\t\tG_TYPE_%s, %d",
+ sig, m->id,
+ flags,
+ typebase, m->id, mar,
+ (char *)m->gtktypes->data,
+ is_none ? 0 : g_list_length(m->gtktypes->next));
+ g_free(mar);
+ g_free(sig);
+ g_free(flags);
+
+ if( ! is_none) {
+ GList *l;
+ char *t;
+ for(l = m->gtktypes->next; l != NULL; l = l->next) {
+ char *str = l->data;
+ if (strncmp (str, "BOXED_", 6) == 0)
+ t = g_strdup (&(str[6]));
+ else
+ t = g_strconcat ("G_TYPE_", str, NULL);
+ out_printf (out, ",\n\t\t\t%s", t);
+ g_free (t);
+ }
+ }
+
+ out_printf(out, ");\n");
+
+ if(strcmp(m->gtktypes->data, "NONE") != 0 ||
+ ! is_none) {
+ GList *gl, *al;
+ out_printf(out, "\tif ___GOB_UNLIKELY(");
+ if(strcmp(m->gtktypes->data, "NONE") != 0) {
+ out_printf(out, "sizeof(");
+ print_type(out, m->mtype, FALSE);
+ out_printf(out, "%s",
+ m->mtype->postfix ?
+ m->mtype->postfix : "");
+ out_printf(out, ") != sizeof(%s) || ",
+ get_cast(m->gtktypes->data, FALSE));
+ }
+
+ for(al = m->args->next, gl = m->gtktypes->next;
+ al != NULL && gl != NULL;
+ al = al->next, gl = gl->next) {
+ FuncArg *arg = al->data;
+ char *gtkarg = gl->data;
+
+ out_printf(out, "sizeof(");
+ print_type(out, arg->atype, FALSE);
+ out_printf(out, "%s",
+ arg->atype->postfix ?
+ arg->atype->postfix : "");
+ out_printf(out, ") != sizeof(%s) || ",
+ get_cast(gtkarg, FALSE));
+ }
+
+ out_printf (out,
+ "parent_class == NULL /* avoid warning */");
+
+ out_printf(out, ") {\n"
+ "\t\tg_error(\"%s line %d: Type mismatch "
+ "of \\\"%s\\\" signal signature\");\n"
+ "\t}\n",
+ filename, m->line_no, m->id);
+
+ }
+ }
+}
+
+static void
+set_def_handlers(Class *c, const char *oname)
+{
+ GList *li;
+ gboolean set_line = FALSE;
+
+ out_printf(out, "\n");
+ for(li = c->nodes; li; li = g_list_next(li)) {
+ Node *n = li->data;
+ Method *m = (Method *)n;
+
+ if(n->type != METHOD_NODE ||
+ (m->method != SIGNAL_FIRST_METHOD &&
+ m->method != SIGNAL_LAST_METHOD &&
+ m->method != VIRTUAL_METHOD &&
+ m->method != OVERRIDE_METHOD))
+ continue;
+
+ if(m->line_no > 0 && m->cbuf) {
+ out_addline_infile(out, m->line_no);
+ set_line = TRUE;
+ } else if(set_line) {
+ out_addline_outfile(out);
+ set_line = FALSE;
+ }
+
+
+ if (m->method == OVERRIDE_METHOD) {
+ char *s;
+ s = replace_sep (m->otype, '_');
+ gob_strdown (s);
+
+ if (need_dispose &&
+ dispose_handler != NULL &&
+ strcmp (m->id, "dispose") == 0)
+ out_printf (out, "\tg_object_class->dispose "
+ "= ___dispose;\n");
+ else if (need_finalize &&
+ finalize_handler &&
+ strcmp(m->id, "finalize") == 0)
+ out_printf(out,
+ "\tg_object_class->finalize = ___finalize;\n");
+ else if (m->cbuf != NULL)
+ out_printf(out,
+ "\t%s_class->%s = ___%x_%s_%s;\n",
+ s, m->id, (guint)m->unique_id,
+ funcbase, m->id);
+ else
+ out_printf(out, "\t%s_class->%s = NULL;\n",
+ s, m->id);
+ } else {
+ if(m->cbuf)
+ out_printf(out, "\t%s->%s = ___real_%s_%s;\n",
+ oname, m->id,
+ funcbase, m->id);
+ else
+ out_printf(out, "\t%s->%s = NULL;\n",
+ oname, m->id);
+ }
+ }
+ if(set_line)
+ out_addline_outfile(out);
+}
+
+static void
+make_argument (Argument *a)
+{
+ GString *flags;
+ GList *l;
+ char *s;
+ char *argflags[] = {
+ "CONSTRUCT",
+ "CONSTRUCT_ONLY",
+ "LAX_VALIDATION",
+ "PRIVATE",
+ NULL
+ };
+
+ flags = g_string_new ("(GParamFlags)(");
+
+ if(a->get && a->set)
+ g_string_append (flags, "G_PARAM_READABLE | G_PARAM_WRITABLE");
+ else if(a->get)
+ g_string_append (flags, "G_PARAM_READABLE");
+ else
+ g_string_append (flags, "G_PARAM_WRITABLE");
+
+ g_assert(a->get || a->set);
+
+ for (l = a->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, a->line_no,
+ "READABLE and "
+ "WRITABLE argument flags are "
+ "set automatically");
+ continue;
+ }
+ for(i = 0; argflags[i]; i++) {
+ if(strcmp(argflags[i], flag)==0)
+ break;
+ }
+ g_string_sprintfa(flags, " | %s%s", argflags[i] ? "G_PARAM_" : "", flag);
+ }
+
+ g_string_append (flags, ")");
+
+ s = g_strdup(a->name);
+ gob_strup (s);
+ if (!strcmp (a->gtktype, "ENUM"))
+ out_printf(out, "\tparam_spec = g_param_spec_enum (\"%s\", NULL, NULL,\n"
+ "\t\tG_TYPE_ENUM, 0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ if (!strcmp (a->gtktype, "FLAGS"))
+ out_printf(out, "\tparam_spec = g_param_spec_flags (\"%s\", NULL, NULL,\n"
+ "\t\tG_TYPE_FLAGS, 0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "OBJECT"))
+ out_printf(out, "\tparam_spec = g_param_spec_object (\"%s\", NULL, NULL,\n"
+ "\t\tG_TYPE_OBJECT,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "STRING"))
+ out_printf(out, "\tparam_spec = g_param_spec_string (\"%s\", NULL, NULL,\n"
+ "\t\tNULL,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "INT"))
+ out_printf(out, "\tparam_spec = g_param_spec_int (\"%s\", NULL, NULL,\n"
+ "\t\tG_MININT, G_MAXINT,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "UINT"))
+ out_printf(out, "\tparam_spec = g_param_spec_uint (\"%s\", NULL, NULL,\n"
+ "\t\t0, G_MAXUINT,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "INT"))
+ out_printf(out, "\tparam_spec = g_param_spec_int (\"%s\", NULL, NULL,\n"
+ "\t\tG_MININT, G_MAXINT,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "CHAR"))
+ out_printf(out, "\tparam_spec = g_param_spec_char (\"%s\", NULL, NULL,\n"
+ "\t\t-128, 127,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "UCHAR"))
+ out_printf(out, "\tparam_spec = g_param_spec_uchar (\"%s\", NULL, NULL,\n"
+ "\t\t0, 0xFF,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "BOOL") ||
+ !strcmp (a->gtktype, "BOOLEAN"))
+ out_printf(out, "\tparam_spec = g_param_spec_boolean (\"%s\", NULL, NULL,\n"
+ "\t\tFALSE,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "LONG"))
+ out_printf(out, "\tparam_spec = g_param_spec_long (\"%s\", NULL, NULL,\n"
+ "\t\tG_MINLONG, G_MAXLONG,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "ULONG"))
+ out_printf(out, "\tparam_spec = g_param_spec_ulong (\"%s\", NULL, NULL,\n"
+ "\t\t0, G_MAXULONG,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "INT64"))
+ out_printf(out, "\tparam_spec = g_param_spec_int64 (\"%s\", NULL, NULL,\n"
+ "\t\tG_MININT64, G_MAXINT64,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "UINT64"))
+ out_printf(out, "\tparam_spec = g_param_spec_uint64 (\"%s\", NULL, NULL,\n"
+ "\t\t0, G_MAXUINT64,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "FLOAT"))
+ out_printf(out, "\tparam_spec = g_param_spec_float (\"%s\", NULL, NULL,\n"
+ "\t\t-G_MAXFLOAT, G_MAXFLOAT,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "DOUBLE"))
+ out_printf(out, "\tparam_spec = g_param_spec_double (\"%s\", NULL, NULL,\n"
+ "\t\t-G_MAXDOUBLE, G_MAXDOUBLE,\n"
+ "\t\t0,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else if (!strcmp (a->gtktype, "POINTER"))
+ out_printf(out, "\tparam_spec = g_param_spec_pointer (\"%s\", NULL, NULL,\n"
+ "\t\t%s);\n",
+ a->name, flags->str);
+ else
+ error_printf (GOB_ERROR, a->line_no,
+ "%s type is not supported for arguments, try using properties",
+ a->gtktype);
+
+ out_printf(out, "\tg_object_class_install_property (g_object_class,\n"
+ "\t\tPROP_%s, param_spec);\n", s);
+
+
+ g_free(s);
+ g_string_free(flags, TRUE);
+}
+
+#define value_for_print(str, alt) (str != NULL ? str : alt)
+
+static void
+make_property (Property *p)
+{
+ char *s;
+
+ if (p->get == NULL && p->set == NULL) {
+ error_print (GOB_ERROR, p->line_no,
+ "Property has no getter nor setter");
+ }
+
+ 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",
+ "LAX_VALIDATION",
+ "PRIVATE",
+ 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;
+ }
+ g_string_sprintfa(flags, " | %s%s", argflags[i] ? "G_PARAM_" : "", 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_MAXFLOAT"),
+ 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_MAXDOUBLE"),
+ 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);
+ }
+
+ 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
+make_arguments(Class *c)
+{
+ GList *li;
+ if (get_properties > 0)
+ 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");
+ 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;
+ }