Closed davelab6 closed 11 years ago
From digging around, osx passes some info to the app bundle when starting (the -psn_ thing). The app itself needs to get Apple Events from the OS, and while it does the app start and quit events, the following line for OpenDocuments never has it's callback run.
err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
NewAEEventHandlerUPP(OpenDocumentsAE), 0, false);
There is also some info on moving from carbon to cocoa here and at other places. I'll skip ahead from here to something else and come back to this issue later.
http://stackoverflow.com/questions/7892669/getting-appleevents-in-qt-cocoa
Using one of these on the mac might be the simple road forward... http://gtk-osx.sourceforge.net/ige-mac-integration/GtkOSXApplication.html
yes, it brings in a gtk dep, but if that allows the "openfile" stuff to trickle in on 10.6+ and we can do other "maccy" things then it might be an acceptable trade.
If this dep is only needed to build the mac version, I think its ok
imo there's a bundle of good reasons for doing this. We should at least give it a good testing :) Is this like the qt for osx widget library kit? that e.g. ttfautohintGUI uses? Does it give Cocoa mac widgets/GUI on OSX and gtk widgets/GUIunder gnu+linux ?
-v
On 18 Jan 2013, at 07:02, Dave Crossland notifications@github.com wrote:
If this dep is only needed to build the mac version, I think its ok
— Reply to this email directly or view it on GitHub.
No, it wouldn't be used in f f to that extent. And gtk for OS x only integrates the menus, the buttons and dials are normal gtk. See gimp and inkacapes Mac native builds.
Well, that turned out to be an interesting little endeavour. Using gtkosxapp requires gtk2 to be built with the variant +quartz but doing that needs -nox11. And gtk2 built with quartz needs pango and cairo to be made that way too. I don't think you can use the pango to render to a raw X11 window like fontforge likes to do if pango is built that way.
So much for my evil plan of just having a gtk2 app sitting in the background allowing me to get to all the goodies.
Luckily I found an interesting solution. If you forcibly ensure a Cocoa NSApplication instance exists then the old OpenWith event actually gets sent again! I added one Objective-C file for the mac build to make this happen. In the future we might like to expand that to also attach a Delegate to the NSApplication so that FontForge can ask for attention and other mac like special behaviour.
Merged mainline just a moment ago... https://github.com/fontforge/fontforge/pull/243
New bundle up at http://fuuko.libferris.com/osx/packages/v11/
http://fuuko.libferris.com/osx/packages/v10/MacFontForgeBundledApp.zip seems to register .sfd files in the MacOS so that double clicking one runs FontForge, but the file doesn't open, only the 'Open File' dialog :(