XenevaOS
Loading...
Searching...
No Matches
draw.h
Go to the documentation of this file.
1
30#ifndef __DRAW_H__
31#define __DRAW_H__
32
33#include "chitralekha.h"
34#include "color.h"
35#include <_xeneva.h>
36
37#ifdef __cplusplus
39#endif
40
41#pragma pack(push, 1)
48#pragma pack(pop)
49
50 /*
51 * ChDrawRect -- draw a rectangle
52 * @param canvas -- Pointer to canvas
53 * @param x -- X coord
54 * @param y -- Y coord
55 * @param w -- Width of the rect
56 * @param h -- Height of the rect
57 */
58 XE_LIB void ChDrawRect(
59 ChCanvas * canvas, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t col);
60
61 /*
62 * ChDrawRectClipped -- draw a rectangle within clipped boundary
63 * @param canv -- Pointer to canvas
64 * @param x -- X coord
65 * @param y -- Y coord
66 * @param w -- Width of the rect
67 * @param h -- Height of the rect
68 * @param clip -- Pointer to clip rect
69 * @param col -- Color of the rectangle
70 */
72 unsigned x,
73 unsigned y,
74 unsigned w,
75 unsigned h,
76 ChRect* clip,
77 uint32_t col);
78
79 /*
80 * ChDrawVerticalLine -- draws a vertical line
81 * @param canv -- Pointer to canvas
82 * @paam x -- X coord
83 * @param y - y coord
84 * @param len -- length of the line
85 * @param col -- Color to use
86 */
88 ChCanvas * canv, unsigned x, unsigned y, unsigned len, uint32_t col);
89
90 /*
91 * ChDrawVerticalLine -- draws a horizontal line
92 * @param canv -- Pointer to canvas
93 * @paam x -- X coord
94 * @param y - y coord
95 * @param len -- length of the line
96 * @param col -- Color to use
97 */
99 ChCanvas * canv, unsigned x, unsigned y, unsigned len, uint32_t col);
100
101 /*
102 * ChDrawRectUnfilled -- draws a unfilled only outlined rectangle
103 * @param canv -- Pointer to canvas
104 * @param x -- X coordinate
105 * @param y -- Y coordinate
106 * @param w -- Width of the rect
107 * @param h -- Height of the rect
108 */
110 ChCanvas * canv, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t color);
111
112 /*
113 * ChDrawRectUnfilledClipped -- draw a unfilled rectangle within clipped boundary
114 * @param canv -- Pointer to canvas
115 * @param x -- X coord
116 * @param y -- Y coord
117 * @param w -- Width of the rect
118 * @param h -- Height of the rect
119 * @param clip -- Pointer to clip rect
120 * @param col -- Color of the rectangle
121 */
123 unsigned x,
124 unsigned y,
125 unsigned w,
126 unsigned h,
127 ChRect* clip,
128 uint32_t col);
129
130 /*
131 * ChDrawFilledCircle -- draws a filled circle
132 * @param canv -- Pointer to canvas
133 * @param x -- X coordinate
134 * @param y -- Y coordinate
135 * @param radius -- radius of the circle
136 * @param fill_col -- color to use while filling
137 */
138 XE_LIB void ChDrawFilledCircle(ChCanvas * canv, int x, int y, int radius, uint32_t fill_col);
139
140 /*
141 * ChDrawFilledCircleAA -- Draw antialiased filled cirlce
142 * @param canv -- Pointer to canvas
143 * @param cx -- x location
144 * @param cy -- y location
145 * @param radius -- radius of the circle
146 * @param color -- color of the circle
147 */
148 XE_LIB void ChDrawFilledCircleAA(ChCanvas * canv, int cx, int cy, int radius, uint32_t color);
149
150 /*
151 * ChDrawLine -- draws a line
152 * @param canv -- Pointer to canvas
153 * @param x1 -- X coord of point one
154 * @param y1 -- Y coord of point one
155 * @param x2 -- X coord of point two
156 * @param y2 -- Y coord of point two
157 * @param color -- color to use
158 */
159 XE_LIB void ChDrawLine(ChCanvas * canv, int x1, int y1, int x2, int y2, uint32_t color);
160
161 /*
162 * ChDrawCircleUnfilled -- Draws a circle without filling its internal
163 * @param canvas -- Pointer to canvas
164 * @param x -- X coord of the circle
165 * @param y -- Y coord of the circle
166 * @param radius -- radius of the circle
167 * @param color -- outline color
168 */
169 XE_LIB void ChDrawCircleUnfilled(ChCanvas * canvas, int x, int y, int radius, uint32_t color);
170
171 /*
172 * ChDrawCapsule -- draw a capsule shaped rectangle
173 * @param canv -- Pointer to canvas
174 * @param x -- X location relative to window
175 * @param y -- Y location relative to window
176 * @param width -- Width of the capsule
177 * @param height -- Height of the capsule
178 * @param color -- fill color of the capsule
179 */
180 XE_LIB void ChDrawCapsule(ChCanvas * canv, int x, int y, int width, int height, uint32_t color);
181
183 int x,
184 int y,
185 int width,
186 int height,
187 uint32_t color,
188 int topleftRadius,
189 int topRightRadius,
190 int bottomRightRadius,
191 int bottomLeftRadius,
192 ChRect* mask);
193#ifdef __cplusplus
194}
195#endif
196
197#endif
#define XE_LIB
Definition _xeneva.h:55
#define XE_EXTERN
Definition _xeneva.h:50
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
ChCanvas * canvas
Definition deomain.cpp:91
XE_LIB void ChDrawHorizontalLine(ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
Definition draw.cpp:124
XE_LIB void ChDrawRectUnfilledClipped(ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect *clip, uint32_t col)
Definition draw.cpp:154
struct _chrect_ ChRect
XE_LIB void ChDrawCircleUnfilled(ChCanvas *canvas, int x, int y, int radius, uint32_t color)
Definition draw.cpp:268
XE_LIB void ChDrawRect(ChCanvas *canvas, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t col)
Definition draw.cpp:46
XE_LIB void ChDrawRectClipped(ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect *clip, uint32_t col)
Definition draw.cpp:73
XE_LIB void ChDrawCapsule(ChCanvas *canv, int x, int y, int width, int height, uint32_t color)
Definition draw.cpp:329
XE_LIB void ChDrawLine(ChCanvas *canv, int x1, int y1, int x2, int y2, uint32_t color)
Definition draw.cpp:224
XE_LIB void ChDrawFilledCircle(ChCanvas *canv, int x, int y, int radius, uint32_t fill_col)
Definition draw.cpp:190
XE_LIB void ChDrawVerticalLine(ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
Definition draw.cpp:112
XE_LIB void ChDrawFilledCircleAA(ChCanvas *canv, int cx, int cy, int radius, uint32_t color)
Definition draw.cpp:308
XE_LIB void ChDrawRoundedRect(ChCanvas *canv, int x, int y, int width, int height, uint32_t color, int topleftRadius, int topRightRadius, int bottomRightRadius, int bottomLeftRadius, ChRect *mask)
XE_LIB void ChDrawRectUnfilled(ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t color)
Definition draw.cpp:136
Definition chitralekha.h:40
Definition draw.h:42
int32_t x
Definition draw.h:43
int32_t h
Definition draw.h:46
int32_t y
Definition draw.h:44
int32_t w
Definition draw.h:45