58#define DEGREES_TO_RADIANS(deg) ((deg)*2*M_PI/360)
79#define pt(x,y) app_new_point((x),(y))
107#define app_fill_rect( dc, r, BrushObj, Pen) \
108 IntFillRect(dc, r.x, r.y, r.width, r.height, BrushObj, Pen)
129 int b =
r.height / 2;
134 long xcrit = (3 *
a2 / 4) + 1;
135 long ycrit = (3 *
b2 / 4) + 1;
137 long dxt =
b2*(3+
x+
x);
138 long dyt =
a2*(3-
y-
y);
142 int w = pbrush->lWidth;
146 int A =
a-
w > 0 ?
a-
w : 0;
147 int B =
b-
w > 0 ?
b-
w : 0;
152 long XCRIT = (3 * A2 / 4) + 1;
153 long YCRIT = (3 * B2 / 4) + 1;
154 long T = B2 + A2 - 2*A2*
B;
155 long DXT = B2*(3+
X+
X);
156 long DYT = A2*(3-
Y-
Y);
160 int movedown, moveout;
161 int innerX = 0, prevx, prevy,
W;
165 if ((
r.width <= 2) || (
r.height <= 2))
170 r1.width =
r.width & 1;
174 r2.y =
r.y +
r.height - 1;
185 if (
T + A2*
Y < XCRIT)
192 else if (
T - B2*
X >= YCRIT)
210 movedown = moveout = 0;
213 if (
r1.x +
W < prevx)
218 if (
t +
a2*
y < xcrit)
227 else if (
t -
b2*
x >= ycrit)
262 if (
r1.width >
r.width)
263 r1.width =
r2.width =
r.width;
267 r1.width =
r2.width =
r.width;
278 else if (
r1.y+
r1.height <
r2.y)
308 if ((
x <=
a) && (prevy <
r2.y))
315 if (
r.x +
W != prevx)
323 r.width,
r1.height), pbrush,
TRUE);
381 int start_above, end_above;
382 long rise1, run1, rise2, run2;
400 x1 = p0.
x + (
r.y-p0.
y)*run1/rise1;
403 else if ((start_angle >= 0) && (start_angle <= 180))
417 if (
x1 >
r.x+
r.width)
427 x2 = p0.
x + (
r.y-p0.
y)*run2/rise2;
430 else if ((end_angle >= 0) && (end_angle <= 180))
445 if (
x2 >
r.x+
r.width)
x2 =
r.x+
r.width;
447 if (start_above && end_above)
449 if (start_angle > end_angle)
453 x1-
r.x,
r.height), pbrush,
Pen))
456 r.x+
r.width-
x2,
r.height), pbrush,
Pen);
466 else if (start_above)
475 r.width =
r.x+
r.width-
x2;
481 if (start_angle > end_angle)
498 x1 = p0.
x + (
r.y-p0.
y)*run1/rise1;
501 else if ((start_angle >= 180) && (start_angle <= 360))
515 if (
x1 >
r.x+
r.width)
525 x2 = p0.
x + (
r.y-p0.
y)*run2/rise2;
528 else if ((end_angle >= 180) && (end_angle <= 360))
542 if (
x2 >
r.x+
r.width)
545 if (start_above && end_above)
547 if (start_angle > end_angle)
552 else if (start_above)
561 r.width =
r.x+
r.width-
x1;
567 if (start_angle > end_angle)
571 x2-
r.x,
r.height), pbrush,
Pen))
574 r.x+
r.width-
x1,
r.height), pbrush,
Pen);
622 int b =
r.height / 2;
627 long xcrit = (3 *
a2 / 4) + 1;
628 long ycrit = (3 *
b2 / 4) + 1;
630 long dxt =
b2*(3+
x+
x);
631 long dyt =
a2*(3-
y-
y);
637 if ((
r.width <= 2) || (
r.height <= 2))
642 r1.width =
r.width & 1;
646 r2.y =
r.y +
r.height - 1;
650 if (
t +
a2*
y < xcrit)
663 else if (
t -
b2*
x >= ycrit)
684 if ((
r1.width > 0) && (
r1.height > 0))
688 if (
r1.y+
r1.height <
r2.y)
755 return pt(
r.x+
r.width,
cy);
756 else if (
angle == 45)
757 return pt(
r.x+
r.width,
r.y);
758 else if (
angle == 90)
760 else if (
angle == 135)
762 else if (
angle == 180)
764 else if (
angle == 225)
765 return pt(
r.x,
r.y+
r.height);
766 else if (
angle == 270)
767 return pt(
cx,
r.y+
r.height);
768 else if (
angle == 315)
769 return pt(
r.x+
r.width,
r.y+
r.height);
774 return pt((
int)(
cx+
r.height/tangent/2),
r.y);
776 return pt((
int)(
cx-
r.height/tangent/2),
r.y+
r.height);
778 return pt(
r.x, (
int)(
cy+
r.width*tangent/2));
780 return pt(
r.x+
r.width, (
int)(
cy-
r.width*tangent/2));
790 int b =
r.height / 2;
795 long xcrit = (3 *
a2 / 4) + 1;
796 long ycrit = (3 *
b2 / 4) + 1;
798 long dxt =
b2*(3+
x+
x);
799 long dyt =
a2*(3-
y-
y);
803 int movedown, moveout;
810 if ((start_angle + 360 <= end_angle) ||
811 (start_angle - 360 >= end_angle))
817 while (start_angle < 0)
822 while (end_angle < 0)
827 if (start_angle == end_angle)
834 p0 =
pt((p1.
x+p2.
x)/2,(p1.
y+p2.
y)/2);
836 p0 =
pt(
r.x +
r.width/2,
r.y +
r.height/2);
841 r1.width =
r.width & 1;
845 r2.y =
r.y +
r.height - 1;
849 moveout = movedown = 0;
851 if (
t +
a2*
y < xcrit)
860 else if (
t -
b2*
x >= ycrit)
895 if (
r1.width >
r.width)
896 r1.width =
r2.width =
r.width;
900 r1.width =
r2.width =
r.width;
903 if ((
r1.width > 0) && (
r1.y+
r1.height <
r2.y))
908 start_angle, end_angle, pbrush,
FALSE);
911 start_angle, end_angle, pbrush,
FALSE);
934 while (
r1.height > 0)
938 p0, p1, p2, start_angle, end_angle, pbrush,
FALSE);
950 while (
r1.height > 0)
954 p0, p1, p2, start_angle, end_angle, pbrush,
FALSE);
967 int b =
r.height / 2;
972 long xcrit = (3 *
a2 / 4) + 1;
973 long ycrit = (3 *
b2 / 4) + 1;
975 long dxt =
b2*(3+
x+
x);
976 long dyt =
a2*(3-
y-
y);
980 int w = pbrushPen->lWidth;
984 int A =
a-
w > 0 ?
a-
w : 0;
985 int B =
b-
w > 0 ?
b-
w : 0;
990 long XCRIT = (3 * A2 / 4) + 1;
991 long YCRIT = (3 * B2 / 4) + 1;
992 long T = B2 + A2 - 2*A2*
B;
993 long DXT = B2*(3+
X+
X);
994 long DYT = A2*(3-
Y-
Y);
999 int movedown, moveout;
1000 int innerX = 0, prevx, prevy,
W;
1008 if ((start_angle + 360 <= end_angle) ||
1009 (start_angle - 360 >= end_angle))
1015 while (start_angle < 0)
1020 while (end_angle < 0)
1025 if (start_angle == end_angle)
1032 p0 =
pt((p1.
x+p2.
x)/2,(p1.
y+p2.
y)/2);
1034 p0 =
pt(
r.x +
r.width/2,
r.y +
r.height/2);
1039 r1.width =
r.width & 1;
1043 r2.y =
r.y +
r.height - 1;
1054 if (
T + A2*
Y < XCRIT)
1061 else if (
T - B2*
X >= YCRIT)
1079 movedown = moveout = 0;
1082 if (
r1.x +
W < prevx)
1087 if (
t +
a2*
y < xcrit)
1096 else if (
t -
b2*
x >= ycrit)
1131 if (
r1.width >
r.width)
1132 r1.width =
r2.width =
r.width;
1136 r1.width =
r2.width =
r.width;
1143 start_angle, end_angle, pbrushPen,
TRUE);
1146 start_angle, end_angle, pbrushPen,
TRUE);
1151 else if (
r1.y+
r1.height <
r2.y)
1157 start_angle, end_angle, pbrushPen,
TRUE);
1161 start_angle, end_angle, pbrushPen,
TRUE);
1165 start_angle, end_angle, pbrushPen,
TRUE);
1169 start_angle, end_angle, pbrushPen,
TRUE);
1189 if ((
x <=
a) && (prevy <
r2.y))
1196 if (
r.x +
W != prevx)
1203 while (
r1.height > 0)
1206 r1.y,
r.width, 1), p0, p1, p2,
1207 start_angle, end_angle, pbrushPen,
TRUE);
1214 while (
r1.height > 0)
1218 start_angle, end_angle, pbrushPen,
TRUE);
1220 r1.y,
W, 1), p0, p1, p2,
1221 start_angle, end_angle, pbrushPen,
TRUE);
1252 psurf =
dc->dclevel.pSurface;
1261 pdcattr =
dc->pdcattr;
1275 DestRect.
left = XLeft;
1278 DestRect.
top = YLeft;
1281 BrushOrigin.
x = pbrush->ptOrigin.x;
1282 BrushOrigin.
y = pbrush->ptOrigin.y;
1296 Pen ? &
dc->eboLine.BrushObject : &
dc->eboFill.BrushObject,
1321 pdcattr =
dc->pdcattr;
1405 if (Wellipse >
r.width)
1407 if (Hellipse >
r.height)
1412 0, 180, pbrush,
FALSE);
1414 180, 360, pbrush,
FALSE);
1417 else if(Hellipse >
r.height)
1420 90, 270, pbrush,
FALSE);
1422 270, 90, pbrush,
FALSE);
1427 90, 180, pbrush,
FALSE);
1430 180, 270, pbrush,
FALSE);
1433 270, 360, pbrush,
FALSE);
1436 0, 90, pbrush,
FALSE);
1438 if (Wellipse <
r.width)
1443 if (Hellipse <
r.height)
1465 int w = pbrushPen->lWidth;
1471 if (Wellipse >
r.width)
1473 if (Hellipse >
r.height)
1478 0, 180, pbrushPen,
FALSE);
1480 180, 360, pbrushPen,
FALSE);
1483 else if(Hellipse >
r.height)
1486 90, 270, pbrushPen,
FALSE);
1488 270, 90, pbrushPen,
FALSE);
1493 90, 180, pbrushPen,
FALSE);
1496 180, 270, pbrushPen,
FALSE);
1499 270, 360, pbrushPen,
FALSE);
1502 0, 90, pbrushPen,
FALSE);
1504 if ( Hellipse <
r.height)
1512 if ( Wellipse <
r.width)
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
static LPHIST_ENTRY Bottom
#define ASSERT_DC_PREPARED(pdc)
#define ERROR_INVALID_HANDLE
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
BOOL FASTCALL IntFillEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord)
static int FASTCALL app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
static int NTAPI app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
int FASTCALL app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord)
#define DEGREES_TO_RADIANS(deg)
static POINT NTAPI app_new_point(int x, int y)
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen)
BOOL FASTCALL IntDrawRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrushPen)
#define app_fill_rect(dc, r, BrushObj, Pen)
BOOL FASTCALL IntDrawArc(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype, PBRUSH pbrush)
BOOL FASTCALL IntDrawEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
static int FASTCALL app_fill_arc_rect(DC *g, Rect r, POINT p0, POINT p1, POINT p2, int start_angle, int end_angle, PBRUSH pbrush, BOOL Pen)
static POINT FASTCALL app_boundary_point(Rect r, int angle)
BOOL FASTCALL IntFillRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
BOOL FASTCALL IntFillArc(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype)
#define BRUSH_ShareLockBrush(hBrush)
#define BRUSH_ShareUnlockBrush(pBrush)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
#define ROP4_FROM_INDEX(index)
static const struct update_accum a2
static CRYPT_DATA_BLOB b2[]
_Out_opt_ int _Out_opt_ int * cy
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
#define ERROR_INTERNAL_ERROR
BOOL WINAPI Chord(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom, _In_ INT xRadial1, _In_ INT yRadial1, _In_ INT xRadial2, _In_ INT yRadial2)