ReactOS 0.4.16-dev-311-g9382aa2
pathobj.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for pathobj.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

PATHOBJ *APIENTRY EngCreatePath (VOID)
 
VOID APIENTRY EngDeletePath (IN PATHOBJ *ppo)
 
BOOL APIENTRY PATHOBJ_bCloseFigure (IN PATHOBJ *ppo)
 
VOID APIENTRY PATHOBJ_vEnumStart (IN PATHOBJ *ppo)
 
BOOL APIENTRY PATHOBJ_bEnum (IN PATHOBJ *ppo, OUT PATHDATA *ppd)
 
BOOL APIENTRY PATHOBJ_bMoveTo (IN PATHOBJ *ppo, IN POINTFIX ptfx)
 
BOOL APIENTRY PATHOBJ_bPolyLineTo (IN PATHOBJ *ppo, IN POINTFIX *pptfx, IN ULONG cptfx)
 
BOOL APIENTRY PATHOBJ_bPolyBezierTo (IN PATHOBJ *ppo, IN POINTFIX *pptfx, IN ULONG cptfx)
 
VOID APIENTRY PATHOBJ_vEnumStartClipLines (IN PATHOBJ *ppo, IN CLIPOBJ *pco, IN SURFOBJ *pso, IN LINEATTRS *pla)
 
BOOL APIENTRY PATHOBJ_bEnumClipLines (IN PATHOBJ *ppo, IN ULONG cb, OUT CLIPLINE *pcl)
 
VOID APIENTRY PATHOBJ_vGetBounds (IN PATHOBJ *ppo, OUT PRECTFX prectfx)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file pathobj.c.

Function Documentation

◆ EngCreatePath()

PATHOBJ *APIENTRY EngCreatePath ( VOID  )

Definition at line 27 of file pathobj.c.

28{
29 PEPATHOBJ pPathObj;
30 const ULONG size = sizeof(EPATHOBJ);
31
33 if (pPath == NULL)
34 {
35 return NULL;
36 }
37
39 if (pPathObj == NULL)
40 {
41 return NULL;
42 }
43 RtlZeroMemory(pPathObj, size);
44
45 pPathObj->pPath = pPath;
46
47 pPath->flType = PATHTYPE_KEEPME;
48 pPath->epo = pPathObj;
49
50 return &pPathObj->po;
51}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
GLsizeiptr size
Definition: glext.h:5919
#define PATH_AllocPathWithHandle()
Definition: path.h:69
#define PATHTYPE_KEEPME
Definition: path.h:24
struct _EPATHOBJ EPATHOBJ
Definition: path.h:62
PATHOBJ po
Definition: path.h:63
PPATH pPath
Definition: path.h:64
Definition: path.h:35
FLONG flType
Definition: path.h:40
struct _EPATHOBJ * epo
Definition: path.h:49
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define GDITAG_PATHOBJ
Definition: tags.h:147

◆ EngDeletePath()

VOID APIENTRY EngDeletePath ( IN PATHOBJ ppo)

Definition at line 58 of file pathobj.c.

59{
60 PEPATHOBJ pPathObj;
61 PEXTPATHDATA ppd, ppdNext;
62 PPATH pPath;
63
64 pPathObj = (PEPATHOBJ)ppo;
65 if (pPathObj == NULL || pPathObj->pPath == NULL)
66 return;
67
68 pPath = pPathObj->pPath;
69
70 for (ppd = pPath->ppdFirst; ppd; ppd = ppdNext)
71 {
72 ppdNext = ppd->ppdNext;
74 }
77}
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
struct _EPATHOBJ * PEPATHOBJ
struct _EXTPATHDATA * ppdNext
Definition: path.h:31
PEXTPATHDATA ppdFirst
Definition: path.h:41
BASEOBJECT BaseObject
Definition: path.h:36
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1111
_In_ PATHOBJ * ppo
Definition: winddi.h:3591

◆ PATHOBJ_bCloseFigure()

BOOL APIENTRY PATHOBJ_bCloseFigure ( IN PATHOBJ ppo)

Definition at line 84 of file pathobj.c.

