diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/evas/src/lib/canvas/evas_object_smart_clipped.c | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/evas/src/lib/canvas/evas_object_smart_clipped.c')
-rw-r--r-- | libraries/evas/src/lib/canvas/evas_object_smart_clipped.c | 183 |
1 files changed, 0 insertions, 183 deletions
diff --git a/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c b/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c deleted file mode 100644 index 9b9fa6d..0000000 --- a/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c +++ /dev/null | |||
@@ -1,183 +0,0 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_private.h" | ||
3 | |||
4 | #define CSO_DATA_GET_OR_RETURN(obj, ptr) \ | ||
5 | Evas_Object_Smart_Clipped_Data *ptr = evas_object_smart_data_get(obj); \ | ||
6 | if (!ptr) return; | ||
7 | |||
8 | EAPI void | ||
9 | evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) | ||
10 | { | ||
11 | const Eina_Inlist *lst; | ||
12 | Evas_Object *child; | ||
13 | |||
14 | if ((dx == 0) && (dy == 0)) | ||
15 | return; | ||
16 | |||
17 | lst = evas_object_smart_members_get_direct(obj); | ||
18 | EINA_INLIST_FOREACH(lst, child) | ||
19 | { | ||
20 | Evas_Coord orig_x, orig_y; | ||
21 | |||
22 | // shortcut as we are in evas | ||
23 | // evas_object_geometry_get(child, &orig_x, &orig_y, NULL, NULL); | ||
24 | if (child->delete_me) continue; | ||
25 | if (child->is_static_clip) continue; | ||
26 | orig_x = child->cur.geometry.x; | ||
27 | orig_y = child->cur.geometry.y; | ||
28 | evas_object_move(child, orig_x + dx, orig_y + dy); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | EAPI Evas_Object * | ||
33 | evas_object_smart_clipped_clipper_get(Evas_Object *obj) | ||
34 | { | ||
35 | Evas_Object_Smart_Clipped_Data *cso = evas_object_smart_data_get(obj); | ||
36 | if (!cso) | ||
37 | return NULL; | ||
38 | |||
39 | return cso->clipper; | ||
40 | } | ||
41 | |||
42 | static void | ||
43 | evas_object_smart_clipped_smart_add(Evas_Object *obj) | ||
44 | { | ||
45 | Evas_Object_Smart_Clipped_Data *cso; | ||
46 | Evas_Object *clipper; | ||
47 | |||
48 | cso = evas_object_smart_data_get(obj); | ||
49 | if (!cso) | ||
50 | cso = calloc(1, sizeof(*cso)); /* users can provide it or realloc() later */ | ||
51 | |||
52 | cso->evas = evas_object_evas_get(obj); | ||
53 | clipper = evas_object_rectangle_add(cso->evas); | ||
54 | evas_object_static_clip_set(clipper, 1); | ||
55 | cso->clipper = NULL; | ||
56 | evas_object_smart_member_add(clipper, obj); | ||
57 | cso->clipper = clipper; | ||
58 | evas_object_color_set(cso->clipper, 255, 255, 255, 255); | ||
59 | evas_object_move(cso->clipper, -100000, -100000); | ||
60 | evas_object_resize(cso->clipper, 200000, 200000); | ||
61 | evas_object_pass_events_set(cso->clipper, 1); | ||
62 | evas_object_hide(cso->clipper); /* show when have something clipped to it */ | ||
63 | |||
64 | evas_object_smart_data_set(obj, cso); | ||
65 | } | ||
66 | |||
67 | static void | ||
68 | evas_object_smart_clipped_smart_del(Evas_Object *obj) | ||
69 | { | ||
70 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
71 | |||
72 | if (cso->clipper) | ||
73 | { | ||
74 | Evas_Object *clipper = cso->clipper; | ||
75 | cso->clipper = NULL; | ||
76 | evas_object_del(clipper); | ||
77 | } | ||
78 | |||
79 | _evas_object_smart_members_all_del(obj); | ||
80 | |||
81 | free(cso); | ||
82 | evas_object_smart_data_set(obj, NULL); | ||
83 | } | ||
84 | |||
85 | static void | ||
86 | evas_object_smart_clipped_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | ||
87 | { | ||
88 | Evas_Coord orig_x, orig_y; | ||
89 | |||
90 | evas_object_geometry_get(obj, &orig_x, &orig_y, NULL, NULL); | ||
91 | evas_object_smart_move_children_relative(obj, x - orig_x, y - orig_y); | ||
92 | } | ||
93 | |||
94 | static void | ||
95 | evas_object_smart_clipped_smart_show(Evas_Object *obj) | ||
96 | { | ||
97 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
98 | if (evas_object_clipees_get(cso->clipper)) | ||
99 | evas_object_show(cso->clipper); /* just show if clipper being used */ | ||
100 | } | ||
101 | |||
102 | static void | ||
103 | evas_object_smart_clipped_smart_hide(Evas_Object *obj) | ||
104 | { | ||
105 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
106 | evas_object_hide(cso->clipper); | ||
107 | } | ||
108 | |||
109 | static void | ||
110 | evas_object_smart_clipped_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) | ||
111 | { | ||
112 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
113 | evas_object_color_set(cso->clipper, r, g, b, a); | ||
114 | } | ||
115 | |||
116 | static void | ||
117 | evas_object_smart_clipped_smart_clip_set(Evas_Object *obj, Evas_Object *clip) | ||
118 | { | ||
119 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
120 | evas_object_clip_set(cso->clipper, clip); | ||
121 | } | ||
122 | |||
123 | static void | ||
124 | evas_object_smart_clipped_smart_clip_unset(Evas_Object *obj) | ||
125 | { | ||
126 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
127 | evas_object_clip_unset(cso->clipper); | ||
128 | } | ||
129 | |||
130 | static void | ||
131 | evas_object_smart_clipped_smart_member_add(Evas_Object *obj, Evas_Object *member) | ||
132 | { | ||
133 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
134 | if (!cso->clipper) | ||
135 | return; | ||
136 | evas_object_clip_set(member, cso->clipper); | ||
137 | if (evas_object_visible_get(obj)) | ||
138 | evas_object_show(cso->clipper); | ||
139 | } | ||
140 | |||
141 | static void | ||
142 | evas_object_smart_clipped_smart_member_del(Evas_Object *obj, Evas_Object *member) | ||
143 | { | ||
144 | CSO_DATA_GET_OR_RETURN(obj, cso); | ||
145 | if (!cso->clipper) | ||
146 | return; | ||
147 | evas_object_clip_unset(member); | ||
148 | if (!evas_object_clipees_get(cso->clipper)) | ||
149 | evas_object_hide(cso->clipper); | ||
150 | } | ||
151 | |||
152 | EAPI void | ||
153 | evas_object_smart_clipped_smart_set(Evas_Smart_Class *sc) | ||
154 | { | ||
155 | if (!sc) | ||
156 | return; | ||
157 | |||
158 | sc->add = evas_object_smart_clipped_smart_add; | ||
159 | sc->del = evas_object_smart_clipped_smart_del; | ||
160 | sc->move = evas_object_smart_clipped_smart_move; | ||
161 | sc->show = evas_object_smart_clipped_smart_show; | ||
162 | sc->hide = evas_object_smart_clipped_smart_hide; | ||
163 | sc->color_set = evas_object_smart_clipped_smart_color_set; | ||
164 | sc->clip_set = evas_object_smart_clipped_smart_clip_set; | ||
165 | sc->clip_unset = evas_object_smart_clipped_smart_clip_unset; | ||
166 | sc->calculate = NULL; | ||
167 | sc->member_add = evas_object_smart_clipped_smart_member_add; | ||
168 | sc->member_del = evas_object_smart_clipped_smart_member_del; | ||
169 | } | ||
170 | |||
171 | EAPI const Evas_Smart_Class * | ||
172 | evas_object_smart_clipped_class_get(void) | ||
173 | { | ||
174 | static Evas_Smart_Class _sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("EvasObjectSmartClipped"); | ||
175 | static const Evas_Smart_Class *class = NULL; | ||
176 | |||
177 | if (class) | ||
178 | return class; | ||
179 | |||
180 | evas_object_smart_clipped_smart_set(&_sc); | ||
181 | class = &_sc; | ||
182 | return class; | ||
183 | } | ||