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
This commit is contained in:
Michael R Sweet 2003-06-01 00:23:57 +00:00
parent 0aa85c540c
commit 9c7ec90412
6 changed files with 116 additions and 9 deletions

View File

@ -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 $".
#

View File

@ -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 $".
//

BIN
fluid/fluid.icns Normal file

Binary file not shown.

1
fluid/fluid.info Normal file
View File

@ -0,0 +1 @@
FLIDFlid

68
fluid/fluid.plist Normal file
View File

@ -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>

View File

@ -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 $".
//