aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-07-05 16:52:05 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-07-05 16:52:05 +0200
commit32e12841a096fea0ed0ac05fe43a19221b5c5814 (patch)
tree74ef9a66385184dac07772de5b212701770c8a13
parentexamples: fix some unused vars warnings (diff)
downloadegraph-32e12841a096fea0ed0ac05fe43a19221b5c5814.tar.gz
targettrack: printf only on debug mode
-rw-r--r--targettrack.c18
-rw-r--r--targettrack.h1
2 files changed, 13 insertions, 6 deletions
diff --git a/targettrack.c b/targettrack.c
index ddd49c4..5416de7 100644
--- a/targettrack.c
+++ b/targettrack.c
@@ -60,7 +60,8 @@ _targettrack_free(Egraph_Targettrack *track)
Eina_List *l;
Evas_Object *t;
- printf("_targettrack_free\n");
+ if (track->debug)
+ printf("_targettrack_free\n");
evas_object_event_callback_del_full(track->origin, EVAS_CALLBACK_FREE,
_cb_obj_free, track);
evas_object_event_callback_del_full(track->target, EVAS_CALLBACK_FREE,
@@ -96,8 +97,9 @@ _cb_targettrack(void *data, double pos)
Evas_Coord x, y;
double pct;
- printf("_cb_targettrack pos %f\n", pos);
track = data;
+ if (track->debug)
+ printf("_cb_targettrack pos %f\n", pos);
_update_coords(track);
pct = ecore_animator_pos_map(pos, track->map, 0.0, 0.0);
@@ -136,20 +138,24 @@ _cb_obj_free(void *data, Evas *e, Evas_Object *obj, void *event_info)
Eina_List *l, *l_next;
Evas_Object *t;
- printf("_cb_obj_free\n");
track = data;
+ if (track->debug)
+ printf("_cb_obj_free\n");
if (obj == track->origin) {
- printf(" origin\n");
+ if (track->debug)
+ printf(" origin\n");
track->origin = NULL;
}
if (obj == track->target) {
- printf(" target\n");
+ if (track->debug)
+ printf(" target\n");
track->target = NULL;
}
EINA_LIST_FOREACH_SAFE(track->next_targets, l, l_next, t) {
if (obj == t) {
track->next_targets = eina_list_remove(track->next_targets, t);
- printf(" next_target\n");
+ if (track->debug)
+ printf(" next_target\n");
}
}
}
diff --git a/targettrack.h b/targettrack.h
index c25c988..61ed8bf 100644
--- a/targettrack.h
+++ b/targettrack.h
@@ -6,6 +6,7 @@ typedef void (*Egraph_Targettrack_End_Cb)(Evas_Object *obj);
typedef struct Egraph_Targettrack Egraph_Targettrack;
struct Egraph_Targettrack {
+ int debug;
double total_time;
Ecore_Pos_Map map;
Evas_Object *obj;