1077{
1079 const WCHAR *strPtr;
1080 WCHAR *retstr, *p_retstr;
1081 size_t size_retstr;
1085 int lmargin = 0, rmargin = 0;
1088 int max_width = 0;
1089 int last_line;
1090 int tabwidth = 0;
1091 int prefix_offset;
1094
1096
1097#ifdef _WIN32K_
1099#else
1102#endif
1103 if (dtp)
TRACE(
"Params: iTabLength=%d, iLeftMargin=%d, iRightMargin=%d\n",
1105
1107
1109
1111 flags &= ~DT_WORDBREAK;
1112#ifdef _WIN32K_
1114#else
1116#endif
1118 lh =
tm.tmHeight +
tm.tmExternalLeading;
1119 else
1121
1123 return lh;
1124
1126 return 0;
1127#ifdef _WIN32K_
1129 {
1130 SIZE window_ext, viewport_ext;
1133 if ((window_ext.
cy > 0) != (viewport_ext.
cy > 0))
1135 }
1136#else
1138 {
1139 SIZE window_ext, viewport_ext;
1142 if ((window_ext.
cy > 0) != (viewport_ext.
cy > 0))
1144 }
1145#endif
1147 {
1148#ifdef _WIN32K_
1150#else
1152#endif
1154 {
1156 {
1159 rect->bottom =
rect->top + (invert_y ? -lh : lh);
1160 else
1162 }
1163 return lh;
1164 }
1165 }
1166
1167 if (dtp)
1168 {
1174 }
1175
1177 {
1179 tabwidth =
tm.tmAveCharWidth * tabstop;
1180 }
1181
1183#ifndef _WIN32K_
1185 {
1186 int hasClip;
1189 {
1191
1192 if (hasClip != 1)
1193 {
1196 }
1198 }
1199 }
1200#else
1202 {
1203 int hasClip;
1206 {
1208 if (hasClip != 1)
1209 {
1212 }
1214 }
1215 }
1216#endif
1218 {
1220#ifdef _WIN32K_
1222#else
1224#endif
1225 if (!retstr) return 0;
1227 }
1228 else
1229 {
1230 size_retstr = 0;
1232 }
1233 p_retstr = retstr;
1234
1235 do
1236 {
1238 if (invert_y)
1240 else
1242 strPtr =
TEXT_NextLineW(
hdc, strPtr, &
count,
line, &
len,
width,
flags, &
size, last_line, &p_retstr, tabwidth, &prefix_offset, &ellip);
1243
1244#ifdef __REACTOS__
1246 {
1248 {
1250 }
1251 else
1252 {
1254 }
1255 }
1256#else
1259#endif
1261
1263 {
1264#ifdef __REACTOS__
1269#else
1273#endif
1274 }
1275
1277 {
1281 {
1282 int len_seg;
1285 {
1289 if (len_seg !=
len &&
1290#ifdef _WIN32K_
1292#else
1294#endif
1295 {
1296#ifdef _WIN32K_
1298#else
1300#endif
1301 return 0;
1302 }
1303 }
1304 else
1306#ifdef _WIN32K_
1311#else
1316#endif
1317 {
1318#ifdef _WIN32K_
1320#else
1322#endif
1323 return 0;
1324 }
1325 if (prefix_offset != -1 && prefix_offset < len_seg)
1326 {
1328 }
1332 {
1335 xseg += ((
size.cx/tabwidth)+1)*tabwidth;
1336 if (prefix_offset != -1)
1337 {
1338 if (prefix_offset < len_seg)
1339 {
1340
1341
1342
1343
1344
1345
1346 prefix_offset = -1;
1347 }
1348 else
1349 prefix_offset -= len_seg;
1350 }
1351 }
1352 }
1353 }
1354 else if (
size.cx > max_width)
1355 max_width =
size.cx;
1356
1357 y += invert_y ? -lh : lh;
1358 if (dtp)
1360 }
1361 while (strPtr && !last_line);
1362
1363#ifndef _WIN32K_
1365 {
1369 {
1371 }
1372 }
1373#else
1375 {
1378 {
1380 }
1381 }
1382#endif
1383
1385 {
1386 rect->right =
rect->left + max_width;
1388 if (dtp)
1389 rect->right += lmargin + rmargin;
1390 }
1391 if (retstr)
1392 {
1394#ifdef _WIN32K_
1396#else
1398#endif
1399 }
1400 return y -
rect->top;
1401}
static const char * wine_dbgstr_rect(const RECT *prc)
int FASTCALL GreGetGraphicsMode(HDC)
#define ExAllocatePoolWithTag(hernya, size, tag)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei width
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
#define ExFreePoolWithTag(_P, _T)
BOOL WINAPI GreGetViewportExtEx(_In_ HDC hdc, _Out_ LPSIZE lpSize)
BOOL WINAPI GreGetWindowExtEx(_In_ HDC hdc, _Out_ LPSIZE lpSize)
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
__kernel_entry W32KAPI INT APIENTRY NtGdiExtSelectClipRgn(_In_ HDC hdc, _In_opt_ HRGN hrgn, _In_ INT iMode)
__kernel_entry W32KAPI INT APIENTRY NtGdiIntersectClipRect(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
__kernel_entry W32KAPI INT APIENTRY NtGdiGetRandomRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ INT iRgn)
BOOL UserExtTextOutW(HDC hdc, INT x, INT y, UINT flags, PRECTL lprc, LPCWSTR lpString, UINT count)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
BOOL WINAPI GreGetTextMetricsW(_In_ HDC hdc, _Out_ LPTEXTMETRICW lptm)
BOOL FASTCALL GreGetTextExtentW(_In_ HDC hDC, _In_reads_(cwc) PCWCH lpwsz, _In_ INT cwc, _Out_ PSIZE psize, _In_ UINT flOpts)
static void TEXT_DrawUnderscore(HDC hdc, int x, int y, const WCHAR *str, int offset, const RECT *rect)
static const WCHAR * TEXT_NextLineW(HDC hdc, const WCHAR *str, int *count, WCHAR *dest, int *len, int width, DWORD format, SIZE *retsize, int last_line, WCHAR **p_retstr, int tabwidth, int *pprefix_offset, ellipsis_data *pellip)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI GetGraphicsMode(_In_ HDC)
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
BOOL WINAPI GdiFlush(void)
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
BOOL WINAPI GetWindowExtEx(_In_ HDC, _Out_ LPSIZE)
BOOL WINAPI GetViewportExtEx(_In_ HDC, _Out_ LPSIZE)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)