From c147aca0541e9f45b1bd9c8eed4ec71cb1c650ec Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 25 Nov 2001 16:38:11 +0000 Subject: Add flstring.h header file to include string functions, strcasecmp definitions, and (v)snprintf function declarations... Fix Fl_File_Chooser so it always checks for an empty directory_ (so that is doesn't add the leading slash to drive letters and mount points) Make Fl_File_Icon use Fl_Shared_Image, and look in all KDE icon directories. Fl::error() no longer exits by default; only Fl::fatal() does... Wasn't doing callbacks in Fl_Tabs when the current tab was changed via the keyboard. FLUID wasn't writing the tooltips in message files, and didn't count tooltips when computing the message number for catgets. Update dependencies. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/code.cxx | 122 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 87 insertions(+), 35 deletions(-) (limited to 'fluid/code.cxx') diff --git a/fluid/code.cxx b/fluid/code.cxx index f523ec085..3356fd8c6 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -1,5 +1,5 @@ // -// "$Id: code.cxx,v 1.9.2.9.2.1 2001/08/02 16:17:04 easysw Exp $" +// "$Id: code.cxx,v 1.9.2.9.2.2 2001/11/25 16:38:11 easysw Exp $" // // Code output routines for the Fast Light Tool Kit (FLTK). // @@ -335,6 +335,7 @@ int write_code(const char *s, const char *t) { int write_strings(const char *sfile) { FILE *fp = fopen(sfile, "w"); Fl_Type *p; + Fl_Widget_Type *w; int i; if (!fp) return 1; @@ -344,13 +345,26 @@ int write_strings(const char *sfile) { fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { - if (p->is_widget() && p->label() && !((Fl_Widget_Type *)p)->image) { - for (const char *s = p->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); - putc('\n', fp); + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + putc('\n', fp); + } + + if (w->tooltip()) { + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + putc('\n', fp); + } } } break; @@ -358,24 +372,48 @@ int write_strings(const char *sfile) { fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { - if (p->is_widget() && p->label() && !((Fl_Widget_Type *)p)->image) { - const char *s; - - fputs("msgid \"", fp); - for (s = p->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); - fputs("\"\n", fp); - - fputs("msgstr \"", fp); - for (s = p->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); - fputs("\"\n", fp); + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + const char *s; + + fputs("msgid \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + + fputs("msgstr \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + + if (w->tooltip()) { + const char *s; + + fputs("msgid \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + + fputs("msgstr \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } } } break; @@ -386,14 +424,28 @@ int write_strings(const char *sfile) { fputs("$quote \"\n", fp); for (i = 1, p = Fl_Type::first; p; p = p->next) { - if (p->is_widget() && p->label() && !((Fl_Widget_Type *)p)->image) { - fprintf(fp, "%d \"", i ++); - for (const char *s = p->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); - fputs("\"\n", fp); + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + + if (w->tooltip()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } } } break; @@ -412,5 +464,5 @@ void Fl_Type::write_code1() { void Fl_Type::write_code2() {} // -// End of "$Id: code.cxx,v 1.9.2.9.2.1 2001/08/02 16:17:04 easysw Exp $". +// End of "$Id: code.cxx,v 1.9.2.9.2.2 2001/11/25 16:38:11 easysw Exp $". // -- cgit v1.2.3