#define PANEL_ANIMATOR_MAX 1
typedef struct _Widget_Data Widget_Data;
-struct _Widget_Data {
+struct _Widget_Data
+{
Evas_Object *lay;
Evas_Object *button[2];
Evas_Object *bg_rect;
Eina_Bool panel_suppported;
};
-struct _Elm_Softkey_Item {
+struct _Elm_Softkey_Item
+{
Evas_Object *obj;
Evas_Object *base;
Evas_Object *icon;
/*
* callback functions
*/
-static void _softkey_down_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source);
-static void _softkey_up_cb(void *data, Evas_Object *obj, const char *emission,
- const char *source);
-
-static void _panel_down_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-static void _panel_up_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-
-static void _more_btn_click_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source);
-static void _close_btn_click_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source);
-static void _bg_click_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+static void _softkey_down_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _softkey_up_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+
+static void _panel_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+static void _more_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _close_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _bg_click_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
static int _show_button_animator_cb(void *data);
static int _hide_button_animator_cb(void *data);
* internal function
*/
static int
- _show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show);
+_show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show);
static int _delete_button(Evas_Object *obj);
-static void _softkey_object_move(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-static void _softkey_object_resize(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-static void _softkey_object_show(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-static void _softkey_object_hide(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
-
-static void _icon_disable(Evas_Object *icon, Eina_Bool disabled) {
+static void _softkey_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _softkey_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _softkey_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _softkey_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _softkey_horizontal_set(Evas_Object *obj, Eina_Bool horizontal_mode);
+static void _icon_disable(Evas_Object *icon, Eina_Bool disabled)
+{
Evas_Object *edj;
if (!icon)
if (disabled) {
if (!edj) {
edje_object_signal_emit(icon, "elm,state,disabled", "elm");
- } else {
+ }
+ else {
edje_object_signal_emit(edj, "elm,state,disabled", "elm");
}
- } else {
+ }
+ else {
if (!edj) {
edje_object_signal_emit(icon, "elm,state,enabled", "elm");
- } else {
+ }
+ else {
edje_object_signal_emit(edj, "elm,state,enabled", "elm");
}
}
}
-static void _item_disable(Elm_Softkey_Item *it, Eina_Bool disabled) {
+static void _item_disable(Elm_Softkey_Item *it, Eina_Bool disabled)
+{
Widget_Data *wd = elm_widget_data_get(it->obj);
if (!wd)
return;
it->disabled = disabled;
if (it->disabled) {
edje_object_signal_emit(it->base, "elm,state,disabled", "elm");
- } else {
+ }
+ else {
edje_object_signal_emit(it->base, "elm,state,enabled", "elm");
}
_icon_disable(it->icon, disabled);
}
-static void _del_hook(Evas_Object *obj) {
+static void _del_hook(Evas_Object *obj)
+{
int i;
Evas_Object *btn;
Widget_Data *wd = elm_widget_data_get(obj);
free(wd);
}
-static void _theme_hook(Evas_Object *obj) {
+static void _theme_hook(Evas_Object *obj)
+{
Elm_Softkey_Item* item;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Softkey_Item *it;
if (!wd) {
return;
}
- _elm_theme_object_set(obj, wd->lay, "softkey", "bg", elm_widget_style_get(
- obj));
+ _elm_theme_object_set(obj, wd->lay, "softkey", "bg", elm_widget_style_get(obj));
_elm_theme_object_set(obj, wd->glow_obj, "softkey", "glow", "default");
if (wd->button[ELM_SK_LEFT_BTN]) {
item = evas_object_data_get(wd->button[ELM_SK_LEFT_BTN], "item_data");
- _elm_theme_object_set(obj, wd->button[ELM_SK_LEFT_BTN], "softkey",
- "button_left", elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->button[ELM_SK_LEFT_BTN], "softkey", "button_left", elm_widget_style_get(obj));
elm_softkey_item_label_set(item, item->label);
item = evas_object_data_get(wd->button[ELM_SK_RIGHT_BTN], "item_data");
- _elm_theme_object_set(obj, wd->button[ELM_SK_RIGHT_BTN], "softkey",
- "button_right", elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->button[ELM_SK_RIGHT_BTN], "softkey", "button_right", elm_widget_style_get(obj));
elm_softkey_item_label_set(item, item->label);
}
if (wd->panel) {
- _elm_theme_object_set(obj, wd->panel, "softkey", "panel",
- elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->panel, "softkey", "panel", elm_widget_style_get(obj));
if (wd->panel_btn_idx > 0) {
//show more button
edje_object_signal_emit(wd->lay, "more_btn_show", "");
_sizing_eval( obj );
}
-static void _sub_del(void *data, Evas_Object *obj, void *event_info) {
+static void _sub_del(void *data, Evas_Object *obj, void *event_info)
+{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *sub = event_info;
const Eina_List *l;
}
}
-static void _sizing_eval(Evas_Object *obj) {
+static void _sizing_eval(Evas_Object *obj)
+{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd)
_softkey_object_resize(obj, NULL, obj, NULL);
}
-static int _panel_up_animator_cb(void *data) {
+static int _panel_up_animator_cb(void *data)
+{
int max = PANEL_ANIMATOR_MAX;
static int progress = 0;
Widget_Data *wd;
/* move up panel */
if (wd->panel) {
ypos = wd->win_h - (wd->panel_height * progress / max);
- evas_object_move(wd->panel, 0, ypos);
+ evas_object_move(wd->panel, wd->x, ypos);
}
return 1;
}
-static int _panel_down_animator_cb(void *data) {
+static int _panel_down_animator_cb(void *data)
+{
int max = PANEL_ANIMATOR_MAX;
static int progress = 0;
Widget_Data *wd;
/* move down panel */
if (wd->panel) {
- ypos = wd->win_h - wd->panel_height + (wd->panel_height * progress
- / max);
- evas_object_move(wd->panel, 0, ypos);
+ ypos = wd->win_h - wd->panel_height + (wd->panel_height * progress / max);
+ evas_object_move(wd->panel, wd->x, ypos);
}
return 1;
}
-static int _hide_button_animator_cb(void *data) {
+static int _hide_button_animator_cb(void *data)
+{
int max = BTN_ANIMATOR_MAX;
static int progress = 0;
Widget_Data *wd;
/* move left button */
if (wd->button[ELM_SK_LEFT_BTN]) {
- edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN],
- "button_rect", NULL, NULL, &btn_w, NULL);
+ edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN], "button_rect", NULL, NULL, &btn_w, NULL);
- xpos = -1 * btn_w * progress / max;
+ xpos = wd->x + -1 * btn_w * progress / max;
evas_object_move(wd->button[ELM_SK_LEFT_BTN], xpos, wd->y);
}
/* move right button */
if (wd->button[ELM_SK_RIGHT_BTN]) {
- edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN],
- "button_rect", NULL, NULL, &btn_w, NULL);
+ edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN], "button_rect", NULL, NULL, &btn_w, NULL);
- xpos = (wd->w - btn_w) + (btn_w * progress / max);
+ xpos = (wd->x + wd->w - btn_w) + (btn_w * progress / max);
evas_object_move(wd->button[ELM_SK_RIGHT_BTN], xpos, wd->y);
}
return 1;
}
-static int _show_button_animator_cb(void *data) {
+static int _show_button_animator_cb(void *data)
+{
int max = BTN_ANIMATOR_MAX;
static int progress = 0;
Widget_Data *wd;
/* move left button */
if (wd->button[ELM_SK_LEFT_BTN]) {
- edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN],
- "button_rect", NULL, NULL, &btn_w, NULL);
+ edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN], "button_rect", NULL, NULL, &btn_w, NULL);
- xpos = (-1 * btn_w) + (btn_w * progress / max);
+ xpos = wd->x + (-1 * btn_w) + (btn_w * progress / max);
evas_object_move(wd->button[ELM_SK_LEFT_BTN], xpos, wd->y);
}
/* move right button */
if (wd->button[ELM_SK_RIGHT_BTN]) {
- edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN],
- "button_rect", NULL, NULL, &btn_w, NULL);
+ edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN], "button_rect", NULL, NULL, &btn_w, NULL);
- xpos = wd->w - (btn_w * progress / max);
+ xpos = wd->x + wd->w - (btn_w * progress / max);
evas_object_move(wd->button[ELM_SK_RIGHT_BTN], xpos, wd->y);
}
return 1;
}
-static void _more_btn_click_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source) {
+static void _more_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
Widget_Data *wd;
wd = elm_widget_data_get(data);
if (!wd)
}
}
-static void _close_panel(Evas_Object *obj) {
+static void _close_panel(Evas_Object *obj)
+{
Widget_Data *wd;
wd = elm_widget_data_get(obj);
if (!wd)
}
}
-static void _bg_click_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _bg_click_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
_close_panel(data);
}
-static void _close_btn_click_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source) {
+static void _close_btn_click_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
_close_panel(data);
}
-static int _show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show) {
+static int _show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show)
+{
if (!obj)
return -1;
if (show) {
wd->button_show[type] = EINA_TRUE;
evas_object_show(btn);
- } else {
+ }
+ else {
wd->button_show[type] = EINA_FALSE;
evas_object_hide(btn);
}
return 0;
}
-static int _arrange_button(Evas_Object *obj, Elm_Softkey_Type type) {
+static int _arrange_button(Evas_Object *obj, Elm_Softkey_Type type)
+{
Widget_Data *wd;
Evas_Coord btn_w = 0;
Evas_Object *btn;
if (!btn)
return -1;
- switch (type) {
+ switch (type)
+ {
case ELM_SK_LEFT_BTN:
evas_object_move(btn, wd->x, wd->y);
break;
case ELM_SK_RIGHT_BTN:
- edje_object_part_geometry_get(btn, "button_rect", NULL, NULL, &btn_w,
- NULL);
- evas_object_move(btn, wd->w - btn_w, wd->y);
+ edje_object_part_geometry_get(btn, "button_rect", NULL, NULL, &btn_w, NULL);
+ evas_object_move(btn, wd->x + wd->w - btn_w, wd->y);
break;
default:
break;
return 0;
}
-static void _softkey_up_cb(void *data, Evas_Object *obj, const char *emission,
- const char *source) {
+static void _softkey_up_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
Evas_Object *edj;
Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
edje_object_signal_emit(edj, "elm,state,unselected", "elm");
}
-static void _softkey_down_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source) {
+static void _softkey_down_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
Evas_Object *edj;
Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
edje_object_signal_emit(edj, "elm,state,selected", "elm");
}
-static void _panel_up_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
Widget_Data *wd;
evas_object_smart_callback_call(it->obj, "clicked", it);
}
-static void _panel_down_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _panel_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Evas_Coord glow_x, glow_y;
Widget_Data *wd;
evas_object_smart_callback_call(it->obj, "press", it);
}
-static int _delete_button(Evas_Object *obj) {
+static int _delete_button(Evas_Object *obj)
+{
if (!obj)
return -1;
return 0;
}
-static void _calc_win_height(Widget_Data *wd) {
+static void _calc_win_height(Widget_Data *wd)
+{
wd->win_h = wd->y + wd->h;
if (wd->bg_rect) {
evas_object_resize(wd->bg_rect, wd->w, wd->win_h);
+ evas_object_move(wd->bg_rect, wd->x, 0);
}
if (wd->show_panel) {
evas_object_move(wd->panel, wd->x, (wd->win_h - wd->panel_height));
- } else {
+ }
+ else {
evas_object_move(wd->panel, wd->x, wd->win_h);
}
}
-static void _softkey_object_move(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _softkey_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Widget_Data *wd;
int i;
Evas_Coord x, y;
wd->x = x;
wd->y = y;
- // evas_object_move(wd->lay, x, y);
+ evas_object_move(wd->lay, x, y);
for (i = 0; i < 2; i++) {
_arrange_button((Evas_Object *) data, i);
_calc_win_height(wd);
}
-static void _softkey_object_resize(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _softkey_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Widget_Data *wd;
Evas_Object *btn;
int i;
for (i = 0; i < 2; i++) {
btn = wd->button[i];
if (btn != NULL) {
- edje_object_part_geometry_get(btn, "button_rect", NULL, NULL,
- &btn_w, NULL);
+ edje_object_part_geometry_get(btn, "button_rect", NULL, NULL, &btn_w, NULL);
evas_object_resize(btn, btn_w, h);
_arrange_button((Evas_Object *) data, i);
}
if (wd->w >= wd->win_h) {
_softkey_horizontal_set(data, EINA_TRUE);
- } else {
+ }
+ else {
_softkey_horizontal_set(data, EINA_FALSE);
}
_calc_win_height(wd);
}
-static void _softkey_object_show(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _softkey_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Widget_Data *wd = NULL;
Evas_Object *btn;
int i;
}
}
-static void _softkey_object_hide(void *data, Evas *e, Evas_Object *obj,
- void *event_info) {
+static void _softkey_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
Widget_Data *wd = NULL;
Evas_Object *btn;
int i;
* @ingroup Softkey
*/
EAPI Evas_Object *
-elm_softkey_add(Evas_Object *parent) {
+elm_softkey_add(Evas_Object *parent)
+{
Evas_Object *obj = NULL;
Widget_Data *wd = NULL;
Evas *e;
return NULL;
}
elm_widget_resize_object_set(obj, wd->lay);
- edje_object_signal_callback_add(wd->lay, "clicked", "more_btn",
- _more_btn_click_cb, obj);
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
- _softkey_object_resize, obj);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
- _softkey_object_move, obj);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
- _softkey_object_show, obj);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
- _softkey_object_hide, obj);
+ edje_object_signal_callback_add(wd->lay, "clicked", "more_btn", _more_btn_click_cb, obj);
+
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _softkey_object_resize, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _softkey_object_move, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _softkey_object_show, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _softkey_object_hide, obj);
wd->is_horizontal = EINA_FALSE;
wd->panel_suppported = EINA_TRUE;
wd->scale_factor = elm_scale_get();
return obj;
}
-EAPI void _softkey_horizontal_set(Evas_Object *obj, Eina_Bool horizontal_mode) {
+static void _softkey_horizontal_set(Evas_Object *obj, Eina_Bool horizontal_mode)
+{
Widget_Data *wd;
char buff[32];
if (!obj)
if (wd->panel) {
if ((edje_object_data_get(wd->panel, "max_item_count") == NULL)
|| (edje_object_data_get(wd->panel, "panel_height") == NULL)
- || (edje_object_data_get(wd->panel, "panel_height_horizontal")
- == NULL)) {
+ || (edje_object_data_get(wd->panel, "panel_height_horizontal") == NULL)) {
wd->panel_suppported = EINA_FALSE;
- } else
+ }
+ else
wd->panel_suppported = EINA_TRUE;
if (wd->panel_suppported == EINA_TRUE) {
if (wd->is_horizontal == EINA_TRUE) {
sprintf(buff, "button_%d", (wd->panel_btn_idx + wd->max_button));
edje_object_signal_emit(wd->panel, buff, "panel_rect");
- wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel,
- buff)) * wd->scale_factor);
- evas_object_resize(
- wd->panel,
- wd->w,
- ((int) (atoi(edje_object_data_get(wd->panel,
- "panel_height_horizontal")) * wd->scale_factor)));
- } else {
+ wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff)) * wd->scale_factor);
+ evas_object_resize(wd->panel, wd->w, ((int) (atoi(edje_object_data_get(wd->panel, "panel_height_horizontal"))
+ * wd->scale_factor)));
+ }
+ else {
sprintf(buff, "button_%d", (wd->panel_btn_idx));
edje_object_signal_emit(wd->panel, buff, "panel_rect");
- wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel,
- buff)) * wd->scale_factor);
- evas_object_resize(wd->panel, wd->w, ((int) (atoi(
- edje_object_data_get(wd->panel, "panel_height"))
+ wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff)) * wd->scale_factor);
+ evas_object_resize(wd->panel, wd->w, ((int) (atoi(edje_object_data_get(wd->panel, "panel_height"))
* wd->scale_factor)));
}
}
* @ingroup Softkey
*/
EAPI Elm_Softkey_Item *
-elm_softkey_button_add(Evas_Object *obj, Elm_Softkey_Type type,
- Evas_Object *icon, const char *label, void(*func)(void *data,
- Evas_Object *obj, void *event_info), const void *data) {
+elm_softkey_button_add(Evas_Object *obj, Elm_Softkey_Type type, Evas_Object *icon, const char *label, void(*func)(void *data, Evas_Object *obj, void *event_info), const void *data)
+{
Widget_Data *wd;
Evas* evas;
char button_type[64];
if (wd->button[type] == NULL) {
if (type == ELM_SK_LEFT_BTN) {
strcpy(button_type, "button_left");
- } else {
+ }
+ else {
strcpy(button_type, "button_right");
}
it->base = wd->button[type] = edje_object_add(evas);
if (!wd->button[type])
return NULL;
- _elm_theme_object_set(obj, wd->button[type], "softkey", button_type,
- elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->button[type], "softkey", button_type, elm_widget_style_get(obj));
wd->button_show[type] = EINA_TRUE;
if (evas_object_visible_get(obj)) {
}
evas_object_smart_member_add(wd->button[type], obj);
- edje_object_signal_callback_add(wd->button[type], "elm,action,down",
- "", _softkey_down_cb, it);
- edje_object_signal_callback_add(wd->button[type], "elm,action,click",
- "", _softkey_up_cb, it);
+ edje_object_signal_callback_add(wd->button[type], "elm,action,down", "", _softkey_down_cb, it);
+ edje_object_signal_callback_add(wd->button[type], "elm,action,click", "", _softkey_up_cb, it);
evas_object_clip_set(wd->button[type], evas_object_clip_get(obj));
if (wd->panel)
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_button_del(Evas_Object *obj, Elm_Softkey_Type type) {
+EAPI void elm_softkey_button_del(Evas_Object *obj, Elm_Softkey_Type type)
+{
Widget_Data *wd;
Elm_Softkey_Item *it;
Evas_Object *btn;
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_button_show(Evas_Object *obj, Elm_Softkey_Type type) {
+EAPI void elm_softkey_button_show(Evas_Object *obj, Elm_Softkey_Type type)
+{
_show_button(obj, type, EINA_TRUE);
}
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_button_hide(Evas_Object *obj, Elm_Softkey_Type type) {
+EAPI void elm_softkey_button_hide(Evas_Object *obj, Elm_Softkey_Type type)
+{
_show_button(obj, type, EINA_FALSE);
}
* @ingroup Softkey
*/
EAPI Elm_Softkey_Item *
-elm_softkey_panel_item_add(Evas_Object *obj, Evas_Object *icon,
- const char *label, void(*func)(void *data, Evas_Object *obj,
- void *event_info), const void *data) {
+elm_softkey_panel_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void(*func)(void *data, Evas_Object *obj, void *event_info), const void *data)
+{
Widget_Data *wd;
Evas *evas;
char button_name[32];
if (wd->bg_rect) {
evas_object_resize(wd->bg_rect, wd->w, wd->win_h);
- evas_object_event_callback_add(wd->bg_rect, EVAS_CALLBACK_MOUSE_UP,
- _bg_click_cb, obj);
+ evas_object_event_callback_add(wd->bg_rect, EVAS_CALLBACK_MOUSE_UP, _bg_click_cb, obj);
evas_object_smart_member_add(wd->bg_rect, obj);
}
wd->panel = edje_object_add(evas);
if (!wd->panel)
return NULL;
- _elm_theme_object_set(obj, wd->panel, "softkey", "panel",
- elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->panel, "softkey", "panel", elm_widget_style_get(obj));
evas_object_move(wd->panel, 0, wd->win_h);
- edje_object_signal_callback_add(wd->panel, "clicked", "close_btn",
- _close_btn_click_cb, obj);
+ edje_object_signal_callback_add(wd->panel, "clicked", "close_btn", _close_btn_click_cb, obj);
evas_object_smart_member_add(wd->panel, obj);
if (evas_object_visible_get(obj)) {
evas_object_show(wd->panel);
wd->panel_height = 0;
if ((edje_object_data_get(wd->panel, "max_item_count") == NULL)
|| (edje_object_data_get(wd->panel, "panel_height") == NULL)
- || (edje_object_data_get(wd->panel, "panel_height_horizontal")
- == NULL)) {
+ || (edje_object_data_get(wd->panel, "panel_height_horizontal") == NULL)) {
//If this key is not found in data section, then it means the panel won't come.
wd->max_button = 0;
// delete panel
}
wd->panel_suppported = EINA_FALSE;
return NULL;
- } else {
- wd->max_button = (int) (atoi(edje_object_data_get(wd->panel,
- "max_item_count")));
+ }
+ else {
+ wd->max_button = (int) (atoi(edje_object_data_get(wd->panel, "max_item_count")));
if (wd->is_horizontal) {
- evas_object_resize(
- wd->panel,
- wd->w,
- ((int) (atoi(edje_object_data_get(wd->panel,
- "panel_height_horizontal")) * wd->scale_factor)));
- } else {
- evas_object_resize(wd->panel, wd->w, ((int) (atoi(
- edje_object_data_get(wd->panel, "panel_height"))
+ evas_object_resize(wd->panel, wd->w, ((int) (atoi(edje_object_data_get(wd->panel, "panel_height_horizontal"))
+ * wd->scale_factor)));
+ }
+ else {
+ evas_object_resize(wd->panel, wd->w, ((int) (atoi(edje_object_data_get(wd->panel, "panel_height"))
* wd->scale_factor)));
}
}
it->base = btn = edje_object_add(evas);
if (!btn)
return NULL;
- _elm_theme_object_set(obj, btn, "softkey", "panel_button",
- elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, btn, "softkey", "panel_button", elm_widget_style_get(obj));
edje_object_part_text_set(btn, "elm.text", label); /* set text */
edje_object_message_signal_process(btn);
- evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_DOWN,
- _panel_down_cb, it);
- evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, _panel_up_cb,
- it);
+ evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_DOWN, _panel_down_cb, it);
+ evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, _panel_up_cb, it);
/* swallow button */
sprintf(button_name, "panel_button_area_%d", wd->panel_btn_idx);
if (wd->is_horizontal) {
sprintf(buff, "button_%d", wd->max_button + wd->panel_btn_idx);
edje_object_signal_emit(wd->panel, buff, "panel_rect");
- wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff))
- * wd->scale_factor);
- } else {
+ wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff)) * wd->scale_factor);
+ }
+ else {
sprintf(buff, "button_%d", wd->panel_btn_idx);
edje_object_signal_emit(wd->panel, buff, "panel_rect");
- wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff))
- * wd->scale_factor);
+ wd->panel_height = (int) (atoi(edje_object_data_get(wd->panel, buff)) * wd->scale_factor);
}
return it;
*
* @ingroup Softkey
*/
-EAPI int elm_softkey_panel_del(Evas_Object *obj) {
+EAPI int elm_softkey_panel_del(Evas_Object *obj)
+{
Widget_Data *wd;
char button_name[32];
Evas_Object *btn;
*
* @ingroup Softkey
*/
-EAPI int elm_softkey_panel_open(Evas_Object *obj) {
+EAPI int elm_softkey_panel_open(Evas_Object *obj)
+{
Widget_Data *wd;
wd = elm_widget_data_get(obj);
*
* @ingroup Softkey
*/
-EAPI int elm_softkey_panel_close(Evas_Object *obj) {
+EAPI int elm_softkey_panel_close(Evas_Object *obj)
+{
Widget_Data *wd;
wd = elm_widget_data_get(obj);
if (!wd)
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_item_icon_set(Elm_Softkey_Item *it, Evas_Object *icon) {
+EAPI void elm_softkey_item_icon_set(Elm_Softkey_Item *it, Evas_Object *icon)
+{
if (!it)
return;
edje_object_signal_emit(it->base, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(it->base);
_sizing_eval(it->obj);
- } else
+ }
+ else
it->icon = icon;
}
* @ingroup Softkey
*/
EAPI Evas_Object *
-elm_softkey_item_icon_get(Elm_Softkey_Item *it) {
+elm_softkey_item_icon_get(Elm_Softkey_Item *it)
+{
if (!it)
return NULL;
return it->icon;
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_item_label_set(Elm_Softkey_Item *it, const char *label) {
+EAPI void elm_softkey_item_label_set(Elm_Softkey_Item *it, const char *label)
+{
if (!it)
return;
if (it->label)
edje_object_signal_emit(it->base, "elm,state,text,visible", "elm");
/* set text */
- edje_object_part_text_set(it->base, "elm.text", label == NULL ? ""
- : label);
- } else {
+ edje_object_part_text_set(it->base, "elm.text", label == NULL ? "" : label);
+ }
+ else {
it->label = NULL;
edje_object_signal_emit(it->base, "elm,state,text,hidden", "elm");
}
*
* @ingroup Softkey
*/
-EAPI void elm_softkey_item_callback_set(Elm_Softkey_Item* item, void(*func)(
- void *data, Evas_Object *obj, void *event_info), const void *data) {
+EAPI void elm_softkey_item_callback_set(Elm_Softkey_Item* item, void(*func)(void *data, Evas_Object *obj, void *event_info), const void *data)
+{
if (!item)
return;
* @ingroup Softkey
*/
EAPI const char *
-elm_softkey_item_label_get(Elm_Softkey_Item *it) {
+elm_softkey_item_label_get(Elm_Softkey_Item *it)
+{
if (!it)
return NULL;
return it->label;
}
-EAPI Eina_Bool elm_softkey_item_disabled_get(Elm_Softkey_Item *it) {
+EAPI Eina_Bool elm_softkey_item_disabled_get(Elm_Softkey_Item *it)
+{
if (!it)
return EINA_FALSE;
return it->disabled;
}
-EAPI void elm_softkey_item_disabled_set(Elm_Softkey_Item *it,
- Eina_Bool disabled) {
+EAPI void elm_softkey_item_disabled_set(Elm_Softkey_Item *it, Eina_Bool disabled)
+{
if (!it)
return;
_item_disable(it, disabled);