Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_config.c e_config.h e_gadcon.c e_int_config_theme.c
e_shelf.c e_shelf.h
Log Message:
some more work on shelves/gadcon
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -3 -r1.162 -r1.163
--- e_config.c 1 Apr 2006 09:24:56 -0000 1.162
+++ e_config.c 3 Apr 2006 14:01:00 -0000 1.163
@@ -113,6 +113,8 @@
E_CONFIG_VAL(D, T, h, INT);
E_CONFIG_VAL(D, T, orient, INT);
E_CONFIG_VAL(D, T, style, STR);
+ E_CONFIG_VAL(D, T, fit_along, UCHAR);
+ E_CONFIG_VAL(D, T, fit_size, UCHAR);
_e_config_shelf_edd = E_CONFIG_DD_NEW("E_Config_Shelf", E_Config_Shelf);
#undef T
@@ -1045,6 +1047,8 @@
cf_escf->w = 800;
cf_escf->h = 40;
cf_escf->orient = E_GADCON_ORIENT_TOP;
+ cf_escf->fit_along = 1;
+ cf_escf->fit_size = 0;
cf_escf->style = evas_stringshare_add("default");
cf_es->configs = evas_list_append(cf_es->configs, cf_escf);
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -3 -r1.92 -r1.93
--- e_config.h 1 Apr 2006 01:27:47 -0000 1.92
+++ e_config.h 3 Apr 2006 14:01:00 -0000 1.93
@@ -335,6 +335,8 @@
int x, y, w, h;
int orient;
const char *style;
+ unsigned char fit_along;
+ unsigned char fit_size;
};
EAPI int e_config_init(void);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_gadcon.c 2 Apr 2006 11:35:35 -0000 1.12
+++ e_gadcon.c 3 Apr 2006 14:01:00 -0000 1.13
@@ -72,6 +72,12 @@
evas_object_del(gcc->o_base);
}
+static void
+__test3(E_Gadcon_Client *gcc)
+{
+ e_gadcon_client_min_size_set(gcc, 80, 20);
+}
+
/* externally accessible functions */
EAPI int
e_gadcon_init(void)
@@ -84,7 +90,7 @@
GADCON_CLIENT_CLASS_VERSION,
"ibar",
{
- __test, __test2, NULL
+ __test, __test2, __test3
}
};
e_gadcon_provider_register(&cc);
@@ -585,12 +591,14 @@
Evas_Coord w, h;
e_gadcon_layout_min_size_get(gc->o_container, &w, &h);
+ /* FIXME: this needs to be controlled */
if (gc->edje.o_parent)
{
edje_extern_object_min_size_set(gc->o_container, w, h);
edje_object_part_swallow(gc->edje.o_parent, gc->edje.swallow_name,
gc->o_container);
}
+ printf("new minh/h\n");
gc->resize_request.func(gc->resize_request.data, gc, w, h);
}
}
@@ -1658,7 +1666,7 @@
{
sd->minw = min;
sd->minh = mino;
- evas_object_smart_callback_call(sd->obj, "size_requeset", NULL);
+ evas_object_smart_callback_call(sd->obj, "size_request", NULL);
}
}
else
@@ -1667,7 +1675,7 @@
{
sd->minw = mino;
sd->minh = min;
- evas_object_smart_callback_call(sd->obj, "size_requeset", NULL);
+ evas_object_smart_callback_call(sd->obj, "size_request", NULL);
}
}
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_theme.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- e_int_config_theme.c 2 Apr 2006 04:18:18 -0000 1.21
+++ e_int_config_theme.c 3 Apr 2006 14:01:00 -0000 1.22
@@ -200,7 +200,7 @@
E_Cfg_Theme_Data *cb_data;
if (!e_thumb_exists(fulltheme))
- o3 = e_thumb_generate_begin(fulltheme, 48, 48,
cfd->dia->win->evas, &o, NULL, NULL);
+ o3 = e_thumb_generate_begin(fulltheme, 48, 48,
cfd->dia->win->evas, &o3, NULL, NULL);
else
o3 = e_thumb_evas_object_get(fulltheme,
cfd->dia->win->evas, 48, 48, 1);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- e_shelf.c 26 Mar 2006 06:06:57 -0000 1.9
+++ e_shelf.c 3 Apr 2006 14:01:00 -0000 1.10
@@ -5,10 +5,7 @@
static void _e_shelf_free(E_Shelf *es);
static void _e_shelf_config_port(E_Config_Shelf_Config *cf1,
E_Config_Shelf_Config *cf2);
-static void _e_shelf_cb_signal_all(void *data, Evas_Object *obj, const char
*emission, const char *source);
-static void _e_shelf_cb_signal_move_start(void *data, Evas_Object *obj, const
char *emission, const char *source);
-static void _e_shelf_cb_signal_move_go(void *data, Evas_Object *obj, const
char *emission, const char *source);
-static void _e_shelf_cb_signal_move_stop(void *data, Evas_Object *obj, const
char *emission, const char *source);
+static void _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord
w, Evas_Coord h);
static Evas_List *shelves = NULL;
static int shelf_id = 0;
@@ -133,6 +130,7 @@
es->ee = zone->container->bg_ecore_evas;
es->evas = zone->container->bg_evas;
}
+// es->fit_along = 1;
es->layer = layer;
es->zone = zone;
es->style = evas_stringshare_add(style);
@@ -155,19 +153,11 @@
evas_object_layer_set(es->o_base, layer);
}
- edje_object_signal_callback_add(es->o_base, "*", "*",
- _e_shelf_cb_signal_all, es);
- edje_object_signal_callback_add(es->o_base, "mouse,down,1", "drag*",
- _e_shelf_cb_signal_move_start, es);
- edje_object_signal_callback_add(es->o_base, "mouse,move", "drag*",
- _e_shelf_cb_signal_move_go, es);
- edje_object_signal_callback_add(es->o_base, "mouse,up,1", "drag*",
- _e_shelf_cb_signal_move_stop, es);
-
-
snprintf(buf, sizeof(buf), "%i", shelf_id);
shelf_id++;
es->gadcon = e_gadcon_swallowed_new(es->name, buf, es->o_base, "items");
+ e_gadcon_size_request_callback_set(es->gadcon, _e_shelf_gadcon_size_request,
+ es);
e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
e_gadcon_zone_set(es->gadcon, zone);
e_gadcon_ecore_evas_set(es->gadcon, es->ee);
@@ -419,60 +409,56 @@
}
static void
-_e_shelf_cb_signal_all(void *data, Evas_Object *obj, const char *emission,
const char *source)
-{
- E_Shelf *es;
-
- es = data;
- printf("SIG: %s %s\n", emission, source);
-}
-
-static void
-_e_shelf_cb_signal_move_start(void *data, Evas_Object *obj, const char
*emission, const char *source)
+_e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w,
Evas_Coord h)
{
E_Shelf *es;
+ Evas_Coord nx, ny, nw, nh;
es = data;
- printf("MV start\n");
- es->moveresize.pos.x = es->x;
- es->moveresize.pos.y = es->y;
- es->moveresize.move = 1;
- ecore_x_pointer_last_xy_get(&(es->moveresize.x), &(es->moveresize.y));
-}
-
-static void
-_e_shelf_cb_signal_move_go(void *data, Evas_Object *obj, const char *emission,
const char *source)
-{
- E_Shelf *es;
- int x, y;
-
- es = data;
- if (es->moveresize.move)
- {
- int x, y, nx, ny, nw, nh;
-
- printf("MV go\n");
- ecore_x_pointer_last_xy_get(&x, &y);
- nx = x = es->moveresize.pos.x + (x - es->moveresize.x);
- ny = y = es->moveresize.pos.y + (y - es->moveresize.y);
- e_resist_container_border_position(es->zone->container,
- NULL,
- es->x, es->y, es->w, es->h,
- x, y, es->w, es->h,
- &nx, &ny, &nw, &nh);
- e_shelf_move(es, nx, ny);
- }
-}
-
-static void
-_e_shelf_cb_signal_move_stop(void *data, Evas_Object *obj, const char
*emission, const char *source)
-{
- E_Shelf *es;
-
- es = data;
- if (es->moveresize.move)
- {
- printf("MV stop\n");
- es->moveresize.move = 0;
+ nx = es->x;
+ ny = es->y;
+ nw = es->w;
+ nh = es->h;
+ edje_object_size_min_calc(es->o_base, &nw, &nh);
+ printf("new w, h = %i %i\n", nw, nh);
+ switch (gc->orient)
+ {
+ case E_GADCON_ORIENT_FLOAT:
+ break;
+ case E_GADCON_ORIENT_HORIZ:
+ break;
+ case E_GADCON_ORIENT_VERT:
+ break;
+ case E_GADCON_ORIENT_LEFT:
+ break;
+ case E_GADCON_ORIENT_RIGHT:
+ break;
+ case E_GADCON_ORIENT_TOP:
+ if (!es->fit_along) nw = es->w;
+ if (!es->fit_size) nh = es->h;
+ if (nw > es->zone->w) nw = es->zone->w;
+ if (nh > es->zone->h) nh = es->zone->h;
+ if (nw != es->w) nx = es->x + ((es->w - es->w) / 2);
+ ny = 0;
+ break;
+ case E_GADCON_ORIENT_BOTTOM:
+ if (!es->fit_along) nw = es->w;
+ if (!es->fit_size) nh = es->h;
+ if (nw > es->zone->w) nw = es->zone->w;
+ if (nh > es->zone->h) nh = es->zone->h;
+ if (nw != es->w) nx = es->x + ((es->w - es->w) / 2);
+ ny = es->zone->h - nh;
+ break;
+ case E_GADCON_ORIENT_CORNER_TL:
+ break;
+ case E_GADCON_ORIENT_CORNER_TR:
+ break;
+ case E_GADCON_ORIENT_CORNER_BL:
+ break;
+ case E_GADCON_ORIENT_CORNER_BR:
+ break;
+ default:
+ break;
}
+ e_shelf_move_resize(es, nx, ny, nw, nh);
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_shelf.h 26 Mar 2006 06:06:57 -0000 1.7
+++ e_shelf.h 3 Apr 2006 14:01:00 -0000 1.8
@@ -25,14 +25,8 @@
const char *name;
const char *style;
E_Config_Shelf *cfg;
- struct {
- int x, y;
- struct {
- int x, y;
- } pos;
- int move;
- int resize;
- } moveresize;
+ unsigned char fit_along : 1;
+ unsigned char fit_size : 1;
};
EAPI int e_shelf_init(void);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs