Implement temp GetEnhMetaFilePixelFormat
authorJames Tabor <james.tabor@reactos.org>
Sat, 6 Sep 2003 19:44:00 +0000 (19:44 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sat, 6 Sep 2003 19:44:00 +0000 (19:44 +0000)
svn path=/trunk/; revision=6003

reactos/lib/gdi32/misc/stubs.c
reactos/lib/gdi32/misc/wingl.c

index e119433..bd45809 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.33 2003/09/06 16:50:11 jimtabor Exp $
+/* $Id: stubs.c,v 1.34 2003/09/06 19:44:00 jimtabor Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
@@ -965,22 +965,6 @@ GetEnhMetaFilePaletteEntries(
 }
 
 
-/*
- * @unimplemented
- */
-UINT
-STDCALL
-GetEnhMetaFilePixelFormat(
-       HENHMETAFILE                    a0,
-       DWORD                           a1,
-       CONST PIXELFORMATDESCRIPTOR     *a2
-       )
-{
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
 /*
  * @unimplemented
  */
index 45ef159..5df2548 100644 (file)
@@ -25,7 +25,7 @@
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <ddk/ntddk.h>
-
+#include <string.h>
 
 #define NDEBUG
 #include <win32k/debug1.h>
@@ -44,7 +44,11 @@ static SETPIXELFMT       glSetPixelFormat      = NULL;
 static SWAPBUFFERS       glSwapBuffers         = NULL;
 static DESCRIBEPIXELFMT  glDescribePixelFormat = NULL;
 static GETPIXELFMT       glGetPixelFormat      = NULL;
-static HINSTANCE         hOpenGL               = NULL;
+
+/*
+               OpenGL Handle.
+*/
+HINSTANCE                hOpenGL               = NULL;
 
 static BOOL OpenGLEnable(void)
 {
@@ -175,4 +179,36 @@ SwapBuffers(HDC  hDC)
   return(glSwapBuffers(hDC));
 }
 
+
+/*
+       Do this here for now.
+*/
+
+/*
+ * @implemented
+ */
+UINT
+STDCALL
+GetEnhMetaFilePixelFormat(
+       HENHMETAFILE                    hEmh,
+       DWORD                           cbBufz,
+       CONST PIXELFORMATDESCRIPTOR     *ppfd
+       )
+{
+ENHMETAHEADER pemh;
+
+       if(GetEnhMetaFileHeader(hEmh, sizeof(ENHMETAHEADER), &pemh))
+       {
+       if(pemh.bOpenGL)
+       {
+               if(pemh.cbPixelFormat)
+               {
+               memcpy((void*)ppfd, (const void *)pemh.offPixelFormat, cbBufz );
+               return(pemh.cbPixelFormat);
+               }
+       }
+       }
+       return(0);
+}
+
 /* EOF */