diff options
author | Hermet Park <hermetpark@gmail.com> | 2020-01-28 13:14:42 +0900 |
---|---|---|
committer | Hermet Park <hermetpark@gmail.com> | 2020-01-28 13:14:42 +0900 |
commit | e8459a8e4b476788ee5130679924abeb98f90a33 (patch) | |
tree | ea0d4accf1f7ee45cd8501bb6aa8680f480ecdf3 | |
parent | d30dd3140c588388ddb32a6ed79fcc47b3e187a8 (diff) | |
parent | b3c0da13d80456bcbf3954698413df5ee845b8c2 (diff) | |
download | efl-e8459a8e4b476788ee5130679924abeb98f90a33.tar.gz |
Merge branch 'master' into devs/hermet/lottie
63 files changed, 659 insertions, 460 deletions
@@ -361,7 +361,8 @@ pointers to be indirect table lookups for increased safety at runtime. This library provides a wrapper around the Bullet physics library, allowing for it to be linked directly with Evas objects and control -their behavior as if they were real physical objects. +their behavior as if they were real physical objects. This is now +disabled by default as it's rarely if ever used by anything. @@ -423,9 +424,9 @@ to C++ libraries like Bullet and our C++ bindings. Required by default: - * bullet * libpng * libjpeg + * openjpeg2 * gstreamer (Ensure all codecs you want are installed.) * zlib * luajit (lua 5.1 or 5.2 support optional) @@ -437,6 +438,7 @@ Required by default: * fontconfig * freetype2 * fribidi + * harfbuzz * libpulse * libsndfile * libx11 @@ -452,10 +454,9 @@ Required by default: * libxss * libxtst * libxcursor - * libxp * libxi (2.2 or newer) * opengl(mesa etc.) (opengl/glx/full or opengl-es2/egl. full opengl only on osx - must be explicitly specified to be full to have support) - * giflib + * giflib/libgif * util-linux (limbount + libblkid) * systemd / libudev * poppler / poppler-cpp diff --git a/confs/freebsd.sh b/confs/freebsd.sh new file mode 100755 index 0000000000..1a88fc7295 --- /dev/null +++ b/confs/freebsd.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e +meson -Dsystemd=false -Dv4l2=false -Deeze=false -Devas-loaders-disabler=json \ + $@ . build diff --git a/confs/linux-elogind.sh b/confs/linux-elogind.sh new file mode 100755 index 0000000000..077ea58f99 --- /dev/null +++ b/confs/linux-elogind.sh @@ -0,0 +1,4 @@ +#!/bin/sh -e +meson -Dfb=true -Ddrm=true -Dwl=true -Devas-loaders-disabler=json \ + -Dsystemd=false -Delogind=true \ + $@ . build diff --git a/confs/linux-nowayland-nosystemd.sh b/confs/linux-nowayland-nosystemd.sh new file mode 100755 index 0000000000..ea9fde6695 --- /dev/null +++ b/confs/linux-nowayland-nosystemd.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e +meson -Dfb=true -Dsystemd=false -Devas-loaders-disabler=json \ + $@ . build diff --git a/confs/linux-nowayland.sh b/confs/linux-nowayland.sh new file mode 100755 index 0000000000..4219e980b2 --- /dev/null +++ b/confs/linux-nowayland.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e +meson -Dfb=true -Devas-loaders-disabler=json \ + $@ . build diff --git a/confs/linux.sh b/confs/linux.sh new file mode 100755 index 0000000000..223cb0df3e --- /dev/null +++ b/confs/linux.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e +meson -Dfb=true -Ddrm=true -Dwl=true -Devas-loaders-disabler=json \ + $@ . build diff --git a/examples_checks.py b/examples_checks.py index b5494530a7..ef42de80b1 100755 --- a/examples_checks.py +++ b/examples_checks.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import os import subprocess import json diff --git a/generate_widget_header.py b/generate_widget_header.py index c1de110855..3c1045a954 100755 --- a/generate_widget_header.py +++ b/generate_widget_header.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import sys import os from ete3 import Tree, TreeStyle, AttrFace, faces, NodeStyle diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c index 34792f3832..c9ec2d6222 100644 --- a/src/bin/elementary/test_ui_pager.c +++ b/src/bin/elementary/test_ui_pager.c @@ -316,7 +316,7 @@ static void indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Params *params = data; - params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager); + params->indicator = efl_add(EFL_PAGE_ICON_INDICATOR_CLASS, params->pager); efl_ui_pager_indicator_set(params->pager, params->indicator); } diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c index c60ac486b2..7c1211e31b 100644 --- a/src/bin/elementary/test_ui_pager_scroll.c +++ b/src/bin/elementary/test_ui_pager_scroll.c @@ -369,7 +369,7 @@ static void indicator_icon_btn_cb(void *data, { Params *params = data; - params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager); + params->indicator = efl_add(EFL_PAGE_ICON_INDICATOR_CLASS, params->pager); efl_ui_pager_indicator_set(params->pager, params->indicator); } diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c index f38dfca754..cf52bb750a 100644 --- a/src/bin/elementary/test_ui_spotlight.c +++ b/src/bin/elementary/test_ui_spotlight.c @@ -396,7 +396,7 @@ indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Params *params = data; - params->indicator = efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS); + params->indicator = efl_new(EFL_UI_SPOTLIGHT_ICON_INDICATOR_CLASS); efl_ui_spotlight_indicator_set(params->spotlight, params->indicator); } diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index 62e4e7df09..1cc0055051 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -527,14 +527,14 @@ _tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) static void _tran_set_btn_scroll_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_Spotlight_Manager_Scroll *scroll = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS); + Efl_Ui_Spotlight_Scroll_Manager *scroll = efl_new(EFL_UI_SPOTLIGHT_SCROLL_MANAGER_CLASS); efl_ui_spotlight_manager_set(data, scroll); } static void _tran_set_btn_stack_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_Spotlight_Manager_Scroll *stack = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); + Efl_Ui_Spotlight_Scroll_Manager *stack = efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS); efl_ui_spotlight_manager_set(data, stack); } diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh index 1f4152aa74..48d69dc834 100644 --- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh @@ -564,12 +564,13 @@ struct struct_definition_generator // iterate struct fields for (auto const& field : struct_.fields) { - if (!as_generator(documentation(indent.n + 1)).generate(sink, field, context)) + auto docs = documentation(indent.n + 1); + if (!as_generator(docs).generate(sink, field, context)) return false; if (!field.type.doc_summary.empty()) { - if (!as_generator(indent << scope_tab << "/// <value>" << field.type.doc_summary << "</value>\n").generate(sink, attributes::unused, context)) + if (!docs.generate_tag_value(sink, field.type.doc_summary, context)) return false; } diff --git a/src/examples/elementary/efl_ui_slideshow_example.c b/src/examples/elementary/efl_ui_slideshow_example.c index 6292f4390f..4be9865bd3 100644 --- a/src/examples/elementary/efl_ui_slideshow_example.c +++ b/src/examples/elementary/efl_ui_slideshow_example.c @@ -93,8 +93,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) container = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, win, efl_event_callback_add(efl_added, EFL_UI_SPOTLIGHT_EVENT_TRANSITION_END, _container_end, NULL), efl_pack_table(table, efl_added, 0, 0, 1, 1)); - efl_ui_spotlight_indicator_set(container, efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS)); - efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS)); + efl_ui_spotlight_indicator_set(container, efl_new(EFL_UI_SPOTLIGHT_ICON_INDICATOR_CLASS)); + efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS)); for (int i = 0; i < IMG_NUM; i++) { diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c index 226d557c29..206845b308 100644 --- a/src/lib/ecore_con/efl_net_server_unix.c +++ b/src/lib/ecore_con/efl_net_server_unix.c @@ -45,53 +45,63 @@ typedef struct _Efl_Net_Server_Unix_Data { unsigned int leading_directories_create_mode; - Eina_Bool leading_directories_create; - Eina_Bool unlink_before_bind; +#ifdef BIND_HANG_WORKAROUND + int lock_fd; + Eina_Bool have_lock_fd : 1; +#endif + Eina_Bool leading_directories_create : 1; + Eina_Bool unlink_before_bind : 1; } Efl_Net_Server_Unix_Data; #ifdef BIND_HANG_WORKAROUND -static Eina_Error -_efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lock) +static int +_efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lock, int lockfile_fd) { size_t addrlen; char *lockfile; - int lockfile_fd, ret; - Eina_Error err = 0; + int ret; - if (strncmp(address, "abstract:", strlen("abstract:")) == 0) return err; + if (strncmp(address, "abstract:", strlen("abstract:")) == 0) return -1; addrlen = strlen(address); lockfile = malloc(addrlen + 1 + 5); - if (!lockfile) return err; + if (!lockfile) return -1; strcpy(lockfile, address); strncpy(lockfile + addrlen, ".lock", 6); + if (lock) + { #ifdef HAVE_OPEN_CLOEXEC - lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, - S_IRUSR | S_IWUSR); - if (lockfile_fd < 0) return err; + lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, + S_IRUSR | S_IWUSR); + if (lockfile_fd < 0) return -1; #else - lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC, - S_IRUSR | S_IWUSR); - if (lockfile_fd < 0) return err; - eina_file_close_on_exec(lockfile_fd, EINA_TRUE); + lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR); + if (lockfile_fd < 0) return -1; + eina_file_close_on_exec(lockfile_fd, EINA_TRUE); #endif + } errno = 0; if (lock) { ret = flock(lockfile_fd, LOCK_EX | LOCK_NB); if ((ret != 0) && (errno == EWOULDBLOCK)) - err = EADDRINUSE; + { + close(lockfile_fd); + lockfile_fd = -1; + } } else { flock(lockfile_fd, LOCK_UN | LOCK_NB); unlink(lockfile); + close(lockfile_fd); + lockfile_fd = -1; } - close(lockfile_fd); free(lockfile); - return err; + return lockfile_fd; } #endif @@ -107,7 +117,13 @@ _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd E { unlink(address); #ifdef BIND_HANG_WORKAROUND - _efl_net_server_unix_bind_hang_lock_workaround(address, EINA_FALSE); + if ((pd->have_lock_fd) && (pd->lock_fd >= 0)) + { + _efl_net_server_unix_bind_hang_lock_workaround + (address, EINA_FALSE, pd->lock_fd); + pd->lock_fd = -1; + pd->have_lock_fd = EINA_FALSE; + } #endif } } @@ -173,8 +189,14 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd) } #ifdef BIND_HANG_WORKAROUND - if (_efl_net_server_unix_bind_hang_lock_workaround(address, EINA_TRUE)) - goto error; + pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround + (address, EINA_TRUE, -1); + if (pd->lock_fd < 0) + { + err = EADDRINUSE; + goto error; + } + pd->have_lock_fd = EINA_TRUE; #endif r = bind(fd, (struct sockaddr *)&addr, addrlen); if (r != 0) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 75a7366f82..0d7aaaa727 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1218,7 +1218,7 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri _pointer_cb_enter(data, NULL, serial, surface, x, y); - if ((!input->grab.window) && (input->focus.touch)) + if ((!input->grab.window) && (input->focus.touch) && input->grab.touch_count == 1) { _ecore_wl2_input_grab(input, input->focus.touch, BTN_LEFT); input->grab.timestamp = timestamp; @@ -1235,7 +1235,7 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial input = data; if (!input) return; - if (!input->focus.touch) return; + EINA_SAFETY_ON_NULL_RETURN(input->focus.touch); //if this is happening, then we are getting up events in a invalid state input->timestamp = timestamp; input->display->serial = serial; @@ -1246,7 +1246,7 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial if (input->grab.count) input->grab.count--; if (input->grab.touch_count) input->grab.touch_count--; if ((input->grab.window) && (input->grab.button == BTN_LEFT) && - (!input->grab.count)) + (!input->grab.count) && !input->grab.touch_count) _ecore_wl2_input_ungrab(input); if (input->grab.touch_count == 0) input->focus.touch = NULL; diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index d32ab8d2d3..956a8085c1 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -21,10 +21,3 @@ struct @beta Efl.Text_Change_Info { insertion: bool; [[$true if the content was inserted, $false if removed]] mergeable: bool; [[$true if can be merged with the previous one. Used for example with insertion when something is already selected]] } - -struct @beta Efl.Text_Range { - [[This structure includes text position range (from/to). - ]] - start: int; [[The start postion.]] - end: int; [[The end position.]] -} diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 4ec831f2a2..c010581c74 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -266,9 +266,9 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include <efl_ui_spotlight_container.eo.h> # include <efl_ui_spotlight_manager.eo.h> # include <efl_ui_spotlight_indicator.eo.h> -# include <efl_ui_spotlight_indicator_icon.eo.h> -# include <efl_ui_spotlight_manager_scroll.eo.h> -# include <efl_ui_spotlight_manager_stack.eo.h> +# include <efl_ui_spotlight_icon_indicator.eo.h> +# include <efl_ui_spotlight_scroll_manager.eo.h> +# include <efl_ui_spotlight_fade_manager.eo.h> # include <efl_ui_spotlight_util.eo.h> # include <efl_ui_stack.eo.h> # include <efl_ui_pager.eo.h> diff --git a/src/lib/elementary/efl_text_interactive.eo b/src/lib/elementary/efl_text_interactive.eo index 933aad0cb1..cc15cdc15b 100644 --- a/src/lib/elementary/efl_text_interactive.eo +++ b/src/lib/elementary/efl_text_interactive.eo @@ -25,13 +25,17 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font_Properties, } @property selection_cursors { [[The cursors used for selection handling. - If the cursors are equal there's no selection. - - You are allowed to retain and modify them. Modifying them modifies - the selection of the object. ]] - get {} + get { + [[You are allowed to retain and modify them. Modifying them modifies + the selection of the object (recommended to extend selection range).]] + } + set { + [[The positions of passed cursors will be used to set selection cursors positions. + Further modification for passed @Efl.Text.Cursor objects, will not affect selection. + Setter is recommended to set new range for selection.]] + } values { start: Efl.Text.Cursor; [[The start of the selection.]] end: Efl.Text.Cursor; [[The end of the selection.]] @@ -75,7 +79,7 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font_Properties, event but only the last one will emit a @[.changed,user] event. ]] have_selection,changed: bool; [[Emitted when the @.have_selection property value changes.]] - selection,changed: Efl.Text_Range; [[Emitted when selection has changed. Query using @.selection_cursors.]] + selection,changed: Eina.Range; [[Emitted when selection has changed. Query using @.selection_cursors.]] redo,request: void; [[Emitted when a redo operation is requested.]] undo,request: void; [[Emitted when a undo operation is requested.]] changed,user: Efl.Text_Change_Info; [[Emitted when the text content has changed due to user interaction.]] diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index 1de73161c5..1f6ba219d1 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -999,7 +999,6 @@ _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd) const Eina_File *f; const char *key; const char *file = efl_file_get(obj); - efl_file_unload(obj); if (eina_str_has_extension(file, ".edj")) return _efl_ui_image_edje_file_set(obj); diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 62a146422f..7d4f5d072a 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -1972,32 +1972,6 @@ _efl_ui_image_zoomable_efl_layout_group_group_size_max_get(const Eo *obj EINA_UN return EINA_SIZE2D(0, 0); } -EOLIAN static Eina_Bool -_efl_ui_image_zoomable_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED, - const char *emission, const char *source, - void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) -{ - Eina_Bool ok; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - ok = efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_data, func, func_free_cb); - - return ok; -} - -EOLIAN static Eina_Bool -_efl_ui_image_zoomable_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED, - const char *emission, const char *source, - void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) -{ - Eina_Bool ok; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - ok = efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_data, func, func_free_cb); - - return ok; -} - static Eina_Error _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool resize) @@ -3040,7 +3014,7 @@ _efl_ui_image_zoomable_animate_cb(void *data) return ECORE_CALLBACK_RENEW; } -static Eina_Bool +static Eina_Bool _efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool anim) { anim = !!anim; diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo index 4887128503..e27eb82c13 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.eo +++ b/src/lib/elementary/efl_ui_image_zoomable.eo @@ -67,9 +67,6 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom Efl.Gfx.Image_Orientable.image_orientation { get; set; } Efl.Layout.Group.group_size_min { get; } Efl.Layout.Group.group_size_max { get; } - Efl.Layout.Signal.signal_callback_add; - Efl.Layout.Signal.signal_callback_del; - //Efl.Canvas.Layout_Group.group_data { get; } } events { press: void; [[Called when photocam got pressed]] diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 8c39ed6287..146deb7de5 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -14,17 +14,21 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data { Efl_Text_Cursor *sel_start, *sel_end; + Eina_Bool watch_selection; Efl_Text_Cursor *main_cursor; Efl_Text_Cursor *preedit_start, *preedit_end; Ecore_Timer *pw_timer; Eina_List *seq; char *selection; + const char *file; + Elm_Text_Format format; Eina_Bool composing : 1; Eina_Bool selecting : 1; Eina_Bool have_selection : 1; Eina_Bool select_allow : 1; Eina_Bool editable : 1; Eina_Bool had_sel : 1; + Eina_Bool auto_save : 1; Eina_Bool prediction_allow : 1; Eina_Bool anchors_updated : 1; Eina_Bool auto_return_key : 1; @@ -44,13 +48,17 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data } Efl_Ui_Internal_Text_Interactive_Data; static void _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en); -static void _sel_init(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); -static void _sel_enable(Efl_Text_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_init(Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_enable(Evas_Object *o,Efl_Ui_Internal_Text_Interactive_Data *en); static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en); static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en); static void _entry_imf_cursor_info_set(Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_watch_freeze(Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_watch_thaw(Efl_Ui_Internal_Text_Interactive_Data *en); + static void _text_filter_format_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en, Efl_Text_Cursor *c, const char *text); @@ -82,6 +90,18 @@ _cur_pos_copy(Efl_Text_Cursor *src, Efl_Text_Cursor *dest) efl_text_cursor_position_set(dest, efl_text_cursor_position_get(src)); } +static void +_sel_watch_freeze(Efl_Ui_Internal_Text_Interactive_Data *en) +{ + en->watch_selection = EINA_FALSE; +} + +static void +_sel_watch_thaw(Efl_Ui_Internal_Text_Interactive_Data *en) +{ + en->watch_selection = EINA_TRUE; +} + #ifdef HAVE_ECORE_IMF static void _preedit_clear(Efl_Ui_Internal_Text_Interactive_Data *en) @@ -628,8 +648,8 @@ _entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED { _sel_clear(obj, en); efl_text_cursor_position_set(cur, ev->start); - _sel_enable(cur, obj, en); - _sel_init(cur, obj, en); + _sel_enable(obj, en); + _sel_init(cur, en); efl_text_cursor_position_set(cur, ev->end); _sel_extend(cur, obj, en); } @@ -747,19 +767,69 @@ _entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj EINA_UNUSED, Efl_Ui_I } static void +_sel_reset(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en){ + + if (!en->watch_selection) + return; + + if (!en->have_selection && efl_text_cursor_equal(en->sel_start, en->sel_end)) + return; + + if (en->have_selection) + { + if (efl_text_cursor_equal(en->sel_start, en->sel_end)) + { + _sel_clear(obj, en); + } + else + { + _entry_imf_cursor_info_set(en); + if (en->selection) + { + free(en->selection); + en->selection = NULL; + } + _emit_sel_state(obj, en); + } + } + else + { + if (!efl_text_cursor_equal(en->sel_start, en->sel_end)) + { + _sel_enable(obj, en); + _entry_imf_cursor_info_set(en); + if (en->selection) + { + free(en->selection); + en->selection = NULL; + } + _emit_sel_state(obj, en); + } + } +} + +static void _sel_cursor_changed(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { -// Eo *obj = data; + Efl_Ui_Internal_Text_Interactive *obj = data; + Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); + + if (!efl_text_interactive_selection_allowed_get(obj)) + return; + + _sel_reset(obj, en); } static void -_sel_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) +_sel_init(Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en) { if (en->have_selection) return; + _sel_watch_freeze(en); _cur_pos_copy(c, en->sel_start); _cur_pos_copy(c, en->sel_end); + _sel_watch_thaw(en); en->have_selection = EINA_FALSE; if (en->selection) @@ -770,8 +840,7 @@ _sel_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_I } static void -_sel_enable(Efl_Text_Cursor *c EINA_UNUSED, - Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) +_sel_enable(Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en) { if (en->have_selection) return; en->have_selection = EINA_TRUE; @@ -791,14 +860,12 @@ _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en) { if (!efl_text_cursor_compare(en->sel_start, en->sel_end)) { - Eina_Bool b_value = EINA_FALSE; - efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); + _sel_clear(o, en); } else { - Efl_Text_Range range = {0}; - range.start = efl_text_cursor_position_get(en->sel_start); - range.end = efl_text_cursor_position_get(en->sel_end); + Eina_Range range = eina_range_from_to(efl_text_cursor_position_get(en->sel_start), + efl_text_cursor_position_get(en->sel_end)); efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, &range); } } @@ -806,11 +873,12 @@ _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en) static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) { - if (!en->sel_end) return; - _sel_enable(c, o, en); + _sel_enable(o, en); if (efl_text_cursor_equal(c, en->sel_end)) return; + _sel_watch_freeze(en); _cur_pos_copy(c, en->sel_end); + _sel_watch_thaw(en); _entry_imf_cursor_info_set(en); @@ -836,7 +904,9 @@ _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en { en->have_selection = EINA_FALSE; Eina_Bool b_value = en->have_selection; + _sel_watch_freeze(en); _cur_pos_copy(en->sel_start, en->sel_end); + _sel_watch_thaw(en); efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); } } @@ -852,25 +922,28 @@ EOLIAN static Eina_Bool _efl_ui_internal_text_interactive_efl_text_interactive_have_selection_get( const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { + if (!en->have_selection) return en->have_selection; return !efl_text_cursor_equal(en->sel_start, en->sel_end); } EOLIAN static void _efl_ui_internal_text_interactive_efl_text_interactive_all_select( - Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) + Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en EINA_UNUSED) { if (!efl_text_interactive_selection_allowed_get(obj)) return; - Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj); - _entry_imf_context_reset(en); + Eo *c1 = efl_canvas_textblock_cursor_create(obj); + Eo *c2 = efl_canvas_textblock_cursor_create(obj); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST); - _entry_imf_context_reset(en); - _sel_init(cur, obj, en); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST); - _sel_extend(cur, obj, en); + efl_text_cursor_move(c1, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST); + efl_text_cursor_move(c2, EFL_TEXT_CURSOR_MOVE_TYPE_LAST); + + efl_text_interactive_selection_cursors_set(obj, c1, c2); + + efl_del(c1); + efl_del(c2); } @@ -1024,7 +1097,7 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, E { if (shift) { - _sel_init(cur, obj, en); + _sel_init(cur, en); } else if (en->have_selection) { @@ -1032,7 +1105,8 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, E if ((sel_forward && movement_forward) || (!sel_forward && !movement_forward)) _cur_pos_copy(en->sel_end, cur); else - _cur_pos_copy(en->sel_start, cur); + _cur_pos_copy(en->sel_start, cur); + _sel_clear(obj, en); } } @@ -1571,7 +1645,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN tc = efl_canvas_textblock_cursor_create(obj); _cur_pos_copy(cur, tc); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START); - _sel_init(cur, obj, en); + _sel_init(cur, en); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END); _sel_extend(cur, obj, en); } @@ -1600,7 +1674,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN tc = efl_canvas_textblock_cursor_create(obj); _cur_pos_copy(cur, tc); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START); - _sel_init(cur, obj, en); + _sel_init(cur, en); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); _sel_extend(cur, obj, en); @@ -1620,7 +1694,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN { en->selecting = EINA_TRUE; _sel_clear(obj, en); - _sel_init(cur, obj, en); + _sel_init(cur, en); } } @@ -1719,7 +1793,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo _sel_extend(cur, obj, en); if (!efl_text_cursor_equal(en->sel_start, en->sel_end)) - _sel_enable(cur, obj, en); + _sel_enable(obj, en); } efl_del(tc); } @@ -1737,9 +1811,18 @@ _efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Interna obj = efl_constructor(efl_super(obj, MY_CLASS)); en->select_allow = EINA_TRUE; en->editable = EINA_TRUE; + en->watch_selection = EINA_TRUE; return obj; } +EOLIAN static void +_efl_ui_internal_text_interactive_efl_object_destructor(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *sd) +{ + eina_stringshare_del(sd->file); + sd->file = NULL; + efl_destructor(efl_super(obj, MY_CLASS)); +} + EOLIAN static Efl_Object * _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { @@ -1754,7 +1837,9 @@ _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, Efl_Ui_Internal_T en->sel_start = efl_canvas_textblock_cursor_create(obj); en->sel_end = efl_canvas_textblock_cursor_create(obj); - efl_event_callback_add(efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_EVENT_CHANGED, + efl_event_callback_add(en->sel_start, EFL_TEXT_CURSOR_EVENT_CHANGED, + _sel_cursor_changed, obj); + efl_event_callback_add(en->sel_end, EFL_TEXT_CURSOR_EVENT_CHANGED, _sel_cursor_changed, obj); #ifdef HAVE_ECORE_IMF @@ -1874,6 +1959,31 @@ _efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_get(con } EOLIAN static void +_efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en, Efl_Text_Cursor *start, Efl_Text_Cursor *end) +{ + if (!efl_text_interactive_selection_allowed_get(obj)) + return; + + int new_sel_start_pos = efl_text_cursor_position_get(start); + int new_sel_end_pos = efl_text_cursor_position_get(end); + + int current_sel_start_pos = efl_text_cursor_position_get(en->sel_start); + int current_sel_end_pos = efl_text_cursor_position_get(en->sel_end); + + Eina_Bool b_start_changed = (new_sel_start_pos == current_sel_start_pos); + Eina_Bool b_end_changed = (new_sel_end_pos == current_sel_end_pos); + + if (b_start_changed && b_end_changed) + return; + + _sel_watch_freeze(en); + efl_text_cursor_position_set(en->sel_start, new_sel_start_pos); + efl_text_cursor_position_set(en->sel_end, new_sel_end_pos); + _sel_watch_thaw(en); + _sel_reset(obj, en); +} + +EOLIAN static void _efl_ui_internal_text_interactive_efl_text_interactive_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd, Eina_Bool editable) { sd->editable = editable; @@ -2216,5 +2326,154 @@ _efl_ui_internal_text_interactive_efl_input_text_autocapitalization_get(const Eo #endif } + +static char * +_file_load(Eo *obj) +{ + Eina_File *f; + char *text = NULL; + void *tmp = NULL; + + f = eina_file_dup(efl_file_mmap_get(obj)); + + tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + if (!tmp) goto on_error; + + text = malloc(eina_file_size_get(f) + 1); + if (!text) goto on_error; + + memcpy(text, tmp, eina_file_size_get(f)); + text[eina_file_size_get(f)] = 0; + + if (eina_file_map_faulted(f, tmp)) + { + ELM_SAFE_FREE(text, free); + } + + on_error: + if (tmp) eina_file_map_free(f, tmp); + eina_file_close(f); + + return text; +} + +static char * +_plain_load(Eo *obj) +{ + return _file_load(obj); +} + +static Eina_Error +_load_do(Evas_Object *obj) +{ + char *text; + Eina_Error err = 0; + + Efl_Ui_Internal_Text_Interactive_Data * sd = efl_data_scope_get(obj, MY_CLASS); + + if (!sd->file) + { + efl_text_set(obj, ""); + return 0; + } + + switch (sd->format) + { + /* Only available format */ + case ELM_TEXT_FORMAT_PLAIN_UTF8: + text = _plain_load(obj); + if (!text) + { + err = errno; + if (!err) err = ENOENT; + } + break; + + default: + text = NULL; + break; + } + + if (text) + { + efl_text_set(obj, text); + free(text); + return 0; + } + efl_text_set(obj, ""); + return err; +} + +static void +_text_save(const char *file, + const char *text) +{ + FILE *f; + + if (!text) + { + ecore_file_unlink(file); + return; + } + + f = fopen(file, "wb"); + if (!f) + { + ERR("Failed to open %s for writing", file); + return; + } + + if (fputs(text, f) == EOF) + ERR("Failed to write text to file %s", file); + fclose(f); +} + +static void +_save_do(Evas_Object *obj) +{ + Efl_Ui_Internal_Text_Interactive_Data * sd = efl_data_scope_get(obj, MY_CLASS); + + if (!sd->file) return; + switch (sd->format) + { + /* Only supported format */ + case ELM_TEXT_FORMAT_PLAIN_UTF8: + _text_save(sd->file, efl_text_get(obj)); + break; + + case ELM_TEXT_FORMAT_MARKUP_UTF8: + default: + break; + } +} + + +EOLIAN static Eina_Error +_efl_ui_internal_text_interactive_efl_file_file_set(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *sd, const char *file) +{ + eina_stringshare_replace(&sd->file, file); + return efl_file_set(efl_super(obj, MY_CLASS), file); +} + +EOLIAN static void +_efl_ui_internal_text_interactive_efl_file_unload(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *sd EINA_UNUSED) +{ + efl_file_unload(efl_super(obj, MY_CLASS)); + efl_text_set(obj, ""); +} + +EOLIAN static Eina_Error +_efl_ui_internal_text_interactive_efl_file_load(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *sd) +{ + Eina_Error err; + + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + if (sd->auto_save) _save_do(obj); + return _load_do(obj); +} + + #include "efl_ui_internal_text_interactive.eo.c" #include "efl_text_interactive.eo.c" diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo b/src/lib/elementary/efl_ui_internal_text_interactive.eo index 448f7a0c6c..ebe694b006 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.eo +++ b/src/lib/elementary/efl_ui_internal_text_interactive.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implements Efl.Text_Interactive, Efl.Input_Text +class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implements Efl.Text_Interactive, Efl.Input_Text, Efl.File { [[An internal object in charge of the interactive aspect of the text widget. @@ -6,10 +6,11 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implem ]] implements { Efl.Object.constructor; + Efl.Object.destructor; Efl.Object.finalize; Efl.Text_Interactive.main_cursor { get; } Efl.Text_Interactive.selection_allowed { get; set; } - Efl.Text_Interactive.selection_cursors { get; } + Efl.Text_Interactive.selection_cursors { get; set; } Efl.Text_Interactive.editable { get; set; } Efl.Text_Interactive.all_unselect; Efl.Text_Interactive.all_select; @@ -29,5 +30,9 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implem Efl.Input_Text.input_panel_show; Efl.Input_Text.input_panel_hide; Efl.Input_Text.input_panel_imdata { get; set; } + //FIXME Efl.File should be implemented later at Efl.Ui.TextBox level + Efl.File.file { set; } + Efl.File.load; + Efl.File.unload; } } diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 9ab1ab3a4a..3b6c50ba2a 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -551,6 +551,23 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd, Elm_Widget_Smart_ return ret; } +static void +_deferred_signals_emit(Efl_Ui_Layout_Data *pd) +{ + do + { + Deferred_Version_Signal *dvs = eina_inarray_pop(pd->deferred_signals); + + if (pd->version < dvs->version_threshold) + efl_layout_signal_emit(pd->obj, dvs->old_sig, "efl"); + else + efl_layout_signal_emit(pd->obj, dvs->new_sig, "efl"); + eina_stringshare_del(dvs->old_sig); + eina_stringshare_del(dvs->new_sig); + } while (eina_inarray_count(pd->deferred_signals)); + ELM_SAFE_FREE(pd->deferred_signals, eina_inarray_free); +} + EOLIAN static Eina_Error _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) { @@ -603,20 +620,8 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) } } if (sd->deferred_signals) - { - do - { - Deferred_Version_Signal *dvs = eina_inarray_pop(sd->deferred_signals); + _deferred_signals_emit(sd); - if (sd->version < dvs->version_threshold) - efl_layout_signal_emit(sd->obj, dvs->old_sig, "efl"); - else - efl_layout_signal_emit(sd->obj, dvs->new_sig, "efl"); - eina_stringshare_del(dvs->old_sig); - eina_stringshare_del(dvs->new_sig); - } while (eina_inarray_count(sd->deferred_signals)); - ELM_SAFE_FREE(sd->deferred_signals, eina_inarray_free); - } if (!version) { snprintf(buf, sizeof(buf), "%d%d", EFL_VERSION_MAJOR, EFL_VERSION_MINOR + (EFL_VERSION_MICRO == 99 ? 1 : 0)); @@ -2730,6 +2735,8 @@ _efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd) /* handle case where subclass does not call into layout */ pd->needs_theme_apply = EINA_FALSE; } + else if (pd->deferred_signals) + _deferred_signals_emit(pd); efl_canvas_group_change(obj); Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN); diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c index 8ac5a429cc..33ab9bf9bd 100644 --- a/src/lib/elementary/efl_ui_pager.c +++ b/src/lib/elementary/efl_ui_pager.c @@ -18,7 +18,7 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, Efl_Ui_Pager_Data *sd EINA_UNUSED) obj = efl_constructor(efl_super(obj, MY_CLASS)); - scroller = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS); + scroller = efl_new(EFL_UI_SPOTLIGHT_SCROLL_MANAGER_CLASS); efl_ui_spotlight_manager_set(obj, scroller); return obj; diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c index a5f3c9e390..1bc3c25f8f 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.c +++ b/src/lib/elementary/efl_ui_spotlight_container.c @@ -4,7 +4,7 @@ #include <Efl_Ui.h> #include "elm_priv.h" -#include "efl_ui_spotlight_manager_plain.eo.h" +#include "efl_ui_spotlight_plain_manager.eo.h" typedef struct _Efl_Ui_Spotlight_Container_Data { @@ -236,7 +236,7 @@ _efl_ui_spotlight_container_efl_object_finalize(Eo *obj, Efl_Ui_Spotlight_Contai //set a view manager in case nothing is here if (!manager) { - efl_ui_spotlight_manager_set(obj, efl_new(EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS)); + efl_ui_spotlight_manager_set(obj, efl_new(EFL_UI_SPOTLIGHT_PLAIN_MANAGER_CLASS)); } else { @@ -648,7 +648,7 @@ EOLIAN static void _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Ui_Spotlight_Manager *transition) { if (!transition) - pd->transition = efl_add(EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS, obj); + pd->transition = efl_add(EFL_UI_SPOTLIGHT_PLAIN_MANAGER_CLASS, obj); else EINA_SAFETY_ON_FALSE_RETURN(efl_isa(transition, EFL_UI_SPOTLIGHT_MANAGER_CLASS)); @@ -679,7 +679,7 @@ _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Cont EOLIAN static Efl_Ui_Spotlight_Manager* _efl_ui_spotlight_container_spotlight_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd) { - if (efl_isa(pd->transition, EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS)) + if (efl_isa(pd->transition, EFL_UI_SPOTLIGHT_PLAIN_MANAGER_CLASS)) return NULL; else return pd->transition; diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_fade_manager.c index dccef97cdc..da70a3848f 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c +++ b/src/lib/elementary/efl_ui_spotlight_fade_manager.c @@ -14,12 +14,12 @@ typedef struct { int ids[2]; //only used when in animation Eina_Size2D page_size; Eina_Bool animation; -} Efl_Ui_Spotlight_Manager_Stack_Data; +} Efl_Ui_Spotlight_Fade_Manager_Data; -#define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS +#define MY_CLASS EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS static void -_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd) +_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Fade_Manager_Data *pd) { Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->container); Eina_Rect goal = EINA_RECT_EMPTY(); @@ -37,7 +37,7 @@ _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd) static void _running_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_Spotlight_Manager_Stack_Data *pd = efl_data_scope_safe_get(data, MY_CLASS); + Efl_Ui_Spotlight_Fade_Manager_Data *pd = efl_data_scope_safe_get(data, MY_CLASS); double absolut_position; EINA_SAFETY_ON_NULL_RETURN(pd); @@ -58,7 +58,7 @@ _hide_object_cb(void *data, const Efl_Event *ev) } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Ui_Spotlight_Container *spotlight) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, Efl_Ui_Spotlight_Container *spotlight) { if (spotlight) { @@ -90,7 +90,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp } static void -_update_ids(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, int avoid_index) +_update_ids(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, int avoid_index) { for (int i = 0; i < 2; ++i) { @@ -102,7 +102,7 @@ _update_ids(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, int avoid_index) } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Fade_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { efl_key_data_set(subobj, "_elm_leaveme", pd->container); efl_canvas_object_clipper_set(subobj, pd->clipper); @@ -112,7 +112,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_add(Eo *obj EIN } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Fade_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index) { efl_key_data_set(subobj, "_elm_leaveme", NULL); efl_canvas_object_clipper_set(subobj, NULL); @@ -135,7 +135,7 @@ is_valid(Eo *obj, int index) } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, int from, int to) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, int from, int to) { if (efl_pack_content_get(pd->container, to) == pd->content[1]) return; @@ -175,14 +175,14 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_ } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Eina_Size2D size) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, Eina_Size2D size) { pd->page_size = size; _geom_sync(obj, pd); } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd) +_efl_ui_spotlight_fade_manager_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd) { efl_invalidate(efl_super(obj, MY_CLASS)); @@ -201,7 +201,7 @@ _efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_ } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Eina_Bool animation) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Fade_Manager_Data *pd, Eina_Bool animation) { for (int i = 0; i < 2; ++i) { @@ -212,10 +212,10 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_set } EOLIAN static Eina_Bool -_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd) +_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Fade_Manager_Data *pd) { return pd->animation; } -#include "efl_ui_spotlight_manager_stack.eo.c" +#include "efl_ui_spotlight_fade_manager.eo.c" diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo b/src/lib/elementary/efl_ui_spotlight_fade_manager.eo index 2275eb8ff0..2447d92471 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo +++ b/src/lib/elementary/efl_ui_spotlight_fade_manager.eo @@ -1,5 +1,6 @@ -class @beta Efl.Ui.Spotlight.Manager_Stack extends Efl.Ui.Spotlight.Manager +class @beta Efl.Ui.Spotlight.Fade_Manager extends Efl.Ui.Spotlight.Manager { + c_prefix: efl_ui_spotlight_manager_fade; implements { Efl.Ui.Spotlight.Manager.bind; Efl.Ui.Spotlight.Manager.content_add; diff --git a/src/lib/elementary/efl_ui_spotlight_indicator_icon.c b/src/lib/elementary/efl_ui_spotlight_icon_indicator.c index 4ac177580d..731a9a9429 100644 --- a/src/lib/elementary/efl_ui_spotlight_indicator_icon.c +++ b/src/lib/elementary/efl_ui_spotlight_icon_indicator.c @@ -13,7 +13,7 @@ typedef struct { Efl_Canvas_Layout *layout; double last_position; Eina_Size2D min, max; -} Efl_Ui_Spotlight_Indicator_Icon_Data; +} Efl_Ui_Spotlight_Icon_Indicator_Data; static void _flush_state(Eo *item, double val) @@ -24,7 +24,7 @@ _flush_state(Eo *item, double val) } static void -_add_item(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Indicator_Icon_Data *pd) +_add_item(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Icon_Indicator_Data *pd) { Efl_Canvas_Layout *item; @@ -40,7 +40,7 @@ _add_item(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Indicator_Icon_Data *pd) } static void -_flush_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Indicator_Icon_Data *pd) +_flush_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Icon_Indicator_Data *pd) { int next = -1, closer; double closer_val; @@ -91,7 +91,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(spotlight_resized, ) EOLIAN static void -_efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_bind(Eo *obj, Efl_Ui_Spotlight_Indicator_Icon_Data *pd, Efl_Ui_Spotlight_Container *spotlight) +_efl_ui_spotlight_icon_indicator_efl_ui_spotlight_indicator_bind(Eo *obj, Efl_Ui_Spotlight_Icon_Indicator_Data *pd, Efl_Ui_Spotlight_Container *spotlight) { if (spotlight) { @@ -122,7 +122,7 @@ _efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_bind(Eo *obj, Efl_Ui } EOLIAN static void -_efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_content_add(Eo *obj, Efl_Ui_Spotlight_Indicator_Icon_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index EINA_UNUSED) +_efl_ui_spotlight_icon_indicator_efl_ui_spotlight_indicator_content_add(Eo *obj, Efl_Ui_Spotlight_Icon_Indicator_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index EINA_UNUSED) { _add_item(obj, pd); _flush_position(obj, pd); @@ -130,29 +130,29 @@ _efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_content_add(Eo *obj, } EOLIAN static void -_efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_content_del(Eo *obj, Efl_Ui_Spotlight_Indicator_Icon_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index EINA_UNUSED) +_efl_ui_spotlight_icon_indicator_efl_ui_spotlight_indicator_content_del(Eo *obj, Efl_Ui_Spotlight_Icon_Indicator_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index EINA_UNUSED) { efl_del(efl_pack_content_get(pd->indicator, 0)); _flush_position(obj, pd); } EOLIAN static void -_efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_position_update(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Indicator_Icon_Data *pd, double position) +_efl_ui_spotlight_icon_indicator_efl_ui_spotlight_indicator_position_update(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Icon_Indicator_Data *pd, double position) { pd->last_position = position; _flush_position(obj, pd); } EOLIAN static void -_efl_ui_spotlight_indicator_icon_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Indicator_Icon_Data *pd) +_efl_ui_spotlight_icon_indicator_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Icon_Indicator_Data *pd) { if (pd->layout) efl_del(pd->layout); if (pd->indicator) efl_del(pd->indicator); - efl_destructor(efl_super(obj, EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS)); + efl_destructor(efl_super(obj, EFL_UI_SPOTLIGHT_ICON_INDICATOR_CLASS)); } -#include "efl_ui_spotlight_indicator_icon.eo.c" +#include "efl_ui_spotlight_icon_indicator.eo.c" diff --git a/src/lib/elementary/efl_ui_spotlight_indicator_icon.eo b/src/lib/elementary/efl_ui_spotlight_icon_indicator.eo index de1d689d74..63ef0554fd 100644 --- a/src/lib/elementary/efl_ui_spotlight_indicator_icon.eo +++ b/src/lib/elementary/efl_ui_spotlight_icon_indicator.eo @@ -1,4 +1,5 @@ -class @beta Efl.Ui.Spotlight.Indicator_Icon extends Efl.Ui.Spotlight.Indicator { +class @beta Efl.Ui.Spotlight.Icon_Indicator extends Efl.Ui.Spotlight.Indicator { + c_prefix: efl_ui_spotlight_indicator_icon; implements { Efl.Ui.Spotlight.Indicator.bind; Efl.Ui.Spotlight.Indicator.content_del; diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_plain_manager.c index 81c954e62f..d120ef8f11 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c +++ b/src/lib/elementary/efl_ui_spotlight_plain_manager.c @@ -4,7 +4,7 @@ #include <Efl_Ui.h> #include "elm_priv.h" -#include "efl_ui_spotlight_manager_plain.eo.h" +#include "efl_ui_spotlight_plain_manager.eo.h" typedef struct { Efl_Ui_Spotlight_Container * container; @@ -13,12 +13,12 @@ typedef struct { Efl_Gfx_Entity *clipper; Eina_Bool animation; double last_pos; -} Efl_Ui_Spotlight_Manager_Plain_Data; +} Efl_Ui_Spotlight_Plain_Manager_Data; -#define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS +#define MY_CLASS EFL_UI_SPOTLIGHT_PLAIN_MANAGER_CLASS static void -_emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +_emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Plain_Manager_Data *pd) { double absolut_position = efl_pack_index_get(pd->container, pd->current_content); if (pd->last_pos != absolut_position) @@ -28,7 +28,7 @@ _emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) } static void -_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Plain_Manager_Data *pd) { Efl_Gfx_Entity *entity = pd->current_content; Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->container); @@ -42,7 +42,7 @@ _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Ui_Spotlight_Container *spotlight) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, Efl_Ui_Spotlight_Container *spotlight) { if (spotlight) { @@ -74,7 +74,7 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp } static void -_content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +_content_changed(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd) { if (efl_ui_spotlight_active_element_get(pd->container) != pd->current_content) { @@ -88,7 +88,7 @@ _content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_add(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_content_add(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { efl_key_data_set(subobj, "_elm_leaveme", pd->container); efl_canvas_object_clipper_set(subobj, pd->clipper); @@ -98,7 +98,7 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_add(Eo *obj, Ef } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_del(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_content_del(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { efl_key_data_set(subobj, "_elm_leaveme", NULL); efl_canvas_object_clipper_set(subobj, NULL); @@ -108,7 +108,7 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_del(Eo *obj, Ef _content_changed(obj, pd); } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, int from EINA_UNUSED, int to) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, int from EINA_UNUSED, int to) { Efl_Gfx_Entity *to_obj, *from_obj; to_obj = efl_pack_content_get(pd->container, to); @@ -130,14 +130,14 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_ } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Eina_Size2D size) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, Eina_Size2D size) { pd->page_size = size; _geom_sync(obj, pd); } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd EINA_UNUSED) +_efl_ui_spotlight_plain_manager_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd EINA_UNUSED) { efl_destructor(efl_super(obj, MY_CLASS)); @@ -149,19 +149,19 @@ _efl_ui_spotlight_manager_plain_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_ } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Eina_Bool animation) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Plain_Manager_Data *pd, Eina_Bool animation) { pd->animation = animation; } EOLIAN static Eina_Bool -_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Plain_Manager_Data *pd) { return pd->animation; } EOLIAN static void -_efl_ui_spotlight_manager_plain_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +_efl_ui_spotlight_plain_manager_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd) { efl_del(pd->clipper); @@ -173,4 +173,4 @@ _efl_ui_spotlight_manager_plain_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_ efl_invalidate(efl_super(obj, MY_CLASS)); } -#include "efl_ui_spotlight_manager_plain.eo.c" +#include "efl_ui_spotlight_plain_manager.eo.c" diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo b/src/lib/elementary/efl_ui_spotlight_plain_manager.eo index 23bf0e443e..95464305ec 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo +++ b/src/lib/elementary/efl_ui_spotlight_plain_manager.eo @@ -1,5 +1,6 @@ -class @beta Efl.Ui.Spotlight.Manager_Plain extends Efl.Ui.Spotlight.Manager +class @beta Efl.Ui.Spotlight.Plain_Manager extends Efl.Ui.Spotlight.Manager { + c_prefix: efl_ui_spotlight_manager_plain; implements { Efl.Ui.Spotlight.Manager.bind; Efl.Ui.Spotlight.Manager.content_add; diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_scroll_manager.c index 267b64471b..bdb6840c06 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c +++ b/src/lib/elementary/efl_ui_spotlight_scroll_manager.c @@ -24,9 +24,9 @@ typedef struct { } mouse_move; Eina_Bool animation; Eina_Bool scroll_block; -} Efl_Ui_Spotlight_Manager_Scroll_Data; +} Efl_Ui_Spotlight_Scroll_Manager_Data; -#define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS +#define MY_CLASS EFL_UI_SPOTLIGHT_SCROLL_MANAGER_CLASS static void _page_set_animation(void *data, const Efl_Event *event); @@ -37,7 +37,7 @@ _propagate_progress(Eo *obj, double pos) } static void -_apply_box_properties(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd) +_apply_box_properties(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd) { Eina_Rect geometry = EINA_RECT_EMPTY(); Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->container); @@ -84,7 +84,7 @@ _mouse_down_cb(void *data, { Efl_Input_Pointer *ev = event->info; Eo *obj = data; - Efl_Ui_Spotlight_Manager_Scroll_Data *pd = efl_data_scope_get(obj, MY_CLASS); + Efl_Ui_Spotlight_Scroll_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS); if (efl_input_pointer_button_get(ev) != 1) return; if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return; @@ -110,7 +110,7 @@ _mouse_move_cb(void *data, { Efl_Input_Pointer *ev = event->info; Eo *obj = data; - Efl_Ui_Spotlight_Manager_Scroll_Data *pd = efl_data_scope_get(obj, MY_CLASS); + Efl_Ui_Spotlight_Scroll_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS); Eina_Position2D pos; int pos_y_diff; @@ -139,7 +139,7 @@ _mouse_up_cb(void *data, { Efl_Input_Pointer *ev = event->info; Eo *obj = data; - Efl_Ui_Spotlight_Manager_Scroll_Data *pd = efl_data_scope_get(obj, MY_CLASS); + Efl_Ui_Spotlight_Scroll_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS); if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return; if (!pd->mouse_move.active) return; @@ -159,7 +159,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(mouse_listeners, ); EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Efl_Ui_Spotlight_Container *spotlight) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Efl_Ui_Spotlight_Container *spotlight) { if (spotlight) { @@ -196,7 +196,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_S } EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { efl_key_data_set(subobj, "_elm_leaveme", pd->container); efl_gfx_entity_visible_set(subobj, EINA_TRUE); @@ -209,7 +209,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_add(Eo *obj EI EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { efl_key_data_set(subobj, "_elm_leaveme", NULL); efl_canvas_object_clipper_set(subobj, NULL); @@ -222,7 +222,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_del(Eo *obj EI static void _page_set_animation(void *data, const Efl_Event *event EINA_UNUSED) { - Efl_Ui_Spotlight_Manager_Scroll_Data *pd = efl_data_scope_get(data, MY_CLASS); + Efl_Ui_Spotlight_Scroll_Manager_Data *pd = efl_data_scope_get(data, MY_CLASS); double p = (ecore_loop_time_get() - pd->transition.start_time) / pd->transition.max_time; if (p >= 1.0) p = 1.0; @@ -241,7 +241,7 @@ _page_set_animation(void *data, const Efl_Event *event EINA_UNUSED) } static void -_animation_request_switch(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, int from, int to) +_animation_request_switch(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int from, int to) { //if there is already a transition ongoing, which is no mouse transition, but goes to the same position, then do nothing if (pd->transition.active && !pd->mouse_move.active && pd->transition.to == to) @@ -276,7 +276,7 @@ _animation_request_switch(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, int } EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, int from, int to) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int from, int to) { if (pd->animation) { @@ -292,7 +292,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl } EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Eina_Size2D size) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Eina_Size2D size) { pd->page_size = size; if (!pd->transition.active) @@ -300,7 +300,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_size_set(Eo *obj EINA_ } EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Eina_Bool animation) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Eina_Bool animation) { pd->animation = animation; if (pd->transition.active && !animation) @@ -312,14 +312,14 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_se } EOLIAN static Eina_Bool -_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd) +_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd) { return pd->animation; } EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd EINA_UNUSED) +_efl_ui_spotlight_scroll_manager_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd EINA_UNUSED) { efl_del(pd->event); efl_del(pd->backclip); @@ -334,7 +334,7 @@ _efl_ui_spotlight_manager_scroll_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight } EOLIAN static void -_efl_ui_spotlight_manager_scroll_scroll_block_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Eina_Bool scroll_block) +_efl_ui_spotlight_scroll_manager_scroll_block_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, Eina_Bool scroll_block) { if (pd->scroll_block == scroll_block) return; @@ -349,9 +349,9 @@ _efl_ui_spotlight_manager_scroll_scroll_block_set(Eo *obj EINA_UNUSED, Efl_Ui_Sp } EOLIAN static Eina_Bool -_efl_ui_spotlight_manager_scroll_scroll_block_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd) +_efl_ui_spotlight_scroll_manager_scroll_block_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Scroll_Manager_Data *pd) { return pd->scroll_block; } -#include "efl_ui_spotlight_manager_scroll.eo.c" +#include "efl_ui_spotlight_scroll_manager.eo.c" diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo b/src/lib/elementary/efl_ui_spotlight_scroll_manager.eo index c9a8e7ad34..b7101035cd 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo +++ b/src/lib/elementary/efl_ui_spotlight_scroll_manager.eo @@ -1,5 +1,6 @@ -class @beta Efl.Ui.Spotlight.Manager_Scroll extends Efl.Ui.Spotlight.Manager +class @beta Efl.Ui.Spotlight.Scroll_Manager extends Efl.Ui.Spotlight.Manager { + c_prefix: efl_ui_spotlight_manager_scroll; methods { @property scroll_block { [[User scrolling forbidden. diff --git a/src/lib/elementary/efl_ui_spotlight_util.c b/src/lib/elementary/efl_ui_spotlight_util.c index c49ebd4d8c..c7c68da4e0 100644 --- a/src/lib/elementary/efl_ui_spotlight_util.c +++ b/src/lib/elementary/efl_ui_spotlight_util.c @@ -12,7 +12,7 @@ typedef struct { EOLIAN static Efl_Ui_Spotlight_Container* _efl_ui_spotlight_util_stack_gen(Efl_Ui_Widget *parent) { - Efl_Ui_Spotlight_Manager *manager = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); + Efl_Ui_Spotlight_Manager *manager = efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS); return efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, parent, efl_ui_spotlight_manager_set(efl_added, manager)); } diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c index e1769b7603..7c9f72f95a 100644 --- a/src/lib/elementary/efl_ui_stack.c +++ b/src/lib/elementary/efl_ui_stack.c @@ -18,7 +18,7 @@ _efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *sd EINA_UNUSED) obj = efl_constructor(efl_super(obj, MY_CLASS)); - stack = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); + stack = efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS); efl_ui_spotlight_manager_set(obj, stack); return obj; diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c index 83ecb12c41..0976e81616 100644 --- a/src/lib/elementary/efl_ui_textbox.c +++ b/src/lib/elementary/efl_ui_textbox.c @@ -49,8 +49,6 @@ struct _Efl_Ui_Textbox_Data int append_text_len; /* Only for clipboard */ const char *text; - const char *file; - Elm_Text_Format format; Evas_Coord ent_w, ent_h; Evas_Coord downx, downy; Evas_Coord ox, oy; @@ -98,7 +96,6 @@ struct _Efl_Ui_Textbox_Data Eina_Bool deferred_decoration_anchor : 1; Eina_Bool context_menu_enabled : 1; Eina_Bool long_pressed : 1; - Eina_Bool auto_save : 1; Eina_Bool has_text : 1; Eina_Bool use_down : 1; Eina_Bool sel_mode : 1; @@ -213,126 +210,6 @@ static Eina_Position2D _decoration_calc_offset(Efl_Ui_Textbox_Data *sd); static void _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd); static void _efl_ui_textbox_selection_paste_type(Eo *obj, Efl_Ui_Selection_Type type); -static char * -_file_load(Eo *obj) -{ - Eina_File *f; - char *text = NULL; - void *tmp = NULL; - - f = eina_file_dup(efl_file_mmap_get(obj)); - - tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); - if (!tmp) goto on_error; - - text = malloc(eina_file_size_get(f) + 1); - if (!text) goto on_error; - - memcpy(text, tmp, eina_file_size_get(f)); - text[eina_file_size_get(f)] = 0; - - if (eina_file_map_faulted(f, tmp)) - { - ELM_SAFE_FREE(text, free); - } - - on_error: - if (tmp) eina_file_map_free(f, tmp); - eina_file_close(f); - - return text; -} - -static char * -_plain_load(Eo *obj) -{ - return _file_load(obj); -} - -static Eina_Error -_load_do(Evas_Object *obj) -{ - char *text; - Eina_Error err = 0; - - EFL_UI_TEXT_DATA_GET(obj, sd); - - if (!sd->file) - { - efl_text_set(obj, ""); - return 0; - } - - switch (sd->format) - { - /* Only available format */ - case ELM_TEXT_FORMAT_PLAIN_UTF8: - text = _plain_load(obj); - if (!text) - { - err = errno; - if (!err) err = ENOENT; - } - break; - - default: - text = NULL; - break; - } - - if (text) - { - efl_text_set(obj, text); - free(text); - return 0; - } - efl_text_set(obj, ""); - return err; -} - -static void -_text_save(const char *file, - const char *text) -{ - FILE *f; - - if (!text) - { - ecore_file_unlink(file); - return; - } - - f = fopen(file, "wb"); - if (!f) - { - ERR("Failed to open %s for writing", file); - return; - } - - if (fputs(text, f) == EOF) - ERR("Failed to write text to file %s", file); - fclose(f); -} - -static void -_save_do(Evas_Object *obj) -{ - EFL_UI_TEXT_DATA_GET(obj, sd); - - if (!sd->file) return; - switch (sd->format) - { - /* Only supported format */ - case ELM_TEXT_FORMAT_PLAIN_UTF8: - _text_save(sd->file, efl_text_get(obj)); - break; - - case ELM_TEXT_FORMAT_MARKUP_UTF8: - default: - break; - } -} - static void _efl_ui_textbox_guide_update(Evas_Object *obj, Eina_Bool has_text) @@ -1379,36 +1256,6 @@ _item_get(void *data, const char *item) return o; } -EOLIAN static void -_efl_ui_textbox_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, const char *emission, const char *source) -{ - /* always pass to both edje objs */ - efl_layout_signal_emit(sd->entry_edje, emission, source); - - // FIXME: This should not be here! - efl_layout_signal_process(sd->entry_edje, EINA_TRUE); -} - -static Eina_Bool -_efl_ui_textbox_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) -{ - Eina_Bool ok; - - ok = efl_layout_signal_callback_add(pd->entry_edje, emission, source, func_data, func, func_free_cb); - - return ok; -} - -static Eina_Bool -_efl_ui_textbox_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) -{ - Eina_Bool ok; - - ok = efl_layout_signal_callback_del(pd->entry_edje, emission, source, func_data, func, func_free_cb); - - return ok; -} - static void _selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler) { @@ -1838,7 +1685,6 @@ _efl_ui_textbox_efl_object_constructor(Eo *obj, Efl_Ui_Textbox_Data *sd) sd->entry_edje = wd->resize_obj; sd->cnp_mode = EFL_UI_SELECTION_FORMAT_TEXT; sd->context_menu_enabled = EINA_TRUE; - sd->auto_save = EINA_TRUE; efl_text_interactive_editable_set(obj, EINA_TRUE); efl_text_interactive_selection_allowed_set(obj, EINA_TRUE); sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE; @@ -1916,8 +1762,6 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd) { efl_event_freeze(obj); - eina_stringshare_del(sd->file); - _popup_dismiss(sd); if ((sd->api) && (sd->api->obj_unhook)) sd->api->obj_unhook(obj); // module - unhook @@ -2198,32 +2042,6 @@ _efl_ui_textbox_context_menu_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textb return sd->context_menu_enabled; } -EOLIAN static Eina_Error -_efl_ui_textbox_efl_file_file_set(Eo *obj, Efl_Ui_Textbox_Data *sd, const char *file) -{ - eina_stringshare_replace(&sd->file, file); - return efl_file_set(efl_super(obj, MY_CLASS), file); -} - -EOLIAN static void -_efl_ui_textbox_efl_file_unload(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED) -{ - efl_file_unload(efl_super(obj, MY_CLASS)); - efl_text_set(obj, ""); -} - -EOLIAN static Eina_Error -_efl_ui_textbox_efl_file_load(Eo *obj, Efl_Ui_Textbox_Data *sd) -{ - Eina_Error err; - - if (efl_file_loaded_get(obj)) return 0; - err = efl_file_load(efl_super(obj, MY_CLASS)); - if (err) return err; - if (sd->auto_save) _save_do(obj); - return _load_do(obj); -} - EOLIAN static void _efl_ui_textbox_cnp_mode_set(Eo *obj, Efl_Ui_Textbox_Data *sd, Efl_Ui_Selection_Format cnp_mode) { diff --git a/src/lib/elementary/efl_ui_textbox.eo b/src/lib/elementary/efl_ui_textbox.eo index e3c86e18ad..dc3c428f1b 100644 --- a/src/lib/elementary/efl_ui_textbox.eo +++ b/src/lib/elementary/efl_ui_textbox.eo @@ -1,5 +1,5 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, - Efl.Access.Text, Efl.Access.Editable.Text, Efl.File + Efl.Access.Text, Efl.Access.Editable.Text composites Efl.Text_Interactive, Efl.Text_Markup, Efl.Input_Text { @@ -90,9 +90,6 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click Efl.Gfx.Entity.size { set; } Efl.Canvas.Group.group_member_add; Efl.Canvas.Group.group_calculate; - Efl.Layout.Signal.signal_callback_add; - Efl.Layout.Signal.signal_callback_del; - Efl.Layout.Signal.signal_emit; Efl.Ui.Widget.on_access_activate; Efl.Ui.Widget.theme_apply; Efl.Ui.Focus.Object.on_focus_update; @@ -100,9 +97,6 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click Efl.Ui.Widget.disabled {set;} Efl.Text_Format.password {set;} Efl.Text_Format.multiline {set;} - //Efl.Ui.Widget.widget_sub_object_del; - //Elm.Interface_Scrollable.policy { set; } - //Elm.Interface_Scrollable.bounce_allow { set; } Efl.Access.Object.state_set { get; } Efl.Access.Object.i18n_name { get; } Efl.Access.Text.access_text { get; } @@ -127,9 +121,6 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click Efl.Access.Editable.Text.cut; Efl.Access.Editable.Text.delete; Efl.Access.Editable.Text.paste; - Efl.File.file { set; } - Efl.File.load; - Efl.File.unload; Efl.Text_Interactive.editable { set; } Efl.Part.part_get; } diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 826e2e0c91..ab1f11544b 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -2384,10 +2384,8 @@ _entry_selection_changed_signal_cb(void *data, if (!sd) return; sd->have_selection = EINA_TRUE; - Efl_Text_Range range = {0}; //FIXME how to get selection range in legacy !? - range.start = 0; - range.end = 0; + Eina_Range range = EINA_RANGE_EMPTY(); efl_event_callback_legacy_call (data, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, &range); // XXX: still try primary selection even if on wl in case it's diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 99aa22469a..d4a34da04f 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -147,10 +147,10 @@ pub_eo_files = [ 'efl_ui_focus_manager_window_root.eo', 'efl_ui_spotlight_container.eo', 'efl_ui_spotlight_manager.eo', - 'efl_ui_spotlight_manager_scroll.eo', - 'efl_ui_spotlight_manager_stack.eo', + 'efl_ui_spotlight_scroll_manager.eo', + 'efl_ui_spotlight_fade_manager.eo', 'efl_ui_spotlight_indicator.eo', - 'efl_ui_spotlight_indicator_icon.eo', + 'efl_ui_spotlight_icon_indicator.eo', 'efl_ui_spotlight_util.eo', 'efl_ui_tab_pager.eo', 'efl_ui_tab_bar.eo', @@ -242,7 +242,7 @@ priv_eo_files = [ 'efl_ui_homogeneous_model.eo', 'efl_ui_exact_model.eo', 'efl_ui_average_model.eo', - 'efl_ui_spotlight_manager_plain.eo', + 'efl_ui_spotlight_plain_manager.eo', 'efl_ui_collection_focus_manager.eo', ] @@ -916,11 +916,11 @@ elementary_src = [ 'elm_focus_legacy.c', 'efl_ui_spotlight_container.c', 'efl_ui_spotlight_manager.c', - 'efl_ui_spotlight_manager_plain.c', - 'efl_ui_spotlight_manager_scroll.c', - 'efl_ui_spotlight_manager_stack.c', + 'efl_ui_spotlight_plain_manager.c', + 'efl_ui_spotlight_scroll_manager.c', + 'efl_ui_spotlight_fade_manager.c', 'efl_ui_spotlight_indicator.c', - 'efl_ui_spotlight_indicator_icon.c', + 'efl_ui_spotlight_icon_indicator.c', 'efl_ui_spotlight_util.c', 'efl_ui_focus_graph.h', 'efl_ui_focus_graph.c', diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot index d4033e26aa..fcdf1ec572 100644 --- a/src/lib/eo/eina_types.eot +++ b/src/lib/eo/eina_types.eot @@ -43,21 +43,47 @@ struct @extern Eina.Vector2 { } struct @extern Eina.Matrix3 { - [[Eina 3x3 Matrix + [[A bidimensional array of floating point values with 3 rows and 3 columns. @since 1.22 ]] - xx: double; [[XX matrix value]] - xy: double; [[XY matrix value]] - xz: double; [[XZ matrix value]] + xx: double; [[XX value.]] + xy: double; [[XY value.]] + xz: double; [[XZ value.]] - yx: double; [[YX matrix value]] - yy: double; [[YY matrix value]] - yz: double; [[YZ matrix value]] + yx: double; [[YX value.]] + yy: double; [[YY value.]] + yz: double; [[YZ value.]] - zx: double; [[ZX matrix value]] - zy: double; [[ZY matrix value]] - zz: double; [[ZZ matrix value]] + zx: double; [[ZX value.]] + zy: double; [[ZY value.]] + zz: double; [[ZZ value.]] +} + +struct @extern Eina.Matrix4 { + [[A bidimensional array of floating point values with 4 rows and 4 columns. + + @since 1.24 + ]] + xx: double; [[XX value.]] + xy: double; [[XY value.]] + xz: double; [[XZ value.]] + xw: double; [[XW value.]] + + yx: double; [[YX value.]] + yy: double; [[YY value.]] + yz: double; [[YZ value.]] + yw: double; [[YW value.]] + + zx: double; [[ZX value.]] + zy: double; [[ZY value.]] + zz: double; [[ZZ value.]] + zw: double; [[ZW value.]] + + wx: double; [[WX value.]] + wy: double; [[WY value.]] + wz: double; [[WZ value.]] + ww: double; [[WW value.]] } struct @extern @beta Eina.Range { diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo b/src/lib/evas/canvas/efl_canvas_textblock.eo index 8e9bee7dba..2ecfd7bd8d 100644 --- a/src/lib/evas/canvas/efl_canvas_textblock.eo +++ b/src/lib/evas/canvas/efl_canvas_textblock.eo @@ -388,7 +388,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, } } // Obstacles - obstacle_add { + obstacle_add @beta { [[Add obstacle object $eo_obs to be avoided during layout of text. @@ -400,7 +400,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, } return: bool; [[$true on success.]] } - obstacle_del { + obstacle_del @beta { [[Removes $eo_obs from observation during text layout. ]] params { @@ -408,7 +408,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, } return: bool; [[$true on success.]] } - obstacles_update { + obstacles_update @beta { [[Triggers for relayout due to obstacles' state change. The obstacles alone don't affect the layout, until this is diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 4f44054152..c654822871 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -4717,8 +4717,11 @@ loop_advance: if (c->descent < 2) c->underline_extend = 2 - c->descent; } c->ln->line_no = c->line_no - c->ln->par->line_no; - c->line_no++; - c->y += c->ascent + c->descent; + if ( c->line_no == 0 || c->o->multiline) + { + c->line_no++; + c->y += c->ascent + c->descent; + } if (c->w >= 0) { /* c->o->style_pad.r is already included in the line width, so it's @@ -6390,7 +6393,8 @@ _layout_par(Ctxt *c) #endif it = _ITEM(eina_list_data_get(c->par->logical_items)); - _layout_line_new(c, it->format); + if (c->line_no == 0 || c->o->multiline) + _layout_line_new(c, it->format); /* We walk on our own because we want to be able to add items from * inside the list and then walk them on the next iteration. */ diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c index bab7376621..640fc65b4c 100644 --- a/src/lib/evas/common/evas_font_query.c +++ b/src/lib/evas/common/evas_font_query.c @@ -68,6 +68,7 @@ get_top_font: /* Find the longest run of the same font starting from the start position * and update cur_fi accordingly. */ + Eina_Unicode variation_sequence = 0; itr = text; while (itr < run_end) { @@ -85,7 +86,17 @@ get_top_font: if (evas_common_language_char_script_get(*itr) == EVAS_SCRIPT_INHERITED) continue; - Eina_Unicode variation_sequence = VAR_SEQ_SAFE(itr+1); + if (!variation_sequence) + { + variation_sequence = VAR_SEQ_SAFE(itr+1); + } + else + { + /* Variation sequence treated as single run, if we found one, we keep looking adding to same + * run, but if it is not, then we need to start a new one */ + if (variation_sequence != VAR_SEQ_SAFE(itr+1)) + break; + } /* Break if either it's not in the font, or if it is in the * script's font. */ diff --git a/src/lib/evas/meson.build b/src/lib/evas/meson.build index d2202389b6..94f81ae0a5 100644 --- a/src/lib/evas/meson.build +++ b/src/lib/evas/meson.build @@ -8,6 +8,7 @@ png = dependency('libpng') tiff = dependency('libtiff-4', required: get_option('evas-loaders-disabler').contains('tiff') == false) giflib = cc.find_library('gif') webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false) +libopenjp2 = dependency('libopenjp2', required: get_option('evas-loaders-disabler').contains('jp2k') == false) evas_image_loaders_file = [ ['bmp', 'shared', []], @@ -16,6 +17,7 @@ evas_image_loaders_file = [ ['gif', 'shared', [giflib]], ['ico', 'shared', []], ['jpeg', 'static', [jpeg]], + ['jp2k', 'shared', [libopenjp2]], ['pmaps', 'shared', []], ['png', 'static', [png]], ['psd', 'shared', []], diff --git a/src/tests/ecore_wl2/ecore_wl2_test_input.c b/src/tests/ecore_wl2/ecore_wl2_test_input.c index 2802ee6c00..2eb3aa6b38 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_input.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_input.c @@ -218,8 +218,8 @@ EFL_START_TEST(wl2_input_keyboard_repeat) ecore_wl2_input_keyboard_repeat_set(input, 2.0, 2.0); ecore_wl2_input_keyboard_repeat_get(input, &rate, &delay); - ck_assert_double_ne(rate, 2.0); - ck_assert_double_ne(delay, 2.0); + ck_assert(!EINA_DBL_EQ(rate, 2.0)); + ck_assert(!EINA_DBL_EQ(delay, 2.0)); } } diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c index f4e39ffdf0..e26acad108 100644 --- a/src/tests/elementary/efl_ui_test_spotlight.c +++ b/src/tests/elementary/efl_ui_test_spotlight.c @@ -645,7 +645,7 @@ EFL_START_TEST (efl_ui_spotlight_animated_transition) ck_assert_int_eq(efl_ui_spotlight_manager_animated_transition_get(efl_ui_spotlight_manager_get(container)), EINA_FALSE); //now check with a real spotlight manager - efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS)); + efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS)); efl_ui_spotlight_animated_transition_set(container, EINA_TRUE); ck_assert_int_eq(efl_ui_spotlight_animated_transition_get(container), EINA_TRUE); ck_assert_int_eq(efl_ui_spotlight_manager_animated_transition_get(efl_ui_spotlight_manager_get(container)), EINA_TRUE); @@ -654,7 +654,7 @@ EFL_START_TEST (efl_ui_spotlight_animated_transition) ck_assert_int_eq(efl_ui_spotlight_animated_transition_get(container), EINA_FALSE); ck_assert_int_eq(efl_ui_spotlight_manager_animated_transition_get(efl_ui_spotlight_manager_get(container)), EINA_FALSE); - Eo *manager2 = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); + Eo *manager2 = efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS); Eina_Bool animated_transition_manager; efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, win, efl_ui_spotlight_manager_set(efl_added, manager2), diff --git a/src/tests/elementary/efl_ui_test_text.c b/src/tests/elementary/efl_ui_test_text.c index a49c7e7cc9..b7886544f1 100644 --- a/src/tests/elementary/efl_ui_test_text.c +++ b/src/tests/elementary/efl_ui_test_text.c @@ -72,6 +72,45 @@ EFL_START_TEST(text_all_select_all_unselect) ecore_main_loop_iterate(); ck_assert_int_eq(i_have_selection, 2); ck_assert_int_eq(i_selection, 1); + + /*Partial select, the select all*/ + Eo *sel1, *sel2; + i_selection = 0; + efl_text_interactive_selection_cursors_get(txt, &sel1, &sel2); + efl_text_cursor_position_set(sel1, 1); + efl_text_cursor_position_set(sel2, 2); + ck_assert_int_eq(i_selection, 2); + efl_text_interactive_all_select(txt); + ck_assert_int_eq(i_selection, 3); + ck_assert_int_eq(efl_text_cursor_position_get(sel1), 0); + ck_assert_int_eq(efl_text_cursor_position_get(sel2), 5); + + Eo *cur1 = efl_ui_textbox_cursor_create(txt); + Eo *cur2 = efl_ui_textbox_cursor_create(txt); + efl_text_cursor_position_set(cur1, 1); + efl_text_cursor_position_set(cur2, 2); + efl_text_interactive_selection_cursors_set(txt, cur1, cur2); + ck_assert_int_eq(i_selection, 4); + efl_text_interactive_selection_cursors_get(txt, &sel1, &sel2); + ck_assert_int_eq(efl_text_cursor_position_get(sel1),1); + ck_assert_int_eq(efl_text_cursor_position_get(sel2),2); + + + /*Select part then select all*/ + efl_text_interactive_all_unselect(txt); + i_have_selection = 0, i_selection = 0; + efl_text_cursor_position_set(cur1, 1); + efl_text_cursor_position_set(cur2, 2); + efl_text_interactive_selection_cursors_set(txt, cur1, cur2); + ck_assert_int_eq(i_selection, 1); + ck_assert_int_eq(i_have_selection, 1); + efl_text_interactive_all_select(txt); + ck_assert_int_eq(i_selection, 2); + ck_assert_int_eq(i_have_selection, 1); + efl_text_interactive_all_unselect(txt); + ck_assert_int_eq(i_have_selection, 2); + + efl_del(txt); efl_del(win); } diff --git a/src/tests/eolian/data/complex_type.eo b/src/tests/eolian/data/complex_type.eo index 9cb6a1faf1..82613a1641 100644 --- a/src/tests/eolian/data/complex_type.eo +++ b/src/tests/eolian/data/complex_type.eo @@ -1,6 +1,6 @@ class Complex_Type { methods { - @property a { + @property a @beta { set { return: list<array<strbuf @move> > @move; } @@ -10,7 +10,7 @@ class Complex_Type { value: list<string> @move; } } - foo { + foo @beta { params { buf: mstring @move; sl: slice<ubyte>; diff --git a/src/tests/eolian/data/object_impl.eo b/src/tests/eolian/data/object_impl.eo index 7fe8ce2e24..aa708a8bd7 100644 --- a/src/tests/eolian/data/object_impl.eo +++ b/src/tests/eolian/data/object_impl.eo @@ -1,6 +1,6 @@ abstract Object_Impl extends Base { methods { - @property a { + @property a @beta { set { values { value: const(list<string>); @@ -23,7 +23,7 @@ abstract Object_Impl extends Base { /* set as virtual pure - no implementation expected */ } values { - value: list<string> @move; + value: iterator<string> @move; } } constructor_1 { diff --git a/src/tests/eolian/data/object_impl_add.eo b/src/tests/eolian/data/object_impl_add.eo index c1e82e2365..b8113a2f01 100644 --- a/src/tests/eolian/data/object_impl_add.eo +++ b/src/tests/eolian/data/object_impl_add.eo @@ -2,7 +2,7 @@ class Object_Impl_Add extends Base { data: Object_Impl_Data; methods { - @property c { + @property c @beta { set { } get { diff --git a/src/tests/eolian/data/object_impl_add_ref.c b/src/tests/eolian/data/object_impl_add_ref.c index f6b8fa5927..55f57578bb 100644 --- a/src/tests/eolian/data/object_impl_add_ref.c +++ b/src/tests/eolian/data/object_impl_add_ref.c @@ -20,7 +20,7 @@ _object_impl_a_get(const Eo *obj, Object_Impl_Data *pd, const char *part) } EOLIAN static void -_object_impl_b_set(Eo *obj, Object_Impl_Data *pd, Eina_List *value) +_object_impl_b_set(Eo *obj, Object_Impl_Data *pd, Eina_Iterator *value) { } diff --git a/src/tests/eolian/data/object_impl_ref.c b/src/tests/eolian/data/object_impl_ref.c index ddc0d7ccd5..32a331529f 100644 --- a/src/tests/eolian/data/object_impl_ref.c +++ b/src/tests/eolian/data/object_impl_ref.c @@ -20,7 +20,7 @@ _object_impl_a_get(const Eo *obj, Object_Impl_Data *pd, const char *part) } EOLIAN static void -_object_impl_b_set(Eo *obj, Object_Impl_Data *pd, Eina_List *value) +_object_impl_b_set(Eo *obj, Object_Impl_Data *pd, Eina_Iterator *value) { } diff --git a/src/tests/eolian/data/typedef.eo b/src/tests/eolian/data/typedef.eo index 916a39fcfc..cb97dd12ad 100644 --- a/src/tests/eolian/data/typedef.eo +++ b/src/tests/eolian/data/typedef.eo @@ -1,5 +1,5 @@ type Evas.Coord: int; /* Simple type definition */ -type List_Objects: list<Typedef>; /* A little more complex */ +type List_Objects: iterator<Typedef>; /* A little more complex */ type Evas.Coord2: Evas.Coord; type Evas.Coord3: Evas.Coord2; diff --git a/src/tests/eolian/data/typedef_ref.h b/src/tests/eolian/data/typedef_ref.h index dd3f3ad85e..2a3b888394 100644 --- a/src/tests/eolian/data/typedef_ref.h +++ b/src/tests/eolian/data/typedef_ref.h @@ -13,7 +13,7 @@ typedef Eo Typedef; typedef int Evas_Coord; -typedef Eina_List *List_Objects; +typedef Eina_Iterator *List_Objects; typedef Evas_Coord Evas_Coord2; diff --git a/src/tests/eolian/data/typedef_ref_stub.h b/src/tests/eolian/data/typedef_ref_stub.h index 0f6f4ec38b..1b18c46031 100644 --- a/src/tests/eolian/data/typedef_ref_stub.h +++ b/src/tests/eolian/data/typedef_ref_stub.h @@ -5,7 +5,7 @@ typedef Eo Typedef; typedef int Evas_Coord; -typedef Eina_List *List_Objects; +typedef Eina_Iterator *List_Objects; typedef Evas_Coord Evas_Coord2; diff --git a/src/tests/eolian/eolian_generation.c b/src/tests/eolian/eolian_generation.c index f60bb875bf..8e0babd39d 100644 --- a/src/tests/eolian/eolian_generation.c +++ b/src/tests/eolian/eolian_generation.c @@ -106,6 +106,7 @@ EFL_START_TEST(eolian_dev_impl_code) fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/object_impl.eo", "-gi", output_filepath)); fail_if(!_files_compare(TESTS_SRC_DIR"/data/object_impl_ref.c", output_filepath, "c")); fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/object_impl_add.eo", "-gi", output_filepath)); + fprintf(stderr, "[%s]\n", output_filepath); fail_if(!_files_compare(TESTS_SRC_DIR"/data/object_impl_add_ref.c", output_filepath, "c")); } EFL_END_TEST diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 9d137dcec3..b21af5a5c7 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -368,7 +368,7 @@ EFL_START_TEST(eolian_typedef) fail_if(strcmp(type_name, "List_Objects")); fail_if(!(type = eolian_typedecl_base_type_get(tdl))); fail_if(!(type_name = eolian_type_c_type_get(type))); - fail_if(strcmp(type_name, "Eina_List *")); + fail_if(strcmp(type_name, "Eina_Iterator *")); eina_stringshare_del(type_name); fail_if(!(type = eolian_type_base_type_get(type))); fail_if(!!eolian_type_next_type_get(type)); diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index a87391d83b..4ec79fb0af 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo @@ -3,47 +3,47 @@ class Complex extends Efl.Object data: Complex_Data; methods { // container test - inptrcont { + inptrcont @beta { params { l: list<string>; } } - inclasscont { + inclasscont @beta { params { l: list<Efl.Object>; } } - incontcont { + incontcont @beta { params { l: list<list<string>>; } } - incontcontown { + incontcontown @beta { params { l: list<list<string>> @move; } } - incontowncontown { + incontowncontown @beta { params { l: list<list<string> @move> @move; } } - incontowncont { + incontowncont @beta { params { l: list<list<string> @move>; } } - instringcont { + instringcont @beta { params { l: list<string>; } } - instringowncont { + instringowncont @beta { params { l: list<mstring @move>; } } - instringcontown { + instringcontown @beta { params { l: list<string> @move; } @@ -89,42 +89,42 @@ class Complex extends Efl.Object } } // out - outclasscont { + outclasscont @beta { params { @out l: list<Efl.Object>; } } - outcontcont { + outcontcont @beta { params { @out l: list<list<string>>; } } - outcontcontown { + outcontcontown @beta { params { @out l: list<list<string>> @move; } } - outcontowncontown { + outcontowncontown @beta { params { @out l: list<list<string> @move> @move; } } - outcontowncont { + outcontowncont @beta { params { @out l: list<list<string> @move>; } } - outstringcont { + outstringcont @beta { params { @out l: list<string>; } } - outstringowncont { + outstringowncont @beta { params { @out l: list<mstring @move>; } } - outstringcontown { + outstringcontown @beta { params { @out l: list<string> @move; } @@ -169,7 +169,7 @@ class Complex extends Efl.Object @out l: accessor<int> @move; } } - foo { + foo @beta { params { l: list<string>; } diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index c6e0381551..98020bf919 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc @@ -21,6 +21,7 @@ #include <map> +#define GENERIC_BETA #include <generic.eo.hh> #include <generic.eo.impl.hh> #include <name1_name2_type_generation.eo.hh> @@ -160,8 +161,8 @@ EFL_START_TEST(eolian_cxx_test_type_callback) efl::eo::eo_init i; bool event1 = false, event2 = false, event3 = false, event4 = false - , event5 = false; - + , event5 = false, event6 = false; + nonamespace::Generic g(efl::eo::instantiate); efl::eolian::event_add(g.prefix_event1_event, g, [&] (nonamespace::Generic) { @@ -183,22 +184,28 @@ EFL_START_TEST(eolian_cxx_test_type_callback) // FIXME eina::range_array is incompatible with eina::string_view //ck_assert(*e.begin() == efl::eina::string_view{"42"}); }); - efl::eolian::event_add(g.prefix_event5_event, g, [&] (nonamespace::Generic, Generic_Event) + efl::eolian::event_add(g.prefix_event5_event, g, [&] (nonamespace::Generic, Generic_Beta_Event) { event5 = true; }); + efl::eolian::event_add(g.prefix_event6_event, g, [&] (nonamespace::Generic, Generic_Event) + { + event6 = true; + }); g.call_event1(); g.call_event2(); g.call_event3(); g.call_event4(); g.call_event5(); + g.call_event6(); ck_assert(event1); ck_assert(event2); ck_assert(event3); ck_assert(event4); ck_assert(event5); + ck_assert(event6); } EFL_END_TEST diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index 0bbf894457..78b22e5519 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c @@ -125,10 +125,21 @@ static void _generic_call_event5(Eo *obj, Generic_Data* pd EINA_UNUSED) const char *s = "42"; Eina_List* p = eina_list_append(NULL, s); - Generic_Event e = {.field1 = 42, .field2 = p}; + Generic_Beta_Event e = {.field1 = 42, .field2 = p}; efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT5, &e); eina_list_free(p); } +static void _generic_call_event6(Eo *obj, Generic_Data* pd EINA_UNUSED) +{ + const char *s = "42"; + Eina_Array* p = eina_array_new(1); + + eina_array_push(p, s); + + Generic_Event e = {.field1 = 42, .field2 = p}; + efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT6, &e); + eina_array_free(p); +} static void _generic_protected_method1(Eo *obj EINA_UNUSED, Generic_Data* pd EINA_UNUSED) { } diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index cf7aa3b31e..327aafd9af 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo @@ -1,10 +1,16 @@ -struct Generic.Event +struct @beta Generic.Beta_Event { field1: int; field2: list<string>; } +struct Generic.Event +{ + field1: int; + field2: array<string>; +} + class Generic extends Efl.Object implements Generic_Interface { data: Generic_Data; @@ -87,6 +93,8 @@ class Generic extends Efl.Object implements Generic_Interface } call_event5 { } + call_event6 { + } protected_method1 @protected { } @@ -129,7 +137,8 @@ class Generic extends Efl.Object implements Generic_Interface prefix,event2: Generic; prefix,event3: int; prefix,event4: const(array<string>); - prefix,event5: Generic.Event; + prefix,event5 @beta: Generic.Beta_Event; + prefix,event6: Generic.Event; protected,event1 @protected: void; beta,event1 @beta: void; protected,beta,event1 @beta @protected: void; |