Author: jordi
Date: 2005-04-27 13:42:21 -0400 (Wed, 27 Apr 2005)
New Revision: 43669
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/gdip.h
trunk/libgdiplus/src/graphics.c
Log:
2005-04-27 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
* graphics.c:
- Set bounds when using a X Drawable
- Fixes GdipGraphicsClear to make it work with X Drawables
* gdip.h: define new function
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2005-04-27 17:23:50 UTC (rev 43668)
+++ trunk/libgdiplus/src/ChangeLog 2005-04-27 17:42:21 UTC (rev 43669)
@@ -1,3 +1,10 @@
+2005-04-27 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+ * graphics.c:
+ - Set bounds when using a X Drawable
+ - Fixes GdipGraphicsClear to make it work with X Drawables
+ * gdip.h: define new function
+
2005-04-20 Jackson Harper <[EMAIL PROTECTED]>
* hatchbrush.c: Don't require that hatch brushes be created on a
Modified: trunk/libgdiplus/src/gdip.h
===================================================================
--- trunk/libgdiplus/src/gdip.h 2005-04-27 17:23:50 UTC (rev 43668)
+++ trunk/libgdiplus/src/gdip.h 2005-04-27 17:42:21 UTC (rev 43669)
@@ -1023,6 +1023,7 @@
GpStatus GdipGetTextContrast(GpGraphics *graphics, UINT *contrast);
GpStatus GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode);
GpStatus GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mode);
+GpStatus GdipSetVisibleClip_linux (GpGraphics *graphics, GpRect *rect);
/* Status */
GpStatus gdip_get_status (cairo_status_t status);
Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c 2005-04-27 17:23:50 UTC (rev 43668)
+++ trunk/libgdiplus/src/graphics.c 2005-04-27 17:42:21 UTC (rev 43669)
@@ -334,6 +334,11 @@
GpStatus
GdipCreateFromXDrawable_linux(Drawable d, Display *dpy, GpGraphics **graphics)
{
+ XImage *ximage;
+ Window root_ignore;
+ GpRect bounds;
+ int bwidth_ignore, depth_ignore;
+
g_return_val_if_fail (graphics != NULL, InvalidParameter);
*graphics = gdip_graphics_new();
@@ -343,6 +348,10 @@
(*graphics)->display = dpy;
(*graphics)->drawable = d;
+ XGetGeometry (dpy, d, &root_ignore, &bounds.X, &bounds.Y,
+ &bounds.Width, &bounds.Height, &bwidth_ignore, &depth_ignore);
+
+ GdipSetVisibleClip_linux (*graphics, &bounds);
return Ok;
}
@@ -3146,14 +3155,10 @@
GpStatus
GdipGraphicsClear (GpGraphics *graphics, ARGB color)
{
- GpImage *image;
double red, green, blue, alpha;
g_return_val_if_fail (graphics != NULL, InvalidParameter);
- image = graphics->image;
- g_return_val_if_fail (image != NULL, InvalidParameter);
-
blue = color & 0xff;
green = (color >> 8) & 0xff;
red = (color >> 16) & 0xff;
@@ -3164,7 +3169,7 @@
cairo_set_rgb_color (graphics->ct, red / 255, green / 255, blue / 255);
cairo_set_alpha (graphics->ct, alpha / 255);
- cairo_rectangle (graphics->ct, 0, 0, image->width, image->height);
+ cairo_rectangle (graphics->ct, 0, 0, graphics->bounds.Width,
graphics->bounds.Height);
cairo_fill (graphics->ct);
/* Restore the color/alpha/pattern settings */
@@ -3456,7 +3461,6 @@
graphics->bounds.Y = rect->Y;
graphics->bounds.Width = rect->Width;
graphics->bounds.Height = rect->Height;
-
return Ok;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches