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...


SVN revision: 33794
This commit is contained in:
Carsten Haitzler 2008-02-20 04:12:59 +00:00
parent 4dbd25097b
commit 2df5c4159c
11 changed files with 168 additions and 47 deletions

View File

@ -11,11 +11,11 @@ group {
description {
state: "default" 0.0;
rel1 {
offset: 4 4;
to_y: "e.text.label";
relative: 0.0 1.0;
offset: 0 4;
}
rel2 {
to_y: "e.text.label";
relative: 1.0 0.0;
offset: -5 -5;
}
}
@ -38,21 +38,21 @@ group {
description {
state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
offset: 4 -5;
relative: 0.0 0.0;
offset: 4 4;
}
rel2 {
relative: 1.0 1.0;
offset: -5 -5;
relative: 1.0 0.0;
offset: -5 4;
}
align: 0.0 1.0;
align: 0.0 0.0;
color: 255 255 255 255;
color3: 0 0 0 16;
text {
font: "Sans:style=Bold,Edje-Vera-Bold";
size: 10;
size: 20;
min: 0 1;
align: 0.0 1.0;
align: 0.0 0.0;
text_class: "slidesel_label";
}
}
@ -114,6 +114,24 @@ group {
// action: STATE_SET "default" 0.0;
// target: "outline";
// target: "event";
// target: "e.text.label";
}
program {
name: "hint_on";
signal: "e,state,slide,hint,on";
source: "e";
// action: STATE_SET "disabled" 0.0;
// target: "outline";
// target: "event";
// target: "e.text.label";
}
program {
name: "hint_off";
signal: "e,state,slide,hint,off";
source: "e";
// action: STATE_SET "disabled" 0.0;
// target: "outline";
// target: "event";
// target: "e.text.label";
}
}

View File

@ -53,6 +53,12 @@ e_canvas_engine_decide(int engine)
/* 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 @@ e_canvas_engine_decide(int engine)
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 */
@ -208,6 +215,19 @@ e_canvas_new(int engine_hint, Ecore_X_Window win, int x, int y, int w, int h,
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;
}
else
{
try2:

View File

@ -1792,7 +1792,10 @@ e_config_engine_list(void)
#if 0
l = evas_list_append(l, strdup("GL"));
#endif
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;
}

View File

@ -40,6 +40,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
#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
{

View File

@ -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 @@ struct _E_Exec_Launch
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 @@ struct _E_Config_Dialog_Data
};
/* 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 @@ e_exec_shutdown(void)
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 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
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 @@ e_exec_startup_id_pid_find(int startup_id, pid_t pid)
}
/* 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 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
if (desktop)
{
inst = E_NEW(E_Exec_Instance, 1);
if (!inst) return;
if (!inst) return NULL;
}
if (startup_id == 0)
@ -229,7 +220,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
"<br>"
"%s<br>"),
exec);
return;
return NULL;
}
/* reset env vars */
if (launch->launch_method) e_exehist_add(launch->launch_method, exec);
@ -265,7 +256,11 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
e_exec_start_pending = evas_list_append(e_exec_start_pending, desktop);
}
else if (exe)
{
E_FREE(inst);
inst = NULL;
ecore_exe_free(exe);
}
if (!remaining)
{
@ -273,6 +268,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
if (launch->zone) e_object_unref(E_OBJECT(launch->zone));
free(launch);
}
return inst;
}
static int

View File

@ -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);

View File

@ -21,8 +21,6 @@ struct _E_Smart_Data
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 @@ struct _E_Smart_Data
} 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 @@ struct _E_Smart_Data
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 @@ e_scrollframe_edje_object_get(Evas_Object *obj)
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 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
{
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 @@ _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
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 @@ _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
}
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);
}
}

View File

@ -30,6 +30,9 @@ EAPI void e_scrollframe_page_size_get (Evas_Object *obj, Evas_Coord *x
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

View File

@ -210,6 +210,7 @@ _e_smart_reconfigure(E_Smart_Data *sd)
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);

View File

@ -20,7 +20,9 @@ struct _E_Smart_Data
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 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
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,21 +144,25 @@ _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
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)
{
/* 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);
}
}
}
}
sd->down = 0;
}
}
@ -166,6 +175,20 @@ _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
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

View File

@ -97,6 +97,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
if (!strcmp("SOFTWARE", l->data)) engine = E_EVAS_ENGINE_SOFTWARE_X11;
else if (!strcmp("GL", l->data)) engine = E_EVAS_ENGINE_GL_X11;
else if (!strcmp("XRENDER", l->data)) engine = E_EVAS_ENGINE_XRENDER_X11;
else if (!strcmp("SOFTWARE_16", l->data)) engine = E_EVAS_ENGINE_SOFTWARE_X11_16;
else continue;
ob = e_widget_radio_add(evas, _(l->data), engine, rg);
e_widget_framelist_object_append(of, ob);