patches, caching fixes, zone dynamic creation/deletion handling, stuff.

SVN revision: 33127
This commit is contained in:
Carsten Haitzler 2007-12-14 05:57:16 +00:00
parent 1e54439422
commit 4a2bc0e79c
7 changed files with 169 additions and 7 deletions

View File

@ -194,7 +194,7 @@ group {
mouse_events: 1;
dragable {
x: 0 0 0;
y: 1 1 0;
y: -1 1 0;
confine: "sld_base";
}
description {

View File

@ -738,7 +738,8 @@ e_border_hide(E_Border *bd, int manage)
e_border_focus_set(bd, 0, 1);
if (manage != 2)
{
if (e_config->focus_policy == E_FOCUS_CLICK && e_config->focus_revert_on_hide_or_close)
if ((e_config->focus_policy == E_FOCUS_CLICK) &&
(e_config->focus_revert_on_hide_or_close))
e_desk_last_focused_focus(bd->desk);
}
}
@ -1353,6 +1354,10 @@ EAPI void
e_border_focus_set_with_pointer(E_Border *bd)
{
if (e_config->focus_policy == E_FOCUS_SLOPPY)
{
e_border_focus_set(bd, 1, 1);
}
else if (e_config->focus_policy == E_FOCUS_MOUSE)
{
if (e_border_under_pointer_get(NULL, bd))
{

View File

@ -17,10 +17,16 @@ static int _e_zone_cb_mouse_out(void *data, int type, void *event);
static int _e_zone_cb_timer(void *data);
static int _e_zone_cb_desk_show(void *data, int type, void *event);
static void _e_zone_update_flip(E_Zone *zone);
static void _e_zone_event_move_resize_free(void *data, void *ev);
static void _e_zone_event_add_free(void *data, void *ev);
static void _e_zone_event_del_free(void *data, void *ev);
static void _e_zone_object_del_attach(void *o);
EAPI int E_EVENT_ZONE_DESK_COUNT_SET = 0;
EAPI int E_EVENT_POINTER_WARP = 0;
EAPI int E_EVENT_ZONE_MOVE_RESIZE = 0;
EAPI int E_EVENT_ZONE_ADD = 0;
EAPI int E_EVENT_ZONE_DEL = 0;
/* FIXME: We need a EDGE_MOVE event */
EAPI int E_EVENT_ZONE_EDGE_IN = 0;
EAPI int E_EVENT_ZONE_EDGE_OUT = 0;
@ -36,6 +42,8 @@ e_zone_init(void)
E_EVENT_ZONE_DESK_COUNT_SET = ecore_event_type_new();
E_EVENT_POINTER_WARP = ecore_event_type_new();
E_EVENT_ZONE_MOVE_RESIZE = ecore_event_type_new();
E_EVENT_ZONE_ADD = ecore_event_type_new();
E_EVENT_ZONE_DEL = ecore_event_type_new();
E_EVENT_ZONE_EDGE_IN = ecore_event_type_new();
E_EVENT_ZONE_EDGE_OUT = ecore_event_type_new();
return 1;
@ -53,6 +61,7 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
E_Zone *zone;
char name[40];
Evas_Object *o;
E_Event_Zone_Add *ev;
zone = E_OBJECT_ALLOC(E_Zone, E_ZONE_TYPE, _e_zone_free);
if (!zone) return NULL;
@ -141,6 +150,14 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
e_config->zone_desks_y_count);
_e_zone_update_flip(zone);
e_object_del_attach_func_set(E_OBJECT(zone), _e_zone_object_del_attach);
ev = E_NEW(E_Event_Zone_Add, 1);
ev->zone = zone;
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_ADD, ev, _e_zone_event_add_free, NULL);
return zone;
}
@ -170,7 +187,8 @@ e_zone_move(E_Zone *zone, int x, int y)
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, NULL, NULL);
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -195,7 +213,8 @@ e_zone_resize(E_Zone *zone, int w, int h)
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, NULL, NULL);
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -228,7 +247,8 @@ e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h)
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, NULL, NULL);
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -468,7 +488,7 @@ e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count)
ev = E_NEW(E_Event_Zone_Desk_Count_Set, 1);
if (!ev) return;
ev->zone = zone;
e_object_ref(E_OBJECT(zone));
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_DESK_COUNT_SET, ev, _e_zone_event_zone_desk_count_set_free, NULL);
}
@ -1018,3 +1038,48 @@ _e_zone_update_flip(E_Zone *zone)
zone->flip.bottom = 1;
}
}
static void
_e_zone_event_move_resize_free(void *data, void *ev)
{
E_Event_Zone_Move_Resize *e;
e = ev;
e_object_unref(E_OBJECT(e->zone));
free(e);
}
static void
_e_zone_event_add_free(void *data, void *ev)
{
E_Event_Zone_Add *e;
e = ev;
e_object_unref(E_OBJECT(e->zone));
free(e);
}
static void
_e_zone_event_del_free(void *data, void *ev)
{
E_Event_Zone_Del *e;
e = ev;
e_object_unref(E_OBJECT(e->zone));
free(e);
}
static void
_e_zone_object_del_attach(void *o)
{
E_Zone *zone;
E_Event_Zone_Del *ev;
if (e_object_is_del(E_OBJECT(o))) return;
zone = o;
ev = E_NEW(E_Event_Zone_Del, 1);
ev->zone = zone;
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_DEL, ev, _e_zone_event_del_free, NULL);
}

