Adding fileman as a module. This commit includes necessary changes to

e_zone, e_int_menus, etc, etc to make this happen.


SVN revision: 31258
This commit is contained in:
Christopher Michael 2007-08-12 09:57:24 +00:00
parent 7f23b7cd9c
commit 7935a4da9f
6 changed files with 47 additions and 103 deletions

View File

@ -141,7 +141,6 @@ e_widget_color_well.h \
e_color_dialog.h \
e_sys.h \
e_obj_dialog.h \
e_fwin.h \
e_widget_aspect.h \
e_filereg.h \
e_widget_desk_preview.h \
@ -267,7 +266,6 @@ e_widget_color_well.c \
e_color_dialog.c \
e_sys.c \
e_obj_dialog.c \
e_fwin.c \
e_widget_aspect.c \
e_widget_desk_preview.c \
e_filereg.c \

View File

@ -116,7 +116,7 @@
#include "e_color_dialog.h"
#include "e_sys.h"
#include "e_obj_dialog.h"
#include "e_fwin.h"
//#include "e_fwin.h"
#include "e_filereg.h"
#include "e_widget_aspect.h"
#include "e_widget_desk_preview.h"

View File

@ -20,7 +20,7 @@ struct _Main_Data
/* local subsystem functions */
static void _e_int_menus_main_del_hook (void *obj);
static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
//static void _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
static int _e_int_menus_main_lock_defer_cb (void *data);
static void _e_int_menus_main_lock (void *data, E_Menu *m, E_Menu_Item*mi);
static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi);
@ -118,13 +118,14 @@ e_int_menus_main_new(void)
e_util_menu_item_edje_icon_set(mi, "enlightenment/applications");
e_menu_item_submenu_set(mi, subm);
}
/*
#ifdef ENABLE_FILES
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Files"));
e_util_menu_item_edje_icon_set(mi, "enlightenment/fileman");
e_menu_item_callback_set(mi, _e_int_menus_fwin_favorites_item_cb, NULL);
#endif
*/
l = evas_hash_find(_e_int_menus_augmentation, "main/1");
if (l) _e_int_menus_augmentation_add(m, l);
@ -459,11 +460,14 @@ _e_int_menus_themes_about(void *data, E_Menu *m, E_Menu_Item *mi)
if (about) e_theme_about_show(about);
}
/*
static void
_e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
{
e_fwin_new(m->zone->container, "favorites", "/");
}
*/
/* FIXME: this is a workaround for menus' haveing a key grab AND exebuf
* wanting one too
*/

View File

@ -701,6 +701,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_fm2_shutdown);
/*
TS("fwin");
if (!e_fwin_init())
{
@ -708,6 +709,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_fwin_shutdown);
*/
TS("msg");
/* setup generic msg handling etc */
if (!e_msg_init())

View File

