forked from enlightenment/efl
Merge branch 'master' into devs/hermet/lottie
This commit is contained in:
commit
e8459a8e4b
9
README
9
README
|
@ -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
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dsystemd=false -Dv4l2=false -Deeze=false -Devas-loaders-disabler=json \
|
||||
$@ . build
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dfb=true -Ddrm=true -Dwl=true -Devas-loaders-disabler=json \
|
||||
-Dsystemd=false -Delogind=true \
|
||||
$@ . build
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dfb=true -Dsystemd=false -Devas-loaders-disabler=json \
|
||||
$@ . build
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dfb=true -Devas-loaders-disabler=json \
|
||||
$@ . build
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dfb=true -Ddrm=true -Dwl=true -Devas-loaders-disabler=json \
|
||||
$@ . build
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python3
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import subprocess
|
||||
import json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python3
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
from ete3 import Tree, TreeStyle, AttrFace, faces, NodeStyle
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.]]
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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.]]
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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_cursor_changed(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||
{
|
||||
// Eo *obj = data;
|
||||
_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_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
|
||||
_sel_cursor_changed(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||
{
|
||||
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, 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
|
||||
|
@ -1873,6 +1958,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)
|
||||
{
|
||||
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
|
@ -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;
|
|
@ -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"
|
|
@ -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;
|
|
@ -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"
|
|
@ -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;
|
|
@ -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"
|
|
@ -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.
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. */
|
||||
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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', []],
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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>;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -2,7 +2,7 @@ class Object_Impl_Add extends Base {
|
|||
data: Object_Impl_Data;
|
||||
|
||||
methods {
|
||||
@property c {
|
||||
@property c @beta {
|
||||
set {
|
||||
}
|
||||
get {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
|
||||
struct @beta Generic.Beta_Event
|
||||
{
|
||||
field1: int;
|
||||
field2: list<string>;
|
||||
}
|
||||
|
||||
struct Generic.Event
|
||||
{
|
||||
field1: int;
|
||||
field2: list<string>;
|
||||
field2: array<string>;
|
||||
}
|
||||
|
||||
class Generic extends Efl.Object implements Generic_Interface
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue