5 _evas_object_event_new(void)
11 evas_object_was_visible(Evas_Object *obj)
13 if ((obj->prev.visible) &&
14 ((obj->prev.cache.clip.visible) || (obj->smart.smart)) &&
15 (obj->prev.cache.clip.a > 0))
17 if (obj->func->was_visible)
18 return obj->func->was_visible(obj);
25 evas_add_rect(Eina_Array *rects, int x, int y, int w, int h)
29 NEW_RECT(r, x, y, w, h);
30 if (r) eina_array_push(rects, r);
33 static inline Cutout_Rect*
34 evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
35 int x, int y, int w, int h)
39 if (rects->max < (rects->active + 1))
42 rects->rects = (Cutout_Rect *)realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
45 rect = rects->rects + rects->active;
56 evas_object_is_opaque(Evas_Object *obj)
58 if (obj->smart.smart) return 0;
59 if (obj->cur.cache.clip.a == 255)
61 if (obj->func->is_opaque)
62 return obj->func->is_opaque(obj);
69 evas_event_passes_through(Evas_Object *obj)
71 if (obj->layer->evas->events_frozen > 0) return 1;
72 if (obj->pass_events) return 1;
73 if (obj->parent_cache_valid) return obj->parent_pass_events;
74 if (obj->smart.parent)
78 par_pass = evas_event_passes_through(obj->smart.parent);
79 obj->parent_cache_valid = 1;
80 obj->parent_pass_events = par_pass;
87 evas_object_is_visible(Evas_Object *obj)
89 if ((obj->cur.visible) &&
90 ((obj->cur.cache.clip.visible) || (obj->smart.smart)) &&
91 (obj->cur.cache.clip.a > 0))
93 if (obj->func->is_visible)
94 return obj->func->is_visible(obj);
101 evas_object_clippers_is_visible(Evas_Object *obj)
103 if (obj->cur.visible)
105 if (obj->cur.clipper)
106 return evas_object_clippers_is_visible(obj->cur.clipper);
113 evas_object_is_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
115 /* assumes coords have been recalced */
116 if ((RECTS_INTERSECT(x, y, w, h,
117 obj->cur.cache.clip.x,
118 obj->cur.cache.clip.y,
119 obj->cur.cache.clip.w,
120 obj->cur.cache.clip.h)))
126 evas_object_is_active(Evas_Object *obj)
128 if (evas_object_is_visible(obj) || evas_object_was_visible(obj))
130 if (obj->smart.smart)
133 if (obj->smart.smart && (obj->cur.map && obj->cur.usemap)) mapsmt = 1;
134 if (!mapsmt) return 1;
135 if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
136 obj->layer->evas->output.h) ||
137 evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
138 obj->layer->evas->output.h))
143 if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
144 obj->layer->evas->output.h) ||
145 evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
146 obj->layer->evas->output.h))
154 evas_object_coords_recalc(Evas_Object *obj)
156 //// if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity)
158 //// obj->cur.cache.geometry.x =
159 //// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x);
160 //// obj->cur.cache.geometry.y =
161 //// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y);
162 //// obj->cur.cache.geometry.w =
163 //// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.w) -
164 //// evas_coord_world_x_to_screen(obj->layer->evas, 0);
165 //// obj->cur.cache.geometry.h =
166 //// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.h) -
167 //// evas_coord_world_y_to_screen(obj->layer->evas, 0);
168 if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
169 //// obj->cur.cache.geometry.validity = obj->layer->evas->output_validity;
173 evas_object_clip_recalc(Evas_Object *obj)
175 int cx, cy, cw, ch, cvis, cr, cg, cb, ca;
176 int nx, ny, nw, nh, nvis, nr, ng, nb, na;
178 if (!obj->cur.cache.clip.dirty &&
179 !(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty))
181 if (obj->layer->evas->events_frozen > 0) return;
182 evas_object_coords_recalc(obj);
183 if ((obj->cur.map) && (obj->cur.usemap))
185 cx = obj->cur.map->normal_geometry.x;
186 cy = obj->cur.map->normal_geometry.y;
187 cw = obj->cur.map->normal_geometry.w;
188 ch = obj->cur.map->normal_geometry.h;
192 cx = obj->cur.geometry.x;
193 cy = obj->cur.geometry.y;
194 cw = obj->cur.geometry.w;
195 ch = obj->cur.geometry.h;
197 //// cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y;
198 //// cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h;
199 if (obj->cur.color.a == 0) cvis = 0;
200 else cvis = obj->cur.visible;
201 cr = obj->cur.color.r; cg = obj->cur.color.g;
202 cb = obj->cur.color.b; ca = obj->cur.color.a;
203 if (obj->cur.clipper)
205 // this causes problems... hmmm
206 if (obj->cur.clipper->cur.cache.clip.dirty)
207 evas_object_clip_recalc(obj->cur.clipper);
208 nx = obj->cur.clipper->cur.cache.clip.x;
209 ny = obj->cur.clipper->cur.cache.clip.y;
210 nw = obj->cur.clipper->cur.cache.clip.w;
211 nh = obj->cur.clipper->cur.cache.clip.h;
212 RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
214 nvis = obj->cur.clipper->cur.cache.clip.visible;
215 nr = obj->cur.clipper->cur.cache.clip.r;
216 ng = obj->cur.clipper->cur.cache.clip.g;
217 nb = obj->cur.clipper->cur.cache.clip.b;
218 na = obj->cur.clipper->cur.cache.clip.a;
220 cr = (cr * (nr + 1)) >> 8;
221 cg = (cg * (ng + 1)) >> 8;
222 cb = (cb * (nb + 1)) >> 8;
223 ca = (ca * (na + 1)) >> 8;
225 if ((ca == 0) || (cw <= 0) || (ch <= 0)) cvis = 0;
226 obj->cur.cache.clip.x = cx;
227 obj->cur.cache.clip.y = cy;
228 obj->cur.cache.clip.w = cw;
229 obj->cur.cache.clip.h = ch;
230 obj->cur.cache.clip.visible = cvis;
231 obj->cur.cache.clip.r = cr;
232 obj->cur.cache.clip.g = cg;
233 obj->cur.cache.clip.b = cb;
234 obj->cur.cache.clip.a = ca;
235 obj->cur.cache.clip.dirty = 0;