#define TRUETYPE_FONTTYPE (4)
/* EnumObjects, GetCurrentObject, GetObjectType */
-#define OBJ_BRUSH (2)
#define OBJ_PEN (1)
+#define OBJ_BRUSH (2)
+#define OBJ_DC (3)
+#define OBJ_METADC (4)
#define OBJ_PAL (5)
#define OBJ_FONT (6)
#define OBJ_BITMAP (7)
-#define OBJ_EXTPEN (11)
#define OBJ_REGION (8)
-#define OBJ_DC (3)
-#define OBJ_MEMDC (10)
#define OBJ_METAFILE (9)
-#define OBJ_METADC (4)
-#define OBJ_ENHMETAFILE (13)
+#define OBJ_MEMDC (10)
+#define OBJ_EXTPEN (11)
#define OBJ_ENHMETADC (12)
+#define OBJ_ENHMETAFILE (13)
+#define OBJ_COLORSPACE (14)
/* EnumPrinters */
-/* $Id: stubs.c,v 1.55 2004/04/25 14:46:53 weiden Exp $
+/* $Id: stubs.c,v 1.56 2004/04/25 15:31:43 weiden Exp $
*
* reactos/lib/gdi32/misc/stubs.c
*
}
-/*
- * @unimplemented
- */
-HGDIOBJ
-STDCALL
-GetCurrentObject(
- HDC a0,
- UINT a1
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-
/*
* @unimplemented
*/
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dc.c,v 1.130 2004/04/25 12:51:53 weiden Exp $
+/* $Id: dc.c,v 1.131 2004/04/25 15:31:43 weiden Exp $
*
* DC.C - Device context functions
*
#define NDEBUG
#include <win32k/debug1.h>
+#ifndef OBJ_COLORSPACE
+#define OBJ_COLORSPACE (14)
+#endif
+
static GDIDEVICE PrimarySurface;
/* FIXME: DCs should probably be thread safe */
HGDIOBJ STDCALL
NtGdiGetCurrentObject(HDC hDC, UINT ObjectType)
{
- UNIMPLEMENTED;
+ HGDIOBJ SelObject;
+ DC *dc;
+
+ if(!(dc = DC_LockDc(hDC)))
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return NULL;
+ }
+
+ switch(ObjectType)
+ {
+ case OBJ_PEN:
+ SelObject = dc->w.hPen;
+ break;
+ case OBJ_BRUSH:
+ SelObject = dc->w.hBrush;
+ break;
+ case OBJ_PAL:
+ DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_PAL not supported yet!\n");
+ break;
+ case OBJ_FONT:
+ SelObject = dc->w.hFont;
+ break;
+ case OBJ_BITMAP:
+ SelObject = dc->w.hBitmap;
+ break;
+ case OBJ_COLORSPACE:
+ DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not supported yet!\n");
+ break;
+ default:
+ SelObject = NULL;
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ break;
+ }
+
+ DC_UnlockDc(hDC);
+ return SelObject;
}
DC_GET_VAL_EX ( GetCurrentPositionEx, w.CursPosX, w.CursPosY, POINT, x, y )