collections {
styles {
+ style {
+ name: "info,text";
+ base: "font=Tizen font_size=15 align=left color=#FFFFFF ellipsis=1.0 wrap=char";
+ tag: "br" "\n";
+ tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "b" "+ font=Tizen:style=Bold";
+ tag: "tag" "\t";
+ }
}
group {
}
part {
- name: "widget,id";
+ name: "widget,id,name";
clip_to: "widget,info";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 0.1; }
- rel2 { relative: 1.0 0.2; }
+ rel1 { relative: 0.0 0.0; to_y, "widget,id"; }
+ rel2 { relative: 0.3 1.0; to_y, "widget,id"; }
+ text {
+ style: "info,text";
+ text: "widget id";
+ }
+ }
+ }
+
+ part {
+ name: "widget,id";
+ clip_to: "widget,info";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.35 0.1; }
+ rel2 { relative: 1.0 0.15; }
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;
}
}
}
part {
- name: "widget,content,info";
+ name: "widget,content,info,name";
clip_to: "widget,info";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 0.25; }
- rel2 { relative: 1.0 0.35; }
+ rel1 { relative: 0.0 0.0; to_y, "widget,content,info"; }
+ rel2 { relative: 0.3 1.0; to_y, "widget,content,info"; }
+ text {
+ style: "info,text";
+ text: "content info";
+ }
+ }
+ }
+
+ part {
+ name: "widget,content,info";
+ clip_to: "widget,info";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.35 0.20; }
+ rel2 { relative: 1.0 0.25; }
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;
}
}
}
part {
- name: "widget,title";
+ name: "widget,title,name";
clip_to: "widget,info";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 0.4; }
- rel2 { relative: 1.0 0.5; }
+ rel1 { relative: 0.0 0.0; to_y, "widget,title"; }
+ rel2 { relative: 0.3 1.0; to_y, "widget,title"; }
+ text {
+ style: "info,text";
+ text: "title";
+ }
+ }
+ }
+
+ part {
+ name: "widget,title";
+ clip_to: "widget,info";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.35 0.3; }
+ rel2 { relative: 1.0 0.35; }
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;
}
}
}
part {
- name: "widget,period";
+ name: "widget,period,name";
clip_to: "widget,info";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 0.55; }
- rel2 { relative: 1.0 0.65; }
+ rel1 { relative: 0.0 0.0; to_y, "widget,period"; }
+ rel2 { relative: 0.3 1.0; to_y, "widget,period"; }
+ text {
+ style: "info,text";
+ text: "period";
+ }
+ }
+ }
+
+ part {
+ name: "widget,period";
+ clip_to: "widget,info";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.35 0.4; }
+ rel2 { relative: 1.0 0.45; }
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;
}
}
}
#include <bundle.h>
#include <dlog.h>
#include <string.h>
+#include <app_control.h>
+#include <app_control_internal.h>
int errno;
return;
}
-// evas_object_resize(s_info.ctx.widget, w, h);
-// evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
+ evas_object_resize(s_info.ctx.widget, w, h);
+ evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
+ evas_object_size_hint_max_set(s_info.ctx.widget, w, h);
evas_object_resize(s_info.layout, w, h);
evas_object_size_hint_min_set(s_info.layout, w, h);
+ evas_object_size_hint_max_set(s_info.layout, w, h);
}
static void extra_updated_cb(void *data, Evas_Object *obj, void *event_info)
DbgPrint("Period updated: %s\n", buffer);
}
+static void widget_created_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ period_changed_cb(data, obj, NULL);
+ extra_updated_cb(data, obj, NULL);
+}
+
static int load_widget(const char *widget_id)
{
int w = 0;
}
DbgPrint("Resize the widget(%s) to [%X] %dx%d\n", widget_id, s_info.ctx.size_types[0], w, h);
- evas_object_resize(s_info.ctx.widget, w, h);
- evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_UPDATED, updated_cb, NULL);
evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED, extra_updated_cb, NULL);
evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_PERIOD_CHANGED, period_changed_cb, NULL);
+ evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_WIDGET_CREATED, widget_created_cb, NULL);
elm_object_part_text_set(s_info.layout, "widget,id", widget_id);
elm_object_part_content_set(s_info.layout, "widget", s_info.ctx.widget);
+ evas_object_resize(s_info.ctx.widget, w, h);
+ evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
+ evas_object_size_hint_max_set(s_info.ctx.widget, w, h);
+
evas_object_resize(s_info.layout, w, h);
evas_object_size_hint_min_set(s_info.layout, w, h);
+ evas_object_size_hint_max_set(s_info.layout, w, h);
return WIDGET_ERROR_NONE;
}
return icon;
}
-static int prepare_widget(const char *widget_id)
+static int prepare_widget(const char *widget_id, app_control_h control)
{
int ret;
Evas_Object *size_list;
int i;
int w;
int h;
+ bundle *b;
static Elm_Genlist_Item_Class class = {
.func = {
.text_get = list_item_text_get_cb,
}
};
+ if (app_control_export_as_bundle(control, &b) == APP_CONTROL_ERROR_NONE) {
+ bundle_raw *r;
+ int len;
+
+ if (bundle_encode(b, &r, &len) == BUNDLE_ERROR_NONE) {
+ s_info.ctx.content_info = malloc(len + 8);
+ if (!s_info.ctx.content_info) {
+ ErrPrint("malloc: %d\n", errno);
+ } else {
+ snprintf(s_info.ctx.content_info, len + 8, "%d:%s", len, (char *)r);
+ DbgPrint("Encoded content_info: [%s]\n", s_info.ctx.content_info);
+ }
+
+ free((char *)r); /* Do I have to use the g_free? */
+ } else {
+ ErrPrint("Failed to encode a bundle\n");
+ }
+
+ bundle_free(b);
+ }
+
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");
}
ret = unload_widget();
- ret = prepare_widget(widget_id);
+ ret = prepare_widget(widget_id, service);
ret = load_widget(widget_id);
free(widget_id);
} else {