View File

@ -15,6 +15,8 @@ typedef struct _E_Zone E_Zone;
typedef struct _E_Event_Zone_Desk_Count_Set E_Event_Zone_Desk_Count_Set;
typedef struct _E_Event_Zone_Move_Resize E_Event_Zone_Move_Resize;
typedef struct _E_Event_Zone_Add E_Event_Zone_Add;
typedef struct _E_Event_Zone_Del E_Event_Zone_Del;
/* TODO: Move this to a general place? */
typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp;
typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge_In;
@ -82,6 +84,16 @@ struct _E_Event_Zone_Move_Resize
E_Zone *zone;
};
struct _E_Event_Zone_Add
{
E_Zone *zone;
};
struct _E_Event_Zone_Del
{
E_Zone *zone;
};
struct _E_Event_Pointer_Warp
{
struct {
@ -123,6 +135,8 @@ EAPI void e_zone_flip_win_restore(void);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;
extern EAPI int E_EVENT_ZONE_ADD;
extern EAPI int E_EVENT_ZONE_DEL;
extern EAPI int E_EVENT_POINTER_WARP;
extern EAPI int E_EVENT_ZONE_EDGE_IN;
extern EAPI int E_EVENT_ZONE_EDGE_OUT;

View File

@ -43,6 +43,7 @@ struct _E_Fwin
E_Toolbar *tbar;
Ecore_Event_Handler *zone_handler;
Ecore_Event_Handler *zone_del_handler;
};
struct _E_Fwin_Apps_Dialog
@ -99,6 +100,7 @@ static void _e_fwin_pan_scroll_update(E_Fwin *fwin);
static void _e_fwin_zone_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static int _e_fwin_zone_move_resize(void *data, int type, void *event);
static int _e_fwin_zone_del(void *data, int type, void *event);
static void _e_fwin_config_set(E_Fwin *fwin);
static void _e_fwin_window_title_set(E_Fwin *fwin);
static void _e_fwin_toolbar_resize(E_Fwin *fwin);
@ -155,6 +157,10 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
fwin->zone_handler = ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
_e_fwin_zone_move_resize,
fwin);
fwin->zone_del_handler = ecore_event_handler_add(E_EVENT_ZONE_DEL,
_e_fwin_zone_del,
fwin);
/* FIXME: catch del of zone and del fwin when zone goes */
/* Trap the mouse_down on zone so we can unselect */
evas_object_event_callback_add(zone->bg_event_object,
@ -283,6 +289,7 @@ e_fwin_reload_all(void)
E_Zone *zone;
zone = lll->data;
if (e_fwin_zone_find(zone)) continue;
if ((zone->container->num == 0) && (zone->num == 0) &&
(fileman_config->view.show_desktop_icons))
e_fwin_zone_new(zone, "desktop", "/");
@ -302,6 +309,21 @@ e_fwin_reload_all(void)
}
}
EAPI int
e_fwin_zone_find(E_Zone *zone)
{
Evas_List *f;
for (f = fwins; f; f = f->next)
{
E_Fwin *win;
win = f->data;
if (win->zone == zone) return 1;
}
return 0;
}
/* local subsystem functions */
static E_Fwin *
_e_fwin_new(E_Container *con, const char *dev, const char *path)
@ -440,6 +462,8 @@ _e_fwin_free(E_Fwin *fwin)
if (fwin->zone_handler)
ecore_event_handler_del(fwin->zone_handler);
if (fwin->zone_del_handler)
ecore_event_handler_del(fwin->zone_del_handler);
fwins = evas_list_remove(fwins, fwin);
if (fwin->wallpaper_file) evas_stringshare_del(fwin->wallpaper_file);
@ -1489,6 +1513,7 @@ _e_fwin_zone_move_resize(void *data, int type, void *event)
fwin = data;
ev = event;
if (!fwin) return 1;
if (fwin->zone != ev->zone) return 1;
if (fwin->bg_obj)
{
evas_object_move(fwin->bg_obj, ev->zone->x, ev->zone->y);
@ -1502,6 +1527,21 @@ _e_fwin_zone_move_resize(void *data, int type, void *event)
return 1;
}
static int
_e_fwin_zone_del(void *data, int type, void *event)
{
E_Event_Zone_Del *ev;
E_Fwin *fwin;
if (type != E_EVENT_ZONE_DEL) return 1;
fwin = data;
ev = event;
if (!fwin) return 1;
if (fwin->zone != ev->zone) return 1;
e_object_del(E_OBJECT(fwin));
return 1;
}
static void
_e_fwin_config_set(E_Fwin *fwin)
{

View File

@ -14,6 +14,7 @@ EAPI void e_fwin_zone_new (E_Zone *zone, const char *dev, const char *path)
EAPI void e_fwin_zone_shutdown (E_Zone *zone);
EAPI void e_fwin_all_unsel (void *data);
EAPI void e_fwin_reload_all (void);
EAPI int e_fwin_zone_find (E_Zone *zone);
#endif
#endif

View File

@ -12,10 +12,12 @@ static void _e_mod_menu_add(void *data, E_Menu *m);
static void _e_mod_fileman_config_load(void);
static void _e_mod_fileman_config_free(void);
static int _e_mod_cb_config_timer(void *data);
static int _e_mod_zone_add(void *data, int type, void *event);
static E_Module *conf_module = NULL;
static E_Action *act = NULL;
static E_Int_Menu_Augmentation *maug = NULL;
static Ecore_Event_Handler *zone_add_handler = NULL;
static E_Config_DD *conf_edd = NULL;
Config *fileman_config = NULL;
@ -69,6 +71,7 @@ e_modapi_init(E_Module *m)
for (lll = con->zones; lll; lll = lll->next)
{
zone = lll->data;
if (e_fwin_zone_find(zone)) continue;
if ((zone->container->num == 0) && (zone->num == 0) &&
(fileman_config->view.show_desktop_icons))
e_fwin_zone_new(zone, "desktop", "/");
@ -86,6 +89,10 @@ e_modapi_init(E_Module *m)
}
}
}
zone_add_handler = ecore_event_handler_add(E_EVENT_ZONE_ADD,
_e_mod_zone_add, NULL);
/* FIXME: add system event for new zone creation, and on creation, add an fwin to the zone */
return m;
}
@ -98,6 +105,9 @@ e_modapi_shutdown(E_Module *m)
E_Container *con;
E_Zone *zone;
ecore_event_handler_del(zone_add_handler);
zone_add_handler = NULL;
/* Unhook zone fm */
for (l = e_manager_list(); l; l = l->next)
{
@ -333,3 +343,30 @@ _e_mod_cb_config_timer(void *data)
e_util_dialog_show(_("Fileman Configuration Updated"), data);
return 0;
}
static int
_e_mod_zone_add(void *data, int type, void *event)
{
E_Event_Zone_Add *ev;
E_Zone *zone;
if (type != E_EVENT_ZONE_ADD) return 1;
ev = event;
zone = ev->zone;
if (e_fwin_zone_find(zone)) return 1;
if ((zone->container->num == 0) && (zone->num == 0) &&
(fileman_config->view.show_desktop_icons))
e_fwin_zone_new(zone, "desktop", "/");
else
{
char buf[256];
if (fileman_config->view.show_desktop_icons)
{
snprintf(buf, sizeof(buf), "%i",
(zone->container->num + zone->num));
e_fwin_zone_new(zone, "desktop", buf);
}
}
return 1;
}