elm: try to use lambdapp for a file

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).
This commit is contained in:
Jean-Philippe Andre 2016-07-13 10:28:43 +09:00
parent e8c396a6e2
commit acb1414d50
2 changed files with 22 additions and 15 deletions

View File

@ -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 \

View File

@ -23,15 +23,6 @@ _efl_ui_box_list_data_get(const Eina_List *list)
return opt->obj;
}
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)
{
@ -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);