[4/7] gdiplus: added GdipSetImagePalette stub

Evan Stade estade at gmail.com
Wed Aug 8 21:42:16 CDT 2007


Hi,

this is another function needed by Foxit Reader--this stub
implementation at least allows the program to not crash (image colors
are a bit off though).

 dlls/gdiplus/gdiplus.spec     |    2 +-
 dlls/gdiplus/image.c          |   14 ++++++++++++++
 include/gdiplusflat.h         |    1 +
 include/gdipluspixelformats.h |   21 +++++++++++++++++++++
 4 files changed, 37 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index f0d1bde..834d0e2 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -532,7 +532,7 @@
 @ stub GdipSetImageAttributesThreshold
 @ stub GdipSetImageAttributesToIdentity
 @ stdcall GdipSetImageAttributesWrapMode(ptr long long long)
-@ stub GdipSetImagePalette
+@ stdcall GdipSetImagePalette(ptr ptr)
 @ stub GdipSetInfinite
 @ stdcall GdipSetInterpolationMode(ptr long)
 @ stub GdipSetLineBlend
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 85cfc07..ec52d5d 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -668,3 +668,17 @@ GpStatus WINGDIPAPI GdipSaveImageToStrea
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipSetImagePalette(GpImage *image,
+    GDIPCONST ColorPalette *palette)
+{
+    static int calls;
+
+    if(!image || !palette)
+        return InvalidParameter;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 1ae9ced..57b14ab 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -208,6 +208,7 @@ GpStatus WINGDIPAPI GdipLoadImageFromStr
 GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage*,PROPID);
 GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*,
     GDIPCONST CLSID*,GDIPCONST EncoderParameters*);
+GpStatus WINGDIPAPI GdipSetImagePalette(GpImage*,GDIPCONST ColorPalette*);
 
 GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**);
 GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*);
diff --git a/include/gdipluspixelformats.h b/include/gdipluspixelformats.h
index dd67410..d7382f1 100644
--- a/include/gdipluspixelformats.h
+++ b/include/gdipluspixelformats.h
@@ -48,4 +48,25 @@ #define    PixelFormat64bppARGB         
 #define    PixelFormat64bppPARGB        (14 | (64 << 8) | PixelFormatAlpha  | PixelFormatPAlpha | PixelFormatExtended)
 #define    PixelFormatMax               15
 
+#ifdef __cplusplus
+
+struct ColorPalette
+{
+public:
+    UINT Flags;
+    UINT Count;
+    ARGB Entries[1];
+};
+
+#else /* end of c++ typedefs */
+
+typedef struct ColorPalette
+{
+    UINT Flags;
+    UINT Count;
+    ARGB Entries[1];
+} ColorPalette;
+
+#endif  /* end of c typedefs */
+
 #endif
-- 
1.4.1


More information about the wine-patches mailing list