From 9c7ec90412754b36441871b6869ba582b10bb51a Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 1 Jun 2003 00:23:57 +0000 Subject: Fix open-documents callback stuff. Add open documents callback to FLUID. Add FLUID application to fltk.list file for packaging. Add FLUID application icon and data files. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3020 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/fluid.cxx | 32 +++++++++++++++++++++++-- fluid/fluid.icns | Bin 0 -> 44080 bytes fluid/fluid.info | 1 + fluid/fluid.plist | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 fluid/fluid.icns create mode 100644 fluid/fluid.info create mode 100644 fluid/fluid.plist (limited to 'fluid') diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index edf298092..2cc9096a3 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -1,5 +1,5 @@ // -// "$Id: fluid.cxx,v 1.15.2.13.2.37 2003/04/01 19:58:08 easysw Exp $" +// "$Id: fluid.cxx,v 1.15.2.13.2.38 2003/06/01 00:23:57 easysw Exp $" // // FLUID main entry for the Fast Light Tool Kit (FLTK). // @@ -178,6 +178,30 @@ void exit_cb(Fl_Widget *,void *) { exit(0); } +#ifdef __APPLE__ +# include + +void +apple_open_cb(const char *c) { + if (modflag && !fl_ask("Discard changes?")) return; + const char *oldfilename; + oldfilename = filename; + filename = NULL; + set_filename(c); + if (!read_file(c, 0)) { + fl_message("Can't read %s: %s", c, strerror(errno)); + free((void *)filename); + filename = oldfilename; + if (main_window) main_window->label(filename); + return; + } + + // Loaded a file; free the old filename... + modflag = 0; + if (oldfilename) free((void *)oldfilename); +} +#endif // __APPLE__ + void open_cb(Fl_Widget *, void *v) { if (!v && modflag && !fl_ask("Discard changes?")) return; const char *c; @@ -820,6 +844,10 @@ int main(int argc,char **argv) { make_main_window(); +#ifdef __APPLE__ + fl_open_callback(apple_open_cb); +#endif // __APPLE__ + if (c) set_filename(c); if (!compile_only) { Fl::visual((Fl_Mode)(FL_DOUBLE|FL_INDEX)); @@ -856,5 +884,5 @@ int main(int argc,char **argv) { } // -// End of "$Id: fluid.cxx,v 1.15.2.13.2.37 2003/04/01 19:58:08 easysw Exp $". +// End of "$Id: fluid.cxx,v 1.15.2.13.2.38 2003/06/01 00:23:57 easysw Exp $". // diff --git a/fluid/fluid.icns b/fluid/fluid.icns new file mode 100644 index 000000000..361eaa56a Binary files /dev/null and b/fluid/fluid.icns differ diff --git a/fluid/fluid.info b/fluid/fluid.info new file mode 100644 index 000000000..c5f93635d --- /dev/null +++ b/fluid/fluid.info @@ -0,0 +1 @@ +FLIDFlid diff --git a/fluid/fluid.plist b/fluid/fluid.plist new file mode 100644 index 000000000..b6fc19bdf --- /dev/null +++ b/fluid/fluid.plist @@ -0,0 +1,68 @@ + + + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleExecutable + fluid + + CFBundleIdentifier + org.fltk.fluid + + CFBundleVersion + 1.1.4 + + CFBundleDevelopmentRegion + English + + NSHumanReadableCopyright + Copyright 1998-2003 by Bill Spitzak and others + + CFAppleHelpAnchor + help + + CFBundleName + FLUID + + CFBundlePackageType + APPL + + CFBundleSignature + FLID + + CFBundleIconFile + fluid.icns + + CFBundleShortVersionString + 1.1.4 + + CFBundleGetInfoString + 1.1.4, Copyright 1998-2003 by Bill Spitzak and others + + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + fl + + + CFBundleTypeIconFile + fluid.icns + + CFBundleTypeName + FLUID Designer File + + CFBundleTypeOSTypes + + Flid + + + CFBundleTypeRole + Editor + + + + + -- cgit v1.2.3