Open GoogleCodeExporter opened 9 years ago
[deleted comment]
I want to avoid having anything platform specific in that event, even using
#ifdef.
How about something like:
event->getWindow<FB::PluginWindowWin>()->getHWND();
AttachedEvent could just have a reference to the PluginWindow, and getWindow
could be
a template function that does a dynamic cast, throws an exception if you try to
get
an invalid type, etc.
Similarly, on Mac we could use
event->getWindow<FB::PluginWindowMac>()->getPort() or
whatnot.
Original comment by taxilian
on 28 Dec 2009 at 2:40
Hm, would be an alternative... but makes the user type more and requires
remembering
more.
Personally i currently only care about the native window handle in the attached
event
and would expect that for other people too - thus i thought direct access to
the
native window handle would save some pain.
Original comment by georg.fritzsche
on 29 Dec 2009 at 10:34
My concern with just doing the window handle is that I would like (as much as
possible) to keep things the same across platforms. When we get to Mac, there
is more
than just a handle that needs to be passed. Linux has even more to it than the
mac does.
Thus I was thinking that the PluginWindow object can be dereferenced into the OS
specific component in the OS specific code and you can use it to get whatever OS
specific stuff you need.
However, if you have a better idea, I'm open to negotiation
Original comment by taxilian
on 29 Dec 2009 at 4:48
Well, after testing it out in the example plugin i am taking a step back and
would
propose to add this to FB::AttachedEvent:
FB::PluginWindow* getWindow();
Although it would be convenient to store window handle in a portable way (i.e.
don't
care yet what it is, only platform specific drawing code etc. will care) its
probably
not that important.
Original comment by georg.fritzsche
on 29 Dec 2009 at 5:03
Original comment by georg.fritzsche
on 13 Jan 2010 at 1:09
Original issue reported on code.google.com by
georg.fritzsche
on 28 Dec 2009 at 10:00