85{
86 PEXTPATHDATA ppd;
87 PEPATHOBJ pPathObj = (PEPATHOBJ)ppo;
88 if (pPathObj == NULL || pPathObj->pPath == NULL)
89 return FALSE;
90
91 ppd = pPathObj->pPath->ppdLast;
92 if (ppd == NULL)
93 return FALSE;
94
96 return TRUE;
97}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PATHDATA pd
Definition: path.h:30
FLONG flags
Definition: winddi.h:938
PEXTPATHDATA ppdLast
Definition: path.h:42
#define PD_CLOSEFIGURE
Definition: winddi.h:929
#define PD_ENDSUBPATH
Definition: winddi.h:927

◆ PATHOBJ_bEnum()

BOOL APIENTRY PATHOBJ_bEnum ( IN PATHOBJ ppo,
OUT PATHDATA ppd 
)

Definition at line 118 of file pathobj.c.

121{
122 PEPATHOBJ pPathObj = (PEPATHOBJ)ppo;
123 if (pPathObj == NULL|| pPathObj->pPath == NULL || pPathObj->pPath->ppdCurrent == NULL)
124 return FALSE;
125
126 *ppd = pPathObj->pPath->ppdCurrent->pd;
127
128 pPathObj->pPath->ppdCurrent = pPathObj->pPath->ppdCurrent->ppdNext;
129 return (pPathObj->pPath->ppdCurrent != NULL);
130}
PEXTPATHDATA ppdCurrent
Definition: path.h:44

◆ PATHOBJ_bEnumClipLines()

BOOL APIENTRY PATHOBJ_bEnumClipLines ( IN PATHOBJ ppo,
IN ULONG  cb,
OUT CLIPLINE pcl 
)

Definition at line 396 of file pathobj.c.

400{
402 return FALSE;
403}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ PATHOBJ_bMoveTo()

BOOL APIENTRY PATHOBJ_bMoveTo ( IN PATHOBJ ppo,
IN POINTFIX  ptfx 
)

Definition at line 137 of file pathobj.c.

140{
141 PEPATHOBJ pPathObj;
142 PEXTPATHDATA ppd, ppdLast;
143
144 pPathObj = (PEPATHOBJ)ppo;
145 if (pPathObj == NULL || pPathObj->pPath == NULL)
146 return FALSE;
147
148 /* allocate a subpath data */
150 if (ppd == NULL)
151 return FALSE;
152
153 RtlZeroMemory(ppd, sizeof(EXTPATHDATA));
154
155 /* add the first point to the subpath */
156 ppd->pd.flags = PD_BEGINSUBPATH;
157 ppd->pd.count = 1;
159 if (ppd->pd.pptfx == NULL)
160 {
162 return FALSE;
163 }
164 ppd->pd.pptfx[0] = ptfx;
165
166 ppdLast = pPathObj->pPath->ppdLast;
167 if (ppdLast)
168 {
169 /* end the last subpath */
170 ppdLast->pd.flags |= PD_ENDSUBPATH;
171
172 /* add the subpath to the last */
173 ppdLast->ppdNext = ppd;
174 pPathObj->pPath->ppdLast = ppd;
175 }
176 else
177 {
178 /* add the subpath */
179 pPathObj->pPath->ppdLast = pPathObj->pPath->ppdFirst = ppd;
180 }
181
182 pPathObj->po.cCurves++;
183
184 return TRUE;
185}
POINTFIX * pptfx
Definition: winddi.h:940
ULONG count
Definition: winddi.h:939
ULONG cCurves
Definition: winddi.h:954
#define PD_BEGINSUBPATH
Definition: winddi.h:926

◆ PATHOBJ_bPolyBezierTo()

BOOL APIENTRY PATHOBJ_bPolyBezierTo ( IN PATHOBJ ppo,
IN POINTFIX pptfx,
IN ULONG  cptfx 
)

Definition at line 289 of file pathobj.c.

