summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-08-07 09:43:22 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-08-07 09:43:22 +0000
commit61c2345c5535a2ea3ebd7cb69dcccb13db61d6e4 (patch)
treea7d1f4fb531352985fe4e730c77f576be1c9c028 /legacy
parent07742ef737ca5bb88ebdf68163da0331426e5006 (diff)
evas: properly warn when linking object from different canvas.
SVN revision: 74968
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/lib/canvas/evas_clip.c42
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_image.c32
2 files changed, 67 insertions, 7 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c
index 6baa28cdb3..1597bfced1 100644
--- a/legacy/evas/src/lib/canvas/evas_clip.c
+++ b/legacy/evas/src/lib/canvas/evas_clip.c
@@ -176,14 +176,44 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
176 return; 176 return;
177 MAGIC_CHECK_END(); 177 MAGIC_CHECK_END();
178 if (obj->cur.clipper == clip) return; 178 if (obj->cur.clipper == clip) return;
179 if (obj == clip) return; 179 if (obj == clip)
180 {
181 CRIT("Setting clip %p on itself", obj)
182 return;
183 }
184 if (clip->delete_me)
185 {
186 CRIT("Setting deleted object %p as clip obj %p", clip, obj);
187 abort();
188 return;
189 }
190 if (obj->delete_me)
191 {
192 CRIT("Setting object %p as clip to deleted obj %p", clip, obj);
193 abort();
194 return;
195 }
196 if (!obj->layer)
197 {
198 CRIT("No evas surface associated with object (%p)", obj);
199 abort();
200 return;
201 }
202 if ((obj->layer && clip->layer) &&
203 (obj->layer->evas != clip->layer->evas))
204 {
205 CRIT("Setting object %p from Evas (%p) to another Evas (%p)", obj, obj->layer->evas, clip->layer->evas);
206 abort();
207 return;
208 }
209
180 if (evas_object_intercept_call_clip_set(obj, clip)) return; 210 if (evas_object_intercept_call_clip_set(obj, clip)) return;
181 // illegal to set anything but a rect as a clip 211 // illegal to set anything but a rect as a clip
182 /* if (clip->type != o_rect_type) */ 212 if (clip->type != o_rect_type)
183 /* { */ 213 {
184 /* ERR("For now a clip on other object than a rectangle is disabled"); */ 214 ERR("For now a clip on other object than a rectangle is disabled");
185 /* return; */ 215 return;
186 /* } */ 216 }
187 if (obj->smart.smart) 217 if (obj->smart.smart)
188 { 218 {
189 if (obj->smart.smart->smart_class->clip_set) 219 if (obj->smart.smart->smart_class->clip_set)
diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c
index 8f5ef4eea2..9c4a2d9209 100644
--- a/legacy/evas/src/lib/canvas/evas_object_image.c
+++ b/legacy/evas/src/lib/canvas/evas_object_image.c
@@ -447,7 +447,37 @@ evas_object_image_source_set(Evas_Object *obj, Evas_Object *src)
447 return EINA_FALSE; 447 return EINA_FALSE;
448 MAGIC_CHECK_END(); 448 MAGIC_CHECK_END();
449 449
450 if (src == obj) return EINA_FALSE; 450 if (obj->delete_me)
451 {
452 CRIT("Setting deleted object %p as image source %p", src, obj);
453 abort();
454 return EINA_FALSE;
455 }
456 if (src->delete_me)
457 {
458 CRIT("Setting object %p to deleted image source %p", src, obj);
459 abort();
460 return EINA_FALSE;
461 }
462 if (!src->layer)
463 {
464 CRIT("No evas surface associated with source object (%p)", obj);
465 abort();
466 return EINA_FALSE;
467 }
468 if ((obj->layer && src->layer) &&
469 (obj->layer->evas != src->layer->evas))
470 {
471 CRIT("Setting object %p from Evas (%p) from another Evas (%p)", src, src->layer->evas, obj->layer->evas);
472 abort();
473 return EINA_FALSE;
474 }
475 if (src == obj)
476 {
477 CRIT("Setting object %p as a source for itself", obj);
478 abort();
479 return EINA_FALSE;
480 }
451 if (o->cur.source == src) return EINA_TRUE; 481 if (o->cur.source == src) return EINA_TRUE;
452 482
453 _evas_object_image_cleanup(obj, o); 483 _evas_object_image_cleanup(obj, o);