summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-05-28 17:41:49 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-05-28 17:41:49 +0900
commit6a286e94784d68ec2856ab1e2d5aaaafbc6cca02 (patch)
treec86049ba1ad890c22412a868b8298468aaebbf7f
parent0638a71cd23dc284b4cfc247c87e8fc0268d3311 (diff)
clipper: removed.
we've discussed and concluded it's unncessary.
-rw-r--r--src/lib/Elementary.h.in1
-rw-r--r--src/lib/Makefile.am7
-rw-r--r--src/lib/elm_clipper.c229
-rw-r--r--src/lib/elm_clipper.eo48
-rw-r--r--src/lib/elm_clipper.h41
-rw-r--r--src/lib/elm_clipper_eo.h11
-rw-r--r--src/lib/elm_clipper_legacy.h12
7 files changed, 0 insertions, 349 deletions
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 87d904595..cd17bbfd3 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -195,7 +195,6 @@ EAPI extern Elm_Version *elm_version;
195#include <elm_cache.h> 195#include <elm_cache.h>
196#include <elm_calendar.h> 196#include <elm_calendar.h>
197#include <elm_check.h> 197#include <elm_check.h>
198#include <elm_clipper.h>
199#include <elm_clock.h> 198#include <elm_clock.h>
200#include <elm_cnp.h> 199#include <elm_cnp.h>
201#include <elm_colorselector.h> 200#include <elm_colorselector.h>
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 2a5243672..de8574987 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -48,7 +48,6 @@ elm_widget_bubble.h \
48elm_widget_button.h \ 48elm_widget_button.h \
49elm_widget_calendar.h \ 49elm_widget_calendar.h \
50elm_widget_check.h \ 50elm_widget_check.h \
51elm_widget_clipper.h \
52elm_widget_clock.h \ 51elm_widget_clock.h \
53elm_widget_colorselector.h \ 52elm_widget_colorselector.h \
54elm_widget_conform.h \ 53elm_widget_conform.h \
@@ -178,9 +177,6 @@ elm_calendar_common.h \
178elm_check.h \ 177elm_check.h \
179elm_check_eo.h \ 178elm_check_eo.h \
180elm_check_legacy.h \ 179elm_check_legacy.h \
181elm_clipper.h \
182elm_clipper_eo.h \
183elm_clipper_legacy.h \
184elm_clock.h \ 180elm_clock.h \
185elm_clock_eo.h \ 181elm_clock_eo.h \
186elm_clock_legacy.h \ 182elm_clock_legacy.h \
@@ -426,7 +422,6 @@ elm_bubble.c \
426elm_button.c \ 422elm_button.c \
427elm_calendar.c \ 423elm_calendar.c \
428elm_check.c \ 424elm_check.c \
429elm_clipper.c \
430elm_clock.c \ 425elm_clock.c \
431elm_cnp.c \ 426elm_cnp.c \
432elm_colorselector.c \ 427elm_colorselector.c \
@@ -548,7 +543,6 @@ elm_bubble.eo \
548elm_button.eo \ 543elm_button.eo \
549elm_calendar.eo \ 544elm_calendar.eo \
550elm_check.eo \ 545elm_check.eo \
551elm_clipper.eo \
552elm_clock.eo \ 546elm_clock.eo \
553elm_colorselector.eo \ 547elm_colorselector.eo \
554elm_conformant.eo \ 548elm_conformant.eo \
@@ -701,7 +695,6 @@ elementaryeolianfiles_DATA = \
701 elm_button.eo \ 695 elm_button.eo \
702 elm_calendar.eo \ 696 elm_calendar.eo \
703 elm_check.eo \ 697 elm_check.eo \
704 elm_clipper.eo \
705 elm_clock.eo \ 698 elm_clock.eo \
706 elm_colorselector.eo \ 699 elm_colorselector.eo \
707 elm_conformant.eo \ 700 elm_conformant.eo \
diff --git a/src/lib/elm_clipper.c b/src/lib/elm_clipper.c
deleted file mode 100644
index 5b869e8d8..000000000
--- a/src/lib/elm_clipper.c
+++ /dev/null
@@ -1,229 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6
7#include <Elementary.h>
8
9#include "elm_priv.h"
10#include "elm_widget_clipper.h"
11#include "elm_widget_container.h"
12
13#define MY_CLASS ELM_CLIPPER_CLASS
14
15#define MY_CLASS_NAME "Elm_Clipper"
16#define MY_CLASS_NAME_LEGACY "elm_clipper"
17
18static void
19_calc_region(Eo *obj)
20{
21 int x, y, w, h;
22 int calx1, caly1, calx2, caly2;
23
24 ELM_CLIPPER_DATA_GET(obj, sd);
25 evas_object_geometry_get(sd->content, &x, &y, &w, &h);
26
27 calx1 = (int)(w * sd->region_x1 + x);
28 caly1 = (int)(h * sd->region_y1 + y);
29
30 if (sd->region_x2 < sd->region_x1) calx2 = 0;
31 else calx2 = (int)(w * (sd->region_x2 - sd->region_x1));
32 if (sd->region_y2 < sd->region_y1) caly2 = 0;
33 else caly2 = (int)(h * (sd->region_y2 - sd->region_y1));
34
35 evas_object_move(sd->clipper, calx1, caly1);
36 evas_object_resize(sd->clipper, calx2, caly2);
37}
38
39EOLIAN static void
40_elm_clipper_clip_set(Eo *obj, Elm_Clipper_Data *sd, Evas_Object *clip)
41{
42 if (sd->clipper != clip)
43 {
44 if (sd->clipper)
45 {
46 elm_widget_sub_object_del(obj, sd->clipper);
47 if (sd->content) evas_object_clip_unset(sd->content);
48 sd->clipper = NULL;
49 }
50 if (clip)
51 {
52 elm_widget_sub_object_add(obj, clip);
53 evas_object_smart_member_add(clip, obj);
54 _calc_region(obj);
55 if (sd->content) evas_object_clip_set(sd->content, clip);
56 sd->clipper = clip;
57 }
58 }
59}
60
61EOLIAN static Evas_Object *
62_elm_clipper_clip_get(Eo *obj EINA_UNUSED, Elm_Clipper_Data *sd)
63{
64 return sd->clipper;
65}
66
67#if 0
68EOLIAN static void
69_elm_clipper_region_set(Eo *obj, Elm_Clipper_Data *sd, double x1, double y1, double x2, double y2)
70{
71 if (x2 < x1 || y2 < y1)
72 ERR("Clipper region x2/y2 should be greater than or equal to x1/y1!\n");
73
74 if (sd->region_x1 != x1 || sd->region_y1 != y1 ||
75 sd->region_x2 != x2 || sd->region_y2 != y2)
76 {
77 sd->region_x1 = x1;
78 sd->region_y1 = y1;
79 sd->region_x2 = x2;
80 sd->region_y2 = y2;
81 _calc_region(obj);
82 }
83}
84
85EOLIAN static void
86_elm_clipper_region_get(Eo *obj EINA_UNUSED, Elm_Clipper_Data *sd, double *x1, double *y1, double *x2, double *y2)
87{
88 if (x1) *x1 = sd->region_x1;
89 if (y1) *y1 = sd->region_y1;
90 if (x2) *x2 = sd->region_x2;
91 if (y2) *y2 = sd->region_y2;
92}
93#endif
94
95EOLIAN static Eina_Bool
96_elm_clipper_elm_widget_sub_object_del(Eo *obj, Elm_Clipper_Data *sd, Evas_Object *sobj)
97{
98 Eina_Bool int_ret = EINA_FALSE;
99 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
100 if (!int_ret) return EINA_FALSE;
101 if (sobj == sd->content) evas_object_data_del(sobj, "_elm_leaveme");
102 evas_object_smart_member_del(sobj);
103 return EINA_TRUE;
104}
105
106EOLIAN static void
107_elm_clipper_evas_object_smart_resize(Eo *obj, Elm_Clipper_Data *sd EINA_UNUSED, Evas_Coord w, Evas_Coord h)
108{
109 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
110 if(sd->content) evas_object_resize(sd->content, w, h);
111 _calc_region(obj);
112}
113
114EOLIAN static void
115_elm_clipper_evas_object_smart_move(Eo *obj, Elm_Clipper_Data *sd EINA_UNUSED, Evas_Coord x, Evas_Coord y)
116{
117 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
118 evas_object_move(sd->content, x, y);
119 _calc_region(obj);
120}
121
122EOLIAN static void
123_elm_clipper_evas_object_smart_show(Eo *obj, Elm_Clipper_Data *sd)
124{
125 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
126 if(sd->content) evas_object_show(sd->content);
127 if(sd->clipper) evas_object_show(sd->clipper);
128
129}
130
131EOLIAN static void
132_elm_clipper_evas_object_smart_hide(Eo *obj, Elm_Clipper_Data *sd)
133{
134 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
135 if(sd->content) evas_object_hide(sd->content);
136 if(sd->clipper) evas_object_hide(sd->clipper);
137}
138
139EOLIAN static Eina_Bool
140_elm_clipper_elm_container_content_set(Eo *obj, Elm_Clipper_Data *sd, const char *part, Evas_Object *content)
141{
142 if (part && strcmp(part, "default")) return EINA_FALSE;
143 if (sd->content != content)
144 {
145 if (sd->content)
146 {
147 elm_widget_sub_object_del(obj, sd->content);
148 sd->content = NULL;
149 }
150 if (content)
151 {
152 elm_widget_sub_object_add(content,obj);
153 evas_object_data_set(content, "_elm_leaveme", (void *)1);
154 evas_object_smart_member_add(content, obj);
155 _calc_region(obj);
156 if (sd->clipper) evas_object_clip_set(content, sd->clipper);
157 sd->content = content;
158 }
159 }
160 return EINA_TRUE;
161}
162
163EOLIAN static Evas_Object*
164_elm_clipper_elm_container_content_get(Eo *obj EINA_UNUSED, Elm_Clipper_Data *sd, const char *part)
165{
166 if (part && strcmp(part, "default")) return NULL;
167 return sd->content;
168}
169
170EOLIAN static Evas_Object*
171_elm_clipper_elm_container_content_unset(Eo *obj, Elm_Clipper_Data *sd, const char *part)
172{
173 Evas_Object *content;
174 if (part && strcmp(part, "default")) return NULL;
175 content = sd->content;
176 elm_widget_sub_object_del(obj, sd->content);
177 sd->content = NULL;
178 return content;
179}
180
181EOLIAN static void
182_elm_clipper_evas_object_smart_add(Eo *obj, Elm_Clipper_Data *priv)
183{
184 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
185 elm_widget_sub_object_parent_add(obj);
186 elm_widget_can_focus_set(obj, EINA_FALSE);
187 priv->content = NULL;
188 priv->clipper = NULL;
189 priv->region_x1 = 0;
190 priv->region_y1 = 0;
191 priv->region_x2 = 1;
192 priv->region_y2 = 1;
193}
194
195EOLIAN static void
196_elm_clipper_evas_object_smart_del(Eo *obj, Elm_Clipper_Data *sd)
197{
198 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
199 ELM_SAFE_FREE(sd->content, evas_object_del);
200 ELM_SAFE_FREE(sd->clipper, evas_object_del);
201 sd->content = NULL;
202 sd->clipper = NULL;
203}
204
205
206EAPI Evas_Object *
207elm_clipper_add(Evas_Object *parent)
208{
209 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
210 Evas_Object *obj = eo_add(MY_CLASS, parent);
211 return obj;
212}
213
214EOLIAN static Eo *
215_elm_clipper_eo_base_constructor(Eo *obj, Elm_Clipper_Data *sd EINA_UNUSED)
216{
217 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
218 eo_do(obj, evas_obj_type_set(MY_CLASS_NAME_LEGACY));
219
220 return obj;
221}
222
223static void
224_elm_clipper_class_constructor(Eo_Class *klass)
225{
226 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
227}
228
229#include "elm_clipper.eo.c"
diff --git a/src/lib/elm_clipper.eo b/src/lib/elm_clipper.eo
deleted file mode 100644
index 9be421574..000000000
--- a/src/lib/elm_clipper.eo
+++ /dev/null
@@ -1,48 +0,0 @@
1class Elm.Clipper (Elm.Container)
2{
3 eo_prefix: elm_obj_clipper;
4 methods {
5 @property clip {
6 set {
7 /*@
8 @brief Set the clip(mask) object of the clipper
9
10 Sets the clip(mask) object for clipping
11
12 @note
13 Allow setting only an Evas_Object_Rectangle and an Evas_Object_Image as clip on 1.14
14
15 @since 1.15
16
17 @ingroup Clipper */
18 }
19 get {
20 /*@
21 @brief Get the clip(mask) object of the clipper
22
23 @see elm_clipper_clip_set()
24
25 @since 1.15
26
27 @ingroup Clipper */
28 }
29 values {
30 clip: Evas_Object *;
31 }
32 }
33 }
34 implements {
35 class.constructor;
36 Eo.Base.constructor;
37 Evas.Object_Smart.hide;
38 Evas.Object_Smart.show;
39 Evas.Object_Smart.move;
40 Evas.Object_Smart.add;
41 Evas.Object_Smart.del;
42 Evas.Object_Smart.resize;
43 Elm.Widget.sub_object_del;
44 Elm.Container.content_get;
45 Elm.Container.content_set;
46 Elm.Container.content_unset;
47 }
48}
diff --git a/src/lib/elm_clipper.h b/src/lib/elm_clipper.h
deleted file mode 100644
index fa15cc9f5..000000000
--- a/src/lib/elm_clipper.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/**
2 * @defgroup Clipper Clipper
3 * @ingroup Elementary
4 *
5 * This widget displays a clipped(masked) object.
6 * For this widget, you need one clipper and one content objects.
7 * The content would be clipped out by the clipper.
8 * If clipper is not set, you would see the content without cuts
9 *
10 * The Evas_Object_Rectangle and the Evas_Object_Image object can be a clipper.
11 * A content can have only a clipper even if user set some objects as the clipper.
12 *
13 * This widget can display a clipped object into many shapes according to the clipper.
14 * The shape of the clipped object be decided by pixel's transparency of the clipper object.
15 * If you want to cut out the content into a circle,
16 * the clipper's pixel should have non-zero as alpha value into the circle.
17 * In case of outside of the circle, should have zero as alpha value.
18 *
19 * This widget inherits from @ref elm-container-class,
20 * So you can use are:
21 *
22 * @li @ref elm_object_part_content_set
23 * @li @ref elm_object_part_content_get
24 * @li @ref elm_object_part_content_unset
25 *
26 * Default content parts of the clipper widget that you can use are:
27 * @li @c "default" - The content to be clipped off
28 *
29 * @{
30 */
31
32#ifdef EFL_EO_API_SUPPORT
33#include <elm_clipper_eo.h>
34#endif
35#ifndef EFL_NOLEGACY_API_SUPPORT
36#include <elm_clipper_legacy.h>
37#endif
38
39/**
40 * @}
41 */
diff --git a/src/lib/elm_clipper_eo.h b/src/lib/elm_clipper_eo.h
deleted file mode 100644
index 3b9a71cc0..000000000
--- a/src/lib/elm_clipper_eo.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/**
2 * @ingroup Clipper
3 *
4 * @{
5 */
6
7#include "elm_clipper.eo.h"
8
9/**
10 * @}
11 */
diff --git a/src/lib/elm_clipper_legacy.h b/src/lib/elm_clipper_legacy.h
deleted file mode 100644
index 09725739f..000000000
--- a/src/lib/elm_clipper_legacy.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/**
2 * @brief Add a new clipper object to the parent
3 *
4 * @param parent The parent object
5 * @return The new object or NULL if it cannot be created
6 * @since 1.14
7 *
8 * @ingroup Clipper
9 */
10EAPI Evas_Object *elm_clipper_add(Evas_Object *parent);
11
12#include "elm_clipper.eo.legacy.h"