summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_clip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_clip.c')
-rw-r--r--src/lib/evas/canvas/evas_clip.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 27ed00e..3678d4a 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -190,7 +190,7 @@ evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_D
190} 190}
191 191
192static void 192static void
193_efl_canvas_object_clip_mask_unset(Evas_Object_Protected_Data *obj) 193_efl_canvas_object_clipper_mask_unset(Evas_Object_Protected_Data *obj)
194{ 194{
195 EVAS_OBJECT_DATA_VALID_CHECK(obj); 195 EVAS_OBJECT_DATA_VALID_CHECK(obj);
196 if (!obj->mask->is_mask) return; 196 if (!obj->mask->is_mask) return;
@@ -218,7 +218,7 @@ extern const char *o_image_type;
218static void _clipper_invalidated_cb(void *data, const Efl_Event *event); 218static void _clipper_invalidated_cb(void *data, const Efl_Event *event);
219 219
220Eina_Bool 220Eina_Bool
221_efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, 221_efl_canvas_object_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj,
222 Evas_Object *eo_clip, Evas_Object_Protected_Data *clip) 222 Evas_Object *eo_clip, Evas_Object_Protected_Data *clip)
223{ 223{
224 if (!obj) obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 224 if (!obj) obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -259,7 +259,7 @@ err_type:
259} 259}
260 260
261static inline void 261static inline void
262_efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn) 262_efl_canvas_object_clipper_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn)
263{ 263{
264 Evas_Object_Protected_Data *clip = obj->cur->clipper; 264 Evas_Object_Protected_Data *clip = obj->cur->clipper;
265 265
@@ -302,7 +302,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool
302 } 302 }
303 } 303 }
304 304
305 _efl_canvas_object_clip_mask_unset(clip); 305 _efl_canvas_object_clipper_mask_unset(clip);
306 } 306 }
307 evas_object_change(clip->object, clip); 307 evas_object_change(clip->object, clip);
308 if (obj->prev->clipper != clip) 308 if (obj->prev->clipper != clip)
@@ -315,7 +315,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool
315} 315}
316 316
317EOLIAN void 317EOLIAN void
318_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip) 318_efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip)
319{ 319{
320 Evas_Object_Protected_Data *clip; 320 Evas_Object_Protected_Data *clip;
321 321
@@ -331,7 +331,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
331 return; 331 return;
332 } 332 }
333 333
334 if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_clip, clip)) return; 334 if (_efl_canvas_object_clipper_set_block(eo_obj, obj, eo_clip, clip)) return;
335 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return; 335 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return;
336 336
337 if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && 337 if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class &&
@@ -341,7 +341,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
341 } 341 }
342 342
343 /* unset cur clipper */ 343 /* unset cur clipper */
344 _efl_canvas_object_clip_unset_common(obj, EINA_TRUE); 344 _efl_canvas_object_clipper_unset_common(obj, EINA_TRUE);
345 345
346 /* image object clipper */ 346 /* image object clipper */
347 if (clip->type == o_image_type) 347 if (clip->type == o_image_type)
@@ -391,7 +391,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
391} 391}
392 392
393EOLIAN Evas_Object * 393EOLIAN Evas_Object *
394_efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 394_efl_canvas_object_clipper_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
395{ 395{
396 EVAS_OBJECT_DATA_ALIVE_CHECK(obj, NULL); 396 EVAS_OBJECT_DATA_ALIVE_CHECK(obj, NULL);
397 if (obj->cur->clipper) 397 if (obj->cur->clipper)
@@ -400,7 +400,7 @@ _efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_
400} 400}
401 401
402Eina_Bool 402Eina_Bool
403_efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 403_efl_canvas_object_clipper_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
404{ 404{
405 if (!obj->cur->clipper) 405 if (!obj->cur->clipper)
406 return EINA_TRUE; 406 return EINA_TRUE;
@@ -414,14 +414,14 @@ _efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protecte
414static void 414static void
415_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj) 415_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
416{ 416{
417 if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) return; 417 if (_efl_canvas_object_clipper_unset_block(eo_obj, obj)) return;
418 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return; 418 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return;
419 if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && 419 if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class &&
420 obj->smart.smart->smart_class->clip_unset) 420 obj->smart.smart->smart_class->clip_unset)
421 { 421 {
422 obj->smart.smart->smart_class->clip_unset(eo_obj); 422 obj->smart.smart->smart_class->clip_unset(eo_obj);
423 } 423 }
424 _efl_canvas_object_clip_unset_common(obj, EINA_FALSE); 424 _efl_canvas_object_clipper_unset_common(obj, EINA_FALSE);
425 evas_object_update_bounding_box(eo_obj, obj, NULL); 425 evas_object_update_bounding_box(eo_obj, obj, NULL);
426 evas_object_change(eo_obj, obj); 426 evas_object_change(eo_obj, obj);
427 evas_object_clip_dirty(eo_obj, obj); 427 evas_object_clip_dirty(eo_obj, obj);
@@ -469,7 +469,7 @@ _clipper_invalidated_cb(void *data, const Efl_Event *event)
469} 469}
470 470
471void 471void
472_efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev) 472_efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev)
473{ 473{
474 if (obj->prev->clipper) 474 if (obj->prev->clipper)
475 { 475 {
@@ -502,6 +502,13 @@ evas_object_clipees_get(const Evas_Object *eo_obj)
502 return answer; 502 return answer;
503} 503}
504 504
505EAPI Eina_Bool
506evas_object_clipees_has(const Evas_Object *eo_obj)
507{
508 Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE);
509 return !!obj->clip.clipees;
510}
511
505typedef struct 512typedef struct
506{ 513{
507 Eina_Iterator iterator; 514 Eina_Iterator iterator;
@@ -536,7 +543,7 @@ _clipee_iterator_free(Clipee_Iterator *it)
536} 543}
537 544
538EOLIAN Eina_Iterator * 545EOLIAN Eina_Iterator *
539_efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj) 546_efl_canvas_object_clipped_objects_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj)
540{ 547{
541 Clipee_Iterator *it; 548 Clipee_Iterator *it;
542 549
@@ -556,10 +563,10 @@ _efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj
556 return &it->iterator; 563 return &it->iterator;
557} 564}
558 565
559EOLIAN Eina_Bool 566EOLIAN unsigned int
560_efl_canvas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 567_efl_canvas_object_clipped_objects_count(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
561{ 568{
562 return (obj->clip.clipees ? EINA_TRUE : EINA_FALSE); 569 return eina_list_count(obj->clip.clipees);
563} 570}
564 571
565EOLIAN void 572EOLIAN void