Help!

Drawing gradients in X11 and transparent windows


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> App Development RSS
Next:  [SLUG] Suncoast LUG Meetings  
Author Message
llothar
External


Since: Jul 02, 2007
Posts: 9



PostPosted: Sun Jul 22, 2007 6:01 am    Post subject: Drawing gradients in X11 and transparent windows
Archived from groups: comp>os>linux>development>apps (more info?)

I would like to improve the appearence of my application.

For the gradient: Is there any fast way other then doing it myself in
a client side image.

And transparent windows - well how at all can i do it and how portable
is it?
Back to top
ShieldsOnTour
External


Since: Jul 16, 2007
Posts: 3



PostPosted: Sun Jul 22, 2007 1:50 pm    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi there,

I can't answer the questions about the gradient fills, but I can offer
some help on transparent windows - depending upon what it is you are
trying to achieve.

First of all, you will need to be running a composite window manager -
such as beryl.... These window managers allow access to and obey the
alpha byte if you create you windows as ARGB 32-bit. You can then
directly manipulate the alpha channel (Using XGetImage/XPutImage to
access the data --- or shared memory extensions).

If you are wanting to set the transparency of your entire window, you
simply need to set a window property that the composite window manager
will honor --- its a really simply 2 line process. I'm not at work
right now so I can't remember what the property is called. When I get
to work tomorrow, I will post some code to do this ( and also a
function to tell you if you are even running a composite window
manager).

Hope this helps some --- I will try and be more helpful tomorrow Smile


Regards,

Tim


On 22 Jul, 14:01, llothar <llot....TakeThisOut@web.de> wrote:
> I would like to improve the appearence of my application.
>
> For the gradient: Is there any fast way other then doing it myself in
> a client side image.
>
> And transparent windows - well how at all can i do it and how portable
> is it?
Back to top
Jasen Betts
External


Since: Jul 10, 2005
Posts: 27



PostPosted: Mon Jul 23, 2007 9:28 am    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2007-07-22, llothar <llothar.RemoveThis@web.de> wrote:
> I would like to improve the appearence of my application.
>
> For the gradient: Is there any fast way other then doing it myself in
> a client side image.
>
> And transparent windows - well how at all can i do it and how portable
> is it?

shaped windows have been around since atleast the early 90s (eg: xeyes uses a
shaped window) another example, of more recent origin, would be xosd

Bye.
Jasen
Back to top
llothar
External


Since: Jul 02, 2007
Posts: 9



PostPosted: Fri Jul 27, 2007 12:13 pm    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 23 Jul., 16:28, Jasen Betts <ja... DeleteThis @free.net.nz> wrote:

> shaped windows have been around since atleast the early 90s (eg: xeyes uses a
> shaped window) another example, of more recent origin, would be xosd

I know about shaped windows. But i'm asking about alpha transparent
ones say 50% opaque. Sorry thought that this is clear from the wording.
Back to top
llothar
External


Since: Jul 02, 2007
Posts: 9



PostPosted: Fri Jul 27, 2007 12:16 pm    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sorry for the delayed response, was very busy with something else.

> If you are wanting to set the transparency of your entire window, you
> simply need to set a window property that the composite window manager
> will honor --- its a really simply 2 line process. I'm not at work
> right now so I can't remember what the property is called. When I get
> to work tomorrow, I will post some code to do this ( and also a
> function to tell you if you are even running a composite window
> manager).

Yes this is exactly what i want. I have done this on windows and there
it is also a 2 lines code. Would be very nice from you if would help
me here. It seems i can't come up with the right google words to find
the answer.

By the way, how can i find out if the window manager is a composite
window manager?
Is there same property i can check.
Back to top
llothar
External


Since: Jul 02, 2007
Posts: 9



PostPosted: Fri Jul 27, 2007 8:54 pm    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> A way to find the code is to download the GTK/GDK source and look
> through it -- have a look at the function gdk_window_set_opacity
> (http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-windo...)
> as a start. Trace that through the code and it will show you how to
> set the opacity of the window --- and also how to tell if the user is
> running a composite window manager. Remember - GDK is your friend -
> its just a wrapper ( a good one ) around native X code.

Thanks i think i can find it now.

I will be able to work again with Linux in about 10 days, btw. never
buy ASROCK mainboards if you live in a country with high air humidity.

And one more question: Does the Beryl WM work with old Matrox G450
cards? I never needed more then this but now i want to add some nice
transparent shaped windows for Drag operations to my application. Pure
eye candy but who don't like candies?
Back to top
ShieldsOnTour
External


Since: Jul 16, 2007
Posts: 3



PostPosted: Fri Jul 27, 2007 9:19 pm    Post subject: Re: Drawing gradients in X11 and transparent windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I really, really sorry --- have been snowed under at work and no time
to post the functions.

A way to find the code is to download the GTK/GDK source and look
through it -- have a look at the function gdk_window_set_opacity
( http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window...t-opaci)
as a start. Trace that through the code and it will show you how to
set the opacity of the window --- and also how to tell if the user is
running a composite window manager. Remember - GDK is your friend -
its just a wrapper ( a good one ) around native X code.

If you cant find the relevant code, I promise I will post it on Monday
when I get back into work Smile

regards,

Tim



On 27 Jul, 20:16, llothar <llot... RemoveThis @web.de> wrote:
> Sorry for the delayed response, was very busy with something else.
>
> > If you are wanting to set the transparency of your entire window, you
> > simply need to set a window property that the composite window manager
> > will honor --- its a really simply 2 line process. I'm not at work
> > right now so I can't remember what the property is called. When I get
> > to work tomorrow, I will post some code to do this ( and also a
> > function to tell you if you are even running a composite window
> > manager).
>
> Yes this is exactly what i want. I have done this on windows and there
> it is also a 2 lines code. Would be very nice from you if would help
> me here. It seems i can't come up with the right google words to find
> the answer.
>
> By the way, how can i find out if the window manager is a composite
> window manager?
> Is there same property i can check.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> App Development All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum