#include <Edje.h>
#include <pkgmgr-info.h>
+#include <system_info.h>
#include <widget_errno.h>
#include <widget_viewer.h>
#define DEFAULT_CLUSTER "user,created"
#define DEFAULT_CATEGORY "default"
-// Enable this to apply shadow effect to image object (for text widget)
-// #define SUPPORT_IMAGE_EFFECT
+/*!
+ * \note
+ * Enable this to apply shadow effect to image object (for text widget)
+ * #define SUPPORT_IMAGE_EFFECT
+ */
int errno;
union _conf {
struct _field {
- unsigned int user_view_port: 1;
- unsigned int force_to_buffer: 1;
- unsigned int support_gbar: 1;
- unsigned int manual_pause_resume: 1;
- unsigned int use_fixed_size: 1;
- unsigned int easy_mode: 1;
- unsigned int is_scroll_x: 1;
- unsigned int is_scroll_y: 1;
- unsigned int auto_feed: 1;
- unsigned int delayed_resume: 1;
- unsigned int sensitive_move: 1;
- unsigned int render_animator: 1;
- unsigned int auto_render_selector: 1;
- unsigned int skip_acquire: 1;
-
- unsigned int reserved: 18;
+ unsigned int user_view_port:1;
+ unsigned int force_to_buffer:1;
+ unsigned int support_gbar:1;
+ unsigned int manual_pause_resume:1;
+ unsigned int use_fixed_size:1;
+ unsigned int easy_mode:1;
+ unsigned int is_scroll_x:1;
+ unsigned int is_scroll_y:1;
+ unsigned int auto_feed:1;
+ unsigned int delayed_resume:1;
+ unsigned int sensitive_move:1;
+ unsigned int render_animator:1;
+ unsigned int auto_render_selector:1;
+ unsigned int skip_acquire:1;
+
+ unsigned int reserved:18;
} field;
unsigned int mask;
} conf;
union {
struct {
- unsigned int pressed: 1; /**< Mouse is pressed */
- unsigned int touch_effect: 1; /**< Requires to play touch effect */
- unsigned int mouse_event: 1; /**< Requires to feed mouse event */
- unsigned int scroll_x: 1; /**< */
- unsigned int scroll_y: 1;
- unsigned int faulted: 1;
- unsigned int flick_down: 1;
- unsigned int gbar_created: 1;
-
- unsigned int created: 1;
- unsigned int deleted: 1;
- unsigned int widget_pixmap_acquire_requested: 1;
- unsigned int gbar_pixmap_acquire_requested: 1;
- unsigned int cancel_scroll_x: 1;
- unsigned int cancel_scroll_y: 1;
- unsigned int cancel_click: 2;
- unsigned int disable_preview: 1;
- unsigned int disable_loading: 1;
- unsigned int disable_text: 1;
- unsigned int widget_overlay_loaded: 1;
- unsigned int gbar_overlay_loaded: 1;
-
- unsigned int freeze_visibility: 1;
-
- unsigned int widget_dirty: 1;
- unsigned int gbar_dirty: 1;
-
- unsigned int send_delete: 1;
- unsigned int permanent_delete: 1;
-
- unsigned int delayed_resume: 2;
-
- unsigned int reserved: 4;
+ unsigned int pressed:1; /**< Mouse is pressed */
+ unsigned int touch_effect:1; /**< Requires to play touch effect */
+ unsigned int mouse_event:1; /**< Requires to feed mouse event */
+ unsigned int scroll_x:1; /**< */
+ unsigned int scroll_y:1;
+ unsigned int faulted:1;
+ unsigned int flick_down:1;
+ unsigned int gbar_created:1;
+
+ unsigned int created:1;
+ unsigned int deleted:1;
+ unsigned int widget_pixmap_acquire_requested:1;
+ unsigned int gbar_pixmap_acquire_requested:1;
+ unsigned int cancel_scroll_x:1;
+ unsigned int cancel_scroll_y:1;
+ unsigned int cancel_click:2;
+ unsigned int disable_preview:1;
+ unsigned int disable_loading:1;
+ unsigned int disable_text:1;
+ unsigned int widget_overlay_loaded:1;
+ unsigned int gbar_overlay_loaded:1;
+
+ unsigned int freeze_visibility:1;
+
+ unsigned int widget_dirty:1;
+ unsigned int gbar_dirty:1;
+
+ unsigned int send_delete:1;
+ unsigned int permanent_delete:1;
+
+ unsigned int delayed_resume:2;
+
+ unsigned int reserved:4;
} field; /* Do we really have the performance loss because of bit fields? */
unsigned int flags;
static void __widget_event_widget_updated(struct widget_data *data);
static void __widget_event_gbar_updated(struct widget_data *data);
+static inline bool is_widget_feature_enabled(void)
+{
+ bool feature = false;
+ int ret;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/shell.appwidget", &feature);
+ if (ret != SYSTEM_INFO_ERROR_NONE) {
+ ErrPrint("system_info: %d\n", ret);
+ }
+
+ return feature;
+}
+
static char *get_preview_image(struct widget_data *data, widget_size_type_e type)
{
Eina_List *l;
static struct widget_data *get_smart_data_from_handle(widget_h handle)
{
Evas_Object *widget;
- // struct widget_data *data;
widget = widget_viewer_get_data(handle);
if (!widget) {
s_info.conf.field.render_animator = 0;
}
}
-
}
static void __widget_pixmap_del_cb(void *cbdata, Evas *e, Evas_Object *obj, void *event_info)
return;
}
- // -90, 2, 4, 0x99000000
+ /* -90, 2, 4, 0x99000000 */
ea_image_effect_add_outer_shadow(ea_effect, img_opt->shadow.angle, img_opt->shadow.offset, img_opt->shadow.softness, img_opt->shadow.color);
ea_object_image_effect_set(img, ea_effect);
rx = ((double)x + (double)w / 2.0f) / (double)s_info.screen_width;
DbgPrint("x[%d], w[%d], rx[%lf]\n", x, w, rx);
- // 0.0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1.0
+ /* 0.0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1.0 */
widget_viewer_get_size_type(data->handle, &size_type);
switch (size_type) {
case WIDGET_SIZE_TYPE_1x1:
elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_scroller_single_direction_set(scroller, ELM_SCROLLER_SINGLE_DIRECTION_HARD);
- //elm_object_scroll_lock_x_set(scroller, EINA_TRUE);
+ /* elm_object_scroll_lock_x_set(scroller, EINA_TRUE); */
box = evas_object_rectangle_add(data->e);
if (box) {
s_info.widget_dirty_objects = eina_list_remove(s_info.widget_dirty_objects, data);
}
-static void remove_gbar_dirty_object_list(struct widget_data *data)
-{
- s_info.gbar_dirty_objects = eina_list_remove(s_info.gbar_dirty_objects, data);
-}
-
static void append_widget_dirty_object_list(struct widget_data *data, int idx)
{
data->is.field.widget_dirty = 1;
}
}
+static void remove_gbar_dirty_object_list(struct widget_data *data)
+{
+ s_info.gbar_dirty_objects = eina_list_remove(s_info.gbar_dirty_objects, data);
+}
+
static void append_gbar_dirty_object_list(struct widget_data *data, int idx)
{
data->is.field.gbar_dirty = 1;
if (data->is.field.delayed_resume == 0) { /* Follow the global configuration */
delay = s_info.conf.field.delayed_resume;
} else { /* Ignore the global configuration */
- // 1 : Disable Delayed Pause Resume
- // 2 : Enable Delayed Pause Resume
+ /* 1 : Disable Delayed Pause Resume */
+ /* 2 : Enable Delayed Pause Resume */
delay = (data->is.field.delayed_resume == 2);
}
if (data->size_type == WIDGET_SIZE_TYPE_UNKNOWN || widget_service_get_size(data->size_type, &data->widget_width, &data->widget_height) < 0) {
ErrPrint("Failed to get size info: %s\n", widget_viewer_get_pkgname(handle));
-
+
} else {
DbgPrint("System created WIDGET size is (%d)%dx%d\n", data->size_type, data->widget_width, data->widget_height);
}
widget_unref(data);
return;
}
+
widget_viewer_get_type(handle, 0, &widget_type);
switch (widget_type) {
case WIDGET_CONTENT_TYPE_IMAGE:
* Then we should not try to resize resource_id(surface) as width & height.
* Just keep them their size and try to resize layout only.
*/
-
if (!widget_viewer_is_created_by_user(data->handle)) {
/**
* Viewer should not be able to resize the box
widget_service_get_need_of_mouse_event(data->widget_id, type, (bool *)&need_of_mouse_event);
data->is.field.mouse_event = need_of_mouse_event;
} else {
+
int ret;
if (type > 0 && type != WIDGET_SIZE_TYPE_UNKNOWN) {
evas_object_clip_unset(data->stage);
}
-/*!
+/**
* This must be called before update_gbar_geometry
*/
static void update_stage_geometry(struct acquire_data *acquire_data)
const int delta_y_bottom = (acquire_data->h - (s_info.screen_height - widget_y - widget_h));
stage_w = widget_w > acquire_data->w ? widget_w : acquire_data->w;
- stage_h = widget_h + acquire_data->h;// - delta_y_top;
+ stage_h = widget_h + acquire_data->h;/* - delta_y_top; */
- if(delta_y_top >= delta_y_bottom)
- {
+ if (delta_y_top >= delta_y_bottom) {
evas_object_move(acquire_data->data->stage, 0, widget_y);
- }
- else
- {
+ } else {
evas_object_move(acquire_data->data->stage, 0, widget_y - acquire_data->h);
}
evas_object_geometry_get(acquire_data->data->widget_layout, &widget_x, &widget_y, &widget_w, &widget_h);
- //How much of the GBAR is outside the screen
+ /* How much of the GBAR is outside the screen */
const int delta_y_top = (acquire_data->h - widget_y) < 0 ? 0 : acquire_data->h - widget_y;
const int delta_y_bottom = (acquire_data->h - (s_info.screen_height - widget_y - widget_h)) < 0 ? 0 : (acquire_data->h - (s_info.screen_height - widget_y - widget_h));
- //If more of the GBAR is outside the top side draw at the bottom, otherwise draw at the top
- if(delta_y_top >= delta_y_bottom)
- {
+ /* If more of the GBAR is outside the top side draw at the bottom, otherwise draw at the top */
+ if (delta_y_top >= delta_y_bottom) {
evas_object_move(acquire_data->data->gbar_layout, 0, widget_y + widget_h - delta_y_bottom);
effect_resize(acquire_data->data->gbar_layout, acquire_data->w, acquire_data->h, EFFECT_HEIGHT);
- }
- else
- {
+ } else {
evas_object_move(acquire_data->data->gbar_layout, 0, widget_y + delta_y_top);
effect_resize(acquire_data->data->gbar_layout, acquire_data->w, acquire_data->h, EFFECT_HEIGHT|EFFECT_MOVE);
}
widget_viewer_release_buffer(data->gbar_fb);
data->gbar_fb = NULL;
} else {
- // This is first time
+ /* This is first time */
gbar_overlay_disable(data);
}
/* Emit RAW_CREATE event */
nr = invoke_raw_event_callback(WIDGET_VIEWER_EVAS_RAW_CREATE, widget_viewer_get_pkgname(handle), widget, WIDGET_ERROR_NONE);
- if ( (temp_widget_data = get_smart_data(widget)) == NULL) {
+ if ((temp_widget_data = get_smart_data(widget)) == NULL) {
ErrPrint("Failed to get widget data\n");
(void)widget_viewer_delete_widget(handle, WIDGET_DELETE_PERMANENTLY, NULL, NULL);
return WIDGET_ERROR_FAULT;
if (nr <= 0 || widget_system_created(handle, temp_widget_data) != WIDGET_ERROR_NONE) {
/*
* Deleting evas object will invoke delete callback.
- * Then it will invoke the RAW_DELETE event and execute the proper procedures for deleting object
+ * Then it will invoke the RAW_DELETE event and execute the proper procedures for deleting object
*/
widget_viewer_evas_set_permanent_delete(widget, EINA_TRUE);
evas_object_del(widget);
{
int ret;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!win) {
return WIDGET_ERROR_INVALID_PARAMETER;
}
util_screen_size_get(&s_info.screen_width, &s_info.screen_height);
- s_info.conf.field.render_animator = 0; // By default, use render animator for updating
+ s_info.conf.field.render_animator = 0; /* By default, use render animator for updating */
ret = widget_viewer_init(util_display_get(), 1, 0.001f, 1);
if (ret < 0) {
{
int ret;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (s_info.initialized) {
widget_viewer_remove_event_handler(widget_event_handler);
widget_viewer_remove_fault_handler(widget_fault_handler);
EAPI int widget_viewer_evas_notify_resumed_status_of_viewer(void)
{
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
EAPI int widget_viewer_evas_notify_paused_status_of_viewer(void)
{
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
EAPI int widget_viewer_evas_notify_orientation_of_viewer(int orientation)
{
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
char *cluster = DEFAULT_CLUSTER;
char *category = DEFAULT_CATEGORY;
+ if (!is_widget_feature_enabled()) {
+ return NULL;
+ }
+
if (!s_info.initialized) {
ErrPrint("Viewer is not initialized\n");
return NULL;
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
int ret = WIDGET_ERROR_NONE;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
switch ((int)type) {
case WIDGET_VIEWER_EVAS_SENSITIVE_MOVE:
s_info.conf.field.sensitive_move = value;
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
(void)ecore_timer_del(data->delayed_resume_timer);
data->delayed_resume_timer = NULL;
}
+
return widget_viewer_set_visibility(data->handle, WIDGET_HIDE_WITH_PAUSE);
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
(void)ecore_timer_del(data->delayed_resume_timer);
data->delayed_resume_timer = NULL;
}
+
return widget_viewer_set_visibility(data->handle, WIDGET_SHOW);
}
struct widget_data *data;
int ret;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return NULL;
+ }
+
if (!s_info.initialized) {
return NULL;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return NULL;
+ }
+
if (!s_info.initialized) {
return NULL;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return NULL;
+ }
+
if (!s_info.initialized) {
return NULL;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return 0.0f;
+ }
+
if (!s_info.initialized) {
return 0.0f;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
EAPI int widget_viewer_evas_feed_access_event(Evas_Object *widget, int type, void *_info, void (*ret_cb)(Evas_Object *obj, int ret, void *data), void *cbdata)
{
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
#if defined(ELM_ACCESS_ENABLED)
struct widget_data *data;
Elm_Access_Action_Info *info = _info;
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return false;
+ }
+
if (!s_info.initialized) {
return 0;
}
{
struct raw_event_cbdata *cbdata;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
cbdata = calloc(1, sizeof(*cbdata));
if (!cbdata) {
ErrPrint("calloc: %d\n", errno);
Eina_List *n;
struct raw_event_cbdata *cbdata;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
switch (type) {
case WIDGET_VIEWER_EVAS_RAW_DELETE:
EINA_LIST_FOREACH_SAFE(s_info.raw_event.delete_list, l, n, cbdata) {
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return false;
+ }
+
if (!s_info.initialized) {
ErrPrint("Not initialized\n");
return false;
struct widget_data *data;
FILE *fp;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return false;
+ }
+
if (!s_info.initialized) {
- return 0;
+ return false;
}
data = get_smart_data(widget);
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return;
+ }
+
if (!s_info.initialized) {
return;
}
Eina_List *l;
int ret;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
Eina_List *l;
Eina_List *n;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
Eina_List *l;
int ret;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
Eina_List *n;
struct subscribe_category *item;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *widget_data_from_evas;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
{
struct widget_data *data;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
Eina_List *n;
struct preview_info *info;
+ if (!is_widget_feature_enabled()) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
if (!s_info.initialized) {
return WIDGET_ERROR_FAULT;
}
#include <string.h>
#include <app_control.h>
#include <app_control_internal.h>
+#include <efl_extension.h>
int errno;
.ctx = {
.content_info = NULL,
.title = NULL,
- .period = WIDGET_VIEWER_EVAS_DEFAULT_PERIOD,
+ .period = WIDGET_VIEWER_EVAS_DEFAULT_PERIOD,
.widget = NULL,
.size_types = NULL,
.count_of_size_type = 20,
#define LONG_PRESS 1.0f
+static void back_key_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_app_exit();
+}
+
static void hide_widget_info_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
DbgPrint("Hide info panel\n");
s_info.win = NULL;
return false;
}
- elm_win_resize_object_add(s_info.win, s_info.box);
- evas_object_show(s_info.box);
+ evas_object_size_hint_expand_set(s_info.box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(s_info.box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_align_set(s_info.box, 0.5, 0.5);
s_info.layout = elm_layout_add(s_info.win);
if (!s_info.layout) {
return false;
}
- elm_box_align_set(s_info.box, 0.5, 0.5);
- evas_object_size_hint_expand_set(s_info.box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_fill_set(s_info.box, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
if (elm_layout_file_set(s_info.layout, LAYOUT_EDJ, "layout") != EINA_TRUE) {
LOGE("Failed to load an edje\n");
evas_object_del(s_info.bg);
s_info.win = NULL;
return false;
}
+ evas_object_size_hint_expand_set(s_info.layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(s_info.layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(s_info.win, s_info.layout);
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);
- elm_box_pack_end(s_info.box, s_info.layout);
+ elm_object_part_content_set(s_info.layout, "widget", s_info.box);
/* WIDGET init */
widget_viewer_evas_set_option(WIDGET_VIEWER_EVAS_DIRECT_UPDATE, 1);
widget_viewer_evas_init(s_info.win);
+ eext_object_event_callback_add(s_info.win, EEXT_CALLBACK_BACK, back_key_cb, NULL);
+
return true;
}
DbgPrint("Unload previous widget: %s\n", tmp);
widget_viewer_evas_set_permanent_delete(s_info.ctx.widget, EINA_TRUE);
- elm_object_part_content_unset(s_info.layout, "widget");
+ elm_box_unpack(s_info.box, s_info.ctx.widget);
evas_object_del(s_info.ctx.widget);
free(s_info.ctx.title);
free(s_info.ctx.content_info);
static void app_terminate(void *data)
{
+ eext_object_event_callback_del(s_info.win, EEXT_CALLBACK_BACK, back_key_cb);
+
unload_widget();
/* WIDGET fini */
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)
evas_object_size_hint_min_set(rect, s_info.w, s_info.h);
evas_object_color_set(rect, 100, 100, 100, 255);
evas_object_show(rect);
- elm_object_part_content_set(s_info.layout, "widget", rect);
- evas_object_show(s_info.layout);
+ elm_box_pack_end(s_info.box, rect);
update_message("Supported size is not found");
return WIDGET_ERROR_NOT_SUPPORTED;
evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED, widget_create_aborted_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);
+ elm_box_pack_end(s_info.box, 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);
+ evas_object_show(s_info.ctx.widget);
return WIDGET_ERROR_NONE;
}
icon = elm_icon_add(s_info.win);
if (icon) {
elm_image_file_set(icon, icon_filename, NULL);
- elm_image_resizable_set(icon, EINA_FALSE, EINA_FALSE);
+ elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE);
+ evas_object_size_hint_max_set(icon, 100, 100);
DbgPrint("Icon: %s\n", icon_filename);
}
free(icon_filename);
int h;
bundle *b;
static Elm_Genlist_Item_Class class = {
+ .item_style = "1text.1icon",
.func = {
.text_get = list_item_text_get_cb,
.content_get = list_item_content_get_cb,