summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2003-06-01 00:23:57 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2003-06-01 00:23:57 +0000
commit9c7ec90412754b36441871b6869ba582b10bb51a (patch)
treef77e17eec5e2e0dbfea3f7c7b5c3f8db1638d182
parent0aa85c540cc0b440d6ae46720f3496ce3733d4db (diff)
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
-rw-r--r--fltk.list.in16
-rw-r--r--fluid/fluid.cxx32
-rw-r--r--fluid/fluid.icnsbin0 -> 44080 bytes
-rw-r--r--fluid/fluid.info1
-rw-r--r--fluid/fluid.plist68
-rw-r--r--src/Fl_mac.cxx8
6 files changed, 116 insertions, 9 deletions
diff --git a/fltk.list.in b/fltk.list.in
index db1c2970f..5b564c8f3 100644
--- a/fltk.list.in
+++ b/fltk.list.in
@@ -1,5 +1,5 @@
#
-# "$Id: fltk.list.in,v 1.1.2.9 2003/01/30 21:38:22 easysw Exp $"
+# "$Id: fltk.list.in,v 1.1.2.10 2003/06/01 00:23:56 easysw Exp $"
#
# EPM product list file for the Fast Light Tool Kit (FLTK).
#
@@ -52,8 +52,18 @@ $GLLIBNAME=@GLLIBNAME@
$FLUID=@FLUID@
%system darwin
-%postinstall $bindir/fltk-config -post $bindir/fluid
f 0444 root sys $includedir/FL/mac.r FL/mac.r
+
+d 0555 root sys /Applications/fluid.app -
+d 0555 root sys /Applications/fluid.app/Contents -
+f 0444 root sys /Applications/fluid.app/Info.plist fluid/fluid.plist
+f 0444 root sys /Applications/fluid.app/PkgInfo fluid/fluid.info
+d 0555 root sys /Applications/fluid.app/Contents/MacOS -
+l 0555 root sys /Applications/fluid.app/Contents/MacOS/fluid $bindir/fluid
+d 0555 root sys /Applications/fluid.app/Contents/Resources -
+f 0444 root sys /Applications/fluid.app/Contents/Resources/fluid.icns fluid/fluid.icns
+%postinstall $bindir/fltk-config --post $bindir/fluid
+%postremove /bin/rm -rf /Applications/fluid.app
%system all
# FLUID
@@ -251,5 +261,5 @@ f 0444 root sys $datadir/doc/fltk/COPYING COPYING
f 0444 root sys $datadir/doc/fltk/CHANGES CHANGES
#
-# End of "$Id: fltk.list.in,v 1.1.2.9 2003/01/30 21:38:22 easysw Exp $".
+# End of "$Id: fltk.list.in,v 1.1.2.10 2003/06/01 00:23:56 easysw Exp $".
#
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 <FL/x.H>
+
+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
--- /dev/null
+++ b/fluid/fluid.icns
Binary files 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="0.9">
+ <dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleExecutable</key>
+ <string>fluid</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>org.fltk.fluid</string>
+
+ <key>CFBundleVersion</key>
+ <string>1.1.4</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 1998-2003 by Bill Spitzak and others</string>
+
+ <key>CFAppleHelpAnchor</key>
+ <string>help</string>
+
+ <key>CFBundleName</key>
+ <string>FLUID</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleSignature</key>
+ <string>FLID</string>
+
+ <key>CFBundleIconFile</key>
+ <string>fluid.icns</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>1.1.4</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>1.1.4, Copyright 1998-2003 by Bill Spitzak and others</string>
+
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>fl</string>
+ </array>
+
+ <key>CFBundleTypeIconFile</key>
+ <string>fluid.icns</string>
+
+ <key>CFBundleTypeName</key>
+ <string>FLUID Designer File</string>
+
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>Flid</string>
+ </array>
+
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ </array>
+
+ </dict>
+</plist>
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx
index 779d20112..fe046222e 100644
--- a/src/Fl_mac.cxx
+++ b/src/Fl_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_mac.cxx,v 1.1.2.44 2003/05/30 07:03:09 easysw Exp $"
+// "$Id: Fl_mac.cxx,v 1.1.2.45 2003/06/01 00:23:57 easysw Exp $"
//
// MacOS specific code for the Fast Light Tool Kit (FLTK).
//
@@ -1026,10 +1026,10 @@ static OSErr OpenAppleEventHandler(const AppleEvent *appleEvt,
fl_lock_function();
// Open the documents via the callback...
- if (AECountItems(theDocuments, &n) == noErr) {
+ if (AECountItems(&documents, &n) == noErr) {
for (i = 1; i <= n; i ++) {
// Get the next FSSpec record...
- AEGetNthPtr(theDocuments, i, typeFSS, &keyWd, &typeCd,
+ AEGetNthPtr(&documents, i, typeFSS, &keyWd, &typeCd,
(Ptr)&fileSpec, sizeof(fileSpec),
(actSz = sizeof(fileSpec), &actSz));
@@ -1861,6 +1861,6 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) {
//
-// End of "$Id: Fl_mac.cxx,v 1.1.2.44 2003/05/30 07:03:09 easysw Exp $".
+// End of "$Id: Fl_mac.cxx,v 1.1.2.45 2003/06/01 00:23:57 easysw Exp $".
//