Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

dc.h

Go to the documentation of this file.
00001 /* $Id: dc.h,v 1.17 2001/05/11 08:39:42 sandervl Exp $ */
00002 /*
00003  * public dc functions
00004  *
00005  *
00006  * Copyright 1999      Daniela Engert (dani@ngrt.de)
00007  *
00008  *
00009  * Project Odin Software License can be found in LICENSE.TXT
00010  *
00011  */
00012 #ifndef __DC_H__
00013 #define __DC_H__
00014 
00015 extern BOOL isYup (struct _DCData *pHps);
00016 extern HDC sendEraseBkgnd (Win32BaseWindow *wnd);
00017 extern void releaseOwnDC (HDC hps);
00018 BOOL setPageXForm(Win32BaseWindow *wnd, struct _DCData * pHps);
00019 
00020 void selectClientArea(Win32BaseWindow *wnd, HDC hdc);
00021 
00022 BOOL GetOS2UpdateRect(Win32BaseWindow *window,LPRECT pRect);
00023 
00024 #ifdef DEBUG
00025 void dprintfOrigin(HDC hdc);
00026 #else
00027 #define dprintfOrigin(a)
00028 #endif
00029 
00030 #ifdef INCLUDED_BY_DC
00031 /*********************/
00032 typedef struct
00033 {
00034     HDC   hdc;
00035     BOOL  fErase;
00036     RECT  rcPaint;
00037     BOOL  fRestore;
00038     BOOL  IncUpdate;
00039     BYTE  rgbReserved[32];
00040 } PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
00041 
00042 #define PS_SOLID_W         0x00000000
00043 #define PS_DASH_W          0x00000001
00044 #define PS_DOT_W           0x00000002
00045 #define PS_DASHDOT_W       0x00000003
00046 #define PS_DASHDOTDOT_W    0x00000004
00047 #define PS_NULL_W          0x00000005
00048 #define PS_INSIDEFRAME_W   0x00000006
00049 #define PS_USERSTYLE_W     0x00000007
00050 #define PS_ALTERNATE_W     0x00000008
00051 #define PS_STYLE_MASK_W    0x0000000f
00052 
00053 typedef struct
00054 {
00055     UINT   lopnStyle;
00056     POINT  lopnWidth;
00057     ULONG  lopnColor;
00058 } LOGPEN_W, *LPLOGPEN_W;
00059 
00060 typedef struct tagEXTLOGPEN
00061 {
00062     DWORD elpPenStyle;
00063     DWORD elpWidth;
00064     DWORD elpBrushStyle;
00065     DWORD elpColor;
00066     DWORD elpNumEntries;
00067     DWORD elpStyleEntry[1];
00068 } EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
00069 
00070 typedef struct
00071 {
00072     UINT   lbStyle;
00073     ULONG  lbColor;
00074     INT    lbHatch;
00075 } LOGBRUSH_W, *LPLOGBRUSH_W;
00076 
00077 typedef struct _penobject
00078 {
00079    ULONG filler[9];
00080    union {
00081      struct {
00082        PEXTLOGPEN_W      pExtLogPen;
00083        LOGBRUSH_W        logbrush;
00084        LOGPEN_W          logpen;
00085      } ExtPen;
00086      struct {
00087        LOGPEN_W          logpen;
00088      } Pen;
00089    };
00090 } tPenObject, *pPenObject;
00091 
00092 /* DC Graphics Mode */
00093 #define GM_COMPATIBLE_W     1
00094 #define GM_ADVANCED_W       2
00095 
00096 #define DCX_WINDOW_W                    0x00000001L
00097 #define DCX_CACHE_W                     0x00000002L
00098 #define DCX_NORESETATTRS_W              0x00000004L
00099 #define DCX_CLIPCHILDREN_W              0x00000008L
00100 #define DCX_CLIPSIBLINGS_W              0x00000010L
00101 #define DCX_PARENTCLIP_W                0x00000020L
00102 #define DCX_EXCLUDERGN_W                0x00000040L
00103 #define DCX_INTERSECTRGN_W              0x00000080L
00104 #define DCX_EXCLUDEUPDATE_W             0x00000100L
00105 #define DCX_INTERSECTUPDATE_W           0x00000200L
00106 #define DCX_LOCKWINDOWUPDATE_W          0x00000400L
00107 #define DCX_USESTYLE_W                  0x00010000L
00108 #define DCX_VALIDATE_W                  0x00200000L
00109 
00110 #define RDW_INVALIDATE_W       0x0001
00111 #define RDW_INTERNALPAINT_W    0x0002
00112 #define RDW_ERASE_W            0x0004
00113 #define RDW_VALIDATE_W         0x0008
00114 #define RDW_NOINTERNALPAINT_W  0x0010
00115 #define RDW_NOERASE_W          0x0020
00116 #define RDW_NOCHILDREN_W       0x0040
00117 #define RDW_ALLCHILDREN_W      0x0080
00118 #define RDW_UPDATENOW_W        0x0100
00119 #define RDW_ERASENOW_W         0x0200
00120 #define RDW_FRAME_W            0x0400
00121 #define RDW_NOFRAME_W          0x0800
00122 /* Xform FLAGS */
00123 #define MWT_IDENTITY_W        1
00124 #define MWT_LEFTMULTIPLY_W    2
00125 #define MWT_RIGHTMULTIPLY_W   3
00126 
00127 /* Mapping Modes */
00128 #define MM_TEXT_W             1
00129 #define MM_LOMETRIC_W         2
00130 #define MM_HIMETRIC_W         3
00131 #define MM_LOENGLISH_W        4
00132 #define MM_HIENGLISH_W        5
00133 #define MM_TWIPS_W            6
00134 #define MM_ISOTROPIC_W        7
00135 #define MM_ANISOTROPIC_W      8
00136 
00137 #define RGN_OR_W              2
00138 
00139 /* Window scrolling */
00140 #define SW_SCROLLCHILDREN_W    0x0001
00141 #define SW_INVALIDATE_W        0x0002
00142 #define SW_ERASE_W             0x0004
00143 #define SW_SMOOTHSCROLL_W      0x0010
00144 
00145 /*********************/
00146 
00147 #ifndef OPEN32API
00148 #define OPEN32API _System
00149 #endif
00150 
00151 
00152 BOOL    APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
00153 
00154 inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
00155 {
00156  BOOL yyrc;
00157  USHORT sel = RestoreOS2FS();
00158 
00159     yyrc = _GpiEnableYInversion(hps, lHeight);
00160     SetFS(sel);
00161 
00162     return yyrc;
00163 }
00164 
00165 LONG APIENTRY _GpiQueryYInversion(ULONG hps);
00166 
00167 inline LONG GpiQueryYInversion(ULONG hps)
00168 {
00169  LONG yyrc;
00170  USHORT sel = RestoreOS2FS();
00171 
00172     yyrc = _GpiQueryYInversion(hps);
00173     SetFS(sel);
00174 
00175     return yyrc;
00176 }
00177 
00178 PVOID   APIENTRY _GpiAllocateDCData (HPS GpiH, ULONG size);
00179 
00180 inline PVOID APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size)
00181 {
00182  PVOID yyrc;
00183  USHORT sel = RestoreOS2FS();
00184 
00185     yyrc = _GpiAllocateDCData(GpiH, size);
00186     SetFS(sel);
00187 
00188     return yyrc;
00189 }
00190 
00191 PVOID   APIENTRY _GpiQueryDCData (HPS hps);
00192 
00193 inline PVOID APIENTRY GpiQueryDCData (HPS hps)
00194 {
00195  PVOID yyrc;
00196  USHORT sel = RestoreOS2FS();
00197 
00198     yyrc = _GpiQueryDCData(hps);
00199     SetFS(sel);
00200 
00201     return yyrc;
00202 }
00203 
00204 HDC     OPEN32API _HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a);
00205 
00206 inline HDC OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a)
00207 {
00208  HDC yyrc;
00209  USHORT sel = RestoreOS2FS();
00210 
00211     yyrc = _HPSToHDC(hwnd, hps, hdc, a);
00212     SetFS(sel);
00213 
00214     return yyrc;
00215 }
00216 
00217 void    OPEN32API _DeleteHDC (HDC hdc);
00218 
00219 inline void OPEN32API DeleteHDC (HDC hdc)
00220 {
00221  USHORT sel = RestoreOS2FS();
00222 
00223     _DeleteHDC(hdc);
00224     SetFS(sel);
00225 }
00226 
00227 BOOL    OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
00228 
00229 inline BOOL O32_EndPaint(HWND a, CONST PAINTSTRUCT_W *b)
00230 {
00231  BOOL yyrc;
00232  USHORT sel = RestoreOS2FS();
00233 
00234     yyrc = _O32_EndPaint(a, b);
00235     SetFS(sel);
00236 
00237     return yyrc;
00238 }
00239 
00240 int     OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
00241 
00242 inline int O32_GetUpdateRgn(HWND a, HRGN b, BOOL c)
00243 {
00244  int yyrc;
00245  USHORT sel = RestoreOS2FS();
00246 
00247     yyrc = _O32_GetUpdateRgn(a, b, c);
00248     SetFS(sel);
00249 
00250     return yyrc;
00251 }
00252 
00253 
00254 BOOL    OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
00255 
00256 inline BOOL O32_DeleteObject(HANDLE a)
00257 {
00258  BOOL yyrc;
00259  USHORT sel = RestoreOS2FS();
00260 
00261     yyrc = _O32_DeleteObject(a);
00262     SetFS(sel);
00263 
00264     return yyrc;
00265 }
00266 
00267 int     OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
00268 
00269 inline int O32_ReleaseDC(HWND a, HDC b)
00270 {
00271  int yyrc;
00272  USHORT sel = RestoreOS2FS();
00273 
00274     yyrc = _O32_ReleaseDC(a, b);
00275     SetFS(sel);
00276 
00277     return yyrc;
00278 }
00279 
00280 VOID    OPEN32API _O32_SetLastError( DWORD );
00281 
00282 inline VOID O32_SetLastError(DWORD a)
00283 {
00284  USHORT sel = RestoreOS2FS();
00285 
00286     _O32_SetLastError(a);
00287     SetFS(sel);
00288 }
00289 
00290 BOOL    OPEN32API _O32_ExcludeUpdateRgn( HDC, HWND );
00291 
00292 inline BOOL O32_ExcludeUpdateRgn(HDC a, HWND b)
00293 {
00294  BOOL yyrc;
00295  USHORT sel = RestoreOS2FS();
00296 
00297     yyrc = _O32_ExcludeUpdateRgn(a, b);
00298     SetFS(sel);
00299 
00300     return yyrc;
00301 }
00302 
00303 BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
00304 
00305 inline BOOL O32_CreateCaret(HWND a, HBITMAP b, int c, int d)
00306 {
00307  BOOL yyrc;
00308  USHORT sel = RestoreOS2FS();
00309 
00310     yyrc = _O32_CreateCaret(a, b, c, d);
00311     SetFS(sel);
00312 
00313     return yyrc;
00314 }
00315 
00316 BOOL OPEN32API _O32_SelectClipRgn(HDC hdc,HRGN hrgn);
00317 
00318 inline BOOL O32_SelectClipRgn(HDC hdc,HRGN hrgn)
00319 {
00320  BOOL yyrc;
00321  USHORT sel = RestoreOS2FS();
00322 
00323     yyrc = _O32_SelectClipRgn(hdc,hrgn);
00324     SetFS(sel);
00325 
00326     return yyrc;
00327 }
00328 
00329 BOOL    APIENTRY  __DestroyCaret (void);
00330 
00331 inline BOOL APIENTRY _DestroyCaret (void)
00332 {
00333  BOOL yyrc;
00334  USHORT sel = RestoreOS2FS();
00335 
00336     yyrc = __DestroyCaret();
00337     SetFS(sel);
00338 
00339     return yyrc;
00340 }
00341 
00342 UINT    APIENTRY  __GetCaretBlinkTime (void);
00343 
00344 inline UINT APIENTRY _GetCaretBlinkTime (void)
00345 {
00346  UINT yyrc;
00347  USHORT sel = RestoreOS2FS();
00348 
00349     yyrc = __GetCaretBlinkTime();
00350     SetFS(sel);
00351 
00352     return yyrc;
00353 }
00354 
00355 BOOL    APIENTRY  __HideCaret (HWND hwnd);
00356 
00357 inline BOOL APIENTRY _HideCaret (HWND hwnd)
00358 {
00359  BOOL yyrc;
00360  USHORT sel = RestoreOS2FS();
00361 
00362     yyrc = __HideCaret(hwnd);
00363     SetFS(sel);
00364 
00365     return yyrc;
00366 }
00367 
00368 BOOL    APIENTRY  __SetCaretBlinkTime (UINT mSecs);
00369 
00370 inline BOOL APIENTRY _SetCaretBlinkTime (UINT mSecs)
00371 {
00372  BOOL yyrc;
00373  USHORT sel = RestoreOS2FS();
00374 
00375     yyrc = __SetCaretBlinkTime(mSecs);
00376     SetFS(sel);
00377 
00378     return yyrc;
00379 }
00380 
00381 BOOL    APIENTRY  __ShowCaret (HWND hwnd);
00382 
00383 inline BOOL APIENTRY _ShowCaret (HWND hwnd)
00384 {
00385  BOOL yyrc;
00386  USHORT sel = RestoreOS2FS();
00387 
00388     yyrc = __ShowCaret(hwnd);
00389     SetFS(sel);
00390 
00391     return yyrc;
00392 }
00393 
00394 
00395 int       APIENTRY _O32_GetClipRgn( HDC, HRGN );
00396 
00397 inline int O32_GetClipRgn(HDC a, HRGN b)
00398 {
00399  int yyrc;
00400  USHORT sel = RestoreOS2FS();
00401 
00402     yyrc = _O32_GetClipRgn(a, b);
00403     SetFS(sel);
00404 
00405     return yyrc;
00406 } 
00407 
00408 int APIENTRY _O32_ExcludeClipRect(HDC a, int b, int c, int d, int e);
00409 
00410 inline int O32_ExcludeClipRect(HDC a, int b, int c, int d, int e)
00411 {
00412  int yyrc;
00413  USHORT sel = RestoreOS2FS();
00414 
00415     yyrc = _O32_ExcludeClipRect(a, b, c, d, e);
00416     SetFS(sel);
00417 
00418     return yyrc;
00419 } 
00420 
00421 int APIENTRY _O32_IntersectClipRect(HDC a, int b, int c, int d, int e);
00422 
00423 inline int O32_IntersectClipRect(HDC a, int b, int c, int d, int e)
00424 {
00425  int yyrc;
00426  USHORT sel = RestoreOS2FS();
00427 
00428     yyrc = _O32_IntersectClipRect(a, b, c, d, e);
00429     SetFS(sel);
00430 
00431     return yyrc;
00432 } 
00433 
00434 int APIENTRY _O32_ExtSelectClipRgn(HDC a, HRGN b, int c);
00435 
00436 inline int O32_ExtSelectClipRgn(HDC a, HRGN b, int c)
00437 {
00438  int yyrc;
00439  USHORT sel = RestoreOS2FS();
00440 
00441     yyrc = _O32_ExtSelectClipRgn(a, b, c);
00442     SetFS(sel);
00443 
00444     return yyrc;
00445 } 
00446 
00447 int APIENTRY _O32_OffsetClipRgn(HDC a, int b, int c);
00448 
00449 inline int O32_OffsetClipRgn(HDC a, int b, int c)
00450 {
00451  int yyrc;
00452  USHORT sel = RestoreOS2FS();
00453 
00454     yyrc = _O32_OffsetClipRgn(a, b, c);
00455     SetFS(sel);
00456 
00457     return yyrc;
00458 } 
00459 
00460    // from pmddi.h:
00461    /* CopyClipRegion */
00462 
00463    #define COPYCRGN_ALLINTERSECT        0L
00464    #define COPYCRGN_VISRGN              1L
00465    #define COPYCRGN_CLIPRGN             2L
00466 
00467    /* SetupDC */
00468 
00469    #define SETUPDC_VISRGN               0x00000001L
00470    #define SETUPDC_ORIGIN               0x00000002L
00471    #define SETUPDC_ACCUMBOUNDSON        0x00000004L
00472    #define SETUPDC_ACCUMBOUNDSOFF       0x00000008L
00473    #define SETUPDC_RECALCCLIP           0x00000010L
00474    #define SETUPDC_SETOWNER             0x00000020L
00475    #define SETUPDC_CLEANDC              0x00000040L
00476 
00477 ULONG APIENTRY Gre32Entry4(ULONG,ULONG,ULONG,ULONG);
00478 
00479 inline ULONG APIENTRY _Gre32Entry4 (ULONG a, ULONG b, ULONG c, ULONG d)
00480 {
00481  ULONG yyrc;
00482  USHORT sel = RestoreOS2FS();
00483 
00484     yyrc = Gre32Entry4(a,b,c,d);
00485     SetFS(sel);
00486 
00487     return yyrc;
00488 }
00489 
00490 ULONG APIENTRY Gre32Entry5(ULONG,ULONG,ULONG,ULONG,ULONG);
00491 
00492 inline ULONG APIENTRY _Gre32Entry5 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e)
00493 {
00494  ULONG yyrc;
00495  USHORT sel = RestoreOS2FS();
00496 
00497     yyrc = Gre32Entry5(a,b,c,d,e);
00498     SetFS(sel);
00499 
00500     return yyrc;
00501 }
00502 
00503 
00504 ULONG APIENTRY Gre32Entry6(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
00505 
00506 inline ULONG APIENTRY _Gre32Entry6 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f)
00507 {
00508  ULONG yyrc;
00509  USHORT sel = RestoreOS2FS();
00510 
00511     yyrc = Gre32Entry6(a,b,c,d,e,f);
00512     SetFS(sel);
00513 
00514     return yyrc;
00515 }
00516 
00517 ULONG APIENTRY Gre32Entry7(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
00518 
00519 inline ULONG APIENTRY _Gre32Entry7 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g)
00520 {
00521  ULONG yyrc;
00522  USHORT sel = RestoreOS2FS();
00523 
00524     yyrc = Gre32Entry7(a,b,c,d,e,f,g);
00525     SetFS(sel);
00526 
00527     return yyrc;
00528 }
00529 
00530 ULONG APIENTRY Gre32Entry8(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
00531 
00532 inline ULONG APIENTRY _Gre32Entry8 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g, ULONG h)
00533 {
00534  ULONG yyrc;
00535  USHORT sel = RestoreOS2FS();
00536 
00537     yyrc = Gre32Entry8(a,b,c,d,e,f,g,h);
00538     SetFS(sel);
00539 
00540     return yyrc;
00541 }
00542 
00543 
00544    #define GreSetupDC(a,b,c,d,e,f) (BOOL) _Gre32Entry8((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(LONG)(c),(ULONG)(LONG)(d),(ULONG)(PRECTL)(e),(ULONG)(ULONG)(f),0L,0x00004081L)
00545    #define GreCreateRectRegion(a,b,c) (HRGN) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),(ULONG)(LONG)(c),0L,0x00004062L)
00546    #define GreGetPageUnits(a,b) (LONG) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PULONG)(b),0L,0x00004083L)
00547    #define GreCopyClipRegion(a,b,c,d) (INT) _Gre32Entry6((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PRECTL)(c),(ULONG)(ULONG)(d),0L,0x00004080L)
00548    #define GreCombineRegion(a,b,c,d,e) (INT) _Gre32Entry7((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(HRGN)(c),(ULONG)(HRGN)(d),(ULONG)(ULONG)(e),0L,0x00004065L)
00549    #define GreDestroyRegion(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(HRGN)(b),0L,0x00004063L)
00550    #define GreGetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BAL)
00551    #define GreDeviceSetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BBL)
00552    #define GreSelectClipRegion(a,b,c) (INT) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PHRGN)(c),0L,0x00004074L)
00553    #define GreIntersectClipRectangle(a,b) (INT) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),0L,0x00004075L)
00554 
00555 #endif //INCLUDED_BY_DC
00556 
00557 #endif //__DC_H__
00558 

Generated on Wed Jan 23 23:17:28 2002 for ODIN-user32 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001