summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authortsauerbeck <tsauerbeck>2005-07-26 19:27:02 +0000
committertsauerbeck <tsauerbeck@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-07-26 19:27:02 +0000
commitecdb98382719e1769facf0eaa6d9a3bdbca6b958 (patch)
tree73d828d41f4d5915ffe88354e0a2eb246ba14c3c /legacy
parent24e1406536d5c7f0fc17de17b28f541e1a836c07 (diff)
cleanup. formatting and stuff
SVN revision: 15908
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/src/lib/edje_callbacks.c106
1 files changed, 49 insertions, 57 deletions
diff --git a/legacy/edje/src/lib/edje_callbacks.c b/legacy/edje/src/lib/edje_callbacks.c
index 0b362c8a8c..5ca4c4202c 100644
--- a/legacy/edje/src/lib/edje_callbacks.c
+++ b/legacy/edje/src/lib/edje_callbacks.c
@@ -1,8 +1,7 @@
1/* 1/*
2 * vim: ts=8 2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */ 3 */
4 4
5
6#include "Edje.h" 5#include "Edje.h"
7#include "edje_private.h" 6#include "edje_private.h"
8 7
@@ -61,64 +60,55 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
61 _edje_emit(ed, buf, rp->part->name); 60 _edje_emit(ed, buf, rp->part->name);
62 61
63 if (rp->events_to) 62 if (rp->events_to)
64 { 63 {
65 int x, y; 64 int x = 0, y = 0;
66 Edje_Real_Part* events; 65 Edje_Real_Part *events = rp->events_to;
67 events = rp->events_to;
68 66
69 //fprintf(stderr,"rp = %s, events = %s\n", rp->part->name, events->part->name); 67 evas_object_geometry_get(rp->object, &x, &y, NULL, NULL);
70 68
71 evas_object_geometry_get(rp->object, &x, &y, NULL, NULL); 69 if ((events->part->dragable.x) || (events->part->dragable.y))
72 /* 70 {
73 fprintf(stderr,"x = %d, y = %d\n", x, y); 71 if (events->part->dragable.x)
74 fprintf(stderr,"ev->canvas.x = %d\n", ev->canvas.x);
75 *
76 x = ed->x;
77 y = ed->y;
78 */
79 if ((events->part->dragable.x) || (events->part->dragable.y))
80 {
81 if (events->part->dragable.x)
82 { 72 {
83 events->drag.tmp.x = ev->canvas.x - x - (events->x + events->w/2); 73 events->drag.tmp.x = ev->canvas.x - x - (events->x + events->w / 2);
84 events->drag.down.x = ev->canvas.x - x; 74 events->drag.down.x = ev->canvas.x - x;
85 events->x = ev->canvas.x - x - events->w/2; 75 events->x = ev->canvas.x - x - events->w / 2;
86 } 76 }
87 if (events->part->dragable.y) 77 if (events->part->dragable.y)
88 { 78 {
89 events->drag.tmp.y = ev->canvas.y - y - (events->y + events->h/2); 79 events->drag.tmp.y = ev->canvas.y - y - (events->y + events->h / 2);
90 events->drag.down.y = ev->canvas.y - y; 80 events->drag.down.y = ev->canvas.y - y;
91 events->y = ev->canvas.y - y - events->h/2; 81 events->y = ev->canvas.y - y - events->h / 2;
92 } 82 }
93 83
94 snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button); 84 snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
95 _edje_emit(ed, buf, events->part->name); 85 _edje_emit(ed, buf, events->part->name);
96 ed->dirty = 1; 86 ed->dirty = 1;
97 } 87 }
98 _edje_recalc(ed); 88 _edje_recalc(ed);
99 _edje_thaw(ed); 89 _edje_thaw(ed);
100 _edje_unref(ed); 90 _edje_unref(ed);
101 _edje_ref(ed); 91 _edje_ref(ed);
102 _edje_freeze(ed); 92 _edje_freeze(ed);
103 93
104 rp = events; 94 rp = events;
105 { 95 {
106 double dx, dy; 96 double dx = 0.0, dy = 0.0;
107 int dir; 97 int dir;
108 98
109 dir = _edje_part_dragable_calc(ed, rp, &dx, &dy); 99 dir = _edje_part_dragable_calc(ed, rp, &dx, &dy);
110// fprintf(stderr,"dx = %f, dy = %f\n", dx, dy); 100
111 if ((dx != rp->drag.val.x) || (dy != rp->drag.val.y)) 101 if ((dx != rp->drag.val.x) || (dy != rp->drag.val.y))
112 { 102 {
113 rp->drag.val.x = dx; 103 rp->drag.val.x = dx;
114 rp->drag.val.y = dy; 104 rp->drag.val.y = dy;
115 _edje_emit(ed, "drag", rp->part->name); 105 _edje_emit(ed, "drag", rp->part->name);
116 ed->dirty = 1; 106 ed->dirty = 1;
117 rp->drag.need_reset = 1; 107 rp->drag.need_reset = 1;
118 _edje_recalc(ed); 108 _edje_recalc(ed);
119 } 109 }
120 } 110 }
121 } 111 }
122 112
123 if ((rp->part->dragable.x) || (rp->part->dragable.y)) 113 if ((rp->part->dragable.x) || (rp->part->dragable.y))
124 { 114 {
@@ -161,11 +151,11 @@ _edje_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
161 _edje_ref(ed); 151 _edje_ref(ed);
162 _edje_emit(ed, buf, rp->part->name); 152 _edje_emit(ed, buf, rp->part->name);
163 153
164 if(rp->events_to) 154 if (rp->events_to)
165 { 155 {
166 rp = rp->events_to; 156 rp = rp->events_to;
167 snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button); 157 snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
168 _edje_emit(ed, buf, rp->part->name); 158 _edje_emit(ed, buf, rp->part->name);
169 } 159 }
170 160
171 if ((rp->part->dragable.x) || (rp->part->dragable.y)) 161 if ((rp->part->dragable.x) || (rp->part->dragable.y))
@@ -208,7 +198,9 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
208 rp = evas_object_data_get(obj, "real_part"); 198 rp = evas_object_data_get(obj, "real_part");
209 if (!rp) return; 199 if (!rp) return;
210 if (rp->events_to) 200 if (rp->events_to)
211 rp = rp->events_to; 201 {
202 rp = rp->events_to;
203 }
212 204
213 if (rp->still_in) 205 if (rp->still_in)
214 { 206 {