Re: Wrapper functions for setting up RGBA colormaps



Thanks, Murray.

On 6/15/06, Murray Cumming <murrayc murrayc com> wrote:
On Wed, 2006-06-14 at 15:41 -0500, Matt Hoosier wrote:
> I'd like to do some drawing using the alpha channel for blending. At
> least one technique for doing this in raw Gtk+ is to query whether an
> RGBA colormap exists:
>
>    GdkScreen* screen = gtk_widget_get_screen(widget);
>
>     GdkColormap* colormap = gdk_screen_get_rgba_colormap(screen);
>     gboolean supports_alpha = TRUE;
>
>     if (!colormap)
>     {
>         /* display doesn't support compositing; fall back to RGB */
>         colormap = gdk_screen_get_rgb_colormap(screen);
>         supports_alpha = FALSE;
>     }
>
>     gtk_widget_set_colormap(widget, colormap);
>
> One then can later inspect the 'supports_alpha' flag when setting up
> the colormap on a Cairo context.
>
> Gtkmm doesn't seem to offer wrappers for this RGBA colormap
> fetching/setting. Should I continue to use the underlying Gtk+ API, or
> is there a cleaner way of doing this kind of thing in Gtkmm?

I wrapped those functions in HEAD just a few days ago, so they are not
available yet in stable releases:
http://cvs.gnome.org/viewcvs/gtkmm/ChangeLog?r1=1.486&r2=1.487

But it should be totally OK to use the C API together with the gtkmm
API, using gobj().

--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]