[Pharo-project] HostWindows rewrite
Hello list, i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible. The plan is to move windowing & events handling into new plugin and at same time, completely remove cruft from basic VM functionality. - you are in total control when to create a window - multiple windows support (will require refactoring in Morphic code) - control the window style/appearance, including: title, titlebar presence, window icon, size & position, pixel format, transparency (aka layered window), border style (resizeable or not, or completely w/o border ) - control video modes (if its provided by platform) and fullscreen window mode - events are now bound to particular window - different notification events like changing window position / activating or deactivating Plugin is publishing a list of available window attributes. Different platforms, depends on implementation, may or may not support different window attributes. Instead of spawing dozens of primitives , like setWidth/setHeight/setTitle/getTitle etc etc, plugin will have only two primitives - get/setWindowAttribute. So, to set an X position of window, a code will look like: window primAttributeAt: #x put: 10. or to hide window: window primAttributeAt: #visible put: false. or to set multiple attributes in batch manner: window primSetAttributes: { #x -> 10. #y->20. #visible->false. }. I'll try to cover a most basic attributes, available on major platforms for the initial implementation. What you'll never see in new plugin: - native widgets support or any kind of dealing with native widgets/controls. Awaiting for your comments or suggestions. -- Best regards, Igor Stasenko AKA sig.
I'm not expert but this sounds interesting. I will continue to clean etoy impacts this way refactoring morphc should be easier. Stef On Nov 9, 2008, at 12:47 PM, Igor Stasenko wrote:
Hello list,
i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible. The plan is to move windowing & events handling into new plugin and at same time, completely remove cruft from basic VM functionality.
- you are in total control when to create a window - multiple windows support (will require refactoring in Morphic code) - control the window style/appearance, including: title, titlebar presence, window icon, size & position, pixel format, transparency (aka layered window), border style (resizeable or not, or completely w/o border ) - control video modes (if its provided by platform) and fullscreen window mode - events are now bound to particular window - different notification events like changing window position / activating or deactivating
Plugin is publishing a list of available window attributes. Different platforms, depends on implementation, may or may not support different window attributes. Instead of spawing dozens of primitives , like setWidth/setHeight/setTitle/getTitle etc etc, plugin will have only two primitives - get/setWindowAttribute. So, to set an X position of window, a code will look like: window primAttributeAt: #x put: 10. or to hide window: window primAttributeAt: #visible put: false.
or to set multiple attributes in batch manner: window primSetAttributes: { #x -> 10. #y->20. #visible->false. }.
I'll try to cover a most basic attributes, available on major platforms for the initial implementation.
What you'll never see in new plugin: - native widgets support or any kind of dealing with native widgets/ controls.
Awaiting for your comments or suggestions.
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2008/11/9 Michael Rueger <m.rueger@acm.org>:
Igor Stasenko wrote:
Hello list,
i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible.
What about ffenestri?
i currently taking parts from it as well as parts from core VM functionality, like event handling. Not blindly , of course. :) The idea is to make an integral plugin with clean design, which will allow us to clean a lot of things in VM & language side both as well as finer control of different windowing operations.
Michael
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
Igor Stasenko wrote:
2008/11/9 Michael Rueger <m.rueger@acm.org>:
Igor Stasenko wrote:
Hello list,
i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible. What about ffenestri?
i currently taking parts from it as well as parts from core VM functionality, like event handling. Not blindly , of course. :) The idea is to make an integral plugin with clean design, which will allow us to clean a lot of things in VM & language side both as well as finer control of different windowing operations.
Sound good :-) Just wanted to make sure that no unnecessary re-inventing of wheels takes place ;-) Michael
On Sun, Nov 09, 2008 at 01:47:26PM +0200, Igor Stasenko wrote:
Hello list,
i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible. ...
Awaiting for your comments or suggestions.
I tried implementing HostWindowPlugin for X11 a couple of years ago but did not complete it. IIRC, one area of difficulty was the encoding of X-Y coordinates in the plugin parameters, which put the X and Y values into the high and low order 16 bits of a 32 bit int. On X11, the coordinates are (32 bit) signed ints, and I recall that negative screen positions causes problems. Sorry I can't recall the exact details, but if you do reimplement the plugin, I would suggest encoding screen position parameters as separate X and Y ints rather than the hi and lo 16 bit scheme used in the current plugin. Dave
2008/11/9 David T. Lewis <lewis@mail.msen.com>:
On Sun, Nov 09, 2008 at 01:47:26PM +0200, Igor Stasenko wrote:
Hello list,
i started design of new plugin, which is conceptually based on HostWindows, but will be more integral & flexible. ...
Awaiting for your comments or suggestions.
I tried implementing HostWindowPlugin for X11 a couple of years ago but did not complete it. IIRC, one area of difficulty was the encoding of X-Y coordinates in the plugin parameters, which put the X and Y values into the high and low order 16 bits of a 32 bit int. On X11, the coordinates are (32 bit) signed ints, and I recall that negative screen positions causes problems. Sorry I can't recall the exact details, but if you do reimplement the plugin, I would suggest encoding screen position parameters as separate X and Y ints rather than the hi and lo 16 bit scheme used in the current plugin.
Oh, that's the bits i'm missing. I found the sources of HostWindowPlugin for win and mac, but was unable to find anything for X11. Can you please send me a sources of it, or link for downloads? Concerning 16/32 bit - forget it :) Internally, all attribute declarations having a type. Currently it will support only most commonly used types: - int - boolean - string but of course, in case of need, more types can be added later. A plugin will coerce values back and forth without any problems. And of course, i don't see a need in packing X and Y into a single 32 bit int as its currently done in HostWindowPlugin. Partly, because there will be no #setXY or #setSizeXY , but instead you'll have only an attributeAt: #attributeName put: value and setAttributes: { #name1 -> value1. #name2-> value2 ... } primitives for setting multiple attributes in single batch.
Dave
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
On Sun, Nov 09, 2008 at 05:05:45PM +0200, Igor Stasenko wrote:
2008/11/9 David T. Lewis <lewis@mail.msen.com>: Oh, that's the bits i'm missing. I found the sources of HostWindowPlugin for win and mac, but was unable to find anything for X11. Can you please send me a sources of it, or link for downloads?
There is no implementation for X11, but I posted a copy of my imcomplete work to the vm-dev list here: http://lists.squeakfoundation.org/pipermail/vm-dev/2008-July/001977.html This does have enough support to permit opening windows, moving them, setting window label, etc but it is incomplete and is not integrated into Squeak in any useful way.
And of course, i don't see a need in packing X and Y into a single 32 bit int as its currently done in HostWindowPlugin.
Good, that sounds fine. Dave
2008/11/9 David T. Lewis <lewis@mail.msen.com>:
On Sun, Nov 09, 2008 at 05:05:45PM +0200, Igor Stasenko wrote:
2008/11/9 David T. Lewis <lewis@mail.msen.com>: Oh, that's the bits i'm missing. I found the sources of HostWindowPlugin for win and mac, but was unable to find anything for X11. Can you please send me a sources of it, or link for downloads?
There is no implementation for X11, but I posted a copy of my imcomplete work to the vm-dev list here:
http://lists.squeakfoundation.org/pipermail/vm-dev/2008-July/001977.html
This does have enough support to permit opening windows, moving them, setting window label, etc but it is incomplete and is not integrated into Squeak in any useful way.
Thanks for the link. I hope it will help me to better understand how to make a linux port of plugin, because i never dealt with X11 API in my life.
And of course, i don't see a need in packing X and Y into a single 32 bit int as its currently done in HostWindowPlugin.
Good, that sounds fine.
Dave
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
On 09/11/2008, at 10:17 PM, Igor Stasenko wrote:
What you'll never see in new plugin: - native widgets support or any kind of dealing with native widgets/ controls.
Notwithstanding this, IMO a really good feature would be the ability to create and manage native views within windows, where e.g. a Morph could be 'backed' by a native view. This feature alone is enough to later allow native controls (such as WebKit) to mix with 'light' controls with correct z-ordering/clipping/event handling etc. Of course one could retrofit such a feature, but using native views from the start would encourage any Morphic mods (or other widget set) to use native views and hence be ready for better integration. Antony Blakey -------------------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. -- Douglas Adams
participants (5)
-
Antony Blakey -
David T. Lewis -
Igor Stasenko -
Michael Rueger -
Stéphane Ducasse