elementary / calendar, button, colorselector, bg, cnp_helper, bubble, check, box, clock - removed white spaces

SVN revision: 58253
This commit is contained in:
ChunEon Park 2011-04-01 11:35:07 +00:00
parent b880342a74
commit 0369dbff50
9 changed files with 1010 additions and 1010 deletions

View File

@ -49,7 +49,7 @@ _theme_hook(Evas_Object *obj)
if (wd->overlay)
edje_object_part_swallow(wd->base, "elm.swallow.content", wd->overlay);
// FIXME: if i don't do this, bg doesnt calc correctly. why?
// FIXME: if i don't do this, bg doesnt calc correctly. why?
evas_object_geometry_get(wd->base, NULL, NULL, &w, &h);
evas_object_resize(wd->base, w, h);
}
@ -83,33 +83,33 @@ _custom_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
switch (wd->option)
{
case ELM_BG_OPTION_CENTER:
fw = nw = iw;
fh = nh = ih;
nx = ((bw - fw) / 2);
ny = ((bh - fh) / 2);
mw = iw;
mh = ih;
break;
fw = nw = iw;
fh = nh = ih;
nx = ((bw - fw) / 2);
ny = ((bh - fh) / 2);
mw = iw;
mh = ih;
break;
case ELM_BG_OPTION_SCALE:
fw = bw;
fh = ((ih * fw) / iw);
if (fh < bh)
{
fh = bh;
fw = ((iw * fh) / ih);
}
fx = ((bw - fw) / 2);
fy = ((bh - fh) / 2);
break;
fw = bw;
fh = ((ih * fw) / iw);
if (fh < bh)
{
fh = bh;
fw = ((iw * fh) / ih);
}
fx = ((bw - fw) / 2);
fy = ((bh - fh) / 2);
break;
case ELM_BG_OPTION_TILE:
fw = iw;
fh = ih;
break;
fw = iw;
fh = ih;
break;
case ELM_BG_OPTION_STRETCH:
default:
fw = bw;
fh = bh;
break;
fw = bw;
fh = bh;
break;
}
evas_object_move(wd->img, nx, ny);
@ -136,7 +136,7 @@ elm_bg_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "bg");
elm_widget_type_set(obj, "bg");
elm_widget_sub_object_add(parent, obj);
@ -203,7 +203,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
{
wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
if ((wd->load_opts.w > 0) && (wd->load_opts.h > 0))
evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
evas_object_image_file_set(wd->img, file, group);
}
evas_object_repeat_events_set(wd->img, EINA_TRUE);
@ -340,8 +340,8 @@ elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay)
if (!wd) return;
if (wd->overlay)
{
evas_object_del(wd->overlay);
wd->overlay = NULL;
evas_object_del(wd->overlay);
wd->overlay = NULL;
}
if (overlay)
{
@ -419,6 +419,6 @@ elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
wd->load_opts.h = h;
if (!wd->img) return;
if (!(((p = strrchr(wd->file, '.'))) && (!strcasecmp(p, ".edj"))))
evas_object_image_load_size_set(wd->img, w, h);
evas_object_image_load_size_set(wd->img, w, h);
}

View File

