[cairo] drawing into GDK bitmap (pixmap of depth 1)?

Mirco Müller macslow at bangang.de
Sun Feb 19 20:36:57 PST 2006


Am Sonntag, den 19.02.2006, 16:11 -0800 schrieb Eric Smith:

	What a funny coincidence. I just solved that problem myself for
cairo-clock 0.3.1. Take a look at the extracted example for shaped-input
with cairo I did:

	http://macslow.thepimp.net/?p=26

> I'm trying to convert a simple GTK application from using GDK drawing
> primitives to Cairo (1.0.2 on Fedora Core 5 test 2 x86_64).  Most of it
> works fine.  But the application wants a round window, so it creates a
> GDK bitmap, fills it with black, draws a filled white circle in it, and
> passes that to gtk_widget_shape_combine_mask() to get a round window.

	There's the catch. You'll need to use 
gtk_widget_input_shape_combine_mask() instead. But that call currently
is only available for gtk+ CVS-head (2.9.0) with some patch applied. But
even without all that you can still do this. One just needs to
"decompose" that call down to the real Xlib-calls responsible for
shaped-input with XShape 1.1. The supplied example program available
from the page mentioned above has everything in place.

I hope this help.

Best regards...

MacSlow



More information about the cairo mailing list