+static char *
+make_run_signal_flags(Method *m, gboolean last)
+{
+ GList *li;
+ GString *gs;
+ char *flags[] = {
+ "FIRST",
+ "LAST",
+ "BOTH",
+ "NO_RECURSE",
+ "ACTION",
+ "NO_HOOKS",
+ NULL
+ };
+
+ gs = g_string_new(NULL);
+
+ if(last)
+ g_string_assign(gs, "GTK_RUN_LAST");
+ else
+ g_string_assign(gs, "GTK_RUN_FIRST");
+
+ if(m->scope == PUBLIC_SCOPE)
+ g_string_append(gs, " | GTK_RUN_ACTION");
+
+ for(li = m->flags; li; li = li->next) {
+ char *flag = li->data;
+ int i;
+ for(i=0;flags[i];i++) {
+ if(strcmp(flags[i],flag)==0)
+ break;
+ }
+ /* if we haven't found it in our list */
+ if(!flags[i]) {
+ char *s;
+ s = g_strdup_printf("Unknown flag '%s' used, "
+ "perhaps it was misspelled",
+ flag);
+ print_error(TRUE, s, m->line_no);
+ g_free(s);
+ }
+ g_string_sprintfa(gs, " | GTK_RUN_%s",flag);
+ }
+
+ {
+ char *ret = gs->str;
+ g_string_free(gs, FALSE);
+ return ret;
+ }
+}
+
+