Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_dnd.c e_scrollframe.c e_slidecore.c e_slidesel.c
Log Message:
fix sys battery reader to support lowercase bats too...
some other bugs and fixes
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_dnd.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -3 -r1.66 -r1.67
--- e_dnd.c 19 Nov 2007 11:38:43 -0000 1.66
+++ e_dnd.c 26 Feb 2008 09:47:50 -0000 1.67
@@ -618,11 +618,13 @@
switch (h->obj->type)
{
case E_GADCON_TYPE:
- e_shelf_toggle(e_gadcon_shelf_get((E_Gadcon *)(h->obj)), 1);
- break;
+ /* FIXME: this is wrong - it ASSUMES the holder is a shelf */
+// e_shelf_toggle(e_gadcon_shelf_get((E_Gadcon *)(h->obj)), 1);
+ break;
case E_GADCON_CLIENT_TYPE:
- e_shelf_toggle(e_gadcon_shelf_get(((E_Gadcon_Client
*)(h->obj))->gadcon), 1);
- break;
+ /* FIXME: this is wrong - it ASSUMES the holder is a shelf */
+// e_shelf_toggle(e_gadcon_shelf_get(((E_Gadcon_Client
*)(h->obj))->gadcon), 1);
+ break;
/* FIXME: add more types as needed */
default:
break;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_scrollframe.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_scrollframe.c 20 Feb 2008 04:12:58 -0000 1.20
+++ e_scrollframe.c 26 Feb 2008 09:47:50 -0000 1.21
@@ -30,10 +30,12 @@
} history[20];
double anim_start;
Ecore_Animator *momentum_animator;
+ Evas_Coord locked_x, locked_y;
unsigned char now : 1;
unsigned char dragged : 1;
unsigned char dir_x : 1;
unsigned char dir_y : 1;
+ unsigned char locked : 1;
} down;
struct {
@@ -63,6 +65,7 @@
static void _e_smart_pan_pan_changed_hook(void *data, Evas_Object *obj, void
*event_info);
static void _e_smart_event_wheel(void *data, Evas *e, Evas_Object *obj, void
*event_info);
static void _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj,
void *event_info);
+static int _e_smart_momentum_animator(void *data);
static void _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj,
void *event_info);
static void _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj,
void *event_info);
static void _e_smart_event_key_down(void *data, Evas *e, Evas_Object *obj,
void *event_info);
@@ -435,6 +438,7 @@
}
if (ev->button == 1)
{
+ printf("down @ %3.3f\n", ecore_time_get());
sd->down.now = 1;
sd->down.dragged = 0;
sd->down.dir_x = 0;
@@ -444,6 +448,7 @@
e_scrollframe_child_pos_get(sd->smart_obj, &x, &y);
sd->down.sx = x;
sd->down.sy = y;
+ sd->down.locked = 0;
memset(&(sd->down.history[0]), 0, sizeof(sd->down.history[0]) *
20);
sd->down.history[0].timestamp = ecore_time_get();
sd->down.history[0].x = ev->canvas.x;
@@ -453,7 +458,7 @@
}
static int
-_e_cb_momentum_animator(void *data)
+_e_smart_momentum_animator(void *data)
{
E_Smart_Data *sd;
double t, dt, p;
@@ -494,7 +499,7 @@
{
if (ev->button == 1)
{
-
+ printf("up @ %3.3f\n", ecore_time_get());
x = ev->canvas.x - sd->down.x;
y = ev->canvas.y - sd->down.y;
if (sd->down.dragged)
@@ -529,7 +534,7 @@
(vel > e_config->thumbscroll_momentum_threshhold))
{
if (!sd->down.momentum_animator)
- sd->down.momentum_animator =
ecore_animator_add(_e_cb_momentum_animator, sd);
+ sd->down.momentum_animator =
ecore_animator_add(_e_smart_momentum_animator, sd);
sd->down.dx = ((double)dx / at);
sd->down.dy = ((double)dy / at);
sd->down.anim_start = t;
@@ -565,7 +570,9 @@
sd->down.history[0].y = ev->cur.canvas.y;
x = ev->cur.canvas.x - sd->down.x;
+ if (x < 0) x = -x;
y = ev->cur.canvas.y - sd->down.y;
+ if (y < 0) y = -y;
if ((sd->one_dir_at_a_time) &&
(!sd->down.dir_x) && (!sd->down.dir_y))
{
@@ -598,8 +605,15 @@
y = sd->down.sy - (ev->cur.canvas.y - sd->down.y);
if ((sd->down.dir_x) || (sd->down.dir_y))
{
- if (sd->down.dir_x) y = sd->down.sy;
- else x = sd->down.sx;
+ if (!sd->down.locked)
+ {
+ printf("lock dir to x%iy%i\n", sd->down.dir_x,
sd->down.dir_y);
+ sd->down.locked_x = x;
+ sd->down.locked_y = y;
+ sd->down.locked = 1;
+ }
+ if (sd->down.dir_x) y = sd->down.locked_y;
+ else x = sd->down.locked_x;
}
e_scrollframe_child_pos_set(sd->smart_obj, x, y);
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_slidecore.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_slidecore.c 20 Feb 2008 04:12:58 -0000 1.3
+++ e_slidecore.c 26 Feb 2008 09:47:50 -0000 1.4
@@ -10,9 +10,9 @@
typedef struct _E_Smart_Item E_Smart_Item;
struct _E_Smart_Data
-{
+{
Evas_Coord x, y, w, h;
-
+
Evas_Object *smart_obj;
Evas_Object *event_obj;
Evas_Object *o1, *o2;
@@ -20,7 +20,7 @@
Evas_Coord dist, pos;
int p1, p2, pn;
unsigned char down : 1;
-};
+};
struct _E_Smart_Item
{
@@ -70,7 +70,7 @@
e_slidecore_item_add(Evas_Object *obj, const char *label, const char *icon,
void (*func) (void *data), void *data)
{
E_Smart_Item *it;
-
+
API_ENTRY return;
it = calloc(1, sizeof(E_Smart_Item));
if (!it) return;
@@ -133,10 +133,10 @@
Evas_Coord dp, pos;
int p1, p2, at, pl1, pl2, n;
int r, g, b, a;
-
+
evas_object_move(sd->event_obj, sd->x, sd->y);
evas_object_resize(sd->event_obj, sd->w, sd->h);
-
+
pos = sd->pos;
n = evas_list_count(sd->items);
while (pos < 0) pos += (sd->dist * n);
@@ -144,7 +144,7 @@
p2 = (pos + sd->dist) / sd->dist;
dp = pos - (p1 * sd->dist);
at = (dp * 255) / (sd->dist - 1);
-
+
while ((p1 < 0) || (p2 < 0))
{
p1 += n;
@@ -155,7 +155,7 @@
if ((sd->p1 != p1) || (sd->p2 != p2) || (sd->pn != n))
{
E_Smart_Item *it1, *it2;
-
+
/* FIXME: delete old o1, o2, create new o1, o2 */
sd->pn = n;
if (n > 0)
@@ -172,7 +172,7 @@
it2 = evas_list_nth(sd->items, pl2);
if (it1 && it2)
{
- sd->o1 = e_util_icon_theme_icon_add(it1->icon, "512x512",
+ sd->o1 = e_util_icon_theme_icon_add(it1->icon, "512x512",
evas_object_evas_get(sd->smart_obj));
if (sd->o1)
{
@@ -184,7 +184,7 @@
evas_object_clip_set(sd->o1,
evas_object_clip_get(sd->smart_obj));
evas_object_show(sd->o1);
}
- sd->o2 = e_util_icon_theme_icon_add(it2->icon, "512x512",
+ sd->o2 = e_util_icon_theme_icon_add(it2->icon, "512x512",
evas_object_evas_get(sd->smart_obj));
if (sd->o2)
{
@@ -196,7 +196,7 @@
evas_object_clip_set(sd->o2,
evas_object_clip_get(sd->smart_obj));
evas_object_show(sd->o2);
}
- if (a < 128)
+ if (at < 128)
{
if (it1->func) it1->func(it1->data);
}
@@ -208,12 +208,12 @@
}
}
evas_object_color_get(sd->smart_obj, &r, &g, &b, &a);
-
+
evas_object_move(sd->o1, sd->x - sd->dist + dp, sd->y);
// printf("SZ: %ix%i\n", sd->w + sd->dist + sd->dist, sd->h);
evas_object_resize(sd->o1, sd->w + sd->dist + sd->dist, sd->h);
evas_object_color_set(sd->o1, r, g, b, a);
-
+
evas_object_move(sd->o2, sd->x - sd->dist - sd->dist + dp, sd->y);
evas_object_resize(sd->o2, sd->w + sd->dist + sd->dist, sd->h);
evas_object_color_set(sd->o2, (r * at) / 255, (g * at) / 255, (b * at) /
255, (a * at) / 255);
@@ -224,24 +224,24 @@
{
E_Smart_Data *sd;
Evas_Object *o;
-
+
sd = calloc(1, sizeof(E_Smart_Data));
if (!sd) return;
evas_object_smart_data_set(obj, sd);
-
+
sd->smart_obj = obj;
sd->x = 0;
sd->y = 0;
sd->w = 0;
sd->h = 0;
-
+
evas_object_propagate_events_set(obj, 0);
sd->dist = 48;
sd->pos = 0;
sd->p1 = -1;
sd->p2 = -1;
-
+
o = evas_object_rectangle_add(evas_object_evas_get(obj));
sd->event_obj = o;
evas_object_color_set(o, 0, 0, 0, 0);
@@ -256,7 +256,19 @@
_e_smart_del(Evas_Object *obj)
{
INTERNAL_ENTRY;
+ while (sd->items)
+ {
+ E_Smart_Item *it;
+
+ it = sd->items->data;
+ sd->items = evas_list_remove_list(sd->items, sd->items);
+ if (it->label) evas_stringshare_del(it->label);
+ if (it->icon) evas_stringshare_del(it->icon);
+ free(it);
+ }
evas_object_del(sd->event_obj);
+ if (sd->o1) evas_object_del(sd->o1);
+ if (sd->o2) evas_object_del(sd->o2);
free(sd);
}
@@ -314,7 +326,7 @@
{
INTERNAL_ENTRY;
evas_object_clip_unset(sd->event_obj);
-}
+}
/* never need to touch this */
@@ -328,7 +340,7 @@
SMART_NAME,
EVAS_SMART_CLASS_VERSION,
_e_smart_add,
- _e_smart_del,
+ _e_smart_del,
_e_smart_move,
_e_smart_resize,
_e_smart_show,
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_slidesel.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_slidesel.c 20 Feb 2008 04:12:59 -0000 1.3
+++ e_slidesel.c 26 Feb 2008 09:47:50 -0000 1.4
@@ -183,7 +183,7 @@
d1 = ev->cur.canvas.x - sd->down_x;
d2 = ev->cur.canvas.y - sd->down_y;
d = (d1 * d1) + (d2 * d2);
- if (d > (16 * 16))
+ if (d > (64 * 64))
{
edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off",
"e");
sd->down_cancel = 1;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs