2 * GDI Device Context functions
4 * Copyright 1993 Alexandre Julliard
19 static DeviceCaps
* displayDevCaps
= NULL
;
21 extern void CLIPPING_UpdateGCRegion( DC
* dc
); /* objects/clipping.c */
23 /* Default DC values */
24 static const WIN_DC_INFO DC_defaultValues
=
32 STOCK_BLACK_PEN
, /* hPen */
33 STOCK_WHITE_BRUSH
, /* hBrush */
34 STOCK_SYSTEM_FONT
, /* hFont */
38 STOCK_DEFAULT_PALETTE
, /* hPalette */
39 R2_COPYPEN
, /* ROPmode */
40 ALTERNATE
, /* polyFillMode */
41 BLACKONWHITE
, /* stretchBltMode */
42 ABSOLUTE
, /* relAbsMode */
43 OPAQUE
, /* backgroundMode */
44 RGB( 255, 255, 255 ), /* backgroundColor */
45 RGB( 0, 0, 0 ), /* textColor */
46 0, /* backgroundPixel */
50 TA_LEFT
| TA_TOP
| TA_NOUPDATECP
, /* textAlign */
52 0, /* breakTotalExtra */
57 MM_TEXT
, /* MapMode */
72 /* ROP code to GC function conversion */
73 const int DC_XROPfunction
[16] =
75 GXclear
, /* R2_BLACK */
76 GXnor
, /* R2_NOTMERGEPEN */
77 GXandInverted
, /* R2_MASKNOTPEN */
78 GXcopyInverted
, /* R2_NOTCOPYPEN */
79 GXandReverse
, /* R2_MASKPENNOT */
80 GXinvert
, /* R2_NOT */
81 GXxor
, /* R2_XORPEN */
82 GXnand
, /* R2_NOTMASKPEN */
83 GXand
, /* R2_MASKPEN */
84 GXequiv
, /* R2_NOTXORPEN */
86 GXorInverted
, /* R2_MERGENOTPEN */
87 GXcopy
, /* R2_COPYPEN */
88 GXorReverse
, /* R2_MERGEPENNOT */
89 GXor
, /* R2_MERGEPEN */
94 /***********************************************************************
97 * Fill the device caps structure.
99 void DC_FillDevCaps( DeviceCaps
* caps
)
101 caps
->version
= 0x300;
102 caps
->technology
= DT_RASDISPLAY
;
103 caps
->horzSize
= WidthMMOfScreen(screen
) * screenWidth
/ WidthOfScreen(screen
);
104 caps
->vertSize
= HeightMMOfScreen(screen
) * screenHeight
/ HeightOfScreen(screen
);
105 caps
->horzRes
= screenWidth
;
106 caps
->vertRes
= screenHeight
;
107 caps
->bitsPixel
= screenDepth
;
109 caps
->numBrushes
= 16+6; /* 16 solid + 6 hatched brushes */
110 caps
->numPens
= 16; /* 16 solid pens */
111 caps
->numMarkers
= 0;
113 caps
->numColors
= 1 << caps
->bitsPixel
;
114 caps
->pdeviceSize
= 0;
115 caps
->curveCaps
= CC_CIRCLES
| CC_PIE
| CC_CHORD
| CC_ELLIPSES
|
116 CC_WIDE
| CC_STYLED
| CC_WIDESTYLED
|
117 CC_INTERIORS
| CC_ROUNDRECT
;
118 caps
->lineCaps
= LC_POLYLINE
| LC_MARKER
| LC_POLYMARKER
| LC_WIDE
|
119 LC_STYLED
| LC_WIDESTYLED
| LC_INTERIORS
;
120 caps
->polygonalCaps
= PC_POLYGON
| PC_RECTANGLE
| PC_WINDPOLYGON
|
121 PC_SCANLINE
| PC_WIDE
| PC_STYLED
|
122 PC_WIDESTYLED
| PC_INTERIORS
;
123 caps
->textCaps
= TC_OP_CHARACTER
| TC_OP_STROKE
| TC_CP_STROKE
|
124 TC_IA_ABLE
| TC_UA_ABLE
| TC_SO_ABLE
| TC_RA_ABLE
;
125 caps
->clipCaps
= CP_REGION
;
126 caps
->rasterCaps
= RC_BITBLT
| RC_BANDING
| RC_SCALING
| RC_BITMAP64
|
127 RC_DI_BITMAP
| RC_PALETTE
| RC_DIBTODEV
| RC_BIGFONT
|
128 RC_STRETCHBLT
| RC_STRETCHDIB
| RC_DEVBITS
;
129 caps
->aspectX
= 36; /* ?? */
130 caps
->aspectY
= 36; /* ?? */
132 caps
->logPixelsX
= (int)(caps
->horzRes
* 25.4 / caps
->horzSize
);
133 caps
->logPixelsY
= (int)(caps
->vertRes
* 25.4 / caps
->vertSize
);
134 caps
->sizePalette
= DefaultVisual(display
,DefaultScreen(display
))->map_entries
;
135 caps
->numReserved
= 0;
140 /***********************************************************************
143 * Setup device-specific DC values for a newly created DC.
145 void DC_InitDC( HDC hdc
)
147 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
148 RealizeDefaultPalette( hdc
);
149 SetTextColor( hdc
, dc
->w
.textColor
);
150 SetBkColor( hdc
, dc
->w
.backgroundColor
);
151 SelectObject( hdc
, dc
->w
.hPen
);
152 SelectObject( hdc
, dc
->w
.hBrush
);
153 SelectObject( hdc
, dc
->w
.hFont
);
154 XSetGraphicsExposures( display
, dc
->u
.x
.gc
, False
);
155 XSetSubwindowMode( display
, dc
->u
.x
.gc
, IncludeInferiors
);
156 CLIPPING_UpdateGCRegion( dc
);
160 /***********************************************************************
161 * DC_SetupDCForPatBlt
163 * Setup the GC for a PatBlt operation using current brush.
164 * If fMapColors is TRUE, X pixels are mapped to Windows colors.
165 * Return FALSE if brush is BS_NULL, TRUE otherwise.
167 BOOL
DC_SetupGCForPatBlt( DC
* dc
, GC gc
, BOOL fMapColors
)
173 if (dc
->u
.x
.brush
.style
== BS_NULL
) return FALSE
;
174 if (dc
->u
.x
.brush
.pixel
== -1)
176 /* Special case used for monochrome pattern brushes.
177 * We need to swap foreground and background because
178 * Windows does it the wrong way...
180 val
.foreground
= dc
->w
.backgroundPixel
;
181 val
.background
= dc
->w
.textPixel
;
185 val
.foreground
= dc
->u
.x
.brush
.pixel
;
186 val
.background
= dc
->w
.backgroundPixel
;
188 if (fMapColors
&& COLOR_PixelToPalette
)
190 val
.foreground
= COLOR_PixelToPalette
[val
.foreground
];
191 val
.background
= COLOR_PixelToPalette
[val
.background
];
194 val
.function
= DC_XROPfunction
[dc
->w
.ROPmode
-1];
195 val
.fill_style
= dc
->u
.x
.brush
.fillStyle
;
196 switch(val
.fill_style
)
199 case FillOpaqueStippled
:
200 if (dc
->w
.backgroundMode
==OPAQUE
) val
.fill_style
= FillOpaqueStippled
;
201 val
.stipple
= dc
->u
.x
.brush
.pixmap
;
206 if (fMapColors
&& COLOR_PixelToPalette
)
210 pixmap
= XCreatePixmap( display
, rootWindow
, 8, 8, screenDepth
);
211 image
= XGetImage( display
, dc
->u
.x
.brush
.pixmap
, 0, 0, 8, 8,
212 AllPlanes
, ZPixmap
);
213 for (y
= 0; y
< 8; y
++)
214 for (x
= 0; x
< 8; x
++)
215 XPutPixel( image
, x
, y
,
216 COLOR_PixelToPalette
[XGetPixel( image
, x
, y
)] );
217 XPutImage( display
, pixmap
, gc
, image
, 0, 0, 0, 0, 8, 8 );
218 XDestroyImage( image
);
221 else val
.tile
= dc
->u
.x
.brush
.pixmap
;
229 val
.ts_x_origin
= dc
->w
.DCOrgX
+ dc
->w
.brushOrgX
;
230 val
.ts_y_origin
= dc
->w
.DCOrgY
+ dc
->w
.brushOrgY
;
231 val
.fill_rule
= (dc
->w
.polyFillMode
==WINDING
) ? WindingRule
: EvenOddRule
;
232 XChangeGC( display
, gc
,
233 GCFunction
| GCForeground
| GCBackground
| GCFillStyle
|
234 GCFillRule
| GCTileStipXOrigin
| GCTileStipYOrigin
| mask
,
236 if (pixmap
) XFreePixmap( display
, pixmap
);
241 /***********************************************************************
244 * Setup dc->u.x.gc for drawing operations using current brush.
245 * Return FALSE if brush is BS_NULL, TRUE otherwise.
247 BOOL
DC_SetupGCForBrush( DC
* dc
)
249 return DC_SetupGCForPatBlt( dc
, dc
->u
.x
.gc
, FALSE
);
253 /***********************************************************************
256 * Setup dc->u.x.gc for drawing operations using current pen.
257 * Return FALSE if pen is PS_NULL, TRUE otherwise.
259 BOOL
DC_SetupGCForPen( DC
* dc
)
263 if (dc
->u
.x
.pen
.style
== PS_NULL
) return FALSE
;
265 if ((screenDepth
<= 8) && /* FIXME: Should check for palette instead */
266 ((dc
->w
.ROPmode
== R2_BLACK
) || (dc
->w
.ROPmode
== R2_WHITE
)))
268 val
.function
= GXcopy
;
269 val
.foreground
= COLOR_ToPhysical( NULL
, (dc
->w
.ROPmode
== R2_BLACK
) ?
270 RGB(0,0,0) : RGB(255,255,255) );
274 val
.function
= DC_XROPfunction
[dc
->w
.ROPmode
-1];
275 val
.foreground
= dc
->u
.x
.pen
.pixel
;
277 val
.background
= dc
->w
.backgroundPixel
;
278 val
.fill_style
= FillSolid
;
279 if ((dc
->u
.x
.pen
.style
!=PS_SOLID
) && (dc
->u
.x
.pen
.style
!=PS_INSIDEFRAME
))
281 XSetDashes( display
, dc
->u
.x
.gc
, 0,
282 dc
->u
.x
.pen
.dashes
, dc
->u
.x
.pen
.dash_len
);
283 val
.line_style
= (dc
->w
.backgroundMode
== OPAQUE
) ?
284 LineDoubleDash
: LineOnOffDash
;
286 else val
.line_style
= LineSolid
;
287 val
.line_width
= dc
->u
.x
.pen
.width
;
288 val
.cap_style
= CapRound
;
289 val
.join_style
= JoinBevel
;
290 XChangeGC( display
, dc
->u
.x
.gc
,
291 GCFunction
| GCForeground
| GCBackground
| GCLineWidth
|
292 GCLineStyle
| GCCapStyle
| GCJoinStyle
| GCFillStyle
, &val
);
297 /***********************************************************************
300 * Setup dc->u.x.gc for text drawing operations.
301 * Return FALSE if the font is null, TRUE otherwise.
303 BOOL
DC_SetupGCForText( DC
* dc
)
307 if (!dc
->u
.x
.font
.fstruct
)
309 fprintf( stderr
, "DC_SetupGCForText: fstruct is NULL. Please report this\n" );
312 val
.function
= GXcopy
; /* Text is always GXcopy */
313 val
.foreground
= dc
->w
.textPixel
;
314 val
.background
= dc
->w
.backgroundPixel
;
315 val
.fill_style
= FillSolid
;
316 val
.font
= dc
->u
.x
.font
.fstruct
->fid
;
317 XChangeGC( display
, dc
->u
.x
.gc
,
318 GCFunction
| GCForeground
| GCBackground
| GCFillStyle
|
324 /***********************************************************************
325 * GetDCState (GDI.179)
327 HDC
GetDCState( HDC hdc
)
332 if (!(dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
))) return 0;
333 if (!(handle
= GDI_AllocObject( sizeof(DC
), DC_MAGIC
))) return 0;
334 newdc
= (DC
*) GDI_HEAP_LIN_ADDR( handle
);
336 dprintf_dc(stddeb
, "GetDCState("NPFMT
"): returning "NPFMT
"\n", hdc
, handle
);
338 memset( &newdc
->u
.x
, 0, sizeof(newdc
->u
.x
) );
339 memcpy( &newdc
->w
, &dc
->w
, sizeof(dc
->w
) );
340 memcpy( &newdc
->u
.x
.pen
, &dc
->u
.x
.pen
, sizeof(dc
->u
.x
.pen
) );
341 newdc
->saveLevel
= 0;
342 newdc
->w
.flags
|= DC_SAVED
;
344 newdc
->w
.hGCClipRgn
= 0;
345 newdc
->w
.hVisRgn
= CreateRectRgn( 0, 0, 0, 0 );
346 CombineRgn( newdc
->w
.hVisRgn
, dc
->w
.hVisRgn
, 0, RGN_COPY
);
349 newdc
->w
.hClipRgn
= CreateRectRgn( 0, 0, 0, 0 );
350 CombineRgn( newdc
->w
.hClipRgn
, dc
->w
.hClipRgn
, 0, RGN_COPY
);
352 COLOR_SetMapping( newdc
, dc
->u
.x
.pal
.hMapping
,
353 dc
->u
.x
.pal
.hRevMapping
, dc
->u
.x
.pal
.mappingSize
);
358 /***********************************************************************
359 * SetDCState (GDI.180)
361 void SetDCState( HDC hdc
, HDC hdcs
)
364 HRGN hVisRgn
, hClipRgn
, hGCClipRgn
;
366 if (!(dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
))) return;
367 if (!(dcs
= (DC
*) GDI_GetObjPtr( hdcs
, DC_MAGIC
))) return;
368 if (!dcs
->w
.flags
& DC_SAVED
) return;
369 dprintf_dc(stddeb
, "SetDCState: "NPFMT
" "NPFMT
"\n", hdc
, hdcs
);
371 /* Save the regions before overwriting everything */
372 hVisRgn
= dc
->w
.hVisRgn
;
373 hClipRgn
= dc
->w
.hClipRgn
;
374 hGCClipRgn
= dc
->w
.hGCClipRgn
;
375 memcpy( &dc
->w
, &dcs
->w
, sizeof(dc
->w
) );
376 memcpy( &dc
->u
.x
.pen
, &dcs
->u
.x
.pen
, sizeof(dc
->u
.x
.pen
) );
377 dc
->w
.flags
&= ~DC_SAVED
;
379 /* Restore the regions */
380 dc
->w
.hVisRgn
= hVisRgn
;
381 dc
->w
.hClipRgn
= hClipRgn
;
382 dc
->w
.hGCClipRgn
= hGCClipRgn
;
383 CombineRgn( dc
->w
.hVisRgn
, dcs
->w
.hVisRgn
, 0, RGN_COPY
);
384 SelectClipRgn( hdc
, dcs
->w
.hClipRgn
);
386 SelectObject( hdc
, dcs
->w
.hBrush
);
387 SelectObject( hdc
, dcs
->w
.hFont
);
388 COLOR_SetMapping( dc
, dcs
->u
.x
.pal
.hMapping
,
389 dcs
->u
.x
.pal
.hRevMapping
, dcs
->u
.x
.pal
.mappingSize
);
393 /***********************************************************************
396 int SaveDC( HDC hdc
)
401 dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
404 dc
= (DC
*)GDI_GetObjPtr(hdc
, METAFILE_DC_MAGIC
);
406 MF_MetaParam0(dc
, META_SAVEDC
);
409 if (!(hdcs
= GetDCState( hdc
))) return 0;
410 dcs
= (DC
*) GDI_HEAP_LIN_ADDR( hdcs
);
411 dcs
->header
.hNext
= dc
->header
.hNext
;
412 dc
->header
.hNext
= hdcs
;
413 dprintf_dc(stddeb
, "SaveDC("NPFMT
"): returning %d\n", hdc
, dc
->saveLevel
+1 );
414 return ++dc
->saveLevel
;
418 /***********************************************************************
421 BOOL
RestoreDC( HDC hdc
, short level
)
425 dprintf_dc(stddeb
, "RestoreDC: "NPFMT
" %d\n", hdc
, level
);
426 dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
429 dc
= (DC
*)GDI_GetObjPtr(hdc
, METAFILE_DC_MAGIC
);
430 if (!dc
) return FALSE
;
431 if (level
!= -1) return FALSE
;
432 MF_MetaParam1(dc
, META_RESTOREDC
, level
);
435 if (level
== -1) level
= dc
->saveLevel
;
436 if ((level
< 1) || (level
> (short)dc
->saveLevel
)) return FALSE
;
438 while ((short)dc
->saveLevel
>= level
)
440 HDC hdcs
= dc
->header
.hNext
;
441 if (!(dcs
= (DC
*) GDI_GetObjPtr( hdcs
, DC_MAGIC
))) return FALSE
;
442 dc
->header
.hNext
= dcs
->header
.hNext
;
443 if ((short)--dc
->saveLevel
< level
) SetDCState( hdc
, hdcs
);
450 /***********************************************************************
453 HDC
CreateDC( LPSTR driver
, LPSTR device
, LPSTR output
, LPSTR initData
)
458 handle
= GDI_AllocObject( sizeof(DC
), DC_MAGIC
);
459 if (!handle
) return 0;
460 dc
= (DC
*) GDI_HEAP_LIN_ADDR( handle
);
462 dprintf_dc(stddeb
, "CreateDC(%s %s %s): returning "NPFMT
"\n",
463 driver
, device
, output
, handle
);
467 displayDevCaps
= (DeviceCaps
*) xmalloc( sizeof(DeviceCaps
) );
468 DC_FillDevCaps( displayDevCaps
);
472 memcpy( &dc
->w
, &DC_defaultValues
, sizeof(DC_defaultValues
) );
473 memset( &dc
->u
.x
, 0, sizeof(dc
->u
.x
) );
475 dc
->u
.x
.drawable
= rootWindow
;
476 dc
->u
.x
.gc
= XCreateGC( display
, dc
->u
.x
.drawable
, 0, NULL
);
478 dc
->w
.devCaps
= displayDevCaps
;
479 dc
->w
.bitsPerPixel
= displayDevCaps
->bitsPixel
;
480 dc
->w
.hVisRgn
= CreateRectRgn( 0, 0, displayDevCaps
->horzRes
,
481 displayDevCaps
->vertRes
);
484 GDI_HEAP_FREE( handle
);
494 /***********************************************************************
497 HDC
CreateIC( LPSTR driver
, LPSTR device
, LPSTR output
, LPSTR initData
)
499 /* Nothing special yet for ICs */
500 return CreateDC( driver
, device
, output
, initData
);
504 /***********************************************************************
505 * CreateCompatibleDC (GDI.52)
507 HDC
CreateCompatibleDC( HDC hdc
)
514 handle
= GDI_AllocObject( sizeof(DC
), DC_MAGIC
);
515 if (!handle
) return 0;
516 dc
= (DC
*) GDI_HEAP_LIN_ADDR( handle
);
518 dprintf_dc(stddeb
, "CreateCompatibleDC("NPFMT
"): returning "NPFMT
"\n", hdc
, handle
);
520 /* Create default bitmap */
521 if (!(hbitmap
= CreateBitmap( 1, 1, 1, 1, NULL
)))
523 GDI_HEAP_FREE( handle
);
526 bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
529 memcpy( &dc
->w
, &DC_defaultValues
, sizeof(DC_defaultValues
) );
530 memset( &dc
->u
.x
, 0, sizeof(dc
->u
.x
) );
532 dc
->u
.x
.drawable
= bmp
->pixmap
;
533 dc
->u
.x
.gc
= XCreateGC( display
, dc
->u
.x
.drawable
, 0, NULL
);
534 dc
->w
.flags
= DC_MEMORY
;
535 dc
->w
.bitsPerPixel
= 1;
536 dc
->w
.devCaps
= displayDevCaps
;
537 dc
->w
.hBitmap
= hbitmap
;
538 dc
->w
.hFirstBitmap
= hbitmap
;
539 dc
->w
.hVisRgn
= CreateRectRgn( 0, 0, 1, 1 );
543 DeleteObject( hbitmap
);
544 GDI_HEAP_FREE( handle
);
554 /***********************************************************************
557 BOOL
DeleteDC( HDC hdc
)
559 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
560 if (!dc
) return FALSE
;
562 dprintf_dc(stddeb
, "DeleteDC: "NPFMT
"\n", hdc
);
564 while (dc
->saveLevel
)
567 HDC hdcs
= dc
->header
.hNext
;
568 if (!(dcs
= (DC
*) GDI_GetObjPtr( hdcs
, DC_MAGIC
))) break;
569 dc
->header
.hNext
= dcs
->header
.hNext
;
574 if (!(dc
->w
.flags
& DC_SAVED
))
576 SelectObject( hdc
, STOCK_BLACK_PEN
);
577 SelectObject( hdc
, STOCK_WHITE_BRUSH
);
578 SelectObject( hdc
, STOCK_SYSTEM_FONT
);
579 XFreeGC( display
, dc
->u
.x
.gc
);
582 if (dc
->w
.flags
& DC_MEMORY
) DeleteObject( dc
->w
.hFirstBitmap
);
583 if (dc
->w
.hClipRgn
) DeleteObject( dc
->w
.hClipRgn
);
584 if (dc
->w
.hVisRgn
) DeleteObject( dc
->w
.hVisRgn
);
585 if (dc
->w
.hGCClipRgn
) DeleteObject( dc
->w
.hGCClipRgn
);
587 return GDI_FreeObject( hdc
);
591 /***********************************************************************
594 HDC
ResetDC( HDC hdc
, /* DEVMODE */ void *devmode
)
596 fprintf( stderr
, "ResetDC: empty stub!\n" );
601 /***********************************************************************
602 * GetDeviceCaps (GDI.80)
604 int GetDeviceCaps( HDC hdc
, WORD cap
)
606 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
609 if (cap
> sizeof(DeviceCaps
)-sizeof(WORD
)) return 0;
611 dprintf_dc(stddeb
, "GetDeviceCaps("NPFMT
",%d): returning %d\n",
612 hdc
, cap
, *(WORD
*)(((char *)dc
->w
.devCaps
) + cap
) );
613 return *(WORD
*)(((char *)dc
->w
.devCaps
) + cap
);
617 /***********************************************************************
620 COLORREF
SetBkColor( HDC hdc
, COLORREF color
)
623 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
626 dc
= (DC
*)GDI_GetObjPtr(hdc
, METAFILE_DC_MAGIC
);
627 if (!dc
) return 0x80000000;
628 MF_MetaParam2(dc
, META_SETBKCOLOR
, HIWORD(color
), LOWORD(color
));
632 oldColor
= dc
->w
.backgroundColor
;
633 dc
->w
.backgroundColor
= color
;
634 dc
->w
.backgroundPixel
= COLOR_ToPhysical( dc
, color
);
639 /***********************************************************************
640 * SetTextColor (GDI.9)
642 COLORREF
SetTextColor( HDC hdc
, COLORREF color
)
645 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
648 dc
= (DC
*)GDI_GetObjPtr(hdc
, METAFILE_DC_MAGIC
);
649 if (!dc
) return 0x80000000;
650 MF_MetaParam2(dc
, META_SETTEXTCOLOR
, HIWORD(color
), LOWORD(color
));
654 oldColor
= dc
->w
.textColor
;
655 dc
->w
.textColor
= color
;
656 dc
->w
.textPixel
= COLOR_ToPhysical( dc
, color
);
661 /***********************************************************************
664 DWORD
GetDCOrg( HDC hdc
)
667 int x
, y
, w
, h
, border
, depth
;
669 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
671 if (dc
->w
.flags
& DC_MEMORY
) return 0;
672 XGetGeometry( display
, dc
->u
.x
.drawable
, &root
,
673 &x
, &y
, &w
, &h
, &border
, &depth
);
674 return MAKELONG( dc
->w
.DCOrgX
+ (WORD
)x
, dc
->w
.DCOrgY
+ (WORD
)y
);
678 /***********************************************************************
681 DWORD
SetDCOrg( HDC hdc
, short x
, short y
)
684 DC
* dc
= (DC
*) GDI_GetObjPtr( hdc
, DC_MAGIC
);
686 prevOrg
= dc
->w
.DCOrgX
| (dc
->w
.DCOrgY
<< 16);