diff options
author | Daniel Hirt <hirt.danny@gmail.com> | 2017-09-19 19:36:43 +0300 |
---|---|---|
committer | Daniel Hirt <hirt.danny@gmail.com> | 2017-09-20 09:19:33 +0300 |
commit | d44131a3aa220b6482b3eb62e207c8c05c10e02e (patch) | |
tree | fb984d264e99eab2e732383598b896ed477d3483 | |
parent | 380b3eb09a785bab5d3bbd4921712c103b3cddd4 (diff) |
Edje: move selection-related part_text API to legacy
-rw-r--r-- | src/lib/edje/Edje_Legacy.h | 65 | ||||
-rw-r--r-- | src/lib/edje/edje_object.eo | 64 | ||||
-rw-r--r-- | src/lib/edje/edje_util.c | 54 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_text.c | 7 | ||||
-rw-r--r-- | src/lib/elementary/elm_entry.c | 6 |
5 files changed, 102 insertions, 94 deletions
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 2e1efc8ed4..7086acb4bc 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h | |||
@@ -2549,6 +2549,71 @@ EAPI Eina_Bool edje_object_part_text_input_panel_show_on_demand_get(const Edje_O | |||
2549 | EAPI void edje_object_part_text_prediction_hint_set(Edje_Object *obj, const char *part, const char *prediction_hint); | 2549 | EAPI void edje_object_part_text_prediction_hint_set(Edje_Object *obj, const char *part, const char *prediction_hint); |
2550 | 2550 | ||
2551 | /** | 2551 | /** |
2552 | * @brief Starts selecting at current cursor position | ||
2553 | * | ||
2554 | * @param[in] part The part name | ||
2555 | * | ||
2556 | * @ingroup Edje_Object | ||
2557 | */ | ||
2558 | EAPI void edje_object_part_text_select_begin(const Edje_Object *obj, const char *part); | ||
2559 | |||
2560 | /** | ||
2561 | * @brief Aborts any selection action on a part. | ||
2562 | * | ||
2563 | * @param[in] part The part name | ||
2564 | * | ||
2565 | * @ingroup Edje_Object | ||
2566 | */ | ||
2567 | EAPI void edje_object_part_text_select_abort(const Edje_Object *obj, const char *part); | ||
2568 | |||
2569 | /** | ||
2570 | * @brief Extends the current selection to the current cursor position | ||
2571 | * | ||
2572 | * @param[in] part The part name | ||
2573 | * | ||
2574 | * @ingroup Edje_Object | ||
2575 | */ | ||
2576 | EAPI void edje_object_part_text_select_extend(const Edje_Object *obj, const char *part); | ||
2577 | |||
2578 | /** | ||
2579 | * @brief Sets the selection to be everything. | ||
2580 | * | ||
2581 | * This function selects all text of the object of the part. | ||
2582 | * | ||
2583 | * @param[in] part The part name | ||
2584 | * | ||
2585 | * @ingroup Edje_Object | ||
2586 | */ | ||
2587 | EAPI void edje_object_part_text_select_all(const Edje_Object *obj, const char *part); | ||
2588 | |||
2589 | /** | ||
2590 | * @brief Sets the selection to be none. | ||
2591 | * | ||
2592 | * This function sets the selection text to be none. | ||
2593 | * | ||
2594 | * @param[in] part The part name | ||
2595 | * | ||
2596 | * @ingroup Edje_Object | ||
2597 | */ | ||
2598 | EAPI void edje_object_part_text_select_none(const Edje_Object *obj, const char *part); | ||
2599 | |||
2600 | /** | ||
2601 | * @brief Returns the selection text of the object part. | ||
2602 | * | ||
2603 | * This function returns selection text of the object part. | ||
2604 | * | ||
2605 | * See also @ref edje_object_part_text_select_all() and | ||
2606 | * @ref edje_object_part_text_select_none() | ||
2607 | * | ||
2608 | * @param[in] part The part name | ||
2609 | * | ||
2610 | * @return The text string | ||
2611 | * | ||
2612 | * @ingroup Edje_Object | ||
2613 | */ | ||
2614 | EAPI const char *edje_object_part_text_selection_get(const Edje_Object *obj, const char *part); | ||
2615 | |||
2616 | /** | ||
2552 | * @brief Whether this object is playing or not. | 2617 | * @brief Whether this object is playing or not. |
2553 | * | 2618 | * |
2554 | * This property indicates whether the object is running or not. If stopped (or | 2619 | * This property indicates whether the object is running or not. If stopped (or |
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 2463b8408e..9c4a84bf56 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo | |||
@@ -365,70 +365,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, | |||
365 | data: void_ptr; [[The data pointer to pass to the func callback]] | 365 | data: void_ptr; [[The data pointer to pass to the func callback]] |
366 | } | 366 | } |
367 | } | 367 | } |
368 | @property part_text_select_allow { | ||
369 | set { | ||
370 | [[Enables selection if the entry is an EXPLICIT selection mode | ||
371 | type. | ||
372 | |||
373 | The default is to not allow selection. This function only affects user | ||
374 | selection, functions such as edje_object_part_text_select_all() and | ||
375 | edje_object_part_text_select_none() are not affected.]] | ||
376 | legacy: null; | ||
377 | } | ||
378 | keys { | ||
379 | part: string; [[The part name]] | ||
380 | } | ||
381 | values { | ||
382 | allow: bool; [[$true to enable, $false otherwise]] | ||
383 | } | ||
384 | } | ||
385 | part_text_select_begin @const { | ||
386 | [[Starts selecting at current cursor position]] | ||
387 | params { | ||
388 | @in part: string; [[The part name]] | ||
389 | } | ||
390 | } | ||
391 | part_text_select_abort @const { | ||
392 | [[Aborts any selection action on a part.]] | ||
393 | params { | ||
394 | @in part: string; [[The part name]] | ||
395 | } | ||
396 | } | ||
397 | part_text_select_extend @const { | ||
398 | [[Extends the current selection to the current cursor position]] | ||
399 | params { | ||
400 | @in part: string; [[The part name]] | ||
401 | } | ||
402 | } | ||
403 | part_text_select_all @const { | ||
404 | [[Sets the selection to be everything. | ||
405 | |||
406 | This function selects all text of the object of the part.]] | ||
407 | params { | ||
408 | @in part: string; [[The part name]] | ||
409 | } | ||
410 | } | ||
411 | part_text_select_none @const { | ||
412 | [[Sets the selection to be none. | ||
413 | |||
414 | This function sets the selection text to be none.]] | ||
415 | params { | ||
416 | @in part: string; [[The part name]] | ||
417 | } | ||
418 | } | ||
419 | @property part_text_selection { | ||
420 | get { | ||
421 | [[Returns the selection text of the object part. | ||
422 | |||
423 | This function returns selection text of the object part. | ||
424 | |||
425 | See also @.part_text_select_all() and @.part_text_select_none()]] | ||
426 | return: string; [[The text string]] | ||
427 | } | ||
428 | keys { | ||
429 | part: string; [[The part name]] | ||
430 | } | ||
431 | } | ||
432 | /* TEXT PART APIS END ------------------------------------------------ */ | 368 | /* TEXT PART APIS END ------------------------------------------------ */ |
433 | 369 | ||
434 | @property seat { | 370 | @property seat { |
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 67c18c6535..e76eb582b2 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c | |||
@@ -1978,10 +1978,13 @@ _edje_efl_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | |||
1978 | return NULL; | 1978 | return NULL; |
1979 | } | 1979 | } |
1980 | 1980 | ||
1981 | EOLIAN const char * | 1981 | EAPI const char * |
1982 | _edje_object_part_text_selection_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 1982 | edje_object_part_text_selection_get(const Eo *obj, const char *part) |
1983 | { | 1983 | { |
1984 | Edje_Real_Part *rp; | 1984 | Edje_Real_Part *rp; |
1985 | Edje *ed; | ||
1986 | |||
1987 | ed = _edje_fetch(obj); | ||
1985 | 1988 | ||
1986 | if ((!ed) || (!part)) return NULL; | 1989 | if ((!ed) || (!part)) return NULL; |
1987 | rp = _edje_real_part_recursive_get(&ed, part); | 1990 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -1992,10 +1995,13 @@ _edje_object_part_text_selection_get(Eo *obj EINA_UNUSED, Edje *ed, const char * | |||
1992 | return NULL; | 1995 | return NULL; |
1993 | } | 1996 | } |
1994 | 1997 | ||
1995 | EOLIAN void | 1998 | EAPI void |
1996 | _edje_object_part_text_select_none(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 1999 | edje_object_part_text_select_none(const Eo *obj, const char *part) |
1997 | { | 2000 | { |
1998 | Edje_Real_Part *rp; | 2001 | Edje_Real_Part *rp; |
2002 | Edje *ed; | ||
2003 | |||
2004 | ed = _edje_fetch(obj); | ||
1999 | 2005 | ||
2000 | if ((!ed) || (!part)) return; | 2006 | if ((!ed) || (!part)) return; |
2001 | rp = _edje_real_part_recursive_get(&ed, part); | 2007 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -2004,10 +2010,13 @@ _edje_object_part_text_select_none(Eo *obj EINA_UNUSED, Edje *ed, const char *pa | |||
2004 | _edje_entry_select_none(rp); | 2010 | _edje_entry_select_none(rp); |
2005 | } | 2011 | } |
2006 | 2012 | ||
2007 | EOLIAN void | 2013 | EAPI void |
2008 | _edje_object_part_text_select_all(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 2014 | edje_object_part_text_select_all(const Eo *obj, const char *part) |
2009 | { | 2015 | { |
2010 | Edje_Real_Part *rp; | 2016 | Edje_Real_Part *rp; |
2017 | Edje *ed; | ||
2018 | |||
2019 | ed = _edje_fetch(obj); | ||
2011 | 2020 | ||
2012 | if ((!ed) || (!part)) return; | 2021 | if ((!ed) || (!part)) return; |
2013 | rp = _edje_real_part_recursive_get(&ed, part); | 2022 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -2037,16 +2046,12 @@ _edje_object_part_text_cursor_geometry_get(Eo *obj EINA_UNUSED, Edje *ed, const | |||
2037 | } | 2046 | } |
2038 | 2047 | ||
2039 | EAPI void | 2048 | EAPI void |
2040 | edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow) | 2049 | edje_object_part_text_select_allow_set(const Eo *obj, const char *part, Eina_Bool allow) |
2041 | { | ||
2042 | edje_obj_part_text_select_allow_set((Eo *)obj, part, allow); | ||
2043 | } | ||
2044 | |||
2045 | |||
2046 | EOLIAN void | ||
2047 | _edje_object_part_text_select_allow_set(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Eina_Bool allow) | ||
2048 | { | 2050 | { |
2049 | Edje_Real_Part *rp; | 2051 | Edje_Real_Part *rp; |
2052 | Edje *ed; | ||
2053 | |||
2054 | ed = _edje_fetch(obj); | ||
2050 | 2055 | ||
2051 | if ((!ed) || (!part)) return; | 2056 | if ((!ed) || (!part)) return; |
2052 | rp = _edje_real_part_recursive_get(&ed, part); | 2057 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -2055,10 +2060,13 @@ _edje_object_part_text_select_allow_set(Eo *obj EINA_UNUSED, Edje *ed, const cha | |||
2055 | _edje_entry_select_allow_set(rp, allow); | 2060 | _edje_entry_select_allow_set(rp, allow); |
2056 | } | 2061 | } |
2057 | 2062 | ||
2058 | EOLIAN void | 2063 | EAPI void |
2059 | _edje_object_part_text_select_abort(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 2064 | edje_object_part_text_select_abort(const Eo *obj, const char *part) |
2060 | { | 2065 | { |
2061 | Edje_Real_Part *rp; | 2066 | Edje_Real_Part *rp; |
2067 | Edje *ed; | ||
2068 | |||
2069 | ed = _edje_fetch(obj); | ||
2062 | 2070 | ||
2063 | if ((!ed) || (!part)) return; | 2071 | if ((!ed) || (!part)) return; |
2064 | rp = _edje_real_part_recursive_get(&ed, part); | 2072 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -2067,10 +2075,13 @@ _edje_object_part_text_select_abort(Eo *obj EINA_UNUSED, Edje *ed, const char *p | |||
2067 | _edje_entry_select_abort(rp); | 2075 | _edje_entry_select_abort(rp); |
2068 | } | 2076 | } |
2069 | 2077 | ||
2070 | EOLIAN void | 2078 | EAPI void |
2071 | _edje_object_part_text_select_begin(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 2079 | edje_object_part_text_select_begin(const Eo *obj, const char *part) |
2072 | { | 2080 | { |
2073 | Edje_Real_Part *rp; | 2081 | Edje_Real_Part *rp; |
2082 | Edje *ed; | ||
2083 | |||
2084 | ed = _edje_fetch(obj); | ||
2074 | 2085 | ||
2075 | if ((!ed) || (!part)) return; | 2086 | if ((!ed) || (!part)) return; |
2076 | rp = _edje_real_part_recursive_get(&ed, part); | 2087 | rp = _edje_real_part_recursive_get(&ed, part); |
@@ -2079,10 +2090,13 @@ _edje_object_part_text_select_begin(Eo *obj EINA_UNUSED, Edje *ed, const char *p | |||
2079 | _edje_entry_select_begin(rp); | 2090 | _edje_entry_select_begin(rp); |
2080 | } | 2091 | } |
2081 | 2092 | ||
2082 | EOLIAN void | 2093 | EAPI void |
2083 | _edje_object_part_text_select_extend(Eo *obj EINA_UNUSED, Edje *ed, const char *part) | 2094 | edje_object_part_text_select_extend(const Eo *obj, const char *part) |
2084 | { | 2095 | { |
2085 | Edje_Real_Part *rp; | 2096 | Edje_Real_Part *rp; |
2097 | Edje *ed; | ||
2098 | |||
2099 | ed = _edje_fetch(obj); | ||
2086 | 2100 | ||
2087 | if ((!ed) || (!part)) return; | 2101 | if ((!ed) || (!part)) return; |
2088 | rp = _edje_real_part_recursive_get(&ed, part); | 2102 | rp = _edje_real_part_recursive_get(&ed, part); |
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index c908bedd77..1875e722a6 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c | |||
@@ -930,13 +930,6 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) | |||
930 | elm_widget_theme_object_set | 930 | elm_widget_theme_object_set |
931 | (obj, sd->entry_edje, "efl_ui_text", _efl_ui_text_theme_group_get(obj), style); | 931 | (obj, sd->entry_edje, "efl_ui_text", _efl_ui_text_theme_group_get(obj), style); |
932 | 932 | ||
933 | if (sd->sel_allow && _elm_config->desktop_entry) | ||
934 | edje_obj_part_text_select_allow_set | ||
935 | (sd->entry_edje, "elm.text", EINA_TRUE); | ||
936 | else | ||
937 | edje_obj_part_text_select_allow_set | ||
938 | (sd->entry_edje, "elm.text", EINA_FALSE); | ||
939 | |||
940 | if (elm_widget_disabled_get(obj)) | 933 | if (elm_widget_disabled_get(obj)) |
941 | edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); | 934 | edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); |
942 | 935 | ||
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 822cd68ea0..a1a6896c3b 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c | |||
@@ -886,10 +886,10 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) | |||
886 | (obj, sd->entry_edje, "entry", _elm_entry_theme_group_get(obj), style); | 886 | (obj, sd->entry_edje, "entry", _elm_entry_theme_group_get(obj), style); |
887 | 887 | ||
888 | if (sd->sel_allow && _elm_config->desktop_entry) | 888 | if (sd->sel_allow && _elm_config->desktop_entry) |
889 | edje_obj_part_text_select_allow_set | 889 | edje_object_part_text_select_allow_set |
890 | (sd->entry_edje, "elm.text", EINA_TRUE); | 890 | (sd->entry_edje, "elm.text", EINA_TRUE); |
891 | else | 891 | else |
892 | edje_obj_part_text_select_allow_set | 892 | edje_object_part_text_select_allow_set |
893 | (sd->entry_edje, "elm.text", EINA_FALSE); | 893 | (sd->entry_edje, "elm.text", EINA_FALSE); |
894 | 894 | ||
895 | edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", stl_user); | 895 | edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", stl_user); |
@@ -5449,7 +5449,7 @@ _elm_entry_select_allow_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina_Bool a | |||
5449 | if (sd->sel_allow == allow) return; | 5449 | if (sd->sel_allow == allow) return; |
5450 | sd->sel_allow = allow; | 5450 | sd->sel_allow = allow; |
5451 | 5451 | ||
5452 | edje_obj_part_text_select_allow_set(sd->entry_edje, "elm.text", allow); | 5452 | edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text", allow); |
5453 | } | 5453 | } |
5454 | 5454 | ||
5455 | EOLIAN static Eina_Bool | 5455 | EOLIAN static Eina_Bool |