Lines Matching refs:hdc
31 static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
32 static DWORD (WINAPI *pGetLayout)(HDC hdc);
81 HDC hdc; in test_world_transform() local
86 hdc = CreateCompatibleDC(0); in test_world_transform()
94 ret = SetWorldTransform(hdc, &xform); in test_world_transform()
97 size_cx = GetDeviceCaps(hdc, HORZSIZE); in test_world_transform()
98 size_cy = GetDeviceCaps(hdc, VERTSIZE); in test_world_transform()
99 res_x = GetDeviceCaps(hdc, HORZRES); in test_world_transform()
100 res_y = GetDeviceCaps(hdc, VERTRES); in test_world_transform()
101 dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); in test_world_transform()
102 dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); in test_world_transform()
106 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
107 expect_window_ext(hdc, 1, 1); in test_world_transform()
108 expect_world_transform(hdc, 1.0, 1.0); in test_world_transform()
109 expect_LPtoDP(hdc, 1000, 1000); in test_world_transform()
112 ret = SetMapMode(hdc, MM_LOMETRIC); in test_world_transform()
115 expect_viewport_ext(hdc, res_x, -res_y); in test_world_transform()
116 ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); in test_world_transform()
123 expect_world_transform(hdc, 1.0, 1.0); in test_world_transform()
124 expect_LPtoDP(hdc, MulDiv(1000 / 10, res_x, size_cx), -MulDiv(1000 / 10, res_y, size_cy)); in test_world_transform()
127 ret = SetMapMode(hdc, MM_TEXT); in test_world_transform()
130 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
131 expect_window_ext(hdc, 1, 1); in test_world_transform()
132 expect_world_transform(hdc, 1.0, 1.0); in test_world_transform()
133 expect_LPtoDP(hdc, 1000, 1000); in test_world_transform()
135 ret = SetGraphicsMode(hdc, GM_ADVANCED); in test_world_transform()
138 DeleteDC(hdc); in test_world_transform()
143 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
144 expect_window_ext(hdc, 1, 1); in test_world_transform()
145 expect_world_transform(hdc, 1.0, 1.0); in test_world_transform()
146 expect_LPtoDP(hdc, 1000, 1000); in test_world_transform()
155 ret = SetWorldTransform(hdc, &xform); in test_world_transform()
167 ret = SetWorldTransform(hdc, &xform); in test_world_transform()
170 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
171 expect_window_ext(hdc, 1, 1); in test_world_transform()
172 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
173 expect_LPtoDP(hdc, 20000, 20000); in test_world_transform()
176 ret = SetMapMode(hdc, MM_LOMETRIC); in test_world_transform()
179 expect_viewport_ext(hdc, res_x, -res_y); in test_world_transform()
180 ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); in test_world_transform()
187 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
188 expect_LPtoDP(hdc, MulDiv(20000, res_x, size.cx), -MulDiv(20000, res_y, size.cy)); in test_world_transform()
191 ret = SetMapMode(hdc, MM_TEXT); in test_world_transform()
194 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
195 expect_window_ext(hdc, 1, 1); in test_world_transform()
196 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
197 expect_LPtoDP(hdc, 20000, 20000); in test_world_transform()
201 ret = SetViewportExtEx(hdc, -1, -1, &size); in test_world_transform()
204 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
205 expect_window_ext(hdc, 1, 1); in test_world_transform()
206 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
207 expect_LPtoDP(hdc, 20000, 20000); in test_world_transform()
209 ret = SetMapMode(hdc, MM_ANISOTROPIC); in test_world_transform()
212 expect_viewport_ext(hdc, 1, 1); in test_world_transform()
213 expect_window_ext(hdc, 1, 1); in test_world_transform()
214 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
215 expect_LPtoDP(hdc, 20000, 20000); in test_world_transform()
219 ret = SetViewportExtEx(hdc, -1, -1, &size); in test_world_transform()
222 expect_viewport_ext(hdc, -1, -1); in test_world_transform()
223 expect_window_ext(hdc, 1, 1); in test_world_transform()
224 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
225 expect_LPtoDP(hdc, -20000, -20000); in test_world_transform()
227 ret = SetGraphicsMode(hdc, GM_COMPATIBLE); in test_world_transform()
229 ret = GetGraphicsMode(hdc); in test_world_transform()
232 expect_viewport_ext(hdc, -1, -1); in test_world_transform()
233 expect_window_ext(hdc, 1, 1); in test_world_transform()
234 expect_world_transform(hdc, 20.0, 20.0); in test_world_transform()
235 expect_LPtoDP(hdc, -20000, -20000); in test_world_transform()
237 DeleteDC(hdc); in test_world_transform()
247 HDC hdc; in test_dc_layout() local
256 hdc = CreateCompatibleDC(0); in test_dc_layout()
257 bitmap = CreateCompatibleBitmap( hdc, 100, 100 ); in test_dc_layout()
258 SelectObject( hdc, bitmap ); in test_dc_layout()
260 size_cx = GetDeviceCaps(hdc, HORZSIZE); in test_dc_layout()
261 size_cy = GetDeviceCaps(hdc, VERTSIZE); in test_dc_layout()
262 res_x = GetDeviceCaps(hdc, HORZRES); in test_dc_layout()
263 res_y = GetDeviceCaps(hdc, VERTRES); in test_dc_layout()
264 dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); in test_dc_layout()
265 dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); in test_dc_layout()
267 ret = GetMapMode( hdc ); in test_dc_layout()
269 expect_viewport_ext(hdc, 1, 1); in test_dc_layout()
270 expect_window_ext(hdc, 1, 1); in test_dc_layout()
271 expect_world_transform(hdc, 1.0, 1.0); in test_dc_layout()
272 expect_LPtoDP(hdc, 1000, 1000); in test_dc_layout()
274 pSetLayout( hdc, LAYOUT_RTL ); in test_dc_layout()
275 if (!pGetLayout( hdc )) in test_dc_layout()
278 DeleteDC(hdc); in test_dc_layout()
282 ret = GetMapMode( hdc ); in test_dc_layout()
284 expect_viewport_ext(hdc, 1, 1); in test_dc_layout()
285 expect_window_ext(hdc, 1, 1); in test_dc_layout()
286 expect_world_transform(hdc, 1.0, 1.0); in test_dc_layout()
287 expect_LPtoDP(hdc, -1000 + 99, 1000); in test_dc_layout()
288 GetViewportOrgEx( hdc, &pt ); in test_dc_layout()
290 GetWindowOrgEx( hdc, &pt ); in test_dc_layout()
292 GetDCOrgEx( hdc, &pt ); in test_dc_layout()
297 BOOL ret = pGetTransform( hdc, 0x204, &xform ); /* World -> Device */ in test_dc_layout()
308 IntersectClipRect( hdc, 10, 10, 20, 20 ); in test_dc_layout()
310 GetClipRgn( hdc, hrgn ); in test_dc_layout()
313 pSetLayout( hdc, LAYOUT_LTR ); in test_dc_layout()
315 GetClipRgn( hdc, hrgn ); in test_dc_layout()
318 GetClipBox( hdc, &ret_rc ); in test_dc_layout()
320 IntersectClipRect( hdc, 80, 10, 85, 20 ); in test_dc_layout()
321 pSetLayout( hdc, LAYOUT_RTL ); in test_dc_layout()
323 GetClipRgn( hdc, hrgn ); in test_dc_layout()
326 GetClipBox( hdc, &ret_rc ); in test_dc_layout()
329 pSetLayout( hdc, LAYOUT_LTR ); in test_dc_layout()
330 ExtSelectClipRgn( hdc, hrgn, RGN_OR ); in test_dc_layout()
331 pSetLayout( hdc, LAYOUT_RTL ); in test_dc_layout()
333 GetClipRgn( hdc, hrgn ); in test_dc_layout()
336 GetClipBox( hdc, &ret_rc ); in test_dc_layout()
340 OffsetClipRgn( hdc, 5, 5 ); in test_dc_layout()
342 GetClipRgn( hdc, hrgn ); in test_dc_layout()
350 pGetRandomRgn( hdc, hrgn, 1 ); in test_dc_layout()
355 SetMapMode(hdc, MM_LOMETRIC); in test_dc_layout()
356 ret = GetMapMode( hdc ); in test_dc_layout()
359 expect_viewport_ext(hdc, res_x, -res_y); in test_dc_layout()
360 ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); in test_dc_layout()
367 expect_world_transform(hdc, 1.0, 1.0); in test_dc_layout()
368 expect_LPtoDP(hdc, -MulDiv(1000 / 10, res_x, size_cx) + 99, -MulDiv(1000 / 10, res_y, size_cy)); in test_dc_layout()
370 SetMapMode(hdc, MM_TEXT); in test_dc_layout()
371 ret = GetMapMode( hdc ); in test_dc_layout()
373 pSetLayout( hdc, LAYOUT_LTR ); in test_dc_layout()
374 ret = GetMapMode( hdc ); in test_dc_layout()
376 SetMapMode(hdc, MM_TEXT); in test_dc_layout()
377 ret = GetMapMode( hdc ); in test_dc_layout()
380 DeleteDC(hdc); in test_dc_layout()
386 HDC hdc = GetDC(0); in test_modify_world_transform() local
389 ret = SetGraphicsMode(hdc, GM_ADVANCED); in test_modify_world_transform()
392 ret = ModifyWorldTransform(hdc, NULL, MWT_IDENTITY); in test_modify_world_transform()
395 ret = ModifyWorldTransform(hdc, NULL, MWT_LEFTMULTIPLY); in test_modify_world_transform()
398 ret = ModifyWorldTransform(hdc, NULL, MWT_RIGHTMULTIPLY); in test_modify_world_transform()
401 ReleaseDC(0, hdc); in test_modify_world_transform()
404 static void test_SetWindowExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LONG expected_vp_cy) in test_SetWindowExt() argument
409 GetWindowOrgEx(hdc, &windowOrg); in test_SetWindowExt()
410 GetViewportOrgEx(hdc, &viewportOrg); in test_SetWindowExt()
412 SetWindowExtEx(hdc, cx, cy, NULL); in test_SetWindowExt()
413 GetWindowExtEx(hdc, &windowExt); in test_SetWindowExt()
418 GetViewportExtEx(hdc, &viewportExt); in test_SetWindowExt()
423 GetWindowOrgEx(hdc, &windowOrgAfter); in test_SetWindowExt()
428 GetViewportOrgEx(hdc, &viewportOrgAfter); in test_SetWindowExt()
434 static void test_SetViewportExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LONG expected_vp_cy) in test_SetViewportExt() argument
439 GetWindowOrgEx(hdc, &windowOrg); in test_SetViewportExt()
440 GetViewportOrgEx(hdc, &viewportOrg); in test_SetViewportExt()
441 GetWindowExtEx(hdc, &windowExt); in test_SetViewportExt()
443 SetViewportExtEx(hdc, cx, cy, NULL); in test_SetViewportExt()
444 GetViewportExtEx(hdc, &viewportExt); in test_SetViewportExt()
449 GetWindowExtEx(hdc, &windowExtAfter); in test_SetViewportExt()
454 GetWindowOrgEx(hdc, &windowOrgAfter); in test_SetViewportExt()
459 GetViewportOrgEx(hdc, &viewportOrgAfter); in test_SetViewportExt()
468 HDC hdc = GetDC(0); in test_isotropic_mapping() local
470 SetMapMode(hdc, MM_ISOTROPIC); in test_isotropic_mapping()
484 GetWindowExtEx(hdc, &win); in test_isotropic_mapping()
485 GetViewportExtEx(hdc, &vp); in test_isotropic_mapping()
487 test_SetViewportExt(hdc, 10 * vp.cx, 10 * vp.cy, 10 * vp.cx, 10 * vp.cy); in test_isotropic_mapping()
488 test_SetWindowExt(hdc, win.cx, win.cy, 10 * vp.cx, 10 * vp.cy); in test_isotropic_mapping()
489 test_SetWindowExt(hdc, 2 * win.cx, win.cy, 10 * vp.cx, 5 * vp.cy); in test_isotropic_mapping()
490 test_SetWindowExt(hdc, win.cx, win.cy, 5 * vp.cx, 5 * vp.cy); in test_isotropic_mapping()
491 test_SetViewportExt(hdc, 4 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); in test_isotropic_mapping()
492 test_SetViewportExt(hdc, vp.cx, 2 * vp.cy, vp.cx, vp.cy); in test_isotropic_mapping()
493 test_SetViewportExt(hdc, 2 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); in test_isotropic_mapping()
494 test_SetViewportExt(hdc, 4 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); in test_isotropic_mapping()
495 test_SetWindowExt(hdc, 4 * win.cx, 2 * win.cy, 2 * vp.cx, vp.cy); in test_isotropic_mapping()
496 test_SetViewportExt(hdc, -2 * vp.cx, -4 * vp.cy, -2 * vp.cx, -vp.cy); in test_isotropic_mapping()
497 test_SetViewportExt(hdc, -2 * vp.cx, -1 * vp.cy, -2 * vp.cx, -vp.cy); in test_isotropic_mapping()
498 test_SetWindowExt(hdc, -4 * win.cx, -2 * win.cy, -2 * vp.cx, -vp.cy); in test_isotropic_mapping()
499 test_SetWindowExt(hdc, 4 * win.cx, -4 * win.cy, -vp.cx, -vp.cy); in test_isotropic_mapping()
501 ReleaseDC(0, hdc); in test_isotropic_mapping()
506 HDC hdc = CreateICA("DISPLAY", NULL, NULL, NULL); in test_setvirtualresolution() local
508 INT horz_res = GetDeviceCaps(hdc, HORZRES); in test_setvirtualresolution()
509 INT horz_size = GetDeviceCaps(hdc, HORZSIZE); in test_setvirtualresolution()
510 INT log_pixels_x = GetDeviceCaps(hdc, LOGPIXELSX); in test_setvirtualresolution()
520 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
521 GetViewportExtEx(hdc, &orig_lometric_vp); in test_setvirtualresolution()
522 GetWindowExtEx(hdc, &orig_lometric_wnd); in test_setvirtualresolution()
523 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
525 r = pSetVirtualResolution(hdc, 4000, 1000, 400, 200); /* 10 pix/mm x 5 pix/mm */ in test_setvirtualresolution()
527 expect_LPtoDP(hdc, 1000, 1000); in test_setvirtualresolution()
528 expect_viewport_ext(hdc, 1, 1); in test_setvirtualresolution()
529 expect_window_ext(hdc, 1, 1); in test_setvirtualresolution()
531 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
532 expect_LPtoDP(hdc, 1000, -500); in test_setvirtualresolution()
533 expect_viewport_ext(hdc, 4000, -1000); in test_setvirtualresolution()
534 expect_window_ext(hdc, 4000, 2000); in test_setvirtualresolution()
537 ok(horz_res == GetDeviceCaps(hdc, HORZRES), "horz_res changed\n"); in test_setvirtualresolution()
538 ok(horz_size == GetDeviceCaps(hdc, HORZSIZE), "horz_size changed\n"); in test_setvirtualresolution()
539 ok(log_pixels_x == GetDeviceCaps(hdc, LOGPIXELSX), "log_pixels_x changed\n"); in test_setvirtualresolution()
541 r = pSetVirtualResolution(hdc, 8000, 1000, 400, 200); /* 20 pix/mm x 5 pix/mm */ in test_setvirtualresolution()
543 expect_LPtoDP(hdc, 1000, -500); /* No change, need to re-set the mapping mode */ in test_setvirtualresolution()
544 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
545 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
546 expect_LPtoDP(hdc, 2000, -500); in test_setvirtualresolution()
547 expect_viewport_ext(hdc, 8000, -1000); in test_setvirtualresolution()
548 expect_window_ext(hdc, 4000, 2000); in test_setvirtualresolution()
550 r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */ in test_setvirtualresolution()
552 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
553 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
554 expect_LPtoDP(hdc, 4000, -500); in test_setvirtualresolution()
555 expect_viewport_ext(hdc, 8000, -1000); in test_setvirtualresolution()
556 expect_window_ext(hdc, 2000, 2000); in test_setvirtualresolution()
558 r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */ in test_setvirtualresolution()
560 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
561 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
562 expect_LPtoDP(hdc, 4000, -500); in test_setvirtualresolution()
563 expect_viewport_ext(hdc, 8000, -1000); in test_setvirtualresolution()
564 expect_window_ext(hdc, 2000, 2000); in test_setvirtualresolution()
566 r = pSetVirtualResolution(hdc, 8000, 2000, 200, 200); /* 40 pix/mm x 10 pix/mm */ in test_setvirtualresolution()
568 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
569 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
570 expect_LPtoDP(hdc, 4000, -1000); in test_setvirtualresolution()
571 expect_viewport_ext(hdc, 8000, -2000); in test_setvirtualresolution()
572 expect_window_ext(hdc, 2000, 2000); in test_setvirtualresolution()
574 r = pSetVirtualResolution(hdc, 0, 0, 10, 0); /* Error */ in test_setvirtualresolution()
576 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
577 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
578 expect_LPtoDP(hdc, 4000, -1000); in test_setvirtualresolution()
579 expect_viewport_ext(hdc, 8000, -2000); in test_setvirtualresolution()
580 expect_window_ext(hdc, 2000, 2000); in test_setvirtualresolution()
582 r = pSetVirtualResolution(hdc, 0, 0, 0, 0); /* Reset to true resolution */ in test_setvirtualresolution()
584 SetMapMode(hdc, MM_TEXT); in test_setvirtualresolution()
585 SetMapMode(hdc, MM_LOMETRIC); in test_setvirtualresolution()
586 expect_viewport_ext(hdc, orig_lometric_vp.cx, orig_lometric_vp.cy); in test_setvirtualresolution()
587 expect_window_ext(hdc, orig_lometric_wnd.cx, orig_lometric_wnd.cy); in test_setvirtualresolution()
589 DeleteDC(hdc); in test_setvirtualresolution()
616 HDC hdc = CreateICA("DISPLAY", NULL, NULL, NULL); in test_gettransform() local
627 r = pGetTransform(hdc, 0x203, &xform); /* World -> Page */ in test_gettransform()
630 r = pGetTransform(hdc, 0x304, &xform); /* Page -> Device */ in test_gettransform()
633 r = pGetTransform(hdc, 0x204, &xform); /* World -> Device */ in test_gettransform()
636 r = pGetTransform(hdc, 0x402, &xform); /* Device -> World */ in test_gettransform()
640 SetMapMode(hdc, MM_LOMETRIC); in test_gettransform()
641 GetViewportExtEx(hdc, &lometric_vp); in test_gettransform()
642 GetWindowExtEx(hdc, &lometric_wnd); in test_gettransform()
644 r = pGetTransform(hdc, 0x203, &xform); /* World -> Page */ in test_gettransform()
648 r = pGetTransform(hdc, 0x304, &xform); /* Page -> Device */ in test_gettransform()
656 r = pGetTransform(hdc, 0x204, &xform); /* World -> Device */ in test_gettransform()
660 r = pGetTransform(hdc, 0x402, &xform); /* Device -> World */ in test_gettransform()
667 SetGraphicsMode(hdc, GM_ADVANCED); in test_gettransform()
671 SetWorldTransform(hdc, &expect); in test_gettransform()
672 r = pGetTransform(hdc, 0x203, &xform); /* World -> Page */ in test_gettransform()
676 r = pGetTransform(hdc, 0x304, &xform); /* Page -> Device */ in test_gettransform()
682 r = pGetTransform(hdc, 0x204, &xform); /* World -> Device */ in test_gettransform()
688 r = pGetTransform(hdc, 0x402, &xform); /* Device -> World */ in test_gettransform()
694 r = pGetTransform(hdc, 0x102, &xform); in test_gettransform()
696 r = pGetTransform(hdc, 0x103, &xform); in test_gettransform()
698 r = pGetTransform(hdc, 0x104, &xform); in test_gettransform()
700 r = pGetTransform(hdc, 0x202, &xform); in test_gettransform()
702 r = pGetTransform(hdc, 0x302, &xform); in test_gettransform()
704 r = pGetTransform(hdc, 0x303, &xform); in test_gettransform()
706 r = pGetTransform(hdc, 0x403, &xform); in test_gettransform()
708 r = pGetTransform(hdc, 0x404, &xform); in test_gettransform()
710 r = pGetTransform(hdc, 0xffff, &xform); in test_gettransform()