summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-11-19 13:27:12 +0900
committerHermet Park <hermetpark@gmail.com>2019-11-19 13:27:12 +0900
commit2d704c935beb92d3a9674fc87aa92579b714f7b5 (patch)
tree01f27b9f48c9dcfe42efa27dba6e71c79eead0b9 /src
parent704d95fcea7de121616ef6bc370ebe90810f1c40 (diff)
parentfd6e5081f9b0de50c30f80ec99c0d3c21ea29cae (diff)
Merge branch 'master' into devs/hermet/lottie
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_file/Ecore_File.h8
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c20
-rw-r--r--src/lib/elementary/efl_ui_slider.c21
-rw-r--r--src/lib/elementary/elm_priv.h3
-rw-r--r--src/lib/elementary/elm_slider.c39
5 files changed, 68 insertions, 23 deletions
diff --git a/src/lib/ecore_file/Ecore_File.h b/src/lib/ecore_file/Ecore_File.h
index 23a0521..37f3bd8 100644
--- a/src/lib/ecore_file/Ecore_File.h
+++ b/src/lib/ecore_file/Ecore_File.h
@@ -609,8 +609,8 @@ EAPI Eina_List *ecore_file_app_list(void);
609 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure. 609 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure.
610 * 610 *
611 * This function starts the download of the URL @p url and saves it to 611 * This function starts the download of the URL @p url and saves it to
612 * @p dst. @p url must provide the protocol, including 'http://', 612 * @p dst. @p url must provide the protocol, including '%http://',
613 * 'ftp://' or 'file://'. Ecore_File must be compiled with CURL to 613 * '%ftp://' or '%file://'. Ecore_File must be compiled with CURL to
614 * download using http and ftp protocols. If @p dst is ill-formed, or 614 * download using http and ftp protocols. If @p dst is ill-formed, or
615 * if it already exists, the function returns @c EINA_FALSE. When the 615 * if it already exists, the function returns @c EINA_FALSE. When the
616 * download is complete, the callback @p completion_cb is called and 616 * download is complete, the callback @p completion_cb is called and
@@ -684,8 +684,8 @@ EAPI void ecore_file_download_abort(Ecore_File_Download_Job *job);
684 * @return @c EINA_TRUE if protocol is handled, @c EINA_FALSE otherwise. 684 * @return @c EINA_TRUE if protocol is handled, @c EINA_FALSE otherwise.
685 * 685 *
686 * This function returns @c EINA_TRUE if @p protocol is supported, 686 * This function returns @c EINA_TRUE if @p protocol is supported,
687 * @c EINA_FALSE otherwise. @p protocol can be 'http://', 'ftp://' or 687 * @c EINA_FALSE otherwise. @p protocol can be '%http://', '%ftp://' or
688 * 'file://'. Ecore_FILE must be compiled with CURL to handle http and 688 * '%file://'. Ecore_FILE must be compiled with CURL to handle http and
689 * ftp protocols. 689 * ftp protocols.
690 */ 690 */
691EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol); 691EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol);
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index bf1f8fb..d0cbcb5 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -39,8 +39,6 @@ struct _Eldbus_Property_Promise
39 Eina_Stringshare *property; 39 Eina_Stringshare *property;
40}; 40};
41 41
42static void _eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *);
43
44static Eina_Bool 42static Eina_Bool
45_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd) 43_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd)
46{ 44{
@@ -236,6 +234,9 @@ _eldbus_model_proxy_cancel_cb(Efl_Loop_Consumer *consumer EINA_UNUSED,
236 Eldbus_Model_Proxy_Property_Set_Data *sd = data; 234 Eldbus_Model_Proxy_Property_Set_Data *sd = data;
237 235
238 sd->promise = NULL; 236 sd->promise = NULL;
237 eina_stringshare_del(sd->property);
238 eina_value_free(sd->value);
239 free(sd);
239} 240}
240 241
241static Eldbus_Pending * 242static Eldbus_Pending *
@@ -655,7 +656,6 @@ _eldbus_model_proxy_property_set_load_cb(void *data,
655 if (!signature || !properties) 656 if (!signature || !properties)
656 { 657 {
657 eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN); 658 eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
658 _eldbus_model_proxy_property_set_data_free(set_data);
659 goto end; 659 goto end;
660 } 660 }
661 661
@@ -688,7 +688,7 @@ _eldbus_model_proxy_property_set_cb(void *data,
688 { 688 {
689 ERR("%s: %s", error_name, error_text); 689 ERR("%s: %s", error_name, error_text);
690 eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN); 690 eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN);
691 goto end; 691 return;
692 } 692 }
693 693
694 value = eina_hash_find(pd->properties, sd->property); 694 value = eina_hash_find(pd->properties, sd->property);
@@ -705,9 +705,6 @@ _eldbus_model_proxy_property_set_cb(void *data,
705 eina_promise_reject(sd->promise, 705 eina_promise_reject(sd->promise,
706 EFL_MODEL_ERROR_NOT_FOUND); 706 EFL_MODEL_ERROR_NOT_FOUND);
707 } 707 }
708
709 end:
710 _eldbus_model_proxy_property_set_data_free(sd);
711} 708}
712 709
713static const char * 710static const char *
@@ -726,13 +723,4 @@ _eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd,
726 return property_introspection->type; 723 return property_introspection->type;
727} 724}
728 725
729static void
730_eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *data)
731{
732 EINA_SAFETY_ON_NULL_RETURN(data);
733 eina_stringshare_del(data->property);
734 eina_value_free(data->value);
735 free(data);
736}
737
738#include "eldbus_model_proxy.eo.c" 726#include "eldbus_model_proxy.eo.c"
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 2aca5f9..219a15b 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -78,6 +78,21 @@ _user_value_update(Evas_Object *obj, double value)
78} 78}
79 79
80static void 80static void
81_step_value_update(Evas_Object *obj, double step)
82{
83 double value;
84
85 EFL_UI_SLIDER_DATA_GET(obj, sd);
86
87 if (efl_ui_mirrored_get(obj) ^ efl_ui_layout_orientation_is_inverted(sd->dir))
88 step *= -1.0;
89
90 value = CLAMP(sd->val + step, sd->val_min, sd->val_max);
91 _user_value_update(obj, value);
92
93}
94
95static void
81_drag_value_fetch(Evas_Object *obj) 96_drag_value_fetch(Evas_Object *obj)
82{ 97{
83 EFL_UI_SLIDER_DATA_GET(obj, sd); 98 EFL_UI_SLIDER_DATA_GET(obj, sd);
@@ -194,7 +209,8 @@ _drag_up(Evas_Object *obj)
194 209
195 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.draggable.slider"), 210 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.draggable.slider"),
196 relative_step, relative_step); 211 relative_step, relative_step);
197 _drag_value_fetch(obj); 212
213 _step_value_update(obj, step);
198} 214}
199 215
200static void 216static void
@@ -214,7 +230,8 @@ _drag_down(Evas_Object *obj)
214 230
215 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.draggable.slider"), 231 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.draggable.slider"),
216 relative_step, relative_step); 232 relative_step, relative_step);
217 _drag_value_fetch(obj); 233
234 _step_value_update(obj, step);
218} 235}
219 236
220static Eina_Bool 237static Eina_Bool
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 0d71bd0..0be9080 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -329,6 +329,9 @@ extern const char *_elm_engines[];
329# define ELM_PRIV_SMART_CALLBACKS_DESC(name, signal, type) \ 329# define ELM_PRIV_SMART_CALLBACKS_DESC(name, signal, type) \
330 {name, type}, 330 {name, type},
331 331
332# define CLAMP(x, min, max) \
333 (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
334
332struct _Elm_Config_Flags 335struct _Elm_Config_Flags
333{ 336{
334 Eina_Bool engine : 1; 337 Eina_Bool engine : 1;
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index 8542638..c426a45 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -144,7 +144,6 @@ _indicator_set(Evas_Object *obj)
144 elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", str); 144 elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", str);
145 if (sd->popup) 145 if (sd->popup)
146 edje_object_part_text_set(sd->popup, "elm.indicator", str); 146 edje_object_part_text_set(sd->popup, "elm.indicator", str);
147
148 if (sd->popup2) 147 if (sd->popup2)
149 { 148 {
150 eina_strbuf_reset(sd->indi_format_strbuf); 149 eina_strbuf_reset(sd->indi_format_strbuf);
@@ -336,6 +335,40 @@ _val_set(Evas_Object *obj)
336} 335}
337 336
338static void 337static void
338_user_value_update(Evas_Object *obj, double value)
339{
340 double val = value;
341
342 ELM_SLIDER_DATA_GET_OR_RETURN(obj, sd);
343
344 if (fabs(val - sd->val) > DBL_EPSILON)
345 {
346 sd->val = val;
347 sd->intvl_from = val;
348 _val_set(obj);
349
350 evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
351 ecore_timer_del(sd->delay);
352 sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
353 }
354}
355
356static void
357_step_value_update(Evas_Object *obj, double step)
358{
359 double value, absolute_step;
360
361 ELM_SLIDER_DATA_GET(obj, sd);
362
363 if (efl_ui_mirrored_get(obj) ^ efl_ui_layout_orientation_is_inverted(sd->dir))
364 step *= -1.0;
365
366 absolute_step = step * (sd->val_max - sd->val_min);
367 value = CLAMP(sd->val + absolute_step, sd->val_min, sd->val_max);
368 _user_value_update(obj, value);
369}
370
371static void
339_val_fetch(Evas_Object *obj, Eina_Bool user_event) 372_val_fetch(Evas_Object *obj, Eina_Bool user_event)
340{ 373{
341 double posx = 0.0, posy = 0.0, pos = 0.0, val; 374 double posx = 0.0, posy = 0.0, pos = 0.0, val;
@@ -489,6 +522,8 @@ _drag_up(void *data,
489 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); 522 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
490 efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"), 523 efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
491 step, step); 524 step, step);
525
526 _step_value_update(data, step);
492} 527}
493 528
494static void 529static void
@@ -507,6 +542,8 @@ _drag_down(void *data,
507 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); 542 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
508 efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"), 543 efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
509 step, step); 544 step, step);
545
546 _step_value_update(data, step);
510} 547}
511 548
512static Eina_Bool 549static Eina_Bool