Formatting.

SVN revision: 29448
This commit is contained in:
Sebastian Dransfeld 2007-04-08 21:00:30 +00:00
parent a0a2e5c7fc
commit 39e228c73a
15 changed files with 132 additions and 130 deletions

View File

@ -1,25 +1,27 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
EAPI int
e_color_class_init(void)
{
Evas_List *l;
for (l = e_config->color_classes; l; l = l->next)
{
E_Color_Class *cc;
{
E_Color_Class *cc;
cc = l->data;
if (!cc) continue;
cc = l->data;
if (!cc) continue;
printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a);
edje_color_class_set(cc->name,
cc->r, cc->g, cc->b, cc->a,
cc->r2, cc->g2, cc->b2, cc->a2,
cc->r3, cc->g3, cc->b3, cc->a3);
printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a);
edje_color_class_set(cc->name,
cc->r, cc->g, cc->b, cc->a,
cc->r2, cc->g2, cc->b2, cc->a2,
cc->r3, cc->g3, cc->b3, cc->a3);
}
}
return 1;
}
@ -36,14 +38,14 @@ e_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, i
cc = e_color_class_find(color_class);
if (!cc)
{
cc = E_NEW(E_Color_Class, 1);
e_config->color_classes = evas_list_append(e_config->color_classes, cc);
cc->name = evas_stringshare_add(color_class);
cc->r = cc->g = cc->b = cc->a = 255;
cc->r2 = cc->g2 = cc->b2 = cc->a2 = 255;
cc->r3 = cc->g3 = cc->b3 = cc->a3 = 255;
}
{
cc = E_NEW(E_Color_Class, 1);
e_config->color_classes = evas_list_append(e_config->color_classes, cc);
cc->name = evas_stringshare_add(color_class);
cc->r = cc->g = cc->b = cc->a = 255;
cc->r2 = cc->g2 = cc->b2 = cc->a2 = 255;
cc->r3 = cc->g3 = cc->b3 = cc->a3 = 255;
}
if (r != -1) cc->r = E_CLAMP(r, 0, 255);
if (g != -1) cc->g = E_CLAMP(g, 0, 255);
@ -72,14 +74,14 @@ e_color_class_del(const char *name)
cc = e_color_class_find(name);
if (cc)
{
e_config->color_classes = evas_list_remove(e_config->color_classes, cc);
edje_color_class_del(cc->name);
evas_stringshare_del(cc->name);
E_FREE(cc);
{
e_config->color_classes = evas_list_remove(e_config->color_classes, cc);
edje_color_class_del(cc->name);
evas_stringshare_del(cc->name);
E_FREE(cc);
e_config_save_queue();
}
e_config_save_queue();
}
}
EAPI E_Color_Class *
@ -88,17 +90,17 @@ e_color_class_find(const char *name)
Evas_List *l;
E_Color_Class *cc = NULL;
for(l = e_config->color_classes; l; l = l->next)
{
cc = l->data;
if (!cc) continue;
if (!strcmp(cc->name, name))
for (l = e_config->color_classes; l; l = l->next)
{
return cc;
break;
cc = l->data;
if (!cc) continue;
if (!strcmp(cc->name, name))
{
return cc;
break;
}
}
}
return NULL;
}

View File

@ -24,7 +24,7 @@ e_color_dialog_new(E_Container *con, const E_Color *color)
Evas_Coord mw, mh;
dia = E_OBJECT_ALLOC(E_Color_Dialog, E_COLOR_DIALOG_TYPE, _e_color_dialog_free);
if(!dia) return NULL;
if (!dia) return NULL;
dia->dia = e_dialog_new(con, "E", "_color_dialog");
e_dialog_title_set(dia->dia, "Color Selector");
@ -105,7 +105,7 @@ _e_color_dialog_button1_click(void *data, E_Dialog *edia)
E_Color_Dialog *dia;
dia = data;
if(dia->select_func && dia->color)
if (dia->select_func && dia->color)
dia->select_func(dia, dia->color, dia->select_data);
_e_color_dialog_free(dia);
}
@ -116,7 +116,7 @@ _e_color_dialog_button2_click(void *data, E_Dialog *edia)
E_Color_Dialog *dia;
dia = data;
if(dia->cancel_func && dia->initial)
if (dia->cancel_func && dia->initial)
dia->cancel_func(dia, dia->initial, dia->cancel_data);
_e_color_dialog_free(data);
}

View File