@ -40,11 +40,11 @@ struct _Elm_Box_Transition
Ecore_Animator *animator;
struct
{
Evas_Object_Box_Layout layout;
void *data;
void(*free_data)(void *data);
} start, end;
{
Evas_Object_Box_Layout layout;
void *data;
void(*free_data)(void *data);
} start, end;
void(*transition_end_cb)(void *data);
void *transition_end_data;
@ -57,9 +57,9 @@ struct _Transition_Animation_Data
{
Evas_Object *obj;
struct
{
Evas_Coord x, y, w, h;
} start, end;
{
Evas_Coord x, y, w, h;
} start, end;
};
static const char *widtype = NULL;
@ -71,11 +71,11 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info);
static void
_del_pre_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
evas_object_event_callback_del_full
(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
evas_object_box_remove_all(wd->box, 0);
evas_object_event_callback_del_full
(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
evas_object_box_remove_all(wd->box, 0);
}
static void
@ -166,7 +166,7 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_els_box_layout(o, priv, wd->horizontal, wd->homogeneous,
elm_widget_mirrored_get(obj));
elm_widget_mirrored_get(obj));
}
static Eina_Bool
@ -226,7 +226,7 @@ _transition_layout_calculate_coords(Evas_Object *obj, Evas_Object_Box_Data *priv
const double curtime = ecore_loop_time_get();
layout_data->duration =
layout_data->duration - (curtime - layout_data->initial_time);
layout_data->duration - (curtime - layout_data->initial_time);
layout_data->initial_time = curtime;
evas_object_geometry_get(obj, &x, &y, &w, &h);
@ -256,7 +256,7 @@ _transition_layout_load_children_list(Evas_Object_Box_Data *priv,
Transition_Animation_Data *tad;
EINA_LIST_FREE(layout_data->objs, tad)
free(tad);
free(tad);
EINA_LIST_FOREACH(priv->children, l, opt)
{
@ -264,7 +264,7 @@ _transition_layout_load_children_list(Evas_Object_Box_Data *priv,
if (!tad)
{
EINA_LIST_FREE(layout_data->objs, tad)
free(tad);
free(tad);
layout_data->objs = NULL;
return EINA_FALSE;
}
@ -283,7 +283,7 @@ _transition_layout_animation_start(Evas_Object *obj, Evas_Object_Box_Data *priv,
layout_data->initial_time = ecore_loop_time_get();
if (!_transition_layout_load_children_list(priv, layout_data))
return EINA_FALSE;
return EINA_FALSE;
_transition_layout_calculate_coords(obj, priv, layout_data);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
@ -293,7 +293,7 @@ _transition_layout_animation_start(Evas_Object *obj, Evas_Object_Box_Data *priv,
evas_object_smart_callback_add(obj, SIG_CHILD_REMOVED,
_transition_layout_child_removed, layout_data);
if (!layout_data->animator)
layout_data->animator = ecore_animator_add(transition_animation_cb, obj);
layout_data->animator = ecore_animator_add(transition_animation_cb, obj);
layout_data->animation_ended = EINA_FALSE;
return EINA_TRUE;
}
@ -309,7 +309,7 @@ _transition_layout_animation_stop(Elm_Box_Transition *layout_data)
}
if (layout_data->transition_end_cb)
layout_data->transition_end_cb(layout_data->transition_end_data);
layout_data->transition_end_cb(layout_data->transition_end_data);
}
static void
@ -352,7 +352,7 @@ elm_box_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "box");
elm_widget_type_set(obj, "box");
elm_widget_sub_object_add(parent, obj);
@ -366,11 +366,11 @@ elm_box_add(Evas_Object *parent)
wd->box = evas_object_box_add(e);
/*evas_object_box_layout_set(wd->box, evas_object_box_layout_vertical,
NULL, NULL);*/
NULL, NULL);*/
evas_object_box_layout_set(wd->box, _layout, obj, NULL);
evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
_changed_size_hints, obj);
elm_widget_resize_object_set(obj, wd->box);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
@ -400,21 +400,21 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
evas_object_smart_calculate(wd->box);
/*if (wd->horizontal)
{
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
}
else
else
{
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_vertical, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_vertical, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
}*/
}
@ -456,21 +456,21 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous)
evas_object_smart_calculate(wd->box);
/*if (wd->horizontal)
{
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
}
else
else
{
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_vertical, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
if (wd->homogeneous)
evas_object_box_layout_set(wd->box,
evas_object_box_layout_homogeneous_vertical, NULL, NULL);
else
evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
NULL, NULL);
}*/
}
@ -703,15 +703,15 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
if (box_data->animation_ended)
{
box_data->end.layout(obj, priv, box_data->end.data);
return;
box_data->end.layout(obj, priv, box_data->end.data);
return;
}
if (!box_data->animator)
{
if (!_transition_layout_animation_start(obj, priv, box_data,
_transition_animation))
return;
_transition_animation))
return;
}
else
{
@ -723,9 +723,9 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
}
if ((curtime >= box_data->duration + box_data->initial_time))
_transition_layout_animation_stop(box_data);
_transition_layout_animation_stop(box_data);
else
_transition_layout_animation_exec(obj, priv, box_data, curtime);
_transition_layout_animation_exec(obj, priv, box_data, curtime);
}
/**
@ -751,12 +751,12 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
*/
EAPI Elm_Box_Transition *
elm_box_transition_new(const double duration,
Evas_Object_Box_Layout start_layout, void *start_layout_data,
void(*start_layout_free_data)(void *data),
Evas_Object_Box_Layout end_layout, void *end_layout_data,
void(*end_layout_free_data)(void *data),
void(*transition_end_cb)(void *data),
void *transition_end_data)
Evas_Object_Box_Layout start_layout, void *start_layout_data,
void(*start_layout_free_data)(void *data),
Evas_Object_Box_Layout end_layout, void *end_layout_data,
void(*end_layout_free_data)(void *data),
void(*transition_end_cb)(void *data),
void *transition_end_data)
{
Elm_Box_Transition *box_data;
@ -765,7 +765,7 @@ elm_box_transition_new(const double duration,
box_data = calloc(1, sizeof(Elm_Box_Transition));
if (!box_data)
return NULL;
return NULL;
box_data->start.layout = start_layout;
box_data->start.data = start_layout_data;
@ -797,9 +797,9 @@ elm_box_transition_free(void *data)
Transition_Animation_Data *tad;
Elm_Box_Transition *box_data = data;
if ((box_data->start.free_data) && (box_data->start.data))
box_data->start.free_data(box_data->start.data);
box_data->start.free_data(box_data->start.data);
if ((box_data->end.free_data) && (box_data->end.data))
box_data->end.free_data(box_data->end.data);
box_data->end.free_data(box_data->end.data);
EINA_LIST_FREE(box_data->objs, tad)
free(tad);
evas_object_event_callback_del(box_data->box, EVAS_CALLBACK_RESIZE, _transition_layout_obj_resize_cb);

View File

@ -32,8 +32,8 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info);
#define SIG_CLICKED "clicked"
static const Evas_Smart_Cb_Description _signals[] =
{
{SIG_CLICKED, ""},
{NULL, NULL}
{SIG_CLICKED, ""},
{NULL, NULL}
};
static void
@ -73,7 +73,7 @@ _theme_hook(Evas_Object *obj)
if (wd->content)
{
edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content);
edje_object_message_signal_process(wd->bbl);
edje_object_message_signal_process(wd->bbl);
}
if (wd->icon)
edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
@ -126,13 +126,13 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
Evas_Object *sub = event_info;
if (!wd) return;
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
_changed_size_hints, obj);
if (sub == wd->content) wd->content = NULL;
else if (sub == wd->icon)
{
edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm");
wd->icon = NULL;
edje_object_message_signal_process(wd->bbl);
edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm");
wd->icon = NULL;
edje_object_message_signal_process(wd->bbl);
}
_sizing_eval(obj);
}
@ -164,7 +164,7 @@ elm_bubble_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "bubble");
elm_widget_type_set(obj, "bubble");
elm_widget_sub_object_add(parent, obj);
@ -310,10 +310,10 @@ elm_bubble_content_set(Evas_Object *obj, Evas_Object *content)
wd->content = content;
if (content)
{
elm_widget_sub_object_add(obj, content);
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
elm_widget_sub_object_add(obj, content);
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
}
_sizing_eval(obj);
}
@ -385,12 +385,12 @@ elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon)
wd->icon = icon;
if (icon)
{
elm_widget_sub_object_add(obj, icon);
edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->bbl);
elm_widget_sub_object_add(obj, icon);
edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->bbl);
}
_sizing_eval(obj);
}

View File

@ -307,7 +307,7 @@ elm_button_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "button");
elm_widget_type_set(obj, "button");
elm_widget_sub_object_add(parent, obj);

View File

