On Fri, 2009-08-21 at 14:26 +0100, Andrew Flegg wrote:
> My interpretation:
> 
>   * You set HILDON_PORTRAIT_MODE_SUPPORT _if_ the device is portrait
>     _before_ you open a window.
> 
>   * You pick up events (DBus or size-changed depending on whether
>     you need orientation or just aspect) and then explicitly
>     set HILDON_PORTRAIT_MODE_REQUEST.

Hmm, the only thing is you can only pick up size-changed events once the
size has changed :) Listening to the DBus events would be possible,
though.

> Presumably your code, once you refactor common stuff will be something like:
> 
>   -------->8--------
>   function void startApplication() {
>     setPortraitFlagsIfAppropriate(window);
>     window.addListener('size-change') {
>       setPortraitFlagsIfAppropriate(window)
>     }
> 
>     open(window);
>   }
> 
>   function void setPortraitFlagsIfAppropriate(window) {
>     if (isPortrait())
>       window.set(HILDON_PORTRAIT_SUPPORT | HILDON_PORTRAIT_REQUEST)
>     else
>       window.unset(HILDON_PORTRAIT_SUPPORT | HILDON_PORTRAIT_REQUEST)
>   }
>   --------8<--------
> 
> Hope that helps,
> 
> Andrew

Thanks for your interpretation. But the fact that an API needs
interpretation at all is quite a bit funny.

I'm getting the feeling that your interpretation is the right one. Still
I hope you're wrong, that would be probably the most cumbersome API I've
ever seen...

Cheers!
Conny



_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to