gboolean no_lines = FALSE;
gboolean no_self_alias = FALSE;
gboolean always_private_struct = FALSE;
+gboolean gtk3_ok = FALSE;
+
gint prealloc = 0;
+
+
gboolean use_m4 = FALSE; /* preprocess sources with m4 */
gboolean use_m4_clean = FALSE; /* preprocess sources with m4, no m4 flags */
char *m4_commandline = NULL;
/* hack because glib is braindamaged */
set_func = g_strdup ("g_value_set_uint");
else
- set_func = g_strdup_printf ("g_value_set_%s%s",
- (char *)m->gtktypes->data,
+ set_func = g_strdup_printf ("g_value_%s_%s",
take_ownership ?
- "_take_ownership" : "");
+ "take" : "set",
+ (char *)m->gtktypes->data);
gob_strdown (set_func);
out_printf (out, "\n\t%s (return_value, v_return);\n",
char *name = replace_sep (interface, '_');
char *type = remove_sep (interface);
- /* EEEK! evil, we should have some sort of option
- * to force this for arbitrary interfaces, since
- * some are Class and some are Iface. Glib is shite
- * in consistency. */
- if (strcmp (type, "GtkEditable") == 0 ||
- strcmp (type, "GTypePlugin") == 0)
- end = "Class";
+ if(!gtk3_ok)
+ {
+ /* EEEK! evil, we should have some sort of option
+ * to force this for arbitrary interfaces, since
+ * some are Class and some are Iface. Glib is shite
+ * in consistency. */
+
+ if (strcmp (type, "GtkEditable") == 0 ||
+ strcmp (type, "GTypePlugin") == 0)
+ end = "Class";
+ else
+ // We'll assume Iface is the standard ending
+ end = "Iface";
+ }
else
- /* We'll assume Iface is the standard ending */
- end = "Iface";
-
+ {
+ /*GTK3 doesn't need Iface end*/
+ end="Interface";
+ }
+
out_printf (out, "\nstatic void\n"
"___%s_init (%s%s *iface)\n"
"{\n",
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\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,
+ sig, m->signal_name /*m->id* if not given signal_name*/,
flags,
typebase, m->id, mar,
(char *)m->gtktypes->data,
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);
+ "\t\t\"%s\");\n", s, value_for_print (p->canonical_name, p->name) );
g_free (s);
} else {
GString *flags;
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "-128"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "0"),
"\t\t %s /* blurb */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->default_value, "FALSE"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "G_MININT"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "0"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "G_MINLONG"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "0"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "G_MININT64"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "0"),
"\t\t %s /* blurb */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->default_value, "0"),
"\t\t %s /* enum_type */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
type,
"\t\t %s /* flags_type */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
type,
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "-G_MAXFLOAT"),
"\t\t %s /* maximum */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->minimum, "-G_MAXDOUBLE"),
"\t\t %s /* blurb */,\n"
"\t\t %s /* default_value */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
value_for_print (p->default_value, "NULL"),
"\t\t %s /* blurb */,\n"
"\t\t %s /* param_type */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
type,
"\t\t %s /* blurb */,\n"
"\t\t %s /* boxed_type */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
type,
"\t\t %s /* nick */,\n"
"\t\t %s /* blurb */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
flags->str);
"\t\t %s /* nick */,\n"
"\t\t %s /* blurb */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
flags->str);
"\t\t %s /* blurb */,\n"
"\t\t %s /* object_type */,\n"
"\t\t %s);\n",
- p->name,
+ value_for_print (p->canonical_name, p->name),
value_for_print (p->nick, "NULL"),
value_for_print (p->blurb, "NULL"),
type,
"\t-o,--output-dir The directory where output "
"should be placed\n"
"\t--file-sep[=c] replace default \'-\' file "
- "name separator\n\n");
+ "name separator\n\n"
+ "\t--gtk3 Use gtk+3\n"
+ );
fprintf(stderr, "End world hunger, donate to the World Food Programme, http://www.wfp.org\n");
}
} else {
file_sep = 0;
}
+ } else if(strcmp(argv[i], "--gtk3")==0) {
+ gtk3_ok = TRUE;
} else if(strcmp(argv[i], "--")==0) {
/*further arguments are files*/
no_opts = TRUE;