----- Original Message -----
Sent: Monday, April 15, 2002 10:56
PM
Subject: [platform-swt-dev] Q's about
adding new function to SWT: transparent regions
I'm thinking about submitting some new function to
SWT. Namely, use of the regions in Win32 and the call SetWindowRgn() to
associate a region with a control. This allows you to have
non-rectangular windows, which I'm thinking of using specifically with
shells. To make some kind of a groovy looking app like the mp3 players
du jour do.
So, couple of questions:
- say I hack the C code and Java code to do this in Windows;
how do I submit this as a candidate? Zip it up and attach it to an
email?
- more importantly, what do you think this interface should
look like in SWT itself? I think (but am not sure) that the
SetWindowRgn() will work with any HWND, so, should be on Control.
The whole region business is a bit complicated, so I'm thinking that to make
it easier, the interface would be to pass an image in, and any transparent
pixels (or pixels with alpha set to 0) would indicate areas of the region that
were transparent. It would boil the API down to one new method. A
setter:
void setTransparentRegion(Image
image)
Or would it be better to expose all the region glorp?
And would we want a getter?
Image
getTransparentRegion()
Since this is aimed at Shells (in my case anyway), keeping
the images around, which might be large, seems like a huge waste of
space. And it seems like there wouldn't really be much use for getting
this data back anyway. And to get the original Image back, you'd really
have to hold onto it, since the only data used is the transparent-ness, and
there would be no way to recreate the pixel data from a GetWindowRgn()
call.
Just curious ...