From 249f5338b1c944b1a914b7de9f0ddae33175225d Mon Sep 17 00:00:00 2001 From: YoungHun Cho Date: Fri, 16 Dec 2016 16:01:19 +0900 Subject: [PATCH] widget box Change-Id: I232b5a3f1d6a21bb3a00e5f76dff1463aad5f66c --- .cproject | 38 +++++++++++------------ Build/basedef.mk | 2 +- Build/build_edc.mk | 4 +-- Build/build_po.mk | 4 +-- Build/makefile | 3 +- Build/makefile.mk | 28 ++++++++--------- inc/cluster_data.h | 1 + inc/edc_conf.h | 2 ++ project_def.prop | 4 +-- res/edje/cluster_page.edc | 12 ++++--- res/edje/widget.edc | 6 ++++ res/edje/widget_box.edc | 26 ++++++++++++++++ src/widget_viewer.c | 79 +++++++++++++++++++++-------------------------- 13 files changed, 117 insertions(+), 92 deletions(-) create mode 100644 res/edje/widget_box.edc diff --git a/.cproject b/.cproject index ab7aa9b..2e3c45f 100755 --- a/.cproject +++ b/.cproject @@ -22,22 +22,16 @@ - + - + - + - + diff --git a/Build/basedef.mk b/Build/basedef.mk index a762983..64fbf82 100755 --- a/Build/basedef.mk +++ b/Build/basedef.mk @@ -22,7 +22,7 @@ PROJ_PATH ?= $(PROJPATH) #endif #ifeq ($(strip $(OUTPUT_DIR)),) -#OUTPUT_DIR ?= $(PROJ_PATH)/$(BUILD_CONFIG) +OUTPUT_DIR ?= $(PROJ_PATH)/$(BUILD_CONFIG) #endif #ifeq ($(strip $(BUILD_ARCH)),) diff --git a/Build/build_edc.mk b/Build/build_edc.mk index 2270b84..6f85fdd 100644 --- a/Build/build_edc.mk +++ b/Build/build_edc.mk @@ -1,12 +1,12 @@ # EDC build script -FUNC_EDC2EDJ = $(patsubst %.edc,%.edj,$(1)) +FUNC_EDC2EDJ = $(patsubst %.edc,$(2)/%.edj,$(1)) # parameter : # $(1) - C/C++ soruce file # $(2) - output path -CONVERT_ESC_EDC_TO_EDJ = $(2)/$(call CONVERT_4MAKE_TO_OUT,$(call FUNC_EDC2EDJ,$(1))) +CONVERT_ESC_EDC_TO_EDJ = $(call CONVERT_4MAKE_TO_OUT,$(call FUNC_EDC2EDJ,$(1),$(2))) # parameter : diff --git a/Build/build_po.mk b/Build/build_po.mk index 514116b..d88d71a 100644 --- a/Build/build_po.mk +++ b/Build/build_po.mk @@ -1,14 +1,14 @@ # PO build script -_FUNC_PO2MO = $(patsubst %.po,res/locale/%/LC_MESSAGES/$(2).mo,$(notdir $(1))) +_FUNC_PO2MO = $(patsubst %.po,$(2)/res/locale/%/LC_MESSAGES/$(3).mo,$(notdir $(1))) # parameter : # $(1) - C/C++ soruce file # $(2) - output path # $(3) - app name -CONVERT_ESC_PO_TO_MO = $(2)/$(call CONVERT_4MAKE_TO_OUT,$(call _FUNC_PO2MO,$(1),$(3))) +CONVERT_ESC_PO_TO_MO = $(call CONVERT_4MAKE_TO_OUT,$(call _FUNC_PO2MO,$(1),$(2),$(3))) # parameter : diff --git a/Build/makefile b/Build/makefile index 3c3f61e..9348c50 100755 --- a/Build/makefile +++ b/Build/makefile @@ -14,8 +14,7 @@ clean : app_clean version : build_version #PROJ_ROOT = . -PROJ_PATH ?= .# -BUILD_ROOT ?= $(PROJ_PATH)/Build# +BUILD_ROOT := $(PROJ_PATH)/Build# ifeq ($(MAKE_NAME),mingw32-make) ifneq ($(SHELL),) diff --git a/Build/makefile.mk b/Build/makefile.mk index fd5349d..c95b4b4 100644 --- a/Build/makefile.mk +++ b/Build/makefile.mk @@ -15,8 +15,8 @@ version : build_version #PROJ_ROOT := $(call BSLASH2SLASH,$(PROJ_PATH)) -PROJ_ROOT ?= .# -BUILD_ROOT ?= $(PROJ_ROOT)/Build +PROJ_ROOT := . +BUILD_ROOT := $(PROJ_ROOT)/Build include $(BUILD_ROOT)/basedef.mk @@ -32,11 +32,8 @@ include $(BUILD_ROOT)/funcs.mk APPTYPE := $(type) -OUTPUT_BASE ?= $(PROJ_ROOT) -#OUTPUT_DIR ?= $(OUTPUT_BASE)/$(BUILD_CONFIG)/$(BUILD_ARCH) -OUTPUT_DIR ?= $(OUTPUT_BASE)/$(BUILD_CONFIG) -OUTPUT_DIR := $(call BSLASH2SLASH,$(OUTPUT_DIR)) -OBJ_OUTPUT ?= $(OUTPUT_DIR)/objs +OUTPUT_DIR := $(PROJ_ROOT)/$(BUILD_CONFIG) +OBJ_OUTPUT := $(OUTPUT_DIR)/objs LOWER_APPNAME := $(call LOWER_CASE,$(APPNAME)) APPID2 := $(subst $(basename $(APPID)).,,$(APPID)) @@ -68,8 +65,8 @@ ifeq ($(strip $(APPTYPE)),sharedLib) EXT_OP := -fPIC endif -C_OPT := $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) $(USER_C_OPTS) -CPP_OPT := $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) $(USER_CPP_OPTS) +C_OPT := $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) +CPP_OPT := $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) C_OPT_FILE := $(PLATFORM_INCS_FILE) OBJS := # @@ -84,7 +81,7 @@ $(foreach ext,cpp cxx cc c++ C,$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_SRC # Individual C/C++ ifneq ($(strip $(USER_EXT_C_KEYS)),) $(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_INC_FILES),$(USER_EXT_$(var)_DEFS),$(USER_EXT_$(var)_UNDEFS),$(C_OPT),$(C_OPT_FILE),C,c,$(CC),OBJS))) -$(foreach ext,cpp cxx cc c++ C,$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_CPP_INC_FILES),$(USER_EXT_$(var)_CPP_DEFS),$(USER_EXT_$(var)_CPP_UNDEFS),$(CPP_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS)))) +$(foreach ext,cpp cxx cc c++ C,$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_CPP_INC_FILES),$(USER_EXT_$(var)_CPP_DEFS),$(USER_EXT_$(var)_CPP_UNDEFS),$(C_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS)))) endif @@ -112,7 +109,7 @@ $(APPFILE) : $(OBJS) $(UOBJS) @echo ' Building target: $@' @echo ' Invoking: C/C++ Linker' $(call MAKEDIRS,$(@D)) - $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -pie -lpthread --sysroot="$(SYSROOT)" -Xlinker --version-script="$(PROJ_ROOT)/.exportMap" $(RS_LIB_PATHS) $(RS_LIBRARIES) -Xlinker -rpath="/opt/usr/apps/$(APPID)/lib" -Werror-implicit-function-declaration $(USER_LINK_OPTS) + $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -pie -lpthread --sysroot="$(SYSROOT)" -Xlinker --version-script="$(PROJ_ROOT)/.exportMap" $(RS_LIB_PATHS) $(RS_LIBRARIES) -Xlinker -rpath="/opt/usr/apps/$(APPID)/lib" -Werror-implicit-function-declaration @echo ' Finished building target: $@' endif ifeq ($(strip $(APPTYPE)),staticLib) @@ -120,7 +117,7 @@ $(APPFILE) : $(OBJS) $(UOBJS) @echo ' Building target: $@' @echo ' Invoking: Archive utility' $(call MAKEDIRS,$(@D)) - $(AR) -r $(APPFILE) $(OBJS) $(UOBJS) $(AR_FLAGS) $(USER_LINK_OPTS) + $(AR) -r $(APPFILE) $(OBJS) $(UOBJS) $(AR_FLAGS) @echo ' Finished building target: $@' endif ifeq ($(strip $(APPTYPE)),sharedLib) @@ -128,7 +125,7 @@ $(APPFILE) : $(OBJS) $(UOBJS) @echo ' Building target: $@' @echo ' Invoking: C/C++ Linker' $(call MAKEDIRS,$(@D)) - $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -shared -lpthread --sysroot="$(SYSROOT)" $(RS_LIB_PATHS) $(RS_LIBRARIES) $(USER_LINK_OPTS) + $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -shared -lpthread --sysroot="$(SYSROOT)" $(RS_LIB_PATHS) $(RS_LIBRARIES) @echo ' Finished building target: $@' endif @@ -147,13 +144,14 @@ ifneq ($(findstring Windows,$(OS)),) ifneq ($(findstring 3.82,$(MAKE_VERSION)),) $(file > $@,$(PLATFORM_INCS)) else - @echo $(PLATFORM_INCS) > "$@" + @echo $(PLATFORM_INCS) > $@ endif else - @echo $(PLATFORM_INCS) > "$@" + @echo $(PLATFORM_INCS) > $@ endif endif + include $(BUILD_ROOT)/build_edc.mk #ifeq ($(strip $(ENVENTOR_SHARED_RES_PATH)),) diff --git a/inc/cluster_data.h b/inc/cluster_data.h index 29eb506..356e974 100755 --- a/inc/cluster_data.h +++ b/inc/cluster_data.h @@ -33,6 +33,7 @@ typedef struct { double period; int allow_duplicate; Evas_Object *widget_layout; + Evas_Object *widget_box; Evas_Object *widget_content; } widget_data_t; diff --git a/inc/edc_conf.h b/inc/edc_conf.h index f5ad1d8..b6a6e17 100755 --- a/inc/edc_conf.h +++ b/inc/edc_conf.h @@ -164,8 +164,10 @@ #define SIGNAL_APPS_FOLDER_CLICKED_PLUS_ICON "apps_folder_clicked_plus_icon" #define GROUP_WIDGET_LY "widget_ly" +#define GROUP_WIDGET_BOX_LY "widget_box_ly" #define WIDGET_CONTENT "widget_content" #define WIDGET_THUMBNAIL "widget_thumbnail" +#define WIDGET_BOX_CONTENT "widget_box_content" #define WIDGET_DELETE_BUTTON "widget_delete_button" #define SIGNAL_DELETE_BUTTON_SHOW_ANI "delete_button_show_ani" #define SIGNAL_DELETE_BUTTON_HIDE_ANI "delete_button_hide_ani" diff --git a/project_def.prop b/project_def.prop index b64d38e..a027382 100755 --- a/project_def.prop +++ b/project_def.prop @@ -18,7 +18,7 @@ USER_EDCS = USER_POS = res/po/ca.po res/po/fr.po res/po/nl.po res/po/pt_BR.po res/po/sk.po res/po/sv.po res/po/uz.po res/po/ko_KR.po res/po/is.po res/po/ka.po res/po/ro.po res/po/it_IT.po res/po/en_PH.po res/po/lt.po res/po/mk.po res/po/nb.po res/po/ru_RU.po res/po/el_GR.po res/po/zh_TW.po res/po/az.po res/po/hr.po res/po/uk.po res/po/zh_CN.po res/po/de.po res/po/es_US.po res/po/eu.po res/po/kk.po res/po/sl.po res/po/et.po res/po/fr_CA.po res/po/ga.po res/po/gl.po res/po/hy.po res/po/lv.po res/po/ja_JP.po res/po/es_ES.po res/po/bg.po res/po/cs.po res/po/pl.po res/po/pt_PT.po res/po/sr.po res/po/hu.po res/po/ar.po res/po/en_US.po res/po/fi.po res/po/da.po res/po/en.po res/po/zh_HK.po res/po/tr_TR.po # User Defines -USER_DEFS = TIZEN_DEPRECATION +USER_DEFS = USER_CPP_DEFS = # User Undefines @@ -52,7 +52,7 @@ USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts # EDC Flags USER_EXT_EDC_KEYS = EDC0 -USER_EXT_EDC0_EDCS = res/edje/cluster_allpage_thumbnail.edc res/edje/home_btn.edc res/edje/home.edc res/edje/widget.edc res/edje/add_widget_viewer.edc res/edje/apps_folder_icon.edc res/edje/apps_chooser_btn.edc res/edje/apps_folder_popup.edc res/edje/app_icon.edc res/edje/cluster_page.edc res/edje/apps_view.edc res/edje/page_indicator_unit.edc res/edje/apps_view_bg.edc res/edje/cluster_allpage.edc +USER_EXT_EDC0_EDCS = res/edje/cluster_allpage_thumbnail.edc res/edje/home_btn.edc res/edje/home.edc res/edje/widget.edc res/edje/add_widget_viewer.edc res/edje/apps_folder_icon.edc res/edje/apps_chooser_btn.edc res/edje/apps_folder_popup.edc res/edje/app_icon.edc res/edje/cluster_page.edc res/edje/apps_view.edc res/edje/page_indicator_unit.edc res/edje/apps_view_bg.edc res/edje/cluster_allpage.edc res/edje/widget_box.edc USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images res/images USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts diff --git a/res/edje/cluster_page.edc b/res/edje/cluster_page.edc index 1e531b0..5f1de33 100755 --- a/res/edje/cluster_page.edc +++ b/res/edje/cluster_page.edc @@ -39,8 +39,10 @@ collections { align: 0 0; visible: 0; color : 0 0 0 0; - rel1{relative: 0.01 0.06; to: SIZE_SETTER;} - rel2{relative: 0.99 0.675; to: SIZE_SETTER;} + rel1{relative: 0.0 0.06; to: SIZE_SETTER;} + rel2{relative: 1.0 1.0; to: SIZE_SETTER;} + aspect: 1.0 1.0; + aspect_preference: BOTH; } description { state: "edit" 0.0; @@ -48,14 +50,16 @@ collections { color : 0 0 0 50; visible: 1; rel1{relative: 0.057 0.066; to: SIZE_SETTER;} - rel2{relative: 0.943 0.621; to: SIZE_SETTER;} + rel2{relative: 0.943 1.0; to: SIZE_SETTER;} + aspect: 1.0 1.0; + aspect_preference: BOTH; } } part { name: CLUSTER_BOX; type: SWALLOW; description { state: "default" 0.0; - align: 0 0; + align: 0.5 0.5; rel1{relative: 0.0 0.0; to: CLUSTER_BG;} rel2{relative: 1.0 1.0; to: CLUSTER_BG;} } diff --git a/res/edje/widget.edc b/res/edje/widget.edc index 647bcbd..693d7ae 100755 --- a/res/edje/widget.edc +++ b/res/edje/widget.edc @@ -14,7 +14,9 @@ collections { repeat_events: 1; description { state: "default" 0.0; + align: 0.5 0.5; rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; } } part { name: WIDGET_THUMBNAIL; @@ -23,7 +25,9 @@ collections { repeat_events: 1; description { state: "default" 0.0; + align: 0.5 0.5; rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; } } part { name: SIZE_SETTER; @@ -37,6 +41,8 @@ collections { visible: 0; rel1.relative: 0.0 0.0; rel2.relative: 0.01 0.01; + aspect: 1.0 1.0; + aspect_preference: BOTH; } } part { name: "touch,block"; diff --git a/res/edje/widget_box.edc b/res/edje/widget_box.edc new file mode 100644 index 0000000..2b0bc8e --- /dev/null +++ b/res/edje/widget_box.edc @@ -0,0 +1,26 @@ +#include "../../inc/edc_conf.h" + +collections { + group { name: GROUP_WIDGET_BOX_LY; + parts { + part { name: SIZE_SETTER; + type: SWALLOW; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: WIDGET_BOX_CONTENT; + type: SWALLOW; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1{relative: 0.0 0.0; to: SIZE_SETTER;} + rel2{relative: 1.0 1.0; to: SIZE_SETTER;} + } + } + } + } +} \ No newline at end of file diff --git a/src/widget_viewer.c b/src/widget_viewer.c index de65195..40ced5e 100755 --- a/src/widget_viewer.c +++ b/src/widget_viewer.c @@ -21,16 +21,6 @@ #include "conf.h" #include "edc_conf.h" -//#define _TEST_ -#ifdef _TEST_ -static Eina_Bool __widget_viewer_test_timer_cb(void *data) -{ - Evas_Object *widget = (Evas_Object*) data; - evas_object_color_set(widget, rand()%255, rand()%255, rand()%255, 100); - return ECORE_CALLBACK_RENEW; -} -static int count = 0; -#endif static void __widget_viewer_delete_btn_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); static void __widget_viewer_created_cb(void *data, Evas_Object *obj, void *event_info); @@ -57,8 +47,6 @@ void widget_viewer_add_widget(Evas_Object *parent, widget_data_t *widget_data, i elm_layout_file_set(widget_layout, util_get_res_file_path(EDJE_DIR"/widget.edj"), GROUP_WIDGET_LY); evas_object_size_hint_weight_set(widget_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - widget_service_get_size(widget_data->type, widget_width, widget_height); - Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(widget_layout)); evas_object_size_hint_min_set(rect, CLUSTER_W / 4, CLUSTER_H / 4); evas_object_size_hint_align_set(rect, 0, 0); @@ -66,47 +54,52 @@ void widget_viewer_add_widget(Evas_Object *parent, widget_data_t *widget_data, i evas_object_show(rect); elm_object_part_content_set(widget_layout, SIZE_SETTER, rect); -#ifndef _TEST_ - int w, h; - Evas_Object *widget = widget_viewer_evas_add_widget(widget_layout, widget_data->pkg_name, widget_data->content_info, widget_data->period); - evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); + Evas_Object *widget_box = elm_box_add(widget_layout); + evas_object_size_hint_weight_set(widget_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_align_set(widget_box, 0.5, 0.5); + evas_object_show(widget_box); + + Evas_Object *widget_box_layout = elm_layout_add(widget_box); + elm_layout_file_set(widget_box_layout, util_get_res_file_path(EDJE_DIR"/widget_box.edj"), GROUP_WIDGET_BOX_LY); + evas_object_size_hint_weight_set(widget_box_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(widget_box_layout, 0.5, 0.5); + evas_object_show(widget_box_layout); + + Evas_Object *widget = widget_viewer_evas_add_widget(widget_box_layout, widget_data->pkg_name, widget_data->content_info, widget_data->period); evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(widget, 0.5, 0.5); //Notify widget_size_type_e to widget application. - widget_service_get_size(widget_data->type, &w, &h); - evas_object_resize(widget, w, h); + widget_service_get_size(widget_data->type, widget_width, widget_height); + evas_object_resize(widget, *widget_width, *widget_height); + + evas_object_size_hint_min_set(widget, *widget_width, *widget_height); + evas_object_show(widget); evas_object_smart_callback_add(widget, WIDGET_SMART_SIGNAL_WIDGET_CREATED, __widget_viewer_created_cb, widget_data); evas_object_smart_callback_add(widget, WIDGET_SMART_SIGNAL_WIDGET_FAULTED, __widget_viewer_faulted_cb, widget_data); evas_object_smart_callback_add(widget, WIDGET_SMART_SIGNAL_UPDATED, __widget_viewer_update_cb, widget_data); evas_object_smart_callback_add(widget, WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED, __widget_viewer_extra_info_updated_cb, widget_data); -#else // for TEST -/* Evas_Object *widget = evas_object_rectangle_add(evas_object_evas_get(widget_layout)); - evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_color_set(widget, 0, 0, 255, 100); - evas_object_show(widget); -*/ - char number[1000]; - snprintf(number, sizeof(number), "%s_%d", widget_data->pkg_name, count++); - Evas_Object *widget = elm_label_add(evas_object_evas_get(widget_layout)); - elm_object_style_set(widget, "popup/default"); - evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(widget, number); - evas_object_color_set(widget, 0, 0, 255, 100); - evas_object_show(widget); + Evas_Object *widget_size_setter = evas_object_rectangle_add(evas_object_evas_get(widget_box_layout)); + evas_object_size_hint_weight_set(widget_size_setter, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(widget_size_setter, 0.5, 0.5); + evas_object_color_set(widget_size_setter, 0, 0, 0, 0); + evas_object_resize(widget_size_setter, *widget_width, *widget_height); + evas_object_size_hint_min_set(widget_size_setter, *widget_width, *widget_height); + + elm_object_part_content_set(widget_box_layout, SIZE_SETTER, widget_size_setter); + elm_object_part_content_set(widget_box_layout, WIDGET_BOX_CONTENT, widget); - Ecore_Timer *timer = ecore_timer_add(1, __widget_viewer_test_timer_cb, widget); -#endif - elm_object_part_content_set(widget_layout, WIDGET_CONTENT, widget); + elm_box_pack_end(widget_box, widget_box_layout); + + elm_object_part_content_set(widget_layout, WIDGET_CONTENT, widget_box); elm_object_signal_callback_add(widget_layout, SIGNAL_DELETE_BUTTON_CLICKED, SIGNAL_SOURCE, __widget_viewer_delete_btn_clicked_cb, (void *)widget_data); - evas_object_show(widget); evas_object_show(widget_layout); widget_data->widget_content = widget; + widget_data->widget_box = widget_box; widget_data->widget_layout = widget_layout; } @@ -119,9 +112,7 @@ static void __widget_viewer_delete_btn_clicked_cb(void *data, Evas_Object *obj, void widget_viewer_send_cancel_click_event(widget_data_t *widget_data) { LOGD("Send to : %s", widget_data->pkg_name); - Evas_Object *widget_obj = NULL; - widget_obj = elm_object_part_content_get(widget_data->widget_layout, WIDGET_CONTENT); - widget_viewer_evas_cancel_click_event(widget_obj); + widget_viewer_evas_cancel_click_event(widget_data->widget_content); } void widget_viewer_thumbnail_add(widget_data_t *widget_data) @@ -134,7 +125,7 @@ void widget_viewer_thumbnail_add(widget_data_t *widget_data) return; } - if (!evas_object_image_source_set(image, widget_data->widget_content)) { + if (!evas_object_image_source_set(image, widget_data->widget_box)) { evas_object_del(image); LOGE("Could not set proxy image source"); return; @@ -153,13 +144,13 @@ void widget_viewer_thumbnail_add(widget_data_t *widget_data) void widget_viewer_thumbnail_delete(widget_data_t *widget_data) { - if (widget_data && widget_data->widget_layout && widget_data->widget_content) { + if (widget_data && widget_data->widget_layout && widget_data->widget_box) { Evas_Object *image = NULL; image = elm_object_part_content_get(widget_data->widget_layout, WIDGET_THUMBNAIL); evas_object_image_source_visible_set(image, EINA_TRUE); elm_object_part_content_unset(widget_data->widget_layout, WIDGET_THUMBNAIL); evas_object_del(image); - elm_object_part_content_set(widget_data->widget_layout, WIDGET_CONTENT, widget_data->widget_content); + elm_object_part_content_set(widget_data->widget_layout, WIDGET_CONTENT, widget_data->widget_box); } } -- 2.7.4