4 * Copyright 1999 Patrik Stridvall
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
30 /**********************************************************************/
32 extern HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap);
33 extern BOOL TTYDRV_DC_BITMAP_DeleteObject(HBITMAP hbitmap, BITMAPOBJ *bitmap);
36 /***********************************************************************
37 * TTYDRV_DC_BRUSH_SelectObject
39 static HBRUSH TTYDRV_DC_BRUSH_SelectObject(DC *dc, HBRUSH hbrush)
41 HBRUSH hPreviousBrush;
43 TRACE("(%p, 0x%04x)\n", dc, hbrush);
45 hPreviousBrush = dc->hBrush;
48 return hPreviousBrush;
51 /***********************************************************************
52 * TTYDRV_DC_FONT_SelectObject
54 static HFONT TTYDRV_DC_FONT_SelectObject(DC* dc, HFONT hfont)
56 TRACE("(%p, 0x%04x)\n", dc, hfont);
58 return TRUE; /* Use device font */
61 /***********************************************************************
62 * TTYDRV_DC_PEN_SelectObject
64 static HPEN TTYDRV_DC_PEN_SelectObject(DC *dc, HBRUSH hpen)
68 TRACE("(%p, 0x%04x)\n", dc, hpen);
70 hPreviousPen = dc->hPen;
76 /***********************************************************************
77 * TTYDRV_DC_SelectObject
79 HGDIOBJ TTYDRV_DC_SelectObject(DC *dc, HGDIOBJ handle)
81 GDIOBJHDR *ptr = GDI_GetObjPtr(handle, MAGIC_DONTCARE);
86 switch(GDIMAGIC(ptr->wMagic))
89 result = TTYDRV_DC_BITMAP_SelectObject(dc, handle, (BITMAPOBJ *) ptr);
92 result = TTYDRV_DC_BRUSH_SelectObject(dc, handle);
95 result = TTYDRV_DC_FONT_SelectObject(dc, handle);
98 result = TTYDRV_DC_PEN_SelectObject(dc, handle);
101 /* FIXME: Shouldn't be handled here */
102 result = (HGDIOBJ) SelectClipRgn(dc->hSelf, handle);
105 ERR("handle (0x%04x) has unknown magic (0x%04x)\n",
106 handle, GDIMAGIC(ptr->wMagic));
109 GDI_ReleaseObj(handle);
114 /***********************************************************************
115 * TTYDRV_DC_DeleteObject
117 BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle)
119 GDIOBJHDR *ptr = GDI_GetObjPtr(handle, MAGIC_DONTCARE);
122 if(!ptr) return FALSE;
124 switch(GDIMAGIC(ptr->wMagic))
127 result = TTYDRV_DC_BITMAP_DeleteObject(handle, (BITMAPOBJ *) ptr);
136 ERR("handle (0x%04x) has unknown magic (0x%04x)\n",
137 handle, GDIMAGIC(ptr->wMagic));
141 GDI_ReleaseObj(handle);