make the module compile and works (more or less) again

This commit is contained in:
Davide Andreoli 2014-01-19 21:15:31 +01:00
parent 9a5abb6501
commit 8e4732c726
5 changed files with 148 additions and 32 deletions

83
.gitignore vendored Normal file
View File

@ -0,0 +1,83 @@
*~
*swo
*swp
ABOUT-NLS
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.guess
config.h
config.h.in
config.log
config.rpath
config.status
config.sub
configure
depcomp
e-module-penguins.edj
e_modules-penguins.spec
install-sh
libtool
ltmain.sh
m4/codeset.m4
m4/gettext.m4
m4/glibc21.m4
m4/iconv.m4
m4/intdiv0.m4
m4/intmax.m4
m4/inttypes-pri.m4
m4/inttypes.m4
m4/inttypes_h.m4
m4/isc-posix.m4
m4/lcmessage.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/libtool.m4
m4/longdouble.m4
m4/longlong.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
m4/nls.m4
m4/po.m4
m4/printf-posix.m4
m4/progtest.m4
m4/signed.m4
m4/size_max.m4
m4/stdint_h.m4
m4/uintmax_t.m4
m4/ulonglong.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/xsize.m4
missing
mkinstalldirs
module.desktop
po/*.gmo
po/Makefile
po/Makefile.in
po/Makefile.in.in
po/Makevars.template
po/POTFILES
po/Rules-quot
po/boldquot.sed
po/en@boldquot.header
po/en@quot.header
po/insert-header.sin
po/penguins.pot
po/quot.sed
po/remove-potcdate.sed
po/remove-potcdate.sin
po/stamp-po
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
src/*.o
src/*.lo
src/*.la
stamp-h1

View File

@ -18,10 +18,9 @@ static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static void _fill_data(Population *pop, E_Config_Dialog_Data *cfdata);
//static E_Config_Dialog *
//_pager_config_dialog(E_Container *con, const char *params)
E_Config_Dialog *
e_int_config_penguins_module(E_Container *con, const char *params)
e_int_config_penguins_module(E_Comp *comp, const char *params)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
@ -38,7 +37,7 @@ e_int_config_penguins_module(E_Container *con, const char *params)
v->basic.create_widgets = _basic_create_widgets;
snprintf(buf, sizeof(buf), "%s/e-module-penguins.edj", e_module_dir_get(pop->module));
cfd = e_config_dialog_new(con,
cfd = e_config_dialog_new(comp,
D_("Population Settings"),
"Penguins", "appearance/penguins",
buf, 0, v, pop);
@ -149,7 +148,6 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
Population *pop;
pop = cfd->data;
e_border_button_bindings_ungrab_all();
pop->conf->penguins_count = cfdata->penguins_count;
pop->conf->zoom = cfdata->zoom;
@ -159,7 +157,6 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
pop->conf->theme = eina_stringshare_ref(cfdata->theme);
e_config_save_queue();
e_border_button_bindings_grab_all();
_penguins_cb_config_updated(pop);
return 1;

View File

@ -4,7 +4,7 @@
# define E_MOD_CONFIG_H
# include "e_mod_main.h"
E_Config_Dialog *e_int_config_penguins_module(E_Container *con, const char *params);
E_Config_Dialog *e_int_config_penguins_module(E_Comp *comp, const char *params);
# endif
#endif

View File

@ -27,7 +27,6 @@ static void _start_falling_at(Penguin *tux, int at_x);
static void _start_flying_at(Penguin *tux, int at_y);
static void _start_splatting_at(Penguin *tux, int at_y);
static void _start_custom_at(Penguin *tux, int at_y);
//static void _win_shape_change(void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
static void _reborn(Penguin *tux);
static void _cb_custom_end(void *data, Evas_Object *o, const char *emi, const char *src);
static void _cb_click_l (void *data, Evas_Object *o, const char *emi, const char *src);
@ -132,7 +131,7 @@ _population_init(E_Module *m)
pop->conf->theme = eina_stringshare_add(buf);
}
managers = e_manager_list();
/*managers = e_manager_list();
for (l = managers; l; l = l->next)
{
E_Manager *man;
@ -147,24 +146,24 @@ _population_init(E_Module *m)
// con->name, con->x, con->y, con->w, con->h);
pop->cons = eina_list_append(pop->cons, con);
pop->canvas = con->bg_evas;
//e_container_shape_change_callback_add(con, _win_shape_change, NULL);
/* for (l3 = e_container_shape_list_get(con); l3; l3 = l3->next)
{
E_Container_Shape *es;
int x, y, w, h;
es = l3->data;
if (es->visible)
{
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);
}
} */
}
}
}
}*/
// E_Manager *man;
// EINA_LIST_FOREACH(e_manager_list(), l, man)
// {
// printf("PENGUINS: E_manager found\n");
// }
pop->canvas = e_manager_current_get()->comp->evas;
evas_output_viewport_get(pop->canvas, NULL, NULL, &pop->width, &pop->height);
//printf("PENGUINS: Get themes list\n");
// e_comp_util_wins_print(e_manager_current_get()->comp);
printf("PENGUINS: Get themes list\n");
Eina_List *files;
char *filename;
char *name;
@ -180,7 +179,7 @@ _population_init(E_Module *m)
name = edje_file_data_get(buf, "PopulationName");
if (name)
{
//printf("PENGUINS: Theme found: %s (%s)\n", filename, name);
printf("PENGUINS: Theme found: %s (%s)\n", filename, name);
pop->themes = eina_list_append(pop->themes, strdup(buf));
}
}
@ -189,9 +188,9 @@ _population_init(E_Module *m)
_theme_load(pop);
_population_load(pop);
pop->animator = ecore_animator_add(_cb_animator, pop);
return pop;
}
@ -251,13 +250,13 @@ _population_shutdown(Population *pop)
{
//printf("PENGUINS: KILL 'EM ALL\n");
while (pop->cons)
/* while (pop->cons)
{
E_Container *con;
con = pop->cons->data;
pop->cons = eina_list_remove_list(pop->cons, pop->cons);
}
}*/
_population_free(pop);
@ -416,7 +415,7 @@ _population_load(Population *pop)
evas_output_viewport_get(pop->canvas, &xx, &yy, &ww, &hh);
//printf("PENGUINS: Creating %d penguins\n", pop->conf->penguins_count);
printf("PENGUINS: Creating %d penguins\n", pop->conf->penguins_count);
for (i = 0; i < pop->conf->penguins_count; i++)
{
tux = malloc(sizeof(Penguin));
@ -680,7 +679,45 @@ static int
_is_inside_any_win(Population *pop, int x, int y, int ret_value)
{
Eina_List *l;
E_Container *con;
E_Client *ec;
// EINA_LIST_FOREACH(e_manager_current_get()->comp->clients, l, ec)
// {
// printf("PENGUINS: COMP EC%s: %p - '%s:%s' || %d,%d @ %dx%d\n", ec->focused ? "*" : "", ec, ec->icccm.name, ec->icccm.class, ec->x, ec->y, ec->w, ec->h);
// }
E_CLIENT_FOREACH(e_manager_current_get()->comp, ec)
{
// printf("PENGUINS: COMP EC%s: %p - '%s:%s' || %d,%d @ %dx%d\n", ec->focused ? "*" : "", ec, ec->icccm.name, ec->icccm.class, ec->x, ec->y, ec->w, ec->h);
if ((ec->w > 1) && (ec->h > 1))
{
if ( ((x > ec->x) && (x < (ec->x + ec->w))) &&
((y > ec->y) && (y < (ec->y + ec->h))) )
{
switch (ret_value)
{
case _RET_NONE_VALUE:
return 1;
break;
case _RET_RIGHT_VALUE:
return ec->x + ec->w;
break;
case _RET_BOTTOM_VALUE:
return ec->y + ec->h;
break;
case _RET_TOP_VALUE:
return ec->y;
break;
case _RET_LEFT_VALUE:
return ec->x;
break;
default:
return 1;
}
}
}
}
/*E_Container *con;
con = e_container_current_get(e_manager_current_get());
@ -718,7 +755,7 @@ _is_inside_any_win(Population *pop, int x, int y, int ret_value)
}
}
}
}
}*/
return 0;
}

View File

@ -42,7 +42,6 @@ struct _Config
struct _Population
{
E_Module *module;
Eina_List *cons;
Evas *canvas;
Ecore_Animator *animator;
Eina_List *penguins;