From 4ecb929c2a923e06e7b451b62def84b280b8280c Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Wed, 20 May 2015 20:15:06 +0900 Subject: [PATCH] Update SDK Viewer. Change-Id: If1e613374e67306d88c3df98cbebe3e70cedf087 --- widget_viewer_sdk/data/widget_viewer_sdk.edc | 12 +++++------ widget_viewer_sdk/src/main.c | 22 +++++++++++++++++--- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/widget_viewer_sdk/data/widget_viewer_sdk.edc b/widget_viewer_sdk/data/widget_viewer_sdk.edc index 2d6327a8..57bbe873 100644 --- a/widget_viewer_sdk/data/widget_viewer_sdk.edc +++ b/widget_viewer_sdk/data/widget_viewer_sdk.edc @@ -57,7 +57,7 @@ collections { part { name: "widget,info"; type: RECT; - mouse_events: 1; + mouse_events: 0; description { state: "default" 0.0; rel1 { relative: 0.0 0.0; } @@ -233,19 +233,17 @@ collections { part { name: "message"; mouse_events: 0; - type: TEXT; + type: TEXTBLOCK; description { state: "default" 0.0; - rel1 { relative: 0.5 0.5; } - rel2 { relative: 0.5 0.5; } - fixed: 1 1; + rel1 { relative: 0.0 0.3; } + rel2 { relative: 0.0 0.6; } color: 255 255 255 255; color2: 0 0 0 255; color3: 0 0 0 255; text { + style: "info,text"; text: "Hello"; - align: 0.5 0.5; - size: 15; } visible: 0; } diff --git a/widget_viewer_sdk/src/main.c b/widget_viewer_sdk/src/main.c index 60fcdd5b..e06bc5b6 100644 --- a/widget_viewer_sdk/src/main.c +++ b/widget_viewer_sdk/src/main.c @@ -69,6 +69,12 @@ static struct info { #define LONG_PRESS 1.0f +static void hide_widget_info_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + DbgPrint("Hide info panel\n"); + elm_object_signal_emit(s_info.layout, "hide", "info"); +} + static Eina_Bool show_widget_info_cb(void *data) { DbgPrint("Show info panel\n"); @@ -96,8 +102,6 @@ static void layout_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info if (s_info.long_press) { ecore_timer_del(s_info.long_press); s_info.long_press = NULL; - - elm_object_signal_emit(s_info.layout, "hide", "info"); } } @@ -164,6 +168,7 @@ static bool app_create(void *data) } evas_object_show(s_info.layout); + elm_object_signal_callback_add(s_info.layout, "mouse,clicked,1", "widget,info,bg", hide_widget_info_cb, NULL); evas_object_event_callback_add(s_info.layout, EVAS_CALLBACK_MOUSE_DOWN, layout_down_cb, NULL); evas_object_event_callback_add(s_info.layout, EVAS_CALLBACK_MOUSE_UP, layout_up_cb, NULL); @@ -325,9 +330,17 @@ static int load_widget(const char *widget_id) } if (i == s_info.ctx.count_of_size_type) { - ErrPrint("Failed to load a widget\n"); + ErrPrint("Supported size is not found\n"); + evas_object_resize(s_info.layout, s_info.w, s_info.h); + evas_object_size_hint_min_set(s_info.layout, s_info.w, s_info.h); + evas_object_size_hint_max_set(s_info.layout, s_info.w, s_info.h); + evas_object_show(s_info.layout); + + elm_object_part_text_set(s_info.layout, "message", "Supported size is not found"); + elm_object_signal_emit(s_info.layout, "show", "message"); return WIDGET_ERROR_NOT_SUPPORTED; } + elm_object_signal_emit(s_info.layout, "hide", "message"); DbgPrint("Found valid size[%X]: %dx%d\n", s_info.ctx.size_types[i], w, h); @@ -437,11 +450,14 @@ static int prepare_widget(const char *widget_id, app_control_h control) bundle_free(b); } + s_info.ctx.count_of_size_type = 20; ret = widget_service_get_supported_size_types(widget_id, &s_info.ctx.count_of_size_type, &s_info.ctx.size_types); if (ret != WIDGET_ERROR_NONE) { ErrPrint("Failed to load an widget\n"); } + DbgPrint("[%s] %d\n", widget_id, s_info.ctx.count_of_size_type); + if (s_info.ctx.count_of_size_type <= 1) { elm_object_signal_emit(s_info.layout, "hide", "size,list"); return WIDGET_ERROR_NONE; -- 2.34.1