_move_evas_object(void *data)
{
Evas_Object *bg_image;
- double t, vx, vy, vw, vh;
- int dx, dy, dw, dh;
- int px, py, pw, ph;
- int ox, oy, ow, oh;
- int x, y, w, h;
+ double t = 0.0, vx = 0.0, vy = 0.0, vw = 0.0, vh = 0.0;
+ int dx = 0 , dy = 0, dw = 0, dh = 0;
+ int px = 0, py = 0, pw = 0, ph = 0;
+ int ox = 0, oy = 0, ow = 0, oh = 0;
+ int x = 0, y = 0, w = 0, h = 0;
Animation_Data * ad = (Animation_Data *) data;
bg_image = edje_object_part_object_get(_EDJ(ad->obj), "bg_image");
vw = (double)pw / (double)ow;
vh = (double)ph / (double)oh;
- if (x == dx && y == dy && w == dw && h == dh)
+ if ((x == dx) && (y == dy) && (w == dw) && (h == dh))
{
if (ad->timer) ecore_animator_del(ad->timer);
ad->timer = NULL;
EINA_LIST_FOREACH(wd->items, l, item)
{
- if (item->order == order && item != it)
+ if ((item->order == order) && (item != it))
check = 1;
}
if (check)
Evas_Coord fx, fy, fw, fh, tx, ty, tw, th;
Evas_Object *from, *to;
- if (fit->order <= 0 && wd->auto_align)
+ if ((fit->order <= 0) && (wd->auto_align))
fit = wd->more_item;
from = (Evas_Object *) edje_object_part_object_get(_EDJ(fit->base), "bg_img");
}
it->selected = EINA_TRUE;
- if (fit != NULL && fit != it)
+ if ((fit != NULL) && (fit != it))
{
_move_selected_box(wd, fit, it);
}
if (_check_item(wd, wd->pre_item))
{
evas_object_geometry_get(wd->pre_item->base, &x, &y, &w, &h);
- if (ev->output.x > x && ev->output.x < x+w && ev->output.y > y && ev->output.y < y+h)
+ if ((ev->output.x > x) && (ev->output.x < x+w) && (ev->output.y > y) && (ev->output.y < y+h))
{
_select_box(wd->pre_item);
}
EINA_LIST_FOREACH(wd->items, l, item)
{
- if (item == mit && item->order > 0)
+ if ((item == mit) && (item->order > 0))
{
check = EINA_TRUE;
it->order = mit->order;
elm_layout_content_set(wd->view, "elm.swallow.view", item->view);
}
- if (item->style == TOOLBAR && item->func)
+ if ((item->style == TOOLBAR) && (item->func))
item->func(item->data, item->obj, item);
}
Elm_Controlbar_Item *it;
const Eina_List *l;
Evas_Object *ctxpopup = obj;
+ char * label;
Widget_Data *wd = (Widget_Data *)data;
EINA_LIST_FOREACH(wd->items, l, it)
- if (!strcmp(it->text, elm_ctxpopup_item_label_get((Elm_Ctxpopup_Item *) event_info))) break;
+ {
+ label = elm_ctxpopup_item_label_get((Elm_Ctxpopup_Item *) event_info);
+ if ((label) && (!strcmp(it->text, label))) break;
+ }
if (it->func)
it->func(it->data, it->obj, it);
Evas_Object * bg = NULL;
Widget_Data * wd = NULL;
Evas_Coord x, y, w, h;
- wd = ELM_NEW(Widget_Data);
- Evas *evas = evas_object_evas_get(parent);
- if (evas == NULL) return NULL;
- obj = elm_widget_add(evas);
- if (obj == NULL) return NULL;
+ Evas *e;
+ ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "controlbar");
elm_widget_type_set(obj, "controlbar");
elm_widget_sub_object_add(parent, obj);
it = _create_tab_item(obj, icon_path, label, view);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item) {
lit = elm_controlbar_last_item_get(obj);
_set_item_visible(lit, EINA_FALSE);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
item = eina_list_data_get(wd->items);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item) {
lit = elm_controlbar_last_item_get(obj);
_set_item_visible(lit, EINA_FALSE);
it = _create_tab_item(obj, icon_path, label, view);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item)
{
lit = elm_controlbar_last_item_get(obj);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
item = elm_controlbar_item_next(after);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item)
{
lit = elm_controlbar_last_item_get(obj);
_create_more_item(wd, TABBAR);
}
lit = elm_controlbar_item_prev(wd->more_item);
- if (lit != after && item->order > 0)
+ if ((lit != after) && (item->order > 0))
{
_set_item_visible(lit, EINA_FALSE);
_set_items_position(obj, it, item, EINA_TRUE);
it = _create_tool_item(obj, icon_path, label, func, data);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item) {
lit = elm_controlbar_last_item_get(obj);
_set_item_visible(lit, EINA_FALSE);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
item = eina_list_data_get(wd->items);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item) {
lit = elm_controlbar_last_item_get(obj);
_set_item_visible(lit, EINA_FALSE);
it = _create_tool_item(obj, icon_path, label, func, data);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item)
{
lit = elm_controlbar_last_item_get(obj);
if (!it) return NULL;
wd = elm_widget_data_get(obj);
item = elm_controlbar_item_next(after);
- if (_check_bar_item_number(wd) >= 5 && wd->auto_align){
+ if ((_check_bar_item_number(wd) >= 5) && (wd->auto_align))
+ {
if (!wd->more_item)
{
lit = elm_controlbar_last_item_get(obj);
_create_more_item(wd, TOOLBAR);
}
lit = elm_controlbar_item_prev(wd->more_item);
- if (lit != after && item->order > 0)
+ if ((lit != after) && (item->order > 0))
{
_set_item_visible(lit, EINA_FALSE);
_set_items_position(obj, it, item, EINA_TRUE);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data * wd;
Elm_Controlbar_Item * it;
- it = _create_object_item(obj, obj_item, sel);
- if (!it) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
+ it = _create_object_item(obj, obj_item, sel);
+ if (!it) return NULL;
_set_items_position(obj, it, NULL, EINA_TRUE);
wd->items = eina_list_append(wd->items, it);
_sizing_eval(obj);
Widget_Data * wd;
Elm_Controlbar_Item * it;
Elm_Controlbar_Item * item;
- it = _create_object_item(obj, obj_item, sel);
- if (!it) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
+ it = _create_object_item(obj, obj_item, sel);
+ if (!it) return NULL;
item = eina_list_data_get(wd->items);
_set_items_position(obj, it, item, EINA_TRUE);
wd->items = eina_list_prepend(wd->items, it);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data * wd;
Elm_Controlbar_Item * it;
+ wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
if (!before) return NULL;
it = _create_object_item(obj, obj_item, sel);
if (!it) return NULL;
- wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
_set_items_position(obj, it, before, EINA_TRUE);
wd->items = eina_list_prepend_relative(wd->items, it, before);
_sizing_eval(obj);
Widget_Data * wd;
Elm_Controlbar_Item * it;
Elm_Controlbar_Item * item;
+ wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
if (!after) return NULL;
it = _create_object_item(obj, obj_item, sel);
if (!it) return NULL;
- wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
item = elm_controlbar_item_next(after);
_set_items_position(obj, it, item, EINA_TRUE);
wd->items = eina_list_append_relative(wd->items, it, after);
EAPI void
elm_controlbar_item_del(Elm_Controlbar_Item * it)
{
- if (!it) return;
Evas_Object * obj;
Widget_Data * wd;
const Eina_List *l;
Elm_Controlbar_Item * item;
- int check = 0;
-
- // int i = 1;
int sel = 1;
elm_table_pack(wd->box, item->base, 0, item->order - 1, item->sel, 1);
}
}
- if (it == item)
- check = 1;
}
}
it->disabled = disabled;
- if (it->wd && it->wd->disabled) return;
+ if ((it->wd) && (it->wd->disabled)) return;
if (it->base_item) elm_widget_disabled_set(it->base_item, disabled);
}
if (auto_align)
{
- if (_check_bar_item_number(wd) >= 5 && !wd->more_item)
+ if ((_check_bar_item_number(wd)) >= 5 && (!wd->more_item))
{
i = 0;
EINA_LIST_FOREACH(wd->items, l, item)