- Timestamp:
- Dec 9, 1999, 5:49:45 PM (26 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/gdi32.DEF
r1710 r2049 1 ; $Id: gdi32.DEF,v 1. 3 1999-11-12 11:38:38 sandervlExp $1 ; $Id: gdi32.DEF,v 1.4 1999-12-09 16:49:44 cbratschi Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 6 6 7 7 IMPORTS 8 __GpiQueryDCData@4 = PMGPI.665 8 9 _GpiEnableYInversion = PMGPI.723 9 10 … … 340 341 ; pfnSelectPalette = _pfnSelectPalette@?? @434 341 342 343 ;USER32 functions 344 InternalDrawTextExA = _InternalDrawTextExA@24 @1000 345 InternalDrawTextExW = _InternalDrawTextExW@24 @1001 346 InternalTabbedTextOutA = _InternalTabbedTextOutA@32 @1002 347 InternalTabbedTextOutW = _InternalTabbedTextOutW@32 @1003 348 InternalGetTabbedTextExtentA = _InternalGetTabbedTextExtentA@20 @1004 349 InternalGetTabbedTextExtentW = _InternalGetTabbedTextExtentW@20 @1005 -
trunk/src/gdi32/gdi32exp.def
r1533 r2049 319 319 _UpdateICMRegKeyW@16 @430 320 320 _WidenPath@4 @431 321 _InternalDrawTextExA@24 @1000 322 _InternalDrawTextExW@24 @1001 323 _InternalTabbedTextOutA@32 @1002 324 _InternalTabbedTextOutW@32 @1003 325 _InternalGetTabbedTextExtentA@20 @1004 326 _InternalGetTabbedTextExtentW@20 @1005 -
trunk/src/gdi32/makefile
r1961 r2049 1 # $Id: makefile,v 1.1 3 1999-12-03 17:31:51cbratschi Exp $1 # $Id: makefile,v 1.14 1999-12-09 16:49:45 cbratschi Exp $ 2 2 3 3 # … … 22 22 TARGET = gdi32 23 23 24 OBJS = gdi32.obj opengl.obj callback.obj dibsect.obj initterm.obj oslibgdi.obj font.obj text.obj palette.obj line.obj 24 OBJS = gdi32.obj opengl.obj callback.obj dibsect.obj initterm.obj \ 25 oslibgdi.obj font.obj text.obj palette.obj line.obj oslibgpi.obj 25 26 26 27 … … 74 75 $(PDWIN32_INCLUDE)\misc.h \ 75 76 77 oslibgpi.obj: oslibgpi.cpp oslibgpi.h 78 76 79 initterm.obj: initterm.cpp 77 80 -
trunk/src/gdi32/oslibgdi.cpp
r1095 r2049 1 /* $Id: oslibgdi.cpp,v 1. 1 1999-10-01 10:14:59 sandervlExp $ */1 /* $Id: oslibgdi.cpp,v 1.2 1999-12-09 16:49:45 cbratschi Exp $ */ 2 2 3 3 /* … … 11 11 #define INCL_GPI 12 12 #define INCL_WIN 13 #include <os2wrap.h> 13 #include <os2wrap.h> //Odin32 OS/2 api wrappers 14 14 #include <stdlib.h> 15 15 #include <string.h> … … 22 22 //****************************************************************************** 23 23 //****************************************************************************** 24 INT OSLibSetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy, 25 INT xSrc, INT ySrc, UINT startscan, UINT lines, 26 LPCVOID bits, WINBITMAPINFOHEADER *info, 24 INT OSLibSetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy, 25 INT xSrc, INT ySrc, UINT startscan, UINT lines, 26 LPCVOID bits, WINBITMAPINFOHEADER *info, 27 27 UINT coloruse) 28 28 { … … 56 56 descr.gc = physDev->gc; 57 57 descr.xSrc = xSrc; 58 descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy) 58 descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy) 59 59 : ySrc - startscan; 60 60 descr.xDest = dc->w.DCOrgX + XLPTODP( dc, xDest ); … … 77 77 GpiDrawBits((HPS)hdc, (VOID *)bits, (BITMAPINFO2 *)info, 4, 78 78 points, ROP_SRCCOPY, BBO_IGNORE); 79 79 80 80 return lines; 81 81 } 82 82 //****************************************************************************** 83 83 //****************************************************************************** 84 -
trunk/src/gdi32/oslibgdi.h
r1095 r2049 1 /* $Id: oslibgdi.h,v 1. 1 1999-10-01 10:14:59 sandervlExp $ */1 /* $Id: oslibgdi.h,v 1.2 1999-12-09 16:49:45 cbratschi Exp $ */ 2 2 3 3 /* … … 12 12 #define __OSLIBGDI_H__ 13 13 14 INT OSLibSetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy, 15 INT xSrc, INT ySrc, UINT startscan, UINT lines, 16 LPCVOID bits, WINBITMAPINFOHEADER *info, 14 INT OSLibSetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy, 15 INT xSrc, INT ySrc, UINT startscan, UINT lines, 16 LPCVOID bits, WINBITMAPINFOHEADER *info, 17 17 UINT coloruse); 18 18 -
trunk/src/gdi32/text.cpp
r1961 r2049 1 /* $Id: text.cpp,v 1. 2 1999-12-03 17:31:51cbratschi Exp $ */1 /* $Id: text.cpp,v 1.3 1999-12-09 16:49:45 cbratschi Exp $ */ 2 2 3 3 /* … … 16 16 #include <misc.h> 17 17 #include <string.h> 18 #include "oslibgpi.h" 18 19 19 20 //****************************************************************************** … … 61 62 } 62 63 //****************************************************************************** 63 //****************************************************************************** 64 static BOOL InternalTextOutA(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut) 65 { 66 if (cbCount < 0 || (lpszString == NULL && cbCount != 0)) 64 // CB: USER32 function, but here is the better place 65 //****************************************************************************** 66 INT WIN32API InternalDrawTextExA(HDC hdc,LPCSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams) 67 { 68 //CB: todo 69 70 return 0; 71 } 72 //****************************************************************************** 73 //****************************************************************************** 74 INT WIN32API InternalDrawTextExW(HDC hdc,LPWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams) 75 { 76 char *astring = UnicodeToAsciiStringN((LPWSTR)lpchText,cchText); 77 INT rc; 78 79 rc = InternalDrawTextExA(hdc,astring,cchText,lprc,dwDTFormat,lpDTParams); 80 FreeAsciiString(astring); 81 82 return(rc); 83 } 84 //****************************************************************************** 85 // CB: USER32 function, but here is the better place 86 //****************************************************************************** 87 LONG WIN32API InternalTabbedTextOutA( HDC hdc, int x, int y, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin) 88 { 89 //CB: todo 90 91 return 0; 92 } 93 //****************************************************************************** 94 //****************************************************************************** 95 LONG WIN32API InternalTabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin) 96 { 97 char *astring = UnicodeToAsciiStringN((LPWSTR)lpString,nCount); 98 LONG rc; 99 100 rc = InternalTabbedTextOutA(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin); 101 FreeAsciiString(astring); 102 103 return(rc); 104 } 105 //****************************************************************************** 106 // CB: USER32 function, but here is the better place 107 //****************************************************************************** 108 DWORD WIN32API InternalGetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions) 109 { 110 //CB: todo 111 112 return 0; 113 } 114 //****************************************************************************** 115 //****************************************************************************** 116 DWORD WIN32API InternalGetTabbedTextExtentW( HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions) 117 { 118 char *astring = UnicodeToAsciiStringN((LPWSTR)lpString,nCount); 119 DWORD rc; 120 121 rc = InternalGetTabbedTextExtentA(hDC,astring,nCount,nTabPositions,lpnTabStopPositions); 122 FreeAsciiString(astring); 123 124 return(rc); 125 } 126 //****************************************************************************** 127 // todo: metafile support 128 //****************************************************************************** 129 BOOL InternalTextOutA(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut) 130 { 131 PVOID pHps = OSLibGpiQueryDCData(hdc); 132 ULONG flOptions = 0; 133 RECTLOS2 pmRect; 134 POINTLOS2 ptl; 135 LONG hits; 136 137 if (!pHps || cbCount < 0 || (lpszString == NULL && cbCount != 0)) 67 138 { 68 139 SetLastError(ERROR_INVALID_HANDLE); … … 70 141 } 71 142 72 //CB: todo 73 74 if (IsExtTextOut) 75 return O32_ExtTextOut(hdc,X,Y,fuOptions,lprc,lpszString,cbCount,lpDx); 76 else 77 return O32_TextOut(hdc,X,Y,lpszString,cbCount); 78 } 79 //****************************************************************************** 80 //****************************************************************************** 81 static BOOL InternalTextOutW(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCWSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut) 82 { 83 char *astring = UnicodeToAsciiString((LPWSTR)lpszString); 143 if (cbCount > 512) 144 { 145 SetLastError(ERROR_INVALID_PARAMETER); 146 return FALSE; 147 } 148 if (fuOptions & ~((UINT)(ETO_CLIPPED | ETO_OPAQUE))) 149 { 150 //ETO_GLYPH_INDEX, ETO_RTLLEADING, ETO_NUMERICSLOCAL, ETO_NUMERICSLATIN, ETO_IGNORELANGUAGE, ETO_PDY are ignored 151 return TRUE; 152 } 153 154 //CB: add metafile info 155 156 if (lprc) 157 { 158 if (fuOptions) 159 { 160 MapWin32ToOS2Rect(*lprc,pmRect); 161 if (excludeBottomRightPoint(pHps,(PPOINTLOS2)&pmRect) == 0) 162 { 163 return TRUE; 164 } 165 166 if (fuOptions & ETO_CLIPPED) flOptions |= CHSOS_CLIP; 167 if (fuOptions & ETO_OPAQUE) flOptions |= CHSOS_OPAQUE; 168 } 169 } else 170 { 171 if (fuOptions) 172 { 173 SetLastError(ERROR_INVALID_HANDLE); 174 return FALSE; 175 } 176 } 177 178 if (cbCount == 0) 179 { 180 if (fuOptions & ETO_OPAQUE) 181 { 182 lpszString = " "; 183 cbCount = 1; 184 flOptions |= CHSOS_CLIP; 185 } else return TRUE; 186 } 187 if (lpDx) 188 flOptions |= CHSOS_VECTOR; 189 190 if (getAlignUpdateCP(pHps) == FALSE) 191 { 192 ptl.x = X; 193 ptl.y = Y; 194 195 flOptions |= CHSOS_LEAVEPOS; 196 } else OSLibGpiQueryCurrentPosition(pHps,&ptl); 197 198 UINT align = GetTextAlign(hdc); 199 LONG pmHAlign,pmVAlign; 200 201 //CB: TA_RIGHT not supported, only TA_CENTER and TA_LEFT 202 if ((align & 0x6) == TA_RIGHT) 203 { 204 PPOINTLOS2 pts = (PPOINTLOS2)malloc((cbCount+1)*sizeof(POINTLOS2)); 205 206 OSLibGpiQueryCharStringPosAt(pHps,&ptl,flOptions,cbCount,lpszString,lpDx,pts); 207 ptl.x -= pts[cbCount].x-pts[0].x; 208 free(pts); 209 } 210 211 if (lprc && (align & 0x18) == TA_BASELINE) 212 { 213 //CB: if TA_BASELINE is set, GPI doesn't fill rect 214 // TA_BOTTOM fills rect 215 OSLibGpiQueryTextAlignment(pHps,&pmHAlign,&pmVAlign); 216 OSLibGpiSetTextAlignment(pHps,pmHAlign,(pmVAlign & ~TAOS_BASE) | TAOS_BOTTOM); 217 } 218 219 ptl.y += getWorldYDeltaFor1Pixel(pHps); 220 221 hits = OSLibGpiCharStringPosAt(pHps,&ptl,&pmRect,flOptions,cbCount,lpszString,lpDx); 222 223 if (lprc && (align & 0x18) == TA_BASELINE) 224 OSLibGpiSetTextAlignment(pHps,pmHAlign,pmVAlign); 225 226 if (hits == GPIOS_ERROR) 227 { 228 return FALSE; 229 } 230 if (getAlignUpdateCP(pHps)) 231 { 232 OSLibGpiQueryCurrentPosition(pHps,&ptl); 233 ptl.y -= getWorldYDeltaFor1Pixel(pHps); 234 OSLibGpiSetCurrentPosition(pHps,&ptl); 235 } 236 237 return TRUE; 238 } 239 //****************************************************************************** 240 //****************************************************************************** 241 BOOL InternalTextOutW(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCWSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut) 242 { 243 char *astring = UnicodeToAsciiStringN((LPWSTR)lpszString,cbCount); 84 244 BOOL rc; 85 245
Note:
See TracChangeset
for help on using the changeset viewer.