293{
294 PEPATHOBJ pPathObj;
295 PEXTPATHDATA ppd, ppdLast;
296 PPOINTFIX pptfxNew, pptfxOld;
297 ULONG size;
298
299 pPathObj = (PEPATHOBJ)ppo;
300 if (pPathObj == NULL || pPathObj->pPath == NULL || pptfx == NULL || cptfx == 0)
301 return FALSE;
302
303 ppdLast = pPathObj->pPath->ppdLast;
304 if (ppdLast == NULL)
305 {
306 /* allocate a subpath data */
308 if (ppd == NULL)
309 return FALSE;
310
311 /* store data */
312 RtlZeroMemory(ppd, sizeof(EXTPATHDATA));
314
315 size = cptfx * sizeof(POINTFIX);
317 if (pptfxNew == NULL)
318 {
320 return FALSE;
321 }
322 RtlCopyMemory(pptfxNew, pptfx, size);
323 ppd->pd.pptfx = pptfxNew;
324 ppd->pd.count = cptfx;
325
326 /* set the subpath */
327 pPathObj->pPath->ppdLast = pPathObj->pPath->ppdFirst = ppd;
328
329 pPathObj->po.cCurves++;
330 }
331 else if (!(ppdLast->pd.flags & PD_BEZIERS) || (ppdLast->pd.flags & PD_ENDSUBPATH))
332 {
333 /* allocate a subpath data */
335 if (ppd == NULL)
336 return FALSE;
337
338 /* store data */
339 RtlZeroMemory(ppd, sizeof(EXTPATHDATA));
340 ppd->pd.flags = PD_BEZIERS;
341 ppd->pd.count = cptfx;
342
343 size = cptfx * sizeof(POINTFIX);
345 if (pptfxNew == NULL)
346 {
348 return FALSE;
349 }
350 RtlCopyMemory(pptfxNew, pptfx, size);
351 ppd->pd.pptfx = pptfxNew;
352
353 /* add to last */
354 ppdLast->ppdNext = ppd;
355 pPathObj->pPath->ppdLast = ppd;
356
357 pPathObj->po.cCurves++;
358 }
359 else
360 {
361 /* concatenate ppdLast->pd.pptfx and pptfx */
362 size = (ppdLast->pd.count + cptfx) * sizeof(POINTFIX);
364 if (pptfxNew == NULL)
365 return FALSE;
366
367 size = ppdLast->pd.count * sizeof(POINTFIX);
368 RtlCopyMemory(&pptfxNew[0], ppdLast->pd.pptfx, size);
369 size = cptfx * sizeof(POINTFIX);
370 RtlCopyMemory(&pptfxNew[ppdLast->pd.count], pptfx, size);
371
372 pptfxOld = ppdLast->pd.pptfx;
373 ppdLast->pd.pptfx = pptfxNew;
374 ppdLast->pd.count += cptfx;
376 }
377
378 pPathObj->po.fl |= PO_BEZIERS;
379
380 return TRUE;
381}
FLONG fl
Definition: winddi.h:953
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define PD_BEZIERS
Definition: winddi.h:930
struct _POINTFIX POINTFIX
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_opt_ COLORADJUSTMENT _In_opt_ POINTL _In_ POINTFIX * pptfx
Definition: winddi.h:3781
#define PO_BEZIERS
Definition: winddi.h:944

◆ PATHOBJ_bPolyLineTo()

BOOL APIENTRY PATHOBJ_bPolyLineTo ( IN PATHOBJ ppo,
IN POINTFIX pptfx,
IN ULONG  cptfx 
)

Definition at line 192 of file pathobj.c.

