Release 971012
[wine/multimedia.git] / graphics / win16drv / text.c
blobcef68aa5eac60bed1c4df7c36ff4d21b5d7544d3
1 /*
2 * win16 driver text functions
4 * Copyright 1996 John Harvey
5 */
7 #include <stdlib.h>
8 #include "windows.h"
9 #include "win16drv.h"
10 #include "dc.h"
11 #include "gdi.h"
12 #include "stddebug.h"
13 /* #define DEBUG_WIN16DRV */
14 #include "debug.h"
16 /***********************************************************************
17 * WIN16DRV_ExtTextOut
19 BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
20 const RECT32 *lprect, LPCSTR str, UINT32 count,
21 const INT32 *lpDx )
23 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
24 BOOL32 bRet = 1;
25 RECT16 clipRect;
26 RECT16 opaqueRect;
27 RECT16 *lpOpaqueRect = NULL;
28 WORD wOptions = 0;
29 WORD wCount = count;
31 static BOOL32 bInit = FALSE;
35 if (count == 0)
36 return FALSE;
38 dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n", dc->hSelf, x, y,
39 flags, lprect, count > 0 ? count : 8, str, lpDx);
42 if (bInit == FALSE)
44 DWORD dwRet;
46 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
47 NULL, " ",
48 -1, physDev->segptrFontInfo, win16drv_SegPtr_DrawMode,
49 win16drv_SegPtr_TextXForm, NULL, NULL, 0);
50 bInit = TRUE;
53 if (dc != NULL)
55 DWORD dwRet;
56 clipRect.left = 0;
57 clipRect.top = 0;
59 clipRect.right = dc->w.devCaps->horzRes;
60 clipRect.bottom = dc->w.devCaps->vertRes;
61 if (lprect)
63 opaqueRect.left = lprect->left;
64 opaqueRect.top = lprect->top;
65 opaqueRect.right = lprect->right;
66 opaqueRect.bottom = lprect->bottom;
67 lpOpaqueRect = &opaqueRect;
71 #ifdef NOTDEF
73 RECT16 rcPageSize;
74 FONTINFO16 *p = (FONTINFO16 *)PTR_SEG_TO_LIN(physDev->segptrFontInfo);
75 rcPageSize.left = 0;
76 rcPageSize.right = 0x3c0;
78 rcPageSize.top = 0;
79 rcPageSize.bottom = 0x630;
84 if(y < rcPageSize.top || y + p->dfPixHeight > rcPageSize.bottom)
86 printf("Failed 1 y %d top %d y +height %d bottom %d\n",
87 y, rcPageSize.top , y + p->dfPixHeight , rcPageSize.bottom);
91 if(x >= rcPageSize.right ||
92 x + wCount * p->dfPixWidth < rcPageSize.left)
94 printf("Faile 2\n");
98 #endif
100 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, XLPTODP(dc,x), XLPTODP(dc,y),
101 &clipRect, str,
102 wCount, physDev->segptrFontInfo, win16drv_SegPtr_DrawMode,
103 win16drv_SegPtr_TextXForm, NULL, lpOpaqueRect, wOptions);
105 return bRet;