@ -18,10 +18,11 @@ 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 int _e_zone_fm_deferred(void *data);
static void _e_zone_event_move_resize_free(void *data, void *event);
EAPI int E_EVENT_ZONE_DESK_COUNT_SET = 0;
EAPI int E_EVENT_POINTER_WARP = 0;
EAPI int E_EVENT_ZONE_MOVE_RESIZE = 0;
#define E_ZONE_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
#define E_ZONE_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count))
@ -33,6 +34,7 @@ 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();
return 1;
}
@ -126,8 +128,6 @@ e_zone_new(E_Container *con, int num, int x, int y, int w, int h)
e_config->zone_desks_x_count,
e_config->zone_desks_y_count);
zone->deferred_fm_timer = ecore_timer_add(0.1, _e_zone_fm_deferred, zone);
_e_zone_update_flip(zone);
return zone;
}
@ -144,6 +144,8 @@ e_zone_name_set(E_Zone *zone, const char *name)
EAPI void
e_zone_move(E_Zone *zone, int x, int y)
{
E_Event_Zone_Move_Resize *ev;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -153,12 +155,10 @@ e_zone_move(E_Zone *zone, int x, int y)
evas_object_move(zone->bg_object, x, y);
evas_object_move(zone->bg_event_object, x, y);
evas_object_move(zone->bg_clip_object, x, y);
if (zone->bg_fwin)
{
if (zone->bg_fwin->bg_obj)
evas_object_move(zone->bg_fwin->bg_obj, x, y);
evas_object_move(zone->bg_fwin->scrollframe_obj, x, y);
}
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->flip.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->flip.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -169,6 +169,8 @@ e_zone_move(E_Zone *zone, int x, int y)
EAPI void
e_zone_resize(E_Zone *zone, int w, int h)
{
E_Event_Zone_Move_Resize *ev;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -178,12 +180,10 @@ e_zone_resize(E_Zone *zone, int w, int h)
evas_object_resize(zone->bg_object, w, h);
evas_object_resize(zone->bg_event_object, w, h);
evas_object_resize(zone->bg_clip_object, w, h);
if (zone->bg_fwin)
{
if (zone->bg_fwin->bg_obj)
evas_object_resize(zone->bg_fwin->bg_obj, w, h);
evas_object_resize(zone->bg_fwin->scrollframe_obj, w, h);
}
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->flip.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->flip.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -194,6 +194,8 @@ e_zone_resize(E_Zone *zone, int w, int h)
EAPI void
e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h)
{
E_Event_Zone_Move_Resize *ev;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -211,16 +213,10 @@ e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h)
evas_object_resize(zone->bg_object, w, h);
evas_object_resize(zone->bg_event_object, w, h);
evas_object_resize(zone->bg_clip_object, w, h);
if (zone->bg_fwin)
{
if (zone->bg_fwin->bg_obj)
{
evas_object_move(zone->bg_fwin->bg_obj, x, y);
evas_object_resize(zone->bg_fwin->bg_obj, w, h);
}
evas_object_move(zone->bg_fwin->scrollframe_obj, x, y);
evas_object_resize(zone->bg_fwin->scrollframe_obj, w, h);
}
ev = E_NEW(E_Event_Zone_Move_Resize, 1);
ev->zone = zone;
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->flip.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->flip.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
@ -268,8 +264,7 @@ e_zone_current_get(E_Container *con)
return zone;
}
}
if (!con->zones)
return NULL;
if (!con->zones) return NULL;
l = con->zones;
return (E_Zone *)l->data;
}
@ -619,33 +614,6 @@ e_zone_flip_win_restore(void)
}
}
EAPI void
e_zone_fm_set(E_Zone *zone, int set)
{
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
if (set)
{
if (zone->bg_fwin) return;
if ((zone->container->num == 0) && (zone->num == 0))
_e_zone_fm_add(zone, "desktop", "/");
else
{
char buf[256];
snprintf(buf, sizeof(buf), "%i", zone->container->num + zone->num);
_e_zone_fm_add(zone, "desktop", buf);
}
}
else
{
if (!zone->bg_fwin) return;
e_object_del(E_OBJECT(zone->bg_fwin));
zone->bg_fwin = NULL;
}
}
/* local subsystem functions */
static void
_e_zone_free(E_Zone *zone)
@ -654,16 +622,11 @@ _e_zone_free(E_Zone *zone)
Evas_List *l;
int x, y;
if (zone->deferred_fm_timer)
{
ecore_timer_del(zone->deferred_fm_timer);
zone->deferred_fm_timer = NULL;
}
if (zone->bg_fwin)
{
e_object_del(E_OBJECT(zone->bg_fwin));
zone->bg_fwin = NULL;
}
/* Delete the object event callbacks */
evas_object_event_callback_del(zone->bg_event_object, EVAS_CALLBACK_MOUSE_DOWN, _e_zone_cb_bg_mouse_down);
evas_object_event_callback_del(zone->bg_event_object, EVAS_CALLBACK_MOUSE_UP, _e_zone_cb_bg_mouse_up);
evas_object_event_callback_del(zone->bg_event_object, EVAS_CALLBACK_MOUSE_MOVE, _e_zone_cb_bg_mouse_move);
if (zone->black_ecore_evas)
{
e_canvas_del(zone->black_ecore_evas);
@ -705,24 +668,6 @@ _e_zone_free(E_Zone *zone)
free(zone);
}
static void
_e_zone_cb_fwin_del(void *obj)
{
E_Zone *zone;
zone = (E_Zone *)e_object_data_get(E_OBJECT(obj));
if (!zone) return;
zone->bg_fwin = NULL;
}
static void
_e_zone_fm_add(E_Zone *zone, const char *dev, const char *path)
{
zone->bg_fwin = e_fwin_zone_new(zone, dev, path);
e_object_data_set(E_OBJECT(zone->bg_fwin), zone);
e_object_del_attach_func_set(E_OBJECT(zone->bg_fwin), _e_zone_cb_fwin_del);
}
static void
_e_zone_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
@ -733,9 +678,6 @@ _e_zone_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_i
zone = data;
if (e_menu_grab_window_get()) return;
if (zone->bg_fwin)
e_fwin_all_unsel(zone->bg_fwin);
if (!zone->cur_mouse_action)
{
if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_DOWN)
@ -1033,13 +975,8 @@ _e_zone_update_flip(E_Zone *zone)
}
}
static int
_e_zone_fm_deferred(void *data)
static void
_e_zone_event_move_resize_free(void *data, void *event)
{
E_Zone *zone;
zone = data;
e_zone_fm_set(zone, e_config->show_desktop_icons);
zone->deferred_fm_timer = NULL;
return 0;
E_FREE(event);
}

View File

@ -6,6 +6,7 @@
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;
/* TODO: Move this to a general place? */
typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp;
@ -33,8 +34,6 @@ struct _E_Zone
Evas_Object *prev_bg_object;
Evas_Object *transition_object;
E_Fwin *bg_fwin;
int desk_x_count, desk_y_count;
int desk_x_current, desk_y_current;
E_Desk **desks;
@ -53,7 +52,6 @@ struct _E_Zone
Ecore_Evas *black_ecore_evas;
Evas *black_evas;
Ecore_X_Window black_win;
Ecore_Timer *deferred_fm_timer;
};
struct _E_Event_Zone_Desk_Count_Set
@ -61,6 +59,11 @@ struct _E_Event_Zone_Desk_Count_Set
E_Zone *zone;
};
struct _E_Event_Zone_Move_Resize
{
E_Zone *zone;
};
struct _E_Event_Pointer_Warp
{
struct {
@ -92,9 +95,9 @@ EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
EAPI void e_zone_flip_win_disable(void);
EAPI void e_zone_flip_win_restore(void);
EAPI void e_zone_fm_set(E_Zone *zone, int set);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;
extern EAPI int E_EVENT_POINTER_WARP;
#endif