Fix formatting in elm_theme.

Fix compiler warnings in elm_theme.
More Panel work...can now slide in & out. Still needs more love tho.



SVN revision: 43318
This commit is contained in:
Christopher Michael 2009-10-27 19:32:50 +00:00
parent ce08200cfd
commit 8694f94d26
4 changed files with 33 additions and 51 deletions

View File

@ -18072,6 +18072,15 @@ group
{
state: "default" 0.0;
color: 255 255 255 0;
rel1.relative: -0.5 0.0;
rel2.relative: 0.3 1.0;
}
description
{
state: "visible" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
}
}
part
@ -18121,7 +18130,6 @@ group
description
{
state: "default" 0.0;
min: 32 48;
max: 32 48;
fixed: 1 1;
align: 0.0 0.5;
@ -18131,6 +18139,7 @@ group
offset: -3 0;
to_x: "base";
}
rel2.to_x: "bg";
image
{
normal: "bt_base1.png";
@ -18224,19 +18233,18 @@ group
align: 0.5 0.5;
min: 16 16;
max: 16 16;
image.normal: "icon_arrow_left.png";
image.normal: "icon_arrow_right.png";
}
description
{
state: "hidden" 0.0;
state: "visible" 0.0;
inherit: "default" 0.0;
image.normal: "icon_arrow_right.png";
image.normal: "icon_arrow_left.png";
}
}
}
programs
{
/*
program
{
name: "show";
@ -18244,6 +18252,8 @@ group
source: "elm";
action: STATE_SET "visible" 0.0;
target: "bg";
target: "btn_icon";
transition: LINEAR 0.5;
}
program
{
@ -18258,6 +18268,7 @@ group
name: "show3";
action: STATE_SET "visible" 0.0;
target: "bg";
target: "btn_icon";
transition: LINEAR 0.5;
}
program
@ -18267,8 +18278,9 @@ group
source: "elm";
action: STATE_SET "default" 0.0;
target: "bg";
target: "btn_icon";
transition: LINEAR 0.5;
}
*/
program
{
name: "btn_click";
@ -18309,22 +18321,6 @@ group
source: "btn_over2";
action: SIGNAL_EMIT "elm,action,panel,toggle" "";
}
program
{
name: "visible";
signal: "elm,state,visible";
source: "elm";
action: STATE_SET "default" 0.0;
target: "btn_icon";
}
program
{
name: "hidden";
signal: "elm,state,hidden";
source: "elm";
action: STATE_SET "hidden" 0.0;
target: "btn_icon";
}
}
}

View File

@ -998,7 +998,6 @@ extern "C" {
} Elm_Panel_Orient;
EAPI Evas_Object *elm_panel_add(Evas_Object *parent);
EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient);
EAPI void elm_panel_timeout_set(Evas_Object *obj, int timeout);
EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content);
#ifdef __cplusplus

View File

