Fix warnings.

SVN revision: 32305
This commit is contained in:
Sebastian Dransfeld 2007-11-02 12:48:00 +00:00
parent f3f001fced
commit eaa53fdb1d
3 changed files with 48 additions and 58 deletions

View File

@ -78,8 +78,7 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
static Evas_Object * static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{ {
Evas_Object *o, *of, *ob, *ol, *oi; Evas_Object *o, *of, *ob, *ol;
E_Radio_Group *rg;
Population *pop; Population *pop;
pop = cfd->data; pop = cfd->data;
@ -124,7 +123,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
char * name; char * name;
Evas_Object *oi; Evas_Object *oi;
theme = l->data; theme = l->data;
name = edje_file_data_get (theme, "PopulationName"); name = edje_file_data_get(theme, "PopulationName");
if (name) if (name)
{ {
oi = edje_object_add(evas); oi = edje_object_add(evas);
@ -133,7 +132,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
printf("TEMA: %s (%s)\n", name, cfdata->theme); printf("TEMA: %s (%s)\n", name, cfdata->theme);
e_widget_ilist_append(ol, oi, name, e_widget_ilist_append(ol, oi, name,
_ilist_cb_selected, theme, theme); _ilist_cb_selected, theme, theme);
if (strcmp(theme,cfdata->theme) == 0) if (strcmp(theme, cfdata->theme) == 0)
{ {
e_widget_ilist_selected_set(ol, count); e_widget_ilist_selected_set(ol, count);
} }
@ -151,14 +150,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
static void static void
_ilist_cb_selected(void *data) _ilist_cb_selected(void *data)
{ {
E_Config_Dialog_Data *cfdata;
char *th; char *th;
th = data; th = data;
//cfdata = data;
//if (!cfdata) return;
printf("CB %s\n",th); printf("CB %s\n", th);
} }
static int static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)

View File

@ -1,8 +1,11 @@
#include <e.h> #include <e.h>
#include <Ecore_Str.h>
#include "config.h" #include "config.h"
#include "e_mod_main.h" #include "e_mod_main.h"
#include "e_mod_config.h" #include "e_mod_config.h"
#define CLIMBER_PROB 4 // 4 Means: one climber every 5 - 1 Means: all climber - !!Don't set to 0 #define CLIMBER_PROB 4 // 4 Means: one climber every 5 - 1 Means: all climber - !!Don't set to 0
#define FLOATER_PROB 2 #define FLOATER_PROB 2
#define MAX_FALLER_HEIGHT 300 #define MAX_FALLER_HEIGHT 300
@ -135,7 +138,7 @@ _population_init(E_Module *m)
if (es->visible) if (es->visible)
{ {
e_container_shape_geometry_get(es, &x, &y, &w, &h); e_container_shape_geometry_get(es, &x, &y, &w, &h);
printf("E_shape: [%d] x:%d y:%d w:%d h:%d\n", es->visible,x, y, w, h); printf("E_shape: [%d] x:%d y:%d w:%d h:%d\n", es->visible, x, y, w, h);
} }
} }
} }
@ -154,12 +157,12 @@ _population_init(E_Module *m)
{ {
if (ecore_str_has_suffix(filename, ".edj")) if (ecore_str_has_suffix(filename, ".edj"))
{ {
snprintf(buf,sizeof(buf),"%s/%s",PACKAGE_DATA_DIR"/themes",filename); snprintf(buf, sizeof(buf),"%s/%s", PACKAGE_DATA_DIR"/themes", filename);
name = edje_file_data_get (buf, "PopulationName"); name = edje_file_data_get(buf, "PopulationName");
if (name) if (name)
{ {
printf("THEME FILE: %s (%s)\n",filename,name); printf("THEME FILE: %s (%s)\n", filename, name);
pop->themes = evas_list_append(pop->themes,strdup(buf)); pop->themes = evas_list_append(pop->themes, strdup(buf));
} }
} }
} }
@ -178,9 +181,9 @@ _action_free(Evas_Hash *hash, const char *key, void *data, void *fdata)
{ {
Action *a; Action *a;
a = data; a = data;
printf("Free Action '%s' :(\n",a->name); printf("Free Action '%s' :(\n", a->name);
E_FREE(a->name); E_FREE(a->name);
E_FREE (a); E_FREE(a);
return 1; return 1;
} }
static void static void
@ -242,7 +245,7 @@ _population_shutdown(Population *pop)
while (pop->themes) while (pop->themes)
{ {
printf("Free Theme '%s' :(\n",pop->themes->data); printf("Free Theme '%s' :(\n", (char *)pop->themes->data);
pop->themes = evas_list_remove_list(pop->themes, pop->themes); pop->themes = evas_list_remove_list(pop->themes, pop->themes);
} }
@ -274,9 +277,8 @@ _load_action(Population *pop, char *filename, char *name, int id)
{ {
Action *act; Action *act;
char *data; char *data;
int w, h, speed;
data = edje_file_data_get(filename, name);
data = edje_file_data_get (filename, name);
if (!data) if (!data)
return NULL; return NULL;
@ -301,10 +303,9 @@ _load_custom_action(Population *pop, char *filename, char *name)
{ {
Custom_Action *c; Custom_Action *c;
char *data; char *data;
int w, h, speed;
char buf[25]; char buf[25];
data = edje_file_data_get (filename, name); data = edje_file_data_get(filename, name);
if (!data) if (!data)
return NULL; return NULL;
@ -332,7 +333,7 @@ _load_custom_action(Population *pop, char *filename, char *name)
Evas_Bool hash_fn(Evas_Hash *hash, const char *key, void *data, void *fdata) Evas_Bool hash_fn(Evas_Hash *hash, const char *key, void *data, void *fdata)
{ {
Action *a = data; Action *a = data;
printf("ACTIONS: name:'%s' w:%d h:%d speed:%d\n",key,a->w,a->h,a->speed); printf("ACTIONS: name:'%s' w:%d h:%d speed:%d\n", key, a->w, a->h, a->speed);
return 1; return 1;
} }
@ -340,7 +341,6 @@ static void
_theme_load(Population *pop) _theme_load(Population *pop)
{ {
char *name; char *name;
Action *act;
char buf[15]; char buf[15];
int i; int i;
@ -352,7 +352,7 @@ _theme_load(Population *pop)
pop->conf->theme = PACKAGE_DATA_DIR "/default.edj"; pop->conf->theme = PACKAGE_DATA_DIR "/default.edj";
name = edje_file_data_get (pop->conf->theme, "PopulationName"); name = edje_file_data_get(pop->conf->theme, "PopulationName");
if (!name) if (!name)
return; return;
@ -371,12 +371,12 @@ _theme_load(Population *pop)
// load custom actions // load custom actions
i = 2; i = 2;
snprintf(buf, sizeof(buf), "Custom_1"); snprintf(buf, sizeof(buf), "Custom_1");
while(_load_custom_action(pop, pop->conf->theme, buf)) while (_load_custom_action(pop, pop->conf->theme, buf))
snprintf(buf, sizeof(buf), "Custom_%d", i++); snprintf(buf, sizeof(buf), "Custom_%d", i++);
evas_hash_foreach(pop->actions, hash_fn, NULL); evas_hash_foreach(pop->actions, hash_fn, NULL);
Evas_List *l; Evas_List *l;
for ( l = pop->customs; l; l = l->next ) for (l = pop->customs; l; l = l->next )
{ {
Custom_Action *c = l->data; Custom_Action *c = l->data;
printf("CUSTOMS: name:'%s' w:%d h:%d h_speed:%d v_speed:%d\n", printf("CUSTOMS: name:'%s' w:%d h:%d h_speed:%d v_speed:%d\n",
@ -394,13 +394,11 @@ _population_load(Population *pop)
evas_output_viewport_get(pop->canvas, &xx, &yy, &ww, &hh); evas_output_viewport_get(pop->canvas, &xx, &yy, &ww, &hh);
//Create edje //Create edje
printf("\n *** LOAD %d ANIMS ***\n",pop->conf->penguins_count); printf("\n *** LOAD %d ANIMS ***\n", pop->conf->penguins_count);
for (i = 0; i < pop->conf->penguins_count; i++) for (i = 0; i < pop->conf->penguins_count; i++)
{ {
Evas_Coord tx, ty;
tux = malloc(sizeof(Penguin)); tux = malloc(sizeof(Penguin));
o = edje_object_add(pop->canvas); o = edje_object_add(pop->canvas);
@ -410,7 +408,7 @@ _population_load(Population *pop)
evas_object_image_alpha_set(o, 0.5); evas_object_image_alpha_set(o, 0.5);
evas_object_color_set(o, pop->conf->alpha, pop->conf->alpha, evas_object_color_set(o, pop->conf->alpha, pop->conf->alpha,
pop->conf->alpha,pop->conf->alpha); pop->conf->alpha, pop->conf->alpha);
evas_object_pass_events_set(o, 1); evas_object_pass_events_set(o, 1);
tux->obj = o; tux->obj = o;
@ -443,11 +441,9 @@ _cb_animator(void *data)
{ {
Population *pop; Population *pop;
Evas_List *l; Evas_List *l;
double d;
int ran;
pop = data; pop = data;
for (l=pop->penguins; l ;l=l->next) for (l = pop->penguins; l; l = l->next)
{ {
Penguin *tux; Penguin *tux;
int touch; int touch;
@ -463,17 +459,17 @@ _cb_animator(void *data)
else if (tux->action->id == ID_FALLER) else if (tux->action->id == ID_FALLER)
{ {
tux->y += ((double)tux->action->speed / 100); tux->y += ((double)tux->action->speed / 100);
if (touch = _is_inside_any_win(pop, if ((touch = _is_inside_any_win(pop,
(int)tux->x+(tux->action->w/2), (int)tux->x+(tux->action->w/2),
(int)tux->y + tux->action->h, (int)tux->y + tux->action->h,
_RET_TOP_VALUE)) _RET_TOP_VALUE)))
{ {
if (( (int)tux->y - tux->faller_h) > MAX_FALLER_HEIGHT) if (( (int)tux->y - tux->faller_h) > MAX_FALLER_HEIGHT)
_start_splatting_at(tux, touch); _start_splatting_at(tux, touch);
else else
_start_walking_at(tux, touch); _start_walking_at(tux, touch);
} }
else if(( (int)tux->y + tux->action->h ) > pop->height) else if (( (int)tux->y + tux->action->h ) > pop->height)
{ {
if (( (int)tux->y - tux->faller_h) > MAX_FALLER_HEIGHT) if (( (int)tux->y - tux->faller_h) > MAX_FALLER_HEIGHT)
_start_splatting_at(tux, pop->height); _start_splatting_at(tux, pop->height);
@ -486,13 +482,13 @@ _cb_animator(void *data)
else if (tux->action->id == ID_FLOATER) else if (tux->action->id == ID_FLOATER)
{ {
tux->y += ((double)tux->action->speed / 100); tux->y += ((double)tux->action->speed / 100);
if (touch = _is_inside_any_win(pop, if ((touch = _is_inside_any_win(pop,
(int)tux->x+(tux->action->w/2), (int)tux->x+(tux->action->w/2),
(int)tux->y + tux->action->h, (int)tux->y + tux->action->h,
_RET_TOP_VALUE) _RET_TOP_VALUE)
) ))
_start_walking_at(tux, touch); _start_walking_at(tux, touch);
else if(( (int)tux->y + tux->action->h ) > pop->height) else if (( (int)tux->y + tux->action->h ) > pop->height)
_start_walking_at(tux, pop->height); _start_walking_at(tux, pop->height);
} }
@ -501,11 +497,11 @@ _cb_animator(void *data)
{ {
// random flyer // random flyer
if (_RAND(FLYER_PROB)){ if (_RAND(FLYER_PROB)){
_start_flying_at(tux,tux->y); _start_flying_at(tux, tux->y);
} }
// random custom // random custom
else if (_RAND(CUSTOM_PROB)){ else if (_RAND(CUSTOM_PROB)){
_start_custom_at(tux,tux->y+tux->action->h); _start_custom_at(tux, tux->y+tux->action->h);
} }
// left // left
else if (tux->reverse) else if (tux->reverse)
@ -603,7 +599,7 @@ _cb_animator(void *data)
} }
// printf("Place tux at x:%d y:%d w:%d h:%d\n",tux->x, tux->y,tux->action->w, tux->action->h); // printf("Place tux at x:%d y:%d w:%d h:%d\n", tux->x, tux->y, tux->action->w, tux->action->h);
evas_object_move(tux->obj, (int)tux->x, (int)tux->y); evas_object_move(tux->obj, (int)tux->x, (int)tux->y);
} }
@ -626,7 +622,7 @@ _is_inside_any_win(Population *pop, int x, int y, int ret_value)
if (es->visible) if (es->visible)
{ {
e_container_shape_geometry_get(es, &sx, &sy, &sw, &sh); e_container_shape_geometry_get(es, &sx, &sy, &sw, &sh);
//printf("E_shape: [%d] x:%d y:%d w:%d h:%d\n", es->visible,sx, sy, sw, sh); //printf("E_shape: [%d] x:%d y:%d w:%d h:%d\n", es->visible, sx, sy, sw, sh);
if ( ((x > sx) && (x < (sx+sw))) && if ( ((x > sx) && (x < (sx+sw))) &&
((y > sy) && (y < (sy+sh))) ) ((y > sy) && (y < (sy+sh))) )
{ {
@ -661,7 +657,7 @@ _is_inside_any_win(Population *pop, int x, int y, int ret_value)
static void static void
_start_walking_at(Penguin *tux, int at_y) _start_walking_at(Penguin *tux, int at_y)
{ {
printf("Start walking...at %d\n",at_y); printf("Start walking...at %d\n", at_y);
tux->action = evas_hash_find(tux->pop->actions, "Walker"); tux->action = evas_hash_find(tux->pop->actions, "Walker");
tux->y = at_y - tux->action->h; tux->y = at_y - tux->action->h;
@ -675,7 +671,7 @@ _start_walking_at(Penguin *tux, int at_y)
static void static void
_start_climbing_at(Penguin *tux, int at_x) _start_climbing_at(Penguin *tux, int at_x)
{ {
//printf("Start climbing...at: %d\n",at_x); //printf("Start climbing...at: %d\n", at_x);
tux->action = evas_hash_find(tux->pop->actions, "Climber"); tux->action = evas_hash_find(tux->pop->actions, "Climber");
evas_object_resize(tux->obj, tux->action->w, tux->action->h); evas_object_resize(tux->obj, tux->action->w, tux->action->h);
@ -747,7 +743,7 @@ static void
_cb_splatter_end (void *data, Evas_Object *o, const char *emi, const char *src) _cb_splatter_end (void *data, Evas_Object *o, const char *emi, const char *src)
{ {
_reborn((Penguin*)data); _reborn((Penguin*)data);
edje_object_signal_callback_del(o,"splatting_done","edje",_cb_splatter_end); edje_object_signal_callback_del(o,"splatting_done","edje", _cb_splatter_end);
} }
static void static void
@ -757,7 +753,7 @@ _start_splatting_at(Penguin *tux, int at_y)
evas_object_hide(tux->obj); evas_object_hide(tux->obj);
tux->action = evas_hash_find(tux->pop->actions, "Splatter"); tux->action = evas_hash_find(tux->pop->actions, "Splatter");
evas_object_resize(tux->obj, tux->action->w, tux->action->h); evas_object_resize(tux->obj, tux->action->w, tux->action->h);
evas_object_image_fill_set(tux->obj,0,0, tux->action->w, tux->action->h); evas_object_image_fill_set(tux->obj, 0, 0, tux->action->w, tux->action->h);
tux->y = at_y - tux->action->h; tux->y = at_y - tux->action->h;
if (tux->reverse) if (tux->reverse)
edje_object_signal_emit(tux->obj, "start_splatting_left", "epenguins"); edje_object_signal_emit(tux->obj, "start_splatting_left", "epenguins");
@ -765,9 +761,9 @@ _start_splatting_at(Penguin *tux, int at_y)
edje_object_signal_emit(tux->obj, "start_splatting_right", "epenguins"); edje_object_signal_emit(tux->obj, "start_splatting_right", "epenguins");
edje_object_signal_callback_add(tux->obj,"splatting_done","edje",_cb_splatter_end, tux); edje_object_signal_callback_add(tux->obj,"splatting_done","edje", _cb_splatter_end, tux);
evas_object_resize(tux->obj, tux->action->w, tux->action->h); evas_object_resize(tux->obj, tux->action->w, tux->action->h);
evas_object_image_fill_set(tux->obj,0,0, tux->action->w, tux->action->h); evas_object_image_fill_set(tux->obj, 0, 0, tux->action->w, tux->action->h);
evas_object_move(tux->obj,(int)tux->x,(int)tux->y); evas_object_move(tux->obj,(int)tux->x,(int)tux->y);
evas_object_show(tux->obj); evas_object_show(tux->obj);
} }
@ -788,8 +784,8 @@ _cb_custom_end (void *data, Evas_Object *o, const char *emi, const char *src)
} }
else else
{ {
edje_object_signal_callback_del(o,"custom_done","edje",_cb_custom_end); edje_object_signal_callback_del(o,"custom_done","edje", _cb_custom_end);
_start_walking_at(tux,tux->y+tux->custom->h); _start_walking_at(tux, tux->y+tux->custom->h);
tux->custom = NULL; tux->custom = NULL;
} }
} }
@ -799,8 +795,7 @@ static void
_start_custom_at(Penguin *tux, int at_y) _start_custom_at(Penguin *tux, int at_y)
{ {
int ran; int ran;
char buf[25];
if (tux->pop->custom_num < 1) if (tux->pop->custom_num < 1)
return; return;
@ -825,9 +820,9 @@ _start_custom_at(Penguin *tux, int at_y)
printf("START Custom Action n %d (%s) repeat: %d\n", ran, tux->custom->left_program_name,tux->r_count); printf("START Custom Action n %d (%s) repeat: %d\n", ran, tux->custom->left_program_name, tux->r_count);
edje_object_signal_callback_add(tux->obj,"custom_done","edje",_cb_custom_end, tux); edje_object_signal_callback_add(tux->obj,"custom_done","edje", _cb_custom_end, tux);
} }
/* static void /* static void

View File

@ -1,4 +1,4 @@
%define module_name penguins %define module_name penguins
Summary: %{module_name} module for the Enlightenment window manager Summary: %{module_name} module for the Enlightenment window manager
Name: e_modules-%{module_name} Name: e_modules-%{module_name}