Re: Getting backing pixmap



On 13 Jul 2001, Owen Taylor wrote:

> Anders Carlsson pointed out to me (http://bugzilla.gnome.org/show_bug.cgi?id=57212)
> that there is currently no way of drawing onto a GdkWindow with X functions directly,
> since the backing pixmap is hidden inside private structures.
> 
> I think this is a fairly serious defect, so I'd like to apply the
> following patch which adds a somewhat clumsy, but workable, way to get
> the necessary information:
> 
> With this patch, an X only emulation of gdk_draw_line() would be something like:
> 
> void
> my_draw_line (GdkDrawable *drawable, GdkGC *gc,
>               gint x1, gint y1, gint x2, gint y2)
> {
>   GdkDrawable *real_drawable;
>     
>   gint x_off, y_off;
> 
>   if (GDK_IS_WINDOW (drawable))
>     {
>       gdk_window_get_internal_paint_info (drawable, &real_drawable, &x_off, &y_off);
>     }
>   else if (GDK_IS_PIXMAP (drawable))
>     {
>       real_drawable = drawable;
>       x_off = y_off = 0;
>     }
>   else
>     {
>       g_warning ("my_draw_line() called on non-X drawable");
>       return;
>     }

what's triggering the thrid case, and, couldn't we collapse the
pixmap and window case into one by having gdk_drawable_get_internal_paint_info()?
(i'm not sure the "_internal_" part is required btw)


---
ciaoTJ





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