diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/edje/src/lib | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/edje/src/lib')
-rw-r--r-- | libraries/edje/src/lib/Edje.h | 585 | ||||
-rw-r--r-- | libraries/edje/src/lib/Makefile.in | 2 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_cache.c | 6 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_calc.c | 74 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_data.c | 3 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_entry.c | 462 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_load.c | 29 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_lua2.c | 38 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_main.c | 5 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_multisense.c | 5 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_private.h | 76 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_program.c | 86 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_util.c | 546 |
13 files changed, 1450 insertions, 467 deletions
diff --git a/libraries/edje/src/lib/Edje.h b/libraries/edje/src/lib/Edje.h index 6413014..1449d70 100644 --- a/libraries/edje/src/lib/Edje.h +++ b/libraries/edje/src/lib/Edje.h | |||
@@ -5,7 +5,7 @@ These routines are used for Edje. | |||
5 | 5 | ||
6 | @mainpage Edje Library Documentation | 6 | @mainpage Edje Library Documentation |
7 | @version 1.1 | 7 | @version 1.1 |
8 | @date 2003-2011 | 8 | @date 2003-2012 |
9 | 9 | ||
10 | Please see the @ref authors page for contact details. | 10 | Please see the @ref authors page for contact details. |
11 | 11 | ||
@@ -19,7 +19,7 @@ Please see the @ref authors page for contact details. | |||
19 | 19 | ||
20 | Edje is a complex graphical design & layout library. | 20 | Edje is a complex graphical design & layout library. |
21 | 21 | ||
22 | It doesn't pretend to do containing and regular layout like a widget | 22 | It doesn't intend to do containing and regular layout like a widget |
23 | set, but it is the base for such components. Based on the requirements | 23 | set, but it is the base for such components. Based on the requirements |
24 | of Enlightenment 0.17, Edje should serve all the purposes of creating | 24 | of Enlightenment 0.17, Edje should serve all the purposes of creating |
25 | visual elements (borders of windows, buttons, scrollbars, etc.) and | 25 | visual elements (borders of windows, buttons, scrollbars, etc.) and |
@@ -110,197 +110,11 @@ The application using Edje will then create an object in its Evas | |||
110 | canvas and set the bundle file to use, specifying the @b group name to | 110 | canvas and set the bundle file to use, specifying the @b group name to |
111 | use. Edje will load such information and create all the required | 111 | use. Edje will load such information and create all the required |
112 | children objects with the specified properties as defined in each @b | 112 | children objects with the specified properties as defined in each @b |
113 | part of the given group. See the following annotated example: | 113 | part of the given group. See the following example: |
114 | @include edje_example.c | ||
114 | 115 | ||
115 | @code | 116 | The above example requires the following annotated source Edje file: |
116 | 117 | @include edje_example.edc | |
117 | #include <Eina.h> | ||
118 | #include <Evas.h> | ||
119 | #include <Ecore.h> | ||
120 | #include <Ecore_Evas.h> | ||
121 | #include <Edje.h> | ||
122 | |||
123 | #define WIDTH 320 | ||
124 | #define HEIGHT 240 | ||
125 | |||
126 | static Evas_Object *create_my_group(Evas *canvas, const char *text) | ||
127 | { | ||
128 | Evas_Object *edje; | ||
129 | |||
130 | edje = edje_object_add(canvas); | ||
131 | if (!edje) | ||
132 | { | ||
133 | EINA_LOG_CRIT("could not create edje object!"); | ||
134 | return NULL; | ||
135 | } | ||
136 | |||
137 | if (!edje_object_file_set(edje, "edje_example.edj", "my_group")) | ||
138 | { | ||
139 | int err = edje_object_load_error_get(edje); | ||
140 | const char *errmsg = edje_load_error_str(err); | ||
141 | EINA_LOG_ERR("could not load 'my_group' from edje_example.edj: %s", | ||
142 | errmsg); | ||
143 | |||
144 | evas_object_del(edje); | ||
145 | return NULL; | ||
146 | } | ||
147 | |||
148 | if (text) | ||
149 | { | ||
150 | if (!edje_object_part_text_set(edje, "text", text)) | ||
151 | { | ||
152 | EINA_LOG_WARN("could not set the text. " | ||
153 | "Maybe part 'text' does not exist?"); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | evas_object_move(edje, 0, 0); | ||
158 | evas_object_resize(edje, WIDTH, HEIGHT); | ||
159 | evas_object_show(edje); | ||
160 | return edje; | ||
161 | } | ||
162 | |||
163 | int main(int argc, char *argv[]) | ||
164 | { | ||
165 | Ecore_Evas *window; | ||
166 | Evas *canvas; | ||
167 | Evas_Object *edje; | ||
168 | const char *text; | ||
169 | |||
170 | eina_init(); | ||
171 | evas_init(); | ||
172 | ecore_init(); | ||
173 | ecore_evas_init(); | ||
174 | edje_init(); | ||
175 | |||
176 | window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
177 | if (!window) | ||
178 | { | ||
179 | EINA_LOG_CRIT("could not create window."); | ||
180 | return -1; | ||
181 | } | ||
182 | canvas = ecore_evas_get(window); | ||
183 | |||
184 | text = (argc > 1) ? argv[1] : NULL; | ||
185 | |||
186 | edje = create_my_group(canvas, text); | ||
187 | if (!edje) | ||
188 | return -2; | ||
189 | |||
190 | ecore_evas_show(window); | ||
191 | ecore_main_loop_begin(); | ||
192 | |||
193 | evas_object_del(edje); | ||
194 | ecore_evas_free(window); | ||
195 | |||
196 | return 0; | ||
197 | } | ||
198 | @endcode | ||
199 | |||
200 | It requires the following source Edje file: | ||
201 | @code | ||
202 | // compile: edje_cc edje_example.edc | ||
203 | collections { | ||
204 | group { | ||
205 | name: "my_group"; // must be the same as in edje_example.c | ||
206 | |||
207 | parts { | ||
208 | part { | ||
209 | name: "background"; | ||
210 | type: RECT; // plain boring rectangle | ||
211 | mouse_events: 0; // we don't need any mouse event on the background | ||
212 | |||
213 | // just one state "default" | ||
214 | description { | ||
215 | state: "default" 0.0; // must always exist | ||
216 | color: 255 255 255 255; // white | ||
217 | |||
218 | // define part coordinates: | ||
219 | |||
220 | rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0] | ||
221 | relative: 0.0 0.0; | ||
222 | offset: 0 0; | ||
223 | } | ||
224 | rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1) | ||
225 | relative: 1.0 1.0; | ||
226 | offset: -1 -1; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | part { | ||
232 | name: "text"; | ||
233 | type: TEXT; | ||
234 | mouse_events: 1; // we want to change the color on mouse-over | ||
235 | |||
236 | // 2 states, one "default" and another "over" to be used | ||
237 | // on mouse over effect | ||
238 | |||
239 | description { | ||
240 | state: "default" 0.0; | ||
241 | color: 255 0 0 255; // red | ||
242 | |||
243 | // define part coordinates: | ||
244 | |||
245 | rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10) | ||
246 | relative: 0.1 0.2; | ||
247 | offset: 5 10; | ||
248 | } | ||
249 | rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11) | ||
250 | relative: 0.9 0.8; | ||
251 | offset: -6 -11; | ||
252 | } | ||
253 | |||
254 | // define text specific state details | ||
255 | text { | ||
256 | font: "Sans"; // using fontconfig name! | ||
257 | size: 10; | ||
258 | text: "hello world"; | ||
259 | } | ||
260 | } | ||
261 | |||
262 | description { | ||
263 | state: "over" 0.0; | ||
264 | inherit: "default" 0.0; // copy everything from "default" at this point | ||
265 | |||
266 | color: 0 255 0 255; // override color, now it is green | ||
267 | } | ||
268 | } | ||
269 | |||
270 | // do programs to change color on text mouse in/out (over) | ||
271 | programs { | ||
272 | program { | ||
273 | // what triggers this program: | ||
274 | signal: "mouse,in"; | ||
275 | source: "text"; | ||
276 | |||
277 | // what this program does: | ||
278 | action: STATE_SET "over" 0.0; | ||
279 | target: "text"; | ||
280 | |||
281 | // do the state-set in a nice interpolation animation | ||
282 | // using linear time in 0.1 second | ||
283 | transition: LINEAR 0.1; | ||
284 | } | ||
285 | |||
286 | program { | ||
287 | // what triggers this program: | ||
288 | signal: "mouse,out"; | ||
289 | source: "text"; | ||
290 | |||
291 | // what this program does: | ||
292 | action: STATE_SET "default" 0.0; | ||
293 | target: "text"; | ||
294 | |||
295 | // do the state-set in a nice interpolation animation | ||
296 | // using linear time in 0.1 second | ||
297 | transition: LINEAR 0.1; | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | @endcode | ||
304 | 118 | ||
305 | 119 | ||
306 | One should save these files as edje_example.c and edje_example.edc then: | 120 | One should save these files as edje_example.c and edje_example.edc then: |
@@ -452,6 +266,10 @@ param in edje programs | |||
452 | # undef EAPI | 266 | # undef EAPI |
453 | #endif | 267 | #endif |
454 | 268 | ||
269 | #ifdef HAVE_ECORE_IMF | ||
270 | #include <Ecore_IMF.h> | ||
271 | #endif | ||
272 | |||
455 | #ifdef _WIN32 | 273 | #ifdef _WIN32 |
456 | # ifdef EFL_EDJE_BUILD | 274 | # ifdef EFL_EDJE_BUILD |
457 | # ifdef DLL_EXPORT | 275 | # ifdef DLL_EXPORT |
@@ -778,7 +596,7 @@ typedef enum _Edje_External_Param_Type | |||
778 | { | 596 | { |
779 | EDJE_EXTERNAL_PARAM_TYPE_INT, /**< Parameter value is an integer. */ | 597 | EDJE_EXTERNAL_PARAM_TYPE_INT, /**< Parameter value is an integer. */ |
780 | EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, /**< Parameter value is a double. */ | 598 | EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, /**< Parameter value is a double. */ |
781 | EDJE_EXTERNAL_PARAM_TYPE_STRING, /**< Paramater value is a string. */ | 599 | EDJE_EXTERNAL_PARAM_TYPE_STRING, /**< Parameter value is a string. */ |
782 | EDJE_EXTERNAL_PARAM_TYPE_BOOL, /**< Parameter value is boolean. */ | 600 | EDJE_EXTERNAL_PARAM_TYPE_BOOL, /**< Parameter value is boolean. */ |
783 | EDJE_EXTERNAL_PARAM_TYPE_CHOICE, /**< Parameter value is one of a set of | 601 | EDJE_EXTERNAL_PARAM_TYPE_CHOICE, /**< Parameter value is one of a set of |
784 | predefined string choices. */ | 602 | predefined string choices. */ |
@@ -791,10 +609,10 @@ typedef enum _Edje_External_Param_Type | |||
791 | */ | 609 | */ |
792 | typedef enum _Edje_External_Param_Flags | 610 | typedef enum _Edje_External_Param_Flags |
793 | { | 611 | { |
794 | EDJE_EXTERNAL_PARAM_FLAGS_NONE = 0, /**< Propery is incapable of operations, this is used to catch bogus flags. */ | 612 | EDJE_EXTERNAL_PARAM_FLAGS_NONE = 0, /**< Property is incapable of operations, this is used to catch bogus flags. */ |
795 | EDJE_EXTERNAL_PARAM_FLAGS_GET = (1 << 0), /**< Property can be read/get. */ | 613 | EDJE_EXTERNAL_PARAM_FLAGS_GET = (1 << 0), /**< Property can be read/get. */ |
796 | EDJE_EXTERNAL_PARAM_FLAGS_SET = (1 << 1), /**< Property can be written/set. This only enables edje_object_part_external_param_set() and Embryo scripts. To enable the parameter being set from state description whenever it changes state, use #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ | 614 | EDJE_EXTERNAL_PARAM_FLAGS_SET = (1 << 1), /**< Property can be written/set. This only enables edje_object_part_external_param_set() and Embryo scripts. To enable the parameter being set from state description whenever it changes state, use #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ |
797 | EDJE_EXTERNAL_PARAM_FLAGS_STATE = (1 << 2), /**< Property can be set from state dsecription. */ | 615 | EDJE_EXTERNAL_PARAM_FLAGS_STATE = (1 << 2), /**< Property can be set from state description. */ |
798 | EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR = (1 << 3), /**< This property is only set once when the object is constructed using its value from "default" 0.0 state description. Setting this overrides #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ | 616 | EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR = (1 << 3), /**< This property is only set once when the object is constructed using its value from "default" 0.0 state description. Setting this overrides #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ |
799 | EDJE_EXTERNAL_PARAM_FLAGS_REGULAR = (EDJE_EXTERNAL_PARAM_FLAGS_GET | | 617 | EDJE_EXTERNAL_PARAM_FLAGS_REGULAR = (EDJE_EXTERNAL_PARAM_FLAGS_GET | |
800 | EDJE_EXTERNAL_PARAM_FLAGS_SET | | 618 | EDJE_EXTERNAL_PARAM_FLAGS_SET | |
@@ -817,6 +635,24 @@ typedef enum _Edje_Input_Panel_Layout | |||
817 | EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ | 635 | EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ |
818 | } Edje_Input_Panel_Layout; | 636 | } Edje_Input_Panel_Layout; |
819 | 637 | ||
638 | typedef enum _Edje_Input_Panel_Lang | ||
639 | { | ||
640 | EDJE_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic @since 1.2 */ | ||
641 | EDJE_INPUT_PANEL_LANG_ALPHABET /**< Alphabet @since 1.2 */ | ||
642 | } Edje_Input_Panel_Lang; | ||
643 | |||
644 | typedef enum _Edje_Input_Panel_Return_Key_Type | ||
645 | { | ||
646 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */ | ||
647 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done @since 1.2 */ | ||
648 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go @since 1.2 */ | ||
649 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join @since 1.2 */ | ||
650 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login @since 1.2 */ | ||
651 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next @since 1.2 */ | ||
652 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search or magnifier icon @since 1.2 */ | ||
653 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_SEND /**< Send @since 1.2 */ | ||
654 | } Edje_Input_Panel_Return_Key_Type; | ||
655 | |||
820 | /** | 656 | /** |
821 | * @brief Converts type identifier to string nicer representation. | 657 | * @brief Converts type identifier to string nicer representation. |
822 | * | 658 | * |
@@ -886,18 +722,18 @@ struct _Edje_External_Param_Info | |||
886 | used. */ | 722 | used. */ |
887 | union { | 723 | union { |
888 | struct { | 724 | struct { |
889 | int def, /**< Default value for the paramter. */ | 725 | int def, /**< Default value for the parameter. */ |
890 | min, /**< Minimum value it can have. */ | 726 | min, /**< Minimum value it can have. */ |
891 | max, /**< Maximum value it can have. */ | 727 | max, /**< Maximum value it can have. */ |
892 | step; /**< Values will be a multiple of this. */ | 728 | step; /**< Values will be a multiple of this. */ |
893 | } i; /**< Info about integer type parametrs. Use #EDJE_EXTERNAL_INT_UNSET | 729 | } i; /**< Info about integer type parameters. Use #EDJE_EXTERNAL_INT_UNSET |
894 | on any of them to indicate they are not defined.*/ | 730 | on any of them to indicate they are not defined.*/ |
895 | struct { | 731 | struct { |
896 | double def, /**< Default value for the paramter. */ | 732 | double def, /**< Default value for the parameter. */ |
897 | min, /**< Minimum value it can have. */ | 733 | min, /**< Minimum value it can have. */ |
898 | max, /**< Maximum value it can have. */ | 734 | max, /**< Maximum value it can have. */ |
899 | step; /**< Values will be a multiple of this. */ | 735 | step; /**< Values will be a multiple of this. */ |
900 | } d; /**< Info about double type parametrs. Use | 736 | } d; /**< Info about double type parameters. Use |
901 | #EDJE_EXTERNAL_DOUBLE_UNSET on any of them to indicate they are not defined.*/ | 737 | #EDJE_EXTERNAL_DOUBLE_UNSET on any of them to indicate they are not defined.*/ |
902 | struct { | 738 | struct { |
903 | const char *def; /**< Default value. */ | 739 | const char *def; /**< Default value. */ |
@@ -1054,6 +890,7 @@ typedef void (*Edje_Signal_Cb) (void *data, Evas_Object *obj, c | |||
1054 | typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part); | 890 | typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part); |
1055 | typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg); /**< Edje message handler callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the message comes from. @c type will identify the type of the given message and @c msg will be a pointer the message's contents, de facto, which depend on @c type. */ | 891 | typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg); /**< Edje message handler callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the message comes from. @c type will identify the type of the given message and @c msg will be a pointer the message's contents, de facto, which depend on @c type. */ |
1056 | typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text); | 892 | typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text); |
893 | typedef void (*Edje_Markup_Filter_Cb) (void *data, Evas_Object *obj, const char *part, char **text); | ||
1057 | typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item); | 894 | typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item); |
1058 | 895 | ||
1059 | /** | 896 | /** |
@@ -1187,7 +1024,7 @@ EAPI const char *edje_fontset_append_get (void); | |||
1187 | * edje_object_scale_set(), that factor will @b override the global | 1024 | * edje_object_scale_set(), that factor will @b override the global |
1188 | * one. | 1025 | * one. |
1189 | * | 1026 | * |
1190 | * Scaling affects the values of mininum/maximum @b part sizes, which | 1027 | * Scaling affects the values of minimum/maximum @b part sizes, which |
1191 | * are @b multiplied by it. Font sizes are scaled, too. | 1028 | * are @b multiplied by it. Font sizes are scaled, too. |
1192 | * | 1029 | * |
1193 | * @warning Only parts which, at EDC level, had the @c "scale" | 1030 | * @warning Only parts which, at EDC level, had the @c "scale" |
@@ -1244,7 +1081,7 @@ EAPI void edje_password_show_last_timeout_set(double password_show_last_timeout) | |||
1244 | * | 1081 | * |
1245 | * @param obj A handle to an Edje object | 1082 | * @param obj A handle to an Edje object |
1246 | * @param scale The scaling factor (the default value is @c 0.0, | 1083 | * @param scale The scaling factor (the default value is @c 0.0, |
1247 | * meaning indivinual scaling @b not set) | 1084 | * meaning individual scaling @b not set) |
1248 | * | 1085 | * |
1249 | * This function sets an @b individual scaling factor on the @a obj | 1086 | * This function sets an @b individual scaling factor on the @a obj |
1250 | * Edje object. This property (or Edje's global scaling factor, when | 1087 | * Edje object. This property (or Edje's global scaling factor, when |
@@ -1663,9 +1500,9 @@ EAPI void edje_box_layout_register (const char *name, Evas_Object | |||
1663 | * | 1500 | * |
1664 | * @note You can get a callback every time edje re-calculates the object | 1501 | * @note You can get a callback every time edje re-calculates the object |
1665 | * (either due to animation or some kind of signal or input). This is called | 1502 | * (either due to animation or some kind of signal or input). This is called |
1666 | * in-line just after the recalculation has occured. It is a good idea not | 1503 | * in-line just after the recalculation has occurred. It is a good idea not |
1667 | * to go and delete or alter the object inside this callbacks, simply make | 1504 | * to go and delete or alter the object inside this callbacks, simply make |
1668 | * a note that the recalculation has taken place and then do somethnig about | 1505 | * a note that the recalculation has taken place and then do something about |
1669 | * it outside the callback. to register a callback use code like: | 1506 | * it outside the callback. to register a callback use code like: |
1670 | * | 1507 | * |
1671 | * @code | 1508 | * @code |
@@ -1883,7 +1720,7 @@ EAPI Eina_Bool edje_object_preload (Evas_Object *obj, Eina_Bool c | |||
1883 | * buttons on an interface, you'd be registering for notifications on | 1720 | * buttons on an interface, you'd be registering for notifications on |
1884 | * events of mouse buttons being pressed down on either of those parts | 1721 | * events of mouse buttons being pressed down on either of those parts |
1885 | * (those events all have the @c "mouse,down," common prefix on their | 1722 | * (those events all have the @c "mouse,down," common prefix on their |
1886 | * names, with a suffix giving the button number). The actual emisson | 1723 | * names, with a suffix giving the button number). The actual emission |
1887 | * and source strings of an event will be passed in as the @a emission | 1724 | * and source strings of an event will be passed in as the @a emission |
1888 | * and @a source parameters of the callback function (e.g. @c | 1725 | * and @a source parameters of the callback function (e.g. @c |
1889 | * "mouse,down,2" and @c "button.close"), for each of those events. | 1726 | * "mouse,down,2" and @c "button.close"), for each of those events. |
@@ -2214,6 +2051,27 @@ EAPI Eina_Bool edje_object_text_class_set (Evas_Object *obj, const c | |||
2214 | EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh); | 2051 | EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh); |
2215 | 2052 | ||
2216 | /** | 2053 | /** |
2054 | * @brief Edje will automatically update the size hints on itself. | ||
2055 | * | ||
2056 | * @param obj A handle to an Edje object. | ||
2057 | * @param update Wether or not update the size hints. | ||
2058 | * | ||
2059 | * By default edje doesn't set size hints on itself. With this function | ||
2060 | * call, it will do so if update is true. Be carefully, it cost a lot to | ||
2061 | * trigger this feature as it will recalc the object every time it make | ||
2062 | * sense to be sure that's its minimal size hint is always accurate. | ||
2063 | */ | ||
2064 | EAPI void edje_object_update_hints_set(Evas_Object *obj, Eina_Bool update); | ||
2065 | |||
2066 | /** | ||
2067 | * @brief Wether or not Edje will update size hints on itself. | ||
2068 | * | ||
2069 | * @param obj A handle to an Edje object. | ||
2070 | * @return @c true if does, @c false if it doesn't. | ||
2071 | */ | ||
2072 | EAPI Eina_Bool edje_object_update_hints_get(Evas_Object *obj); | ||
2073 | |||
2074 | /** | ||
2217 | * @brief Get the maximum size specified -- as an EDC property -- for a | 2075 | * @brief Get the maximum size specified -- as an EDC property -- for a |
2218 | * given Edje object | 2076 | * given Edje object |
2219 | * | 2077 | * |
@@ -2362,12 +2220,12 @@ EAPI Eina_Bool edje_object_part_exists (const Evas_Object *obj, c | |||
2362 | * @return A pointer to the Evas object implementing the given part, | 2220 | * @return A pointer to the Evas object implementing the given part, |
2363 | * or @c NULL on failure (e.g. the given part doesn't exist) | 2221 | * or @c NULL on failure (e.g. the given part doesn't exist) |
2364 | * | 2222 | * |
2365 | * This function gets a pointer the Evas object corresponding to a | 2223 | * This function gets a pointer of the Evas object corresponding to a |
2366 | * given part in the @p obj object's group. | 2224 | * given part in the @p obj object's group. |
2367 | * | 2225 | * |
2368 | * You should @b never modify the state of the returned object (with | 2226 | * You should @b never modify the state of the returned object (with |
2369 | * @c evas_object_move() or @c evas_object_hide() for example), | 2227 | * @c evas_object_move() or @c evas_object_hide() for example), |
2370 | * because it's meant to be managed be Edje, solely. You are safe to | 2228 | * because it's meant to be managed by Edje, solely. You are safe to |
2371 | * query information about its current state (with @c | 2229 | * query information about its current state (with @c |
2372 | * evas_object_visible_get() or @c evas_object_color_get() for | 2230 | * evas_object_visible_get() or @c evas_object_color_get() for |
2373 | * example), though. | 2231 | * example), though. |
@@ -2448,6 +2306,43 @@ EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const c | |||
2448 | EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part); | 2306 | EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part); |
2449 | 2307 | ||
2450 | /** | 2308 | /** |
2309 | * @brief Set the style of the | ||
2310 | * | ||
2311 | * @param obj A valid Evas_Object handle | ||
2312 | * @param part The part name | ||
2313 | * @param style The style to set (textblock conventions). | ||
2314 | * | ||
2315 | * This function sets the style associated with the textblock part. | ||
2316 | * | ||
2317 | * @since 1.2.0 | ||
2318 | */ | ||
2319 | EAPI void edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, const char *style); | ||
2320 | |||
2321 | /** | ||
2322 | * @brief Return the text of the object part. | ||
2323 | * | ||
2324 | * @param obj A valid Evas_Object handle | ||
2325 | * @param part The part name | ||
2326 | * | ||
2327 | * @return The text string | ||
2328 | * | ||
2329 | * This function returns the style associated with the textblock part. | ||
2330 | * | ||
2331 | * @since 1.2.0 | ||
2332 | */ | ||
2333 | EAPI const char *edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part); | ||
2334 | |||
2335 | /** | ||
2336 | * @brief Delete the top style form the user style stack. | ||
2337 | * | ||
2338 | * @param obj A valid Evas_Object handle | ||
2339 | * @param part The part name | ||
2340 | * | ||
2341 | * @since 1.2.0 | ||
2342 | */ | ||
2343 | EAPI void edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part); | ||
2344 | |||
2345 | /** | ||
2451 | * @brief Sets the raw (non escaped) text for an object part. | 2346 | * @brief Sets the raw (non escaped) text for an object part. |
2452 | * | 2347 | * |
2453 | * @param obj A valid Evas Object handle | 2348 | * @param obj A valid Evas Object handle |
@@ -2615,6 +2510,15 @@ EAPI Eina_Bool edje_object_part_text_item_geometry_get (const Evas_ | |||
2615 | EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); | 2510 | EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); |
2616 | 2511 | ||
2617 | /** | 2512 | /** |
2513 | * @brief Deletes the selection and emits a change event. | ||
2514 | * | ||
2515 | * @param obj A valid Evas_Object handle | ||
2516 | * @param part The part name | ||
2517 | * @since 1.2.0 | ||
2518 | */ | ||
2519 | EAPI void edje_object_part_text_user_insert (const Evas_Object *obj, const char *part, const char *text); | ||
2520 | |||
2521 | /** | ||
2618 | * @brief Enables selection if the entry is an EXPLICIT selection mode | 2522 | * @brief Enables selection if the entry is an EXPLICIT selection mode |
2619 | * type. | 2523 | * type. |
2620 | * | 2524 | * |
@@ -2813,8 +2717,33 @@ EAPI void edje_object_part_text_cursor_pos_set (Evas_Ob | |||
2813 | EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); | 2717 | EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); |
2814 | 2718 | ||
2815 | /** | 2719 | /** |
2720 | * @brief Reset the input method context if needed. | ||
2721 | * | ||
2722 | * This can be necessary in the case where modifying the buffer would confuse on-going input method behavior | ||
2723 | * | ||
2724 | * @param obj A valid Evas_Object handle | ||
2725 | * @param part The part name | ||
2726 | * @since 1.2.0 | ||
2727 | */ | ||
2728 | EAPI void edje_object_part_text_imf_context_reset (const Evas_Object *obj, const char *part); | ||
2729 | |||
2730 | /** | ||
2731 | * @brief Get the input method context in entry. | ||
2732 | * | ||
2733 | * If ecore_imf was not available when edje was compiled, this function returns NULL | ||
2734 | * otherwise, the returned pointer is an Ecore_IMF * | ||
2735 | * | ||
2736 | * @param obj A valid Evas_Object handle | ||
2737 | * @param part The part name | ||
2738 | * | ||
2739 | * @return The input method context (Ecore_IMF_Context *) in entry | ||
2740 | * @since 1.2.0 | ||
2741 | */ | ||
2742 | EAPI void *edje_object_part_text_imf_context_get (const Evas_Object *obj, const char *part); | ||
2743 | |||
2744 | /** | ||
2816 | * @brief Set the layout of the input panel. | 2745 | * @brief Set the layout of the input panel. |
2817 | * | 2746 | * |
2818 | * The layout of the input panel or virtual keyboard can make it easier or | 2747 | * The layout of the input panel or virtual keyboard can make it easier or |
2819 | * harder to enter content. This allows you to hint what kind of input you | 2748 | * harder to enter content. This allows you to hint what kind of input you |
2820 | * are expecting to enter and thus have the input panel automatically | 2749 | * are expecting to enter and thus have the input panel automatically |
@@ -2825,7 +2754,7 @@ EAPI int edje_object_part_text_cursor_pos_get (const E | |||
2825 | * @param layout layout type | 2754 | * @param layout layout type |
2826 | * @since 1.1 | 2755 | * @since 1.1 |
2827 | */ | 2756 | */ |
2828 | EAPI void edje_object_part_text_input_panel_layout_set (const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout); | 2757 | EAPI void edje_object_part_text_input_panel_layout_set (Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout); |
2829 | 2758 | ||
2830 | /** | 2759 | /** |
2831 | * @brief Get the layout of the input panel. | 2760 | * @brief Get the layout of the input panel. |
@@ -2848,7 +2777,7 @@ EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const | |||
2848 | * @param autocapital_type The type of autocapitalization | 2777 | * @param autocapital_type The type of autocapitalization |
2849 | * @since 1.1.0 | 2778 | * @since 1.1.0 |
2850 | */ | 2779 | */ |
2851 | EAPI void edje_object_part_text_autocapital_type_set (const Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type); | 2780 | EAPI void edje_object_part_text_autocapital_type_set (Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type); |
2852 | 2781 | ||
2853 | /** | 2782 | /** |
2854 | * @brief Retrieves the autocapitalization type | 2783 | * @brief Retrieves the autocapitalization type |
@@ -2861,6 +2790,26 @@ EAPI void edje_object_part_text_autocapital_type_set (const Evas_ | |||
2861 | EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part); | 2790 | EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part); |
2862 | 2791 | ||
2863 | /** | 2792 | /** |
2793 | * @brief Set whether the prediction is allowed or not. | ||
2794 | * | ||
2795 | * @param obj A valid Evas_Object handle | ||
2796 | * @param part The part name | ||
2797 | * @param prediction If true, the prediction feature is allowed. | ||
2798 | * @since 1.2.0 | ||
2799 | */ | ||
2800 | EAPI void edje_object_part_text_prediction_allow_set (Evas_Object *obj, const char *part, Eina_Bool prediction); | ||
2801 | |||
2802 | /** | ||
2803 | * @brief Get whether the prediction is allowed or not. | ||
2804 | * | ||
2805 | * @param obj A valid Evas_Object handle | ||
2806 | * @param part The part name | ||
2807 | * @return EINA_TRUE if prediction feature is allowed. | ||
2808 | * @since 1.2.0 | ||
2809 | */ | ||
2810 | EAPI Eina_Bool edje_object_part_text_prediction_allow_get (const Evas_Object *obj, const char *part); | ||
2811 | |||
2812 | /** | ||
2864 | * @brief Sets the attribute to show the input panel automatically. | 2813 | * @brief Sets the attribute to show the input panel automatically. |
2865 | * | 2814 | * |
2866 | * @param obj A valid Evas_Object handle | 2815 | * @param obj A valid Evas_Object handle |
@@ -2868,7 +2817,7 @@ EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (cons | |||
2868 | * @param enabled If true, the input panel is appeared when entry is clicked or has a focus | 2817 | * @param enabled If true, the input panel is appeared when entry is clicked or has a focus |
2869 | * @since 1.1.0 | 2818 | * @since 1.1.0 |
2870 | */ | 2819 | */ |
2871 | EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_Object *obj, const char *part, Eina_Bool enabled); | 2820 | EAPI void edje_object_part_text_input_panel_enabled_set (Evas_Object *obj, const char *part, Eina_Bool enabled); |
2872 | 2821 | ||
2873 | /** | 2822 | /** |
2874 | * @brief Retrieve the attribute to show the input panel automatically. | 2823 | * @brief Retrieve the attribute to show the input panel automatically. |
@@ -2882,6 +2831,125 @@ EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_ | |||
2882 | EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part); | 2831 | EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part); |
2883 | 2832 | ||
2884 | /** | 2833 | /** |
2834 | * @brief Show the input panel (virtual keyboard) based on the input panel property such as layout, autocapital types, and so on. | ||
2835 | * | ||
2836 | * Note that input panel is shown or hidden automatically according to the focus state. | ||
2837 | * This API can be used in the case of manually controlling by using edje_object_part_text_input_panel_enabled_set. | ||
2838 | * | ||
2839 | * @param obj A valid Evas_Object handle | ||
2840 | * @param part The part name | ||
2841 | * @since 1.2.0 | ||
2842 | */ | ||
2843 | EAPI void edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part); | ||
2844 | |||
2845 | /** | ||
2846 | * @brief Hide the input panel (virtual keyboard). | ||
2847 | * @see edje_object_part_text_input_panel_show | ||
2848 | * | ||
2849 | * Note that input panel is shown or hidden automatically according to the focus state. | ||
2850 | * This API can be used in the case of manually controlling by using edje_object_part_text_input_panel_enabled_set. | ||
2851 | * | ||
2852 | * @param obj A valid Evas_Object handle | ||
2853 | * @param part The part name | ||
2854 | * @since 1.2.0 | ||
2855 | */ | ||
2856 | EAPI void edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part); | ||
2857 | |||
2858 | /** | ||
2859 | * Set the language mode of the input panel. | ||
2860 | * | ||
2861 | * This API can be used if you want to show the Alphabet keyboard. | ||
2862 | * | ||
2863 | * @param obj A valid Evas_Object handle | ||
2864 | * @param part The part name | ||
2865 | * @param lang the language to be set to the input panel. | ||
2866 | * @since 1.2.0 | ||
2867 | */ | ||
2868 | EAPI void edje_object_part_text_input_panel_language_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Lang lang); | ||
2869 | |||
2870 | /** | ||
2871 | * Get the language mode of the input panel. | ||
2872 | * | ||
2873 | * See @ref edje_object_part_text_input_panel_language_set for more details. | ||
2874 | * | ||
2875 | * @param obj A valid Evas_Object handle | ||
2876 | * @param part The part name | ||
2877 | * @return input panel language type | ||
2878 | * @since 1.2.0 | ||
2879 | */ | ||
2880 | EAPI Edje_Input_Panel_Lang edje_object_part_text_input_panel_language_get(const Evas_Object *obj, const char *part); | ||
2881 | |||
2882 | /** | ||
2883 | * Set the input panel-specific data to deliver to the input panel. | ||
2884 | * | ||
2885 | * This API is used by applications to deliver specific data to the input panel. | ||
2886 | * The data format MUST be negotiated by both application and the input panel. | ||
2887 | * The size and format of data are defined by the input panel. | ||
2888 | * | ||
2889 | * @param obj A valid Evas_Object handle | ||
2890 | * @param part The part name | ||
2891 | * @param data The specific data to be set to the input panel. | ||
2892 | * @param len the length of data, in bytes, to send to the input panel | ||
2893 | * @since 1.2.0 | ||
2894 | */ | ||
2895 | EAPI void edje_object_part_text_input_panel_imdata_set(Evas_Object *obj, const char *part, const void *data, int len); | ||
2896 | |||
2897 | /** | ||
2898 | * Get the specific data of the current active input panel. | ||
2899 | * | ||
2900 | * @param obj A valid Evas_Object handle | ||
2901 | * @param part The part name | ||
2902 | * @param data The specific data to be got from the input panel | ||
2903 | * @param len The length of data | ||
2904 | * @since 1.2.0 | ||
2905 | */ | ||
2906 | EAPI void edje_object_part_text_input_panel_imdata_get(const Evas_Object *obj, const char *part, void *data, int *len); | ||
2907 | |||
2908 | /** | ||
2909 | * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. | ||
2910 | * | ||
2911 | * An input panel displays the string or icon associated with this type | ||
2912 | * | ||
2913 | * @param obj A valid Evas_Object handle | ||
2914 | * @param part The part name | ||
2915 | * @param return_key_type The type of "return" key on the input panel | ||
2916 | * @since 1.2.0 | ||
2917 | */ | ||
2918 | EAPI void edje_object_part_text_input_panel_return_key_type_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Return_Key_Type return_key_type); | ||
2919 | |||
2920 | /** | ||
2921 | * Get the "return" key type. | ||
2922 | * | ||
2923 | * @see edje_object_part_text_input_panel_return_key_type_set() for more details | ||
2924 | * | ||
2925 | * @param obj A valid Evas_Object handle | ||
2926 | * @param part The part name | ||
2927 | * @return The type of "return" key on the input panel | ||
2928 | * @since 1.2.0 | ||
2929 | */ | ||
2930 | EAPI Edje_Input_Panel_Return_Key_Type edje_object_part_text_input_panel_return_key_type_get(const Evas_Object *obj, const char *part); | ||
2931 | |||
2932 | /** | ||
2933 | * Set the return key on the input panel to be disabled. | ||
2934 | * | ||
2935 | * @param obj A valid Evas_Object handle | ||
2936 | * @param part The part name | ||
2937 | * @param disabled The state | ||
2938 | * @since 1.2.0 | ||
2939 | */ | ||
2940 | EAPI void edje_object_part_text_input_panel_return_key_disabled_set(Evas_Object *obj, const char *part, Eina_Bool disabled); | ||
2941 | |||
2942 | /** | ||
2943 | * Get whether the return key on the input panel should be disabled or not. | ||
2944 | * | ||
2945 | * @param obj A valid Evas_Object handle | ||
2946 | * @param part The part name | ||
2947 | * @return EINA_TRUE if it should be disabled | ||
2948 | * @since 1.2.0 | ||
2949 | */ | ||
2950 | EAPI Eina_Bool edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part); | ||
2951 | |||
2952 | /** | ||
2885 | * Add a filter function for newly inserted text. | 2953 | * Add a filter function for newly inserted text. |
2886 | * | 2954 | * |
2887 | * Whenever text is inserted (not the same as set) into the given @p part, | 2955 | * Whenever text is inserted (not the same as set) into the given @p part, |
@@ -2897,8 +2965,20 @@ EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_ | |||
2897 | * will make Edje break out of the filter cycle and reject the inserted | 2965 | * will make Edje break out of the filter cycle and reject the inserted |
2898 | * text. | 2966 | * text. |
2899 | * | 2967 | * |
2968 | * @warning This function will be deprecated because of difficulty in use. | ||
2969 | * The type(format, text, or markup) of text should be always | ||
2970 | * checked in the filter function for correct filtering. | ||
2971 | * Please use edje_object_text_markup_filter_callback_add() instead. There | ||
2972 | * is no need to check the type of text in the filter function | ||
2973 | * because the text is always markup. | ||
2974 | * @warning If you use this function with | ||
2975 | * edje_object_text_markup_filter_callback_add() together, all | ||
2976 | * Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions | ||
2977 | * will be executed, and then filtered text will be inserted. | ||
2978 | * | ||
2900 | * @see edje_object_text_insert_filter_callback_del | 2979 | * @see edje_object_text_insert_filter_callback_del |
2901 | * @see edje_object_text_insert_filter_callback_del_full | 2980 | * @see edje_object_text_insert_filter_callback_del_full |
2981 | * @see edje_object_text_markup_filter_callback_add | ||
2902 | * | 2982 | * |
2903 | * @param obj A valid Evas_Object handle | 2983 | * @param obj A valid Evas_Object handle |
2904 | * @param part The part name | 2984 | * @param part The part name |
@@ -2920,7 +3000,7 @@ EAPI void edje_object_text_insert_filter_callback_add (Evas_Ob | |||
2920 | * @param part The part name | 3000 | * @param part The part name |
2921 | * @param func The function callback to remove | 3001 | * @param func The function callback to remove |
2922 | * | 3002 | * |
2923 | * @return The user data pointer if succesful, or NULL otherwise | 3003 | * @return The user data pointer if successful, or NULL otherwise |
2924 | */ | 3004 | */ |
2925 | EAPI void *edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func); | 3005 | EAPI void *edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func); |
2926 | 3006 | ||
@@ -2939,11 +3019,82 @@ EAPI void *edje_object_text_insert_filter_callback_del (Evas_Ob | |||
2939 | * @param func The function callback to remove | 3019 | * @param func The function callback to remove |
2940 | * @param data The data passed to the callback function | 3020 | * @param data The data passed to the callback function |
2941 | * | 3021 | * |
2942 | * @return The same data pointer if succesful, or NULL otherwise | 3022 | * @return The same data pointer if successful, or NULL otherwise |
2943 | */ | 3023 | */ |
2944 | EAPI void *edje_object_text_insert_filter_callback_del_full (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data); | 3024 | EAPI void *edje_object_text_insert_filter_callback_del_full (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data); |
2945 | 3025 | ||
2946 | /** | 3026 | /** |
3027 | * Add a markup filter function for newly inserted text. | ||
3028 | * | ||
3029 | * Whenever text is inserted (not the same as set) into the given @p part, | ||
3030 | * the list of markup filter functions will be called to decide if and how | ||
3031 | * the new text will be accepted. | ||
3032 | * The text parameter in the @p func filter is always markup. It can be | ||
3033 | * modified by the user and it's up to him to free the one passed if he's to | ||
3034 | * change the pointer. If doing so, the newly set text should be malloc'ed, | ||
3035 | * as once all the filters are called Edje will free it. | ||
3036 | * If the text is to be rejected, freeing it and setting the pointer to NULL | ||
3037 | * will make Edje break out of the filter cycle and reject the inserted | ||
3038 | * text. | ||
3039 | * This function is different from edje_object_text_insert_filter_callback_add() | ||
3040 | * in that the text parameter in the @p fucn filter is always markup. | ||
3041 | * | ||
3042 | * @warning If you use this function with | ||
3043 | * edje_object_text_insert_filter_callback_add() togehter, all | ||
3044 | * Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions | ||
3045 | * will be executed, and then filtered text will be inserted. | ||
3046 | * | ||
3047 | * @see edje_object_text_markup_filter_callback_del | ||
3048 | * @see edje_object_text_markup_filter_callback_del_full | ||
3049 | * @see edje_object_text_insert_filter_callback_add | ||
3050 | * | ||
3051 | * @param obj A valid Evas_Object handle | ||
3052 | * @param part The part name | ||
3053 | * @param func The callback function that will act as markup filter | ||
3054 | * @param data User provided data to pass to the filter function | ||
3055 | * @since 1.2.0 | ||
3056 | */ | ||
3057 | EAPI void edje_object_text_markup_filter_callback_add(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data); | ||
3058 | |||
3059 | /** | ||
3060 | * Delete a function from the markup filter list. | ||
3061 | * | ||
3062 | * Delete the given @p func filter from the list in @p part. Returns | ||
3063 | * the user data pointer given when added. | ||
3064 | * | ||
3065 | * @see edje_object_text_markup_filter_callback_add | ||
3066 | * @see edje_object_text_markup_filter_callback_del_full | ||
3067 | * | ||
3068 | * @param obj A valid Evas_Object handle | ||
3069 | * @param part The part name | ||
3070 | * @param func The function callback to remove | ||
3071 | * | ||
3072 | * @return The user data pointer if successful, or NULL otherwise | ||
3073 | * @since 1.2.0 | ||
3074 | */ | ||
3075 | EAPI void *edje_object_text_markup_filter_callback_del(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func); | ||
3076 | |||
3077 | /** | ||
3078 | * Delete a function and matching user data from the markup filter list. | ||
3079 | * | ||
3080 | * Delete the given @p func filter and @p data user data from the list | ||
3081 | * in @p part. | ||
3082 | * Returns the user data pointer given when added. | ||
3083 | * | ||
3084 | * @see edje_object_text_markup_filter_callback_add | ||
3085 | * @see edje_object_text_markup_filter_callback_del | ||
3086 | * | ||
3087 | * @param obj A valid Evas_Object handle | ||
3088 | * @param part The part name | ||
3089 | * @param func The function callback to remove | ||
3090 | * @param data The data passed to the callback function | ||
3091 | * | ||
3092 | * @return The same data pointer if successful, or NULL otherwise | ||
3093 | * @since 1.2.0 | ||
3094 | */ | ||
3095 | EAPI void *edje_object_text_markup_filter_callback_del_full(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data); | ||
3096 | |||
3097 | /** | ||
2947 | * @brief Swallows an object into the edje. | 3098 | * @brief Swallows an object into the edje. |
2948 | * | 3099 | * |
2949 | * @param obj A valid Evas_Object handle | 3100 | * @param obj A valid Evas_Object handle |
@@ -3244,7 +3395,7 @@ EAPI Eina_Bool edje_object_part_external_param_set (Evas_Ob | |||
3244 | * | 3395 | * |
3245 | * Parts of type external may carry extra properties that have | 3396 | * Parts of type external may carry extra properties that have |
3246 | * meanings defined by the external plugin. For instance, it may be a | 3397 | * meanings defined by the external plugin. For instance, it may be a |
3247 | * string that defines a button label. This property can be modifed by | 3398 | * string that defines a button label. This property can be modified by |
3248 | * state parameters, by explicit calls to | 3399 | * state parameters, by explicit calls to |
3249 | * edje_object_part_external_param_set() or getting the actual object | 3400 | * edje_object_part_external_param_set() or getting the actual object |
3250 | * with edje_object_part_external_object_get() and calling native | 3401 | * with edje_object_part_external_object_get() and calling native |
@@ -3850,8 +4001,8 @@ EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char | |||
3850 | * This sets the parameters of the perspective transformation. X, Y and Z | 4001 | * This sets the parameters of the perspective transformation. X, Y and Z |
3851 | * values are used. The px and py points specify the "infinite distance" point | 4002 | * values are used. The px and py points specify the "infinite distance" point |
3852 | * in the 3D conversion (where all lines converge to like when artists draw | 4003 | * in the 3D conversion (where all lines converge to like when artists draw |
3853 | * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1 | 4004 | * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1 |
3854 | * mapping between spatial coorinates and screen coordinates. Any points | 4005 | * mapping between spatial coordinates and screen coordinates. Any points |
3855 | * on this z value will not have their X and Y values modified in the transform. | 4006 | * on this z value will not have their X and Y values modified in the transform. |
3856 | * Those further away (Z value higher) will shrink into the distance, and | 4007 | * Those further away (Z value higher) will shrink into the distance, and |
3857 | * those less than this value will expand and become bigger. The @p foc value | 4008 | * those less than this value will expand and become bigger. The @p foc value |
@@ -3861,8 +4012,8 @@ EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char | |||
3861 | * control and @p foc must be greater than 0. | 4012 | * control and @p foc must be greater than 0. |
3862 | * | 4013 | * |
3863 | * @param m map to change. | 4014 | * @param m map to change. |
3864 | * @param px The pespective distance X coordinate | 4015 | * @param px The perspective distance X coordinate |
3865 | * @param py The pespective distance Y coordinate | 4016 | * @param py The perspective distance Y coordinate |
3866 | * @param z0 The "0" z plane value | 4017 | * @param z0 The "0" z plane value |
3867 | * @param foc The focal distance | 4018 | * @param foc The focal distance |
3868 | */ | 4019 | */ |
diff --git a/libraries/edje/src/lib/Makefile.in b/libraries/edje/src/lib/Makefile.in index e67d90c..cf73390 100644 --- a/libraries/edje/src/lib/Makefile.in +++ b/libraries/edje/src/lib/Makefile.in | |||
@@ -230,6 +230,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
230 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 230 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
231 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 231 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
232 | PKG_CONFIG = @PKG_CONFIG@ | 232 | PKG_CONFIG = @PKG_CONFIG@ |
233 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
234 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
233 | PYTHON = @PYTHON@ | 235 | PYTHON = @PYTHON@ |
234 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 236 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
235 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 237 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/lib/edje_cache.c b/libraries/edje/src/lib/edje_cache.c index 0ce6b30..02d16b5 100644 --- a/libraries/edje/src/lib/edje_cache.c +++ b/libraries/edje/src/lib/edje_cache.c | |||
@@ -76,12 +76,16 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
76 | edc->references = 1; | 76 | edc->references = 1; |
77 | edc->part = ce->entry; | 77 | edc->part = ce->entry; |
78 | 78 | ||
79 | /* For Edje file build with Edje 1.0, people expect text.align to be 0.0 0.0 */ | 79 | /* For Edje file build with Edje 1.0 */ |
80 | if (edf->version <= 3 && edf->minor <= 1) | 80 | if (edf->version <= 3 && edf->minor <= 1) |
81 | { | 81 | { |
82 | /* This will preserve previous rendering */ | 82 | /* This will preserve previous rendering */ |
83 | unsigned int i; | 83 | unsigned int i; |
84 | 84 | ||
85 | /* people expect signal to not be broadcasted */ | ||
86 | edc->broadcast_signal = EINA_FALSE; | ||
87 | |||
88 | /* people expect text.align to be 0.0 0.0 */ | ||
85 | for (i = 0; i < edc->parts_count; ++i) | 89 | for (i = 0; i < edc->parts_count; ++i) |
86 | { | 90 | { |
87 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) | 91 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) |
diff --git a/libraries/edje/src/lib/edje_calc.c b/libraries/edje/src/lib/edje_calc.c index 213e266..6aa6336 100644 --- a/libraries/edje/src/lib/edje_calc.c +++ b/libraries/edje/src/lib/edje_calc.c | |||
@@ -66,7 +66,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
66 | break; | 66 | break; |
67 | case EDJE_TWEEN_MODE_DECELERATE: | 67 | case EDJE_TWEEN_MODE_DECELERATE: |
68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
69 | ECORE_POS_MAP_DECELERATE, | 69 | ECORE_POS_MAP_DECELERATE, |
70 | 0.0, 0.0)); | 70 | 0.0, 0.0)); |
71 | break; | 71 | break; |
72 | case EDJE_TWEEN_MODE_LINEAR: | 72 | case EDJE_TWEEN_MODE_LINEAR: |
@@ -110,7 +110,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
110 | npos = fp_pos; | 110 | npos = fp_pos; |
111 | break; | 111 | break; |
112 | } | 112 | } |
113 | #endif | 113 | #endif |
114 | if (npos == ep->description_pos) return; | 114 | if (npos == ep->description_pos) return; |
115 | 115 | ||
116 | ep->description_pos = npos; | 116 | ep->description_pos = npos; |
@@ -564,7 +564,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
564 | 564 | ||
565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); | 565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); |
566 | 566 | ||
567 | if (ep->description_pos != 0.0) | 567 | if (ep->description_pos > FROM_DOUBLE(0.0)) |
568 | ep->chosen_description = epd2; | 568 | ep->chosen_description = epd2; |
569 | } | 569 | } |
570 | 570 | ||
@@ -572,6 +572,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) | 572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) |
573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); | 573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); |
574 | 574 | ||
575 | ed->recalc_hints = 1; | ||
575 | ed->dirty = 1; | 576 | ed->dirty = 1; |
576 | ed->recalc_call = 1; | 577 | ed->recalc_call = 1; |
577 | #ifdef EDJE_CALC_CACHE | 578 | #ifdef EDJE_CALC_CACHE |
@@ -650,6 +651,16 @@ _edje_recalc_do(Edje *ed) | |||
650 | else | 651 | else |
651 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); | 652 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); |
652 | ed->recalc_call = 0; | 653 | ed->recalc_call = 0; |
654 | |||
655 | if (ed->update_hints && ed->recalc_hints && !ed->calc_only) | ||
656 | { | ||
657 | Evas_Coord w, h; | ||
658 | |||
659 | ed->recalc_hints = 0; | ||
660 | |||
661 | edje_object_size_min_calc(ed->obj, &w, &h); | ||
662 | evas_object_size_hint_min_set(ed->obj, w, h); | ||
663 | } | ||
653 | } | 664 | } |
654 | 665 | ||
655 | void | 666 | void |
@@ -1746,7 +1757,6 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1746 | } | 1757 | } |
1747 | } | 1758 | } |
1748 | 1759 | ||
1749 | |||
1750 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ | 1760 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ |
1751 | if ((ep->swallow_params.max.h <= 0) || | 1761 | if ((ep->swallow_params.max.h <= 0) || |
1752 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) | 1762 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) |
@@ -1810,9 +1820,9 @@ _edje_part_recalc_single_map(Edje *ed, | |||
1810 | } | 1820 | } |
1811 | params->map.center.z = 0; | 1821 | params->map.center.z = 0; |
1812 | 1822 | ||
1813 | params->map.rotation.x = TO_DOUBLE(desc->map.rot.x); | 1823 | params->map.rotation.x = desc->map.rot.x; |
1814 | params->map.rotation.y = TO_DOUBLE(desc->map.rot.y); | 1824 | params->map.rotation.y = desc->map.rot.y; |
1815 | params->map.rotation.z = TO_DOUBLE(desc->map.rot.z); | 1825 | params->map.rotation.z = desc->map.rot.z; |
1816 | 1826 | ||
1817 | if (light) | 1827 | if (light) |
1818 | { | 1828 | { |
@@ -1907,7 +1917,7 @@ _edje_part_recalc_single(Edje *ed, | |||
1907 | sc = ed->scale; | 1917 | sc = ed->scale; |
1908 | if (sc == ZERO) sc = _edje_scale; | 1918 | if (sc == ZERO) sc = _edje_scale; |
1909 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); | 1919 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); |
1910 | 1920 | ||
1911 | /* relative coords of top left & bottom right */ | 1921 | /* relative coords of top left & bottom right */ |
1912 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); | 1922 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); |
1913 | 1923 | ||
@@ -1959,6 +1969,29 @@ _edje_part_recalc_single(Edje *ed, | |||
1959 | if (lminh > minh) minh = lminh; | 1969 | if (lminh > minh) minh = lminh; |
1960 | } | 1970 | } |
1961 | } | 1971 | } |
1972 | else if ((ep->part->type == EDJE_PART_TYPE_IMAGE) && | ||
1973 | (chosen_desc->min.limit || chosen_desc->max.limit)) | ||
1974 | { | ||
1975 | Evas_Coord w, h; | ||
1976 | |||
1977 | /* We only need pos to find the right image that would be displayed */ | ||
1978 | /* Yes, if someone set aspect preference to SOURCE and also max,min | ||
1979 | to SOURCE, it will be under efficient, but who cares at the | ||
1980 | moment. */ | ||
1981 | _edje_real_part_image_set(ed, ep, pos); | ||
1982 | evas_object_image_size_get(ep->object, &w, &h); | ||
1983 | |||
1984 | if (chosen_desc->min.limit) | ||
1985 | { | ||
1986 | if (w > minw) minw = w; | ||
1987 | if (h > minh) minh = h; | ||
1988 | } | ||
1989 | if (chosen_desc->max.limit) | ||
1990 | { | ||
1991 | if ((maxw <= 0) || (w < maxw)) maxw = w; | ||
1992 | if ((maxh <= 0) || (h < maxh)) maxh = h; | ||
1993 | } | ||
1994 | } | ||
1962 | 1995 | ||
1963 | /* remember what our size is BEFORE we go limit it */ | 1996 | /* remember what our size is BEFORE we go limit it */ |
1964 | params->req.x = params->x; | 1997 | params->req.x = params->x; |
@@ -2259,6 +2292,23 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2259 | #endif | 2292 | #endif |
2260 | return; | 2293 | return; |
2261 | } | 2294 | } |
2295 | |||
2296 | if (ep->part->scale && | ||
2297 | ep->part->type == EDJE_PART_TYPE_GROUP && | ||
2298 | ep->swallowed_object) | ||
2299 | { | ||
2300 | edje_object_scale_set(ep->swallowed_object, TO_DOUBLE(ed->scale)); | ||
2301 | |||
2302 | if (ep->description_pos > FROM_DOUBLE(0.5) && ep->param2) | ||
2303 | { | ||
2304 | edje_object_update_hints_set(ep->swallowed_object, ep->param2->description->min.limit); | ||
2305 | } | ||
2306 | else | ||
2307 | { | ||
2308 | edje_object_update_hints_set(ep->swallowed_object, ep->param1.description->min.limit); | ||
2309 | } | ||
2310 | } | ||
2311 | |||
2262 | #ifdef EDJE_CALC_CACHE | 2312 | #ifdef EDJE_CALC_CACHE |
2263 | if (ep->state == ed->state && !state) | 2313 | if (ep->state == ed->state && !state) |
2264 | return ; | 2314 | return ; |
@@ -2426,7 +2476,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2426 | p1, pos); | 2476 | p1, pos); |
2427 | 2477 | ||
2428 | #ifdef EDJE_CALC_CACHE | 2478 | #ifdef EDJE_CALC_CACHE |
2429 | ep->param1.state = ed->state; | 2479 | if (flags == FLAG_XY) |
2480 | ep->param1.state = ed->state; | ||
2430 | #endif | 2481 | #endif |
2431 | } | 2482 | } |
2432 | } | 2483 | } |
@@ -2478,7 +2529,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2478 | confine_to, | 2529 | confine_to, |
2479 | p2, pos); | 2530 | p2, pos); |
2480 | #ifdef EDJE_CALC_CACHE | 2531 | #ifdef EDJE_CALC_CACHE |
2481 | ep->param2->state = ed->state; | 2532 | if (flags == FLAG_XY) |
2533 | ep->param2->state = ed->state; | ||
2482 | #endif | 2534 | #endif |
2483 | } | 2535 | } |
2484 | 2536 | ||
@@ -2806,7 +2858,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2806 | } | 2858 | } |
2807 | 2859 | ||
2808 | evas_map_util_3d_rotate(map, | 2860 | evas_map_util_3d_rotate(map, |
2809 | pf->map.rotation.x, pf->map.rotation.y, pf->map.rotation.z, | 2861 | TO_DOUBLE(pf->map.rotation.x), TO_DOUBLE(pf->map.rotation.y), TO_DOUBLE(pf->map.rotation.z), |
2810 | pf->map.center.x, pf->map.center.y, pf->map.center.z); | 2862 | pf->map.center.x, pf->map.center.y, pf->map.center.z); |
2811 | 2863 | ||
2812 | // calculate light color & position etc. if there is one | 2864 | // calculate light color & position etc. if there is one |
diff --git a/libraries/edje/src/lib/edje_data.c b/libraries/edje/src/lib/edje_data.c index 32b17b6..46fd521 100644 --- a/libraries/edje/src/lib/edje_data.c +++ b/libraries/edje/src/lib/edje_data.c | |||
@@ -456,8 +456,10 @@ _edje_edd_init(void) | |||
456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ | 456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ |
457 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ | 457 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ |
458 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ | 458 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ |
459 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.limit", min.limit, EET_T_UCHAR); \ | ||
459 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ | 460 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ |
460 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.h", max.h, EET_T_INT); \ | 461 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.h", max.h, EET_T_INT); \ |
462 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.limit", max.limit, EET_T_UCHAR); \ | ||
461 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.x", step.x, EET_T_INT); \ | 463 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.x", step.x, EET_T_INT); \ |
462 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.y", step.y, EET_T_INT); \ | 464 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.y", step.y, EET_T_INT); \ |
463 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.min", aspect.min, EDJE_T_FLOAT); \ | 465 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.min", aspect.min, EDJE_T_FLOAT); \ |
@@ -877,4 +879,5 @@ _edje_edd_init(void) | |||
877 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); | 879 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); |
878 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); | 880 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); |
879 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT); | 881 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT); |
882 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR); | ||
880 | } | 883 | } |
diff --git a/libraries/edje/src/lib/edje_entry.c b/libraries/edje/src/lib/edje_entry.c index 563497d..f94883f 100644 --- a/libraries/edje/src/lib/edje_entry.c +++ b/libraries/edje/src/lib/edje_entry.c | |||
@@ -12,7 +12,6 @@ typedef struct _Sel Sel; | |||
12 | typedef struct _Anchor Anchor; | 12 | typedef struct _Anchor Anchor; |
13 | 13 | ||
14 | static void _edje_entry_imf_cursor_info_set(Entry *en); | 14 | static void _edje_entry_imf_cursor_info_set(Entry *en); |
15 | static void _edje_entry_imf_context_reset(Entry *en); | ||
16 | 15 | ||
17 | struct _Entry | 16 | struct _Entry |
18 | { | 17 | { |
@@ -29,12 +28,15 @@ struct _Entry | |||
29 | Eina_List *anchorlist; | 28 | Eina_List *anchorlist; |
30 | Eina_List *itemlist; | 29 | Eina_List *itemlist; |
31 | char *selection; | 30 | char *selection; |
31 | Edje_Input_Panel_Lang input_panel_lang; | ||
32 | Eina_Bool selecting : 1; | 32 | Eina_Bool selecting : 1; |
33 | Eina_Bool have_selection : 1; | 33 | Eina_Bool have_selection : 1; |
34 | Eina_Bool select_allow : 1; | 34 | Eina_Bool select_allow : 1; |
35 | Eina_Bool select_mod_start : 1; | 35 | Eina_Bool select_mod_start : 1; |
36 | Eina_Bool select_mod_end : 1; | 36 | Eina_Bool select_mod_end : 1; |
37 | Eina_Bool had_sel : 1; | 37 | Eina_Bool had_sel : 1; |
38 | Eina_Bool input_panel_enable : 1; | ||
39 | Eina_Bool prediction_allow : 1; | ||
38 | 40 | ||
39 | #ifdef HAVE_ECORE_IMF | 41 | #ifdef HAVE_ECORE_IMF |
40 | Eina_Bool have_preedit : 1; | 42 | Eina_Bool have_preedit : 1; |
@@ -179,6 +181,27 @@ _edje_focus_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, | |||
179 | } | 181 | } |
180 | 182 | ||
181 | static void | 183 | static void |
184 | _text_filter_markup_prepend_internal(Entry *en, Evas_Textblock_Cursor *c, char *text) | ||
185 | { | ||
186 | Edje_Markup_Filter_Callback *cb; | ||
187 | Eina_List *l; | ||
188 | |||
189 | EINA_LIST_FOREACH(en->rp->edje->markup_filter_callbacks, l, cb) | ||
190 | { | ||
191 | if (!strcmp(cb->part, en->rp->part->name)) | ||
192 | { | ||
193 | cb->func(cb->data, en->rp->edje->obj, cb->part, &text); | ||
194 | if (!text) break; | ||
195 | } | ||
196 | } | ||
197 | if (text) | ||
198 | { | ||
199 | evas_object_textblock_text_markup_prepend(c, text); | ||
200 | free(text); | ||
201 | } | ||
202 | } | ||
203 | |||
204 | static void | ||
182 | _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) | 205 | _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) |
183 | { | 206 | { |
184 | char *text2; | 207 | char *text2; |
@@ -196,8 +219,11 @@ _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) | |||
196 | } | 219 | } |
197 | if (text2) | 220 | if (text2) |
198 | { | 221 | { |
199 | evas_textblock_cursor_text_prepend(c, text2); | 222 | char *markup_text; |
223 | markup_text = evas_textblock_text_utf8_to_markup(NULL, text2); | ||
200 | free(text2); | 224 | free(text2); |
225 | if (markup_text) | ||
226 | _text_filter_markup_prepend_internal(en, c, markup_text); | ||
201 | } | 227 | } |
202 | } | 228 | } |
203 | 229 | ||
@@ -219,8 +245,61 @@ _text_filter_format_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *tex | |||
219 | } | 245 | } |
220 | if (text2) | 246 | if (text2) |
221 | { | 247 | { |
222 | evas_textblock_cursor_format_prepend(c, text2); | 248 | char *s, *markup_text; |
249 | |||
250 | s = text2; | ||
251 | if (*s == '+') | ||
252 | { | ||
253 | s++; | ||
254 | while (*s == ' ') s++; | ||
255 | if (!s) | ||
256 | { | ||
257 | free(text2); | ||
258 | return; | ||
259 | } | ||
260 | markup_text = (char*) malloc(strlen(s) + 3); | ||
261 | if (markup_text) | ||
262 | { | ||
263 | *(markup_text) = '<'; | ||
264 | strncpy((markup_text + 1), s, strlen(s)); | ||
265 | *(markup_text + strlen(s) + 1) = '>'; | ||
266 | *(markup_text + strlen(s) + 2) = '\0'; | ||
267 | } | ||
268 | } | ||
269 | else if (s[0] == '-') | ||
270 | { | ||
271 | s++; | ||
272 | while (*s == ' ') s++; | ||
273 | if (!s) | ||
274 | { | ||
275 | free(text2); | ||
276 | return; | ||
277 | } | ||
278 | markup_text = (char*) malloc(strlen(s) + 4); | ||
279 | if (markup_text) | ||
280 | { | ||
281 | *(markup_text) = '<'; | ||
282 | *(markup_text + 1) = '/'; | ||
283 | strncpy((markup_text + 2), s, strlen(s)); | ||
284 | *(markup_text + strlen(s) + 2) = '>'; | ||
285 | *(markup_text + strlen(s) + 3) = '\0'; | ||
286 | } | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | markup_text = (char*) malloc(strlen(s) + 4); | ||
291 | if (markup_text) | ||
292 | { | ||
293 | *(markup_text) = '<'; | ||
294 | strncpy((markup_text + 1), s, strlen(s)); | ||
295 | *(markup_text + strlen(s) + 1) = '/'; | ||
296 | *(markup_text + strlen(s) + 2) = '>'; | ||
297 | *(markup_text + strlen(s) + 3) = '\0'; | ||
298 | } | ||
299 | } | ||
223 | free(text2); | 300 | free(text2); |
301 | if (markup_text) | ||
302 | _text_filter_markup_prepend_internal(en, c, markup_text); | ||
224 | } | 303 | } |
225 | } | 304 | } |
226 | 305 | ||
@@ -241,10 +320,7 @@ _text_filter_markup_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *tex | |||
241 | } | 320 | } |
242 | } | 321 | } |
243 | if (text2) | 322 | if (text2) |
244 | { | 323 | _text_filter_markup_prepend_internal(en, c, text2); |
245 | evas_object_textblock_text_markup_prepend(c, text2); | ||
246 | free(text2); | ||
247 | } | ||
248 | } | 324 | } |
249 | 325 | ||
250 | static void | 326 | static void |
@@ -397,7 +473,7 @@ static void | |||
397 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 473 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
398 | { | 474 | { |
399 | if (!en->sel_end) return; | 475 | if (!en->sel_end) return; |
400 | _edje_entry_imf_context_reset(en); | 476 | _edje_entry_imf_context_reset(en->rp); |
401 | _sel_enable(c, o, en); | 477 | _sel_enable(c, o, en); |
402 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; | 478 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; |
403 | evas_textblock_cursor_copy(c, en->sel_end); | 479 | evas_textblock_cursor_copy(c, en->sel_end); |
@@ -413,7 +489,7 @@ static void | |||
413 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 489 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
414 | { | 490 | { |
415 | if (!en->sel_end) return; | 491 | if (!en->sel_end) return; |
416 | _edje_entry_imf_context_reset(en); | 492 | _edje_entry_imf_context_reset(en->rp); |
417 | _sel_enable(c, o, en); | 493 | _sel_enable(c, o, en); |
418 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; | 494 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; |
419 | evas_textblock_cursor_copy(c, en->sel_start); | 495 | evas_textblock_cursor_copy(c, en->sel_start); |
@@ -882,7 +958,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
882 | char *p; | 958 | char *p; |
883 | an = calloc(1, sizeof(Anchor)); | 959 | an = calloc(1, sizeof(Anchor)); |
884 | if (!an) | 960 | if (!an) |
885 | break; | 961 | break; |
886 | 962 | ||
887 | an->en = en; | 963 | an->en = en; |
888 | p = strstr(s, "href="); | 964 | p = strstr(s, "href="); |
@@ -903,7 +979,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
903 | { | 979 | { |
904 | s = evas_textblock_node_format_text_get(node); | 980 | s = evas_textblock_node_format_text_get(node); |
905 | if ((!strcmp(s, "- a")) || (!strcmp(s, "-a"))) | 981 | if ((!strcmp(s, "- a")) || (!strcmp(s, "-a"))) |
906 | break; | 982 | break; |
907 | } | 983 | } |
908 | 984 | ||
909 | if (node) | 985 | if (node) |
@@ -932,7 +1008,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
932 | char *p; | 1008 | char *p; |
933 | an = calloc(1, sizeof(Anchor)); | 1009 | an = calloc(1, sizeof(Anchor)); |
934 | if (!an) | 1010 | if (!an) |
935 | break; | 1011 | break; |
936 | 1012 | ||
937 | an->en = en; | 1013 | an->en = en; |
938 | an->item = 1; | 1014 | an->item = 1; |
@@ -986,12 +1062,14 @@ _range_del_emit(Edje *ed, Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __ | |||
986 | _edje_emit(ed, "entry,changed", en->rp->part->name); | 1062 | _edje_emit(ed, "entry,changed", en->rp->part->name); |
987 | _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info, | 1063 | _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info, |
988 | _free_entry_change_info); | 1064 | _free_entry_change_info); |
1065 | _sel_clear(en->cursor, en->rp->object, en); | ||
989 | } | 1066 | } |
990 | 1067 | ||
991 | static void | 1068 | static void |
992 | _range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en) | 1069 | _range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en) |
993 | { | 1070 | { |
994 | evas_textblock_cursor_range_delete(en->sel_start, en->sel_end); | 1071 | evas_textblock_cursor_range_delete(en->sel_start, en->sel_end); |
1072 | _sel_clear(en->cursor, en->rp->object, en); | ||
995 | } | 1073 | } |
996 | 1074 | ||
997 | static void | 1075 | static void |
@@ -1041,7 +1119,7 @@ _edje_entry_hide_visible_password(Edje_Real_Part *rp) | |||
1041 | if (!strcmp(text, "+ password=off")) | 1119 | if (!strcmp(text, "+ password=off")) |
1042 | { | 1120 | { |
1043 | evas_textblock_node_format_remove_pair(rp->object, | 1121 | evas_textblock_node_format_remove_pair(rp->object, |
1044 | (Evas_Object_Textblock_Node_Format *) node); | 1122 | (Evas_Object_Textblock_Node_Format *) node); |
1045 | break; | 1123 | break; |
1046 | } | 1124 | } |
1047 | } | 1125 | } |
@@ -1075,7 +1153,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1075 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 1153 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
1076 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE)) | 1154 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE)) |
1077 | return; | 1155 | return; |
1078 | if (!ev->key) return; | 1156 | if (!ev->keyname) return; |
1079 | 1157 | ||
1080 | #ifdef HAVE_ECORE_IMF | 1158 | #ifdef HAVE_ECORE_IMF |
1081 | if (en->imf_context) | 1159 | if (en->imf_context) |
@@ -1089,9 +1167,9 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1089 | } | 1167 | } |
1090 | #endif | 1168 | #endif |
1091 | 1169 | ||
1092 | if ((!strcmp(ev->key, "Escape")) || | 1170 | if ((!strcmp(ev->keyname, "Escape")) || |
1093 | (!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) | 1171 | (!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter"))) |
1094 | _edje_entry_imf_context_reset(en); | 1172 | _edje_entry_imf_context_reset(rp); |
1095 | 1173 | ||
1096 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); | 1174 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); |
1097 | 1175 | ||
@@ -1100,13 +1178,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1100 | shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); | 1178 | shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); |
1101 | multiline = rp->part->multiline; | 1179 | multiline = rp->part->multiline; |
1102 | cursor_changed = EINA_FALSE; | 1180 | cursor_changed = EINA_FALSE; |
1103 | if (!strcmp(ev->key, "Escape")) | 1181 | if (!strcmp(ev->keyname, "Escape")) |
1104 | { | 1182 | { |
1105 | // dead keys here. Escape for now (should emit these) | 1183 | // dead keys here. Escape for now (should emit these) |
1106 | _edje_emit(ed, "entry,key,escape", rp->part->name); | 1184 | _edje_emit(ed, "entry,key,escape", rp->part->name); |
1107 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1185 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1108 | } | 1186 | } |
1109 | else if (!strcmp(ev->key, "Up") || !strcmp(ev->key, "KP_Up")) | 1187 | else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) |
1110 | { | 1188 | { |
1111 | if (multiline) | 1189 | if (multiline) |
1112 | { | 1190 | { |
@@ -1119,14 +1197,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1119 | if (en->select_allow) | 1197 | if (en->select_allow) |
1120 | { | 1198 | { |
1121 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1199 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1200 | else _sel_clear(en->cursor, rp->object, en); | ||
1122 | } | 1201 | } |
1123 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1202 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1124 | } | 1203 | } |
1125 | _sel_clear(en->cursor, rp->object, en); | ||
1126 | _edje_emit(ed, "entry,key,up", rp->part->name); | 1204 | _edje_emit(ed, "entry,key,up", rp->part->name); |
1127 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1205 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1128 | } | 1206 | } |
1129 | else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) | 1207 | else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) |
1130 | { | 1208 | { |
1131 | if (multiline) | 1209 | if (multiline) |
1132 | { | 1210 | { |
@@ -1139,14 +1217,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1139 | if (en->select_allow) | 1217 | if (en->select_allow) |
1140 | { | 1218 | { |
1141 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1219 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1220 | else _sel_clear(en->cursor, rp->object, en); | ||
1142 | } | 1221 | } |
1143 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1222 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1144 | } | 1223 | } |
1145 | _sel_clear(en->cursor, rp->object, en); | ||
1146 | _edje_emit(ed, "entry,key,down", rp->part->name); | 1224 | _edje_emit(ed, "entry,key,down", rp->part->name); |
1147 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1225 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1148 | } | 1226 | } |
1149 | else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) | 1227 | else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) |
1150 | { | 1228 | { |
1151 | if (en->select_allow) | 1229 | if (en->select_allow) |
1152 | { | 1230 | { |
@@ -1159,13 +1237,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1159 | if (en->select_allow) | 1237 | if (en->select_allow) |
1160 | { | 1238 | { |
1161 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1239 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1240 | else _sel_clear(en->cursor, rp->object, en); | ||
1162 | } | 1241 | } |
1163 | _sel_clear(en->cursor, rp->object, en); | ||
1164 | _edje_emit(ed, "entry,key,left", rp->part->name); | 1242 | _edje_emit(ed, "entry,key,left", rp->part->name); |
1165 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1243 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1166 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1244 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1167 | } | 1245 | } |
1168 | else if (!strcmp(ev->key, "Right") || !strcmp(ev->key, "KP_Right")) | 1246 | else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) |
1169 | { | 1247 | { |
1170 | if (en->select_allow) | 1248 | if (en->select_allow) |
1171 | { | 1249 | { |
@@ -1178,13 +1256,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1178 | if (en->select_allow) | 1256 | if (en->select_allow) |
1179 | { | 1257 | { |
1180 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1258 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1259 | else _sel_clear(en->cursor, rp->object, en); | ||
1181 | } | 1260 | } |
1182 | _sel_clear(en->cursor, rp->object, en); | ||
1183 | _edje_emit(ed, "entry,key,right", rp->part->name); | 1261 | _edje_emit(ed, "entry,key,right", rp->part->name); |
1184 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1262 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1185 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1263 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1186 | } | 1264 | } |
1187 | else if (!strcmp(ev->key, "BackSpace")) | 1265 | else if (!strcmp(ev->keyname, "BackSpace")) |
1188 | { | 1266 | { |
1189 | if (control && !en->have_selection) | 1267 | if (control && !en->have_selection) |
1190 | { | 1268 | { |
@@ -1221,7 +1299,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1221 | _edje_emit(ed, "entry,key,backspace", rp->part->name); | 1299 | _edje_emit(ed, "entry,key,backspace", rp->part->name); |
1222 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1300 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1223 | } | 1301 | } |
1224 | else if (!strcmp(ev->key, "Delete") || !strcmp(ev->key, "KP_Delete")) | 1302 | else if (!strcmp(ev->keyname, "Delete") || !strcmp(ev->keyname, "KP_Delete")) |
1225 | { | 1303 | { |
1226 | if (control) | 1304 | if (control) |
1227 | { | 1305 | { |
@@ -1255,7 +1333,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1255 | _edje_emit(ed, "entry,key,delete", rp->part->name); | 1333 | _edje_emit(ed, "entry,key,delete", rp->part->name); |
1256 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1334 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1257 | } | 1335 | } |
1258 | else if (!strcmp(ev->key, "Home") || !strcmp(ev->key, "KP_Home")) | 1336 | else if (!strcmp(ev->keyname, "Home") || !strcmp(ev->keyname, "KP_Home")) |
1259 | { | 1337 | { |
1260 | if (en->select_allow) | 1338 | if (en->select_allow) |
1261 | { | 1339 | { |
@@ -1273,7 +1351,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1273 | _edje_emit(ed, "entry,key,home", rp->part->name); | 1351 | _edje_emit(ed, "entry,key,home", rp->part->name); |
1274 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1352 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1275 | } | 1353 | } |
1276 | else if (!strcmp(ev->key, "End") || !strcmp(ev->key, "KP_End")) | 1354 | else if (!strcmp(ev->keyname, "End") || !strcmp(ev->keyname, "KP_End")) |
1277 | { | 1355 | { |
1278 | if (en->select_allow) | 1356 | if (en->select_allow) |
1279 | { | 1357 | { |
@@ -1291,33 +1369,36 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1291 | _edje_emit(ed, "entry,key,end", rp->part->name); | 1369 | _edje_emit(ed, "entry,key,end", rp->part->name); |
1292 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1370 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1293 | } | 1371 | } |
1294 | else if ((control) && (!strcmp(ev->key, "v"))) | 1372 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "v"))) |
1295 | { | 1373 | { |
1296 | _edje_emit(ed, "entry,paste,request", rp->part->name); | 1374 | _edje_emit(ed, "entry,paste,request", rp->part->name); |
1297 | _edje_emit(ed, "entry,paste,request,3", rp->part->name); | 1375 | _edje_emit(ed, "entry,paste,request,3", rp->part->name); |
1298 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1376 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1299 | } | 1377 | } |
1300 | else if ((control) && (!strcmp(ev->key, "a"))) | 1378 | else if ((control) && (!strcmp(ev->keyname, "a"))) |
1301 | { | 1379 | { |
1302 | _edje_emit(ed, "entry,selection,all,request", rp->part->name); | 1380 | if (shift) |
1303 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1381 | { |
1304 | } | 1382 | _edje_emit(ed, "entry,selection,none,request", rp->part->name); |
1305 | else if ((control) && (!strcmp(ev->key, "A"))) | 1383 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1306 | { | 1384 | } |
1307 | _edje_emit(ed, "entry,selection,none,request", rp->part->name); | 1385 | else |
1308 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1386 | { |
1387 | _edje_emit(ed, "entry,selection,all,request", rp->part->name); | ||
1388 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | ||
1389 | } | ||
1309 | } | 1390 | } |
1310 | else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) | 1391 | else if ((control) && (((!shift) && !strcmp(ev->keyname, "c")) || !strcmp(ev->keyname, "Insert"))) |
1311 | { | 1392 | { |
1312 | _edje_emit(ed, "entry,copy,notify", rp->part->name); | 1393 | _edje_emit(ed, "entry,copy,notify", rp->part->name); |
1313 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1394 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1314 | } | 1395 | } |
1315 | else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) | 1396 | else if ((control) && (!shift) && ((!strcmp(ev->keyname, "x") || (!strcmp(ev->keyname, "m"))))) |
1316 | { | 1397 | { |
1317 | _edje_emit(ed, "entry,cut,notify", rp->part->name); | 1398 | _edje_emit(ed, "entry,cut,notify", rp->part->name); |
1318 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1399 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1319 | } | 1400 | } |
1320 | else if ((control) && (!strcmp(ev->key, "z"))) | 1401 | else if ((control) && (!strcmp(ev->keyname, "z"))) |
1321 | { | 1402 | { |
1322 | if (shift) | 1403 | if (shift) |
1323 | { | 1404 | { |
@@ -1331,19 +1412,19 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1331 | } | 1412 | } |
1332 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1413 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1333 | } | 1414 | } |
1334 | else if ((control) && (!strcmp(ev->key, "y"))) | 1415 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "y"))) |
1335 | { | 1416 | { |
1336 | // redo | 1417 | // redo |
1337 | _edje_emit(ed, "entry,redo,request", rp->part->name); | 1418 | _edje_emit(ed, "entry,redo,request", rp->part->name); |
1338 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1419 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1339 | } | 1420 | } |
1340 | else if ((control) && (!strcmp(ev->key, "w"))) | 1421 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "w"))) |
1341 | { | 1422 | { |
1342 | _sel_clear(en->cursor, rp->object, en); | 1423 | _sel_clear(en->cursor, rp->object, en); |
1343 | // select current word? | 1424 | // select current word? |
1344 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1425 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1345 | } | 1426 | } |
1346 | else if (!strcmp(ev->key, "Tab")) | 1427 | else if (!strcmp(ev->keyname, "Tab")) |
1347 | { | 1428 | { |
1348 | if (multiline) | 1429 | if (multiline) |
1349 | { | 1430 | { |
@@ -1362,7 +1443,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1362 | _range_del_emit(ed, en->cursor, rp->object, en); | 1443 | _range_del_emit(ed, en->cursor, rp->object, en); |
1363 | info->merge = EINA_TRUE; | 1444 | info->merge = EINA_TRUE; |
1364 | } | 1445 | } |
1365 | _sel_clear(en->cursor, rp->object, en); | ||
1366 | info->change.insert.pos = | 1446 | info->change.insert.pos = |
1367 | evas_textblock_cursor_pos_get(en->cursor); | 1447 | evas_textblock_cursor_pos_get(en->cursor); |
1368 | info->change.insert.content = eina_stringshare_add("<tab/>"); | 1448 | info->change.insert.content = eina_stringshare_add("<tab/>"); |
@@ -1378,12 +1458,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1378 | } | 1458 | } |
1379 | _edje_emit(ed, "entry,key,tab", rp->part->name); | 1459 | _edje_emit(ed, "entry,key,tab", rp->part->name); |
1380 | } | 1460 | } |
1381 | else if ((!strcmp(ev->key, "ISO_Left_Tab")) && (multiline)) | 1461 | else if ((!strcmp(ev->keyname, "ISO_Left_Tab")) && (multiline)) |
1382 | { | 1462 | { |
1383 | // remove a tab | 1463 | // remove a tab |
1384 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1464 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1385 | } | 1465 | } |
1386 | else if (!strcmp(ev->key, "Prior") || !strcmp(ev->key, "KP_Prior")) | 1466 | else if (!strcmp(ev->keyname, "Prior") || !strcmp(ev->keyname, "KP_Prior")) |
1387 | { | 1467 | { |
1388 | if (en->select_allow) | 1468 | if (en->select_allow) |
1389 | { | 1469 | { |
@@ -1394,12 +1474,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1394 | if (en->select_allow) | 1474 | if (en->select_allow) |
1395 | { | 1475 | { |
1396 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1476 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1477 | else _sel_clear(en->cursor, rp->object, en); | ||
1397 | } | 1478 | } |
1398 | _sel_clear(en->cursor, rp->object, en); | ||
1399 | _edje_emit(ed, "entry,key,pgup", rp->part->name); | 1479 | _edje_emit(ed, "entry,key,pgup", rp->part->name); |
1400 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1480 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1401 | } | 1481 | } |
1402 | else if (!strcmp(ev->key, "Next") || !strcmp(ev->key, "KP_Next")) | 1482 | else if (!strcmp(ev->keyname, "Next") || !strcmp(ev->keyname, "KP_Next")) |
1403 | { | 1483 | { |
1404 | if (en->select_allow) | 1484 | if (en->select_allow) |
1405 | { | 1485 | { |
@@ -1410,12 +1490,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1410 | if (en->select_allow) | 1490 | if (en->select_allow) |
1411 | { | 1491 | { |
1412 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1492 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1493 | else _sel_clear(en->cursor, rp->object, en); | ||
1413 | } | 1494 | } |
1414 | _sel_clear(en->cursor, rp->object, en); | ||
1415 | _edje_emit(ed, "entry,key,pgdn", rp->part->name); | 1495 | _edje_emit(ed, "entry,key,pgdn", rp->part->name); |
1416 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1496 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1417 | } | 1497 | } |
1418 | else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) | 1498 | else if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter"))) |
1419 | { | 1499 | { |
1420 | if (multiline) | 1500 | if (multiline) |
1421 | { | 1501 | { |
@@ -1427,7 +1507,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1427 | _range_del_emit(ed, en->cursor, rp->object, en); | 1507 | _range_del_emit(ed, en->cursor, rp->object, en); |
1428 | info->merge = EINA_TRUE; | 1508 | info->merge = EINA_TRUE; |
1429 | } | 1509 | } |
1430 | _sel_clear(en->cursor, rp->object, en); | ||
1431 | 1510 | ||
1432 | info->change.insert.pos = | 1511 | info->change.insert.pos = |
1433 | evas_textblock_cursor_pos_get(en->cursor); | 1512 | evas_textblock_cursor_pos_get(en->cursor); |
@@ -1470,7 +1549,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1470 | _range_del_emit(ed, en->cursor, rp->object, en); | 1549 | _range_del_emit(ed, en->cursor, rp->object, en); |
1471 | info->merge = EINA_TRUE; | 1550 | info->merge = EINA_TRUE; |
1472 | } | 1551 | } |
1473 | _sel_clear(en->cursor, rp->object, en); | ||
1474 | 1552 | ||
1475 | info->change.insert.pos = | 1553 | info->change.insert.pos = |
1476 | evas_textblock_cursor_pos_get(en->cursor); | 1554 | evas_textblock_cursor_pos_get(en->cursor); |
@@ -1580,7 +1658,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1580 | } | 1658 | } |
1581 | #endif | 1659 | #endif |
1582 | 1660 | ||
1583 | _edje_entry_imf_context_reset(en); | 1661 | _edje_entry_imf_context_reset(rp); |
1584 | 1662 | ||
1585 | en->select_mod_start = EINA_FALSE; | 1663 | en->select_mod_start = EINA_FALSE; |
1586 | en->select_mod_end = EINA_FALSE; | 1664 | en->select_mod_end = EINA_FALSE; |
@@ -1593,8 +1671,35 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1593 | if (ev->button == 2) dosel = EINA_FALSE; | 1671 | if (ev->button == 2) dosel = EINA_FALSE; |
1594 | if (dosel) | 1672 | if (dosel) |
1595 | { | 1673 | { |
1596 | // double click -> select word | 1674 | if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) |
1597 | // triple click -> select line | 1675 | { |
1676 | en->have_selection = EINA_FALSE; | ||
1677 | en->selecting = EINA_FALSE; | ||
1678 | _sel_clear(en->cursor, rp->object, en); | ||
1679 | tc = evas_object_textblock_cursor_new(rp->object); | ||
1680 | evas_textblock_cursor_copy(en->cursor, tc); | ||
1681 | evas_textblock_cursor_line_char_first(en->cursor); | ||
1682 | _sel_start(en->cursor, rp->object, en); | ||
1683 | evas_textblock_cursor_line_char_last(en->cursor); | ||
1684 | _sel_extend(en->cursor, rp->object, en); | ||
1685 | |||
1686 | goto end; | ||
1687 | } | ||
1688 | else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) | ||
1689 | { | ||
1690 | en->have_selection = EINA_FALSE; | ||
1691 | en->selecting = EINA_FALSE; | ||
1692 | _sel_clear(en->cursor, rp->object, en); | ||
1693 | tc = evas_object_textblock_cursor_new(rp->object); | ||
1694 | evas_textblock_cursor_copy(en->cursor, tc); | ||
1695 | evas_textblock_cursor_word_start(en->cursor); | ||
1696 | _sel_start(en->cursor, rp->object, en); | ||
1697 | evas_textblock_cursor_word_end(en->cursor); | ||
1698 | evas_textblock_cursor_char_next(en->cursor); | ||
1699 | _sel_extend(en->cursor, rp->object, en); | ||
1700 | |||
1701 | goto end; | ||
1702 | } | ||
1598 | } | 1703 | } |
1599 | tc = evas_object_textblock_cursor_new(rp->object); | 1704 | tc = evas_object_textblock_cursor_new(rp->object); |
1600 | evas_textblock_cursor_copy(en->cursor, tc); | 1705 | evas_textblock_cursor_copy(en->cursor, tc); |
@@ -1695,13 +1800,14 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1695 | } | 1800 | } |
1696 | } | 1801 | } |
1697 | } | 1802 | } |
1803 | end: | ||
1698 | if (evas_textblock_cursor_compare(tc, en->cursor)) | 1804 | if (evas_textblock_cursor_compare(tc, en->cursor)) |
1699 | { | 1805 | { |
1700 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 1806 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
1701 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1807 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1702 | } | 1808 | } |
1703 | evas_textblock_cursor_free(tc); | 1809 | evas_textblock_cursor_free(tc); |
1704 | 1810 | ||
1705 | _edje_entry_imf_cursor_info_set(en); | 1811 | _edje_entry_imf_cursor_info_set(en); |
1706 | 1812 | ||
1707 | _edje_entry_real_part_configure(rp); | 1813 | _edje_entry_real_part_configure(rp); |
@@ -1724,6 +1830,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED | |||
1724 | if (ev->button != 1) return; | 1830 | if (ev->button != 1) return; |
1725 | if (!rp) return; | 1831 | if (!rp) return; |
1726 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; | 1832 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; |
1833 | if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return; | ||
1834 | if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) return; | ||
1727 | en = rp->entry_data; | 1835 | en = rp->entry_data; |
1728 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 1836 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
1729 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) | 1837 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) |
@@ -1741,7 +1849,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED | |||
1741 | } | 1849 | } |
1742 | #endif | 1850 | #endif |
1743 | 1851 | ||
1744 | _edje_entry_imf_context_reset(en); | 1852 | _edje_entry_imf_context_reset(rp); |
1745 | 1853 | ||
1746 | tc = evas_object_textblock_cursor_new(rp->object); | 1854 | tc = evas_object_textblock_cursor_new(rp->object); |
1747 | evas_textblock_cursor_copy(en->cursor, tc); | 1855 | evas_textblock_cursor_copy(en->cursor, tc); |
@@ -1911,7 +2019,7 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1911 | } | 2019 | } |
1912 | evas_textblock_cursor_free(tc); | 2020 | evas_textblock_cursor_free(tc); |
1913 | 2021 | ||
1914 | _edje_entry_imf_context_reset(en); | 2022 | _edje_entry_imf_context_reset(rp); |
1915 | _edje_entry_imf_cursor_info_set(en); | 2023 | _edje_entry_imf_cursor_info_set(en); |
1916 | 2024 | ||
1917 | _edje_entry_real_part_configure(rp); | 2025 | _edje_entry_real_part_configure(rp); |
@@ -2035,6 +2143,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2035 | { | 2143 | { |
2036 | evas_object_show(en->cursor_bg); | 2144 | evas_object_show(en->cursor_bg); |
2037 | evas_object_show(en->cursor_fg); | 2145 | evas_object_show(en->cursor_fg); |
2146 | en->input_panel_enable = EINA_TRUE; | ||
2147 | |||
2038 | #ifdef HAVE_ECORE_IMF | 2148 | #ifdef HAVE_ECORE_IMF |
2039 | ecore_imf_init(); | 2149 | ecore_imf_init(); |
2040 | 2150 | ||
@@ -2078,6 +2188,9 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2078 | ecore_imf_context_input_mode_set(en->imf_context, | 2188 | ecore_imf_context_input_mode_set(en->imf_context, |
2079 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? | 2189 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? |
2080 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); | 2190 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); |
2191 | |||
2192 | if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) | ||
2193 | ecore_imf_context_input_panel_language_set(en->imf_context, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET); | ||
2081 | #endif | 2194 | #endif |
2082 | } | 2195 | } |
2083 | #ifdef HAVE_ECORE_IMF | 2196 | #ifdef HAVE_ECORE_IMF |
@@ -2111,9 +2224,9 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) | |||
2111 | { | 2224 | { |
2112 | if (en->imf_context) | 2225 | if (en->imf_context) |
2113 | { | 2226 | { |
2114 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); | 2227 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); |
2115 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); | 2228 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); |
2116 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); | 2229 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); |
2117 | 2230 | ||
2118 | ecore_imf_context_del(en->imf_context); | 2231 | ecore_imf_context_del(en->imf_context); |
2119 | en->imf_context = NULL; | 2232 | en->imf_context = NULL; |
@@ -2192,7 +2305,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text) | |||
2192 | { | 2305 | { |
2193 | Entry *en = rp->entry_data; | 2306 | Entry *en = rp->entry_data; |
2194 | if (!en) return; | 2307 | if (!en) return; |
2195 | _edje_entry_imf_context_reset(en); | 2308 | _edje_entry_imf_context_reset(rp); |
2196 | // set text as markup | 2309 | // set text as markup |
2197 | _sel_clear(en->cursor, rp->object, en); | 2310 | _sel_clear(en->cursor, rp->object, en); |
2198 | evas_object_textblock_text_markup_set(rp->object, text); | 2311 | evas_object_textblock_text_markup_set(rp->object, text); |
@@ -2231,12 +2344,11 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) | |||
2231 | { | 2344 | { |
2232 | Entry *en = rp->entry_data; | 2345 | Entry *en = rp->entry_data; |
2233 | if (!en) return; | 2346 | if (!en) return; |
2234 | _edje_entry_imf_context_reset(en); | 2347 | _edje_entry_imf_context_reset(rp); |
2235 | 2348 | ||
2236 | // prepend markup @ cursor pos | 2349 | // prepend markup @ cursor pos |
2237 | if (en->have_selection) | 2350 | if (en->have_selection) |
2238 | _range_del(en->cursor, rp->object, en); | 2351 | _range_del(en->cursor, rp->object, en); |
2239 | _sel_clear(en->cursor, rp->object, en); | ||
2240 | //xx | 2352 | //xx |
2241 | // evas_object_textblock_text_markup_prepend(en->cursor, text); | 2353 | // evas_object_textblock_text_markup_prepend(en->cursor, text); |
2242 | _text_filter_markup_prepend(en, en->cursor, text); | 2354 | _text_filter_markup_prepend(en, en->cursor, text); |
@@ -2282,7 +2394,7 @@ _edje_entry_select_all(Edje_Real_Part *rp) | |||
2282 | Entry *en = rp->entry_data; | 2394 | Entry *en = rp->entry_data; |
2283 | if (!en) return; | 2395 | if (!en) return; |
2284 | 2396 | ||
2285 | _edje_entry_imf_context_reset(en); | 2397 | _edje_entry_imf_context_reset(rp); |
2286 | 2398 | ||
2287 | _sel_clear(en->cursor, rp->object, en); | 2399 | _sel_clear(en->cursor, rp->object, en); |
2288 | _curs_start(en->cursor, rp->object, en); | 2400 | _curs_start(en->cursor, rp->object, en); |
@@ -2301,7 +2413,7 @@ _edje_entry_select_begin(Edje_Real_Part *rp) | |||
2301 | Entry *en = rp->entry_data; | 2413 | Entry *en = rp->entry_data; |
2302 | if (!en) return; | 2414 | if (!en) return; |
2303 | 2415 | ||
2304 | _edje_entry_imf_context_reset(en); | 2416 | _edje_entry_imf_context_reset(rp); |
2305 | 2417 | ||
2306 | _sel_clear(en->cursor, rp->object, en); | 2418 | _sel_clear(en->cursor, rp->object, en); |
2307 | _sel_enable(en->cursor, rp->object, en); | 2419 | _sel_enable(en->cursor, rp->object, en); |
@@ -2318,7 +2430,7 @@ _edje_entry_select_extend(Edje_Real_Part *rp) | |||
2318 | { | 2430 | { |
2319 | Entry *en = rp->entry_data; | 2431 | Entry *en = rp->entry_data; |
2320 | if (!en) return; | 2432 | if (!en) return; |
2321 | _edje_entry_imf_context_reset(en); | 2433 | _edje_entry_imf_context_reset(rp); |
2322 | _sel_extend(en->cursor, rp->object, en); | 2434 | _sel_extend(en->cursor, rp->object, en); |
2323 | 2435 | ||
2324 | _edje_entry_imf_cursor_info_set(en); | 2436 | _edje_entry_imf_cursor_info_set(en); |
@@ -2440,6 +2552,35 @@ _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord * | |||
2440 | } | 2552 | } |
2441 | 2553 | ||
2442 | void | 2554 | void |
2555 | _edje_entry_user_insert(Edje_Real_Part *rp, const char *text) | ||
2556 | { | ||
2557 | Entry *en = rp->entry_data; | ||
2558 | Edje_Entry_Change_Info *info = calloc(1, sizeof(*info)); | ||
2559 | info->insert = EINA_TRUE; | ||
2560 | info->change.insert.plain_length = 1; | ||
2561 | info->change.insert.content = eina_stringshare_add(text); | ||
2562 | { | ||
2563 | char *tmp; | ||
2564 | tmp = evas_textblock_text_markup_to_utf8(rp->object, | ||
2565 | info->change.insert.content); | ||
2566 | info->change.insert.plain_length = eina_unicode_utf8_get_len(tmp); | ||
2567 | free(tmp); | ||
2568 | } | ||
2569 | |||
2570 | if (en->have_selection) | ||
2571 | { | ||
2572 | _range_del_emit(rp->edje, en->cursor, rp->object, en); | ||
2573 | info->merge = EINA_TRUE; | ||
2574 | } | ||
2575 | info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); | ||
2576 | _text_filter_text_prepend(en, en->cursor, text); | ||
2577 | _edje_emit(rp->edje, "entry,changed", rp->part->name); | ||
2578 | _edje_emit_full(rp->edje, "entry,changed,user", rp->part->name, | ||
2579 | info, _free_entry_change_info); | ||
2580 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | ||
2581 | } | ||
2582 | |||
2583 | void | ||
2443 | _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) | 2584 | _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) |
2444 | { | 2585 | { |
2445 | Entry *en = rp->entry_data; | 2586 | Entry *en = rp->entry_data; |
@@ -2463,12 +2604,25 @@ _edje_entry_select_abort(Edje_Real_Part *rp) | |||
2463 | { | 2604 | { |
2464 | en->selecting = EINA_FALSE; | 2605 | en->selecting = EINA_FALSE; |
2465 | 2606 | ||
2466 | _edje_entry_imf_context_reset(en); | 2607 | _edje_entry_imf_context_reset(rp); |
2467 | _edje_entry_imf_cursor_info_set(en); | 2608 | _edje_entry_imf_cursor_info_set(en); |
2468 | _edje_entry_real_part_configure(rp); | 2609 | _edje_entry_real_part_configure(rp); |
2469 | } | 2610 | } |
2470 | } | 2611 | } |
2471 | 2612 | ||
2613 | void * | ||
2614 | _edje_entry_imf_context_get(Edje_Real_Part *rp) | ||
2615 | { | ||
2616 | Entry *en = rp->entry_data; | ||
2617 | if (!en) return NULL; | ||
2618 | |||
2619 | #ifdef HAVE_ECORE_IMF | ||
2620 | return en->imf_context; | ||
2621 | #else | ||
2622 | return NULL; | ||
2623 | #endif | ||
2624 | } | ||
2625 | |||
2472 | void | 2626 | void |
2473 | _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type) | 2627 | _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type) |
2474 | { | 2628 | { |
@@ -2499,16 +2653,37 @@ _edje_entry_autocapital_type_get(Edje_Real_Part *rp) | |||
2499 | } | 2653 | } |
2500 | 2654 | ||
2501 | void | 2655 | void |
2656 | _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction) | ||
2657 | { | ||
2658 | Entry *en = rp->entry_data; | ||
2659 | |||
2660 | if (!en) return; | ||
2661 | en->prediction_allow = prediction; | ||
2662 | #ifdef HAVE_ECORE_IMF | ||
2663 | if (en->imf_context) | ||
2664 | ecore_imf_context_prediction_allow_set(en->imf_context, prediction); | ||
2665 | #endif | ||
2666 | } | ||
2667 | |||
2668 | Eina_Bool | ||
2669 | _edje_entry_prediction_allow_get(Edje_Real_Part *rp) | ||
2670 | { | ||
2671 | Entry *en = rp->entry_data; | ||
2672 | if (!en) return EINA_FALSE; | ||
2673 | |||
2674 | return en->prediction_allow; | ||
2675 | } | ||
2676 | |||
2677 | void | ||
2502 | _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled) | 2678 | _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled) |
2503 | { | 2679 | { |
2504 | Entry *en = rp->entry_data; | 2680 | Entry *en = rp->entry_data; |
2505 | 2681 | ||
2506 | if (!en) return; | 2682 | if (!en) return; |
2683 | en->input_panel_enable = enabled; | ||
2507 | #ifdef HAVE_ECORE_IMF | 2684 | #ifdef HAVE_ECORE_IMF |
2508 | if (en->imf_context) | 2685 | if (en->imf_context) |
2509 | ecore_imf_context_input_panel_enabled_set(en->imf_context, enabled); | 2686 | ecore_imf_context_input_panel_enabled_set(en->imf_context, enabled); |
2510 | #else | ||
2511 | (void) enabled; | ||
2512 | #endif | 2687 | #endif |
2513 | } | 2688 | } |
2514 | 2689 | ||
@@ -2517,11 +2692,121 @@ _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp) | |||
2517 | { | 2692 | { |
2518 | Entry *en = rp->entry_data; | 2693 | Entry *en = rp->entry_data; |
2519 | if (!en) return EINA_FALSE; | 2694 | if (!en) return EINA_FALSE; |
2695 | |||
2696 | return en->input_panel_enable; | ||
2697 | } | ||
2698 | |||
2699 | void | ||
2700 | _edje_entry_input_panel_show(Edje_Real_Part *rp) | ||
2701 | { | ||
2702 | Entry *en = rp->entry_data; | ||
2703 | |||
2704 | if (!en) return; | ||
2705 | #ifdef HAVE_ECORE_IMF | ||
2706 | if (en->imf_context) | ||
2707 | ecore_imf_context_input_panel_show(en->imf_context); | ||
2708 | #endif | ||
2709 | } | ||
2710 | |||
2711 | void | ||
2712 | _edje_entry_input_panel_hide(Edje_Real_Part *rp) | ||
2713 | { | ||
2714 | Entry *en = rp->entry_data; | ||
2715 | |||
2716 | if (!en) return; | ||
2520 | #ifdef HAVE_ECORE_IMF | 2717 | #ifdef HAVE_ECORE_IMF |
2521 | if (en->imf_context) | 2718 | if (en->imf_context) |
2522 | return ecore_imf_context_input_panel_enabled_get(en->imf_context); | 2719 | ecore_imf_context_input_panel_hide(en->imf_context); |
2523 | #endif | 2720 | #endif |
2721 | } | ||
2722 | |||
2723 | void | ||
2724 | _edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang) | ||
2725 | { | ||
2726 | Entry *en = rp->entry_data; | ||
2524 | 2727 | ||
2728 | if (!en) return; | ||
2729 | en->input_panel_lang = lang; | ||
2730 | #ifdef HAVE_ECORE_IMF | ||
2731 | if (en->imf_context) | ||
2732 | ecore_imf_context_input_panel_language_set(en->imf_context, lang); | ||
2733 | #endif | ||
2734 | } | ||
2735 | |||
2736 | Edje_Input_Panel_Lang | ||
2737 | _edje_entry_input_panel_language_get(Edje_Real_Part *rp) | ||
2738 | { | ||
2739 | Entry *en = rp->entry_data; | ||
2740 | if (!en) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2741 | |||
2742 | return en->input_panel_lang; | ||
2743 | } | ||
2744 | |||
2745 | void | ||
2746 | _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len) | ||
2747 | { | ||
2748 | Entry *en = rp->entry_data; | ||
2749 | if (!en) return; | ||
2750 | #ifdef HAVE_ECORE_IMF | ||
2751 | if (en->imf_context) | ||
2752 | ecore_imf_context_input_panel_imdata_set(en->imf_context, data, len); | ||
2753 | #endif | ||
2754 | } | ||
2755 | |||
2756 | void | ||
2757 | _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len) | ||
2758 | { | ||
2759 | Entry *en = rp->entry_data; | ||
2760 | if (!en) return; | ||
2761 | #ifdef HAVE_ECORE_IMF | ||
2762 | if (en->imf_context) | ||
2763 | ecore_imf_context_input_panel_imdata_get(en->imf_context, data, len); | ||
2764 | #endif | ||
2765 | } | ||
2766 | |||
2767 | void | ||
2768 | _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type) | ||
2769 | { | ||
2770 | Entry *en = rp->entry_data; | ||
2771 | if (!en) return; | ||
2772 | #ifdef HAVE_ECORE_IMF | ||
2773 | if (en->imf_context) | ||
2774 | ecore_imf_context_input_panel_return_key_type_set(en->imf_context, return_key_type); | ||
2775 | #endif | ||
2776 | } | ||
2777 | |||
2778 | Edje_Input_Panel_Return_Key_Type | ||
2779 | _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp) | ||
2780 | { | ||
2781 | Entry *en = rp->entry_data; | ||
2782 | if (!en) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2783 | #ifdef HAVE_ECORE_IMF | ||
2784 | if (en->imf_context) | ||
2785 | return ecore_imf_context_input_panel_return_key_type_get(en->imf_context); | ||
2786 | #endif | ||
2787 | return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2788 | } | ||
2789 | |||
2790 | void | ||
2791 | _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled) | ||
2792 | { | ||
2793 | Entry *en = rp->entry_data; | ||
2794 | if (!en) return; | ||
2795 | #ifdef HAVE_ECORE_IMF | ||
2796 | if (en->imf_context) | ||
2797 | ecore_imf_context_input_panel_return_key_disabled_set(en->imf_context, disabled); | ||
2798 | #endif | ||
2799 | } | ||
2800 | |||
2801 | Eina_Bool | ||
2802 | _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp) | ||
2803 | { | ||
2804 | Entry *en = rp->entry_data; | ||
2805 | if (!en) return EINA_FALSE; | ||
2806 | #ifdef HAVE_ECORE_IMF | ||
2807 | if (en->imf_context) | ||
2808 | return ecore_imf_context_input_panel_return_key_disabled_get(en->imf_context); | ||
2809 | #endif | ||
2525 | return EINA_FALSE; | 2810 | return EINA_FALSE; |
2526 | } | 2811 | } |
2527 | 2812 | ||
@@ -2568,7 +2853,7 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2568 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2853 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2569 | if (!c) return EINA_FALSE; | 2854 | if (!c) return EINA_FALSE; |
2570 | 2855 | ||
2571 | _edje_entry_imf_context_reset(en); | 2856 | _edje_entry_imf_context_reset(rp); |
2572 | 2857 | ||
2573 | if (!evas_textblock_cursor_char_next(c)) | 2858 | if (!evas_textblock_cursor_char_next(c)) |
2574 | { | 2859 | { |
@@ -2589,7 +2874,7 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2589 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2874 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2590 | if (!c) return EINA_FALSE; | 2875 | if (!c) return EINA_FALSE; |
2591 | 2876 | ||
2592 | _edje_entry_imf_context_reset(en); | 2877 | _edje_entry_imf_context_reset(rp); |
2593 | 2878 | ||
2594 | if (!evas_textblock_cursor_char_prev(c)) | 2879 | if (!evas_textblock_cursor_char_prev(c)) |
2595 | { | 2880 | { |
@@ -2615,7 +2900,7 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2615 | int ln; | 2900 | int ln; |
2616 | if (!c) return EINA_FALSE; | 2901 | if (!c) return EINA_FALSE; |
2617 | 2902 | ||
2618 | _edje_entry_imf_context_reset(en); | 2903 | _edje_entry_imf_context_reset(rp); |
2619 | 2904 | ||
2620 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2905 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2621 | ln--; | 2906 | ln--; |
@@ -2649,7 +2934,7 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2649 | int ln; | 2934 | int ln; |
2650 | if (!c) return EINA_FALSE; | 2935 | if (!c) return EINA_FALSE; |
2651 | 2936 | ||
2652 | _edje_entry_imf_context_reset(en); | 2937 | _edje_entry_imf_context_reset(rp); |
2653 | 2938 | ||
2654 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2939 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2655 | ln++; | 2940 | ln++; |
@@ -2679,7 +2964,7 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2679 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2964 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2680 | if (!c) return; | 2965 | if (!c) return; |
2681 | 2966 | ||
2682 | _edje_entry_imf_context_reset(en); | 2967 | _edje_entry_imf_context_reset(rp); |
2683 | 2968 | ||
2684 | evas_textblock_cursor_paragraph_first(c); | 2969 | evas_textblock_cursor_paragraph_first(c); |
2685 | _sel_update(c, rp->object, rp->entry_data); | 2970 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2696,7 +2981,7 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2696 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2981 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2697 | if (!c) return; | 2982 | if (!c) return; |
2698 | 2983 | ||
2699 | _edje_entry_imf_context_reset(en); | 2984 | _edje_entry_imf_context_reset(rp); |
2700 | 2985 | ||
2701 | _curs_end(c, rp->object, rp->entry_data); | 2986 | _curs_end(c, rp->object, rp->entry_data); |
2702 | _sel_update(c, rp->object, rp->entry_data); | 2987 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2721,7 +3006,7 @@ _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst) | |||
2721 | evas_textblock_cursor_copy(c, d); | 3006 | evas_textblock_cursor_copy(c, d); |
2722 | _sel_update(c, rp->object, rp->entry_data); | 3007 | _sel_update(c, rp->object, rp->entry_data); |
2723 | 3008 | ||
2724 | _edje_entry_imf_context_reset(en); | 3009 | _edje_entry_imf_context_reset(rp); |
2725 | _edje_entry_imf_cursor_info_set(en); | 3010 | _edje_entry_imf_cursor_info_set(en); |
2726 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 3011 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2727 | _edje_entry_real_part_configure(rp); | 3012 | _edje_entry_real_part_configure(rp); |
@@ -2733,7 +3018,7 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2733 | Entry *en = rp->entry_data; | 3018 | Entry *en = rp->entry_data; |
2734 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 3019 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2735 | if (!c) return; | 3020 | if (!c) return; |
2736 | _edje_entry_imf_context_reset(en); | 3021 | _edje_entry_imf_context_reset(rp); |
2737 | 3022 | ||
2738 | evas_textblock_cursor_line_char_first(c); | 3023 | evas_textblock_cursor_line_char_first(c); |
2739 | _sel_update(c, rp->object, rp->entry_data); | 3024 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2750,7 +3035,7 @@ _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2750 | Entry *en = rp->entry_data; | 3035 | Entry *en = rp->entry_data; |
2751 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 3036 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2752 | if (!c) return; | 3037 | if (!c) return; |
2753 | _edje_entry_imf_context_reset(en); | 3038 | _edje_entry_imf_context_reset(rp); |
2754 | evas_textblock_cursor_line_char_last(c); | 3039 | evas_textblock_cursor_line_char_last(c); |
2755 | _sel_update(c, rp->object, rp->entry_data); | 3040 | _sel_update(c, rp->object, rp->entry_data); |
2756 | 3041 | ||
@@ -2810,9 +3095,9 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos) | |||
2810 | if (!c) return; | 3095 | if (!c) return; |
2811 | /* Abort if cursor position didn't really change */ | 3096 | /* Abort if cursor position didn't really change */ |
2812 | if (evas_textblock_cursor_pos_get(c) == pos) | 3097 | if (evas_textblock_cursor_pos_get(c) == pos) |
2813 | return; | 3098 | return; |
2814 | 3099 | ||
2815 | _edje_entry_imf_context_reset(en); | 3100 | _edje_entry_imf_context_reset(rp); |
2816 | evas_textblock_cursor_pos_set(c, pos); | 3101 | evas_textblock_cursor_pos_set(c, pos); |
2817 | _sel_update(c, rp->object, rp->entry_data); | 3102 | _sel_update(c, rp->object, rp->entry_data); |
2818 | 3103 | ||
@@ -2855,14 +3140,14 @@ _edje_entry_input_panel_layout_get(Edje_Real_Part *rp) | |||
2855 | return EDJE_INPUT_PANEL_LAYOUT_INVALID; | 3140 | return EDJE_INPUT_PANEL_LAYOUT_INVALID; |
2856 | } | 3141 | } |
2857 | 3142 | ||
2858 | static void | 3143 | void |
2859 | _edje_entry_imf_context_reset(Entry *en) | 3144 | _edje_entry_imf_context_reset(Edje_Real_Part *rp) |
2860 | { | 3145 | { |
3146 | Entry *en = rp->entry_data; | ||
3147 | if (!en) return; | ||
2861 | #ifdef HAVE_ECORE_IMF | 3148 | #ifdef HAVE_ECORE_IMF |
2862 | if (en->imf_context) | 3149 | if (en->imf_context) |
2863 | ecore_imf_context_reset(en->imf_context); | 3150 | ecore_imf_context_reset(en->imf_context); |
2864 | #else | ||
2865 | (void) en; | ||
2866 | #endif | 3151 | #endif |
2867 | } | 3152 | } |
2868 | 3153 | ||
@@ -3019,7 +3304,6 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN | |||
3019 | { | 3304 | { |
3020 | /* delete selected characters */ | 3305 | /* delete selected characters */ |
3021 | _range_del_emit(ed, en->cursor, rp->object, en); | 3306 | _range_del_emit(ed, en->cursor, rp->object, en); |
3022 | _sel_clear(en->cursor, rp->object, en); | ||
3023 | } | 3307 | } |
3024 | 3308 | ||
3025 | /* delete preedit characters */ | 3309 | /* delete preedit characters */ |
diff --git a/libraries/edje/src/lib/edje_load.c b/libraries/edje/src/lib/edje_load.c index 8fe5842..b63cd88 100644 --- a/libraries/edje/src/lib/edje_load.c +++ b/libraries/edje/src/lib/edje_load.c | |||
@@ -132,7 +132,7 @@ edje_file_group_exists(const char *file, const char *glob) | |||
132 | edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL); | 132 | edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL); |
133 | if (!edf) | 133 | if (!edf) |
134 | return EINA_FALSE; | 134 | return EINA_FALSE; |
135 | 135 | ||
136 | for (p = glob; *p; p++) | 136 | for (p = glob; *p; p++) |
137 | { | 137 | { |
138 | if ((*p == '*') || (*p == '?') || (*p == '[')) | 138 | if ((*p == '*') || (*p == '?') || (*p == '[')) |
@@ -141,7 +141,7 @@ edje_file_group_exists(const char *file, const char *glob) | |||
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | if (is_glob) | 145 | if (is_glob) |
146 | { | 146 | { |
147 | if (!edf->collection_patterns) | 147 | if (!edf->collection_patterns) |
@@ -149,18 +149,18 @@ edje_file_group_exists(const char *file, const char *glob) | |||
149 | Edje_Part_Collection_Directory_Entry *ce; | 149 | Edje_Part_Collection_Directory_Entry *ce; |
150 | Eina_Iterator *i; | 150 | Eina_Iterator *i; |
151 | Eina_List *l = NULL; | 151 | Eina_List *l = NULL; |
152 | 152 | ||
153 | i = eina_hash_iterator_data_new(edf->collection); | 153 | i = eina_hash_iterator_data_new(edf->collection); |
154 | 154 | ||
155 | EINA_ITERATOR_FOREACH(i, ce) | 155 | EINA_ITERATOR_FOREACH(i, ce) |
156 | l = eina_list_append(l, ce); | 156 | l = eina_list_append(l, ce); |
157 | 157 | ||
158 | eina_iterator_free(i); | 158 | eina_iterator_free(i); |
159 | 159 | ||
160 | edf->collection_patterns = edje_match_collection_dir_init(l); | 160 | edf->collection_patterns = edje_match_collection_dir_init(l); |
161 | eina_list_free(l); | 161 | eina_list_free(l); |
162 | } | 162 | } |
163 | 163 | ||
164 | succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob); | 164 | succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob); |
165 | if (edf->collection_patterns) | 165 | if (edf->collection_patterns) |
166 | { | 166 | { |
@@ -226,6 +226,20 @@ _edje_programs_patterns_init(Edje *ed) | |||
226 | if (ssp->signals_patterns) | 226 | if (ssp->signals_patterns) |
227 | return; | 227 | return; |
228 | 228 | ||
229 | if (getenv("EDJE_DUMP_PROGRAMS")) | ||
230 | { | ||
231 | INF("Group '%s' programs:", ed->group); | ||
232 | #define EDJE_DUMP_PROGRAM(Section) \ | ||
233 | for (i = 0; i < ed->collection->programs.Section##_count; i++) \ | ||
234 | INF(#Section" for ('%s', '%s')", ed->collection->programs.Section[i]->signal, ed->collection->programs.Section[i]->source); | ||
235 | |||
236 | EDJE_DUMP_PROGRAM(strcmp); | ||
237 | EDJE_DUMP_PROGRAM(strncmp); | ||
238 | EDJE_DUMP_PROGRAM(strrncmp); | ||
239 | EDJE_DUMP_PROGRAM(fnmatch); | ||
240 | EDJE_DUMP_PROGRAM(nocmp); | ||
241 | } | ||
242 | |||
229 | edje_match_program_hash_build(ed->collection->programs.strcmp, | 243 | edje_match_program_hash_build(ed->collection->programs.strcmp, |
230 | ed->collection->programs.strcmp_count, | 244 | ed->collection->programs.strcmp_count, |
231 | &ssp->exact_match); | 245 | &ssp->exact_match); |
@@ -294,6 +308,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
294 | 308 | ||
295 | ed->load_error = EDJE_LOAD_ERROR_NONE; | 309 | ed->load_error = EDJE_LOAD_ERROR_NONE; |
296 | _edje_file_add(ed); | 310 | _edje_file_add(ed); |
311 | ed->block_break = 0; | ||
297 | 312 | ||
298 | if (ed->file && ed->file->external_dir) | 313 | if (ed->file && ed->file->external_dir) |
299 | { | 314 | { |
diff --git a/libraries/edje/src/lib/edje_lua2.c b/libraries/edje/src/lib/edje_lua2.c index 1d167e9..fd88f31 100644 --- a/libraries/edje/src/lib/edje_lua2.c +++ b/libraries/edje/src/lib/edje_lua2.c | |||
@@ -6,11 +6,6 @@ | |||
6 | 6 | ||
7 | #define RASTER_FORGOT_WHY "this is here." | 7 | #define RASTER_FORGOT_WHY "this is here." |
8 | 8 | ||
9 | #ifdef _WIN32 | ||
10 | # define FMT_SIZE_T "%Iu" | ||
11 | #else | ||
12 | # define FMT_SIZE_T "%zu" | ||
13 | #endif | ||
14 | 9 | ||
15 | //--------------------------------------------------------------------------// | 10 | //--------------------------------------------------------------------------// |
16 | #define MAX_LUA_MEM (4 * (1024 * 1024)) | 11 | #define MAX_LUA_MEM (4 * (1024 * 1024)) |
@@ -216,7 +211,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
216 | ela->cur += nsize - osize; | 211 | ela->cur += nsize - osize; |
217 | if (ela->cur > ela->max) | 212 | if (ela->cur > ela->max) |
218 | { | 213 | { |
219 | ERR("Lua memory limit of " FMT_SIZE_T " bytes reached (" FMT_SIZE_T " allocated)", | 214 | ERR("Lua memory limit of %zu bytes reached (%zu allocated)", |
220 | ela->max, ela->cur); | 215 | ela->max, ela->cur); |
221 | return NULL; | 216 | return NULL; |
222 | } | 217 | } |
@@ -228,7 +223,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
228 | 223 | ||
229 | ptr2 = realloc(ptr, nsize); | 224 | ptr2 = realloc(ptr, nsize); |
230 | if (ptr2) return ptr2; | 225 | if (ptr2) return ptr2; |
231 | ERR("Lua cannot re-allocate " FMT_SIZE_T " bytes", nsize); | 226 | ERR("Lua cannot re-allocate %zu bytes", nsize); |
232 | return ptr2; | 227 | return ptr2; |
233 | } | 228 | } |
234 | 229 | ||
@@ -698,7 +693,7 @@ static int | |||
698 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] | 693 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] |
699 | { | 694 | { |
700 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] | 695 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] |
701 | LD("%s\n", string); | 696 | LD("%s", string); |
702 | return 0; | 697 | return 0; |
703 | } | 698 | } |
704 | 699 | ||
@@ -2657,16 +2652,16 @@ _elua_edje_file(lua_State *L) // Stack usage [ | |||
2657 | 2652 | ||
2658 | switch (err) | 2653 | switch (err) |
2659 | { | 2654 | { |
2660 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.\n", obj->ed->file->path, group); break; | 2655 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.", obj->ed->file->path, group); break; |
2661 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.\n", obj->ed->file->path, group); break; | 2656 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.", obj->ed->file->path, group); break; |
2662 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.\n", obj->ed->file->path, group); break; | 2657 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.", obj->ed->file->path, group); break; |
2663 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.\n", obj->ed->file->path, group); break; | 2658 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.", obj->ed->file->path, group); break; |
2664 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.\n", obj->ed->file->path, group); break; | 2659 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.", obj->ed->file->path, group); break; |
2665 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.\n", obj->ed->file->path, group); break; | 2660 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.", obj->ed->file->path, group); break; |
2666 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.\n", obj->ed->file->path, group); break; | 2661 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.", obj->ed->file->path, group); break; |
2667 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.\n", obj->ed->file->path, group); break; | 2662 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.", obj->ed->file->path, group); break; |
2668 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.\n", obj->ed->file->path, group); break; | 2663 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.", obj->ed->file->path, group); break; |
2669 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.\n", obj->ed->file->path, group); break; | 2664 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.", obj->ed->file->path, group); break; |
2670 | } | 2665 | } |
2671 | } | 2666 | } |
2672 | } | 2667 | } |
@@ -2865,13 +2860,14 @@ _elua_image_image(lua_State *L) // Stack usage [ | |||
2865 | } | 2860 | } |
2866 | } | 2861 | } |
2867 | 2862 | ||
2868 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2869 | if (-1 == id) | 2863 | if (-1 == id) |
2870 | { | 2864 | { |
2871 | LI("Image %s not found in our edje file, trying external image file %s.\n", key, file); | 2865 | LE("Image %s not found in our edje file.", key); |
2866 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2867 | LI("Image %s not found in our edje file, trying external image file %s.", key, file); | ||
2872 | evas_object_image_file_set(elo->evas_obj, file, key); | 2868 | evas_object_image_file_set(elo->evas_obj, file, key); |
2869 | */ | ||
2873 | } | 2870 | } |
2874 | */ | ||
2875 | } | 2871 | } |
2876 | evas_object_image_file_get(elo->evas_obj, &file, &key); | 2872 | evas_object_image_file_get(elo->evas_obj, &file, &key); |
2877 | _elua_ret(L, "$file $key", file, key); | 2873 | _elua_ret(L, "$file $key", file, key); |
diff --git a/libraries/edje/src/lib/edje_main.c b/libraries/edje/src/lib/edje_main.c index 5d011ad..f70efb9 100644 --- a/libraries/edje/src/lib/edje_main.c +++ b/libraries/edje/src/lib/edje_main.c | |||
@@ -233,6 +233,11 @@ _edje_del(Edje *ed) | |||
233 | eina_stringshare_del(cb->part); | 233 | eina_stringshare_del(cb->part); |
234 | free(cb); | 234 | free(cb); |
235 | } | 235 | } |
236 | EINA_LIST_FREE(ed->markup_filter_callbacks, cb) | ||
237 | { | ||
238 | eina_stringshare_del(cb->part); | ||
239 | free(cb); | ||
240 | } | ||
236 | 241 | ||
237 | if (ed->members.text_class) | 242 | if (ed->members.text_class) |
238 | { | 243 | { |
diff --git a/libraries/edje/src/lib/edje_multisense.c b/libraries/edje/src/lib/edje_multisense.c index f3324e7..a35b223 100644 --- a/libraries/edje/src/lib/edje_multisense.c +++ b/libraries/edje/src/lib/edje_multisense.c | |||
@@ -1,8 +1,3 @@ | |||
1 | #include "config.h" | ||
2 | #include <string.h> | ||
3 | #include <fcntl.h> | ||
4 | #include <Eina.h> | ||
5 | #include <Edje.h> | ||
6 | #include "edje_private.h" | 1 | #include "edje_private.h" |
7 | 2 | ||
8 | typedef struct _Multisense_Data | 3 | typedef struct _Multisense_Data |
diff --git a/libraries/edje/src/lib/edje_private.h b/libraries/edje/src/lib/edje_private.h index 8bf18eb..1d5aee9 100644 --- a/libraries/edje/src/lib/edje_private.h +++ b/libraries/edje/src/lib/edje_private.h | |||
@@ -9,18 +9,30 @@ | |||
9 | # define _GNU_SOURCE | 9 | # define _GNU_SOURCE |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #ifdef STDC_HEADERS | ||
13 | # include <stdlib.h> | ||
14 | # include <stddef.h> | ||
15 | #else | ||
16 | # ifdef HAVE_STDLIB_H | ||
17 | # include <stdlib.h> | ||
18 | # endif | ||
19 | #endif | ||
12 | #ifdef HAVE_ALLOCA_H | 20 | #ifdef HAVE_ALLOCA_H |
13 | # include <alloca.h> | 21 | # include <alloca.h> |
14 | #elif defined __GNUC__ | 22 | #elif !defined alloca |
15 | # define alloca __builtin_alloca | 23 | # ifdef __GNUC__ |
16 | #elif defined _AIX | 24 | # define alloca __builtin_alloca |
17 | # define alloca __alloca | 25 | # elif defined _AIX |
18 | #elif defined _MSC_VER | 26 | # define alloca __alloca |
19 | # include <malloc.h> | 27 | # elif defined _MSC_VER |
20 | # define alloca _alloca | 28 | # include <malloc.h> |
21 | #else | 29 | # define alloca _alloca |
22 | # include <stddef.h> | 30 | # elif !defined HAVE_ALLOCA |
31 | # ifdef __cplusplus | ||
32 | extern "C" | ||
33 | # endif | ||
23 | void *alloca (size_t); | 34 | void *alloca (size_t); |
35 | # endif | ||
24 | #endif | 36 | #endif |
25 | 37 | ||
26 | #include <string.h> | 38 | #include <string.h> |
@@ -35,6 +47,8 @@ void *alloca (size_t); | |||
35 | # include <unistd.h> | 47 | # include <unistd.h> |
36 | #endif | 48 | #endif |
37 | 49 | ||
50 | #include <fcntl.h> | ||
51 | |||
38 | #include <lua.h> | 52 | #include <lua.h> |
39 | #include <lualib.h> | 53 | #include <lualib.h> |
40 | #include <lauxlib.h> | 54 | #include <lauxlib.h> |
@@ -62,7 +76,7 @@ void *alloca (size_t); | |||
62 | 76 | ||
63 | #include "Edje.h" | 77 | #include "Edje.h" |
64 | 78 | ||
65 | EAPI extern int _edje_default_log_dom ; | 79 | EAPI extern int _edje_default_log_dom ; |
66 | 80 | ||
67 | #ifdef EDJE_DEFAULT_LOG_COLOR | 81 | #ifdef EDJE_DEFAULT_LOG_COLOR |
68 | # undef EDJE_DEFAULT_LOG_COLOR | 82 | # undef EDJE_DEFAULT_LOG_COLOR |
@@ -84,6 +98,10 @@ EAPI extern int _edje_default_log_dom ; | |||
84 | # undef CRIT | 98 | # undef CRIT |
85 | #endif | 99 | #endif |
86 | #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__) | 100 | #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__) |
101 | #ifdef DBG | ||
102 | # undef DBG | ||
103 | #endif | ||
104 | #define DBG(...) EINA_LOG_DOM_DBG(_edje_default_log_dom, __VA_ARGS__) | ||
87 | #ifdef __GNUC__ | 105 | #ifdef __GNUC__ |
88 | # if __GNUC__ >= 4 | 106 | # if __GNUC__ >= 4 |
89 | // BROKEN in gcc 4 on amd64 | 107 | // BROKEN in gcc 4 on amd64 |
@@ -173,7 +191,7 @@ struct _Edje_Smart_Api | |||
173 | /* increment this when you add new feature to edje file format without | 191 | /* increment this when you add new feature to edje file format without |
174 | * breaking backward compatibility. | 192 | * breaking backward compatibility. |
175 | */ | 193 | */ |
176 | #define EDJE_FILE_MINOR 2 | 194 | #define EDJE_FILE_MINOR 3 |
177 | 195 | ||
178 | /* FIXME: | 196 | /* FIXME: |
179 | * | 197 | * |
@@ -218,6 +236,7 @@ struct _Edje_Position | |||
218 | struct _Edje_Size | 236 | struct _Edje_Size |
219 | { | 237 | { |
220 | int w, h; | 238 | int w, h; |
239 | Eina_Bool limit; /* should we limit ourself to the size of the source */ | ||
221 | }; | 240 | }; |
222 | 241 | ||
223 | struct _Edje_Rectangle | 242 | struct _Edje_Rectangle |
@@ -322,6 +341,7 @@ typedef struct _Edje_Var_Timer Edje_Var_Timer; | |||
322 | typedef struct _Edje_Var_Pool Edje_Var_Pool; | 341 | typedef struct _Edje_Var_Pool Edje_Var_Pool; |
323 | typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char; | 342 | typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char; |
324 | typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback; | 343 | typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback; |
344 | typedef struct _Edje_Markup_Filter_Callback Edje_Markup_Filter_Callback; | ||
325 | 345 | ||
326 | #define EDJE_INF_MAX_W 100000 | 346 | #define EDJE_INF_MAX_W 100000 |
327 | #define EDJE_INF_MAX_H 100000 | 347 | #define EDJE_INF_MAX_H 100000 |
@@ -612,6 +632,8 @@ struct _Edje_Program /* a conditional program to be run */ | |||
612 | int src; /* part where parameter is being retrieved */ | 632 | int src; /* part where parameter is being retrieved */ |
613 | int dst; /* part where parameter is being stored */ | 633 | int dst; /* part where parameter is being stored */ |
614 | } param; | 634 | } param; |
635 | |||
636 | Eina_Bool exec : 1; | ||
615 | }; | 637 | }; |
616 | 638 | ||
617 | struct _Edje_Program_Target /* the target of an action */ | 639 | struct _Edje_Program_Target /* the target of an action */ |
@@ -752,6 +774,8 @@ struct _Edje_Part_Collection | |||
752 | 774 | ||
753 | unsigned char lua_script_only; | 775 | unsigned char lua_script_only; |
754 | 776 | ||
777 | unsigned char broadcast_signal; | ||
778 | |||
755 | unsigned char checked : 1; | 779 | unsigned char checked : 1; |
756 | }; | 780 | }; |
757 | 781 | ||
@@ -839,7 +863,7 @@ struct _Edje_Part_Description_Common | |||
839 | unsigned char have; | 863 | unsigned char have; |
840 | FLOAT_T w, h; | 864 | FLOAT_T w, h; |
841 | } minmul; | 865 | } minmul; |
842 | 866 | ||
843 | Edje_Size min, max; | 867 | Edje_Size min, max; |
844 | Edje_Position step; /* size stepping by n pixels, 0 = none */ | 868 | Edje_Position step; /* size stepping by n pixels, 0 = none */ |
845 | Edje_Aspect_Prefer aspect; | 869 | Edje_Aspect_Prefer aspect; |
@@ -1074,6 +1098,7 @@ struct _Edje | |||
1074 | Edje_Real_Part *focused_part; | 1098 | Edje_Real_Part *focused_part; |
1075 | Eina_List *subobjs; | 1099 | Eina_List *subobjs; |
1076 | Eina_List *text_insert_filter_callbacks; | 1100 | Eina_List *text_insert_filter_callbacks; |
1101 | Eina_List *markup_filter_callbacks; | ||
1077 | void *script_only_data; | 1102 | void *script_only_data; |
1078 | 1103 | ||
1079 | int table_programs_size; | 1104 | int table_programs_size; |
@@ -1145,6 +1170,8 @@ struct _Edje | |||
1145 | #endif | 1170 | #endif |
1146 | unsigned int have_mapped_part : 1; | 1171 | unsigned int have_mapped_part : 1; |
1147 | unsigned int recalc_call : 1; | 1172 | unsigned int recalc_call : 1; |
1173 | unsigned int update_hints : 1; | ||
1174 | unsigned int recalc_hints : 1; | ||
1148 | }; | 1175 | }; |
1149 | 1176 | ||
1150 | struct _Edje_Calc_Params | 1177 | struct _Edje_Calc_Params |
@@ -1179,7 +1206,7 @@ struct _Edje_Calc_Params | |||
1179 | int x, y, z; | 1206 | int x, y, z; |
1180 | } center; // 12 | 1207 | } center; // 12 |
1181 | struct { | 1208 | struct { |
1182 | double x, y, z; | 1209 | FLOAT_T x, y, z; |
1183 | } rotation; // 24 | 1210 | } rotation; // 24 |
1184 | struct { | 1211 | struct { |
1185 | int x, y, z; | 1212 | int x, y, z; |
@@ -1334,6 +1361,13 @@ struct _Edje_Text_Insert_Filter_Callback | |||
1334 | void *data; | 1361 | void *data; |
1335 | }; | 1362 | }; |
1336 | 1363 | ||
1364 | struct _Edje_Markup_Filter_Callback | ||
1365 | { | ||
1366 | const char *part; | ||
1367 | Edje_Markup_Filter_Cb func; | ||
1368 | void *data; | ||
1369 | }; | ||
1370 | |||
1337 | struct _Edje_Pending_Program | 1371 | struct _Edje_Pending_Program |
1338 | { | 1372 | { |
1339 | Edje *edje; | 1373 | Edje *edje; |
@@ -1907,10 +1941,11 @@ const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp); | |||
1907 | Eina_Bool _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); | 1941 | Eina_Bool _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); |
1908 | const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp); | 1942 | const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp); |
1909 | void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); | 1943 | void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); |
1944 | void _edje_entry_user_insert(Edje_Real_Part *rp, const char *text); | ||
1910 | void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow); | 1945 | void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow); |
1911 | Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp); | 1946 | Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp); |
1912 | void _edje_entry_select_abort(Edje_Real_Part *rp); | 1947 | void _edje_entry_select_abort(Edje_Real_Part *rp); |
1913 | 1948 | void *_edje_entry_imf_context_get(Edje_Real_Part *rp); | |
1914 | Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur); | 1949 | Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur); |
1915 | Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur); | 1950 | Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur); |
1916 | Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur); | 1951 | Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur); |
@@ -1925,12 +1960,25 @@ Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Curs | |||
1925 | char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1960 | char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1926 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); | 1961 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); |
1927 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1962 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1963 | void _edje_entry_imf_context_reset(Edje_Real_Part *rp); | ||
1928 | void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); | 1964 | void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); |
1929 | Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp); | 1965 | Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp); |
1930 | void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type); | 1966 | void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type); |
1931 | Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp); | 1967 | Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp); |
1968 | void _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction); | ||
1969 | Eina_Bool _edje_entry_prediction_allow_get(Edje_Real_Part *rp); | ||
1932 | void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled); | 1970 | void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled); |
1933 | Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp); | 1971 | Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp); |
1972 | void _edje_entry_input_panel_show(Edje_Real_Part *rp); | ||
1973 | void _edje_entry_input_panel_hide(Edje_Real_Part *rp); | ||
1974 | void _edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang); | ||
1975 | Edje_Input_Panel_Lang _edje_entry_input_panel_language_get(Edje_Real_Part *rp); | ||
1976 | void _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len); | ||
1977 | void _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len); | ||
1978 | void _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type); | ||
1979 | Edje_Input_Panel_Return_Key_Type _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp); | ||
1980 | void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled); | ||
1981 | Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp); | ||
1934 | 1982 | ||
1935 | void _edje_external_init(); | 1983 | void _edje_external_init(); |
1936 | void _edje_external_shutdown(); | 1984 | void _edje_external_shutdown(); |
diff --git a/libraries/edje/src/lib/edje_program.c b/libraries/edje/src/lib/edje_program.c index d80c7c9..d631364 100644 --- a/libraries/edje/src/lib/edje_program.c +++ b/libraries/edje/src/lib/edje_program.c | |||
@@ -531,7 +531,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, | |||
531 | } | 531 | } |
532 | 532 | ||
533 | if (rp->program) | 533 | if (rp->program) |
534 | _edje_program_end(ed, rp->program); | 534 | _edje_program_end(ed, rp->program); |
535 | _edje_part_description_apply(ed, rp, | 535 | _edje_part_description_apply(ed, rp, |
536 | rp->param1.description->state.name, | 536 | rp->param1.description->state.name, |
537 | rp->param1.description->state.value, | 537 | rp->param1.description->state.value, |
@@ -570,7 +570,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, | |||
570 | if (rp) | 570 | if (rp) |
571 | { | 571 | { |
572 | if (rp->program) | 572 | if (rp->program) |
573 | _edje_program_end(ed, rp->program); | 573 | _edje_program_end(ed, rp->program); |
574 | _edje_part_description_apply(ed, rp, | 574 | _edje_part_description_apply(ed, rp, |
575 | pr->state, | 575 | pr->state, |
576 | pr->value, | 576 | pr->value, |
@@ -873,8 +873,11 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
873 | { | 873 | { |
874 | Edje_Message_Signal emsg; | 874 | Edje_Message_Signal emsg; |
875 | const char *sep; | 875 | const char *sep; |
876 | Eina_Bool broadcast; | ||
876 | 877 | ||
878 | if (!ed->collection) return; | ||
877 | if (ed->delete_me) return; | 879 | if (ed->delete_me) return; |
880 | broadcast = ed->collection->broadcast_signal; | ||
878 | 881 | ||
879 | sep = strchr(sig, EDJE_PART_PATH_SEPARATOR); | 882 | sep = strchr(sig, EDJE_PART_PATH_SEPARATOR); |
880 | 883 | ||
@@ -958,6 +961,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
958 | if (!ed2) goto end; | 961 | if (!ed2) goto end; |
959 | 962 | ||
960 | _edje_emit(ed2, newsig, src); | 963 | _edje_emit(ed2, newsig, src); |
964 | broadcast = EINA_FALSE; | ||
961 | break; | 965 | break; |
962 | 966 | ||
963 | case EDJE_PART_TYPE_EXTERNAL: | 967 | case EDJE_PART_TYPE_EXTERNAL: |
@@ -976,6 +980,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
976 | if (!ed2) goto end; | 980 | if (!ed2) goto end; |
977 | _edje_emit(ed2, newsig, src); | 981 | _edje_emit(ed2, newsig, src); |
978 | } | 982 | } |
983 | broadcast = EINA_FALSE; | ||
979 | break ; | 984 | break ; |
980 | 985 | ||
981 | case EDJE_PART_TYPE_BOX: | 986 | case EDJE_PART_TYPE_BOX: |
@@ -988,6 +993,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
988 | ed2 = _edje_fetch(child); | 993 | ed2 = _edje_fetch(child); |
989 | if (!ed2) goto end; | 994 | if (!ed2) goto end; |
990 | _edje_emit(ed2, newsig, src); | 995 | _edje_emit(ed2, newsig, src); |
996 | broadcast = EINA_FALSE; | ||
991 | } | 997 | } |
992 | break ; | 998 | break ; |
993 | 999 | ||
@@ -1012,7 +1018,10 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
1012 | emsg.data = NULL; | 1018 | emsg.data = NULL; |
1013 | } | 1019 | } |
1014 | /* new sends code */ | 1020 | /* new sends code */ |
1015 | edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg); | 1021 | if (broadcast) |
1022 | edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg); | ||
1023 | else | ||
1024 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); | ||
1016 | /* old send code - use api now | 1025 | /* old send code - use api now |
1017 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); | 1026 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); |
1018 | EINA_LIST_FOREACH(ed->subobjs, l, obj) | 1027 | EINA_LIST_FOREACH(ed->subobjs, l, obj) |
@@ -1037,12 +1046,8 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
1037 | 1046 | ||
1038 | struct _Edje_Program_Data | 1047 | struct _Edje_Program_Data |
1039 | { | 1048 | { |
1040 | #ifdef EDJE_PROGRAM_CACHE | ||
1041 | Eina_List *matches; | 1049 | Eina_List *matches; |
1042 | int matched; | ||
1043 | #endif | ||
1044 | Edje *ed; | 1050 | Edje *ed; |
1045 | const char *signal; | ||
1046 | const char *source; | 1051 | const char *source; |
1047 | }; | 1052 | }; |
1048 | 1053 | ||
@@ -1056,33 +1061,16 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt) | |||
1056 | { | 1061 | { |
1057 | rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source); | 1062 | rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source); |
1058 | if (rp) | 1063 | if (rp) |
1059 | exec = (rp->chosen_description->state.name == pr->filter.state); | 1064 | exec = (rp->chosen_description->state.name == pr->filter.state); |
1060 | } | 1065 | } |
1061 | 1066 | ||
1062 | #ifdef EDJE_PROGRAM_CACHE | 1067 | pr->exec = exec; |
1063 | data->matched++; | ||
1064 | #endif | ||
1065 | |||
1066 | if (exec) | ||
1067 | _edje_program_run(data->ed, pr, 0, data->signal, data->source); | ||
1068 | 1068 | ||
1069 | if (_edje_block_break(data->ed)) | ||
1070 | { | ||
1071 | #ifdef EDJE_PROGRAM_CACHE | ||
1072 | eina_list_free(data->matches); | ||
1073 | data->matches = NULL; | ||
1074 | #endif | ||
1075 | return EINA_TRUE; | ||
1076 | } | ||
1077 | |||
1078 | #ifdef EDJE_PROGRAM_CACHE | ||
1079 | data->matches = eina_list_append(data->matches, pr); | 1069 | data->matches = eina_list_append(data->matches, pr); |
1080 | #endif | ||
1081 | 1070 | ||
1082 | return EINA_FALSE; | 1071 | return EINA_FALSE; |
1083 | } | 1072 | } |
1084 | 1073 | ||
1085 | |||
1086 | void | 1074 | void |
1087 | _edje_callbacks_patterns_clean(Edje *ed) | 1075 | _edje_callbacks_patterns_clean(Edje *ed) |
1088 | { | 1076 | { |
@@ -1127,7 +1115,7 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1127 | 1115 | ||
1128 | if (ed->collection && ed->L) | 1116 | if (ed->collection && ed->L) |
1129 | _edje_lua2_script_func_signal(ed, sig, src); | 1117 | _edje_lua2_script_func_signal(ed, sig, src); |
1130 | 1118 | ||
1131 | if (ed->collection) | 1119 | if (ed->collection) |
1132 | { | 1120 | { |
1133 | #ifdef EDJE_PROGRAM_CACHE | 1121 | #ifdef EDJE_PROGRAM_CACHE |
@@ -1156,11 +1144,11 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1156 | 1144 | ||
1157 | if (eina_hash_find(ec->prog_cache.no_matches, tmps)) | 1145 | if (eina_hash_find(ec->prog_cache.no_matches, tmps)) |
1158 | { | 1146 | { |
1159 | done = 1; | 1147 | done = 1; |
1160 | } | 1148 | } |
1161 | else if ((matches = eina_hash_find(ec->prog_cache.matches, tmps))) | 1149 | else if ((matches = eina_hash_find(ec->prog_cache.matches, tmps))) |
1162 | { | 1150 | { |
1163 | EINA_LIST_FOREACH(matches, l, pr) | 1151 | EINA_LIST_FOREACH(matches, l, pr) |
1164 | { | 1152 | { |
1165 | Eina_Bool exec = EINA_TRUE; | 1153 | Eina_Bool exec = EINA_TRUE; |
1166 | 1154 | ||
@@ -1169,10 +1157,12 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1169 | Edje_Real_Part *rp; | 1157 | Edje_Real_Part *rp; |
1170 | 1158 | ||
1171 | rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src); | 1159 | rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src); |
1172 | if (rp) | 1160 | if (rp && !rp->program) |
1173 | exec = (rp->chosen_description->state.name == pr->filter.state); | 1161 | exec = (rp->chosen_description->state.name == pr->filter.state); |
1174 | } | 1162 | } |
1175 | 1163 | ||
1164 | pr->exec = exec; | ||
1165 | #if 0 | ||
1176 | if (exec) | 1166 | if (exec) |
1177 | { | 1167 | { |
1178 | _edje_program_run(ed, pr, 0, sig, src); | 1168 | _edje_program_run(ed, pr, 0, sig, src); |
@@ -1181,7 +1171,19 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1181 | goto break_prog; | 1171 | goto break_prog; |
1182 | } | 1172 | } |
1183 | } | 1173 | } |
1174 | #endif | ||
1184 | } | 1175 | } |
1176 | |||
1177 | EINA_LIST_FOREACH(matches, l, pr) | ||
1178 | if (pr->exec) | ||
1179 | { | ||
1180 | _edje_program_run(ed, pr, 0, sig, src); | ||
1181 | if (_edje_block_break(ed)) | ||
1182 | { | ||
1183 | goto break_prog; | ||
1184 | } | ||
1185 | } | ||
1186 | |||
1185 | done = 1; | 1187 | done = 1; |
1186 | } | 1188 | } |
1187 | } | 1189 | } |
@@ -1192,11 +1194,8 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1192 | 1194 | ||
1193 | data.ed = ed; | 1195 | data.ed = ed; |
1194 | data.source = src; | 1196 | data.source = src; |
1195 | data.signal = sig; | ||
1196 | #ifdef EDJE_PROGRAM_CACHE | ||
1197 | data.matched = 0; | ||
1198 | data.matches = NULL; | 1197 | data.matches = NULL; |
1199 | #endif | 1198 | |
1200 | if (ed->table_programs_size > 0) | 1199 | if (ed->table_programs_size > 0) |
1201 | { | 1200 | { |
1202 | const Eina_List *match; | 1201 | const Eina_List *match; |
@@ -1218,12 +1217,29 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1218 | ed->patterns.programs.exact_match); | 1217 | ed->patterns.programs.exact_match); |
1219 | EINA_LIST_FOREACH(match, l, pr) | 1218 | EINA_LIST_FOREACH(match, l, pr) |
1220 | _edje_glob_callback(pr, &data); | 1219 | _edje_glob_callback(pr, &data); |
1220 | |||
1221 | #ifdef EDJE_PROGRAM_CACHE | ||
1222 | EINA_LIST_FOREACH(data.matches, l, pr) | ||
1223 | #else | ||
1224 | EINA_LIST_FREE(data.matches, pr) | ||
1225 | #endif | ||
1226 | { | ||
1227 | if (pr->exec) | ||
1228 | _edje_program_run(ed, pr, 0, sig, src); | ||
1229 | |||
1230 | if (_edje_block_break(ed)) | ||
1231 | { | ||
1232 | eina_list_free(data.matches); | ||
1233 | data.matches = NULL; | ||
1234 | goto break_prog; | ||
1235 | } | ||
1236 | } | ||
1221 | } | 1237 | } |
1222 | 1238 | ||
1223 | #ifdef EDJE_PROGRAM_CACHE | 1239 | #ifdef EDJE_PROGRAM_CACHE |
1224 | if (tmps) | 1240 | if (tmps) |
1225 | { | 1241 | { |
1226 | if (data.matched == 0) | 1242 | if (data.matches == NULL) |
1227 | { | 1243 | { |
1228 | if (!ec->prog_cache.no_matches) | 1244 | if (!ec->prog_cache.no_matches) |
1229 | ec->prog_cache.no_matches = eina_hash_string_superfast_new(NULL); | 1245 | ec->prog_cache.no_matches = eina_hash_string_superfast_new(NULL); |
diff --git a/libraries/edje/src/lib/edje_util.c b/libraries/edje/src/lib/edje_util.c index 2205ba3..4ce22b5 100644 --- a/libraries/edje/src/lib/edje_util.c +++ b/libraries/edje/src/lib/edje_util.c | |||
@@ -905,7 +905,7 @@ edje_object_part_exists(const Evas_Object *obj, const char *part) | |||
905 | 905 | ||
906 | ed = _edje_fetch(obj); | 906 | ed = _edje_fetch(obj); |
907 | if ((!ed) || (!part)) return EINA_FALSE; | 907 | if ((!ed) || (!part)) return EINA_FALSE; |
908 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 908 | rp = _edje_real_part_recursive_get(ed, part); |
909 | if (!rp) return EINA_FALSE; | 909 | if (!rp) return EINA_FALSE; |
910 | return EINA_TRUE; | 910 | return EINA_TRUE; |
911 | } | 911 | } |
@@ -922,7 +922,7 @@ edje_object_part_object_get(const Evas_Object *obj, const char *part) | |||
922 | /* Need to recalc before providing the object. */ | 922 | /* Need to recalc before providing the object. */ |
923 | _edje_recalc_do(ed); | 923 | _edje_recalc_do(ed); |
924 | 924 | ||
925 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 925 | rp = _edje_real_part_recursive_get(ed, part); |
926 | if (!rp) return NULL; | 926 | if (!rp) return NULL; |
927 | return rp->object; | 927 | return rp->object; |
928 | } | 928 | } |
@@ -946,7 +946,7 @@ edje_object_part_geometry_get(const Evas_Object *obj, const char *part, Evas_Coo | |||
946 | /* Need to recalc before providing the object. */ | 946 | /* Need to recalc before providing the object. */ |
947 | _edje_recalc_do(ed); | 947 | _edje_recalc_do(ed); |
948 | 948 | ||
949 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 949 | rp = _edje_real_part_recursive_get(ed, part); |
950 | if (!rp) | 950 | if (!rp) |
951 | { | 951 | { |
952 | if (x) *x = 0; | 952 | if (x) *x = 0; |
@@ -1014,6 +1014,7 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char | |||
1014 | if (text) rp->text.text = eina_stringshare_add(text); | 1014 | if (text) rp->text.text = eina_stringshare_add(text); |
1015 | rp->edje->dirty = 1; | 1015 | rp->edje->dirty = 1; |
1016 | rp->edje->recalc_call = 1; | 1016 | rp->edje->recalc_call = 1; |
1017 | rp->edje->recalc_hints = 1; | ||
1017 | #ifdef EDJE_CALC_CACHE | 1018 | #ifdef EDJE_CALC_CACHE |
1018 | rp->invalidate = 1; | 1019 | rp->invalidate = 1; |
1019 | #endif | 1020 | #endif |
@@ -1058,6 +1059,63 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch | |||
1058 | return EINA_TRUE; | 1059 | return EINA_TRUE; |
1059 | } | 1060 | } |
1060 | 1061 | ||
1062 | EAPI void | ||
1063 | edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, | ||
1064 | const char *style) | ||
1065 | { | ||
1066 | Edje *ed; | ||
1067 | Edje_Real_Part *rp; | ||
1068 | Evas_Textblock_Style *ts; | ||
1069 | |||
1070 | ed = _edje_fetch(obj); | ||
1071 | if ((!ed) || (!part) || (!style)) return; | ||
1072 | rp = _edje_real_part_recursive_get(ed, part); | ||
1073 | if (!rp) return; | ||
1074 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; | ||
1075 | |||
1076 | ts = evas_textblock_style_new(); | ||
1077 | evas_textblock_style_set(ts, style); | ||
1078 | evas_object_textblock_style_user_push(rp->object, ts); | ||
1079 | evas_textblock_style_free(ts); | ||
1080 | ed->recalc_hints = 1; | ||
1081 | } | ||
1082 | |||
1083 | EAPI void | ||
1084 | edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part) | ||
1085 | { | ||
1086 | Edje *ed; | ||
1087 | Edje_Real_Part *rp; | ||
1088 | |||
1089 | ed = _edje_fetch(obj); | ||
1090 | if ((!ed) || (!part)) return; | ||
1091 | rp = _edje_real_part_recursive_get(ed, part); | ||
1092 | if (!rp) return; | ||
1093 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; | ||
1094 | |||
1095 | evas_object_textblock_style_user_pop(rp->object); | ||
1096 | ed->recalc_hints = 1; | ||
1097 | } | ||
1098 | |||
1099 | EAPI const char * | ||
1100 | edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part) | ||
1101 | { | ||
1102 | Edje *ed; | ||
1103 | Edje_Real_Part *rp; | ||
1104 | const Evas_Textblock_Style *ts; | ||
1105 | |||
1106 | ed = _edje_fetch(obj); | ||
1107 | if ((!ed) || (!part)) return NULL; | ||
1108 | rp = _edje_real_part_recursive_get(ed, part); | ||
1109 | if (!rp) return NULL; | ||
1110 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return NULL; | ||
1111 | |||
1112 | ts = evas_object_textblock_style_user_peek(rp->object); | ||
1113 | if (ts) | ||
1114 | return evas_textblock_style_get(ts); | ||
1115 | else | ||
1116 | return NULL; | ||
1117 | } | ||
1118 | |||
1061 | EAPI Eina_Bool | 1119 | EAPI Eina_Bool |
1062 | edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) | 1120 | edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) |
1063 | { | 1121 | { |
@@ -1066,7 +1124,7 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) | |||
1066 | 1124 | ||
1067 | ed = _edje_fetch(obj); | 1125 | ed = _edje_fetch(obj); |
1068 | if ((!ed) || (!part)) return EINA_FALSE; | 1126 | if ((!ed) || (!part)) return EINA_FALSE; |
1069 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1127 | rp = _edje_real_part_recursive_get(ed, part); |
1070 | if (!rp) return EINA_FALSE; | 1128 | if (!rp) return EINA_FALSE; |
1071 | if ((rp->part->type != EDJE_PART_TYPE_TEXT) && | 1129 | if ((rp->part->type != EDJE_PART_TYPE_TEXT) && |
1072 | (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE; | 1130 | (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE; |
@@ -1085,7 +1143,7 @@ edje_object_part_text_get(const Evas_Object *obj, const char *part) | |||
1085 | /* Need to recalc before providing the object. */ | 1143 | /* Need to recalc before providing the object. */ |
1086 | _edje_recalc_do(ed); | 1144 | _edje_recalc_do(ed); |
1087 | 1145 | ||
1088 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1146 | rp = _edje_real_part_recursive_get(ed, part); |
1089 | if (!rp) return NULL; | 1147 | if (!rp) return NULL; |
1090 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1148 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1091 | return _edje_entry_text_get(rp); | 1149 | return _edje_entry_text_get(rp); |
@@ -1241,7 +1299,7 @@ edje_object_part_text_unescaped_get(const Evas_Object *obj, const char *part) | |||
1241 | /* Need to recalc before providing the object. */ | 1299 | /* Need to recalc before providing the object. */ |
1242 | _edje_recalc_do(ed); | 1300 | _edje_recalc_do(ed); |
1243 | 1301 | ||
1244 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1302 | rp = _edje_real_part_recursive_get(ed, part); |
1245 | if (!rp) return NULL; | 1303 | if (!rp) return NULL; |
1246 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1304 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1247 | { | 1305 | { |
@@ -1268,7 +1326,7 @@ edje_object_part_text_selection_get(const Evas_Object *obj, const char *part) | |||
1268 | 1326 | ||
1269 | ed = _edje_fetch(obj); | 1327 | ed = _edje_fetch(obj); |
1270 | if ((!ed) || (!part)) return NULL; | 1328 | if ((!ed) || (!part)) return NULL; |
1271 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1329 | rp = _edje_real_part_recursive_get(ed, part); |
1272 | if (!rp) return NULL; | 1330 | if (!rp) return NULL; |
1273 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1331 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1274 | return _edje_entry_selection_get(rp); | 1332 | return _edje_entry_selection_get(rp); |
@@ -1283,7 +1341,7 @@ edje_object_part_text_select_none(const Evas_Object *obj, const char *part) | |||
1283 | 1341 | ||
1284 | ed = _edje_fetch(obj); | 1342 | ed = _edje_fetch(obj); |
1285 | if ((!ed) || (!part)) return; | 1343 | if ((!ed) || (!part)) return; |
1286 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1344 | rp = _edje_real_part_recursive_get(ed, part); |
1287 | if (!rp) return; | 1345 | if (!rp) return; |
1288 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1346 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1289 | _edje_entry_select_none(rp); | 1347 | _edje_entry_select_none(rp); |
@@ -1297,7 +1355,7 @@ edje_object_part_text_select_all(const Evas_Object *obj, const char *part) | |||
1297 | 1355 | ||
1298 | ed = _edje_fetch(obj); | 1356 | ed = _edje_fetch(obj); |
1299 | if ((!ed) || (!part)) return; | 1357 | if ((!ed) || (!part)) return; |
1300 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1358 | rp = _edje_real_part_recursive_get(ed, part); |
1301 | if (!rp) return; | 1359 | if (!rp) return; |
1302 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1360 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1303 | _edje_entry_select_all(rp); | 1361 | _edje_entry_select_all(rp); |
@@ -1311,13 +1369,14 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex | |||
1311 | 1369 | ||
1312 | ed = _edje_fetch(obj); | 1370 | ed = _edje_fetch(obj); |
1313 | if ((!ed) || (!part)) return; | 1371 | if ((!ed) || (!part)) return; |
1314 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1372 | rp = _edje_real_part_recursive_get(ed, part); |
1315 | if (!rp) return; | 1373 | if (!rp) return; |
1316 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; | 1374 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; |
1317 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; | 1375 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; |
1318 | _edje_entry_text_markup_insert(rp, text); | 1376 | _edje_entry_text_markup_insert(rp, text); |
1319 | rp->edje->dirty = 1; | 1377 | rp->edje->dirty = 1; |
1320 | rp->edje->recalc_call = 1; | 1378 | rp->edje->recalc_call = 1; |
1379 | rp->edje->recalc_hints = 1; | ||
1321 | #ifdef EDJE_CALC_CACHE | 1380 | #ifdef EDJE_CALC_CACHE |
1322 | rp->invalidate = 1; | 1381 | rp->invalidate = 1; |
1323 | #endif | 1382 | #endif |
@@ -1334,12 +1393,13 @@ edje_object_part_text_append(Evas_Object *obj, const char *part, const char *tex | |||
1334 | 1393 | ||
1335 | ed = _edje_fetch(obj); | 1394 | ed = _edje_fetch(obj); |
1336 | if ((!ed) || (!part)) return; | 1395 | if ((!ed) || (!part)) return; |
1337 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1396 | rp = _edje_real_part_recursive_get(ed, part); |
1338 | if (!rp) return; | 1397 | if (!rp) return; |
1339 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; | 1398 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; |
1340 | _edje_object_part_text_raw_append(obj, rp, part, text); | 1399 | _edje_object_part_text_raw_append(obj, rp, part, text); |
1341 | rp->edje->dirty = 1; | 1400 | rp->edje->dirty = 1; |
1342 | rp->edje->recalc_call = 1; | 1401 | rp->edje->recalc_call = 1; |
1402 | rp->edje->recalc_hints = 1; | ||
1343 | #ifdef EDJE_CALC_CACHE | 1403 | #ifdef EDJE_CALC_CACHE |
1344 | rp->invalidate = 1; | 1404 | rp->invalidate = 1; |
1345 | #endif | 1405 | #endif |
@@ -1356,7 +1416,7 @@ edje_object_part_text_anchor_list_get(const Evas_Object *obj, const char *part) | |||
1356 | 1416 | ||
1357 | ed = _edje_fetch(obj); | 1417 | ed = _edje_fetch(obj); |
1358 | if ((!ed) || (!part)) return NULL; | 1418 | if ((!ed) || (!part)) return NULL; |
1359 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1419 | rp = _edje_real_part_recursive_get(ed, part); |
1360 | if (!rp) return NULL; | 1420 | if (!rp) return NULL; |
1361 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1421 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1362 | return _edje_entry_anchors_list(rp); | 1422 | return _edje_entry_anchors_list(rp); |
@@ -1371,7 +1431,7 @@ edje_object_part_text_anchor_geometry_get(const Evas_Object *obj, const char *pa | |||
1371 | 1431 | ||
1372 | ed = _edje_fetch(obj); | 1432 | ed = _edje_fetch(obj); |
1373 | if ((!ed) || (!part)) return NULL; | 1433 | if ((!ed) || (!part)) return NULL; |
1374 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1434 | rp = _edje_real_part_recursive_get(ed, part); |
1375 | if (!rp) return NULL; | 1435 | if (!rp) return NULL; |
1376 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1436 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1377 | return _edje_entry_anchor_geometry_get(rp, anchor); | 1437 | return _edje_entry_anchor_geometry_get(rp, anchor); |
@@ -1386,7 +1446,7 @@ edje_object_part_text_item_list_get(const Evas_Object *obj, const char *part) | |||
1386 | 1446 | ||
1387 | ed = _edje_fetch(obj); | 1447 | ed = _edje_fetch(obj); |
1388 | if ((!ed) || (!part)) return NULL; | 1448 | if ((!ed) || (!part)) return NULL; |
1389 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1449 | rp = _edje_real_part_recursive_get(ed, part); |
1390 | if (!rp) return NULL; | 1450 | if (!rp) return NULL; |
1391 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1451 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1392 | return _edje_entry_items_list(rp); | 1452 | return _edje_entry_items_list(rp); |
@@ -1401,7 +1461,7 @@ edje_object_part_text_item_geometry_get(const Evas_Object *obj, const char *part | |||
1401 | 1461 | ||
1402 | ed = _edje_fetch(obj); | 1462 | ed = _edje_fetch(obj); |
1403 | if ((!ed) || (!part)) return EINA_FALSE; | 1463 | if ((!ed) || (!part)) return EINA_FALSE; |
1404 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1464 | rp = _edje_real_part_recursive_get(ed, part); |
1405 | if (!rp) return EINA_FALSE; | 1465 | if (!rp) return EINA_FALSE; |
1406 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1466 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1407 | return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch); | 1467 | return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch); |
@@ -1420,7 +1480,7 @@ edje_object_part_text_cursor_geometry_get(const Evas_Object *obj, const char *pa | |||
1420 | if (w) *w = 0; | 1480 | if (w) *w = 0; |
1421 | if (h) *h = 0; | 1481 | if (h) *h = 0; |
1422 | if ((!ed) || (!part)) return; | 1482 | if ((!ed) || (!part)) return; |
1423 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1483 | rp = _edje_real_part_recursive_get(ed, part); |
1424 | if (!rp) return; | 1484 | if (!rp) return; |
1425 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1485 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1426 | { | 1486 | { |
@@ -1432,6 +1492,20 @@ edje_object_part_text_cursor_geometry_get(const Evas_Object *obj, const char *pa | |||
1432 | } | 1492 | } |
1433 | 1493 | ||
1434 | EAPI void | 1494 | EAPI void |
1495 | edje_object_part_text_user_insert(const Evas_Object *obj, const char *part, const char *text) | ||
1496 | { | ||
1497 | Edje *ed; | ||
1498 | Edje_Real_Part *rp; | ||
1499 | |||
1500 | ed = _edje_fetch(obj); | ||
1501 | if ((!ed) || (!part)) return; | ||
1502 | rp = _edje_real_part_recursive_get(ed, part); | ||
1503 | if (!rp) return; | ||
1504 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1505 | _edje_entry_user_insert(rp, text); | ||
1506 | } | ||
1507 | |||
1508 | EAPI void | ||
1435 | edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow) | 1509 | edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow) |
1436 | { | 1510 | { |
1437 | Edje *ed; | 1511 | Edje *ed; |
@@ -1439,7 +1513,7 @@ edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, | |||
1439 | 1513 | ||
1440 | ed = _edje_fetch(obj); | 1514 | ed = _edje_fetch(obj); |
1441 | if ((!ed) || (!part)) return; | 1515 | if ((!ed) || (!part)) return; |
1442 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1516 | rp = _edje_real_part_recursive_get(ed, part); |
1443 | if (!rp) return; | 1517 | if (!rp) return; |
1444 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1518 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1445 | _edje_entry_select_allow_set(rp, allow); | 1519 | _edje_entry_select_allow_set(rp, allow); |
@@ -1453,7 +1527,7 @@ edje_object_part_text_select_abort(const Evas_Object *obj, const char *part) | |||
1453 | 1527 | ||
1454 | ed = _edje_fetch(obj); | 1528 | ed = _edje_fetch(obj); |
1455 | if ((!ed) || (!part)) return; | 1529 | if ((!ed) || (!part)) return; |
1456 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1530 | rp = _edje_real_part_recursive_get(ed, part); |
1457 | if (!rp) return; | 1531 | if (!rp) return; |
1458 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1532 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1459 | _edje_entry_select_abort(rp); | 1533 | _edje_entry_select_abort(rp); |
@@ -1467,7 +1541,7 @@ edje_object_part_text_select_begin(const Evas_Object *obj, const char *part) | |||
1467 | 1541 | ||
1468 | ed = _edje_fetch(obj); | 1542 | ed = _edje_fetch(obj); |
1469 | if ((!ed) || (!part)) return; | 1543 | if ((!ed) || (!part)) return; |
1470 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1544 | rp = _edje_real_part_recursive_get(ed, part); |
1471 | if (!rp) return; | 1545 | if (!rp) return; |
1472 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1546 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1473 | _edje_entry_select_begin(rp); | 1547 | _edje_entry_select_begin(rp); |
@@ -1481,12 +1555,30 @@ edje_object_part_text_select_extend(const Evas_Object *obj, const char *part) | |||
1481 | 1555 | ||
1482 | ed = _edje_fetch(obj); | 1556 | ed = _edje_fetch(obj); |
1483 | if ((!ed) || (!part)) return; | 1557 | if ((!ed) || (!part)) return; |
1484 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1558 | rp = _edje_real_part_recursive_get(ed, part); |
1485 | if (!rp) return; | 1559 | if (!rp) return; |
1486 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1560 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1487 | _edje_entry_select_extend(rp); | 1561 | _edje_entry_select_extend(rp); |
1488 | } | 1562 | } |
1489 | 1563 | ||
1564 | EAPI void * | ||
1565 | edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part) | ||
1566 | { | ||
1567 | Edje *ed; | ||
1568 | Edje_Real_Part *rp; | ||
1569 | |||
1570 | ed = _edje_fetch(obj); | ||
1571 | if ((!ed) || (!part)) return NULL; | ||
1572 | |||
1573 | rp = _edje_real_part_recursive_get(ed, (char *)part); | ||
1574 | if (!rp) return NULL; | ||
1575 | |||
1576 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1577 | return _edje_entry_imf_context_get(rp); | ||
1578 | else | ||
1579 | return NULL; | ||
1580 | } | ||
1581 | |||
1490 | EAPI Eina_Bool | 1582 | EAPI Eina_Bool |
1491 | edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) | 1583 | edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) |
1492 | { | 1584 | { |
@@ -1495,7 +1587,7 @@ edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Curso | |||
1495 | 1587 | ||
1496 | ed = _edje_fetch(obj); | 1588 | ed = _edje_fetch(obj); |
1497 | if ((!ed) || (!part)) return EINA_FALSE; | 1589 | if ((!ed) || (!part)) return EINA_FALSE; |
1498 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1590 | rp = _edje_real_part_recursive_get(ed, part); |
1499 | if (!rp) return EINA_FALSE; | 1591 | if (!rp) return EINA_FALSE; |
1500 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1592 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1501 | { | 1593 | { |
@@ -1512,7 +1604,7 @@ edje_object_part_text_cursor_prev(Evas_Object *obj, const char *part, Edje_Curso | |||
1512 | 1604 | ||
1513 | ed = _edje_fetch(obj); | 1605 | ed = _edje_fetch(obj); |
1514 | if ((!ed) || (!part)) return EINA_FALSE; | 1606 | if ((!ed) || (!part)) return EINA_FALSE; |
1515 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1607 | rp = _edje_real_part_recursive_get(ed, part); |
1516 | if (!rp) return EINA_FALSE; | 1608 | if (!rp) return EINA_FALSE; |
1517 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1609 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1518 | { | 1610 | { |
@@ -1529,7 +1621,7 @@ edje_object_part_text_cursor_up(Evas_Object *obj, const char *part, Edje_Cursor | |||
1529 | 1621 | ||
1530 | ed = _edje_fetch(obj); | 1622 | ed = _edje_fetch(obj); |
1531 | if ((!ed) || (!part)) return EINA_FALSE; | 1623 | if ((!ed) || (!part)) return EINA_FALSE; |
1532 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1624 | rp = _edje_real_part_recursive_get(ed, part); |
1533 | if (!rp) return EINA_FALSE; | 1625 | if (!rp) return EINA_FALSE; |
1534 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1626 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1535 | { | 1627 | { |
@@ -1546,7 +1638,7 @@ edje_object_part_text_cursor_down(Evas_Object *obj, const char *part, Edje_Curso | |||
1546 | 1638 | ||
1547 | ed = _edje_fetch(obj); | 1639 | ed = _edje_fetch(obj); |
1548 | if ((!ed) || (!part)) return EINA_FALSE; | 1640 | if ((!ed) || (!part)) return EINA_FALSE; |
1549 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1641 | rp = _edje_real_part_recursive_get(ed, part); |
1550 | if (!rp) return EINA_FALSE; | 1642 | if (!rp) return EINA_FALSE; |
1551 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1643 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1552 | { | 1644 | { |
@@ -1563,7 +1655,7 @@ edje_object_part_text_cursor_begin_set(Evas_Object *obj, const char *part, Edje_ | |||
1563 | 1655 | ||
1564 | ed = _edje_fetch(obj); | 1656 | ed = _edje_fetch(obj); |
1565 | if ((!ed) || (!part)) return; | 1657 | if ((!ed) || (!part)) return; |
1566 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1658 | rp = _edje_real_part_recursive_get(ed, part); |
1567 | if (!rp) return; | 1659 | if (!rp) return; |
1568 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1660 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1569 | { | 1661 | { |
@@ -1579,7 +1671,7 @@ edje_object_part_text_cursor_end_set(Evas_Object *obj, const char *part, Edje_Cu | |||
1579 | 1671 | ||
1580 | ed = _edje_fetch(obj); | 1672 | ed = _edje_fetch(obj); |
1581 | if ((!ed) || (!part)) return; | 1673 | if ((!ed) || (!part)) return; |
1582 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1674 | rp = _edje_real_part_recursive_get(ed, part); |
1583 | if (!rp) return; | 1675 | if (!rp) return; |
1584 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1676 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1585 | { | 1677 | { |
@@ -1595,7 +1687,7 @@ edje_object_part_text_cursor_copy(Evas_Object *obj, const char *part, Edje_Curso | |||
1595 | 1687 | ||
1596 | ed = _edje_fetch(obj); | 1688 | ed = _edje_fetch(obj); |
1597 | if ((!ed) || (!part)) return; | 1689 | if ((!ed) || (!part)) return; |
1598 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1690 | rp = _edje_real_part_recursive_get(ed, part); |
1599 | if (!rp) return; | 1691 | if (!rp) return; |
1600 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1692 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1601 | { | 1693 | { |
@@ -1611,7 +1703,7 @@ edje_object_part_text_cursor_line_begin_set(Evas_Object *obj, const char *part, | |||
1611 | 1703 | ||
1612 | ed = _edje_fetch(obj); | 1704 | ed = _edje_fetch(obj); |
1613 | if ((!ed) || (!part)) return; | 1705 | if ((!ed) || (!part)) return; |
1614 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1706 | rp = _edje_real_part_recursive_get(ed, part); |
1615 | if (!rp) return; | 1707 | if (!rp) return; |
1616 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1708 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1617 | { | 1709 | { |
@@ -1627,7 +1719,7 @@ edje_object_part_text_cursor_line_end_set(Evas_Object *obj, const char *part, Ed | |||
1627 | 1719 | ||
1628 | ed = _edje_fetch(obj); | 1720 | ed = _edje_fetch(obj); |
1629 | if ((!ed) || (!part)) return; | 1721 | if ((!ed) || (!part)) return; |
1630 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1722 | rp = _edje_real_part_recursive_get(ed, part); |
1631 | if (!rp) return; | 1723 | if (!rp) return; |
1632 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1724 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1633 | { | 1725 | { |
@@ -1644,7 +1736,7 @@ edje_object_part_text_cursor_coord_set(Evas_Object *obj, const char *part, | |||
1644 | 1736 | ||
1645 | ed = _edje_fetch(obj); | 1737 | ed = _edje_fetch(obj); |
1646 | if ((!ed) || (!part)) return EINA_FALSE; | 1738 | if ((!ed) || (!part)) return EINA_FALSE; |
1647 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1739 | rp = _edje_real_part_recursive_get(ed, part); |
1648 | if (!rp) return EINA_FALSE; | 1740 | if (!rp) return EINA_FALSE; |
1649 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1741 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1650 | { | 1742 | { |
@@ -1661,7 +1753,7 @@ edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *p | |||
1661 | 1753 | ||
1662 | ed = _edje_fetch(obj); | 1754 | ed = _edje_fetch(obj); |
1663 | if ((!ed) || (!part)) return EINA_FALSE; | 1755 | if ((!ed) || (!part)) return EINA_FALSE; |
1664 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1756 | rp = _edje_real_part_recursive_get(ed, part); |
1665 | if (!rp) return EINA_FALSE; | 1757 | if (!rp) return EINA_FALSE; |
1666 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1758 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1667 | { | 1759 | { |
@@ -1678,7 +1770,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const | |||
1678 | 1770 | ||
1679 | ed = _edje_fetch(obj); | 1771 | ed = _edje_fetch(obj); |
1680 | if ((!ed) || (!part)) return 0; | 1772 | if ((!ed) || (!part)) return 0; |
1681 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1773 | rp = _edje_real_part_recursive_get(ed, part); |
1682 | if (!rp) return 0; | 1774 | if (!rp) return 0; |
1683 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1775 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1684 | { | 1776 | { |
@@ -1738,7 +1830,7 @@ edje_object_part_text_cursor_pos_get(const Evas_Object *obj, const char *part, E | |||
1738 | } | 1830 | } |
1739 | 1831 | ||
1740 | EAPI void | 1832 | EAPI void |
1741 | edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout) | 1833 | edje_object_part_text_imf_context_reset(const Evas_Object *obj, const char *part) |
1742 | { | 1834 | { |
1743 | Edje *ed; | 1835 | Edje *ed; |
1744 | Edje_Real_Part *rp; | 1836 | Edje_Real_Part *rp; |
@@ -1749,7 +1841,23 @@ edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char | |||
1749 | if (!rp) return; | 1841 | if (!rp) return; |
1750 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1842 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1751 | { | 1843 | { |
1752 | return _edje_entry_input_panel_layout_set(rp, layout); | 1844 | _edje_entry_imf_context_reset(rp); |
1845 | } | ||
1846 | } | ||
1847 | |||
1848 | EAPI void | ||
1849 | edje_object_part_text_input_panel_layout_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout) | ||
1850 | { | ||
1851 | Edje *ed; | ||
1852 | Edje_Real_Part *rp; | ||
1853 | |||
1854 | ed = _edje_fetch(obj); | ||
1855 | if ((!ed) || (!part)) return; | ||
1856 | rp = _edje_real_part_recursive_get(ed, part); | ||
1857 | if (!rp) return; | ||
1858 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1859 | { | ||
1860 | _edje_entry_input_panel_layout_set(rp, layout); | ||
1753 | } | 1861 | } |
1754 | } | 1862 | } |
1755 | 1863 | ||
@@ -1771,14 +1879,14 @@ edje_object_part_text_input_panel_layout_get(const Evas_Object *obj, const char | |||
1771 | } | 1879 | } |
1772 | 1880 | ||
1773 | EAPI void | 1881 | EAPI void |
1774 | edje_object_part_text_autocapital_type_set(const Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type) | 1882 | edje_object_part_text_autocapital_type_set(Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type) |
1775 | { | 1883 | { |
1776 | Edje *ed; | 1884 | Edje *ed; |
1777 | Edje_Real_Part *rp; | 1885 | Edje_Real_Part *rp; |
1778 | 1886 | ||
1779 | ed = _edje_fetch(obj); | 1887 | ed = _edje_fetch(obj); |
1780 | if ((!ed) || (!part)) return; | 1888 | if ((!ed) || (!part)) return; |
1781 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1889 | rp = _edje_real_part_recursive_get(ed, part); |
1782 | if (!rp) return; | 1890 | if (!rp) return; |
1783 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1891 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1784 | { | 1892 | { |
@@ -1794,7 +1902,7 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p | |||
1794 | 1902 | ||
1795 | ed = _edje_fetch(obj); | 1903 | ed = _edje_fetch(obj); |
1796 | if ((!ed) || (!part)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; | 1904 | if ((!ed) || (!part)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; |
1797 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1905 | rp = _edje_real_part_recursive_get(ed, part); |
1798 | if (!rp) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; | 1906 | if (!rp) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; |
1799 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1907 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1800 | { | 1908 | { |
@@ -1804,7 +1912,40 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p | |||
1804 | } | 1912 | } |
1805 | 1913 | ||
1806 | EAPI void | 1914 | EAPI void |
1807 | edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool enabled) | 1915 | edje_object_part_text_prediction_allow_set(Evas_Object *obj, const char *part, Eina_Bool prediction) |
1916 | { | ||
1917 | Edje *ed; | ||
1918 | Edje_Real_Part *rp; | ||
1919 | |||
1920 | ed = _edje_fetch(obj); | ||
1921 | if ((!ed) || (!part)) return; | ||
1922 | rp = _edje_real_part_recursive_get(ed, part); | ||
1923 | if (!rp) return; | ||
1924 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1925 | { | ||
1926 | _edje_entry_prediction_allow_set(rp, prediction); | ||
1927 | } | ||
1928 | } | ||
1929 | |||
1930 | EAPI Eina_Bool | ||
1931 | edje_object_part_text_prediction_allow_get(const Evas_Object *obj, const char *part) | ||
1932 | { | ||
1933 | Edje *ed; | ||
1934 | Edje_Real_Part *rp; | ||
1935 | |||
1936 | ed = _edje_fetch(obj); | ||
1937 | if ((!ed) || (!part)) return EINA_FALSE; | ||
1938 | rp = _edje_real_part_recursive_get(ed, part); | ||
1939 | if (!rp) return EINA_FALSE; | ||
1940 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1941 | { | ||
1942 | return _edje_entry_prediction_allow_get(rp); | ||
1943 | } | ||
1944 | return EINA_FALSE; | ||
1945 | } | ||
1946 | |||
1947 | EAPI void | ||
1948 | edje_object_part_text_input_panel_enabled_set(Evas_Object *obj, const char *part, Eina_Bool enabled) | ||
1808 | { | 1949 | { |
1809 | Edje *ed; | 1950 | Edje *ed; |
1810 | Edje_Real_Part *rp; | 1951 | Edje_Real_Part *rp; |
@@ -1815,7 +1956,7 @@ edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char | |||
1815 | if (!rp) return; | 1956 | if (!rp) return; |
1816 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1957 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1817 | { | 1958 | { |
1818 | return _edje_entry_input_panel_enabled_set(rp, enabled); | 1959 | _edje_entry_input_panel_enabled_set(rp, enabled); |
1819 | } | 1960 | } |
1820 | } | 1961 | } |
1821 | 1962 | ||
@@ -1837,6 +1978,165 @@ edje_object_part_text_input_panel_enabled_get(const Evas_Object *obj, const char | |||
1837 | } | 1978 | } |
1838 | 1979 | ||
1839 | EAPI void | 1980 | EAPI void |
1981 | edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part) | ||
1982 | { | ||
1983 | Edje *ed; | ||
1984 | Edje_Real_Part *rp; | ||
1985 | |||
1986 | ed = _edje_fetch(obj); | ||
1987 | if ((!ed) || (!part)) return; | ||
1988 | rp = _edje_real_part_recursive_get(ed, part); | ||
1989 | if (!rp) return; | ||
1990 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1991 | _edje_entry_input_panel_show(rp); | ||
1992 | } | ||
1993 | |||
1994 | EAPI void | ||
1995 | edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part) | ||
1996 | { | ||
1997 | Edje *ed; | ||
1998 | Edje_Real_Part *rp; | ||
1999 | |||
2000 | ed = _edje_fetch(obj); | ||
2001 | if ((!ed) || (!part)) return; | ||
2002 | rp = _edje_real_part_recursive_get(ed, part); | ||
2003 | if (!rp) return; | ||
2004 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2005 | _edje_entry_input_panel_hide(rp); | ||
2006 | } | ||
2007 | |||
2008 | EAPI void | ||
2009 | edje_object_part_text_input_panel_language_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Lang lang) | ||
2010 | { | ||
2011 | Edje *ed; | ||
2012 | Edje_Real_Part *rp; | ||
2013 | |||
2014 | ed = _edje_fetch(obj); | ||
2015 | if ((!ed) || (!part)) return; | ||
2016 | rp = _edje_real_part_recursive_get(ed, part); | ||
2017 | if (!rp) return; | ||
2018 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2019 | { | ||
2020 | _edje_entry_input_panel_language_set(rp, lang); | ||
2021 | } | ||
2022 | } | ||
2023 | |||
2024 | EAPI Edje_Input_Panel_Lang | ||
2025 | edje_object_part_text_input_panel_language_get(const Evas_Object *obj, const char *part) | ||
2026 | { | ||
2027 | Edje *ed; | ||
2028 | Edje_Real_Part *rp; | ||
2029 | |||
2030 | ed = _edje_fetch(obj); | ||
2031 | if ((!ed) || (!part)) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2032 | rp = _edje_real_part_recursive_get(ed, part); | ||
2033 | if (!rp) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2034 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2035 | { | ||
2036 | return _edje_entry_input_panel_language_get(rp); | ||
2037 | } | ||
2038 | return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2039 | } | ||
2040 | |||
2041 | EAPI void | ||
2042 | edje_object_part_text_input_panel_imdata_set(Evas_Object *obj, const char *part, const void *data, int len) | ||
2043 | { | ||
2044 | Edje *ed; | ||
2045 | Edje_Real_Part *rp; | ||
2046 | |||
2047 | ed = _edje_fetch(obj); | ||
2048 | if ((!ed) || (!part)) return; | ||
2049 | rp = _edje_real_part_recursive_get(ed, part); | ||
2050 | if (!rp) return; | ||
2051 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2052 | { | ||
2053 | _edje_entry_input_panel_imdata_set(rp, data, len); | ||
2054 | } | ||
2055 | } | ||
2056 | |||
2057 | EAPI void | ||
2058 | edje_object_part_text_input_panel_imdata_get(const Evas_Object *obj, const char *part, void *data, int *len) | ||
2059 | { | ||
2060 | Edje *ed; | ||
2061 | Edje_Real_Part *rp; | ||
2062 | |||
2063 | ed = _edje_fetch(obj); | ||
2064 | if ((!ed) || (!part)) return; | ||
2065 | rp = _edje_real_part_recursive_get(ed, part); | ||
2066 | if (!rp) return; | ||
2067 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2068 | { | ||
2069 | _edje_entry_input_panel_imdata_get(rp, data, len); | ||
2070 | } | ||
2071 | } | ||
2072 | |||
2073 | EAPI void | ||
2074 | edje_object_part_text_input_panel_return_key_type_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Return_Key_Type return_key_type) | ||
2075 | { | ||
2076 | Edje *ed; | ||
2077 | Edje_Real_Part *rp; | ||
2078 | |||
2079 | ed = _edje_fetch(obj); | ||
2080 | if ((!ed) || (!part)) return; | ||
2081 | rp = _edje_real_part_recursive_get(ed, part); | ||
2082 | if (!rp) return; | ||
2083 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2084 | { | ||
2085 | _edje_entry_input_panel_return_key_type_set(rp, return_key_type); | ||
2086 | } | ||
2087 | } | ||
2088 | |||
2089 | EAPI Edje_Input_Panel_Return_Key_Type | ||
2090 | edje_object_part_text_input_panel_return_key_type_get(const Evas_Object *obj, const char *part) | ||
2091 | { | ||
2092 | Edje *ed; | ||
2093 | Edje_Real_Part *rp; | ||
2094 | |||
2095 | ed = _edje_fetch(obj); | ||
2096 | if ((!ed) || (!part)) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2097 | rp = _edje_real_part_recursive_get(ed, part); | ||
2098 | if (!rp) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2099 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2100 | { | ||
2101 | return _edje_entry_input_panel_return_key_type_get(rp); | ||
2102 | } | ||
2103 | return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2104 | } | ||
2105 | |||
2106 | EAPI void | ||
2107 | edje_object_part_text_input_panel_return_key_disabled_set(Evas_Object *obj, const char *part, Eina_Bool disabled) | ||
2108 | { | ||
2109 | Edje *ed; | ||
2110 | Edje_Real_Part *rp; | ||
2111 | |||
2112 | ed = _edje_fetch(obj); | ||
2113 | if ((!ed) || (!part)) return; | ||
2114 | rp = _edje_real_part_recursive_get(ed, part); | ||
2115 | if (!rp) return; | ||
2116 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2117 | { | ||
2118 | _edje_entry_input_panel_return_key_disabled_set(rp, disabled); | ||
2119 | } | ||
2120 | } | ||
2121 | |||
2122 | EAPI Eina_Bool | ||
2123 | edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part) | ||
2124 | { | ||
2125 | Edje *ed; | ||
2126 | Edje_Real_Part *rp; | ||
2127 | |||
2128 | ed = _edje_fetch(obj); | ||
2129 | if ((!ed) || (!part)) return EINA_FALSE; | ||
2130 | rp = _edje_real_part_recursive_get(ed, part); | ||
2131 | if (!rp) return EINA_FALSE; | ||
2132 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2133 | { | ||
2134 | return _edje_entry_input_panel_return_key_disabled_get(rp); | ||
2135 | } | ||
2136 | return EINA_FALSE; | ||
2137 | } | ||
2138 | |||
2139 | EAPI void | ||
1840 | edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) | 2140 | edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) |
1841 | { | 2141 | { |
1842 | Edje *ed; | 2142 | Edje *ed; |
@@ -1901,6 +2201,71 @@ edje_object_text_insert_filter_callback_del_full(Evas_Object *obj, const char *p | |||
1901 | return NULL; | 2201 | return NULL; |
1902 | } | 2202 | } |
1903 | 2203 | ||
2204 | EAPI void | ||
2205 | edje_object_text_markup_filter_callback_add(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data) | ||
2206 | { | ||
2207 | Edje *ed; | ||
2208 | Edje_Markup_Filter_Callback *cb; | ||
2209 | |||
2210 | ed = _edje_fetch(obj); | ||
2211 | if ((!ed) || (!part)) return; | ||
2212 | cb = calloc(1, sizeof(Edje_Markup_Filter_Callback)); | ||
2213 | cb->part = eina_stringshare_add(part); | ||
2214 | cb->func = func; | ||
2215 | cb->data = (void *)data; | ||
2216 | ed->markup_filter_callbacks = | ||
2217 | eina_list_append(ed->markup_filter_callbacks, cb); | ||
2218 | } | ||
2219 | |||
2220 | EAPI void * | ||
2221 | edje_object_text_markup_filter_callback_del(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func) | ||
2222 | { | ||
2223 | Edje *ed; | ||
2224 | Edje_Markup_Filter_Callback *cb; | ||
2225 | Eina_List *l; | ||
2226 | |||
2227 | ed = _edje_fetch(obj); | ||
2228 | if ((!ed) || (!part)) return NULL; | ||
2229 | EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) | ||
2230 | { | ||
2231 | if ((!strcmp(cb->part, part)) && (cb->func == func)) | ||
2232 | { | ||
2233 | void *data = cb->data; | ||
2234 | ed->markup_filter_callbacks = | ||
2235 | eina_list_remove_list(ed->markup_filter_callbacks, l); | ||
2236 | eina_stringshare_del(cb->part); | ||
2237 | free(cb); | ||
2238 | return data; | ||
2239 | } | ||
2240 | } | ||
2241 | return NULL; | ||
2242 | } | ||
2243 | |||
2244 | EAPI void * | ||
2245 | edje_object_text_markup_filter_callback_del_full(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data) | ||
2246 | { | ||
2247 | Edje *ed; | ||
2248 | Edje_Markup_Filter_Callback *cb; | ||
2249 | Eina_List *l; | ||
2250 | |||
2251 | ed = _edje_fetch(obj); | ||
2252 | if ((!ed) || (!part)) return NULL; | ||
2253 | EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) | ||
2254 | { | ||
2255 | if ((!strcmp(cb->part, part)) && (cb->func == func) && | ||
2256 | (cb->data == data)) | ||
2257 | { | ||
2258 | void *tmp = cb->data; | ||
2259 | ed->markup_filter_callbacks = | ||
2260 | eina_list_remove_list(ed->markup_filter_callbacks, l); | ||
2261 | eina_stringshare_del(cb->part); | ||
2262 | free(cb); | ||
2263 | return tmp; | ||
2264 | } | ||
2265 | } | ||
2266 | return NULL; | ||
2267 | } | ||
2268 | |||
1904 | EAPI Eina_Bool | 2269 | EAPI Eina_Bool |
1905 | edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_swallow) | 2270 | edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_swallow) |
1906 | { | 2271 | { |
@@ -1927,8 +2292,12 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw | |||
1927 | edje_object_part_unswallow(rp->edje->obj, obj_swallow); | 2292 | edje_object_part_unswallow(rp->edje->obj, obj_swallow); |
1928 | } | 2293 | } |
1929 | 2294 | ||
1930 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2295 | rp = _edje_real_part_recursive_get(ed, part); |
1931 | if (!rp) return EINA_FALSE; | 2296 | if (!rp) |
2297 | { | ||
2298 | DBG("cannot swallow part %s: part not exist!", part); | ||
2299 | return EINA_FALSE; | ||
2300 | } | ||
1932 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) | 2301 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) |
1933 | { | 2302 | { |
1934 | ERR("cannot swallow part %s: not swallow type!", rp->part->name); | 2303 | ERR("cannot swallow part %s: not swallow type!", rp->part->name); |
@@ -2261,7 +2630,7 @@ edje_object_part_swallow_get(const Evas_Object *obj, const char *part) | |||
2261 | /* Need to recalc before providing the object. */ | 2630 | /* Need to recalc before providing the object. */ |
2262 | _edje_recalc_do(ed); | 2631 | _edje_recalc_do(ed); |
2263 | 2632 | ||
2264 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2633 | rp = _edje_real_part_recursive_get(ed, part); |
2265 | if (!rp) return NULL; | 2634 | if (!rp) return NULL; |
2266 | return rp->swallowed_object; | 2635 | return rp->swallowed_object; |
2267 | } | 2636 | } |
@@ -2353,8 +2722,8 @@ EAPI Eina_Bool | |||
2353 | edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) | 2722 | edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) |
2354 | { | 2723 | { |
2355 | Edje *ed; | 2724 | Edje *ed; |
2356 | Evas_Coord x1 = INT_MAX, y1 = INT_MAX; | 2725 | Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX; |
2357 | Evas_Coord x2 = 0, y2 = 0; | 2726 | Evas_Coord xx2 = 0, yy2 = 0; |
2358 | unsigned int i; | 2727 | unsigned int i; |
2359 | 2728 | ||
2360 | ed = _edje_fetch(obj); | 2729 | ed = _edje_fetch(obj); |
@@ -2386,18 +2755,18 @@ edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E | |||
2386 | rpx2 = rpx1 + rp->w; | 2755 | rpx2 = rpx1 + rp->w; |
2387 | rpy2 = rpy1 + rp->h; | 2756 | rpy2 = rpy1 + rp->h; |
2388 | 2757 | ||
2389 | if (x1 > rpx1) x1 = rpx1; | 2758 | if (xx1 > rpx1) xx1 = rpx1; |
2390 | if (y1 > rpy1) y1 = rpy1; | 2759 | if (yy1 > rpy1) yy1 = rpy1; |
2391 | if (x2 < rpx2) x2 = rpx2; | 2760 | if (xx2 < rpx2) xx2 = rpx2; |
2392 | if (y2 < rpy2) y2 = rpy2; | 2761 | if (yy2 < rpy2) yy2 = rpy2; |
2393 | } | 2762 | } |
2394 | 2763 | ||
2395 | ed->calc_only = 0; | 2764 | ed->calc_only = 0; |
2396 | 2765 | ||
2397 | if (x) *x = x1; | 2766 | if (x) *x = xx1; |
2398 | if (y) *y = y1; | 2767 | if (y) *y = yy1; |
2399 | if (w) *w = x2 - x1; | 2768 | if (w) *w = xx2 - xx1; |
2400 | if (h) *h = y2 - y1; | 2769 | if (h) *h = yy2 - yy1; |
2401 | 2770 | ||
2402 | return EINA_TRUE; | 2771 | return EINA_TRUE; |
2403 | } | 2772 | } |
@@ -2448,6 +2817,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co | |||
2448 | maxh = 0; | 2817 | maxh = 0; |
2449 | } | 2818 | } |
2450 | pep = NULL; | 2819 | pep = NULL; |
2820 | has_non_fixed_tb = EINA_FALSE; | ||
2451 | for (i = 0; i < ed->table_parts_size; i++) | 2821 | for (i = 0; i < ed->table_parts_size; i++) |
2452 | { | 2822 | { |
2453 | Edje_Real_Part *ep; | 2823 | Edje_Real_Part *ep; |
@@ -2569,7 +2939,7 @@ edje_object_part_state_get(const Evas_Object *obj, const char *part, double *val | |||
2569 | /* Need to recalc before providing the object. */ | 2939 | /* Need to recalc before providing the object. */ |
2570 | _edje_recalc_do(ed); | 2940 | _edje_recalc_do(ed); |
2571 | 2941 | ||
2572 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2942 | rp = _edje_real_part_recursive_get(ed, part); |
2573 | if (!rp) | 2943 | if (!rp) |
2574 | { | 2944 | { |
2575 | if (val_ret) *val_ret = 0; | 2945 | if (val_ret) *val_ret = 0; |
@@ -2609,7 +2979,7 @@ edje_object_part_drag_dir_get(const Evas_Object *obj, const char *part) | |||
2609 | /* Need to recalc before providing the object. */ | 2979 | /* Need to recalc before providing the object. */ |
2610 | _edje_recalc_do(ed); | 2980 | _edje_recalc_do(ed); |
2611 | 2981 | ||
2612 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2982 | rp = _edje_real_part_recursive_get(ed, part); |
2613 | if (!rp) return EDJE_DRAG_DIR_NONE; | 2983 | if (!rp) return EDJE_DRAG_DIR_NONE; |
2614 | if ((rp->part->dragable.x) && (rp->part->dragable.y)) return EDJE_DRAG_DIR_XY; | 2984 | if ((rp->part->dragable.x) && (rp->part->dragable.y)) return EDJE_DRAG_DIR_XY; |
2615 | else if (rp->part->dragable.x) return EDJE_DRAG_DIR_X; | 2985 | else if (rp->part->dragable.x) return EDJE_DRAG_DIR_X; |
@@ -2625,7 +2995,7 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d | |||
2625 | 2995 | ||
2626 | ed = _edje_fetch(obj); | 2996 | ed = _edje_fetch(obj); |
2627 | if ((!ed) || (!part)) return EINA_FALSE; | 2997 | if ((!ed) || (!part)) return EINA_FALSE; |
2628 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2998 | rp = _edje_real_part_recursive_get(ed, part); |
2629 | if (!rp) return EINA_FALSE; | 2999 | if (!rp) return EINA_FALSE; |
2630 | if (!rp->drag) return EINA_FALSE; | 3000 | if (!rp->drag) return EINA_FALSE; |
2631 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3001 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -2666,7 +3036,7 @@ edje_object_part_drag_value_get(const Evas_Object *obj, const char *part, double | |||
2666 | /* Need to recalc before providing the object. */ | 3036 | /* Need to recalc before providing the object. */ |
2667 | _edje_recalc_do(ed); | 3037 | _edje_recalc_do(ed); |
2668 | 3038 | ||
2669 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3039 | rp = _edje_real_part_recursive_get(ed, part); |
2670 | if (!rp || !rp->drag) | 3040 | if (!rp || !rp->drag) |
2671 | { | 3041 | { |
2672 | if (dx) *dx = 0; | 3042 | if (dx) *dx = 0; |
@@ -2690,7 +3060,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do | |||
2690 | 3060 | ||
2691 | ed = _edje_fetch(obj); | 3061 | ed = _edje_fetch(obj); |
2692 | if ((!ed) || (!part)) return EINA_FALSE; | 3062 | if ((!ed) || (!part)) return EINA_FALSE; |
2693 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3063 | rp = _edje_real_part_recursive_get(ed, part); |
2694 | if (!rp) return EINA_FALSE; | 3064 | if (!rp) return EINA_FALSE; |
2695 | if (!rp->drag) return EINA_FALSE; | 3065 | if (!rp->drag) return EINA_FALSE; |
2696 | if (dw < 0.0) dw = 0.0; | 3066 | if (dw < 0.0) dw = 0.0; |
@@ -2726,7 +3096,7 @@ edje_object_part_drag_size_get(const Evas_Object *obj, const char *part, double | |||
2726 | /* Need to recalc before providing the object. */ | 3096 | /* Need to recalc before providing the object. */ |
2727 | _edje_recalc_do(ed); | 3097 | _edje_recalc_do(ed); |
2728 | 3098 | ||
2729 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3099 | rp = _edje_real_part_recursive_get(ed, part); |
2730 | if (!rp || !rp->drag) | 3100 | if (!rp || !rp->drag) |
2731 | { | 3101 | { |
2732 | if (dw) *dw = 0; | 3102 | if (dw) *dw = 0; |
@@ -2746,7 +3116,7 @@ edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, do | |||
2746 | 3116 | ||
2747 | ed = _edje_fetch(obj); | 3117 | ed = _edje_fetch(obj); |
2748 | if ((!ed) || (!part)) return EINA_FALSE; | 3118 | if ((!ed) || (!part)) return EINA_FALSE; |
2749 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3119 | rp = _edje_real_part_recursive_get(ed, part); |
2750 | if (!rp) return EINA_FALSE; | 3120 | if (!rp) return EINA_FALSE; |
2751 | if (!rp->drag) return EINA_FALSE; | 3121 | if (!rp->drag) return EINA_FALSE; |
2752 | if (dx < 0.0) dx = 0.0; | 3122 | if (dx < 0.0) dx = 0.0; |
@@ -2778,7 +3148,7 @@ edje_object_part_drag_step_get(const Evas_Object *obj, const char *part, double | |||
2778 | /* Need to recalc before providing the object. */ | 3148 | /* Need to recalc before providing the object. */ |
2779 | _edje_recalc_do(ed); | 3149 | _edje_recalc_do(ed); |
2780 | 3150 | ||
2781 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3151 | rp = _edje_real_part_recursive_get(ed, part); |
2782 | if (!rp || !rp->drag) | 3152 | if (!rp || !rp->drag) |
2783 | { | 3153 | { |
2784 | if (dx) *dx = 0; | 3154 | if (dx) *dx = 0; |
@@ -2798,7 +3168,7 @@ edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, do | |||
2798 | 3168 | ||
2799 | ed = _edje_fetch(obj); | 3169 | ed = _edje_fetch(obj); |
2800 | if ((!ed) || (!part)) return EINA_FALSE; | 3170 | if ((!ed) || (!part)) return EINA_FALSE; |
2801 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3171 | rp = _edje_real_part_recursive_get(ed, part); |
2802 | if (!rp) return EINA_FALSE; | 3172 | if (!rp) return EINA_FALSE; |
2803 | if (!rp->drag) return EINA_FALSE; | 3173 | if (!rp->drag) return EINA_FALSE; |
2804 | if (dx < 0.0) dx = 0.0; | 3174 | if (dx < 0.0) dx = 0.0; |
@@ -2830,7 +3200,7 @@ edje_object_part_drag_page_get(const Evas_Object *obj, const char *part, double | |||
2830 | /* Need to recalc before providing the object. */ | 3200 | /* Need to recalc before providing the object. */ |
2831 | _edje_recalc_do(ed); | 3201 | _edje_recalc_do(ed); |
2832 | 3202 | ||
2833 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3203 | rp = _edje_real_part_recursive_get(ed, part); |
2834 | if (!rp || !rp->drag) | 3204 | if (!rp || !rp->drag) |
2835 | { | 3205 | { |
2836 | if (dx) *dx = 0; | 3206 | if (dx) *dx = 0; |
@@ -2851,7 +3221,7 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double | |||
2851 | 3221 | ||
2852 | ed = _edje_fetch(obj); | 3222 | ed = _edje_fetch(obj); |
2853 | if ((!ed) || (!part)) return EINA_FALSE; | 3223 | if ((!ed) || (!part)) return EINA_FALSE; |
2854 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3224 | rp = _edje_real_part_recursive_get(ed, part); |
2855 | if (!rp) return EINA_FALSE; | 3225 | if (!rp) return EINA_FALSE; |
2856 | if (!rp->drag) return EINA_FALSE; | 3226 | if (!rp->drag) return EINA_FALSE; |
2857 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3227 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -2881,7 +3251,7 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double | |||
2881 | 3251 | ||
2882 | ed = _edje_fetch(obj); | 3252 | ed = _edje_fetch(obj); |
2883 | if ((!ed) || (!part)) return EINA_FALSE; | 3253 | if ((!ed) || (!part)) return EINA_FALSE; |
2884 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3254 | rp = _edje_real_part_recursive_get(ed, part); |
2885 | if (!rp) return EINA_FALSE; | 3255 | if (!rp) return EINA_FALSE; |
2886 | if (!rp->drag) return EINA_FALSE; | 3256 | if (!rp->drag) return EINA_FALSE; |
2887 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3257 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -3557,9 +3927,21 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel) | |||
3557 | else if (ep->type == EDJE_PART_TYPE_GROUP) | 3927 | else if (ep->type == EDJE_PART_TYPE_GROUP) |
3558 | { | 3928 | { |
3559 | if (rp->swallowed_object) { | 3929 | if (rp->swallowed_object) { |
3560 | edje_object_signal_callback_del(rp->swallowed_object, EDJE_PRELOAD_EMISSION, EDJE_PRELOAD_SOURCE, _edje_object_signal_preload_cb); | 3930 | char *tmp; |
3561 | edje_object_signal_callback_add(rp->swallowed_object, EDJE_PRELOAD_EMISSION, EDJE_PRELOAD_SOURCE, _edje_object_signal_preload_cb, ed); | 3931 | |
3562 | edje_object_preload(rp->swallowed_object, cancel); | 3932 | if (rp->part->name) |
3933 | { | ||
3934 | tmp = alloca(strlen(rp->part->name) + 2); | ||
3935 | sprintf(tmp, "%s:", rp->part->name); | ||
3936 | |||
3937 | edje_object_signal_callback_del(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb); | ||
3938 | edje_object_signal_callback_add(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb, ed); | ||
3939 | edje_object_preload(rp->swallowed_object, cancel); | ||
3940 | } | ||
3941 | else | ||
3942 | { | ||
3943 | ed->preload_count--; | ||
3944 | } | ||
3563 | 3945 | ||
3564 | count--; | 3946 | count--; |
3565 | } | 3947 | } |
@@ -3574,6 +3956,30 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel) | |||
3574 | return EINA_TRUE; | 3956 | return EINA_TRUE; |
3575 | } | 3957 | } |
3576 | 3958 | ||
3959 | EAPI void | ||
3960 | edje_object_update_hints_set(Evas_Object *obj, Eina_Bool update) | ||
3961 | { | ||
3962 | Edje *ed; | ||
3963 | |||
3964 | ed = _edje_fetch(obj); | ||
3965 | if (!ed) return ; | ||
3966 | if (ed->update_hints == !!update) return ; | ||
3967 | |||
3968 | ed->update_hints = !!update; | ||
3969 | if (update) ed->recalc_hints = 1; | ||
3970 | } | ||
3971 | |||
3972 | EAPI Eina_Bool | ||
3973 | edje_object_update_hints_get(Evas_Object *obj) | ||
3974 | { | ||
3975 | Edje *ed; | ||
3976 | |||
3977 | ed = _edje_fetch(obj); | ||
3978 | if (!ed) return EINA_FALSE; | ||
3979 | |||
3980 | return ed->update_hints; | ||
3981 | } | ||
3982 | |||
3577 | Eina_Bool | 3983 | Eina_Bool |
3578 | _edje_real_part_table_pack(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) | 3984 | _edje_real_part_table_pack(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) |
3579 | { | 3985 | { |
@@ -4037,9 +4443,11 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp) | |||
4037 | { | 4443 | { |
4038 | Evas_Coord w, h; | 4444 | Evas_Coord w, h; |
4039 | 4445 | ||
4446 | #if 0 | ||
4040 | edje_object_size_min_get(rp->swallowed_object, &w, &h); | 4447 | edje_object_size_min_get(rp->swallowed_object, &w, &h); |
4041 | rp->swallow_params.min.w = w; | 4448 | rp->swallow_params.min.w = w; |
4042 | rp->swallow_params.min.h = h; | 4449 | rp->swallow_params.min.h = h; |
4450 | #endif | ||
4043 | edje_object_size_max_get(rp->swallowed_object, &w, &h); | 4451 | edje_object_size_max_get(rp->swallowed_object, &w, &h); |
4044 | rp->swallow_params.max.w = w; | 4452 | rp->swallow_params.max.w = w; |
4045 | rp->swallow_params.max.h = h; | 4453 | rp->swallow_params.max.h = h; |
@@ -4050,8 +4458,10 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp) | |||
4050 | Evas_Coord w, h; | 4458 | Evas_Coord w, h; |
4051 | 4459 | ||
4052 | evas_object_geometry_get(rp->swallowed_object, NULL, NULL, &w, &h); | 4460 | evas_object_geometry_get(rp->swallowed_object, NULL, NULL, &w, &h); |
4461 | #if 0 | ||
4053 | rp->swallow_params.min.w = w; | 4462 | rp->swallow_params.min.w = w; |
4054 | rp->swallow_params.min.h = h; | 4463 | rp->swallow_params.min.h = h; |
4464 | #endif | ||
4055 | rp->swallow_params.max.w = w; | 4465 | rp->swallow_params.max.w = w; |
4056 | rp->swallow_params.max.h = h; | 4466 | rp->swallow_params.max.h = h; |
4057 | } | 4467 | } |
@@ -4127,6 +4537,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4127 | _edje_real_part_swallow_hints_update(rp); | 4537 | _edje_real_part_swallow_hints_update(rp); |
4128 | rp->edje->dirty = 1; | 4538 | rp->edje->dirty = 1; |
4129 | rp->edje->recalc_call = 1; | 4539 | rp->edje->recalc_call = 1; |
4540 | rp->edje->recalc_hints = 1; | ||
4130 | _edje_recalc(rp->edje); | 4541 | _edje_recalc(rp->edje); |
4131 | return; | 4542 | return; |
4132 | } | 4543 | } |
@@ -4171,6 +4582,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4171 | 4582 | ||
4172 | rp->edje->dirty = 1; | 4583 | rp->edje->dirty = 1; |
4173 | rp->edje->recalc_call = 1; | 4584 | rp->edje->recalc_call = 1; |
4585 | rp->edje->recalc_hints = 1; | ||
4174 | _edje_recalc(rp->edje); | 4586 | _edje_recalc(rp->edje); |
4175 | } | 4587 | } |
4176 | 4588 | ||