aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-07-13 10:28:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-14 15:22:54 +0900
commitacb1414d50dc18d7c926ccf0794fa4e8b6710420 (patch)
treeefd470b21f5898eb964f9501e659e67cdde3832e
parentevas generic loaders fix timeout on windows where no alarm exists (diff)
downloadefl-devs/jpeg/lambdapp.tar.gz
elm: try to use lambdapp for a filedevs/jpeg/lambdapp
It works, but not perfectly. GCC's CPP will remove all newlines whenever it encounters a function call. So, it can not be possible to apply a GDB breakpoint inside a lambda. Also, no line step by step is possible inside a lambda (instruction step & step in should work fine).
-rw-r--r--src/Makefile_Elementary.am22
-rw-r--r--src/lib/elementary/efl_ui_box.c15
2 files changed, 22 insertions, 15 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index c999455e32..4dcac91ceb 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -689,7 +689,6 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/els_cursor.c \
lib/elementary/els_tooltip.c \
lib/elementary/elu_ews_wm.c \
- lib/elementary/efl_ui_box.c \
lib/elementary/efl_ui_box_flow.c \
lib/elementary/efl_ui_box_layout.c \
lib/elementary/efl_ui_box_private.h \
@@ -701,12 +700,8 @@ lib_elementary_libelementary_la_SOURCES = \
lib_elementary_libelementary_la_CFLAGS = @ELEMENTARY_CFLAGS@
-lib_elementary_libelementary_la_LIBADD = \
-@ELEMENTARY_LIBS@ \
-@LTLIBINTL@
lib_elementary_libelementary_la_DEPENDENCIES = @ELEMENTARY_INTERNAL_LIBS@
lib_elementary_libelementary_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
-
lib_elementary_libelementary_la_CPPFLAGS = \
-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
-DMODULES_PATH=\"$(pkglibdir)/modules\" \
@@ -726,6 +721,23 @@ lib_elementary_libelementary_la_CPPFLAGS = \
-DELEMENTARY_BUILD \
@ELEMENTARY_CFLAGS@
+# FIXME: I have no idea how to create a helper here
+LAMBDAPP_CFLAGS = $(lib_elementary_libelementary_la_CFLAGS)
+LAMBDAPP_CPPFLAGS = $(lib_elementary_libelementary_la_CPPFLAGS)
+
+%.lambdapp.lo: %.c
+ @echo " LAMBDACC" $@;
+ @$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -E $(CPPFLAGS) $(LAMBDAPP_CPPFLAGS) '$<' -o $(@:.lambdapp.lo=.tmp.i)
+ @lambda-pp -x $(@:.lambdapp.lo=.tmp.i) | $(LTCOMPILE) -x cpp-output -c -o $@ -MT $@ $(LAMBDAPP_CFLAGS) $(LAMBDAPP_CPPFLAGS) -
+
+elm_lambdapp_files = lib/elementary/efl_ui_box.c
+elm_lambdapp_ltobjects = $(elm_lambdapp_files:%.c=%.lambdapp.lo)
+EXTRA_lib_elementary_libelementary_la_DEPENDENCIES = $(elm_lambdapp_ltobjects) $(elm_lambdapp_files)
+
+lib_elementary_libelementary_la_LIBADD = $(elm_lambdapp_ltobjects) \
+@ELEMENTARY_LIBS@ \
+@LTLIBINTL@
+
if HAVE_WINDOWS
lib_elementary_libelementary_la_CPPFLAGS += \
-I$(top_srcdir)/src/lib/evil \
diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c
index 98b4daa6c3..ab0c99398b 100644
--- a/src/lib/elementary/efl_ui_box.c
+++ b/src/lib/elementary/efl_ui_box.c
@@ -24,15 +24,6 @@ _efl_ui_box_list_data_get(const Eina_List *list)
}
static void
-_child_added_cb_proxy(void *data, const Eo_Event *event)
-{
- Evas_Object *box = data;
- Evas_Object_Box_Option *opt = event->info;
-
- eo_event_callback_call(box, EFL_CONTAINER_EVENT_CONTENT_ADDED, opt->obj);
-}
-
-static void
_child_removed_cb_proxy(void *data, const Eo_Event *event)
{
Evas_Object *box = data;
@@ -211,7 +202,11 @@ _efl_ui_box_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED
efl_canvas_group_add(eo_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- eo_event_callback_add(wd->resize_obj, EVAS_BOX_EVENT_CHILD_ADDED, _child_added_cb_proxy, obj);
+#define EO_EV_LAMBDA lambda void(void *data EINA_UNUSED, const Eo_Event *ev EINA_UNUSED)
+
+ eo_event_callback_add(wd->resize_obj, EVAS_BOX_EVENT_CHILD_ADDED, EO_EV_LAMBDA {
+ eo_event_callback_call(data, EFL_CONTAINER_EVENT_CONTENT_ADDED, ((Evas_Object_Box_Option *) ev->info)->obj);
+ } , obj);
eo_event_callback_add(wd->resize_obj, EVAS_BOX_EVENT_CHILD_REMOVED, _child_removed_cb_proxy, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);