196{
197 PEPATHOBJ pPathObj;
198 PEXTPATHDATA ppd, ppdLast;
199 PPOINTFIX pptfxNew, pptfxOld;
200 ULONG size;
201
202 pPathObj = (PEPATHOBJ)ppo;
203 if (pPathObj == NULL || pPathObj->pPath == NULL || pptfx == NULL || cptfx == 0)
204 return FALSE;
205
206 ppdLast = pPathObj->pPath->ppdLast;
207 if (ppdLast == NULL)
208 {
209 /* allocate a subpath data */
211 if (ppd == NULL)
212 return FALSE;
213
214 /* store data */
215 RtlZeroMemory(ppd, sizeof(EXTPATHDATA));
216 ppd->pd.flags = PD_BEGINSUBPATH;
217
218 size = cptfx * sizeof(POINTFIX);
220 if (pptfxNew == NULL)
221 {
223 return FALSE;
224 }
225 RtlCopyMemory(pptfxNew, pptfx, size);
226 ppd->pd.pptfx = pptfxNew;
227 ppd->pd.count = cptfx;
228
229 /* set the subpath */
230 pPathObj->pPath->ppdLast = pPathObj->pPath->ppdFirst = ppd;
231
232 pPathObj->po.cCurves++;
233 }
234 else if (ppdLast->pd.flags & (PD_BEZIERS | PD_ENDSUBPATH))
235 {
236 /* allocate a subpath data */
238 if (ppd == NULL)
239 return FALSE;
240
241 /* store data */
242 RtlZeroMemory(ppd, sizeof(EXTPATHDATA));
243 ppd->pd.flags = 0;
244 ppd->pd.count = cptfx;
245
246 size = cptfx * sizeof(POINTFIX);
248 if (pptfxNew == NULL)
249 {
251 return FALSE;
252 }
253 RtlCopyMemory(pptfxNew, pptfx, size);
254 ppd->pd.pptfx = pptfxNew;
255
256 /* add to last */
257 ppdLast->ppdNext = ppd;
258 pPathObj->pPath->ppdLast = ppd;
259
260 pPathObj->po.cCurves++;
261 }
262 else
263 {
264 /* concatenate ppdLast->pd.pptfx and pptfx */
265 size = (ppdLast->pd.count + cptfx) * sizeof(POINTFIX);
267 if (pptfxNew == NULL)
268 return FALSE;
269
270 size = ppdLast->pd.count * sizeof(POINTFIX);
271 RtlCopyMemory(&pptfxNew[0], ppdLast->pd.pptfx, size);
272 size = cptfx * sizeof(POINTFIX);
273 RtlCopyMemory(&pptfxNew[ppdLast->pd.count], pptfx, size);
274
275 pptfxOld = ppdLast->pd.pptfx;
276 ppdLast->pd.pptfx = pptfxNew;
277 ppdLast->pd.count += cptfx;
279 }
280
281 return TRUE;
282}

◆ PATHOBJ_vEnumStart()

VOID APIENTRY PATHOBJ_vEnumStart ( IN PATHOBJ ppo)

Definition at line 104 of file pathobj.c.

105{
106 PEPATHOBJ pPathObj = (PEPATHOBJ)ppo;
107 if (pPathObj == NULL || pPathObj->pPath == NULL)
108 return;
109
110 pPathObj->pPath->ppdCurrent = pPathObj->pPath->ppdFirst;
111}

◆ PATHOBJ_vEnumStartClipLines()

VOID APIENTRY PATHOBJ_vEnumStartClipLines ( IN PATHOBJ ppo,
IN CLIPOBJ pco,
IN SURFOBJ pso,
IN LINEATTRS pla 
)

Definition at line 385 of file pathobj.c.

390{
392}

◆ PATHOBJ_vGetBounds()

VOID APIENTRY PATHOBJ_vGetBounds ( IN PATHOBJ ppo,
OUT PRECTFX  prectfx 
)

Definition at line 410 of file pathobj.c.

413{
414 FIX xLeft, yTop, xRight, yBottom;
415 PEPATHOBJ pPathObj;
416 PEXTPATHDATA ppd, ppdNext;
417 ULONG i;
418
419 pPathObj = (PEPATHOBJ)ppo;
420 if (pPathObj == NULL || pPathObj->pPath == NULL || prectfx == NULL)
421 return;
422
423 yTop = xLeft = MAXLONG;
424 yBottom = xRight = MINLONG;
425
426 for (ppd = pPathObj->pPath->ppdFirst; ppd; ppd = ppdNext)
427 {
428 ppdNext = ppd->ppdNext;
429 for (i = 0; i < ppd->pd.count; ++i)
430 {
431 PPOINTFIX pptfx = &ppd->pd.pptfx[i];
432 if (pptfx->x < xLeft)
433 xLeft = pptfx->x;
434 if (pptfx->x > xRight)
435 xRight = pptfx->x;
436 if (pptfx->y < yTop)
437 yTop = pptfx->y;
438 if (pptfx->y > yBottom)
439 yBottom = pptfx->y;
440 }
441 }
442
443 if (xLeft <= xRight && yTop <= yBottom)
444 {
445 prectfx->xLeft = xLeft;
446 prectfx->yTop = yTop;
447 prectfx->xRight = xRight + 1;
448 prectfx->yBottom = yBottom + 1;
449 }
450 else
451 {
452 RtlZeroMemory(prectfx, sizeof(*prectfx));
453 }
454}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FIX x
Definition: winddi.h:206
#define MAXLONG
Definition: umtypes.h:116
#define MINLONG
Definition: umtypes.h:115
LONG FIX
Definition: winddi.h:126