[EGIT] [legacy/imlib2] master 01/02: Fix build without HAVE_X11_SHM_FD (T6752)
kwo pushed a commit to branch master. http://git.enlightenment.org/legacy/imlib2.git/commit/?id=8038d9c618f78d61db5b5f19a7aba9366090dd16 commit 8038d9c618f78d61db5b5f19a7aba9366090dd16 Author: Kim WoeldersDate: Wed Mar 7 19:42:11 2018 +0100 Fix build without HAVE_X11_SHM_FD (T6752) --- src/lib/ximage.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/ximage.c b/src/lib/ximage.c index b0a6635..df2917f 100644 --- a/src/lib/ximage.c +++ b/src/lib/ximage.c @@ -77,13 +77,18 @@ ShmCheck(Display * d) if (s) { val = atoi(s); +#ifdef HAVE_X11_SHM_FD if (val == 0) x_does_shm = x_does_shm_fd = 0; /* Disable SHM entirely */ else if (val == 1) x_does_shm_fd = 0; /* Disable SHM-FD */ - printf("%s: x_does_shm=%d x_does_shm_fd=%d\n", __func__, x_does_shm, x_does_shm_fd); +#else +if (val == 0) + x_does_shm = 0; /* Disable SHM entirely */ +printf("%s: x_does_shm=%d\n", __func__, x_does_shm); +#endif } /* Set ximage cache list_max_count */ --
[EGIT] [core/efl] master 02/05: eo: introduce invalidate and noref state.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=83251edae77f9ae0c52edeb06512fbf0e2c39c8a commit 83251edae77f9ae0c52edeb06512fbf0e2c39c8a Author: Cedric BailDate: Wed Mar 7 10:56:53 2018 -0800 eo: introduce invalidate and noref state. This is just a first step. All user of destructor should be updated to move the code that rely on their efl_parent and on efl_provider_find to invalidate. Then we will be able to change the way efl_add and efl_del work to properly refcount things. efl_noref won't be triggered at the moment until both efl_parent_set(obj, NULL) and the last user ref are set to NULL. This is not what we want, but due to how user refcount is accounting parent at the moment, until all the code is move to rely on invalidate we can not fix this. --- src/lib/eo/efl_object.eo | 20 +++- src/lib/eo/eo.c| 1 + src/lib/eo/eo_base_class.c | 23 ++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index f41b6ee3eb..206d135524 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -130,6 +130,14 @@ abstract Efl.Object () finalized: bool; [[$true if the object is finalized, $false otherwise]] } } + @property invalidated { + [[True if the object is already invalidated, otherwise false.]] + get { + } + values { +finalized: bool; [[$true if the object is invalidated, $false otherwise]] + } + } provider_find @const { [[Searches upwards in the object tree for a provider which knows the given class/interface. @@ -155,13 +163,23 @@ abstract Efl.Object () destructor { [[Call the object's destructor. - Should not be used with #eo_do. Only use it with #eo_do_super. + Should not be used with #efl_do. Only use it with #efl_do_super. + Will be triggered once #invalidate and #noref have been triggered. ]] } finalize { [[Called at the end of efl_add. Should not be called, just overridden.]] return: Efl.Object; [[The new object created, can be NULL if aborting]] } + invalidate { + [[Called when parent reference is lost/set to $NULL and switch the state of the object to invalidate.]] + } + noref { + [[Triggered when no reference are keeping the object alive. + + The parent can be the last one keeping an object alive and so $noref can happen before $invalidate + as it is only impacted by the ref/unref of the object.]] + } name_find @const { [[Find a child object with the given name and return it. diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 8052fd714f..f2626acca5 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -1887,6 +1887,7 @@ efl_unref(const Eo *obj_id) EO_OBJ_DONE(obj_id); return; } +efl_noref((Eo *) obj_id); _efl_unref(obj); } EO_OBJ_DONE(obj_id); diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index f1eff91f3e..fe6da95b72 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -60,6 +60,7 @@ typedef struct Eina_Bool parent_sunk : 1; // If parent ref has already been settled (parent has been set, or we are in add_ref mode Eina_Bool allow_parent_unref : 1; // Allows unref to zero even with a parent Eina_Bool has_destroyed_event_cb : 1; // No proper count: minor optimization triggered at destruction only + Eina_Bool invalidate : 1; // Object become invalide once it loose its parent } Efl_Object_Data; typedef enum @@ -620,6 +621,9 @@ _efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id) ((parent_id) && (!_eo_id_domain_compatible(parent_id, obj return; + // Invalidated object can not be bring back to life + if (pd->invalidate) return ; + EO_OBJ_POINTER(obj, eo_obj); if (pd->parent) { @@ -660,6 +664,7 @@ _efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id) else { pd->parent = NULL; +if (prev_parent) efl_invalidate(obj); if (prev_parent && !eo_obj->del_triggered) efl_unref(obj); } @@ -694,6 +699,12 @@ _efl_object_finalized_get(Eo *obj_id, Efl_Object_Data *pd EINA_UNUSED) return finalized; } +EOLIAN static Eina_Bool +_efl_object_invalidated_get(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd) +{ + return pd->invalidate; +} + EOLIAN static Efl_Object * _efl_object_provider_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const Efl_Object *klass) { @@ -701,7 +712,6 @@ _efl_object_provider_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const return NULL;
[EGIT] [core/efl] master 05/05: eo: fix warning.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fae4ad5fbb0fe756ca951f1a2632ff87a225ce62 commit fae4ad5fbb0fe756ca951f1a2632ff87a225ce62 Author: Cedric BailDate: Wed Mar 7 11:01:25 2018 -0800 eo: fix warning. --- src/tests/eo/suite/eo_test_general.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index 46b54dc62b..c6bf035369 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -178,10 +178,10 @@ _eo_signals_efl_del_cb(void *_data EINA_UNUSED, const Efl_Event *event EINA_UNUS _eo_signals_cb_flag |= 0x4; } -static check_is_deled = 0; +static int check_is_deled = 0; void -_eo_signals_cb_added_deled(void *data, const Efl_Event *event) +_eo_signals_cb_added_deled(void *data EINA_UNUSED, const Efl_Event *event) { const Efl_Callback_Array_Item_Full *callback_array = event->info; --
[EGIT] [core/efl] master 03/05: ecore: rely on Efl.Object.invalidate instead of a hack for Efl.Model.Container.Item.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=83233a976d7bf41ee7c81b96d1094611eafb7bd1 commit 83233a976d7bf41ee7c81b96d1094611eafb7bd1 Author: Cedric BailDate: Wed Mar 7 10:59:20 2018 -0800 ecore: rely on Efl.Object.invalidate instead of a hack for Efl.Model.Container.Item. --- src/lib/ecore/efl_model_container.c | 6 +- src/lib/ecore/efl_model_container_item.c | 4 +++- src/lib/ecore/efl_model_container_item.eo | 5 + 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lib/ecore/efl_model_container.c b/src/lib/ecore/efl_model_container.c index 71bb9f192b..d734ea2c66 100644 --- a/src/lib/ecore/efl_model_container.c +++ b/src/lib/ecore/efl_model_container.c @@ -90,11 +90,7 @@ _efl_model_container_efl_object_destructor(Eo *obj, Efl_Model_Container_Data *sd EINA_LIST_FREE(sd->children, child) { -if (child) - { - efl_model_container_item_invalidate(child); - efl_parent_set(child, NULL); - } +if (child) efl_parent_set(child, NULL); } eina_array_free(sd->defined_properties); diff --git a/src/lib/ecore/efl_model_container_item.c b/src/lib/ecore/efl_model_container_item.c index cb95c2f4db..99d4d7d4c3 100644 --- a/src/lib/ecore/efl_model_container_item.c +++ b/src/lib/ecore/efl_model_container_item.c @@ -23,8 +23,10 @@ _efl_model_container_item_define(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_D } EOLIAN static void -_efl_model_container_item_invalidate(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd) +_efl_model_container_item_efl_object_invalidate(Eo *obj, Efl_Model_Container_Item_Data *sd) { + efl_invalidate(efl_super(obj, MY_CLASS)); + sd->parent_data = NULL; sd->index = 0; } diff --git a/src/lib/ecore/efl_model_container_item.eo b/src/lib/ecore/efl_model_container_item.eo index 2b881a3f82..c959494096 100644 --- a/src/lib/ecore/efl_model_container_item.eo +++ b/src/lib/ecore/efl_model_container_item.eo @@ -19,10 +19,6 @@ class Efl.Model.Container.Item (Efl.Object, Efl.Model) children.]] } } - invalidate { - [[Invalidates the object preventing it from using the given parent - data.]] - } } implements { Efl.Model.properties { get; } @@ -32,6 +28,7 @@ class Efl.Model.Container.Item (Efl.Object, Efl.Model) Efl.Model.child_del; Efl.Model.children_slice_get; Efl.Model.children_count_get; + Efl.Object.invalidate; } constructors { .define; --
[EGIT] [core/efl] master 01/05: ecore_wl2: cleanup input code to string logic to reduce compiler warning and useless memory access.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=012bcff80cbf0a89a708c5544d9defd81057b927 commit 012bcff80cbf0a89a708c5544d9defd81057b927 Author: Cedric BailDate: Wed Mar 7 10:51:46 2018 -0800 ecore_wl2: cleanup input code to string logic to reduce compiler warning and useless memory access. --- src/lib/ecore_wl2/ecore_wl2_input.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 3c8c3d4183..3082c5af05 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -624,22 +624,18 @@ static void _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_keysym_t sym, xkb_keysym_t sym_name, unsigned int code, unsigned int state, unsigned int timestamp) { Ecore_Event_Key *ev; - char key[256], keyname[256], compose[256]; + char key[256] = "", keyname[256] = "", compose[256] = ""; int name_len, key_len, comp_len; - memset(key, 0, sizeof(key)); - memset(keyname, 0, sizeof(keyname)); - memset(compose, 0, sizeof(compose)); - /*try to get a name or utf char of the given symbol */ _ecore_wl2_input_symbol_rep_find(sym, key, sizeof(key), code); _ecore_wl2_input_symbol_rep_find(sym_name, keyname, sizeof(keyname), code); _ecore_wl2_input_key_translate(sym, input->keyboard.modifiers, compose, sizeof(compose)); - name_len = (keyname) ? strlen(keyname) : 0; - key_len = (key) ? strlen(key) : 0; - comp_len = (compose) ? strlen(compose) : 0; + name_len = strlen(keyname); + key_len = strlen(key); + comp_len = strlen(compose); ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + comp_len + 3); if (!ev) return; --
[EGIT] [core/efl] master 04/05: eo: adjust test suite to take invalidate state into account.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=21c80b027eb637d77f7a3e2dc7a6cf1e1fbde60f commit 21c80b027eb637d77f7a3e2dc7a6cf1e1fbde60f Author: Cedric BailDate: Wed Mar 7 11:00:06 2018 -0800 eo: adjust test suite to take invalidate state into account. --- src/tests/eo/suite/eo_test_general.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index a1e054c6ab..46b54dc62b 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -652,10 +652,8 @@ START_TEST(efl_refs) ck_assert_int_eq(efl_ref_count(obj2), 1); ck_assert_int_eq(efl_ref_count(obj3), 1); - efl_parent_set(obj2, obj); - efl_parent_set(obj3, obj); - ck_assert_int_eq(efl_ref_count(obj2), 2); - ck_assert_int_eq(efl_ref_count(obj3), 2); + fail_if(!efl_invalidated_get(obj2)); + fail_if(!efl_invalidated_get(obj3)); efl_del(obj); efl_del(obj2); @@ -679,10 +677,8 @@ START_TEST(efl_refs) ck_assert_int_eq(efl_ref_count(obj2), 1); ck_assert_int_eq(efl_ref_count(obj3), 1); - efl_parent_set(obj2, obj); - efl_parent_set(obj3, obj); - ck_assert_int_eq(efl_ref_count(obj2), 2); - ck_assert_int_eq(efl_ref_count(obj3), 2); + fail_if(!efl_invalidated_get(obj2)); + fail_if(!efl_invalidated_get(obj3)); efl_del(obj); efl_del(obj2); --
[EGIT] [legacy/imlib2] master 01/01: BMP loader: Fix infinite loop with invalid bmp images (T6749)
kwo pushed a commit to branch master. http://git.enlightenment.org/legacy/imlib2.git/commit/?id=51a48ecfe97e32cc5797a3bee03a85ab5cb11207 commit 51a48ecfe97e32cc5797a3bee03a85ab5cb11207 Author: Kim WoeldersDate: Wed Mar 7 19:35:30 2018 +0100 BMP loader: Fix infinite loop with invalid bmp images (T6749) https://phab.enlightenment.org/T6749 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773968 --- src/modules/loaders/loader_bmp.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/modules/loaders/loader_bmp.c b/src/modules/loaders/loader_bmp.c index 2d15ba5..3fcc17e 100644 --- a/src/modules/loaders/loader_bmp.c +++ b/src/modules/loaders/loader_bmp.c @@ -235,6 +235,17 @@ load(ImlibImage * im, ImlibProgressFunction progress, ReadleLong(f, ); ReadleLong(f, ); ReadleLong(f, ); +if (bitcount == 16) + { + rmask &= 0xU; + gmask &= 0xU; + bmask &= 0xU; + } +if (rmask == 0 || gmask == 0 || bmask == 0) + { + fclose(f); + return 0; + } for (bit = bitcount - 1; bit >= 0; bit--) { if (bmask & (1 << bit)) --
[EGIT] [core/efl] master 01/02: gl_drm: Move the gl symbol check to immediately after display init
derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f8658d25fa604f885ee23b20e94a2892d340bceb commit f8658d25fa604f885ee23b20e94a2892d340bceb Author: Derek ForemanDate: Wed Mar 7 13:11:45 2018 -0600 gl_drm: Move the gl symbol check to immediately after display init We don't actually need a context first, just an initialized display. --- src/modules/evas/engines/gl_drm/evas_outbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index aff5de87bf..b1235355cc 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -226,6 +226,8 @@ _evas_outbuf_egl_setup(Outbuf *ob) return EINA_FALSE; } + eng_gl_symbols(ob->egl.disp); + if (!eglGetConfigs(ob->egl.disp, NULL, 0, ) || (ncfg == 0)) { ERR("eglGetConfigs() fail. code=%#x", eglGetError()); @@ -334,8 +336,6 @@ _evas_outbuf_egl_setup(Outbuf *ob) goto err; } - eng_gl_symbols(ob->egl.disp); - ob->gl_context = glsym_evas_gl_common_context_new(); if (!ob->gl_context) goto err; --
[EGIT] [core/efl] master 02/02: gl_drm: use EGL_IMG_context_priority if available
derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=329e9c0b4beb2a1f29e9e75bd516f3faccef3abc commit 329e9c0b4beb2a1f29e9e75bd516f3faccef3abc Author: Derek ForemanDate: Wed Mar 7 15:08:46 2018 -0600 gl_drm: use EGL_IMG_context_priority if available This is a hint that we want a high priority context. Since gl_drm is likely a compositor or a full screen app, it makes sense that it try to use this (but other engines probably shouldn't) Based loosely on Chris Wilson's weston patch to do the same thing. (weston commit b678befb6ed055e6c66466505d9195a3cebf8073) As this extension appears to have been around for years, I haven't added fallback defines for: EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 --- src/modules/evas/engines/gl_drm/evas_engine.c | 4 src/modules/evas/engines/gl_drm/evas_engine.h | 1 + src/modules/evas/engines/gl_drm/evas_outbuf.c | 16 +++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index 9bfd562a37..2dd6bb1fb4 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -29,6 +29,7 @@ struct scanout_handle /* external variables */ int _evas_engine_gl_drm_log_dom = -1; int _extn_have_buffer_age = 1; +int _extn_have_context_priority = 0; /* local variables */ static Eina_Bool initted = EINA_FALSE; @@ -236,6 +237,9 @@ eng_gl_symbols(EGLDisplay edsp) FINDSYM(glsym_eglQueryWaylandBufferWL, "eglQueryWaylandBufferWL", glsym_func_uint); + if (strstr(exts, "EGL_IMG_context_priority")) + _extn_have_context_priority = 1; + done = EINA_TRUE; } diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h b/src/modules/evas/engines/gl_drm/evas_engine.h index 3d3acf3de6..8b1f68035b 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.h +++ b/src/modules/evas/engines/gl_drm/evas_engine.h @@ -28,6 +28,7 @@ extern int _evas_engine_gl_drm_log_dom; extern int _extn_have_buffer_age; +extern int _extn_have_context_priority; # ifdef ERR # undef ERR diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index b1235355cc..3dae82a617 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -161,9 +161,9 @@ _evas_outbuf_init(void) static Eina_Bool _evas_outbuf_egl_setup(Outbuf *ob) { - int ctx_attr[3]; + int ctx_attr[5]; int cfg_attr[40]; - int maj = 0, min = 0, n = 0, i = 0; + int maj = 0, min = 0, n = 0, i = 0, cn = 0; EGLint ncfg = 0; EGLConfig *cfgs; const GLubyte *vendor, *renderer, *version, *glslversion; @@ -176,9 +176,15 @@ _evas_outbuf_egl_setup(Outbuf *ob) } /* setup gbm egl surface */ - ctx_attr[0] = EGL_CONTEXT_CLIENT_VERSION; - ctx_attr[1] = 2; - ctx_attr[2] = EGL_NONE; + ctx_attr[cn++] = EGL_CONTEXT_CLIENT_VERSION; + ctx_attr[cn++] = 2; + + if (_extn_have_context_priority) + { +ctx_attr[cn++] = EGL_CONTEXT_PRIORITY_LEVEL_IMG; +ctx_attr[cn++] = EGL_CONTEXT_PRIORITY_HIGH_IMG; + } + ctx_attr[cn++] = EGL_NONE; cfg_attr[n++] = EGL_RENDERABLE_TYPE; cfg_attr[n++] = EGL_OPENGL_ES2_BIT; --
[EGIT] [core/efl] master 01/01: elementary: fix backward compatibility bug introduced by 9c8749b99a03d3601321da6d16071dd7b631d1ae.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6b1b3d25d6e7c9a004859853117900997f45ba50 commit 6b1b3d25d6e7c9a004859853117900997f45ba50 Author: Cedric BailDate: Wed Mar 7 09:34:49 2018 -0800 elementary: fix backward compatibility bug introduced by 9c8749b99a03d3601321da6d16071dd7b631d1ae. --- src/lib/elementary/elm_main.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index 82efe0a3c7..5d8993295b 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -390,13 +390,16 @@ _sys_lang_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA return ECORE_CALLBACK_PASS_ON; } +// This is necessary to keep backward compatibility +static const char *bcargv[] = { "exe" }; + EAPI int elm_init(int argc, char **argv) { _elm_init_count++; if (_elm_init_count > 1) return _elm_init_count; - elm_quicklaunch_init(argc, argv); - elm_quicklaunch_sub_init(argc, argv); + elm_quicklaunch_init(argc, argv ? argv : (char**) bcargv); + elm_quicklaunch_sub_init(argc, argv ? argv : (char**) bcargv); _prefix_shutdown(); --
[EGIT] [core/efl] master 01/01: efl_ui_focus_manager_calc: performe refocus after the node is deleted
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=253680f754f1165ff8b6397d378ecba4af8acc50 commit 253680f754f1165ff8b6397d378ecba4af8acc50 Author: Marcel HollerbachDate: Fri Mar 2 13:13:24 2018 +0100 efl_ui_focus_manager_calc: performe refocus after the node is deleted if node is the last element, the element will be focused again, and later deleted, without cleaning up the history --- src/lib/elementary/efl_ui_focus_manager_calc.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index 773c25f521..f818c39600 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -79,6 +79,9 @@ typedef struct { Node *root; } Efl_Ui_Focus_Manager_Calc_Data; + +static Node* _request_subchild(Node *node); + static void _manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) { @@ -1001,15 +1004,6 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_ if (pd->redirect_entry == node->focusable) pd->redirect_entry = NULL; - if (refocus) - { -Node *n = eina_list_last_data_get(pd->focus_stack); -if (!n) - n = pd->root; - -efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE); - } - //add all neighbors of the node to the dirty list for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++) { @@ -1026,6 +1020,16 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_ pd->dirty = eina_list_remove(pd->dirty, node); eina_hash_del_by_key(pd->node_hash, ); + + if (refocus) + { +Node *n = eina_list_last_data_get(pd->focus_stack); +if (!n) + n = pd->root; + +if (_request_subchild(n)) + efl_ui_focus_manager_focus_set(obj, n->focusable); + } } EOLIAN static void --
[EGIT] [core/efl] master 01/01: examples: cxx: fix the compilation for slider example.
ami pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=558947bf81b4c6df723ac603841e0e3951e06e3e commit 558947bf81b4c6df723ac603841e0e3951e06e3e Author: Amitesh SinghDate: Wed Mar 7 19:25:19 2018 +0900 examples: cxx: fix the compilation for slider example. --- src/examples/elementary/slider_cxx_example.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index 959fe256f0..3a63e158c6 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc @@ -57,7 +57,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Slider sl5(instantiate, win); sl5.indicator().format_string_set("%1.0f rabbit(s)"); sl5.range_min_max_set(0, 100); - sl5.step_set(1); + sl5.range_step_set(1); sl5.direction_set(EFL_UI_DIR_UP); sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); sl5.hint_min_set({0, 120}); --
[EGIT] [core/efl] master 01/01: ecore-wl2: Reduce calls to strlen
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a1bb9b313f008f65b06319a1bede1f175c29d3da commit a1bb9b313f008f65b06319a1bede1f175c29d3da Author: Chris MichaelDate: Wed Mar 7 09:37:25 2018 -0500 ecore-wl2: Reduce calls to strlen Small patch to reduce calls to strlen when sending key events. This patch is loosely based on Phab D5567 @fix Signed-off-by: Chris Michael --- src/lib/ecore_wl2/ecore_wl2_input.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 26d205de04..c252593350 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -625,6 +625,7 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_ { Ecore_Event_Key *ev; char key[256], keyname[256], compose[256]; + int name_len, key_len, comp_len; memset(key, 0, sizeof(key)); memset(keyname, 0, sizeof(keyname)); @@ -636,18 +637,22 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_ _ecore_wl2_input_key_translate(sym, input->keyboard.modifiers, compose, sizeof(compose)); - ev = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) + - ((compose[0] != '\0') ? strlen(compose) : 0) + 3); + name_len = strlen(keyname); + key_len = strlen(key); + comp_len = strlen(compose); + + ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + + ((compose[0] != '\0') ? comp_len : 0) + 3); if (!ev) return; ev->keyname = (char *)(ev + 1); - ev->key = ev->keyname + strlen(keyname) + 1; - ev->compose = strlen(compose) ? ev->key + strlen(key) + 1 : NULL; + ev->key = ev->keyname + name_len + 1; + ev->compose = comp_len ? ev->key + key_len + 1 : NULL; ev->string = ev->compose; strcpy((char *)ev->keyname, keyname); strcpy((char *)ev->key, key); - if (strlen(compose)) strcpy((char *)ev->compose, compose); + if (comp_len) strcpy((char *)ev->compose, compose); ev->window = window->id; ev->event_window = window->id; --
[EGIT] [core/efl] master 01/03: eolian: remove old class retrieval APIs
q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=434b0a399d09b7a6a6c72d744c2b5fd32fab6e22 commit 434b0a399d09b7a6a6c72d744c2b5fd32fab6e22 Author: Daniel KolesaDate: Wed Mar 7 13:08:49 2018 +0100 eolian: remove old class retrieval APIs --- src/bin/eolian/docs.c | 4 +-- src/bin/eolian/main.c | 18 ++--- src/bin/eolian/types.c | 4 +-- src/bin/eolian/types.h | 2 +- src/lib/eolian/Eolian.h| 9 --- src/lib/eolian/database_validate.c | 4 +-- src/lib/eolian/eolian_database.c | 23 ++-- src/tests/eolian/eolian_parsing.c | 54 +++--- 8 files changed, 45 insertions(+), 73 deletions(-) diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c index 09e63bf9ac..173fce910a 100644 --- a/src/bin/eolian/docs.c +++ b/src/bin/eolian/docs.c @@ -68,7 +68,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf, return; } - const Eolian_Class *cl = eolian_class_get_by_name(src, bname); + const Eolian_Class *cl = eolian_unit_class_by_name_get(src, bname); const Eolian_Function *fn = NULL; /* match methods and properties; we're only figuring out existence */ Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; @@ -84,7 +84,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf, while ((mname != refn) && (*mname != '.')) --mname; if (mname == refn) goto noref; bname = eina_stringshare_add_length(refn, mname - refn); - cl = eolian_class_get_by_name(src, bname); + cl = eolian_unit_class_by_name_get(src, bname); eina_stringshare_del(bname); } if (cl) diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c index 7369d9e885..3bc76458df 100644 --- a/src/bin/eolian/main.c +++ b/src/bin/eolian/main.c @@ -328,7 +328,7 @@ _write_header(const Eolian_State *eos, const Eolian_Unit *src, const char *ofnam buf, EINA_TRUE, legacy); buf = _include_guard(ifname, "TYPES", buf); - Eina_Strbuf *cltd = eo_gen_class_typedef_gen(src, ifname); + Eina_Strbuf *cltd = eo_gen_class_typedef_gen(eos, ifname); if (cltd) { cltd = _include_guard(ifname, "CLASS_TYPE", cltd); @@ -337,7 +337,7 @@ _write_header(const Eolian_State *eos, const Eolian_Unit *src, const char *ofnam eina_strbuf_free(cltd); } - const Eolian_Class *cl = eolian_class_get_by_file(src, ifname); + const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname); eo_gen_header_gen(src, cl, buf, legacy); if (cl || !legacy) { @@ -363,7 +363,7 @@ _write_stub_header(const Eolian_State *eos, const Eolian_Unit *src, const char * eo_gen_types_header_gen(src, eolian_declarations_get_by_file(eos, ifname), buf, EINA_FALSE, EINA_FALSE); - Eina_Strbuf *cltd = eo_gen_class_typedef_gen(src, ifname); + Eina_Strbuf *cltd = eo_gen_class_typedef_gen(eos, ifname); if (cltd) { eina_strbuf_prepend_char(buf, '\n'); @@ -379,13 +379,13 @@ _write_stub_header(const Eolian_State *eos, const Eolian_Unit *src, const char * } static Eina_Bool -_write_source(const Eolian_State *eos, const Eolian_Unit *src, const char *ofname, +_write_source(const Eolian_State *eos, const char *ofname, const char *ifname, Eina_Bool eot) { INF("generating source: %s", ofname); Eina_Strbuf *buf = eina_strbuf_new(); - const Eolian_Class *cl = eolian_class_get_by_file(src, ifname); + const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname); eo_gen_types_source_gen(eolian_declarations_get_by_file(eos, ifname), buf); eo_gen_source_gen(cl, buf); if (cl || (eot && eina_strbuf_length_get(buf))) @@ -402,11 +402,11 @@ _write_source(const Eolian_State *eos, const Eolian_Unit *src, const char *ofnam } static Eina_Bool -_write_impl(const Eolian_Unit *src, const char *ofname, const char *ifname) +_write_impl(const Eolian_State *eos, const char *ofname, const char *ifname) { INF("generating impl: %s", ofname); - const Eolian_Class *cl = eolian_class_get_by_file(src, ifname); + const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname); if (!cl) return EINA_FALSE; @@ -573,9 +573,9 @@ main(int argc, char **argv) if (succ && (gen_what & GEN_H_STUB)) succ = _write_stub_header(eos, src, outs[_get_bit_pos(GEN_H_STUB)], eobn); if (succ && (gen_what & GEN_C)) - succ = _write_source(eos, src, outs[_get_bit_pos(GEN_C)], eobn, !strcmp(ext, ".eot")); + succ = _write_source(eos, outs[_get_bit_pos(GEN_C)], eobn, !strcmp(ext, ".eot")); if (succ && (gen_what & GEN_C_IMPL)) - succ = _write_impl(src, outs[_get_bit_pos(GEN_C_IMPL)], eobn); + succ = _write_impl(eos, outs[_get_bit_pos(GEN_C_IMPL)], eobn);
[EGIT] [core/efl] master 02/03: eolian: remove old variable retrieval APIs
q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f596a97da66befa9fe893da062482821e35f7c5d commit f596a97da66befa9fe893da062482821e35f7c5d Author: Daniel KolesaDate: Wed Mar 7 13:25:28 2018 +0100 eolian: remove old variable retrieval APIs --- src/bindings/luajit/eolian.lua| 92 +++ src/lib/eolian/Eolian.h | 18 src/lib/eolian/database_expr.c| 2 +- src/lib/eolian/eolian_database.c | 39 - src/tests/eolian/eolian_parsing.c | 14 +++--- 5 files changed, 62 insertions(+), 103 deletions(-) diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 6faa91c8ba..759e3aee2a 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -471,12 +471,6 @@ ffi.cdef [[ Eolian_Unary_Operator eolian_expression_unary_operator_get(const Eolian_Expression *expr); const Eolian_Expression *eolian_expression_unary_expression_get(const Eolian_Expression *expr); Eolian_Value_t eolian_expression_value_get(const Eolian_Expression *expr); -const Eolian_Variable *eolian_variable_global_get_by_name(const Eolian_Unit *unit, const char *name); -const Eolian_Variable *eolian_variable_constant_get_by_name(const Eolian_Unit *unit, const char *name); -Eina_Iterator *eolian_variable_globals_get_by_file(const Eolian_Unit *unit, const char *fname); -Eina_Iterator *eolian_variable_constants_get_by_file(const Eolian_Unit *unit, const char *fname); -Eina_Iterator *eolian_variable_all_constants_get(const Eolian_Unit *unit); -Eina_Iterator *eolian_variable_all_globals_get(const Eolian_Unit *unit); Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var); const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var); const char *eolian_variable_file_get(const Eolian_Variable *var); @@ -623,6 +617,38 @@ ffi.metatype("Eolian_State", { classes_get = function(self) return Ptr_Iterator("const Eolian_Class*", eolian.eolian_state_classes_get(self)) +end, + +global_by_name_get = function(unit, name) +local v = eolian.eolian_state_global_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +constant_by_name_get = function(unit, name) +local v = eolian.eolian_state_constant_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +globals_by_file_get = function(unit, fname) +return Ptr_Iterator("const Eolian_Variable*", +eolian.eolian_state_globals_by_file_get(self, fname)) +end, + +constants_by_file_get = function(unit, fname) +return Ptr_Iterator("const Eolian_Variable*", +eolian.eolian_state_constants_by_file_get(self, fname)) +end, + +constants_get = function(self) +return Ptr_Iterator("const Eolian_Variable *", +eolian.eolian_state_constants_get(self)) +end, + +globals_get = function(self) +return Ptr_Iterator("const Eolian_Variable *", +eolian.eolian_state_globals_get(self)) end }, __gc = function(self) @@ -652,6 +678,28 @@ ffi.metatype("Eolian_Unit", { classes_get = function(self) return Ptr_Iterator("const Eolian_Class*", eolian.eolian_unit_classes_get(self)) +end, + +global_by_name_get = function(unit, name) +local v = eolian.eolian_unit_global_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +constant_by_name_get = function(unit, name) +local v = eolian.eolian_unit_constant_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +constants_get = function(self) +return Ptr_Iterator("const Eolian_Variable *", +eolian.eolian_unit_constants_get(self)) +end, + +globals_get = function(self) +return Ptr_Iterator("const Eolian_Variable *", +eolian.eolian_unit_globals_get(self)) end } }) @@ -1604,38 +1652,6 @@ M.Expression = ffi.metatype("Eolian_Expression", { } }) -M.variable_global_get_by_name = function(unit, name) -local v = eolian.eolian_variable_global_get_by_name(unit, name) -if v == nil then return nil end -return v -end - -M.variable_constant_get_by_name = function(unit, name) -local v = eolian.eolian_variable_constant_get_by_name(unit, name) -if v == nil then return nil end -return v -end - -M.variable_globals_get_by_file = function(unit, fname) -return Ptr_Iterator("const Eolian_Variable*", -eolian.eolian_variable_globals_get_by_file(unit,
[EGIT] [core/efl] master 03/03: eolian: get rid of old APIs for typedecl retrieval
q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=482c5d1ba237225720f02c358166291cbe9349ea commit 482c5d1ba237225720f02c358166291cbe9349ea Author: Daniel KolesaDate: Wed Mar 7 13:53:08 2018 +0100 eolian: get rid of old APIs for typedecl retrieval --- src/bin/eolian/docs.c| 4 +- src/bindings/luajit/eolian.lua | 138 ++- src/lib/eolian/Eolian.h | 27 -- src/lib/eolian/database_expr.c | 4 +- src/lib/eolian/eolian_database.c | 61 +- src/scripts/elua/apps/docgen/doctree.lua | 45 -- src/tests/eolian/eolian_parsing.c| 66 +++ 7 files changed, 135 insertions(+), 210 deletions(-) diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c index 173fce910a..acb56089a9 100644 --- a/src/bin/eolian/docs.c +++ b/src/bin/eolian/docs.c @@ -39,7 +39,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf, Eina_Stringshare *bname = eina_stringshare_add_length(refn, sfx - refn); - const Eolian_Typedecl *tp = eolian_typedecl_struct_get_by_name(src, bname); + const Eolian_Typedecl *tp = eolian_unit_struct_by_name_get(src, bname); if (tp) { if (!eolian_typedecl_struct_field_get(tp, sfx + 1)) @@ -53,7 +53,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, Eina_Strbuf *wbuf, return; } - tp = eolian_typedecl_enum_get_by_name(src, bname); + tp = eolian_unit_enum_by_name_get(src, bname); if (tp) { const Eolian_Enum_Type_Field *efl = eolian_typedecl_enum_field_get(tp, sfx + 1); diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 759e3aee2a..39293125d2 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -399,15 +399,6 @@ ffi.cdef [[ Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass); Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass); const char *eolian_class_c_get_function_name_get(const Eolian_Class *klass); -const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name); -const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name); -const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name); -Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname); -Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname); -Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname); -Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit); -Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit); -Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit); Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp); Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp); Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp); @@ -649,6 +640,54 @@ ffi.metatype("Eolian_State", { globals_get = function(self) return Ptr_Iterator("const Eolian_Variable *", eolian.eolian_state_globals_get(self)) +end, + +alias_by_name_get = function(self, name) +local v = eolian.eolian_state_alias_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +struct_by_name_get = function(self, name) +local v = eolian.eolian_state_struct_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +enum_by_name_get = function(self, name) +local v = eolian.eolian_state_enum_by_name_get(self, name) +if v == nil then return nil end +return v +end, + +aliases_by_file_get = function(self, fname) +return Ptr_Iterator("const Eolian_Typedecl *", +eolian.eolian_state_aliases_by_file_get(self, fname)) +end, + +structs_by_file_get = function(self, fname) +return Ptr_Iterator("const Eolian_Typedecl *", +eolian.eolian_state_structs_by_file_get(self, fname)) +end, + +enums_by_file_get = function(self, fname) +return Ptr_Iterator("const Eolian_Typedecl *", +eolian.eolian_state_enums_by_file_get(self, fname)) +end, + +aliases_get = function(self) +return Ptr_Iterator("const Eolian_Typedecl *", +eolian.eolian_state_aliases_get(self)) +end, + +structs_get = function(self) +return Ptr_Iterator("const Eolian_Typedecl *", +
[EGIT] [core/efl] master 01/01: ecore-wl2: Check for valid string before passing to strlen()
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=59a689faa47b681e5b7005715dc02c5957bb60cc commit 59a689faa47b681e5b7005715dc02c5957bb60cc Author: Chris MichaelDate: Wed Mar 7 09:50:58 2018 -0500 ecore-wl2: Check for valid string before passing to strlen() As strlen() cannot accept NULL (segfaults), we should check for valid key, keyname, and compose strings here before passing to strlen(). @fix Signed-off-by: Chris Michael --- src/lib/ecore_wl2/ecore_wl2_input.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index c252593350..3c8c3d4183 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -637,12 +637,11 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_ _ecore_wl2_input_key_translate(sym, input->keyboard.modifiers, compose, sizeof(compose)); - name_len = strlen(keyname); - key_len = strlen(key); - comp_len = strlen(compose); + name_len = (keyname) ? strlen(keyname) : 0; + key_len = (key) ? strlen(key) : 0; + comp_len = (compose) ? strlen(compose) : 0; - ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + - ((compose[0] != '\0') ? comp_len : 0) + 3); + ev = calloc(1, sizeof(Ecore_Event_Key) + key_len + name_len + comp_len + 3); if (!ev) return; ev->keyname = (char *)(ev + 1); --