@ -367,7 +367,7 @@ e_int_border_menu_del(E_Border *bd)
bd->border_stacking_menu = NULL;
was_menu = 1;
}
if( bd->border_maximize_menu )
if (bd->border_maximize_menu)
{
e_object_del(E_OBJECT(bd->border_maximize_menu));
bd->border_maximize_menu = NULL;

View File

@ -121,7 +121,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
const char *path;
path = e_intl_imc_system_path_get();
if(!strncmp(cfdata->imc_current, path, strlen(path)))
if (!strncmp(cfdata->imc_current, path, strlen(path)))
cfdata->fmdir = 1;
cfdata->imc_disable = 0;
}
@ -328,7 +328,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
}
i = 0;
while(imc_basic_list)
while (imc_basic_list)
{
E_Input_Method_Config *imc;
Eet_File *imc_ef;

View File

@ -133,7 +133,7 @@ _ilist_fill(E_Config_Dialog_Data *cfdata)
snprintf(buf, sizeof(buf), "%s %i", label, es->id);
ob = edje_object_add(evas);
switch(es->cfg->orient)
switch (es->cfg->orient)
{
case E_GADCON_ORIENT_LEFT:
e_util_edje_icon_set(ob, "enlightenment/shelf_position_left");

View File

@ -442,7 +442,7 @@ _import_cb_on_change(void *data, Evas_Object *obj)
evas_object_gradient_color_stop_add(grad, import->cfdata->color1->r, import->cfdata->color1->g, import->cfdata->color1->b, 255, 1);
evas_object_gradient_color_stop_add(grad, import->cfdata->color2->r, import->cfdata->color2->g, import->cfdata->color2->b, 255, 1);
switch(import->cfdata->mode)
switch (import->cfdata->mode)
{
case GRAD_H:
evas_object_gradient_type_set(grad, "linear", NULL);

View File

@ -499,7 +499,7 @@ _e_intl_cb_exit(void *data, int type, void *event)
static void
_e_intl_locale_hash_free(Evas_Hash *locale_hash)
{
if(!locale_hash) return;
if (!locale_hash) return;
evas_hash_foreach(locale_hash, _e_intl_locale_hash_free_cb, NULL);
evas_hash_free(locale_hash);
}
@ -730,11 +730,11 @@ e_intl_locale_parts_get(const char *locale)
locale_char = locale[locale_idx];
/* we have finished scanning the locale string */
if(locale_char == 0)
if (!locale_char)
break;
/* scan this character based on the current start */
switch(state)
switch (state)
{
case 0: /* Gathering Language */
if (tmp_idx == 2 && locale_char == '_')
@ -759,14 +759,14 @@ e_intl_locale_parts_get(const char *locale)
territory[tmp_idx] = 0;
tmp_idx = 0;
}
else if(tmp_idx == 2 && locale_char == '@')
else if ((tmp_idx == 2) && (locale_char == '@'))
{
state += 2;
territory[tmp_idx] = 0;
codeset[0] = 0;
tmp_idx = 0;
}
else if(tmp_idx < 2 && isupper(locale_char))
else if ((tmp_idx < 2) && isupper(locale_char))
{
territory[tmp_idx++] = locale_char;
}
@ -999,7 +999,7 @@ _e_intl_locale_validate(const char *locale)
all_locales = _e_intl_locale_system_locales_get();
/* Match locale with one from the list */
while(all_locales)
while (all_locales)
{
char *locale_next;
locale_next = all_locales->data;

View File

@ -162,7 +162,7 @@ e_object_error(E_Object *obj)
{
/* try access magic value */
magic = obj->magic;
/* if pointer is bogus we'd segv and so jump to the if() above */
/* if pointer is bogus we'd segv and so jump to the if () above */
/* contents, and thus reset segv handler and set segv flag. */
/* if not we just continue moving along here and reset handler */
sigaction(SIGSEGV, &oact, NULL);

View File

@ -280,7 +280,7 @@ e_shelf_toggle(E_Shelf *es, int show)
}
else
{
if(!es->hide_animator)
if (!es->hide_animator)
es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es);
}
if (es->hide_timer)
@ -291,7 +291,7 @@ e_shelf_toggle(E_Shelf *es, int show)
}
else if (!show && es->cfg->autohide && !es->hidden)
{
if(!es->hide_timer)
if (!es->hide_timer)
es->hide_timer = ecore_timer_add(1.0, _e_shelf_cb_hide_timer, es);
}
}
@ -1107,7 +1107,7 @@ _e_shelf_cb_hide_timer(void *data)
}
else
{
if(!es->hide_animator)
if (!es->hide_animator)
es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es);
}
if (es->hide_timer)
@ -1127,14 +1127,14 @@ _e_shelf_cb_hide_animator(void *data)
es = data;
switch(es->gadcon->orient)
switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR:
/* TODO: step coefficient needs to be configurable */
step = ((es->h - es->hidden_state_size) / e_config->framerate) * 2;
if(es->hidden)
if (es->hidden)
{
if (es->hide_origin == -1) es->hide_origin = es->y;
if (es->hide_step < es->h - es->hidden_state_size)
@ -1155,7 +1155,7 @@ _e_shelf_cb_hide_animator(void *data)
}
else
{
if(es->hide_step > 0)
if (es->hide_step > 0)
{
if (es->hide_step < step)
{
@ -1176,7 +1176,7 @@ _e_shelf_cb_hide_animator(void *data)
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR:
step = ((es->h - es->hidden_state_size) / e_config->framerate) * 2;
if(es->hidden)
if (es->hidden)
{
if (es->hide_origin == -1) es->hide_origin = es->y;
if (es->hide_step < es->h - es->hidden_state_size)
@ -1197,7 +1197,7 @@ _e_shelf_cb_hide_animator(void *data)
}
else
{
if(es->hide_step > 0)
if (es->hide_step > 0)
{
if (es->hide_step < step)
{
@ -1219,7 +1219,7 @@ _e_shelf_cb_hide_animator(void *data)
case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT:
step = ((es->w - es->hidden_state_size) / e_config->framerate) * 2;
if(es->hidden)
if (es->hidden)
{
if (es->hide_origin == -1) es->hide_origin = es->x;
if (es->hide_step < es->w - es->hidden_state_size)
@ -1262,7 +1262,7 @@ _e_shelf_cb_hide_animator(void *data)
case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT:
step = ((es->w - es->hidden_state_size) / e_config->framerate) * 2;
if(es->hidden)
if (es->hidden)
{
if (es->hide_origin == -1) es->hide_origin = es->x;
if (es->hide_step < es->w - es->hidden_state_size)
@ -1318,13 +1318,13 @@ _e_shelf_cb_instant_hide_timer(void *data)
es = data;
switch(es->gadcon->orient)
switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR:
/* TODO: step coefficient needs to be configurable */
if(es->hidden)
if (es->hidden)
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
else
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
@ -1332,7 +1332,7 @@ _e_shelf_cb_instant_hide_timer(void *data)
case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR:
if(es->hidden)
if (es->hidden)
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
else
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
@ -1340,7 +1340,7 @@ _e_shelf_cb_instant_hide_timer(void *data)
case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT:
if(es->hidden)
if (es->hidden)
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);
else
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
@ -1348,7 +1348,7 @@ _e_shelf_cb_instant_hide_timer(void *data)
case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT:
if(es->hidden)
if (es->hidden)
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
else
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);

View File

@ -269,7 +269,7 @@ _e_spectrum_redraw(void *d)
return 0;
}
switch(sp->mode)
switch (sp->mode)
{
case E_COLOR_COMPONENT_R:
vz = (float)sp->cv->r / 255;

View File

@ -59,12 +59,12 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
wd->changing = 1;
/* entry changed */
for(l = wd->entries, i = 0; l; l = l->next, i++)
for (l = wd->entries, i = 0; l; l = l->next, i++)
{
if (o == l->data)
{
changed = i;
switch(i)
switch (i)
{
case E_COLOR_COMPONENT_R:
wd->cv->r = atoi(wd->values[i]);
@ -143,11 +143,11 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
e_widget_color_well_update(wd->well);
/* now update the text fields to show current values */
for(l = wd->entries, i = 0; l; l = l->next, i++)
for (l = wd->entries, i = 0; l; l = l->next, i++)
{
char buf[10];
if (o == l->data) continue;
switch(i)
switch (i)
{
case E_COLOR_COMPONENT_R:
snprintf(buf, 10, "%i", wd->cv->r);
@ -205,10 +205,10 @@ e_widget_csel_add(Evas *evas, E_Color *color)
wd->values = calloc(E_COLOR_COMPONENT_MAX, sizeof(char *));
for(i = 0; i < E_COLOR_COMPONENT_MAX; i++)
for (i = 0; i < E_COLOR_COMPONENT_MAX; i++)
{
wd->values[i] = calloc(10, sizeof(char));
switch(i)
switch (i)
{
case E_COLOR_COMPONENT_R:
snprintf(wd->values[i], 10, "%i", wd->cv->r);

View File

@ -123,7 +123,7 @@ _e_wid_value_set(Evas_Object *o, double vx)
E_Widget_Data *wd;
wd = e_widget_data_get(o);
switch(wd->mode)
switch (wd->mode)
{
case E_COLOR_COMPONENT_R:
wd->color->r = 255 * vx;
@ -207,7 +207,7 @@ _e_wid_update_standard(E_Widget_Data *wd)
evas_object_gradient_clear(wd->o_grad);
switch(wd->mode)
switch (wd->mode)
{
case E_COLOR_COMPONENT_R:
evas_object_gradient_color_stop_add(wd->o_grad, 0, wd->color->g, wd->color->b, 255, 1);
@ -265,59 +265,59 @@ _e_wid_update_fixed(E_Widget_Data *wd)
if (!wd) return;
evas_object_gradient_clear(wd->o_grad);
switch(wd->mode)
{
case E_COLOR_COMPONENT_R:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 0, 0, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->r / 255.0;
break;
case E_COLOR_COMPONENT_G:
evas_object_gradient_color_stop_add(wd->o_grad, 0, 255, 0, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->g / 255.0;
break;
case E_COLOR_COMPONENT_B:
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->b / 255.0;
break;
case E_COLOR_COMPONENT_H:
/*
* Color Stops:
* 0 x n n
* 60 x x n
* 120 n x n
* 180 n x x
* 240 n n x
* 300 x n x
* 360 x n n
*/
min = 0;
max = 255;
switch (wd->mode)
{
case E_COLOR_COMPONENT_R:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 0, 0, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->r / 255.0;
break;
case E_COLOR_COMPONENT_G:
evas_object_gradient_color_stop_add(wd->o_grad, 0, 255, 0, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->g / 255.0;
break;
case E_COLOR_COMPONENT_B:
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->b / 255.0;
break;
case E_COLOR_COMPONENT_H:
/*
* Color Stops:
* 0 x n n
* 60 x x n
* 120 n x n
* 180 n x x
* 240 n n x
* 300 x n x
* 360 x n n
*/
min = 0;
max = 255;
evas_object_gradient_color_stop_add(wd->o_grad, max, min, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, min, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, min, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, max, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, max, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, max, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, min, min, 255, 1);
vx = wd->color->h / 360.0;
break;
case E_COLOR_COMPONENT_S:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 255, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->s;
break;
case E_COLOR_COMPONENT_V:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 255, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->v;
break;
case E_COLOR_COMPONENT_MAX:
break;
}
evas_object_gradient_color_stop_add(wd->o_grad, max, min, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, min, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, min, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, max, max, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, min, max, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, max, min, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, max, min, min, 255, 1);
vx = wd->color->h / 360.0;
break;
case E_COLOR_COMPONENT_S:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 255, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->s;
break;
case E_COLOR_COMPONENT_V:
evas_object_gradient_color_stop_add(wd->o_grad, 255, 255, 255, 255, 1);
evas_object_gradient_color_stop_add(wd->o_grad, 0, 0, 0, 255, 1);
vx = wd->color->v;
break;
case E_COLOR_COMPONENT_MAX:
break;
}
edje_object_part_drag_value_set(wd->o_cslider, "e.dragable.cursor", vx, vx);
}

View File

@ -275,7 +275,7 @@ _e_wid_cb_bg_update(void *data, int type, void *event)
wd = data;
ev = event;
for(l = wd->desks; l; l = l->next)
for (l = wd->desks; l; l = l->next)
{
Evas_Object *o;
E_Widget_Desk_Data *dd;

View File

@ -100,7 +100,7 @@ e_widget_spectrum_update(Evas_Object *obj, int redraw)
if (redraw)
e_spectrum_update(wd->o_spectrum);
switch(wd->mode)
switch (wd->mode)
{
case E_COLOR_COMPONENT_R:
vy = wd->cv->g / 255.0;
@ -235,7 +235,7 @@ _e_wid_mouse_handle(Evas_Object *obj, int mx, int my)
edje_object_part_drag_value_set(wd->o_edje, "e.dragable.cursor", vx, vy);
switch(wd->mode)
switch (wd->mode)
{
case E_COLOR_COMPONENT_R:
wd->cv->g = vy * 255;

View File

@ -635,7 +635,7 @@ _e_zone_free(E_Zone *zone)
/* free desks */
for (x = 0; x < zone->desk_x_count; x++)
{
for(y = 0; y < zone->desk_y_count; y++)
for (y = 0; y < zone->desk_y_count; y++)
e_object_del(E_OBJECT(zone->desks[x + (y * zone->desk_x_count)]));
}
free(zone->desks);