vendredi, janvier 09, 2009

appleremote02 (part6)

Time for code review, last step for the cws before to be ready for QA.

Philipp Lohmann agreed the changes in vcl ( and thus, the corresponding changes in apple_remote module)

Several problems had to be fixed :

* Christian Lippka suggested the use of MEDIA_COMMAND_VOLUME (UP and DOWN ) had to be changed, for other OS than Mac OS S X [fixed]

* protect the popup menu case [fixed]

* Andre Fischer asked about the eventlistener [partially fixed]: is not exactly at the right place, because I add the eventlistener at the end of GetState(SfxItemSet&) method, and this would result in multiple calls to Application::AddEventListener(const Link&). The Application class stores event listeners in a list, not in a set, and thus, more than one eventlistener may be registered for a single SdModule object. Fortunaly, when the (one) listener is removed in ~SdModule the Application::RemoveEventListener(const Link&) removes all listeners (that's what I verified using leaks on Mac)

The possible solutions :

Add the listener directly in the SdModule Ctor : Does not work (maybe my fault), because this leads to a sort of chicken-egg problem, and after some tests, it seems to be unbuildable ( I gve up with that).

Philipp proposed a solution I tested already, based on a singleton pattern [done, works already]

Investigating on another more complicated, but elegant solution Andre proposed. the idea is to create a static Create() method for SdModule, that creates and initializes an SdModule object.
This needs to make the constructor private (no side effects ?) and finally to have SdDLL::Init() calling this new Create() method. Work in progress ...

A big thank you for the code review, and for the time they spend helping me to Andre Fischer,Christian Lippka, Philipp Lohmann and Thorsten Behrens ( kindly answering my questions on the #education.openoffice.org channel)

Libellés : , , , ,

dimanche, août 17, 2008

Apple Remote in Impress : first try before more serious implementation

Just back from holidays, I found some times to hack the Apple Remote (the controller shipped with Apple machines).

After a week of learning the great Pierre Chatelier documentation (Objective C for C++ developers ), and Aaron Hillegass book " Cocoa Programming for Mac OS X", I finally found how to adapt Martin Kahr's code, to make the Apple remote work with OpenOffice.org.

Today, reading Apple documentation, I finally found a simple way to implement the basics of the thing. and it works :-)

What you currently can do is:

- start a presentation
- goto next / previous slide
- goto to last/first slide
- quit the presentation


The Impress window must be in front (the active window). Else, Front row menus works as usual.

Some other features are missing, and I hope to make them work asap.

For the curious, I do provide unofficial builds Intel only ( PowerPC on tuesday), for en-US , fr and de (upload in progress). Don't forget to do a backup of your files.

The URL for the download is Laurent Buisson site . Many thanks to him, for providing the ressources.

Last but not least, I found a way to modify the menus on the fly, and at build time, e.g; removing the not Aqua HIG compliant extra "Quit" in all the menus. I think this change could be an open door to better Mac OpenOffice.org menus customization.

Of course, this is work in progress, and I'm thinking to a more deep and professionnal implementation, but we need feedback from our users, to implement proprely the thing.

To be continued ...

Libellés : , , , ,