2 #include "lv_rectangle.h"
7 VisRectangle *visual_rectangle_new (
int x,
int y,
int width,
int height)
9 return new LV::Rect (x, y, width, height);
22 void visual_rectangle_set (
VisRectangle *
self,
int x,
int y,
int width,
int height)
24 visual_return_if_fail (
self !=
nullptr);
29 visual_return_if_fail (
self !=
nullptr);
30 visual_return_if_fail (src !=
nullptr);
37 visual_return_val_if_fail (
self !=
nullptr,
nullptr);
39 return visual_rectangle_new (self->x, self->y, self->width, self->height);
44 visual_return_if_fail (
self !=
nullptr);
51 visual_return_val_if_fail (
self !=
nullptr, 0);
58 visual_return_if_fail (
self !=
nullptr);
65 visual_return_val_if_fail (
self !=
nullptr, 0);
70 void visual_rectangle_set_width (
VisRectangle *
self,
int width)
72 visual_return_if_fail (
self !=
nullptr);
79 visual_return_val_if_fail (
self !=
nullptr, 0);
84 void visual_rectangle_set_height (
VisRectangle *
self,
int height)
86 visual_return_if_fail (
self !=
nullptr);
88 self->height = height;
93 visual_return_val_if_fail (
self !=
nullptr, 0);
100 visual_return_val_if_fail (
self !=
nullptr, TRUE);
102 return self->empty ();
107 visual_return_val_if_fail (
self !=
nullptr, FALSE);
108 visual_return_val_if_fail (src !=
nullptr, FALSE);
110 return self->intersects (*src);
113 int visual_rectangle_contains_point (
VisRectangle *
self,
int x,
int y)
115 visual_return_val_if_fail (
self !=
nullptr, FALSE);
117 return self->contains (x, y);
122 visual_return_val_if_fail (
self !=
nullptr, FALSE);
123 visual_return_val_if_fail (src !=
nullptr, FALSE);
125 return self->contains (*src);
130 visual_return_if_fail (result !=
nullptr);
131 visual_return_if_fail (bounds !=
nullptr);
132 visual_return_if_fail (src !=
nullptr);
134 *result = bounds->
clip (*src);
139 visual_return_if_fail (
self !=
nullptr);
146 visual_return_if_fail (
self !=
nullptr);
147 visual_return_if_fail (src !=
nullptr);
149 self->normalize_to (*src);
152 void visual_rectangle_denormalize_point (
VisRectangle *
self,
float fx,
float fy, int32_t *x, int32_t *y)
154 visual_return_if_fail (
self !=
nullptr);
155 visual_return_if_fail (x !=
nullptr);
156 visual_return_if_fail (y !=
nullptr);
158 self->denormalize_point (fx, fy, *x, *y);
161 void visual_rectangle_denormalize_point_neg (
VisRectangle *
self,
float fx,
float fy, int32_t *x, int32_t *y)
163 visual_return_if_fail (
self !=
nullptr);
164 visual_return_if_fail (x !=
nullptr);
165 visual_return_if_fail (y !=
nullptr);
167 self->denormalize_point_neg (fx, fy, *x, *y);
170 void visual_rectangle_denormalize_points (
VisRectangle *
self,
const float *fxlist,
const float *fylist, int32_t *xlist, int32_t *ylist,
unsigned int size)
172 visual_return_if_fail (
self !=
nullptr);
174 self->denormalize_points (fxlist, fylist, xlist, ylist, size);
177 void visual_rectangle_denormalise_points_neg (
VisRectangle *
self,
const float *fxlist,
const float *fylist, int32_t *xlist, int32_t *ylist,
unsigned int size)
179 visual_return_if_fail (
self !=
nullptr);
181 self->denormalize_points_neg (fxlist, fylist, xlist, ylist, size);