Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_canvas.c e_config.c e_config.h e_exec.c e_exec.h e_scrollframe.c e_scrollframe.h e_slidecore.c e_slidesel.c Log Message: gee.. um.. software-16 support in e17 - but beware! buggy buggy buggy. do not use this unless you wish to have much pain :) ummm... scrollframe thumb scroll has some heuristics on it to work better - exec returns exec handles... =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_canvas.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- e_canvas.c 11 Jan 2008 07:33:55 -0000 1.17 +++ e_canvas.c 20 Feb 2008 04:12:58 -0000 1.18 @@ -53,6 +53,12 @@ /* if use default - use it */ if (engine == E_EVAS_ENGINE_DEFAULT) engine = e_config->evas_engine_default; + /* if engine is software-16 - do we support it? */ + if (engine == E_EVAS_ENGINE_SOFTWARE_X11_16) + { + if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_X11_16)) + engine = E_EVAS_ENGINE_SOFTWARE_X11; + } /* if engine is gl - do we support it? */ if (engine == E_EVAS_ENGINE_GL_X11) { @@ -60,6 +66,7 @@ if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_GL_X11)) engine = E_EVAS_ENGINE_SOFTWARE_X11; } + /* support xrender? */ if (engine == E_EVAS_ENGINE_XRENDER_X11) { /* if we dont - fall back to software x11 */ @@ -204,6 +211,19 @@ if (direct_resize) ecore_evas_xrender_x11_direct_resize_set(ee, 1); if (win_ret) *win_ret = ecore_evas_xrender_x11_window_get(ee); if (subwin_ret) *subwin_ret = ecore_evas_xrender_x11_subwindow_get(ee); + } + else + goto try2; + } + else if (engine == E_EVAS_ENGINE_SOFTWARE_X11_16) + { + ee = ecore_evas_software_x11_16_new(NULL, win, x, y, w, h); + if (ee) + { + ecore_evas_override_set(ee, override); + if (direct_resize) ecore_evas_software_x11_16_direct_resize_set(ee, 1); + if (win_ret) *win_ret = ecore_evas_software_x11_16_window_get(ee); + if (subwin_ret) *subwin_ret = ecore_evas_software_x11_16_subwindow_get(ee); } else goto try2; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.281 retrieving revision 1.282 diff -u -3 -r1.281 -r1.282 --- e_config.c 13 Feb 2008 04:51:01 -0000 1.281 +++ e_config.c 20 Feb 2008 04:12:58 -0000 1.282 @@ -1792,7 +1792,10 @@ #if 0 l = evas_list_append(l, strdup("GL")); #endif - l = evas_list_append(l, strdup("XRENDER")); + if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_XRENDER_X11)) + l = evas_list_append(l, strdup("XRENDER")); + if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_X11_16)) + l = evas_list_append(l, strdup("SOFTWARE_16")); return l; } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.168 retrieving revision 1.169 diff -u -3 -r1.168 -r1.169 --- e_config.h 13 Feb 2008 04:51:01 -0000 1.168 +++ e_config.h 20 Feb 2008 04:12:58 -0000 1.169 @@ -36,10 +36,11 @@ #define E_CONFIG_FILE_GENERATION 0x0124 #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) -#define E_EVAS_ENGINE_DEFAULT 0 -#define E_EVAS_ENGINE_SOFTWARE_X11 1 -#define E_EVAS_ENGINE_GL_X11 2 -#define E_EVAS_ENGINE_XRENDER_X11 3 +#define E_EVAS_ENGINE_DEFAULT 0 +#define E_EVAS_ENGINE_SOFTWARE_X11 1 +#define E_EVAS_ENGINE_GL_X11 2 +#define E_EVAS_ENGINE_XRENDER_X11 3 +#define E_EVAS_ENGINE_SOFTWARE_X11_16 4 typedef enum _E_Engine_Context { =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_exec.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_exec.c 9 Feb 2008 22:47:09 -0000 1.11 +++ e_exec.c 20 Feb 2008 04:12:58 -0000 1.12 @@ -13,7 +13,6 @@ */ typedef struct _E_Exec_Launch E_Exec_Launch; -typedef struct _E_Exec_Instance E_Exec_Instance; typedef struct _E_Exec_Search E_Exec_Search; struct _E_Exec_Launch @@ -22,15 +21,6 @@ const char *launch_method; }; -struct _E_Exec_Instance -{ - Efreet_Desktop *desktop; - Ecore_Exe *exe; - int startup_id; - double launch_time; - Ecore_Timer *expire_timer; -}; - struct _E_Exec_Search { Efreet_Desktop *desktop; @@ -53,7 +43,7 @@ }; /* local subsystem functions */ -static void _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining); +static E_Exec_Instance *_e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining); static int _e_exec_cb_expire_timer(void *data); static int _e_exec_cb_exit(void *data, int type, void *event); @@ -104,15 +94,16 @@ return 1; } -EAPI int +EAPI E_Exec_Instance * e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Ecore_List *files, const char *launch_method) { E_Exec_Launch *launch; + E_Exec_Instance *inst = NULL; - if ((!desktop) && (!exec)) return 0; + if ((!desktop) && (!exec)) return NULL; launch = E_NEW(E_Exec_Launch, 1); - if (!launch) return 0; + if (!launch) return NULL; if (zone) { launch->zone = zone; @@ -124,13 +115,13 @@ if (desktop) { if (exec) - _e_exec_cb_exec(launch, NULL, strdup(exec), 0); + inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0); else - efreet_desktop_command_get(desktop, files, _e_exec_cb_exec, launch); + inst = efreet_desktop_command_get(desktop, files, _e_exec_cb_exec, launch); } else - _e_exec_cb_exec(launch, NULL, strdup(exec), 0); - return 1; + inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0); + return inst; } EAPI Efreet_Desktop * @@ -146,7 +137,7 @@ } /* local subsystem functions */ -static void +static E_Exec_Instance * _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) { E_Exec_Instance *inst = NULL; @@ -159,7 +150,7 @@ if (desktop) { inst = E_NEW(E_Exec_Instance, 1); - if (!inst) return; + if (!inst) return NULL; } if (startup_id == 0) @@ -229,7 +220,7 @@ "<br>" "%s<br>"), exec); - return; + return NULL; } /* reset env vars */ if (launch->launch_method) e_exehist_add(launch->launch_method, exec); @@ -264,8 +255,12 @@ } e_exec_start_pending = evas_list_append(e_exec_start_pending, desktop); } - else if (exe) - ecore_exe_free(exe); + else if (exe) + { + E_FREE(inst); + inst = NULL; + ecore_exe_free(exe); + } if (!remaining) { @@ -273,6 +268,7 @@ if (launch->zone) e_object_unref(E_OBJECT(launch->zone)); free(launch); } + return inst; } static int =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_exec.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_exec.h 25 Mar 2007 17:23:49 -0000 1.3 +++ e_exec.h 20 Feb 2008 04:12:58 -0000 1.4 @@ -3,13 +3,24 @@ */ #ifdef E_TYPEDEFS +typedef struct _E_Exec_Instance E_Exec_Instance; + #else #ifndef E_EXEC_H #define E_EXEC_H +struct _E_Exec_Instance +{ + Efreet_Desktop *desktop; + Ecore_Exe *exe; + int startup_id; + double launch_time; + Ecore_Timer *expire_timer; +}; + EAPI int e_exec_init(void); EAPI int e_exec_shutdown(void); -EAPI int e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Ecore_List *files, const char *launch_method); +EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Ecore_List *files, const char *launch_method); EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_scrollframe.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- e_scrollframe.c 23 Jan 2008 09:04:55 -0000 1.19 +++ e_scrollframe.c 20 Feb 2008 04:12:58 -0000 1.20 @@ -21,8 +21,6 @@ E_Scrollframe_Policy hbar_flags, vbar_flags; struct { - unsigned char now : 1; - unsigned char dragged : 1; Evas_Coord x, y; Evas_Coord sx, sy; Evas_Coord dx, dy; @@ -32,6 +30,10 @@ } history[20]; double anim_start; Ecore_Animator *momentum_animator; + unsigned char now : 1; + unsigned char dragged : 1; + unsigned char dir_x : 1; + unsigned char dir_y : 1; } down; struct { @@ -52,6 +54,7 @@ unsigned char hbar_visible : 1; unsigned char vbar_visible : 1; unsigned char extern_pan : 1; + unsigned char one_dir_at_a_time : 1; }; /* local subsystem functions */ @@ -329,6 +332,20 @@ return sd->edje_obj; } +EAPI void +e_scrollframe_single_dir_set(Evas_Object *obj, Evas_Bool single_dir) +{ + API_ENTRY return; + sd->one_dir_at_a_time = single_dir; +} + +EAPI Evas_Bool +e_scrollframe_single_dir_get(Evas_Object *obj) +{ + API_ENTRY return 0; + return sd->one_dir_at_a_time; +} + /* local subsystem functions */ static void _e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source) @@ -420,6 +437,8 @@ { sd->down.now = 1; sd->down.dragged = 0; + sd->down.dir_x = 0; + sd->down.dir_y = 0; sd->down.x = ev->canvas.x; sd->down.y = ev->canvas.y; e_scrollframe_child_pos_get(sd->smart_obj, &x, &y); @@ -547,6 +566,26 @@ x = ev->cur.canvas.x - sd->down.x; y = ev->cur.canvas.y - sd->down.y; + if ((sd->one_dir_at_a_time) && + (!sd->down.dir_x) && (!sd->down.dir_y)) + { + if (x > y) + { + if (x > e_config->thumbscroll_threshhold) + { + sd->down.dir_x = 1; + sd->down.dir_y = 0; + } + } + else + { + if (y > e_config->thumbscroll_threshhold) + { + sd->down.dir_x = 0; + sd->down.dir_y = 1; + } + } + } if ((sd->down.dragged) || (((x * x) + (y * y)) > (e_config->thumbscroll_threshhold * @@ -557,6 +596,11 @@ } x = sd->down.sx - (ev->cur.canvas.x - sd->down.x); 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; + } e_scrollframe_child_pos_set(sd->smart_obj, x, y); } } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_scrollframe.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_scrollframe.h 16 Apr 2007 15:23:11 -0000 1.5 +++ e_scrollframe.h 20 Feb 2008 04:12:58 -0000 1.6 @@ -30,6 +30,9 @@ EAPI void e_scrollframe_policy_set (Evas_Object *obj, E_Scrollframe_Policy hbar, E_Scrollframe_Policy vbar); EAPI void e_scrollframe_policy_get (Evas_Object *obj, E_Scrollframe_Policy *hbar, E_Scrollframe_Policy *vbar); EAPI Evas_Object *e_scrollframe_edje_object_get (Evas_Object *obj); +EAPI void e_scrollframe_single_dir_set (Evas_Object *obj, Evas_Bool single_dir); +EAPI Evas_Bool e_scrollframe_single_dir_get (Evas_Object *obj); + #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_slidecore.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_slidecore.c 5 Feb 2008 12:00:19 -0000 1.2 +++ e_slidecore.c 20 Feb 2008 04:12:58 -0000 1.3 @@ -210,6 +210,7 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_slidesel.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_slidesel.c 5 Feb 2008 12:00:19 -0000 1.2 +++ e_slidesel.c 20 Feb 2008 04:12:59 -0000 1.3 @@ -20,7 +20,9 @@ Evas_List *items; Evas_Coord down_x, down_y; E_Smart_Item *cur; + double down_time; unsigned char down : 1; + unsigned char down_cancel : 1; }; struct _E_Smart_Item @@ -123,9 +125,12 @@ ev = event_info; if (ev->button == 1) { + sd->down_time = ecore_time_get(); sd->down = 1; + sd->down_cancel = 0; sd->down_x = ev->canvas.x; sd->down_y = ev->canvas.y; + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,on", "e"); } } @@ -139,18 +144,22 @@ ev = event_info; if (ev->button == 1) { - Evas_Coord d1, d2, d; + double t; - d1 = ev->canvas.x - sd->down_x; - d2 = ev->canvas.y - sd->down_y; - d = (d1 * d1) + (d2 * d2); - if (d < (16 * 16)) + t = ecore_time_get(); + if (!sd->down_cancel) { + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)) { if (sd->cur) { - if (sd->cur->func) sd->cur->func(sd->cur->data); + /* get rid of accidental release and presses */ + if ((t - sd->down_time) > 0.2) + { + edje_object_signal_emit(sd->edje_obj, "e,action,select", "e"); + if (sd->cur->func) sd->cur->func(sd->cur->data); + } } } } @@ -166,6 +175,20 @@ sd = data; ev = event_info; + if ((sd->down) && (!sd->down_cancel)) + { + Evas_Coord d1, d2, d; + + printf("DRAG @ %3.3f\n", ecore_time_get()); + 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)) + { + edje_object_signal_emit(sd->edje_obj, "e,state,slide,hint,off", "e"); + sd->down_cancel = 1; + } + } } static void ------------------------------------------------------------------------- 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 enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs