add a test file that we can destroy at will for testing bits of new code...


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 18 years ago
parent d95a31723a
commit bbd2093235
  1. 4
      src/bin/Makefile.am
  2. 2
      src/bin/e_layout.c
  3. 3
      src/bin/e_main.c
  4. 2
      src/bin/e_table.c
  5. 178
      src/bin/e_test.c
  6. 12
      src/bin/e_test.h

@ -43,7 +43,8 @@ e_gadman.h \
e_signals.h \
e_xinerama.h \
e_table.h \
e_layout.h
e_layout.h \
e_test.h
enlightenment_SOURCES = \
@ -81,6 +82,7 @@ e_signals.c \
e_xinerama.c \
e_table.c \
e_layout.c \
e_test.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@

@ -113,7 +113,7 @@ e_layout_pack(Evas_Object *obj, Evas_Object *child)
sd = evas_object_smart_data_get(obj);
_e_layout_smart_adopt(sd, child);
sd->items = evas_list_append(sd->items, child);
li = evas_object_data_get(obj, "e_layout_data");
li = evas_object_data_get(child, "e_layout_data");
_e_layout_smart_move_resize_item(li);
}

@ -329,6 +329,9 @@ main(int argc, char **argv)
ecore_timer_add(16.0, _e_main_cb_startup_fake_end, NULL);
}
/* run any testing code now we are set up */
e_test();
/* start our main loop */
ecore_main_loop_begin();

@ -119,7 +119,7 @@ e_table_pack(Evas_Object *obj, Evas_Object *child, int col, int row, int colspan
sd = evas_object_smart_data_get(obj);
_e_table_smart_adopt(sd, child);
sd->items = evas_list_append(sd->items, child);
ti = evas_object_data_get(obj, "e_table_data");
ti = evas_object_data_get(child, "e_table_data");
if (ti)
{
ti->col = col;

@ -0,0 +1,178 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
static void _e_test_internal(E_Container *con);
static void _cb_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change);
void
e_test(void)
{
Evas_List *managers, *l, *ll;
managers = e_manager_list();
for (l = managers; l; l = l->next)
{
E_Manager *man;
man = l->data;
for (ll = man->containers; ll; ll = ll->next)
{
E_Container *con;
con = ll->data;
_e_test_internal(con);
}
}
}
#if 0
/* local subsystem functions */
typedef struct _Dat Dat;
struct _Dat
{
Evas_Object *table;
Evas_List *items;
};
static void
_e_test_internal(E_Container *con)
{
E_Gadman_Client *gmc;
Dat *dat;
Evas_Object *o;
int i, j;
dat = calloc(1, sizeof(Dat));
dat->table = e_table_add(con->bg_evas);
e_table_freeze(dat->table);
e_table_homogenous_set(dat->table, 1);
for (j = 0; j < 5; j++)
{
for (i = 0; i < 5; i++)
{
o = evas_object_rectangle_add(con->bg_evas);
dat->items = evas_list_append(dat->items, o);
evas_object_color_set(o, i * 50, j * 50, 100, 100);
e_table_pack(dat->table, o, i, j, 1, 1);
e_table_pack_options_set(o, 1, 1, 1, 1, 0.5, 0.5, 0, 0, -1, -1);
evas_object_show(o);
}
}
e_table_thaw(dat->table);
evas_object_show(dat->table);
gmc = e_gadman_client_new(con->gadman);
e_gadman_client_domain_set(gmc, "TEST", 0);
e_gadman_client_policy_set(gmc,
E_GADMAN_POLICY_ANYWHERE |
E_GADMAN_POLICY_HMOVE |
E_GADMAN_POLICY_VMOVE |
E_GADMAN_POLICY_HSIZE |
E_GADMAN_POLICY_VSIZE);
e_gadman_client_min_size_set(gmc, 10, 10);
e_gadman_client_auto_size_set(gmc, 128, 128);
e_gadman_client_align_set(gmc, 0.5, 0.5);
e_gadman_client_resize(gmc, 128, 128);
e_gadman_client_change_func_set(gmc, _cb_change, dat);
e_gadman_client_load(gmc);
}
static void
_cb_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change)
{
Dat *dat;
Evas_Coord x, y, w, h;
dat = data;
switch (change)
{
case E_GADMAN_CHANGE_MOVE_RESIZE:
e_gadman_client_geometry_get(gmc, &x, &y, &w, &h);
evas_object_move(dat->table, x, y);
evas_object_resize(dat->table, w, h);
break;
default:
break;
}
}
#elif 0
typedef struct _Dat Dat;
struct _Dat
{
Evas_Object *layout;
Evas_List *items;
};
static void
_e_test_internal(E_Container *con)
{
E_Gadman_Client *gmc;
Dat *dat;
Evas_Object *o;
int i;
dat = calloc(1, sizeof(Dat));
dat->layout = e_layout_add(con->bg_evas);
e_layout_freeze(dat->layout);
e_layout_virtual_size_set(dat->layout, 800, 600);
for (i = 0; i < 10; i++)
{
Evas_Coord x, y, w, h;
o = evas_object_rectangle_add(con->bg_evas);
dat->items = evas_list_append(dat->items, o);
evas_object_color_set(o, i * 25, 255 - (i * 25), 100, 100);
e_layout_pack(dat->layout, o);
w = rand() % 800;
h = rand() % 600;
x = rand() % (800 - w);
y = rand() % (600 - h);
e_layout_child_move(o, x, y);
e_layout_child_resize(o, w, h);
evas_object_show(o);
}
e_layout_thaw(dat->layout);
evas_object_show(dat->layout);
gmc = e_gadman_client_new(con->gadman);
e_gadman_client_domain_set(gmc, "TEST", 0);
e_gadman_client_policy_set(gmc,
E_GADMAN_POLICY_ANYWHERE |
E_GADMAN_POLICY_HMOVE |
E_GADMAN_POLICY_VMOVE |
E_GADMAN_POLICY_HSIZE |
E_GADMAN_POLICY_VSIZE);
e_gadman_client_min_size_set(gmc, 10, 10);
e_gadman_client_auto_size_set(gmc, 128, 128);
e_gadman_client_align_set(gmc, 0.5, 0.5);
e_gadman_client_resize(gmc, 128, 128);
e_gadman_client_change_func_set(gmc, _cb_change, dat);
e_gadman_client_load(gmc);
}
static void
_cb_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change)
{
Dat *dat;
Evas_Coord x, y, w, h;
dat = data;
switch (change)
{
case E_GADMAN_CHANGE_MOVE_RESIZE:
e_gadman_client_geometry_get(gmc, &x, &y, &w, &h);
evas_object_move(dat->layout, x, y);
evas_object_resize(dat->layout, w, h);
break;
default:
break;
}
}
#else
static void
_e_test_internal(E_Container *con)
{
}
#endif

@ -0,0 +1,12 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_TEST_H
#define E_TEST_H
EAPI void e_test(void);
#endif
#endif
Loading…
Cancel
Save