Author: spouliot
Date: 2006-04-18 15:07:01 -0400 (Tue, 18 Apr 2006)
New Revision: 59608

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/gdip.h
   trunk/libgdiplus/src/general.c
Log:
general.c: Added a new function to check the status of a cairo pattern (check 
for NULL isn't enough). If invalid the pattern will be destroyed.

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-04-18 18:42:06 UTC (rev 59607)
+++ trunk/libgdiplus/src/ChangeLog      2006-04-18 19:07:01 UTC (rev 59608)
@@ -1,3 +1,10 @@
+2006-04-18  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * gdip.h: Add prototype for gdip_get_pattern_status function.
+       * general.c: Added a new function to check the status of a cairo
+       pattern (check for NULL isn't enough). If invalid the pattern will
+       be destroyed.
+
 2006-04-13  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * font.c: Keep a static collection for the system font that will be

Modified: trunk/libgdiplus/src/gdip.h
===================================================================
--- trunk/libgdiplus/src/gdip.h 2006-04-18 18:42:06 UTC (rev 59607)
+++ trunk/libgdiplus/src/gdip.h 2006-04-18 19:07:01 UTC (rev 59608)
@@ -1382,7 +1382,9 @@
 int utf8_encode_ucs2char(gunichar2 unichar, unsigned char *dest);
 int utf8_decode_ucs2char(const unsigned char *src, gunichar2 *uchar);
 
+GpStatus gdip_get_pattern_status (cairo_pattern_t *pat);
 
+
 /* Stream handling bits */
 typedef int (*GetHeaderDelegate) (unsigned char *, int);
 typedef int (*GetBytesDelegate) (unsigned char *, int, BOOL);

Modified: trunk/libgdiplus/src/general.c
===================================================================
--- trunk/libgdiplus/src/general.c      2006-04-18 18:42:06 UTC (rev 59607)
+++ trunk/libgdiplus/src/general.c      2006-04-18 19:07:01 UTC (rev 59608)
@@ -539,3 +539,20 @@
     }
 }
 
+GpStatus
+gdip_get_pattern_status (cairo_pattern_t *pat)
+{
+       if (!pat)
+               return OutOfMemory;
+
+       switch (cairo_pattern_status (pat)) {
+       case CAIRO_STATUS_SUCCESS:
+               return Ok;
+       case CAIRO_STATUS_NO_MEMORY:
+               cairo_pattern_destroy (pat);
+               return OutOfMemory;
+       default:
+               cairo_pattern_destroy (pat);
+               return InvalidParameter;
+       }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to