21 #include "../src/flstring.h" 41 return (c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_';
63 const char*
unique_id(
void* o,
const char* type,
const char*
name,
const char* label) {
66 while (*type) *q++ = *type++;
69 if (!n || !*n) n = label;
71 while (*n && !
is_id(*n)) n++;
72 while (
is_id(*n)) *q++ = *n++;
79 int i = strcmp(
buffer, (*p)->text);
81 if ((*p)->object == o)
return (*p)->text;
83 sprintf(q,
"%x",++which);
87 else if (i < 0)
p = &((*p)->left);
88 else p = &((*p)->right);
130 va_start(args, format);
135 int i = strcmp(
buf,(*p)->text);
137 else if (i < 0)
p = &((*p)->left);
138 else p = &((*p)->right);
166 case '\b': c =
'b';
goto QUOTED;
167 case '\t': c =
't';
goto QUOTED;
168 case '\n': c =
'n';
goto QUOTED;
169 case '\f': c =
'f';
goto QUOTED;
170 case '\r': c =
'r';
goto QUOTED;
175 if (linelength >= 77) {fputs(
"\\\n",
code_file); linelength = 0;}
181 if (
p-2 >= s && *(
p-2) ==
'?')
goto QUOTED;
184 if (c >=
' ' && c < 127) {
186 if (linelength >= 78) {fputs(
"\\\n",
code_file); linelength = 0;}
194 if (linelength >= 76) {fputs(
"\\\n",
code_file); linelength = 0;}
198 if (linelength >= 75) {fputs(
"\\\n",
code_file); linelength = 0;}
202 if (linelength >= 74) {fputs(
"\\\n",
code_file); linelength = 0;}
210 if (
p < e && ( (c>=
'0'&&c<=
'9') || (c>=
'a'&&c<=
'f') || (c>=
'A'&&c<=
'F') )) {
212 if (linelength >= 79) {fputs(
"\n",
code_file); linelength = 0;}
232 fprintf(
code_file,
"{ /* ... %d bytes of binary data... */ }",
length);
234 fprintf(
code_file,
"{ /* ... binary data... */ }");
238 fprintf(
code_file,
"{ /* ... undefined size binary data... */ }");
241 const unsigned char *w = (
const unsigned char *)s;
242 const unsigned char *e = w+
length;
246 unsigned char c = *w++;
247 if (c>99) linelength += 4;
248 else if (c>9) linelength += 3;
249 else linelength += 2;
250 if (linelength >= 77) {fputs(
"\n",
code_file); linelength = 0;}
267 va_start(args, format);
275 va_start(args, format);
290 if (
p->header_position_end==-1)
299 if (
p->is_widget() &&
p->is_class()) {
301 for (q =
p->next; q && q->
level >
p->level;) {
304 int level = q->
level;
307 }
while (q && q->
level > level);
314 for (q =
p->next; q && q->
level >
p->level;) {
317 int level = q->
level;
320 }
while (q && q->
level > level);
333 if (
p->header_position_end==-1)
343 const char *filemode =
"w";
377 first_type = first_type->
next;
381 // generated by Fast Light User Interface Designer (fluid) version %.4f\n\n";
385 {
char define_name[102];
387 char*
b = define_name;
388 if (!isalpha(*a)) {*
b++ =
'_';}
389 while (*a) {*
b++ = isalnum(*a) ? *a :
'_'; a++;}
405 write_c(
"// Initialize I18N stuff now for menus...\n");
406 write_c(
"#include <locale.h>\n");
407 write_c(
"static char *_locale = setlocale(LC_MESSAGES, \"\");\n");
408 write_c(
"static nl_catd _catalog = catopen(\"%s\", 0);\n",
417 write_c(
"#include \"%s\"\n", t);
426 if (
p->header_position==
p->header_position_end)
p->header_position_end = -1;
428 for (
Fl_Type* q =
p->next; q && q->level >
p->level; q = q->next) {
433 if (q->header_position==q->header_position_end) q->header_position_end = -1;
463 return x >= 0 &&
y >= 0;
476 fprintf(fp,
"# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
479 if (
p->is_widget()) {
483 for (
const char *s = w->
label(); *s; s ++)
484 if (*s < 32 || *s > 126 || *s ==
'\"')
485 fprintf(fp,
"\\%03o", *s);
492 for (
const char *s = w->
tooltip(); *s; s ++)
493 if (*s < 32 || *s > 126 || *s ==
'\"')
494 fprintf(fp,
"\\%03o", *s);
503 fprintf(fp,
"# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
506 if (
p->is_widget()) {
512 fputs(
"msgid \"", fp);
513 for (s = w->
label(); *s; s ++)
514 if (*s < 32 || *s > 126 || *s ==
'\"')
515 fprintf(fp,
"\\%03o", *s);
520 fputs(
"msgstr \"", fp);
521 for (s = w->
label(); *s; s ++)
522 if (*s < 32 || *s > 126 || *s ==
'\"')
523 fprintf(fp,
"\\%03o", *s);
532 fputs(
"msgid \"", fp);
533 for (s = w->
tooltip(); *s; s ++)
534 if (*s < 32 || *s > 126 || *s ==
'\"')
535 fprintf(fp,
"\\%03o", *s);
540 fputs(
"msgstr \"", fp);
541 for (s = w->
tooltip(); *s; s ++)
542 if (*s < 32 || *s > 126 || *s ==
'\"')
543 fprintf(fp,
"\\%03o", *s);
552 fprintf(fp,
"$ generated by Fast Light User Interface Designer (fluid) version %.4f\n",
555 fputs(
"$quote \"\n", fp);
558 if (
p->is_widget()) {
562 fprintf(fp,
"%d \"", i ++);
563 for (
const char *s = w->
label(); *s; s ++)
564 if (*s < 32 || *s > 126 || *s ==
'\"')
565 fprintf(fp,
"\\%03o", *s);
572 fprintf(fp,
"%d \"", i ++);
573 for (
const char *s = w->
tooltip(); *s; s ++)
574 if (*s < 32 || *s > 126 || *s ==
'\"')
575 fprintf(fp,
"\\%03o", *s);