| 1 | /* $Id: region.cpp,v 1.2 2000-02-16 14:18:12 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * GDI32 region code | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) | 
|---|
| 7 | * Copyright 1998 Patrick Haller | 
|---|
| 8 | * | 
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 10 | * | 
|---|
| 11 | */ | 
|---|
| 12 | #include <os2win.h> | 
|---|
| 13 | #include <stdlib.h> | 
|---|
| 14 | #include <stdarg.h> | 
|---|
| 15 | #include <string.h> | 
|---|
| 16 | #include "misc.h" | 
|---|
| 17 |  | 
|---|
| 18 | #define DBG_LOCALLOG    DBG_region | 
|---|
| 19 | #include "dbglocal.h" | 
|---|
| 20 |  | 
|---|
| 21 | //****************************************************************************** | 
|---|
| 22 | //****************************************************************************** | 
|---|
| 23 | HRGN WIN32API CreatePolyPolygonRgn( const POINT * arg1, const INT * arg2, int arg3, int  arg4) | 
|---|
| 24 | { | 
|---|
| 25 | dprintf(("GDI32: CreatePolyPolygonRgn\n")); | 
|---|
| 26 | return O32_CreatePolyPolygonRgn(arg1, arg2, arg3, arg4); | 
|---|
| 27 | } | 
|---|
| 28 | //****************************************************************************** | 
|---|
| 29 | //****************************************************************************** | 
|---|
| 30 | HRGN WIN32API CreatePolygonRgn(const POINT * arg1, int arg2, int arg3) | 
|---|
| 31 | { | 
|---|
| 32 | dprintf(("GDI32: CreatePolygonRgn")); | 
|---|
| 33 | return O32_CreatePolygonRgn(arg1, arg2, arg3); | 
|---|
| 34 | } | 
|---|
| 35 | //****************************************************************************** | 
|---|
| 36 | //****************************************************************************** | 
|---|
| 37 | int WIN32API CombineRgn( HRGN arg1, HRGN  arg2, HRGN  arg3, int  arg4) | 
|---|
| 38 | { | 
|---|
| 39 | dprintf(("GDI32: CombineRgn")); | 
|---|
| 40 | return O32_CombineRgn(arg1, arg2, arg3, arg4); | 
|---|
| 41 | } | 
|---|
| 42 | //****************************************************************************** | 
|---|
| 43 | //****************************************************************************** | 
|---|
| 44 | HRGN WIN32API CreateEllipticRgn( int arg1, int arg2, int arg3, int  arg4) | 
|---|
| 45 | { | 
|---|
| 46 | dprintf(("GDI32: CreateEllipticRgn")); | 
|---|
| 47 | return O32_CreateEllipticRgn(arg1, arg2, arg3, arg4); | 
|---|
| 48 | } | 
|---|
| 49 | //****************************************************************************** | 
|---|
| 50 | //****************************************************************************** | 
|---|
| 51 | HRGN WIN32API CreateEllipticRgnIndirect( const RECT * arg1) | 
|---|
| 52 | { | 
|---|
| 53 | dprintf(("GDI32: CreateEllipticRgnIndirect")); | 
|---|
| 54 | return O32_CreateEllipticRgnIndirect(arg1); | 
|---|
| 55 | } | 
|---|
| 56 | //****************************************************************************** | 
|---|
| 57 | //****************************************************************************** | 
|---|
| 58 | HRGN WIN32API CreateRectRgn( int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) | 
|---|
| 59 | { | 
|---|
| 60 | dprintf(("GDI32: CreateRectRgn (%d,%d)(%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect)); | 
|---|
| 61 | return O32_CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect); | 
|---|
| 62 | } | 
|---|
| 63 | //****************************************************************************** | 
|---|
| 64 | //****************************************************************************** | 
|---|
| 65 | HRGN WIN32API CreateRectRgnIndirect( const RECT * lpRect) | 
|---|
| 66 | { | 
|---|
| 67 | if(lpRect == NULL) { | 
|---|
| 68 | SetLastError(ERROR_INVALID_PARAMETER); | 
|---|
| 69 | return 0; | 
|---|
| 70 | } | 
|---|
| 71 | dprintf(("GDI32: CreateRectRgnIndirect (%d,%d)(%d,%d)", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom)); | 
|---|
| 72 | return O32_CreateRectRgnIndirect(lpRect); | 
|---|
| 73 | } | 
|---|
| 74 | //****************************************************************************** | 
|---|
| 75 | //****************************************************************************** | 
|---|
| 76 | HRGN WIN32API CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, | 
|---|
| 77 | int nWidthEllipse, int nHeightEllipse) | 
|---|
| 78 | { | 
|---|
| 79 | dprintf(("GDI32: CreateRoundRectRgn (%d,%d)(%d,%d) (%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse)); | 
|---|
| 80 | return O32_CreateRoundRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse); | 
|---|
| 81 | } | 
|---|
| 82 | //****************************************************************************** | 
|---|
| 83 | //****************************************************************************** | 
|---|
| 84 | BOOL WIN32API EqualRgn( HRGN arg1, HRGN  arg2) | 
|---|
| 85 | { | 
|---|
| 86 | dprintf(("GDI32: EqualRgn")); | 
|---|
| 87 | return O32_EqualRgn(arg1, arg2); | 
|---|
| 88 | } | 
|---|
| 89 | //****************************************************************************** | 
|---|
| 90 | //****************************************************************************** | 
|---|
| 91 | HRGN WIN32API ExtCreateRegion( const XFORM * arg1, DWORD arg2, const RGNDATA *  arg3) | 
|---|
| 92 | { | 
|---|
| 93 | dprintf(("GDI32: ExtCreateRegion")); | 
|---|
| 94 | return O32_ExtCreateRegion(arg1, arg2, arg3); | 
|---|
| 95 | } | 
|---|
| 96 | //****************************************************************************** | 
|---|
| 97 | //****************************************************************************** | 
|---|
| 98 | int WIN32API ExtSelectClipRgn( HDC arg1, HRGN arg2, int  arg3) | 
|---|
| 99 | { | 
|---|
| 100 | dprintf(("GDI32: ExtSelectClipRgn")); | 
|---|
| 101 | return O32_ExtSelectClipRgn(arg1, arg2, arg3); | 
|---|
| 102 | } | 
|---|
| 103 | //****************************************************************************** | 
|---|
| 104 | //****************************************************************************** | 
|---|
| 105 | BOOL WIN32API FillRgn( HDC arg1, HRGN arg2, HBRUSH  arg3) | 
|---|
| 106 | { | 
|---|
| 107 | dprintf(("GDI32: FillRgn")); | 
|---|
| 108 | return O32_FillRgn(arg1, arg2, arg3); | 
|---|
| 109 | } | 
|---|
| 110 | //****************************************************************************** | 
|---|
| 111 | //****************************************************************************** | 
|---|
| 112 | BOOL WIN32API FrameRgn( HDC arg1, HRGN arg2, HBRUSH arg3, int arg4, int  arg5) | 
|---|
| 113 | { | 
|---|
| 114 | dprintf(("GDI32: FrameRgn")); | 
|---|
| 115 | return O32_FrameRgn(arg1, arg2, arg3, arg4, arg5); | 
|---|
| 116 | } | 
|---|
| 117 | //****************************************************************************** | 
|---|
| 118 | //****************************************************************************** | 
|---|
| 119 | int WIN32API GetClipRgn( HDC arg1, HRGN  arg2) | 
|---|
| 120 | { | 
|---|
| 121 | dprintf(("GDI32: GetClipRgn")); | 
|---|
| 122 | return O32_GetClipRgn(arg1, arg2); | 
|---|
| 123 | } | 
|---|
| 124 | //****************************************************************************** | 
|---|
| 125 | //****************************************************************************** | 
|---|
| 126 | DWORD WIN32API GetRegionData( HRGN arg1, DWORD arg2, PRGNDATA  arg3) | 
|---|
| 127 | { | 
|---|
| 128 | dprintf(("GDI32: GetRegionData")); | 
|---|
| 129 | return O32_GetRegionData(arg1, arg2, arg3); | 
|---|
| 130 | } | 
|---|
| 131 | //****************************************************************************** | 
|---|
| 132 | //****************************************************************************** | 
|---|
| 133 | int WIN32API GetRgnBox( HRGN arg1, PRECT  arg2) | 
|---|
| 134 | { | 
|---|
| 135 | dprintf(("GDI32: GetRgnBox")); | 
|---|
| 136 | return O32_GetRgnBox(arg1, arg2); | 
|---|
| 137 | } | 
|---|
| 138 | //****************************************************************************** | 
|---|
| 139 | //****************************************************************************** | 
|---|
| 140 | BOOL WIN32API InvertRgn( HDC arg1, HRGN  arg2) | 
|---|
| 141 | { | 
|---|
| 142 | dprintf(("GDI32: InvertRgn")); | 
|---|
| 143 | return O32_InvertRgn(arg1, arg2); | 
|---|
| 144 | } | 
|---|
| 145 | //****************************************************************************** | 
|---|
| 146 | //****************************************************************************** | 
|---|
| 147 | int WIN32API OffsetClipRgn( HDC arg1, int arg2, int  arg3) | 
|---|
| 148 | { | 
|---|
| 149 | dprintf(("GDI32: OffsetClipRgn")); | 
|---|
| 150 | return O32_OffsetClipRgn(arg1, arg2, arg3); | 
|---|
| 151 | } | 
|---|
| 152 | //****************************************************************************** | 
|---|
| 153 | //****************************************************************************** | 
|---|
| 154 | int WIN32API OffsetRgn( HRGN arg1, int arg2, int  arg3) | 
|---|
| 155 | { | 
|---|
| 156 | dprintf(("GDI32: OffsetRgn")); | 
|---|
| 157 | return O32_OffsetRgn(arg1, arg2, arg3); | 
|---|
| 158 | } | 
|---|
| 159 | //****************************************************************************** | 
|---|
| 160 | //****************************************************************************** | 
|---|
| 161 | BOOL WIN32API PaintRgn( HDC arg1, HRGN  arg2) | 
|---|
| 162 | { | 
|---|
| 163 | dprintf(("GDI32: PaintRgn")); | 
|---|
| 164 | return O32_PaintRgn(arg1, arg2); | 
|---|
| 165 | } | 
|---|
| 166 | //****************************************************************************** | 
|---|
| 167 | //****************************************************************************** | 
|---|
| 168 | HRGN WIN32API PathToRegion( HDC arg1) | 
|---|
| 169 | { | 
|---|
| 170 | dprintf(("GDI32: PathToRegion")); | 
|---|
| 171 | return O32_PathToRegion(arg1); | 
|---|
| 172 | } | 
|---|
| 173 | //****************************************************************************** | 
|---|
| 174 | //****************************************************************************** | 
|---|
| 175 | BOOL WIN32API PtInRegion( HRGN arg1, int arg2, int  arg3) | 
|---|
| 176 | { | 
|---|
| 177 | dprintf(("GDI32: PtInRegion")); | 
|---|
| 178 | return O32_PtInRegion(arg1, arg2, arg3); | 
|---|
| 179 | } | 
|---|
| 180 | //****************************************************************************** | 
|---|
| 181 | //****************************************************************************** | 
|---|
| 182 | BOOL WIN32API RectInRegion( HRGN arg1, const RECT *  arg2) | 
|---|
| 183 | { | 
|---|
| 184 | dprintf(("GDI32: RectInRegion")); | 
|---|
| 185 | return O32_RectInRegion(arg1, arg2); | 
|---|
| 186 | } | 
|---|
| 187 | //****************************************************************************** | 
|---|
| 188 | //****************************************************************************** | 
|---|
| 189 | int WIN32API SelectClipRgn( HDC hdc, HRGN hRgn) | 
|---|
| 190 | { | 
|---|
| 191 | dprintf(("GDI32: SelectClipRgn %x %x", hdc, hRgn)); | 
|---|
| 192 | return O32_SelectClipRgn(hdc, hRgn); | 
|---|
| 193 | } | 
|---|
| 194 | //****************************************************************************** | 
|---|
| 195 | //****************************************************************************** | 
|---|
| 196 | BOOL WIN32API SetRectRgn( HRGN arg1, int arg2, int arg3, int arg4, int  arg5) | 
|---|
| 197 | { | 
|---|
| 198 | dprintf(("GDI32: SetRectRgn")); | 
|---|
| 199 | return O32_SetRectRgn(arg1, arg2, arg3, arg4, arg5); | 
|---|
| 200 | } | 
|---|
| 201 | /***************************************************************************** | 
|---|
| 202 | * Name      : int GetMetaRgn | 
|---|
| 203 | * Purpose   : The GetMetaRgn function retrieves the current metaregion for | 
|---|
| 204 | *             the specified device context. | 
|---|
| 205 | * Parameters: HDC  hdc   handle of device context | 
|---|
| 206 | *             HRGN hrgn  handle of region | 
|---|
| 207 | * Variables : | 
|---|
| 208 | * Result    : 0 / 1 | 
|---|
| 209 | * Remark    : | 
|---|
| 210 | * Status    : UNTESTED STUB | 
|---|
| 211 | * | 
|---|
| 212 | * Author    : Patrick Haller [Mon, 1998/06/15 08:00] | 
|---|
| 213 | *****************************************************************************/ | 
|---|
| 214 |  | 
|---|
| 215 | int WIN32API GetMetaRgn(HDC  hdc, | 
|---|
| 216 | HRGN hrgn) | 
|---|
| 217 | { | 
|---|
| 218 | dprintf(("GDI32: GetMetaRgn(%08xh, %08xh) not implemented.\n", | 
|---|
| 219 | hdc, | 
|---|
| 220 | hrgn)); | 
|---|
| 221 |  | 
|---|
| 222 | return (0); | 
|---|
| 223 | } | 
|---|
| 224 | /***************************************************************************** | 
|---|
| 225 | * Name      : int SetMetaRgn | 
|---|
| 226 | * Purpose   : The SetMetaRgn function intersects the current clipping region | 
|---|
| 227 | *             for the specified device context with the current metaregion | 
|---|
| 228 | *             and saves the combined region as the new metaregion for the | 
|---|
| 229 | *             specified device context. The clipping region is reset to a null region. | 
|---|
| 230 | * Parameters: HDC    hdc   handle of device context | 
|---|
| 231 | * Variables : | 
|---|
| 232 | * Result    : TRUE / FALSE | 
|---|
| 233 | * Remark    : | 
|---|
| 234 | * Status    : UNTESTED STUB | 
|---|
| 235 | * | 
|---|
| 236 | * Author    : Patrick Haller [Mon, 1998/06/15 08:00] | 
|---|
| 237 | *****************************************************************************/ | 
|---|
| 238 |  | 
|---|
| 239 | BOOL WIN32API SetMetaRgn(HDC hdc) | 
|---|
| 240 | { | 
|---|
| 241 | dprintf(("GDI32: SetMetaRgn(%08xh) not implemented.\n", | 
|---|
| 242 | hdc)); | 
|---|
| 243 |  | 
|---|
| 244 | return (NULLREGION); | 
|---|
| 245 | } | 
|---|
| 246 | //****************************************************************************** | 
|---|
| 247 | //****************************************************************************** | 
|---|