4 * Copyright 1999 Patrik Stridvall
14 #include "debugtools.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv
)
18 /**********************************************************************/
20 extern HBITMAP
TTYDRV_DC_BITMAP_SelectObject(DC
*dc
, HBITMAP hbitmap
, BITMAPOBJ
*bitmap
);
21 extern HBRUSH
TTYDRV_DC_BRUSH_SelectObject(DC
*dc
, HBRUSH hbrush
, BRUSHOBJ
*brush
);
22 extern HFONT
TTYDRV_DC_FONT_SelectObject(DC
* dc
, HFONT hfont
, FONTOBJ
*font
);
23 extern HPEN
TTYDRV_DC_PEN_SelectObject(DC
*dc
, HBRUSH hpen
, PENOBJ
*pen
);
25 extern BOOL
TTYDRV_DC_BITMAP_DeleteObject(HBITMAP hbitmap
, BITMAPOBJ
*bitmap
);
27 /***********************************************************************
28 * TTYDRV_DC_SelectObject
30 HGDIOBJ
TTYDRV_DC_SelectObject(DC
*dc
, HGDIOBJ handle
)
32 GDIOBJHDR
*ptr
= GDI_GetObjPtr(handle
, MAGIC_DONTCARE
);
40 result
= TTYDRV_DC_BITMAP_SelectObject(dc
, handle
, (BITMAPOBJ
*) ptr
);
43 result
= TTYDRV_DC_BRUSH_SelectObject(dc
, handle
, (BRUSHOBJ
*) ptr
);
46 result
= TTYDRV_DC_FONT_SelectObject(dc
, handle
, (FONTOBJ
*) ptr
);
49 result
= TTYDRV_DC_PEN_SelectObject(dc
, handle
, (PENOBJ
*) ptr
);
52 /* FIXME: Shouldn't be handled here */
53 result
= (HGDIOBJ
) SelectClipRgn(dc
->hSelf
, handle
);
56 ERR("handle (0x%04x) has unknown magic (0x%04x)\n", handle
, ptr
->wMagic
);
59 GDI_HEAP_UNLOCK(handle
);
64 /***********************************************************************
65 * TTYDRV_DC_DeleteObject
67 BOOL
TTYDRV_DC_DeleteObject(HGDIOBJ handle
)
69 GDIOBJHDR
*ptr
= GDI_GetObjPtr(handle
, MAGIC_DONTCARE
);
72 if(!ptr
) return FALSE
;
77 result
= TTYDRV_DC_BITMAP_DeleteObject(handle
, (BITMAPOBJ
*) ptr
);
86 ERR("handle (0x%04x) has unknown magic (0x%04x)\n", handle
, ptr
->wMagic
);
90 GDI_HEAP_UNLOCK(handle
);