@ -15,8 +15,6 @@ struct _Widget_Data
Evas_Object *parent, *panel, *content;
Elm_Panel_Orient orient;
Eina_Bool hidden : 1;
int timeout;
Ecore_Timer *timer;
};
static void _del_pre_hook(Evas_Object *obj);
@ -67,19 +65,15 @@ _sizing_eval(Evas_Object *obj)
switch (wd->orient)
{
case ELM_PANEL_ORIENT_TOP:
evas_object_move(wd->panel, x, y);
evas_object_resize(wd->panel, w, pw + PNL_BTN_WIDTH);
break;
case ELM_PANEL_ORIENT_BOTTOM:
evas_object_move(wd->panel, x, h - (pw + PNL_BTN_WIDTH));
evas_object_resize(wd->panel, w, pw + PNL_BTN_WIDTH);
break;
case ELM_PANEL_ORIENT_LEFT:
evas_object_move(wd->panel, x, y);
evas_object_resize(wd->panel, pw + PNL_BTN_WIDTH, h);
break;
case ELM_PANEL_ORIENT_RIGHT:
evas_object_move(wd->panel, (x + w - (pw + PNL_BTN_WIDTH)), y);
evas_object_resize(wd->panel, pw + PNL_BTN_WIDTH, h);
break;
}
@ -96,15 +90,14 @@ _toggle_panel(void *data, Evas_Object *obj, const char *emission, const char *so
{
Widget_Data *wd = elm_widget_data_get(data);
if (wd->timer) ecore_timer_del(wd->timer);
if (wd->hidden)
{
edje_object_signal_emit(wd->panel, "elm,state,visible", "elm");
edje_object_signal_emit(wd->panel, "elm,action,show", "elm");
wd->hidden = EINA_FALSE;
}
else
{
edje_object_signal_emit(wd->panel, "elm,state,hidden", "elm");
edje_object_signal_emit(wd->panel, "elm,action,hide", "elm");
wd->hidden = EINA_TRUE;
}
}
@ -119,7 +112,6 @@ elm_panel_add(Evas_Object *parent)
wd = ELM_NEW(Widget_Data);
wd->parent = parent;
wd->hidden = EINA_FALSE;
wd->timeout = 2;
evas = evas_object_evas_get(parent);
obj = elm_widget_add(evas);
@ -139,6 +131,8 @@ elm_panel_add(Evas_Object *parent)
evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE,
_parent_resize, obj);
edje_object_signal_emit(wd->panel, "elm,action,show", "elm");
return obj;
}
@ -166,15 +160,6 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient)
_sizing_eval(obj);
}
EAPI void
elm_panel_timeout_set(Evas_Object *obj, int timeout)
{
Widget_Data *wd = elm_widget_data_get(obj);
wd->timeout = timeout;
// _timer_init(obj);
}
EAPI void
elm_panel_content_set(Evas_Object *obj, Evas_Object *content)
{

View File

@ -29,8 +29,7 @@ _elm_theme_theme_element_try(const char *home, const char *f, const char *group)
char buf[PATH_MAX];
const char *file = NULL;
if ((f[0] == '/') ||
((f[0] == '.') && (f[1] == '/')) ||
if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) ||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')))
return _elm_theme_find_try(f, group);
else if (((f[0] == '~') && (f[1] == '/')))
@ -54,6 +53,7 @@ _elm_theme_group_file_find(const char *group)
char *p;
static const char *home = NULL;
const char *file = eina_hash_find(cache, group);
if (file) return file;
if (!home)
{
@ -82,6 +82,7 @@ EAPI void
elm_theme_overlay_add(const char *item)
{
const char *f = eina_stringshare_add(item);
if (f) overlay = eina_list_prepend(overlay, f);
elm_theme_flush();
}
@ -91,12 +92,13 @@ elm_theme_overlay_del(const char *item)
{
const Eina_List *l;
const char *f, *s;
s = eina_stringshare_add(item);
EINA_LIST_FOREACH(overlay, l, f)
if (f == s)
{
eina_stringshare_del(f);
overlay = eina_list_remove_list(overlay, l);
overlay = eina_list_remove_list(overlay, (Eina_List *)l);
break;
}
eina_stringshare_del(s);
@ -107,6 +109,7 @@ EAPI void
elm_theme_extension_add(const char *item)
{
const char *f = eina_stringshare_add(item);
if (f) extension = eina_list_append(extension, f);
elm_theme_flush();
}
@ -116,12 +119,13 @@ elm_theme_extension_del(const char *item)
{
const Eina_List *l;
const char *f, *s;
s = eina_stringshare_add(item);
EINA_LIST_FOREACH(extension, l, f)
if (f == s)
{
eina_stringshare_del(f);
extension = eina_list_remove_list(extension, l);
extension = eina_list_remove_list(extension, (Eina_List *)l);
break;
}
eina_stringshare_del(s);
@ -162,8 +166,7 @@ _elm_theme_icon_set(Evas_Object *o, const char *group, const char *style)
{
const char *file;
char buf2[1024];
int w, h;
int ok;
int w, h, ok;
snprintf(buf2, sizeof(buf2), "elm/icon/%s/%s", group, style);
file = _elm_theme_group_file_find(buf2);
@ -199,6 +202,7 @@ _elm_theme_parse(const char *theme)
if (n)
{
const char *nn;
strncpy(n, p, pe - p);
n[pe - p] = 0;
nn = eina_stringshare_add(n);
@ -226,9 +230,7 @@ _elm_theme_parse(const char *theme)
cache = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
EINA_LIST_FREE(themes, p)
{
eina_stringshare_del(p);
}
eina_stringshare_del(p);
themes = names;
return 1;