Wed Aug 30 20:33:16 CEST 2006

Native filepicker for Mac OS X

I had yet another hacking session on Mac OS X with Aqua. The result is half-working filepicker for aquavcl01. Is is not yet ready for inclusion because it crashes a lot and I'm faking files selected and folder picker is not yet implemented, but it was enough to get some screenshots from it. My primary reason was to learn OOo's side of filepicker, but it was so easy that I decided to prototype the complete filepicker and get it to display something.

But let's start from beginning.

OpenOffice.org's filepicker side

I browsed through fpicker directory and used gnome as an example. For native file and folder picker, you have to implement several interfaces: XFilePicker and XFolderPicker. You'll also need other stuff from ::com::sun::star::ui::dialogs. OpenOffice.org's API documentation is brilliant. Really, it helped me a lot.

XFilePicker implements file service - both Open and Save dialogs, can have extended options like read-only box, preview etc. This is of course not yet implemented ;-) XFolderPicker is used to enter the directory - like in Tools - Options - OpenOffice.org - Paths, e.g. for My Documents.

Enabling native
filepicker Native dialogs have to be enabled in Tools - Options - OpenOffice.org - General. To be able to do so, I had to change option dialog in svx a bit - define Mac OS X/Aqua as one of the platforms where this option can be shown.

Other two patches I created add generic fpicker component/uno.dylib module to the build system - scp2 and fpicker changes.

The rest of the code (and hacks) is located in fpicker/aqua directory.

This is the OpenOffice.org side.

Carbon filepicker side

(Please keep in mind, that I'm unexperienced Mac OS X hacker, everything I wrote here was unknown to me yesterday, so it can be inaccurate or incomplete).

Open and Save dialogs and other file and directory dialogs are implemented in Navigation Services API. There are three good papers about Navigation Services: Overview, Programming Guide and complete reference. If you would like to learn Navigation Services, read them in this order.

So this is OpenOffice.org and also Carbon side of filepicker so I only connected them. But there are still problems. I hope I'll have some time before OOoCon 2006 in Lyon to finish the work to at least some extent. But we are now also in 2.0.4 release phase, so it will be a lot of fun again ;-)

Posted by Pavel | Permanent link | File under: OpenOffice.org, Mac OS X