@ -27,9 +27,9 @@
typedef enum _Day_Color // EINA_DEPRECATED
{
DAY_WEEKDAY = 0,
DAY_SATURDAY = 1,
DAY_SUNDAY = 2
DAY_WEEKDAY = 0,
DAY_SATURDAY = 1,
DAY_SUNDAY = 2
} Day_Color;
typedef struct _Widget_Data Widget_Data;
@ -72,8 +72,8 @@ static const char *_days_abbrev[] =
static int _days_in_month[2][12] =
{
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
static Elm_Calendar_Mark *
@ -119,10 +119,10 @@ _maxdays_get(struct tm *time)
month = time->tm_mon;
year = time->tm_year + 1900;
return _days_in_month[((!(year % 4)) &&
((!(year % 400)) ||
(year % 100)))]
[month];
return _days_in_month[((!(year % 4)) &&
((!(year % 400)) ||
(year % 100)))]
[month];
}
static inline void
@ -186,22 +186,22 @@ static void
_text_day_color_update(Widget_Data *wd, int pos)
{
char emission[32];
switch (wd->day_color[pos])
{
case DAY_WEEKDAY:
snprintf(emission, sizeof(emission), "cit_%i,weekday", pos);
break;
case DAY_SATURDAY:
snprintf(emission, sizeof(emission), "cit_%i,saturday", pos);
break;
case DAY_SUNDAY:
snprintf(emission, sizeof(emission), "cit_%i,sunday", pos);
break;
default:
return;
}
{
case DAY_WEEKDAY:
snprintf(emission, sizeof(emission), "cit_%i,weekday", pos);
break;
case DAY_SATURDAY:
snprintf(emission, sizeof(emission), "cit_%i,saturday", pos);
break;
case DAY_SUNDAY:
snprintf(emission, sizeof(emission), "cit_%i,sunday", pos);
break;
default:
return;
}
edje_object_signal_emit(wd->calendar, emission, "elm");
}
@ -239,8 +239,8 @@ _populate(Evas_Object *obj)
buf = wd->format_func(&wd->selected_time);
if (buf)
{
edje_object_part_text_set(wd->calendar, "month_text", buf);
free(buf);
edje_object_part_text_set(wd->calendar, "month_text", buf);
free(buf);
}
else
edje_object_part_text_set(wd->calendar, "month_text", "");
@ -253,129 +253,129 @@ _populate(Evas_Object *obj)
// Layout of the calendar is changed for removing the unfilled last row.
wd->first_day_it = first_day.tm_wday;
if ((35 - wd->first_day_it) > (maxdays - 1)) last_row = EINA_FALSE;
if (!last_row)
{
char emission[32];
for (i = 0; i < 5; i++)
{
snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5);
edje_object_signal_emit(wd->calendar, emission, "elm");
for (i = 0; i < 35; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
for (i = 35; i < 42; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
}
else
{
char emission[32];
for (i = 0; i < 6; i++)
{
snprintf(emission, sizeof(emission), "cseph_%i,row_show", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
for (i = 0; i < 42; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_default", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
}
if ((35 - wd->first_day_it) > (maxdays - 1)) last_row = EINA_FALSE;
if (!last_row)
{
char emission[32];
for (i = 0; i < 5; i++)
{
snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5);
edje_object_signal_emit(wd->calendar, emission, "elm");
for (i = 0; i < 35; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
for (i = 35; i < 42; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
}
else
{
char emission[32];
for (i = 0; i < 6; i++)
{
snprintf(emission, sizeof(emission), "cseph_%i,row_show", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
for (i = 0; i < 42; i++)
{
snprintf(emission, sizeof(emission), "cit_%i,cell_default", i);
edje_object_signal_emit(wd->calendar, emission, "elm");
}
}
for (i = 0; i < 42; i++)
{
_text_day_color_update(wd, i); // EINA_DEPRECATED
if ((!day) && (i == first_day.tm_wday)) day = 1;
if ((!day) && (i == first_day.tm_wday)) day = 1;
if ((day == wd->current_time.tm_mday)
&& (mon == wd->current_time.tm_mon)
&& (year == wd->current_time.tm_year))
_today(wd, i);
if ((day == wd->current_time.tm_mday)
&& (mon == wd->current_time.tm_mon)
&& (year == wd->current_time.tm_year))
_today(wd, i);
if (day == wd->selected_time.tm_mday)
{
if ((wd->selected_it > -1) && (wd->selected_it != i))
_unselect(wd, wd->selected_it);
if (day == wd->selected_time.tm_mday)
{
if ((wd->selected_it > -1) && (wd->selected_it != i))
_unselect(wd, wd->selected_it);
if (wd->selection_enabled) _select(wd, i);
if (wd->selection_enabled) _select(wd, i);
wd->selected_it = i;
}
wd->selected_it = i;
}
if ((day) && (day <= maxdays))
snprintf(day_s, sizeof(day_s), "%i", day++);
else
if ((day) && (day <= maxdays))
snprintf(day_s, sizeof(day_s), "%i", day++);
else
day_s[0] = 0;
snprintf(part, sizeof(part), "cit_%i.text", i);
edje_object_part_text_set(wd->calendar, part, day_s);
/* Clear previous marks */
_cit_mark(wd->calendar, i, "clear");
snprintf(part, sizeof(part), "cit_%i.text", i);
edje_object_part_text_set(wd->calendar, part, day_s);
/* Clear previous marks */
_cit_mark(wd->calendar, i, "clear");
}
/* Set marks */
EINA_LIST_FOREACH(wd->marks, l, mark)
{
struct tm *mtime = &mark->mark_time;
int mon = wd->selected_time.tm_mon;
int year = wd->selected_time.tm_year;
int mday_it = mtime->tm_mday + wd->first_day_it - 1;
struct tm *mtime = &mark->mark_time;
int mon = wd->selected_time.tm_mon;
int year = wd->selected_time.tm_year;
int mday_it = mtime->tm_mday + wd->first_day_it - 1;
switch (mark->repeat)
{
case ELM_CALENDAR_UNIQUE:
if ((mtime->tm_mon == mon) && (mtime->tm_year == year))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_DAILY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
day = mtime->tm_mday;
else
break;
for (; day <= maxdays; day++)
_cit_mark(wd->calendar, day + wd->first_day_it - 1,
mark->mark_type);
break;
case ELM_CALENDAR_WEEKLY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
day = mtime->tm_mday;
else
break;
for (; day <= maxdays; day++)
if (mtime->tm_wday == _weekday_get(wd->first_day_it, day))
_cit_mark(wd->calendar, day + wd->first_day_it - 1,
mark->mark_type);
break;
case ELM_CALENDAR_MONTHLY:
if (((mtime->tm_year < year) ||
((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_ANNUALLY:
if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
}
switch (mark->repeat)
{
case ELM_CALENDAR_UNIQUE:
if ((mtime->tm_mon == mon) && (mtime->tm_year == year))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_DAILY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
day = mtime->tm_mday;
else
break;
for (; day <= maxdays; day++)
_cit_mark(wd->calendar, day + wd->first_day_it - 1,
mark->mark_type);
break;
case ELM_CALENDAR_WEEKLY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
day = mtime->tm_mday;
else
break;
for (; day <= maxdays; day++)
if (mtime->tm_wday == _weekday_get(wd->first_day_it, day))
_cit_mark(wd->calendar, day + wd->first_day_it - 1,
mark->mark_type);
break;
case ELM_CALENDAR_MONTHLY:
if (((mtime->tm_year < year) ||
((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_ANNUALLY:
if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
}
}
}
@ -389,8 +389,8 @@ _set_headers(Evas_Object *obj)
for (i = 0; i < 7; i++)
{
part[3] = i + '0';
edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]);
part[3] = i + '0';
edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]);
}
}
@ -408,10 +408,10 @@ _del_hook(Evas_Object *obj)
if (wd->marks)
{
EINA_LIST_FREE(wd->marks, mark)
{
_mark_free(mark);
}
EINA_LIST_FREE(wd->marks, mark)
{
_mark_free(mark);
}
}
for (i = 0; i < 7; i++)
@ -427,13 +427,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
if (!wd) return;
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit(wd->calendar, "elm,action,focus", "elm");
evas_object_focus_set(wd->calendar, EINA_TRUE);
edje_object_signal_emit(wd->calendar, "elm,action,focus", "elm");
evas_object_focus_set(wd->calendar, EINA_TRUE);
}
else
{
edje_object_signal_emit(wd->calendar, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->calendar, EINA_FALSE);
edje_object_signal_emit(wd->calendar, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->calendar, EINA_FALSE);
}
}
@ -512,23 +512,23 @@ _update_month(Evas_Object *obj, int delta)
wd->selected_time.tm_mon += delta;
if (wd->selected_time.tm_mon < 0)
{
if (wd->selected_time.tm_year == wd->year_min)
{
wd->selected_time.tm_mon++;
return EINA_FALSE;
}
wd->selected_time.tm_mon = 11;
wd->selected_time.tm_year--;
if (wd->selected_time.tm_year == wd->year_min)
{
wd->selected_time.tm_mon++;
return EINA_FALSE;
}
wd->selected_time.tm_mon = 11;
wd->selected_time.tm_year--;
}
else if (wd->selected_time.tm_mon > 11)
{
if (wd->selected_time.tm_year == wd->year_max)
{
wd->selected_time.tm_mon--;
return EINA_FALSE;
}
wd->selected_time.tm_mon = 0;
wd->selected_time.tm_year++;
if (wd->selected_time.tm_year == wd->year_max)
{
wd->selected_time.tm_mon--;
return EINA_FALSE;
}
wd->selected_time.tm_mon = 0;
wd->selected_time.tm_year++;
}
maxdays = _maxdays_get(&wd->selected_time);
@ -606,7 +606,7 @@ _update_sel_it(Evas_Object *obj, int sel_it)
int day;
Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->selection_enabled))
return;
return;
day = _get_item_day(obj, sel_it);
if (!day)
@ -627,7 +627,7 @@ _day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
int sel_it;
Widget_Data *wd = elm_widget_data_get(data);
if ((!wd) || (!wd->selection_enabled))
return;
return;
sel_it = atoi(source);
_update_sel_it(data, sel_it);
@ -636,7 +636,7 @@ _day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
static inline int
_time_to_next_day(struct tm *t)
{
return ((((24 - t->tm_hour) * 60) - t->tm_min) * 60) - t->tm_sec;
return ((((24 - t->tm_hour) * 60) - t->tm_min) * 60) - t->tm_sec;
}
static Eina_Bool
@ -655,7 +655,7 @@ _update_cur_date(void *data)
ecore_timer_interval_set(wd->update_timer, t);
if ((wd->current_time.tm_mon != wd->selected_time.tm_mon) ||
(wd->current_time.tm_year!= wd->selected_time.tm_year))
(wd->current_time.tm_year!= wd->selected_time.tm_year))
return ECORE_CALLBACK_RENEW;
day = wd->current_time.tm_mday + wd->first_day_it - 1;
@ -729,7 +729,7 @@ elm_calendar_add(Evas_Object *parent)
Evas *e;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "calendar");
elm_widget_type_set(obj, "calendar");
elm_widget_sub_object_add(parent, obj);
@ -781,7 +781,7 @@ elm_calendar_add(Evas_Object *parent)
/* If we failed getting day, get a default value */
wd->weekdays[i] = _days_abbrev[i];
WRN("Failed getting weekday name for '%s' from locale.",
_days_abbrev[i]);
_days_abbrev[i]);
}
weekday += 86400; /* Advance by a day */
}
@ -1228,14 +1228,14 @@ elm_calendar_marks_draw(Evas_Object *obj)
/**
* Set a text color to the saturday color.
*
*
* Deprecated. use elm_calendar_mark_add() instead like:
*
*
* @code
* struct tm t = { 0, 0, 12, 6, 0, 0, 5, 5, -1 };
* elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
* @endcode
*
*
* @param obj The calendar object
* @param pos The text position
*
@ -1244,22 +1244,22 @@ elm_calendar_marks_draw(Evas_Object *obj)
EINA_DEPRECATED EAPI void
elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_SATURDAY, pos);
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_SATURDAY, pos);
}
/**
* Set a text color to the sunday color.
*
* Deprecated. use elm_calendar_mark_add() instead like:
*
*
* @code
* struct tm t = { 0, 0, 12, 7, 0, 0, 6, 6, -1 };
* elm_calendar_mark_add(obj, "sun", &t, ELM_CALENDAR_WEEKLY);
* @endcode
*
*
* @param obj The calendar object
* @param pos The text position
*
@ -1268,20 +1268,20 @@ elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos)
EINA_DEPRECATED EAPI void
elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_SUNDAY, pos);
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_SUNDAY, pos);
}
/**
* Set a text color to the weekday color.
*
* Deprecated. use elm_calendar_mark_add() instead like:
*
*
* @code
* struct tm t = { 0, 0, 12, 1, 0, 0, 0, 0, -1 };
*
*
* elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // monday
* t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
* elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // tuesday
@ -1292,7 +1292,7 @@ elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
* t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
* elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // friday
* @endcode
*
*
* @param obj The calendar object
* @param pos The text position
*
@ -1301,8 +1301,8 @@ elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
EINA_DEPRECATED EAPI void
elm_calendar_text_weekday_color_set(Evas_Object *obj, int pos)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_WEEKDAY, pos);
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_text_day_color_set(wd, DAY_WEEKDAY, pos);
}

View File

@ -48,8 +48,8 @@ static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_CHANGED, ""},
{NULL, NULL}
{SIG_CHANGED, ""},
{NULL, NULL}
};
static Eina_Bool
@ -85,13 +85,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
if (!wd) return;
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit(wd->chk, "elm,action,focus", "elm");
evas_object_focus_set(wd->chk, EINA_TRUE);
edje_object_signal_emit(wd->chk, "elm,action,focus", "elm");
evas_object_focus_set(wd->chk, EINA_TRUE);
}
else
{
edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->chk, EINA_FALSE);
edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->chk, EINA_FALSE);
}
}
@ -112,20 +112,20 @@ _theme_hook(Evas_Object *obj)
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->chk, "check", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
if (wd->state)
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
if (wd->label)
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
edje_object_part_text_set(wd->chk, "elm.text", wd->label);
if (elm_widget_disabled_get(obj))
edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
edje_object_message_signal_process(wd->chk);
edje_object_scale_set(wd->chk, elm_widget_scale_get(obj) * _elm_config->scale);
_sizing_eval(obj);
@ -137,9 +137,9 @@ _disable_hook(Evas_Object *obj)
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (elm_widget_disabled_get(obj))
edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm");
edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm");
}
static void
@ -174,12 +174,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
if (!wd) return;
if (sub == wd->icon)
{
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
wd->icon = NULL;
_sizing_eval(obj);
edje_object_message_signal_process(wd->chk);
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
wd->icon = NULL;
_sizing_eval(obj);
edje_object_message_signal_process(wd->chk);
}
}
@ -247,7 +247,7 @@ elm_check_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "check");
elm_widget_type_set(obj, "check");
elm_widget_sub_object_add(parent, obj);
@ -345,12 +345,12 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon)
wd->icon = icon;
if (icon)
{
elm_widget_sub_object_add(obj, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->chk, "elm.swallow.content", icon);
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->chk);
elm_widget_sub_object_add(obj, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->chk, "elm.swallow.content", icon);
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->chk);
}
_sizing_eval(obj);
}
@ -415,12 +415,12 @@ elm_check_state_set(Evas_Object *obj, Eina_Bool state)
if (!wd) return;
if (state != wd->state)
{
wd->state = state;
if (wd->statep) *wd->statep = wd->state;
if (wd->state)
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
wd->state = state;
if (wd->statep) *wd->statep = wd->state;
if (wd->state)
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
}
}
@ -464,15 +464,15 @@ elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
if (!wd) return;
if (statep)
{
wd->statep = statep;
if (*wd->statep != wd->state)
{
wd->state = *wd->statep;
if (wd->state)
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
}
wd->statep = statep;
if (*wd->statep != wd->state)
{
wd->state = *wd->statep;
if (wd->state)
edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
else
edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
}
}
else
wd->statep = NULL;

View File

@ -31,7 +31,7 @@ struct _Widget_Data
Eina_Bool seconds : 1;
Eina_Bool am_pm : 1;
Eina_Bool edit : 1;
Elm_Clock_Digedit digedit;
Elm_Clock_Digedit digedit;
} cur;
};
@ -52,7 +52,7 @@ _del_hook(Evas_Object *obj)
int i;
for (i = 0; i < 6; i++)
{
if (wd->digit[i]) evas_object_del(wd->digit[i]);
if (wd->digit[i]) evas_object_del(wd->digit[i]);
}
if (wd->ampm) evas_object_del(wd->ampm);
if (wd->ticker) ecore_timer_del(wd->ticker);
@ -80,13 +80,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
if (!wd) return;
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit(wd->clk, "elm,action,focus", "elm");
evas_object_focus_set(wd->clk, EINA_TRUE);
edje_object_signal_emit(wd->clk, "elm,action,focus", "elm");
evas_object_focus_set(wd->clk, EINA_TRUE);
}
else
{
edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->clk, EINA_FALSE);
edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->clk, EINA_FALSE);
}
}
@ -99,8 +99,8 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
edje_object_signal_emit(wd->clk, emission, source);
for (i = 0; i < 6; i++)
{
if (wd->digit[i])
edje_object_signal_emit(wd->digit[i], emission, source);
if (wd->digit[i])
edje_object_signal_emit(wd->digit[i], emission, source);
}
}
@ -113,9 +113,9 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so
edje_object_signal_callback_add(wd->clk, emission, source, func_cb, data);
for (i = 0; i < 6; i++)
{
if (wd->digit[i])
edje_object_signal_callback_add(wd->digit[i], emission, source,
func_cb, data);
if (wd->digit[i])
edje_object_signal_callback_add(wd->digit[i], emission, source,
func_cb, data);
}
}
@ -126,7 +126,7 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
int i;
for (i = 0; i < 6; i++)
{
edje_object_signal_callback_del_full(wd->digit[i], emission, source,
edje_object_signal_callback_del_full(wd->digit[i], emission, source,
func_cb, data);
}
edje_object_signal_callback_del_full(wd->clk, emission, source, func_cb,
@ -144,7 +144,7 @@ _timediff_set(Widget_Data *wd)
tzset();
tm = localtime(&tt);
wd->timediff = (((wd->hrs - tm->tm_hour) * 60 +
wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec;
wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec;
}
static Eina_Bool
@ -161,16 +161,16 @@ _ticker(void *data)
wd->ticker = ecore_timer_add(t, _ticker, data);
if (!wd->edit)
{
tt = (time_t)(timev.tv_sec) + wd->timediff;
tzset();
tm = localtime(&tt);
if (tm)
{
wd->hrs = tm->tm_hour;
wd->min = tm->tm_min;
wd->sec = tm->tm_sec;
_time_update(data);
}
tt = (time_t)(timev.tv_sec) + wd->timediff;
tzset();
tm = localtime(&tt);
if (tm)
{
wd->hrs = tm->tm_hour;
wd->min = tm->tm_min;
wd->sec = tm->tm_sec;
_time_update(data);
}
}
return ECORE_CALLBACK_CANCEL;
}
@ -184,38 +184,38 @@ _signal_clock_val_up(void *data)
if (!wd->sel_obj) goto clock_val_up_cancel;
if (wd->sel_obj == wd->digit[0])
{
wd->hrs = wd->hrs + 10;
if (wd->hrs >= 24) wd->hrs -= 24;
wd->hrs = wd->hrs + 10;
if (wd->hrs >= 24) wd->hrs -= 24;
}
if (wd->sel_obj == wd->digit[1])
{
wd->hrs = wd->hrs + 1;
if (wd->hrs >= 24) wd->hrs -= 24;
wd->hrs = wd->hrs + 1;
if (wd->hrs >= 24) wd->hrs -= 24;
}
if (wd->sel_obj == wd->digit[2])
{
wd->min = wd->min + 10;
if (wd->min >= 60) wd->min -= 60;
wd->min = wd->min + 10;
if (wd->min >= 60) wd->min -= 60;
}
if (wd->sel_obj == wd->digit[3])
{
wd->min = wd->min + 1;
if (wd->min >= 60) wd->min -= 60;
wd->min = wd->min + 1;
if (wd->min >= 60) wd->min -= 60;
}
if (wd->sel_obj == wd->digit[4])
{
wd->sec = wd->sec + 10;
if (wd->sec >= 60) wd->sec -= 60;
wd->sec = wd->sec + 10;
if (wd->sec >= 60) wd->sec -= 60;
}
if (wd->sel_obj == wd->digit[5])
{
wd->sec = wd->sec + 1;
if (wd->sec >= 60) wd->sec -= 60;
wd->sec = wd->sec + 1;
if (wd->sec >= 60) wd->sec -= 60;
}
if (wd->sel_obj == wd->ampm)
{
wd->hrs = wd->hrs + 12;
if (wd->hrs > 23) wd->hrs -= 24;
wd->hrs = wd->hrs + 12;
if (wd->hrs > 23) wd->hrs -= 24;
}
wd->interval = wd->interval / 1.05;
ecore_timer_interval_set(wd->spin, wd->interval);
@ -237,38 +237,38 @@ _signal_clock_val_down(void *data)
if (!wd->sel_obj) goto clock_val_down_cancel;
if (wd->sel_obj == wd->digit[0])
{
wd->hrs = wd->hrs - 10;
if (wd->hrs < 0) wd->hrs += 24;
wd->hrs = wd->hrs - 10;
if (wd->hrs < 0) wd->hrs += 24;
}
if (wd->sel_obj == wd->digit[1])
{
wd->hrs = wd->hrs - 1;
if (wd->hrs < 0) wd->hrs += 24;
wd->hrs = wd->hrs - 1;
if (wd->hrs < 0) wd->hrs += 24;
}
if (wd->sel_obj == wd->digit[2])
{
wd->min = wd->min - 10;
if (wd->min < 0) wd->min += 60;
wd->min = wd->min - 10;
if (wd->min < 0) wd->min += 60;
}
if (wd->sel_obj == wd->digit[3])
{
wd->min = wd->min - 1;
if (wd->min < 0) wd->min += 60;
wd->min = wd->min - 1;
if (wd->min < 0) wd->min += 60;
}
if (wd->sel_obj == wd->digit[4])
{
wd->sec = wd->sec - 10;
if (wd->sec < 0) wd->sec += 60;
wd->sec = wd->sec - 10;
if (wd->sec < 0) wd->sec += 60;
}
if (wd->sel_obj == wd->digit[5])
{
wd->sec = wd->sec - 1;
if (wd->sec < 0) wd->sec += 60;
wd->sec = wd->sec - 1;
if (wd->sec < 0) wd->sec += 60;
}
if (wd->sel_obj == wd->ampm)
{
wd->hrs = wd->hrs - 12;
if (wd->hrs < 0) wd->hrs += 24;
wd->hrs = wd->hrs - 12;
if (wd->hrs < 0) wd->hrs += 24;
}
wd->interval = wd->interval / 1.05;
ecore_timer_interval_set(wd->spin, wd->interval);
@ -326,188 +326,188 @@ _time_update(Evas_Object *obj)
if ((wd->cur.seconds != wd->seconds) || (wd->cur.am_pm != wd->am_pm) ||
(wd->cur.edit != wd->edit) || (wd->cur.digedit != wd->digedit))
{
int i;
Evas_Coord mw, mh;
int i;
Evas_Coord mw, mh;
for (i = 0; i < 6; i++)
{
if (wd->digit[i])
{
evas_object_del(wd->digit[i]);
wd->digit[i] = NULL;
}
}
if (wd->ampm)
{
evas_object_del(wd->ampm);
wd->ampm = NULL;
}
for (i = 0; i < 6; i++)
{
if (wd->digit[i])
{
evas_object_del(wd->digit[i]);
wd->digit[i] = NULL;
}
}
if (wd->ampm)
{
evas_object_del(wd->ampm);
wd->ampm = NULL;
}
if ((wd->seconds) && (wd->am_pm))
_elm_theme_object_set(obj, wd->clk, "clock", "base-all", style);
else if (wd->seconds)
_elm_theme_object_set(obj, wd->clk, "clock", "base-seconds", style);
else if (wd->am_pm)
_elm_theme_object_set(obj, wd->clk, "clock", "base-am_pm", style);
else
_elm_theme_object_set(obj, wd->clk, "clock", "base", style);
edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) *
if ((wd->seconds) && (wd->am_pm))
_elm_theme_object_set(obj, wd->clk, "clock", "base-all", style);
else if (wd->seconds)
_elm_theme_object_set(obj, wd->clk, "clock", "base-seconds", style);
else if (wd->am_pm)
_elm_theme_object_set(obj, wd->clk, "clock", "base-am_pm", style);
else
_elm_theme_object_set(obj, wd->clk, "clock", "base", style);
edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) *
_elm_config->scale);
for (i = 0; i < 6; i++)
{
char buf[16];
for (i = 0; i < 6; i++)
{
char buf[16];
if ((!wd->seconds) && (i >= 4)) break;
wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk));
_elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style);
edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) *
if ((!wd->seconds) && (i >= 4)) break;
wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk));
_elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style);
edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) *
_elm_config->scale);
if ((wd->edit) && (wd->digedit & (1 << i)))
edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm");
edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start",
"", _signal_clock_val_up_start, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,up,stop",
"", _signal_clock_val_change_stop, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,down,start",
"", _signal_clock_val_down_start, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,down,stop",
"", _signal_clock_val_change_stop, obj);
mw = mh = -1;
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_extern_object_min_size_set(wd->digit[i], mw, mh);
snprintf(buf, sizeof(buf), "d%i", i);
edje_object_part_swallow(wd->clk , buf, wd->digit[i]);
evas_object_show(wd->digit[i]);
}
if (wd->am_pm)
{
wd->ampm = edje_object_add(evas_object_evas_get(wd->clk));
_elm_theme_object_set(obj, wd->ampm, "clock", "flipampm", style);
edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) *
if ((wd->edit) && (wd->digedit & (1 << i)))
edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm");
edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start",
"", _signal_clock_val_up_start, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,up,stop",
"", _signal_clock_val_change_stop, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,down,start",
"", _signal_clock_val_down_start, obj);
edje_object_signal_callback_add(wd->digit[i], "elm,action,down,stop",
"", _signal_clock_val_change_stop, obj);
mw = mh = -1;
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_extern_object_min_size_set(wd->digit[i], mw, mh);
snprintf(buf, sizeof(buf), "d%i", i);
edje_object_part_swallow(wd->clk , buf, wd->digit[i]);
evas_object_show(wd->digit[i]);
}
if (wd->am_pm)
{
wd->ampm = edje_object_add(evas_object_evas_get(wd->clk));
_elm_theme_object_set(obj, wd->ampm, "clock", "flipampm", style);
edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) *
_elm_config->scale);
if (wd->edit)
edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm");
edje_object_signal_callback_add(wd->ampm, "elm,action,up,start",
"", _signal_clock_val_up_start, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,up,stop",
"", _signal_clock_val_change_stop, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,down,start",
"", _signal_clock_val_down_start, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,down,stop",
"", _signal_clock_val_change_stop, obj);
mw = mh = -1;
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_extern_object_min_size_set(wd->ampm, mw, mh);
edje_object_part_swallow(wd->clk , "ampm", wd->ampm);
evas_object_show(wd->ampm);
}
if (wd->edit)
edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm");
edje_object_signal_callback_add(wd->ampm, "elm,action,up,start",
"", _signal_clock_val_up_start, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,up,stop",
"", _signal_clock_val_change_stop, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,down,start",
"", _signal_clock_val_down_start, obj);
edje_object_signal_callback_add(wd->ampm, "elm,action,down,stop",
"", _signal_clock_val_change_stop, obj);
mw = mh = -1;
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
edje_extern_object_min_size_set(wd->ampm, mw, mh);
edje_object_part_swallow(wd->clk , "ampm", wd->ampm);
evas_object_show(wd->ampm);
}
edje_object_size_min_calc(wd->clk, &mw, &mh);
evas_object_size_hint_min_set(obj, mw, mh);
edje_object_size_min_calc(wd->clk, &mw, &mh);
evas_object_size_hint_min_set(obj, mw, mh);
wd->cur.hrs = 0;
wd->cur.min = 0;
wd->cur.sec = 0;
wd->cur.ampm = -1;
wd->cur.seconds = wd->seconds;
wd->cur.am_pm = wd->am_pm;
wd->cur.edit = wd->edit;
wd->cur.digedit = wd->digedit;
wd->cur.hrs = 0;
wd->cur.min = 0;
wd->cur.sec = 0;
wd->cur.ampm = -1;
wd->cur.seconds = wd->seconds;
wd->cur.am_pm = wd->am_pm;
wd->cur.edit = wd->edit;
wd->cur.digedit = wd->digedit;
}
if (wd->hrs != wd->cur.hrs)
{
int hrs;
int d1, d2, dc1, dc2;
int hrs;
int d1, d2, dc1, dc2;
hrs = wd->hrs;
if (wd->am_pm)
{
if (hrs >= 12)
{
if (hrs > 12) hrs -= 12;
ampm = 1;
}
else if (!hrs) hrs = 12;
}
d1 = hrs / 10;
d2 = hrs % 10;
dc1 = wd->cur.hrs / 10;
dc2 = wd->cur.hrs % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[0], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[1], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.hrs = hrs;
hrs = wd->hrs;
if (wd->am_pm)
{
if (hrs >= 12)
{
if (hrs > 12) hrs -= 12;
ampm = 1;
}
else if (!hrs) hrs = 12;
}
d1 = hrs / 10;
d2 = hrs % 10;
dc1 = wd->cur.hrs / 10;
dc2 = wd->cur.hrs % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[0], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[1], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.hrs = hrs;
}
if (wd->min != wd->cur.min)
{
int d1, d2, dc1, dc2;
int d1, d2, dc1, dc2;
d1 = wd->min / 10;
d2 = wd->min % 10;
dc1 = wd->cur.min / 10;
dc2 = wd->cur.min % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[2], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[3], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.min = wd->min;
d1 = wd->min / 10;
d2 = wd->min % 10;
dc1 = wd->cur.min / 10;
dc2 = wd->cur.min % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[2], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[3], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.min = wd->min;
}
if (wd->seconds)
{
if (wd->sec != wd->cur.sec)
{
int d1, d2, dc1, dc2;
if (wd->sec != wd->cur.sec)
{
int d1, d2, dc1, dc2;
d1 = wd->sec / 10;
d2 = wd->sec % 10;
dc1 = wd->cur.sec / 10;
dc2 = wd->cur.sec % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[4], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[5], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.sec = wd->sec;
}
d1 = wd->sec / 10;
d2 = wd->sec % 10;
dc1 = wd->cur.sec / 10;
dc2 = wd->cur.sec % 10;
if (d1 != dc1)
{
msg.val = d1;
edje_object_message_send(wd->digit[4], EDJE_MESSAGE_INT, 1, &msg);
}
if (d2 != dc2)
{
msg.val = d2;
edje_object_message_send(wd->digit[5], EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.sec = wd->sec;
}
}
else
wd->cur.sec = -1;
if (wd->am_pm)
{
if (wd->hrs >= 12) ampm = 1;
if (ampm != wd->cur.ampm)
{
if (wd->cur.ampm != ampm)
{
msg.val = ampm;
edje_object_message_send(wd->ampm, EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.ampm = ampm;
}
if (wd->hrs >= 12) ampm = 1;
if (ampm != wd->cur.ampm)
{
if (wd->cur.ampm != ampm)
{
msg.val = ampm;
edje_object_message_send(wd->ampm, EDJE_MESSAGE_INT, 1, &msg);
}
wd->cur.ampm = ampm;
}
}
else
wd->cur.ampm = -1;
@ -531,7 +531,7 @@ elm_clock_add(Evas_Object *parent)
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "clock");
elm_widget_type_set(obj, "clock");
elm_widget_sub_object_add(parent, obj);

File diff suppressed because it is too large Load Diff

View File

@ -84,8 +84,8 @@ static void _set_color(Evas_Object *obj, int r, int g, int b, int a);
static const Evas_Smart_Cb_Description _signals[] =
{
{SIG_CHANGED, ""},
{NULL, NULL}
{SIG_CHANGED, ""},
{NULL, NULL}
};
static void
@ -258,35 +258,35 @@ _hsl_to_rgb(void *data)
switch (i)
{
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
}
}
i = (int)(r * 255.0);
@ -357,79 +357,79 @@ _draw_rects(void *data, double x)
switch (cp->color_type)
{
case HUE:
wd->h = 360.0 * x;
case HUE:
wd->h = 360.0 * x;
if (x < one_six)
{
wd->er = 255;
wd->eg = (255.0 * x * 6.0);
wd->eb = 0;
}
else if (x < 2 * one_six)
{
wd->er = 255 - (int)(255.0 * (x - one_six) * 6.0);
wd->eg = 255;
wd->eb = 0;
}
else if (x < 3 * one_six)
{
wd->er = 0;
wd->eg = 255;
wd->eb = (int)(255.0 * (x - (2.0 * one_six)) * 6.0);
}
else if (x < 4 * one_six)
{
wd->er = 0;
wd->eg = 255 - (int)(255.0 * (x - (3.0 * one_six)) * 6.0);
wd->eb = 255;
}
else if (x < 5 * one_six)
{
wd->er = 255.0 * (x - (4.0 * one_six)) * 6.0;
wd->eg = 0;
wd->eb = 255;
}
else
{
wd->er = 255;
wd->eg = 0;
wd->eb = 255 - (int)(255.0 * (x - (5.0 * one_six)) * 6.0);
}
if (x < one_six)
{
wd->er = 255;
wd->eg = (255.0 * x * 6.0);
wd->eb = 0;
}
else if (x < 2 * one_six)
{
wd->er = 255 - (int)(255.0 * (x - one_six) * 6.0);
wd->eg = 255;
wd->eb = 0;
}
else if (x < 3 * one_six)
{
wd->er = 0;
wd->eg = 255;
wd->eb = (int)(255.0 * (x - (2.0 * one_six)) * 6.0);
}
else if (x < 4 * one_six)
{
wd->er = 0;
wd->eg = 255 - (int)(255.0 * (x - (3.0 * one_six)) * 6.0);
wd->eb = 255;
}
else if (x < 5 * one_six)
{
wd->er = 255.0 * (x - (4.0 * one_six)) * 6.0;
wd->eg = 0;
wd->eb = 255;
}
else
{
wd->er = 255;
wd->eg = 0;
wd->eb = 255 - (int)(255.0 * (x - (5.0 * one_six)) * 6.0);
}
evas_object_color_set(wd->cp[0]->arrow, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[1]->bg_rect, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[2]->bg_rect, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[3]->bar, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[0]->arrow, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[1]->bg_rect, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[2]->bg_rect, wd->er, wd->eg, wd->eb, 255);
evas_object_color_set(wd->cp[3]->bar, wd->er, wd->eg, wd->eb, 255);
_color_with_saturation(wd);
evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
_color_with_saturation(wd);
evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
_color_with_lightness(wd);
evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
_color_with_lightness(wd);
evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
evas_object_color_set(wd->cp[3]->arrow,
(wd->er * wd->a) / 255,
(wd->eg * wd->a) / 255,
(wd->eb * wd->a) / 255,
wd->a);
break;
case SATURATION:
wd->s = 1.0 - x;
_color_with_saturation(wd);
evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
break;
case LIGHTNESS:
wd->l = x;
_color_with_lightness(wd);
evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
break;
case ALPHA:
wd->a = 255.0 * x;
evas_object_color_set(wd->cp[3]->arrow, wd->er, wd->eg, wd->eb, wd->a);
break;
default:
break;
evas_object_color_set(wd->cp[3]->arrow,
(wd->er * wd->a) / 255,
(wd->eg * wd->a) / 255,
(wd->eb * wd->a) / 255,
wd->a);
break;
case SATURATION:
wd->s = 1.0 - x;
_color_with_saturation(wd);
evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
break;
case LIGHTNESS:
wd->l = x;
_color_with_lightness(wd);
evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
break;
case ALPHA:
wd->a = 255.0 * x;
evas_object_color_set(wd->cp[3]->arrow, wd->er, wd->eg, wd->eb, wd->a);
break;
default:
break;
}
_hsl_to_rgb(wd);
}
@ -805,7 +805,7 @@ elm_colorselector_add(Evas_Object *parent)
Evas *e;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "colorselector");
elm_widget_type_set(obj, "colorselector");
elm_widget_sub_object_add(parent, obj);