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
38#ifdef __cplusplus
40#endif
41
42#pragma pack(push,1)
49#pragma pack(pop)
50
51 /*
52 * ChDrawRect -- draw a rectangle
53 * @param canvas -- Pointer to canvas
54 * @param x -- X coord
55 * @param y -- Y coord
56 * @param w -- Width of the rect
57 * @param h -- Height of the rect
58 */
59 XE_LIB void ChDrawRect(ChCanvas* canvas, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t col);
60
61
62 /*
63 * ChDrawRectClipped -- draw a rectangle within clipped boundary
64 * @param canv -- Pointer to canvas
65 * @param x -- X coord
66 * @param y -- Y coord
67 * @param w -- Width of the rect
68 * @param h -- Height of the rect
69 * @param clip -- Pointer to clip rect
70 * @param col -- Color of the rectangle
71 */
72 XE_LIB void ChDrawRectClipped(ChCanvas* canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect* clip, uint32_t col);
73
74 /*
75 * ChDrawVerticalLine -- draws a vertical line
76 * @param canv -- Pointer to canvas
77 * @paam x -- X coord
78 * @param y - y coord
79 * @param len -- length of the line
80 * @param col -- Color to use
81 */
82 XE_LIB void ChDrawVerticalLine(ChCanvas* canv, unsigned x, unsigned y, unsigned len, uint32_t col);
83
84 /*
85 * ChDrawVerticalLine -- draws a horizontal line
86 * @param canv -- Pointer to canvas
87 * @paam x -- X coord
88 * @param y - y coord
89 * @param len -- length of the line
90 * @param col -- Color to use
91 */
92 XE_LIB void ChDrawHorizontalLine(ChCanvas* canv, unsigned x, unsigned y, unsigned len, uint32_t col);
93
94
95 /*
96 * ChDrawRectUnfilled -- draws a unfilled only outlined rectangle
97 * @param canv -- Pointer to canvas
98 * @param x -- X coordinate
99 * @param y -- Y coordinate
100 * @param w -- Width of the rect
101 * @param h -- Height of the rect
102 */
103 XE_LIB void ChDrawRectUnfilled(ChCanvas* canv, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t color);
104
105 /*
106 * ChDrawRectUnfilledClipped -- draw a unfilled rectangle within clipped boundary
107 * @param canv -- Pointer to canvas
108 * @param x -- X coord
109 * @param y -- Y coord
110 * @param w -- Width of the rect
111 * @param h -- Height of the rect
112 * @param clip -- Pointer to clip rect
113 * @param col -- Color of the rectangle
114 */
115 XE_LIB void ChDrawRectUnfilledClipped(ChCanvas* canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect* clip, uint32_t col);
116
117 /*
118 * ChDrawFilledCircle -- draws a filled circle
119 * @param canv -- Pointer to canvas
120 * @param x -- X coordinate
121 * @param y -- Y coordinate
122 * @param radius -- radius of the circle
123 * @param fill_col -- color to use while filling
124 */
125 XE_LIB void ChDrawFilledCircle(ChCanvas* canv, int x, int y, int radius, uint32_t fill_col);
126
127 /*
128 * ChDrawFilledCircleAA -- Draw antialiased filled cirlce
129 * @param canv -- Pointer to canvas
130 * @param cx -- x location
131 * @param cy -- y location
132 * @param radius -- radius of the circle
133 * @param color -- color of the circle
134 */
135 XE_LIB void ChDrawFilledCircleAA(ChCanvas* canv, int cx, int cy, int radius, uint32_t color);
136
137 /*
138 * ChDrawLine -- draws a line
139 * @param canv -- Pointer to canvas
140 * @param x1 -- X coord of point one
141 * @param y1 -- Y coord of point one
142 * @param x2 -- X coord of point two
143 * @param y2 -- Y coord of point two
144 * @param color -- color to use
145 */
146 XE_LIB void ChDrawLine(ChCanvas* canv, int x1, int y1, int x2, int y2, uint32_t color);
147
148 /*
149 * ChDrawCircleUnfilled -- Draws a circle without filling its internal
150 * @param canvas -- Pointer to canvas
151 * @param x -- X coord of the circle
152 * @param y -- Y coord of the circle
153 * @param radius -- radius of the circle
154 * @param color -- outline color
155 */
156 XE_LIB void ChDrawCircleUnfilled(ChCanvas * canvas, int x, int y, int radius, uint32_t color);
157
158 /*
159 * ChDrawCapsule -- draw a capsule shaped rectangle
160 * @param canv -- Pointer to canvas
161 * @param x -- X location relative to window
162 * @param y -- Y location relative to window
163 * @param width -- Width of the capsule
164 * @param height -- Height of the capsule
165 * @param color -- fill color of the capsule
166 */
167 XE_LIB void ChDrawCapsule(ChCanvas* canv, int x, int y, int width, int height, uint32_t color);
168
169
170 XE_LIB void ChDrawRoundedRect(ChCanvas* canv, int x, int y, int width, int height, uint32_t color, int topleftRadius,
171 int topRightRadius, int bottomRightRadius, int bottomLeftRadius, ChRect* mask);
172#ifdef __cplusplus
173}
174#endif
175
176#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:92
XE_LIB void ChDrawHorizontalLine(ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
Definition draw.cpp:114
XE_LIB void ChDrawRectUnfilledClipped(ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect *clip, uint32_t col)
Definition draw.cpp:143
struct _chrect_ ChRect
XE_LIB void ChDrawCircleUnfilled(ChCanvas *canvas, int x, int y, int radius, uint32_t color)
Definition draw.cpp:257
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:62
XE_LIB void ChDrawCapsule(ChCanvas *canv, int x, int y, int width, int height, uint32_t color)
Definition draw.cpp:318
XE_LIB void ChDrawLine(ChCanvas *canv, int x1, int y1, int x2, int y2, uint32_t color)
Definition draw.cpp:212
XE_LIB void ChDrawFilledCircle(ChCanvas *canv, int x, int y, int radius, uint32_t fill_col)
Definition draw.cpp:178
XE_LIB void ChDrawVerticalLine(ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
Definition draw.cpp:102
XE_LIB void ChDrawFilledCircleAA(ChCanvas *canv, int cx, int cy, int radius, uint32_t color)
Definition draw.cpp:297
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:126
Definition chitralekha.h:43
Definition draw.h:43
int32_t x
Definition draw.h:44
int32_t h
Definition draw.h:47
int32_t y
Definition draw.h:45
int32_t w
Definition draw.h:46