2007-08-12 02:54:33 -07:00
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
2010-09-20 10:09:13 -07:00
|
|
|
/* FIXME: fwin - the fm2 filemanager wrapped with a window and scrollframe.
|
2007-08-12 02:54:33 -07:00
|
|
|
* primitive BUT enough to test generic dnd and fm stuff more easily. don't
|
|
|
|
* play with this unless u want to help with it. NOT COMPLETE! BEWARE!
|
|
|
|
*/
|
|
|
|
/* FIXME: multiple selected files across different fwins - you can only dnd the
|
|
|
|
* ones in the 1 window src - not all selected ones. also selecting a new file
|
2010-09-08 16:59:07 -07:00
|
|
|
* in a new fwin doesn't deseclect other selections in other fwin's (unless
|
2007-08-12 02:54:33 -07:00
|
|
|
* multi-selecting)
|
|
|
|
*/
|
|
|
|
|
2012-07-06 06:35:03 -07:00
|
|
|
#define DEFAULT_WIDTH 600
|
2011-08-09 08:47:22 -07:00
|
|
|
#define DEFAULT_HEIGHT 350
|
2014-04-21 00:16:34 -07:00
|
|
|
#define MINIMUM_WIDTH 360
|
|
|
|
#define MINIMUM_HEIGHT 250
|
2011-08-09 08:47:22 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
typedef struct _E_Fwin E_Fwin;
|
|
|
|
typedef struct _E_Fwin_Page E_Fwin_Page;
|
2007-08-12 02:54:33 -07:00
|
|
|
typedef struct _E_Fwin_Apps_Dialog E_Fwin_Apps_Dialog;
|
|
|
|
|
|
|
|
#define E_FWIN_TYPE 0xE0b0101f
|
|
|
|
|
|
|
|
struct _E_Fwin
|
|
|
|
{
|
|
|
|
E_Object e_obj_inherit;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
Evas_Object *win;
|
2007-08-12 02:54:33 -07:00
|
|
|
E_Zone *zone;
|
2012-09-13 00:18:13 -07:00
|
|
|
Fileman_Path *path; /* not freed with fwin, actually attached to config */
|
2007-08-12 02:54:33 -07:00
|
|
|
Evas_Object *bg_obj;
|
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Fwin_Page *cur_page;
|
2009-04-22 19:12:55 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
Evas_Object *under_obj;
|
|
|
|
Evas_Object *over_obj;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
const char *wallpaper_file;
|
2017-11-08 06:22:24 -08:00
|
|
|
Eina_Bool wallpaper_is_edj E_BITFIELD;
|
2011-01-05 14:36:21 -08:00
|
|
|
const char *overlay_file;
|
|
|
|
const char *scrollframe_file;
|
|
|
|
const char *theme_file;
|
2016-10-31 02:23:08 -07:00
|
|
|
const char *over_file;
|
2007-11-01 23:22:24 -07:00
|
|
|
|
2012-07-12 05:28:46 -07:00
|
|
|
Ecore_Timer *popup_timer;
|
2013-08-31 07:06:39 -07:00
|
|
|
Ecore_Job *popup_del_job;
|
2012-09-21 00:34:11 -07:00
|
|
|
Eina_List *popup_handlers;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
Evas_Object *popup;
|
2012-09-13 03:49:22 -07:00
|
|
|
|
|
|
|
Ecore_Timer *spring_timer;
|
2012-09-13 09:35:08 -07:00
|
|
|
Ecore_Timer *spring_close_timer;
|
2012-09-13 03:49:22 -07:00
|
|
|
E_Fwin *spring_parent;
|
|
|
|
E_Fwin *spring_child;
|
2012-07-12 05:28:46 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
Ecore_Event_Handler *zone_handler;
|
2007-12-13 21:57:16 -08:00
|
|
|
Ecore_Event_Handler *zone_del_handler;
|
2007-08-12 02:54:33 -07:00
|
|
|
};
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
struct _E_Fwin_Page
|
2009-04-22 19:12:55 -07:00
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Fwin *fwin;
|
2009-04-28 10:38:09 -07:00
|
|
|
Ecore_Event_Handler *fm_op_entry_add_handler;
|
|
|
|
|
2012-07-31 06:31:35 -07:00
|
|
|
Evas_Object *flist;
|
|
|
|
Evas_Object *flist_frame;
|
2009-04-28 10:38:09 -07:00
|
|
|
Evas_Object *scrollframe_obj;
|
2012-07-31 06:31:35 -07:00
|
|
|
Evas_Object *scr;
|
2009-04-28 10:38:09 -07:00
|
|
|
Evas_Object *fm_obj;
|
|
|
|
E_Toolbar *tbar;
|
2009-04-22 19:12:55 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Coord x, y, max_x, max_y, w, h;
|
|
|
|
} fm_pan, fm_pan_last;
|
2009-04-22 19:12:55 -07:00
|
|
|
|
2012-07-06 06:35:03 -07:00
|
|
|
int index;
|
2017-11-08 06:22:24 -08:00
|
|
|
Eina_Bool setting E_BITFIELD;
|
2009-04-22 19:12:55 -07:00
|
|
|
};
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
struct _E_Fwin_Apps_Dialog
|
|
|
|
{
|
2007-10-23 15:40:54 -07:00
|
|
|
E_Dialog *dia;
|
|
|
|
E_Fwin *fwin;
|
2009-04-03 18:20:32 -07:00
|
|
|
const char *app2;
|
2012-08-05 00:52:15 -07:00
|
|
|
Evas_Object *o_filepreview;
|
2009-04-03 18:20:32 -07:00
|
|
|
Evas_Object *o_all;
|
2007-10-23 15:40:54 -07:00
|
|
|
Evas_Object *o_entry;
|
|
|
|
char *exec_cmd;
|
2007-08-12 02:54:33 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
E_FWIN_EXEC_NONE,
|
|
|
|
E_FWIN_EXEC_DIRECT,
|
|
|
|
E_FWIN_EXEC_SH,
|
|
|
|
E_FWIN_EXEC_TERMINAL_DIRECT,
|
|
|
|
E_FWIN_EXEC_TERMINAL_SH,
|
|
|
|
E_FWIN_EXEC_DESKTOP
|
|
|
|
} E_Fwin_Exec_Type;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
/* local subsystem prototypes */
|
2015-03-18 15:09:09 -07:00
|
|
|
static int _e_fwin_cb_dir_handler_test(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *path);
|
|
|
|
static void _e_fwin_cb_dir_handler(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *path);
|
2012-07-31 06:31:35 -07:00
|
|
|
static void _e_fwin_page_favorites_add(E_Fwin_Page *page);
|
2015-03-18 15:09:09 -07:00
|
|
|
static void _e_fwin_icon_mouse_out(void *data, Evas_Object *obj EINA_UNUSED, void *event_info);
|
|
|
|
static void _e_fwin_icon_mouse_in(void *data, Evas_Object *obj EINA_UNUSED, void *event_info);
|
2012-09-13 03:49:22 -07:00
|
|
|
static E_Fwin *_e_fwin_open(E_Fwin_Page *page, E_Fm2_Icon_Info *ici, Eina_Bool force, int *need_dia);
|
2014-11-02 18:35:13 -08:00
|
|
|
static E_Fwin *_e_fwin_new(const char *dev, const char *path);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_free(E_Fwin *fwin);
|
|
|
|
static E_Fwin_Page *_e_fwin_page_create(E_Fwin *fwin);
|
|
|
|
static void _e_fwin_page_free(E_Fwin_Page *page);
|
2014-11-02 18:35:13 -08:00
|
|
|
static void _e_fwin_cb_delete(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _e_fwin_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_deleted(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static const char *_e_fwin_custom_file_path_eval(E_Fwin *fwin,
|
|
|
|
Efreet_Desktop *ef,
|
|
|
|
const char *prev_path,
|
|
|
|
const char *key);
|
|
|
|
static void _e_fwin_desktop_run(Efreet_Desktop *desktop,
|
|
|
|
E_Fwin_Page *page,
|
|
|
|
Eina_Bool skip_history);
|
|
|
|
static Eina_List *_e_fwin_suggested_apps_list_get(Eina_List *files,
|
2012-07-06 20:24:53 -07:00
|
|
|
Eina_List **mime_list,
|
|
|
|
Eina_Bool *has_default);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_changed(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2012-07-31 06:31:35 -07:00
|
|
|
static void _e_fwin_favorite_selected(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_selected(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _e_fwin_selection_change(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _e_fwin_cb_menu_extend_open_with(void *data,
|
|
|
|
E_Menu *m);
|
|
|
|
static void _e_fwin_cb_menu_open_fast(void *data,
|
|
|
|
E_Menu *m,
|
|
|
|
E_Menu_Item *mi);
|
|
|
|
static void _e_fwin_parent(void *data,
|
|
|
|
E_Menu *m,
|
|
|
|
E_Menu_Item *mi);
|
|
|
|
static void _e_fwin_cb_key_down(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _e_fwin_cb_menu_extend_start(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
E_Menu *m,
|
|
|
|
E_Fm2_Icon_Info *info);
|
|
|
|
static void _e_fwin_cb_menu_open(void *data,
|
|
|
|
E_Menu *m,
|
|
|
|
E_Menu_Item *mi);
|
|
|
|
static void _e_fwin_cb_menu_open_with(void *data,
|
|
|
|
E_Menu *m,
|
|
|
|
E_Menu_Item *mi);
|
|
|
|
static void _e_fwin_cb_all_change(void *data,
|
|
|
|
Evas_Object *obj);
|
|
|
|
static void _e_fwin_cb_exec_cmd_changed(void *data,
|
|
|
|
void *data2);
|
|
|
|
static void _e_fwin_cb_open(void *data,
|
|
|
|
E_Dialog *dia);
|
|
|
|
static void _e_fwin_cb_close(void *data,
|
|
|
|
E_Dialog *dia);
|
|
|
|
static void _e_fwin_cb_dialog_free(void *obj);
|
2007-08-12 02:54:33 -07:00
|
|
|
static E_Fwin_Exec_Type _e_fwin_file_is_exec(E_Fm2_Icon_Info *ici);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_file_exec(E_Fwin_Page *page,
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Fm2_Icon_Info *ici,
|
|
|
|
E_Fwin_Exec_Type ext);
|
2012-09-13 03:49:22 -07:00
|
|
|
static void _e_fwin_file_open_dialog(E_Fwin_Page *page,
|
2012-07-06 06:35:03 -07:00
|
|
|
Eina_List *files,
|
|
|
|
int always);
|
2012-08-05 00:52:15 -07:00
|
|
|
static void _e_fwin_file_open_dialog_preview_set(void *data1,
|
|
|
|
void *data2);
|
2012-07-06 06:35:03 -07:00
|
|
|
static void _e_fwin_file_open_dialog_cb_key_down(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
|
|
|
|
static void _e_fwin_pan_set(Evas_Object *obj,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y);
|
|
|
|
static void _e_fwin_pan_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y);
|
|
|
|
static void _e_fwin_pan_max_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y);
|
|
|
|
static void _e_fwin_pan_child_size_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h);
|
|
|
|
static void _e_fwin_pan_scroll_update(E_Fwin_Page *page);
|
|
|
|
static void _e_fwin_cb_page_obj_del(void *data, Evas *evas,
|
|
|
|
Evas_Object *obj, void *event_info);
|
|
|
|
static void _e_fwin_zone_cb_mouse_down(void *data,
|
|
|
|
Evas *evas,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static Eina_Bool _e_fwin_zone_move_resize(void *data,
|
|
|
|
int type,
|
|
|
|
void *event);
|
|
|
|
static Eina_Bool _e_fwin_zone_del(void *data,
|
|
|
|
int type,
|
|
|
|
void *event);
|
|
|
|
static void _e_fwin_config_set(E_Fwin_Page *page);
|
|
|
|
static void _e_fwin_window_title_set(E_Fwin_Page *page);
|
|
|
|
static void _e_fwin_toolbar_resize(E_Fwin_Page *page);
|
|
|
|
static int _e_fwin_dlg_cb_desk_sort(const void *p1,
|
|
|
|
const void *p2);
|
|
|
|
static int _e_fwin_dlg_cb_desk_list_sort(const void *data1,
|
|
|
|
const void *data2);
|
|
|
|
|
|
|
|
static void _e_fwin_op_registry_listener_cb(void *data,
|
|
|
|
const E_Fm2_Op_Registry_Entry *ere);
|
|
|
|
static Eina_Bool _e_fwin_op_registry_entry_add_cb(void *data,
|
|
|
|
int type,
|
|
|
|
void *event);
|
|
|
|
static void _e_fwin_op_registry_entry_iter(E_Fwin_Page *page);
|
|
|
|
static void _e_fwin_op_registry_abort_cb(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2009-03-24 07:52:06 -07:00
|
|
|
|
2012-09-13 03:49:22 -07:00
|
|
|
static E_Fwin *drag_fwin = NULL;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
static E_Client_Hook *focus_out_hook = NULL;
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* local subsystem globals */
|
2008-10-22 04:49:33 -07:00
|
|
|
static Eina_List *fwins = NULL;
|
2012-09-14 05:46:23 -07:00
|
|
|
static E_Fm2_Mime_Handler *dir_handler = NULL;
|
|
|
|
static Efreet_Desktop *tdesktop = NULL;
|
2013-02-07 00:20:42 -08:00
|
|
|
static Eina_Stringshare *fwin_class = NULL;
|
2007-08-12 02:54:33 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_client_hook_focus_unset(void *d EINA_UNUSED, E_Client *ec)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
|
|
|
|
|
|
|
/* if there is no new focused, set focus to zone fwin */
|
2013-10-19 04:14:51 -07:00
|
|
|
if (e_client_focused_get() ||
|
2014-01-27 06:44:50 -08:00
|
|
|
(!e_client_util_ignored_get(e_desk_client_top_visible_get(e_desk_current_get(ec->zone))))) return;
|
2016-05-03 17:26:00 -07:00
|
|
|
if (e_comp_util_kbd_grabbed()) return;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
fwin = e_fwin_zone_find(ec->zone);
|
|
|
|
if (fwin)
|
|
|
|
evas_object_focus_set(fwin->cur_page->fm_obj, 1);
|
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* externally accessible functions */
|
2010-01-22 12:28:39 -08:00
|
|
|
int
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fwin_init(void)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
focus_out_hook = e_client_hook_add(E_CLIENT_HOOK_FOCUS_UNSET, _e_fwin_client_hook_focus_unset, NULL);
|
2013-02-07 00:20:42 -08:00
|
|
|
fwin_class = eina_stringshare_add("e_fwin");
|
2012-09-14 05:46:23 -07:00
|
|
|
tdesktop = e_util_terminal_desktop_get();
|
|
|
|
if (!tdesktop) return 1;
|
2012-12-07 10:15:14 -08:00
|
|
|
dir_handler = e_fm2_mime_handler_new(_("Open Terminal here"),
|
2012-09-14 05:46:23 -07:00
|
|
|
tdesktop->icon,
|
|
|
|
_e_fwin_cb_dir_handler, NULL,
|
|
|
|
_e_fwin_cb_dir_handler_test, NULL);
|
|
|
|
e_fm2_mime_handler_mime_add(dir_handler, "inode/directory");
|
2007-08-12 02:54:33 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-01-22 12:28:39 -08:00
|
|
|
int
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fwin_shutdown(void)
|
|
|
|
{
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
E_Fwin *fwin;
|
2007-12-14 09:09:47 -08:00
|
|
|
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
EINA_LIST_FREE(fwins, fwin)
|
|
|
|
e_object_del(E_OBJECT(fwin));
|
2008-10-15 08:12:56 -07:00
|
|
|
|
2013-02-07 00:20:42 -08:00
|
|
|
eina_stringshare_replace(&fwin_class, NULL);
|
2012-09-14 05:46:23 -07:00
|
|
|
if (dir_handler)
|
|
|
|
{
|
|
|
|
e_fm2_mime_handler_mime_del(dir_handler, "inode/directory");
|
|
|
|
e_fm2_mime_handler_free(dir_handler);
|
|
|
|
}
|
|
|
|
efreet_desktop_free(tdesktop);
|
|
|
|
|
|
|
|
tdesktop = NULL;
|
|
|
|
dir_handler = NULL;
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: this opens a new window - we need a way to inherit a zone as the
|
|
|
|
* "fwin" window
|
|
|
|
*/
|
2010-01-22 12:28:39 -08:00
|
|
|
void
|
2015-03-18 14:40:04 -07:00
|
|
|
e_fwin_new(const char *dev,
|
2012-07-06 06:35:03 -07:00
|
|
|
const char *path)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
_e_fwin_new(dev, path);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2012-09-13 03:49:22 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_e_fwin_spring_cb(E_Fwin *fwin)
|
|
|
|
{
|
|
|
|
E_Fm2_Icon_Info *ici;
|
|
|
|
E_Fwin *f;
|
|
|
|
|
2012-09-13 08:19:06 -07:00
|
|
|
if (fwin->spring_child)
|
|
|
|
_e_fwin_free(fwin->spring_child);
|
|
|
|
|
2012-09-13 03:49:22 -07:00
|
|
|
ici = e_fm2_drop_icon_get(fwin->cur_page->fm_obj);
|
2012-09-13 09:35:08 -07:00
|
|
|
if (!ici)
|
|
|
|
ici = e_fm2_drop_icon_get(fwin->cur_page->flist);
|
2012-09-13 03:49:22 -07:00
|
|
|
while (ici)
|
|
|
|
{
|
|
|
|
/* FIXME: could use an animation here */
|
|
|
|
f = _e_fwin_open(fwin->cur_page, ici, EINA_TRUE, NULL);
|
|
|
|
if (!f) break;
|
|
|
|
f->spring_parent = fwin;
|
|
|
|
fwin->spring_child = f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (fwin->spring_timer) ecore_timer_del(fwin->spring_timer);
|
|
|
|
fwin->spring_timer = NULL;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* called on the drop source */
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_dnd_end_cb(E_Fwin *fwin, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
2012-09-13 08:40:03 -07:00
|
|
|
if (fwin->spring_timer) ecore_timer_del(fwin->spring_timer);
|
|
|
|
fwin->spring_timer = NULL;
|
|
|
|
if (!drag_fwin) return;
|
2012-09-13 03:49:22 -07:00
|
|
|
if (drag_fwin->spring_timer) ecore_timer_del(drag_fwin->spring_timer);
|
|
|
|
drag_fwin->spring_timer = NULL;
|
|
|
|
|
|
|
|
/* NOTE: closing the drop target window here WILL break things */
|
|
|
|
fwin = drag_fwin->spring_parent;
|
2013-10-03 01:45:26 -07:00
|
|
|
if (!fwin)
|
|
|
|
{
|
|
|
|
if (!drag_fwin->zone) return;
|
|
|
|
//dragging from desktop, we'll never have a parent here
|
|
|
|
if (drag_fwin->spring_child)
|
|
|
|
_e_fwin_free(drag_fwin->spring_child);
|
|
|
|
return;
|
|
|
|
}
|
2012-09-13 03:49:22 -07:00
|
|
|
|
|
|
|
fwin->spring_child->spring_parent = NULL;
|
|
|
|
fwin->spring_child = NULL;
|
|
|
|
while (fwin->spring_parent)
|
|
|
|
{
|
|
|
|
/* FIXME: needs closing animation? */
|
|
|
|
fwin = fwin->spring_parent;
|
|
|
|
_e_fwin_free(fwin->spring_child);
|
|
|
|
}
|
|
|
|
drag_fwin = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_dnd_change_cb(E_Fwin *fwin, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
|
|
|
drag_fwin = fwin;
|
|
|
|
if (fwin->spring_timer)
|
2017-02-06 13:59:25 -08:00
|
|
|
ecore_timer_loop_reset(fwin->spring_timer);
|
2012-09-13 03:49:22 -07:00
|
|
|
else
|
2017-02-03 13:52:28 -08:00
|
|
|
fwin->spring_timer = ecore_timer_loop_add(fileman_config->view.spring_delay, (Ecore_Task_Cb)_e_fwin_spring_cb, fwin);
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_dnd_enter_cb(E_Fwin *fwin, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
2012-09-13 09:35:08 -07:00
|
|
|
if (drag_fwin == fwin) return;
|
2012-09-13 03:49:22 -07:00
|
|
|
if (fwin->spring_timer) ecore_timer_del(fwin->spring_timer);
|
|
|
|
fwin->spring_timer = NULL;
|
2012-09-13 09:35:08 -07:00
|
|
|
if (fwin->spring_child && (drag_fwin == fwin->spring_child)) _e_fwin_free(fwin->spring_child);
|
|
|
|
drag_fwin = fwin;
|
|
|
|
if (fwin->spring_close_timer) ecore_timer_del(fwin->spring_close_timer);
|
|
|
|
fwin->spring_close_timer = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_fwin_dnd_close_cb(E_Fwin *fwin)
|
|
|
|
{
|
|
|
|
_e_fwin_free(fwin);
|
|
|
|
return EINA_FALSE;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_dnd_leave_cb(E_Fwin *fwin, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
|
|
|
if (fwin->spring_timer) ecore_timer_del(fwin->spring_timer);
|
|
|
|
fwin->spring_timer = NULL;
|
2012-09-13 09:35:08 -07:00
|
|
|
if (fwin->spring_parent && (!fwin->spring_child))
|
|
|
|
{
|
|
|
|
if (!fwin->spring_close_timer)
|
2017-02-03 13:52:28 -08:00
|
|
|
fwin->spring_close_timer = ecore_timer_loop_add(0.01, (Ecore_Task_Cb)_e_fwin_dnd_close_cb, fwin);
|
2012-09-13 09:35:08 -07:00
|
|
|
}
|
2012-09-13 03:49:22 -07:00
|
|
|
drag_fwin = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_dnd_begin_cb(E_Fwin *fwin EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
|
|
|
drag_fwin = NULL;
|
|
|
|
}
|
|
|
|
|
2013-02-07 05:20:07 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_zone_shutdown(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
const char *dev, *path;
|
|
|
|
|
|
|
|
fwin->path->desktop_mode = e_fm2_view_mode_get(obj);
|
|
|
|
e_fm2_path_get(obj, &dev, &path);
|
|
|
|
eina_stringshare_replace(&fwin->path->dev, dev);
|
|
|
|
eina_stringshare_replace(&fwin->path->path, path);
|
|
|
|
e_object_del(E_OBJECT(fwin));
|
|
|
|
}
|
|
|
|
|
2010-01-22 12:28:39 -08:00
|
|
|
void
|
2012-09-13 00:18:13 -07:00
|
|
|
e_fwin_zone_new(E_Zone *zone, void *p)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
2012-09-13 00:18:13 -07:00
|
|
|
Fileman_Path *path = p;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2007-08-12 02:54:33 -07:00
|
|
|
Evas_Object *o;
|
2010-06-03 18:12:04 -07:00
|
|
|
int x, y, w, h;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free);
|
|
|
|
if (!fwin) return;
|
|
|
|
fwin->zone = zone;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = E_NEW(E_Fwin_Page, 1);
|
|
|
|
page->fwin = fwin;
|
2012-09-13 00:18:13 -07:00
|
|
|
fwin->path = path;
|
2009-04-28 10:38:09 -07:00
|
|
|
|
2007-12-21 16:20:53 -08:00
|
|
|
/* Add Event Handler for zone move/resize & del */
|
2011-01-05 14:36:21 -08:00
|
|
|
fwin->zone_handler =
|
2017-08-04 13:23:38 -07:00
|
|
|
ecore_event_handler_add(E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGED,
|
2008-02-11 21:59:01 -08:00
|
|
|
_e_fwin_zone_move_resize, fwin);
|
2011-01-05 14:36:21 -08:00
|
|
|
fwin->zone_del_handler =
|
|
|
|
ecore_event_handler_add(E_EVENT_ZONE_DEL,
|
2008-02-11 21:59:01 -08:00
|
|
|
_e_fwin_zone_del, fwin);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* Trap the mouse_down on zone so we can unselect */
|
2011-01-05 14:36:21 -08:00
|
|
|
evas_object_event_callback_add(zone->bg_event_object,
|
|
|
|
EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_e_fwin_zone_cb_mouse_down, fwin);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
fwins = eina_list_append(fwins, fwin);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2015-03-13 14:44:24 -07:00
|
|
|
o = e_fm2_add(e_comp->evas);
|
2013-02-07 05:20:07 -08:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _e_fwin_zone_shutdown, fwin);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_obj = o;
|
|
|
|
_e_fwin_config_set(page);
|
2007-12-03 09:06:56 -08:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_custom_theme_content_set(o, "desktop");
|
2009-03-01 19:12:43 -08:00
|
|
|
|
2012-12-18 02:19:42 -08:00
|
|
|
evas_object_smart_callback_add(o, "changed",
|
|
|
|
_e_fwin_icon_mouse_out, fwin);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_smart_callback_add(o, "dir_changed",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_changed, page);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_smart_callback_add(o, "dir_deleted",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_deleted, page);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_smart_callback_add(o, "selected",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_selected, page);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_smart_callback_add(o, "selection_change",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_selection_change, page);
|
2011-02-15 19:45:57 -08:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
|
|
|
|
_e_fwin_cb_page_obj_del, page);
|
2012-09-13 03:49:22 -07:00
|
|
|
evas_object_smart_callback_add(o, "dnd_enter", (Evas_Smart_Cb)_e_fwin_dnd_enter_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_leave", (Evas_Smart_Cb)_e_fwin_dnd_leave_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_changed", (Evas_Smart_Cb)_e_fwin_dnd_change_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_begin", (Evas_Smart_Cb)_e_fwin_dnd_begin_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_end", (Evas_Smart_Cb)_e_fwin_dnd_end_cb, fwin);
|
2012-09-13 03:51:50 -07:00
|
|
|
evas_object_smart_callback_add(o, "icon_mouse_in", (Evas_Smart_Cb)_e_fwin_icon_mouse_in, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "icon_mouse_out", (Evas_Smart_Cb)_e_fwin_icon_mouse_out, fwin);
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, page);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_underlay_hide(o);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_focus_set(o, !e_client_focused_get());
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_show(o);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2015-03-13 14:44:24 -07:00
|
|
|
o = e_scrollframe_add(e_comp->evas);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_scrollframe_custom_theme_set(o, "base/theme/fileman",
|
2011-01-05 14:36:21 -08:00
|
|
|
"e/fileman/desktop/scrollframe");
|
2007-08-12 02:54:33 -07:00
|
|
|
/* FIXME: this theme object will have more versions and options later
|
|
|
|
* for things like swallowing widgets/buttons ot providing them - a
|
2011-01-05 14:36:21 -08:00
|
|
|
* gadcon for starters for fm widgets. need to register the owning
|
2007-08-12 02:54:33 -07:00
|
|
|
* e_object of the gadcon so gadcon clients can get it and thus do
|
|
|
|
* things like find out what dirs/path the fwin is for etc. this will
|
|
|
|
* probably be how you add optional gadgets to fwin views like empty/full
|
|
|
|
* meters for disk usage, and other dir info/stats or controls. also it
|
|
|
|
* might be possible that we can have custom frames per dir later so need
|
|
|
|
* a way to set an edje file directly
|
|
|
|
*/
|
|
|
|
/* FIXME: allow specialised scrollframe obj per dir - get from e config,
|
|
|
|
* then look in the dir itself for a magic dot-file, if not - use theme.
|
|
|
|
* same as currently done for bg & overlay. also add to fm2 the ability
|
|
|
|
* to specify the .edj files to get the list and icon theme stuff from
|
|
|
|
*/
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_data_set(page->fm_obj, "fm_page", page);
|
2012-08-06 06:18:15 -07:00
|
|
|
evas_object_data_set(page->fm_obj, "page_is_zone", page);
|
2009-04-28 10:38:09 -07:00
|
|
|
e_scrollframe_extern_pan_set(o, page->fm_obj,
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_pan_set,
|
|
|
|
_e_fwin_pan_get,
|
|
|
|
_e_fwin_pan_max_get,
|
|
|
|
_e_fwin_pan_child_size_get);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_propagate_events_set(page->fm_obj, 0);
|
2012-08-03 03:32:36 -07:00
|
|
|
e_widget_can_focus_set(o, 0);
|
2013-02-18 05:43:47 -08:00
|
|
|
evas_object_name_set(o, "zone_fwin");
|
2010-06-03 18:12:04 -07:00
|
|
|
e_zone_useful_geometry_get(zone, &x, &y, &w, &h);
|
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_resize(o, w, h);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_show(o);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_layer_set(o, E_LAYER_DESKTOP);
|
|
|
|
evas_object_lower(o);
|
2013-02-18 05:43:47 -08:00
|
|
|
page->scrollframe_obj = page->scr = o;
|
2007-08-12 02:54:33 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_window_object_set(page->fm_obj, E_OBJECT(fwin->zone));
|
|
|
|
|
2012-09-13 00:18:13 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, path->dev, path->path);
|
2007-08-12 02:54:33 -07:00
|
|
|
|
2012-07-06 07:11:16 -07:00
|
|
|
fwin->cur_page = page;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2010-01-22 12:28:39 -08:00
|
|
|
void
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fwin_all_unsel(void *data)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
fwin = data;
|
|
|
|
E_OBJECT_CHECK(fwin);
|
|
|
|
E_OBJECT_TYPE_CHECK(fwin, E_FWIN_TYPE);
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_all_unsel(fwin->cur_page->fm_obj);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
void
|
|
|
|
e_fwin_zone_shutdown(E_Zone *zone)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2010-12-12 23:29:23 -08:00
|
|
|
Eina_List *f, *fn;
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Fwin *fwin;
|
2013-02-07 05:20:07 -08:00
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
EINA_LIST_FOREACH_SAFE(fwins, f, fn, fwin)
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
if (fwin->zone != zone) continue;
|
|
|
|
_e_fwin_zone_shutdown(fwin, NULL, fwin->cur_page->fm_obj, NULL);
|
|
|
|
fwin = NULL;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-28 06:55:54 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_cb_toolbar_del(void *obj)
|
|
|
|
{
|
|
|
|
E_Fwin_Page *page = e_object_data_get(obj);
|
|
|
|
page->tbar = NULL;
|
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
void
|
|
|
|
e_fwin_reload_all(void)
|
2007-08-12 16:04:38 -07:00
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
const Eina_List *l, *ll;
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
E_Fwin *fwin;
|
|
|
|
E_Zone *zone;
|
2007-08-12 16:04:38 -07:00
|
|
|
|
|
|
|
/* Reload/recreate zones cause of property changes */
|
2013-05-28 03:43:51 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(fwins, l, ll, fwin)
|
2007-08-12 16:04:38 -07:00
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!fwin) continue; //safety
|
|
|
|
if (fwin->zone)
|
|
|
|
e_fwin_zone_shutdown(fwin->zone);
|
2012-07-20 03:49:08 -07:00
|
|
|
else
|
|
|
|
{
|
2012-07-20 03:53:33 -07:00
|
|
|
_e_fwin_config_set(fwin->cur_page);
|
2012-07-20 03:49:08 -07:00
|
|
|
if (fileman_config->view.show_toolbar)
|
|
|
|
{
|
|
|
|
if (!fwin->cur_page->tbar)
|
|
|
|
{
|
2012-10-28 00:45:48 -07:00
|
|
|
fwin->cur_page->tbar = e_toolbar_new
|
2014-11-02 18:35:13 -08:00
|
|
|
(evas_object_evas_get(fwin->win), "toolbar",
|
2012-10-28 00:45:48 -07:00
|
|
|
fwin->win, fwin->cur_page->fm_obj);
|
2012-12-18 07:12:22 -08:00
|
|
|
e_toolbar_orient(fwin->cur_page->tbar, fileman_config->view.toolbar_orient);
|
2013-05-28 06:55:54 -07:00
|
|
|
e_object_data_set(E_OBJECT(fwin->cur_page->tbar), fwin->cur_page);
|
|
|
|
E_OBJECT_DEL_SET(fwin->cur_page->tbar, _e_fwin_cb_toolbar_del);
|
2012-07-20 03:49:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fwin->cur_page->tbar)
|
|
|
|
{
|
2012-12-18 07:12:22 -08:00
|
|
|
fileman_config->view.toolbar_orient = fwin->cur_page->tbar->gadcon->orient;
|
2012-07-20 03:49:08 -07:00
|
|
|
e_object_del(E_OBJECT(fwin->cur_page->tbar));
|
|
|
|
fwin->cur_page->tbar = NULL;
|
|
|
|
}
|
|
|
|
}
|
2012-07-31 06:31:35 -07:00
|
|
|
if (fileman_config->view.show_sidebar)
|
|
|
|
{
|
|
|
|
if (!fwin->cur_page->flist_frame)
|
2012-10-28 00:45:48 -07:00
|
|
|
{
|
|
|
|
_e_fwin_page_favorites_add(fwin->cur_page);
|
|
|
|
edje_object_signal_emit(fwin->bg_obj, "e,favorites,enabled", "e");
|
|
|
|
edje_object_message_signal_process(fwin->bg_obj);
|
|
|
|
}
|
2012-07-31 06:31:35 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fwin->cur_page->flist_frame)
|
|
|
|
{
|
|
|
|
evas_object_del(fwin->cur_page->flist_frame);
|
|
|
|
fwin->cur_page->flist_frame = fwin->cur_page->flist = NULL;
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_signal_emit(fwin->bg_obj, "e,favorites,disabled", "e");
|
|
|
|
edje_object_message_signal_process(fwin->bg_obj);
|
2012-07-31 06:31:35 -07:00
|
|
|
}
|
|
|
|
}
|
2012-08-06 05:07:26 -07:00
|
|
|
_e_fwin_window_title_set(fwin->cur_page);
|
2014-11-02 18:35:13 -08:00
|
|
|
_e_fwin_cb_resize(fwin, NULL, NULL, NULL);
|
2012-10-31 23:36:57 -07:00
|
|
|
_e_fwin_toolbar_resize(fwin->cur_page);
|
2013-11-25 17:47:17 -08:00
|
|
|
e_fm2_refresh(fwin->cur_page->fm_obj);
|
2012-07-20 03:49:08 -07:00
|
|
|
}
|
2007-08-12 16:04:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Hook into zones */
|
2015-01-05 12:27:41 -08:00
|
|
|
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
|
|
|
{
|
|
|
|
if (e_fwin_zone_find(zone)) continue;
|
|
|
|
if (e_config->show_desktop_icons)
|
|
|
|
e_fwin_zone_new(zone, e_mod_fileman_path_find(zone));
|
|
|
|
}
|
2007-08-12 16:04:38 -07:00
|
|
|
}
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
void *
|
2007-12-13 21:57:16 -08:00
|
|
|
e_fwin_zone_find(E_Zone *zone)
|
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *f;
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Fwin *fwin;
|
2011-01-05 14:36:21 -08:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
EINA_LIST_FOREACH(fwins, f, fwin)
|
|
|
|
if (fwin->zone == zone) return fwin;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
return NULL;
|
2007-12-13 21:57:16 -08:00
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* local subsystem functions */
|
2012-07-09 04:45:05 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_bg_mouse_down(E_Fwin *fwin, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
2012-07-09 04:45:05 -07:00
|
|
|
{
|
2013-07-26 04:50:28 -07:00
|
|
|
int x, y, w, h, zx, zy, zw, zh, cx, cy, cw, ch;
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Client *ec;
|
|
|
|
|
|
|
|
ec = e_win_client_get(fwin->win);
|
2013-07-26 04:50:28 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
if (ec->maximized) e_client_unmaximize(ec, ec->maximized);
|
|
|
|
if (ec->fullscreen) e_client_unfullscreen(ec);
|
|
|
|
e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, &zh);
|
|
|
|
x = ec->x, y = ec->y;
|
2014-05-09 07:28:04 -07:00
|
|
|
if (!e_fm2_optimal_size_calc(fwin->cur_page->fm_obj, MINIMUM_WIDTH, zw + zx - x, zh + zy - y, &w, &h)) return;
|
2013-07-26 04:50:28 -07:00
|
|
|
evas_object_geometry_get(fwin->cur_page->fm_obj, &cx, &cy, &cw, &ch);
|
2012-07-09 04:45:05 -07:00
|
|
|
if (x + w > zx + zw)
|
|
|
|
w = zx + zw - x;
|
2014-04-21 00:15:11 -07:00
|
|
|
if (y + h > zy + zh)
|
2012-07-09 04:45:05 -07:00
|
|
|
h = zy + zh - y;
|
2013-07-26 04:50:28 -07:00
|
|
|
w = w + cx;
|
2014-04-21 12:53:05 -07:00
|
|
|
h = h + cy;
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_resize(fwin->win, MAX(w, MINIMUM_WIDTH), MAX(h, MINIMUM_HEIGHT));
|
2012-07-09 04:45:05 -07:00
|
|
|
}
|
|
|
|
|
2015-04-27 13:03:42 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_cb_focus(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
|
2015-04-30 13:06:09 -07:00
|
|
|
if (!e_fm2_icon_editing_get(fwin->cur_page->fm_obj))
|
|
|
|
evas_object_focus_set(fwin->cur_page->fm_obj, 1);
|
2015-04-27 13:03:42 -07:00
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static E_Fwin *
|
2014-11-02 18:35:13 -08:00
|
|
|
_e_fwin_new(const char *dev,
|
2012-07-06 06:35:03 -07:00
|
|
|
const char *path)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2007-08-12 02:54:33 -07:00
|
|
|
Evas_Object *o;
|
2011-08-09 08:47:22 -07:00
|
|
|
E_Zone *zone;
|
2012-07-06 06:35:03 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free);
|
|
|
|
if (!fwin) return NULL;
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin->win = elm_win_add(NULL, NULL, ELM_WIN_BASIC);
|
2007-08-12 02:54:33 -07:00
|
|
|
if (!fwin->win)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
free(fwin);
|
|
|
|
return NULL;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2008-10-22 04:49:33 -07:00
|
|
|
fwins = eina_list_append(fwins, fwin);
|
2015-04-27 13:03:42 -07:00
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_FOCUS_IN, _e_fwin_cb_focus, fwin);
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_DEL, _e_fwin_cb_delete, fwin);
|
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_RESIZE, _e_fwin_cb_resize, fwin);
|
2007-08-12 02:54:33 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
o = edje_object_add(evas_object_evas_get(fwin->win));
|
|
|
|
elm_win_resize_object_add(fwin->win, o);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/fileman",
|
2011-01-05 14:36:21 -08:00
|
|
|
"e/fileman/default/window/main");
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
fwin->bg_obj = o;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = _e_fwin_page_create(fwin);
|
|
|
|
fwin->cur_page = page;
|
2007-11-01 23:22:24 -07:00
|
|
|
|
2012-07-03 05:31:51 -07:00
|
|
|
/*
|
2014-11-02 18:35:13 -08:00
|
|
|
o = edje_object_add(evas_object_evas_get(fwin->win));
|
|
|
|
// o = e_icon_add(evas_object_evas_get(fwin->win));
|
2012-07-06 06:35:03 -07:00
|
|
|
// e_icon_scale_size_set(o, 0);
|
|
|
|
// e_icon_fill_inside_set(o, 0);
|
2007-08-12 02:54:33 -07:00
|
|
|
edje_object_part_swallow(fwin->bg_obj, "e.swallow.bg", o);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
|
|
|
fwin->under_obj = o;
|
2012-07-06 06:35:03 -07:00
|
|
|
*/
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
o = edje_object_add(evas_object_evas_get(fwin->win));
|
|
|
|
// o = e_icon_add(evas_object_evas_get(fwin->win));
|
2012-05-03 05:13:34 -07:00
|
|
|
// e_icon_scale_size_set(o, 0);
|
|
|
|
// e_icon_fill_inside_set(o, 0);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(e_scrollframe_edje_object_get(page->scr),
|
|
|
|
"e.swallow.overlay", o);
|
2007-08-12 02:54:33 -07:00
|
|
|
evas_object_pass_events_set(o, 1);
|
|
|
|
fwin->over_obj = o;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, dev, path);
|
|
|
|
_e_fwin_window_title_set(page);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_size_hint_min_set(fwin->win, MINIMUM_WIDTH, MINIMUM_HEIGHT);
|
2011-08-09 08:47:22 -07:00
|
|
|
|
2015-03-13 14:47:36 -07:00
|
|
|
zone = e_zone_current_get();
|
2011-08-09 08:47:22 -07:00
|
|
|
if ((zone) && (zone->w < DEFAULT_WIDTH))
|
|
|
|
{
|
2012-07-06 06:35:03 -07:00
|
|
|
int w, h;
|
|
|
|
e_zone_useful_geometry_get(zone, NULL, NULL, &w, &h);
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_resize(fwin->win, w, h);
|
2011-08-09 08:47:22 -07:00
|
|
|
}
|
|
|
|
else
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_resize(fwin->win, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
2011-08-09 08:47:22 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_show(fwin->win);
|
|
|
|
if (elm_win_window_id_get(fwin->win))
|
|
|
|
e_drop_xdnd_register_set(elm_win_window_id_get(fwin->win), 1);
|
|
|
|
e_win_client_icon_set(fwin->win, "system-file-manager");
|
2009-03-08 07:11:24 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
return fwin;
|
|
|
|
}
|
|
|
|
|
2015-07-06 11:23:54 -07:00
|
|
|
static Eina_Bool
|
2016-07-15 09:16:28 -07:00
|
|
|
_e_fwin_icon_popup_handler(void *data)
|
2015-07-06 11:23:54 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
|
|
|
|
E_FREE_FUNC(fwin->popup_timer, ecore_timer_del);
|
|
|
|
if (fwin->popup)
|
|
|
|
{
|
|
|
|
evas_object_hide(fwin->popup);
|
|
|
|
E_FREE_FUNC(fwin->popup, evas_object_del);
|
|
|
|
}
|
2019-01-09 10:23:19 -08:00
|
|
|
if (fwin->win)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del(fwin->win, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler);
|
|
|
|
evas_object_event_callback_del(fwin->win, EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler);
|
|
|
|
}
|
2015-07-06 11:23:54 -07:00
|
|
|
E_FREE_LIST(fwin->popup_handlers, ecore_event_handler_del);
|
2016-10-31 02:23:08 -07:00
|
|
|
if (fwin->over_file) eina_stringshare_del(fwin->over_file);
|
|
|
|
fwin->over_file = NULL;
|
2015-07-06 11:23:54 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_free(E_Fwin *fwin)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!fwin) return; //safety
|
2008-09-19 17:51:19 -07:00
|
|
|
|
2012-07-06 07:11:16 -07:00
|
|
|
_e_fwin_page_free(fwin->cur_page);
|
2009-04-28 10:38:09 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fwin->zone)
|
2012-10-28 00:45:48 -07:00
|
|
|
evas_object_event_callback_del(fwin->zone->bg_event_object,
|
|
|
|
EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_e_fwin_zone_cb_mouse_down);
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fwin->zone_handler)
|
2007-08-12 02:54:33 -07:00
|
|
|
ecore_event_handler_del(fwin->zone_handler);
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fwin->zone_del_handler)
|
2007-12-13 21:57:16 -08:00
|
|
|
ecore_event_handler_del(fwin->zone_del_handler);
|
2012-09-13 03:49:22 -07:00
|
|
|
if (fwin->spring_timer) ecore_timer_del(fwin->spring_timer);
|
|
|
|
fwin->spring_timer = NULL;
|
2012-09-13 09:35:08 -07:00
|
|
|
if (fwin->spring_close_timer) ecore_timer_del(fwin->spring_close_timer);
|
|
|
|
fwin->spring_close_timer = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
fwins = eina_list_remove(fwins, fwin);
|
2008-10-15 08:12:56 -07:00
|
|
|
if (fwin->wallpaper_file) eina_stringshare_del(fwin->wallpaper_file);
|
|
|
|
if (fwin->overlay_file) eina_stringshare_del(fwin->overlay_file);
|
|
|
|
if (fwin->scrollframe_file) eina_stringshare_del(fwin->scrollframe_file);
|
|
|
|
if (fwin->theme_file) eina_stringshare_del(fwin->theme_file);
|
2016-10-31 02:23:08 -07:00
|
|
|
if (fwin->over_file) eina_stringshare_del(fwin->over_file);
|
2008-03-07 11:13:54 -08:00
|
|
|
if (fwin->fad)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
e_object_del(E_OBJECT(fwin->fad->dia));
|
|
|
|
fwin->fad = NULL;
|
2008-03-07 11:13:54 -08:00
|
|
|
}
|
2013-06-10 05:34:04 -07:00
|
|
|
if (fwin->popup_del_job) ecore_job_del(fwin->popup_del_job);
|
2014-05-07 14:46:24 -07:00
|
|
|
if (fwin->popup)
|
|
|
|
{
|
|
|
|
evas_object_hide(fwin->popup);
|
|
|
|
evas_object_del(fwin->popup);
|
|
|
|
}
|
2012-07-13 00:55:09 -07:00
|
|
|
if (fwin->popup_timer) ecore_timer_del(fwin->popup_timer);
|
|
|
|
fwin->popup_timer = NULL;
|
2019-01-09 10:23:19 -08:00
|
|
|
if (fwin->win)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del(fwin->win, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler);
|
|
|
|
evas_object_event_callback_del(fwin->win, EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler);
|
|
|
|
}
|
2012-09-21 00:34:11 -07:00
|
|
|
E_FREE_LIST(fwin->popup_handlers, ecore_event_handler_del);
|
2012-09-13 03:49:22 -07:00
|
|
|
if (fwin->spring_parent) fwin->spring_parent->spring_child = NULL;
|
2013-02-01 03:39:19 -08:00
|
|
|
if (fwin->win)
|
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_event_callback_del_full(fwin->win, EVAS_CALLBACK_DEL, _e_fwin_cb_delete, fwin);
|
|
|
|
evas_object_del(fwin->win);
|
2013-02-01 03:39:19 -08:00
|
|
|
}
|
2007-08-12 02:54:33 -07:00
|
|
|
free(fwin);
|
|
|
|
}
|
|
|
|
|
2015-01-13 17:04:19 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_icon_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
int x, y, w, h, mw, mh, fx, fy, px, py;
|
|
|
|
E_Zone *zone;
|
|
|
|
Evas_Object *edje;
|
|
|
|
E_Fwin *fwin = data;
|
2016-10-31 02:23:08 -07:00
|
|
|
E_Fm2_Icon_Info *popup_icon;
|
2015-01-13 17:04:19 -08:00
|
|
|
|
2016-10-31 02:23:08 -07:00
|
|
|
popup_icon = e_fm2_icon_file_get(fwin->cur_page->fm_obj, fwin->over_file);
|
|
|
|
if (!popup_icon) return;
|
|
|
|
e_fm2_icon_geometry_get(popup_icon->ic, &x, &y, &w, &h);
|
2015-01-13 17:04:19 -08:00
|
|
|
if (fwin->zone)
|
|
|
|
{
|
2017-08-25 11:47:04 -07:00
|
|
|
zone = fwin->zone;
|
2016-10-31 02:23:08 -07:00
|
|
|
evas_object_geometry_get(popup_icon->fm, &fx, &fy, NULL, NULL);
|
2015-01-13 17:04:19 -08:00
|
|
|
fx -= zone->x, fy -= zone->y;
|
|
|
|
}
|
|
|
|
else
|
2017-08-25 11:47:04 -07:00
|
|
|
{
|
|
|
|
E_Client *ec = e_win_client_get(fwin->win);
|
|
|
|
fx = ec->x, fy = ec->y;
|
|
|
|
zone = ec->zone;
|
|
|
|
}
|
2015-01-13 17:04:19 -08:00
|
|
|
edje = evas_object_smart_parent_get(obj);
|
|
|
|
/* failing to unswallow here causes edje to fail its min size calculations */
|
|
|
|
edje_object_part_unswallow(edje, obj);
|
|
|
|
edje_object_part_swallow(edje, "e.swallow.content", obj);
|
|
|
|
edje_object_size_min_calc(edje, &mw, &mh);
|
|
|
|
/* prefer tooltip left of icon */
|
|
|
|
px = (fx + x) - mw - 3;
|
|
|
|
/* if it's offscreen, try right of icon */
|
|
|
|
if (px < zone->x) px = (fx + x + w) + 3;
|
|
|
|
/* fuck this, stick it right on the icon */
|
|
|
|
if (px + mw + 3 > zone->x + zone->w)
|
|
|
|
px = (x + w / 2) - (mw / 2);
|
|
|
|
/* give up */
|
|
|
|
if (px < zone->x) px = zone->x;
|
|
|
|
|
|
|
|
/* prefer tooltip above icon */
|
|
|
|
py = (fy + y) - mh - 3;
|
|
|
|
/* if it's offscreen, try below icon */
|
|
|
|
if (py < zone->y) py = (fy + y + h) + 3;
|
|
|
|
/* fuck this, stick it right on the icon */
|
|
|
|
if (py + mh + 3 > zone->x + zone->h)
|
|
|
|
py = (y + h / 2) - (mh / 2);
|
|
|
|
/* give up */
|
|
|
|
if (py < zone->y) py = zone->y;
|
|
|
|
evas_object_geometry_set(fwin->popup, px, py, mw, mh);
|
|
|
|
}
|
|
|
|
|
2015-11-20 06:14:53 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_popup_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del(data, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _e_fwin_icon_hints);
|
|
|
|
}
|
|
|
|
|
2012-07-12 05:28:46 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_e_fwin_icon_popup(void *data)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
2012-10-30 04:54:49 -07:00
|
|
|
Evas_Object *bg, *list, *o;
|
2012-07-12 05:28:46 -07:00
|
|
|
E_Zone *zone;
|
2012-08-22 00:32:12 -07:00
|
|
|
char buf[4096];
|
2015-01-13 17:04:19 -08:00
|
|
|
int mw, mh;
|
2016-10-31 02:23:08 -07:00
|
|
|
E_Fm2_Icon_Info *popup_icon;
|
2016-11-01 18:58:49 -07:00
|
|
|
struct stat st;
|
2012-07-12 05:28:46 -07:00
|
|
|
|
|
|
|
fwin->popup_timer = NULL;
|
2016-10-31 02:23:08 -07:00
|
|
|
popup_icon = e_fm2_icon_file_get(fwin->cur_page->fm_obj, fwin->over_file);
|
|
|
|
if (!popup_icon) return EINA_FALSE;
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->cur_page->fm_obj), popup_icon->file);
|
2012-09-10 02:08:24 -07:00
|
|
|
if (!ecore_file_can_read(buf)) return EINA_FALSE;
|
2016-11-01 18:58:49 -07:00
|
|
|
|
|
|
|
if (stat(buf, &st) < 0) return EINA_FALSE;
|
|
|
|
|
|
|
|
if (S_ISFIFO(st.st_mode)) return EINA_FALSE;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (fwin->popup)
|
2012-07-12 05:28:46 -07:00
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_hide(fwin->popup);
|
|
|
|
evas_object_del(fwin->popup);
|
2012-07-12 05:28:46 -07:00
|
|
|
}
|
2014-04-21 10:36:37 -07:00
|
|
|
|
2015-01-13 17:04:19 -08:00
|
|
|
zone = fwin->zone ?: e_comp_object_util_zone_get(fwin->win);
|
2015-01-13 19:44:23 -08:00
|
|
|
bg = edje_object_add(e_comp->evas);
|
2012-10-28 00:45:48 -07:00
|
|
|
e_theme_edje_object_set(bg, "base/theme/fileman",
|
|
|
|
"e/fileman/popup/default");
|
2012-07-13 00:53:26 -07:00
|
|
|
mw = zone->w * fileman_config->tooltip.size / 100.0;
|
|
|
|
mh = zone->h * fileman_config->tooltip.size / 100.0;
|
2012-10-26 06:31:03 -07:00
|
|
|
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_text_set(bg, "e.text.title",
|
2016-10-31 02:23:08 -07:00
|
|
|
popup_icon->label ?
|
|
|
|
popup_icon->label : popup_icon->file);
|
2012-10-28 00:45:48 -07:00
|
|
|
|
2015-01-13 19:44:23 -08:00
|
|
|
list = e_widget_list_add(e_comp->evas, 0, 0);
|
2015-11-20 06:14:53 -08:00
|
|
|
if (fwin->win)
|
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_DEL, _e_fwin_popup_del, list);
|
2012-10-28 00:45:48 -07:00
|
|
|
|
2015-01-13 19:44:23 -08:00
|
|
|
o = e_widget_filepreview_add(e_comp->evas, mw, mh, 0);
|
2014-01-27 09:28:35 -08:00
|
|
|
e_widget_filepreview_clamp_video_set(o, fileman_config->tooltip.clamp_size);
|
2016-10-31 02:23:08 -07:00
|
|
|
e_widget_filepreview_path_set(o, buf, popup_icon->mime);
|
2012-10-28 00:45:48 -07:00
|
|
|
e_widget_list_object_append(list, o, 1, 0, 0.5);
|
|
|
|
edje_object_part_swallow(bg, "e.swallow.content", list);
|
2017-08-25 11:47:04 -07:00
|
|
|
|
|
|
|
_e_fwin_icon_hints(fwin, NULL, list, NULL);
|
2015-01-13 17:04:19 -08:00
|
|
|
evas_object_event_callback_add(list, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _e_fwin_icon_hints, fwin);
|
2012-07-13 03:52:57 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
fwin->popup = e_comp_object_util_add(bg, E_COMP_OBJECT_TYPE_POPUP);
|
|
|
|
evas_object_layer_set(fwin->popup, E_LAYER_POPUP);
|
|
|
|
e_comp_object_util_del_list_append(fwin->popup, list);
|
|
|
|
e_comp_object_util_del_list_append(fwin->popup, o);
|
|
|
|
evas_object_pass_events_set(fwin->popup, 1);
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-09-21 00:34:11 -07:00
|
|
|
if (!fwin->popup_handlers)
|
|
|
|
{
|
2015-07-06 11:23:54 -07:00
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
if (e_comp_util_has_x())
|
|
|
|
E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_XDND_POSITION, (Ecore_Event_Handler_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, (Ecore_Event_Handler_Cb)_e_fwin_icon_popup_handler, fwin);
|
2012-09-21 00:34:11 -07:00
|
|
|
}
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_show(fwin->popup);
|
2012-07-12 05:28:46 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2013-06-10 05:34:04 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_icon_popup_del(E_Fwin *fwin)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_hide(fwin->popup);
|
|
|
|
E_FREE_FUNC(fwin->popup, evas_object_del);
|
2013-06-10 05:34:04 -07:00
|
|
|
fwin->popup_del_job = NULL;
|
|
|
|
}
|
|
|
|
|
2012-07-12 05:28:46 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_icon_mouse_out(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-07-12 05:28:46 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
|
2013-06-10 05:34:04 -07:00
|
|
|
E_FREE_FUNC(fwin->popup_timer, ecore_timer_del);
|
|
|
|
if (!fwin->popup_del_job) fwin->popup_del_job = ecore_job_add((Ecore_Cb)_e_fwin_icon_popup_del, fwin);
|
2012-07-12 05:28:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_icon_mouse_in(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2012-07-12 05:28:46 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
E_Fm2_Icon_Info *ici = event_info;
|
|
|
|
|
|
|
|
if (fwin->popup_timer) ecore_timer_del(fwin->popup_timer);
|
2012-08-13 07:12:45 -07:00
|
|
|
fwin->popup_timer = NULL;
|
|
|
|
if (!fileman_config->tooltip.enable) return;
|
2017-02-03 13:52:28 -08:00
|
|
|
fwin->popup_timer = ecore_timer_loop_add(fileman_config->tooltip.delay, _e_fwin_icon_popup, fwin);
|
2016-10-31 02:23:08 -07:00
|
|
|
if (fwin->over_file) eina_stringshare_del(fwin->over_file);
|
|
|
|
fwin->over_file = NULL;
|
|
|
|
if (ici->file) fwin->over_file = eina_stringshare_add(ici->file);
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-10-01 01:41:57 -07:00
|
|
|
if (!fwin->popup_handlers)
|
|
|
|
{
|
2019-01-09 10:23:19 -08:00
|
|
|
if (fwin->win)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
evas_object_event_callback_add(fwin->win, EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
}
|
2015-07-06 11:23:54 -07:00
|
|
|
if (e_comp_util_has_x())
|
|
|
|
E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_XDND_POSITION, (Ecore_Event_Handler_Cb)_e_fwin_icon_popup_handler, fwin);
|
|
|
|
E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, (Ecore_Event_Handler_Cb)_e_fwin_icon_popup_handler, fwin);
|
2012-10-01 01:41:57 -07:00
|
|
|
}
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2012-07-12 05:28:46 -07:00
|
|
|
}
|
|
|
|
|
2012-07-31 06:31:35 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_page_favorites_add(E_Fwin_Page *page)
|
|
|
|
{
|
|
|
|
E_Fm2_Config fmc;
|
|
|
|
Evas_Object *o;
|
2012-10-28 00:45:48 -07:00
|
|
|
Evas *evas = evas_object_evas_get(page->fwin->bg_obj);
|
2012-07-31 06:31:35 -07:00
|
|
|
|
|
|
|
o = e_fm2_add(evas);
|
2012-09-14 09:51:38 -07:00
|
|
|
evas_object_data_set(o, "fm_page", page);
|
2012-07-31 06:31:35 -07:00
|
|
|
page->flist = o;
|
|
|
|
memset(&fmc, 0, sizeof(E_Fm2_Config));
|
|
|
|
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
|
|
|
|
fmc.view.open_dirs_in_place = 1;
|
|
|
|
fmc.view.selector = 1;
|
|
|
|
fmc.view.single_click = 1;
|
|
|
|
fmc.view.no_subdir_jump = 1;
|
|
|
|
fmc.view.link_drop = 1;
|
|
|
|
fmc.icon.list.w = 24;
|
|
|
|
fmc.icon.list.h = 24;
|
|
|
|
fmc.icon.fixed.w = 1;
|
|
|
|
fmc.icon.fixed.h = 1;
|
|
|
|
fmc.icon.extension.show = 0;
|
|
|
|
fmc.icon.key_hint = NULL;
|
|
|
|
fmc.list.sort.no_case = 1;
|
|
|
|
fmc.list.sort.dirs.first = 0;
|
|
|
|
fmc.list.sort.dirs.last = 0;
|
|
|
|
fmc.selection.single = 1;
|
|
|
|
fmc.selection.windows_modifiers = 0;
|
2012-08-08 04:55:50 -07:00
|
|
|
fmc.view.no_click_rename = 1;
|
2012-07-31 06:31:35 -07:00
|
|
|
e_fm2_config_set(o, &fmc);
|
2012-09-10 03:32:21 -07:00
|
|
|
e_fm2_icon_menu_flags_set(o, E_FM2_MENU_NO_NEW | E_FM2_MENU_NO_ACTIVATE_CHANGE | E_FM2_MENU_NO_VIEW_CHANGE);
|
2012-07-31 06:31:35 -07:00
|
|
|
evas_object_smart_callback_add(o, "selected", _e_fwin_favorite_selected, page);
|
2012-09-13 09:35:08 -07:00
|
|
|
evas_object_smart_callback_add(o, "dnd_enter", (Evas_Smart_Cb)_e_fwin_dnd_enter_cb, page->fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_leave", (Evas_Smart_Cb)_e_fwin_dnd_leave_cb, page->fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_changed", (Evas_Smart_Cb)_e_fwin_dnd_change_cb, page->fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_begin", (Evas_Smart_Cb)_e_fwin_dnd_begin_cb, page->fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_end", (Evas_Smart_Cb)_e_fwin_dnd_end_cb, page->fwin);
|
2012-07-31 06:31:35 -07:00
|
|
|
e_fm2_path_set(o, "favorites", "/");
|
|
|
|
|
|
|
|
o = e_widget_scrollframe_pan_add(evas, page->flist,
|
|
|
|
e_fm2_pan_set,
|
|
|
|
e_fm2_pan_get,
|
|
|
|
e_fm2_pan_max_get,
|
|
|
|
e_fm2_pan_child_size_get);
|
2012-10-28 00:45:48 -07:00
|
|
|
e_scrollframe_custom_theme_set(e_widget_scrollframe_object_get(o),
|
|
|
|
"base/theme/fileman",
|
2012-10-25 00:17:10 -07:00
|
|
|
"e/fileman/default/scrollframe");
|
2012-07-31 06:31:35 -07:00
|
|
|
evas_object_propagate_events_set(page->flist, 0);
|
2012-08-01 00:52:17 -07:00
|
|
|
e_widget_can_focus_set(o, EINA_FALSE);
|
2015-04-27 12:39:43 -07:00
|
|
|
e_fm2_window_set(page->flist, page->fwin->win);
|
2012-07-31 06:31:35 -07:00
|
|
|
e_widget_scrollframe_focus_object_set(o, page->flist);
|
|
|
|
|
|
|
|
page->flist_frame = o;
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(o, 128, 0);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(page->fwin->bg_obj, "e.swallow.favorites", o);
|
2012-07-31 06:31:35 -07:00
|
|
|
}
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
static E_Fwin_Page *
|
|
|
|
_e_fwin_page_create(E_Fwin *fwin)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
E_Fwin_Page *page;
|
2012-07-31 06:31:35 -07:00
|
|
|
Evas *evas;
|
2009-04-28 10:38:09 -07:00
|
|
|
|
|
|
|
page = E_NEW(E_Fwin_Page, 1);
|
|
|
|
page->fwin = fwin;
|
2014-11-02 18:35:13 -08:00
|
|
|
evas = evas_object_evas_get(fwin->win);
|
2009-04-28 10:38:09 -07:00
|
|
|
|
2012-07-31 06:31:35 -07:00
|
|
|
if (fileman_config->view.show_sidebar)
|
2012-10-28 00:45:48 -07:00
|
|
|
{
|
|
|
|
_e_fwin_page_favorites_add(page);
|
|
|
|
edje_object_signal_emit(fwin->bg_obj, "e,favorites,enabled", "e");
|
|
|
|
edje_object_message_signal_process(fwin->bg_obj);
|
|
|
|
}
|
2012-07-31 06:31:35 -07:00
|
|
|
|
|
|
|
o = e_fm2_add(evas);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_obj = o;
|
|
|
|
e_fm2_view_flags_set(o, E_FM2_VIEW_DIR_CUSTOM);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_fwin_cb_key_down, page);
|
2011-01-05 14:36:21 -08:00
|
|
|
|
2012-12-18 02:19:42 -08:00
|
|
|
evas_object_smart_callback_add(o, "changed", _e_fwin_icon_mouse_out, fwin);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_smart_callback_add(o, "dir_changed",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_changed, page);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_smart_callback_add(o, "dir_deleted",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_deleted, page);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_smart_callback_add(o, "selected",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_selected, page);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_smart_callback_add(o, "selection_change",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_selection_change, page);
|
2011-02-15 19:45:57 -08:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
|
|
|
|
_e_fwin_cb_page_obj_del, page);
|
2012-09-13 03:49:22 -07:00
|
|
|
evas_object_smart_callback_add(o, "dnd_enter", (Evas_Smart_Cb)_e_fwin_dnd_enter_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_leave", (Evas_Smart_Cb)_e_fwin_dnd_leave_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_changed", (Evas_Smart_Cb)_e_fwin_dnd_change_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_begin", (Evas_Smart_Cb)_e_fwin_dnd_begin_cb, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "dnd_end", (Evas_Smart_Cb)_e_fwin_dnd_end_cb, fwin);
|
2012-07-09 04:45:05 -07:00
|
|
|
evas_object_smart_callback_add(o, "double_clicked", (Evas_Smart_Cb)_e_fwin_bg_mouse_down, fwin);
|
2012-09-13 03:51:50 -07:00
|
|
|
evas_object_smart_callback_add(o, "icon_mouse_in", (Evas_Smart_Cb)_e_fwin_icon_mouse_in, fwin);
|
|
|
|
evas_object_smart_callback_add(o, "icon_mouse_out", (Evas_Smart_Cb)_e_fwin_icon_mouse_out, fwin);
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, page);
|
2015-04-27 12:39:43 -07:00
|
|
|
e_fm2_window_set(o, fwin->win);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_focus_set(o, 1);
|
2012-07-31 06:31:35 -07:00
|
|
|
_e_fwin_config_set(page);
|
2011-01-05 14:36:21 -08:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
/* FIXME: this theme object will have more versions and options later
|
|
|
|
* for things like swallowing widgets/buttons ot providing them - a
|
2011-01-05 14:36:21 -08:00
|
|
|
* gadcon for starters for fm widgets. need to register the owning
|
2009-04-28 10:38:09 -07:00
|
|
|
* e_object of the gadcon so gadcon clients can get it and thus do
|
|
|
|
* things like find out what dirs/path the fwin is for etc. this will
|
|
|
|
* probably be how you add optional gadgets to fwin views like empty/full
|
|
|
|
* meters for disk usage, and other dir info/stats or controls. also it
|
|
|
|
* might be possible that we can have custom frames per dir later so need
|
|
|
|
* a way to set an edje file directly
|
|
|
|
*/
|
|
|
|
/* FIXME: allow specialised scrollframe obj per dir - get from e config,
|
|
|
|
* then look in the dir itself for a magic dot-file, if not - use theme.
|
|
|
|
* same as currently done for bg & overlay. also add to fm2 the ability
|
|
|
|
* to specify the .edj files to get the list and icon theme stuff from
|
|
|
|
*/
|
|
|
|
evas_object_data_set(page->fm_obj, "fm_page", page);
|
2012-08-06 05:44:29 -07:00
|
|
|
evas_object_data_set(page->fm_obj, "page_is_window", page);
|
2012-07-31 06:31:35 -07:00
|
|
|
o = e_widget_scrollframe_pan_add(evas, page->fm_obj,
|
|
|
|
e_fm2_pan_set,
|
|
|
|
e_fm2_pan_get,
|
|
|
|
e_fm2_pan_max_get,
|
|
|
|
e_fm2_pan_child_size_get);
|
2009-04-28 10:38:09 -07:00
|
|
|
evas_object_propagate_events_set(page->fm_obj, 0);
|
2012-08-01 00:52:17 -07:00
|
|
|
e_widget_can_focus_set(o, EINA_FALSE);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->scrollframe_obj = o;
|
2012-07-31 06:31:35 -07:00
|
|
|
page->scr = e_widget_scrollframe_object_get(o);
|
2012-12-19 04:29:47 -08:00
|
|
|
e_scrollframe_key_navigation_set(o, EINA_FALSE);
|
2012-10-28 00:45:48 -07:00
|
|
|
e_scrollframe_custom_theme_set(o, "base/theme/fileman",
|
2012-07-31 06:31:35 -07:00
|
|
|
"e/fileman/default/scrollframe");
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(fwin->bg_obj, "e.swallow.content", o);
|
2012-12-04 03:21:15 -08:00
|
|
|
e_widget_scrollframe_focus_object_set(o, page->fm_obj);
|
2009-04-28 10:38:09 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fileman_config->view.show_toolbar)
|
2012-12-18 07:12:22 -08:00
|
|
|
{
|
|
|
|
page->tbar = e_toolbar_new(evas, "toolbar",
|
|
|
|
fwin->win, page->fm_obj);
|
|
|
|
e_toolbar_orient(page->tbar, fileman_config->view.toolbar_orient);
|
2013-05-28 06:55:54 -07:00
|
|
|
e_object_data_set(E_OBJECT(page->tbar), page);
|
|
|
|
E_OBJECT_DEL_SET(page->tbar, _e_fwin_cb_toolbar_del);
|
2012-12-18 07:12:22 -08:00
|
|
|
}
|
2009-04-28 10:38:09 -07:00
|
|
|
|
|
|
|
page->fm_op_entry_add_handler =
|
2011-01-05 14:36:21 -08:00
|
|
|
ecore_event_handler_add(E_EVENT_FM_OP_REGISTRY_ADD,
|
|
|
|
_e_fwin_op_registry_entry_add_cb, page);
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_op_registry_entry_iter(page);
|
2012-10-28 00:45:48 -07:00
|
|
|
_e_fwin_toolbar_resize(page);
|
2009-04-28 10:38:09 -07:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_fwin_page_free(E_Fwin_Page *page)
|
|
|
|
{
|
|
|
|
if (page->fm_obj) evas_object_del(page->fm_obj);
|
2014-11-05 11:55:19 -08:00
|
|
|
evas_object_del(page->flist);
|
|
|
|
evas_object_del(page->flist_frame);
|
2012-12-18 07:12:22 -08:00
|
|
|
if (page->tbar)
|
|
|
|
{
|
|
|
|
fileman_config->view.toolbar_orient = page->tbar->gadcon->orient;
|
2013-05-28 06:55:54 -07:00
|
|
|
E_OBJECT_DEL_SET(E_OBJECT(page->tbar), NULL);
|
2012-12-18 07:12:22 -08:00
|
|
|
e_object_del(E_OBJECT(page->tbar));
|
|
|
|
}
|
2012-07-31 06:31:35 -07:00
|
|
|
else evas_object_del(page->scrollframe_obj);
|
2009-04-28 10:38:09 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (page->fm_op_entry_add_handler)
|
2009-04-28 10:38:09 -07:00
|
|
|
ecore_event_handler_del(page->fm_op_entry_add_handler);
|
|
|
|
|
|
|
|
E_FREE(page);
|
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static const char *
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_custom_file_path_eval(E_Fwin *fwin,
|
2011-01-05 14:36:21 -08:00
|
|
|
Efreet_Desktop *ef,
|
2012-07-06 06:35:03 -07:00
|
|
|
const char *prev_path,
|
|
|
|
const char *key)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
const char *res, *ret = NULL;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* get a X-something custom tage from the .desktop for the dir */
|
2016-01-25 08:29:55 -08:00
|
|
|
res = efreet_desktop_x_field_get(ef, key);
|
2007-08-12 02:54:33 -07:00
|
|
|
/* free the old path */
|
2008-10-15 08:12:56 -07:00
|
|
|
if (prev_path) eina_stringshare_del(prev_path);
|
2007-08-12 02:54:33 -07:00
|
|
|
/* if there was no key found - return NULL */
|
|
|
|
if (!res) return NULL;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
/* it's a full path */
|
|
|
|
if (res[0] == '/')
|
2016-01-25 08:29:55 -08:00
|
|
|
return res;
|
2007-08-12 02:54:33 -07:00
|
|
|
/* relative path to the dir */
|
2016-01-25 08:29:55 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s",
|
|
|
|
e_fm2_real_path_get(fwin->cur_page->fm_obj), res);
|
|
|
|
ret = eina_stringshare_add(buf);
|
|
|
|
eina_stringshare_del(res);
|
2007-08-12 02:54:33 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-07-06 20:24:53 -07:00
|
|
|
static Eina_List *
|
|
|
|
_e_fwin_defaults_apps_get(const char *mime, const char *path)
|
|
|
|
{
|
|
|
|
Efreet_Ini *ini;
|
|
|
|
const char *str;
|
|
|
|
Eina_List *apps = NULL;
|
|
|
|
char **array, **itr;
|
|
|
|
|
|
|
|
if (!ecore_file_exists(path)) return NULL;
|
|
|
|
|
|
|
|
ini = efreet_ini_new(path);
|
|
|
|
if (!ini) return NULL;
|
|
|
|
|
|
|
|
efreet_ini_section_set(ini, "Default Applications");
|
|
|
|
str = efreet_ini_string_get(ini, mime);
|
|
|
|
if (!str) goto end;
|
|
|
|
|
|
|
|
array = eina_str_split(str, ";", 0);
|
|
|
|
if (!array) goto end;
|
|
|
|
|
|
|
|
for (itr = array; *itr != NULL; itr++)
|
|
|
|
{
|
|
|
|
const char *name = *itr;
|
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
|
|
|
|
if (name[0] == '/')
|
|
|
|
desktop = efreet_desktop_new(name);
|
|
|
|
else
|
|
|
|
desktop = efreet_util_desktop_file_id_find(name);
|
|
|
|
|
|
|
|
if (!desktop) continue;
|
|
|
|
if (!desktop->exec)
|
|
|
|
{
|
|
|
|
efreet_desktop_free(desktop);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
apps = eina_list_append(apps, desktop);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(array[0]);
|
|
|
|
free(array);
|
|
|
|
end:
|
|
|
|
efreet_ini_free(ini);
|
|
|
|
return apps;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_List *
|
|
|
|
_e_fwin_suggested_apps_list_sort(const char *mime, Eina_List *desktops, Eina_Bool *has_default)
|
|
|
|
{
|
|
|
|
char path[PATH_MAX];
|
|
|
|
Eina_List *order, *l;
|
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
|
2018-03-20 04:36:56 -07:00
|
|
|
snprintf(path, sizeof(path), "%s/mimeapps.list",
|
|
|
|
efreet_config_home_get());
|
2012-07-06 20:24:53 -07:00
|
|
|
order = _e_fwin_defaults_apps_get(mime, path);
|
|
|
|
|
|
|
|
if (!order)
|
|
|
|
{
|
|
|
|
const Eina_List *n, *dirs = efreet_data_dirs_get();
|
|
|
|
const char *d;
|
|
|
|
EINA_LIST_FOREACH(dirs, n, d)
|
|
|
|
{
|
|
|
|
snprintf(path, sizeof(path), "%s/applications/defaults.list", d);
|
|
|
|
order = _e_fwin_defaults_apps_get(mime, path);
|
|
|
|
if (order)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!order)
|
|
|
|
{
|
|
|
|
if (has_default) *has_default = EINA_FALSE;
|
|
|
|
return desktops;
|
|
|
|
}
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(order, l, desktop)
|
|
|
|
{
|
|
|
|
Eina_List *node = eina_list_data_find_list(desktops, desktop);
|
|
|
|
if (!node) continue;
|
|
|
|
desktops = eina_list_remove_list(desktops, node);
|
|
|
|
efreet_desktop_free(desktop);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_default) *has_default = EINA_TRUE;
|
|
|
|
|
|
|
|
return eina_list_merge(order, desktops);
|
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static Eina_List *
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_suggested_apps_list_get(Eina_List *files,
|
2012-07-06 20:24:53 -07:00
|
|
|
Eina_List **mime_list,
|
|
|
|
Eina_Bool *has_default)
|
2009-04-03 21:14:01 -07:00
|
|
|
{
|
|
|
|
E_Fm2_Icon_Info *ici;
|
2012-07-06 19:33:04 -07:00
|
|
|
Eina_Hash *set_mimes;
|
|
|
|
Eina_List *apps = NULL, *l;
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
set_mimes = eina_hash_string_small_new(NULL);
|
2009-04-03 21:14:01 -07:00
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
if (!((ici->link) && (ici->mount)))
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
|
|
|
|
{
|
2012-07-06 19:33:04 -07:00
|
|
|
const char *key = ici->mime;
|
2011-01-05 14:36:21 -08:00
|
|
|
if (ici->link)
|
2012-07-06 19:33:04 -07:00
|
|
|
key = efreet_mime_globs_type_get(ici->link);
|
|
|
|
|
|
|
|
if (!eina_hash_find(set_mimes, key))
|
|
|
|
eina_hash_direct_add(set_mimes, key, (void *)1);
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
2009-04-03 21:14:01 -07:00
|
|
|
}
|
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
if (mime_list) *mime_list = NULL;
|
2012-07-06 20:24:53 -07:00
|
|
|
if (has_default) *has_default = EINA_FALSE;
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
if (eina_hash_population(set_mimes) > 0)
|
2010-03-25 22:34:34 -07:00
|
|
|
{
|
2012-07-06 19:33:04 -07:00
|
|
|
Eina_Hash *set_apps = eina_hash_pointer_new(NULL);
|
|
|
|
Eina_Iterator *itr = eina_hash_iterator_key_new(set_mimes);
|
|
|
|
const char *mime;
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
EINA_ITERATOR_FOREACH(itr, mime)
|
|
|
|
{
|
|
|
|
Eina_List *desktops = efreet_util_desktop_mime_list(mime);
|
|
|
|
Efreet_Desktop *d;
|
2012-07-06 20:24:53 -07:00
|
|
|
Eina_Bool hd = EINA_FALSE;
|
2012-07-06 19:33:04 -07:00
|
|
|
|
|
|
|
if (mime_list) *mime_list = eina_list_append(*mime_list, mime);
|
|
|
|
|
2012-07-06 20:24:53 -07:00
|
|
|
desktops = _e_fwin_suggested_apps_list_sort(mime, desktops, &hd);
|
|
|
|
if ((hd) && (has_default))
|
|
|
|
*has_default = EINA_TRUE;
|
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
EINA_LIST_FREE(desktops, d)
|
|
|
|
{
|
|
|
|
if (eina_hash_find(set_apps, &d)) efreet_desktop_free(d);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
eina_hash_add(set_apps, &d, (void *)1);
|
|
|
|
apps = eina_list_append(apps, d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_iterator_free(itr);
|
|
|
|
eina_hash_free(set_apps);
|
|
|
|
}
|
|
|
|
eina_hash_free(set_mimes);
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2012-07-06 19:33:04 -07:00
|
|
|
return apps;
|
2009-04-03 21:14:01 -07:00
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_desktop_run(Efreet_Desktop *desktop,
|
2012-07-06 06:35:03 -07:00
|
|
|
E_Fwin_Page *page,
|
|
|
|
Eina_Bool skip_history)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
char pcwd[4096], buf[4096];
|
|
|
|
Eina_List *selected, *l, *files = NULL;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin *fwin = page->fwin;
|
2009-04-10 15:02:32 -07:00
|
|
|
E_Fm2_Icon_Info *ici;
|
|
|
|
char *file;
|
2012-07-19 21:48:59 -07:00
|
|
|
|
|
|
|
skip_history = EINA_FALSE;
|
2007-08-12 16:04:38 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
if (!selected) return;
|
|
|
|
|
2012-11-18 11:58:02 -08:00
|
|
|
if (!getcwd(pcwd, sizeof(pcwd))) return;
|
2013-07-14 19:45:19 -07:00
|
|
|
if (chdir(e_fm2_real_path_get(page->fm_obj)) < 0) return;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(selected, l, ici)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Fwin_Exec_Type ext;
|
|
|
|
|
|
|
|
/* this snprintf is silly - but it's here in case i really do
|
|
|
|
* need to provide full paths (seems silly since we chdir
|
|
|
|
* into the dir)
|
|
|
|
*/
|
|
|
|
buf[0] = 0;
|
|
|
|
ext = _e_fwin_file_is_exec(ici);
|
2012-08-22 23:53:53 -07:00
|
|
|
if ((ext == E_FWIN_EXEC_NONE) || (desktop))
|
2011-01-05 14:36:21 -08:00
|
|
|
{
|
|
|
|
if (!((ici->link) && (ici->mount)))
|
|
|
|
eina_strlcpy(buf, ici->file, sizeof(buf));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_e_fwin_file_exec(page, ici, ext);
|
|
|
|
if (buf[0] != 0)
|
|
|
|
{
|
|
|
|
if ((ici->mime) && (desktop) && !(skip_history))
|
|
|
|
e_exehist_mime_desktop_add(ici->mime, desktop);
|
|
|
|
files = eina_list_append(files, strdup(ici->file));
|
|
|
|
}
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
2011-01-01 07:51:09 -08:00
|
|
|
if ((fwin->win) && (desktop))
|
2012-07-19 21:48:59 -07:00
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), desktop, NULL, files, "fwin");
|
2012-07-19 21:48:59 -07:00
|
|
|
ici = selected->data;
|
|
|
|
if ((ici) && (ici->mime) && (desktop) && !(skip_history))
|
|
|
|
e_exehist_mime_desktop_add(ici->mime, desktop);
|
|
|
|
}
|
2009-04-10 15:02:32 -07:00
|
|
|
else if (fwin->zone && desktop)
|
|
|
|
e_exec(fwin->zone, desktop, NULL, files, "fwin");
|
|
|
|
|
2012-07-19 21:48:59 -07:00
|
|
|
eina_list_free(selected);
|
|
|
|
|
|
|
|
EINA_LIST_FREE(files, file) free(file);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2013-07-14 19:45:19 -07:00
|
|
|
if (chdir(pcwd) < 0) perror("chdir");
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static E_Fwin_Exec_Type
|
|
|
|
_e_fwin_file_is_exec(E_Fm2_Icon_Info *ici)
|
|
|
|
{
|
|
|
|
/* special file or dir - can't exec anyway */
|
2012-07-06 06:35:03 -07:00
|
|
|
if ((S_ISCHR(ici->statinfo.st_mode)) ||
|
|
|
|
(S_ISBLK(ici->statinfo.st_mode)) ||
|
|
|
|
(S_ISFIFO(ici->statinfo.st_mode)) ||
|
|
|
|
(S_ISSOCK(ici->statinfo.st_mode)))
|
|
|
|
return E_FWIN_EXEC_NONE;
|
|
|
|
/* it is executable */
|
|
|
|
if ((ici->statinfo.st_mode & S_IXOTH) ||
|
|
|
|
((getgid() == ici->statinfo.st_gid) &&
|
|
|
|
(ici->statinfo.st_mode & S_IXGRP)) ||
|
|
|
|
((getuid() == ici->statinfo.st_uid) &&
|
|
|
|
(ici->statinfo.st_mode & S_IXUSR)))
|
|
|
|
{
|
|
|
|
/* no mimetype */
|
|
|
|
if (!ici->mime)
|
|
|
|
return E_FWIN_EXEC_DIRECT;
|
|
|
|
/* mimetype */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* FIXME: - this could be config */
|
|
|
|
if (!strcmp(ici->mime, "application/x-desktop"))
|
2011-01-05 14:36:21 -08:00
|
|
|
return E_FWIN_EXEC_DESKTOP;
|
2012-07-06 06:35:03 -07:00
|
|
|
else if ((!strcmp(ici->mime, "application/x-sh")) ||
|
|
|
|
(!strcmp(ici->mime, "application/x-shellscript")) ||
|
|
|
|
(!strcmp(ici->mime, "application/x-csh")) ||
|
|
|
|
(!strcmp(ici->mime, "application/x-perl")) ||
|
|
|
|
(!strcmp(ici->mime, "application/x-shar")) ||
|
2012-09-17 03:33:42 -07:00
|
|
|
(!strcmp(ici->mime, "application/x-executable")) ||
|
2012-07-06 06:35:03 -07:00
|
|
|
(!strcmp(ici->mime, "text/x-csh")) ||
|
|
|
|
(!strcmp(ici->mime, "text/x-python")) ||
|
|
|
|
(!strcmp(ici->mime, "text/x-sh"))
|
|
|
|
)
|
|
|
|
{
|
2012-09-05 03:23:23 -07:00
|
|
|
return E_FWIN_EXEC_DIRECT;
|
2012-07-06 06:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* mimetype */
|
|
|
|
if (ici->mime)
|
|
|
|
{
|
|
|
|
/* FIXME: - this could be config */
|
|
|
|
if (!strcmp(ici->mime, "application/x-desktop"))
|
|
|
|
return E_FWIN_EXEC_DESKTOP;
|
|
|
|
else if ((!strcmp(ici->mime, "application/x-sh")) ||
|
|
|
|
(!strcmp(ici->mime, "application/x-shellscript")) ||
|
|
|
|
(!strcmp(ici->mime, "text/x-sh"))
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return E_FWIN_EXEC_TERMINAL_SH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((e_util_glob_match(ici->file, "*.desktop")) ||
|
|
|
|
(e_util_glob_match(ici->file, "*.kdelink"))
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return E_FWIN_EXEC_DESKTOP;
|
|
|
|
}
|
|
|
|
else if (e_util_glob_match(ici->file, "*.run"))
|
|
|
|
return E_FWIN_EXEC_TERMINAL_SH;
|
|
|
|
}
|
|
|
|
return E_FWIN_EXEC_NONE;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_file_exec(E_Fwin_Page *page,
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Fm2_Icon_Info *ici,
|
|
|
|
E_Fwin_Exec_Type ext)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin *fwin = page->fwin;
|
2009-04-10 15:02:32 -07:00
|
|
|
char buf[4096];
|
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
|
|
|
|
/* FIXME: execute file ici with either a terminal, the shell, or directly
|
|
|
|
* or open the .desktop and exec it */
|
|
|
|
switch (ext)
|
|
|
|
{
|
|
|
|
case E_FWIN_EXEC_NONE:
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FWIN_EXEC_DIRECT:
|
2012-09-05 03:23:23 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->cur_page->fm_obj), ici->file);
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
else if (fwin->zone)
|
2012-09-05 03:23:23 -07:00
|
|
|
e_exec(fwin->zone, NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FWIN_EXEC_SH:
|
2011-01-05 14:36:21 -08:00
|
|
|
snprintf(buf, sizeof(buf), "/bin/sh %s", e_util_filename_escape(ici->file));
|
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
else if (fwin->zone)
|
2012-08-22 23:53:53 -07:00
|
|
|
e_exec(fwin->zone, NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FWIN_EXEC_TERMINAL_DIRECT:
|
2011-01-05 14:36:21 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s %s", e_config->exebuf_term_cmd, e_util_filename_escape(ici->file));
|
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
else if (fwin->zone)
|
2012-08-22 23:53:53 -07:00
|
|
|
e_exec(fwin->zone, NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FWIN_EXEC_TERMINAL_SH:
|
2011-01-05 14:36:21 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s /bin/sh %s", e_config->exebuf_term_cmd, e_util_filename_escape(ici->file));
|
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
else if (fwin->zone)
|
2012-08-22 23:53:53 -07:00
|
|
|
e_exec(fwin->zone, NULL, buf, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FWIN_EXEC_DESKTOP:
|
2011-01-05 14:36:21 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
desktop = efreet_desktop_new(buf);
|
|
|
|
if (desktop)
|
|
|
|
{
|
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_exec(e_comp_object_util_zone_get(fwin->win), desktop, NULL, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
else if (fwin->zone)
|
2012-08-22 23:53:53 -07:00
|
|
|
e_exec(fwin->zone, desktop, NULL, NULL, "fwin");
|
2011-01-05 14:36:21 -08:00
|
|
|
efreet_desktop_free(desktop);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
default:
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_config_set(E_Fwin_Page *page)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fm2_Config fmc;
|
|
|
|
|
|
|
|
memset(&fmc, 0, sizeof(E_Fm2_Config));
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!page->fwin->zone)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
#if 0
|
2011-01-05 14:36:21 -08:00
|
|
|
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
|
|
|
|
fmc.icon.list.w = 24 * e_scale;
|
|
|
|
fmc.icon.list.h = 24 * e_scale;
|
|
|
|
fmc.icon.fixed.w = 1;
|
|
|
|
fmc.icon.fixed.h = 1;
|
|
|
|
#else
|
|
|
|
fmc.view.mode = fileman_config->view.mode;
|
|
|
|
fmc.icon.icon.w = fileman_config->icon.icon.w * e_scale;
|
|
|
|
fmc.icon.icon.h = fileman_config->icon.icon.h * e_scale;
|
|
|
|
fmc.icon.fixed.w = 0;
|
|
|
|
fmc.icon.fixed.h = 0;
|
2009-04-10 15:02:32 -07:00
|
|
|
#endif
|
2011-01-05 14:36:21 -08:00
|
|
|
fmc.view.open_dirs_in_place = fileman_config->view.open_dirs_in_place;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
2011-01-05 14:36:21 -08:00
|
|
|
else
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
#if 0
|
2011-01-05 14:36:21 -08:00
|
|
|
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
|
|
|
|
fmc.icon.list.w = 24 * e_scale;
|
|
|
|
fmc.icon.list.h = 24 * e_scale;
|
|
|
|
fmc.icon.fixed.w = 1;
|
|
|
|
fmc.icon.fixed.h = 1;
|
|
|
|
#else
|
2012-09-13 00:18:13 -07:00
|
|
|
fmc.view.mode = page->fwin->path->desktop_mode;
|
2011-01-05 14:36:21 -08:00
|
|
|
fmc.icon.icon.w = fileman_config->icon.icon.w * e_scale;
|
|
|
|
fmc.icon.icon.h = fileman_config->icon.icon.h * e_scale;
|
|
|
|
fmc.icon.fixed.w = 0;
|
|
|
|
fmc.icon.fixed.h = 0;
|
2009-04-10 15:02:32 -07:00
|
|
|
#endif
|
2012-08-06 06:18:15 -07:00
|
|
|
fmc.view.no_typebuf_set = !fileman_config->view.desktop_navigation;
|
2011-01-05 14:36:21 -08:00
|
|
|
fmc.view.open_dirs_in_place = 0;
|
|
|
|
fmc.view.fit_custom_pos = 1;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fmc.view.selector = 0;
|
|
|
|
fmc.view.single_click = fileman_config->view.single_click;
|
|
|
|
fmc.view.no_subdir_jump = 0;
|
2012-09-21 00:08:21 -07:00
|
|
|
fmc.icon.max_thumb_size = fileman_config->icon.max_thumb_size;
|
2009-04-10 15:02:32 -07:00
|
|
|
fmc.icon.extension.show = fileman_config->icon.extension.show;
|
|
|
|
fmc.list.sort.no_case = fileman_config->list.sort.no_case;
|
2012-09-03 07:26:26 -07:00
|
|
|
fmc.list.sort.extension = fileman_config->list.sort.extension;
|
2012-09-04 23:41:42 -07:00
|
|
|
fmc.list.sort.mtime = fileman_config->list.sort.mtime;
|
2012-09-04 03:47:39 -07:00
|
|
|
fmc.list.sort.size = fileman_config->list.sort.size;
|
2009-04-10 15:02:32 -07:00
|
|
|
fmc.list.sort.dirs.first = fileman_config->list.sort.dirs.first;
|
|
|
|
fmc.list.sort.dirs.last = fileman_config->list.sort.dirs.last;
|
|
|
|
fmc.selection.single = fileman_config->selection.single;
|
|
|
|
fmc.selection.windows_modifiers = fileman_config->selection.windows_modifiers;
|
2009-04-28 10:38:09 -07:00
|
|
|
e_fm2_config_set(page->fm_obj, &fmc);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_window_title_set(E_Fwin_Page *page)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2012-08-22 00:32:12 -07:00
|
|
|
char buf[PATH_MAX + sizeof("e_fwin::")];
|
2009-04-10 15:02:32 -07:00
|
|
|
const char *file;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
if (!page) return;
|
2011-01-05 14:36:21 -08:00
|
|
|
if (page->fwin->zone) return; //safety
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (fileman_config->view.show_full_path)
|
2009-04-28 10:38:09 -07:00
|
|
|
file = e_fm2_real_path_get(page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
else
|
2009-04-28 10:38:09 -07:00
|
|
|
file = ecore_file_file_get(e_fm2_real_path_get(page->fm_obj));
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (file)
|
2014-11-02 18:35:13 -08:00
|
|
|
elm_win_title_set(page->fwin->win, file);
|
2011-08-09 08:47:22 -07:00
|
|
|
|
2013-02-07 00:20:42 -08:00
|
|
|
if (e_config->remember_internal_fm_windows_globally)
|
2014-11-02 18:35:13 -08:00
|
|
|
ecore_evas_name_class_set(e_win_ee_get(page->fwin->win), "E", fwin_class);
|
2013-02-07 00:20:42 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "e_fwin::%s", e_fm2_real_path_get(page->fm_obj));
|
2014-11-02 18:35:13 -08:00
|
|
|
ecore_evas_name_class_set(e_win_ee_get(page->fwin->win), "E", buf);
|
2013-02-07 00:20:42 -08:00
|
|
|
}
|
2009-04-28 10:38:09 -07:00
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static void
|
|
|
|
_e_fwin_toolbar_resize(E_Fwin_Page *page)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2012-07-20 02:04:55 -07:00
|
|
|
if (!page->tbar)
|
|
|
|
{
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_signal_emit(page->fwin->bg_obj, "e,toolbar,disabled", "e");
|
2012-07-20 02:04:55 -07:00
|
|
|
return;
|
|
|
|
}
|
2011-01-05 14:36:21 -08:00
|
|
|
switch (page->tbar->gadcon->orient)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2009-04-22 19:12:55 -07:00
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(page->tbar->o_base, 0, page->tbar->minh);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(page->fwin->bg_obj, "e.swallow.toolbar", page->tbar->o_base);
|
|
|
|
edje_object_signal_emit(page->fwin->bg_obj, "e,toolbar,top", "e");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(page->tbar->o_base, 0, page->tbar->minh);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(page->fwin->bg_obj, "e.swallow.toolbar", page->tbar->o_base);
|
|
|
|
edje_object_signal_emit(page->fwin->bg_obj, "e,toolbar,bottom", "e");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
2009-04-22 19:12:55 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(page->tbar->o_base, page->tbar->minw, 0);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(page->fwin->bg_obj, "e.swallow.toolbar", page->tbar->o_base);
|
|
|
|
edje_object_signal_emit(page->fwin->bg_obj, "e,toolbar,left", "e");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(page->tbar->o_base, page->tbar->minw, 0);
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_part_swallow(page->fwin->bg_obj, "e.swallow.toolbar", page->tbar->o_base);
|
|
|
|
edje_object_signal_emit(page->fwin->bg_obj, "e,toolbar,right", "e");
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
2009-04-10 15:02:32 -07:00
|
|
|
default:
|
2012-10-28 00:45:48 -07:00
|
|
|
break;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_message_signal_process(page->fwin->bg_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* fwin callbacks */
|
|
|
|
static void
|
2014-11-02 18:35:13 -08:00
|
|
|
_e_fwin_cb_delete(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
e_object_del(data);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
2009-09-21 13:36:35 -07:00
|
|
|
/* static void
|
|
|
|
* _e_fwin_geom_save(E_Fwin *fwin)
|
|
|
|
* {
|
|
|
|
* char buf[PATH_MAX];
|
|
|
|
* E_Fm2_Custom_File *cf;
|
2011-01-05 14:36:21 -08:00
|
|
|
*
|
2009-09-21 13:36:35 -07:00
|
|
|
* if (!fwin->geom_save_ready) return;
|
|
|
|
* snprintf(buf, sizeof(buf), "dir::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
|
|
|
|
* cf = e_fm2_custom_file_get(buf);
|
|
|
|
* if (!cf)
|
|
|
|
* {
|
2011-01-05 14:36:21 -08:00
|
|
|
* cf = alloca(sizeof(E_Fm2_Custom_File));
|
|
|
|
* memset(cf, 0, sizeof(E_Fm2_Custom_File));
|
2009-09-21 13:36:35 -07:00
|
|
|
* }
|
|
|
|
* cf->geom.x = fwin->win->x;
|
|
|
|
* cf->geom.y = fwin->win->y;
|
|
|
|
* cf->geom.w = fwin->win->w;
|
|
|
|
* cf->geom.h = fwin->win->h;
|
|
|
|
* cf->geom.valid = 1;
|
|
|
|
* e_fm2_custom_file_set(buf, cf);
|
|
|
|
* } */
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
static void
|
2014-11-02 18:35:13 -08:00
|
|
|
_e_fwin_cb_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Fwin *fwin = data;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
if (fwin->bg_obj)
|
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
if (fwin->zone)
|
2011-01-05 14:36:21 -08:00
|
|
|
evas_object_resize(fwin->bg_obj, fwin->zone->w, fwin->zone->h);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
2012-07-20 02:04:55 -07:00
|
|
|
_e_fwin_toolbar_resize(fwin->cur_page);
|
2012-07-06 07:11:16 -07:00
|
|
|
if (fwin->zone)
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_resize(fwin->cur_page->scrollframe_obj, fwin->zone->w, fwin->zone->h);
|
2009-09-21 13:36:35 -07:00
|
|
|
/* _e_fwin_geom_save(fwin); */
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_deleted(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
e_object_del(E_OBJECT(page->fwin));
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_changed(void *data,
|
|
|
|
Evas_Object *obj,
|
2015-03-18 15:09:09 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2012-08-02 03:47:21 -07:00
|
|
|
E_Fm2_Config *cfg;
|
2009-04-10 15:02:32 -07:00
|
|
|
Efreet_Desktop *ef;
|
2012-08-02 08:15:15 -07:00
|
|
|
const char *dev, *path;
|
2012-05-04 02:38:52 -07:00
|
|
|
char buf[PATH_MAX];
|
2012-11-02 02:04:26 -07:00
|
|
|
Eina_Bool need_free = EINA_TRUE;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
fwin = page->fwin;
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!fwin) return; //safety
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2012-12-18 02:19:42 -08:00
|
|
|
_e_fwin_icon_mouse_out(fwin, NULL, NULL);
|
2012-08-02 03:47:21 -07:00
|
|
|
cfg = e_fm2_config_get(page->fm_obj);
|
|
|
|
e_fm2_path_get(page->fm_obj, &dev, NULL);
|
|
|
|
e_user_dir_concat_static(buf, "fileman/favorites");
|
2012-08-02 08:15:15 -07:00
|
|
|
path = e_fm2_real_path_get(page->fm_obj);
|
|
|
|
if ((dev && (!strcmp(dev, "favorites"))) || (path && (!strcmp(buf, path))))
|
2012-08-02 03:47:21 -07:00
|
|
|
cfg->view.link_drop = 1;
|
|
|
|
else
|
|
|
|
cfg->view.link_drop = 0;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
/* FIXME: first look in E config for a special override for this dir's bg
|
|
|
|
* or overlay
|
|
|
|
*/
|
2012-11-02 02:04:26 -07:00
|
|
|
ef = e_fm2_desktop_get(page->fm_obj);
|
|
|
|
if (ef) need_free = EINA_FALSE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/.directory.desktop", e_fm2_real_path_get(page->fm_obj));
|
|
|
|
ef = efreet_desktop_new(buf);
|
|
|
|
}
|
2012-06-11 02:49:28 -07:00
|
|
|
//printf("EF=%p for %s\n", ef, buf);
|
2009-04-10 15:02:32 -07:00
|
|
|
if (ef)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
fwin->wallpaper_file = _e_fwin_custom_file_path_eval(fwin, ef, fwin->wallpaper_file, "X-Enlightenment-Directory-Wallpaper");
|
|
|
|
fwin->overlay_file = _e_fwin_custom_file_path_eval(fwin, ef, fwin->overlay_file, "X-Enlightenment-Directory-Overlay");
|
|
|
|
fwin->scrollframe_file = _e_fwin_custom_file_path_eval(fwin, ef, fwin->scrollframe_file, "X-Enlightenment-Directory-Scrollframe");
|
|
|
|
fwin->theme_file = _e_fwin_custom_file_path_eval(fwin, ef, fwin->theme_file, "X-Enlightenment-Directory-Theme");
|
2012-06-11 02:49:28 -07:00
|
|
|
//printf("fwin->wallpaper_file = %s\n", fwin->wallpaper_file);
|
2012-11-02 02:04:26 -07:00
|
|
|
if (need_free) efreet_desktop_free(ef);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2009-05-15 04:47:28 -07:00
|
|
|
else
|
|
|
|
{
|
2014-03-28 06:43:05 -07:00
|
|
|
eina_stringshare_replace(&fwin->wallpaper_file, NULL);
|
|
|
|
eina_stringshare_replace(&fwin->overlay_file, NULL);
|
|
|
|
eina_stringshare_replace(&fwin->scrollframe_file, NULL);
|
|
|
|
eina_stringshare_replace(&fwin->theme_file, NULL);
|
2009-05-15 04:47:28 -07:00
|
|
|
}
|
2014-03-28 09:17:00 -07:00
|
|
|
if (page->scrollframe_obj)
|
|
|
|
{
|
|
|
|
if ((fwin->scrollframe_file) &&
|
|
|
|
(e_util_edje_collection_exists(fwin->scrollframe_file,
|
|
|
|
"e/fileman/default/scrollframe")))
|
|
|
|
e_scrollframe_custom_edje_file_set(page->scr,
|
|
|
|
(char *)fwin->scrollframe_file,
|
|
|
|
"e/fileman/default/scrollframe");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fwin->zone)
|
|
|
|
e_scrollframe_custom_theme_set(page->scr,
|
|
|
|
"base/theme/fileman",
|
|
|
|
"e/fileman/desktop/scrollframe");
|
|
|
|
else
|
|
|
|
e_scrollframe_custom_theme_set(page->scr,
|
|
|
|
"base/theme/fileman",
|
|
|
|
"e/fileman/default/scrollframe");
|
|
|
|
}
|
|
|
|
e_scrollframe_child_pos_set(page->scr, 0, 0);
|
|
|
|
}
|
|
|
|
if ((fwin->theme_file) && (ecore_file_exists(fwin->theme_file)))
|
|
|
|
e_fm2_custom_theme_set(obj, fwin->theme_file);
|
|
|
|
else
|
|
|
|
e_fm2_custom_theme_set(obj, NULL);
|
2012-07-03 05:31:51 -07:00
|
|
|
if (fwin->wallpaper_file)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2012-07-03 05:31:51 -07:00
|
|
|
if (eina_str_has_extension(fwin->wallpaper_file, "edj"))
|
2011-01-05 14:36:21 -08:00
|
|
|
{
|
2012-07-03 05:31:51 -07:00
|
|
|
if (!fwin->wallpaper_is_edj)
|
|
|
|
{
|
|
|
|
if (fwin->under_obj) evas_object_del(fwin->under_obj);
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin->under_obj = edje_object_add(evas_object_evas_get(fwin->win));
|
2012-07-03 05:31:51 -07:00
|
|
|
fwin->wallpaper_is_edj = EINA_TRUE;
|
|
|
|
}
|
2012-05-03 05:13:34 -07:00
|
|
|
edje_object_file_set(fwin->under_obj, fwin->wallpaper_file, "e/desktop/background");
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
2012-07-03 05:31:51 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fwin->wallpaper_is_edj) evas_object_del(fwin->under_obj);
|
|
|
|
fwin->wallpaper_is_edj = EINA_FALSE;
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin->under_obj = e_icon_add(evas_object_evas_get(fwin->win));
|
2012-07-03 05:31:51 -07:00
|
|
|
e_icon_scale_size_set(fwin->under_obj, 0);
|
|
|
|
e_icon_fill_inside_set(fwin->under_obj, 0);
|
|
|
|
e_icon_file_set(fwin->under_obj, fwin->wallpaper_file);
|
|
|
|
}
|
|
|
|
if (fwin->under_obj)
|
|
|
|
{
|
2014-03-28 09:17:00 -07:00
|
|
|
edje_object_part_swallow(e_scrollframe_edje_object_get(page->scr),
|
2012-10-28 00:45:48 -07:00
|
|
|
"e.swallow.bg", fwin->under_obj);
|
2012-07-03 05:31:51 -07:00
|
|
|
evas_object_pass_events_set(fwin->under_obj, 1);
|
|
|
|
evas_object_show(fwin->under_obj);
|
|
|
|
}
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2012-11-02 02:04:26 -07:00
|
|
|
else
|
2014-03-28 09:17:00 -07:00
|
|
|
{
|
|
|
|
edje_object_part_swallow(e_scrollframe_edje_object_get(page->scr),
|
2012-11-02 02:04:26 -07:00
|
|
|
"e.swallow.bg", NULL);
|
2014-03-28 09:17:00 -07:00
|
|
|
if (fwin->under_obj) evas_object_hide(fwin->under_obj);
|
|
|
|
}
|
2007-08-12 02:54:33 -07:00
|
|
|
if (fwin->over_obj)
|
|
|
|
{
|
2012-06-11 02:49:28 -07:00
|
|
|
//printf("over obj\n");
|
2011-01-05 14:36:21 -08:00
|
|
|
evas_object_hide(fwin->over_obj);
|
|
|
|
if (fwin->overlay_file)
|
|
|
|
{
|
2012-10-28 00:45:48 -07:00
|
|
|
edje_object_file_set(fwin->over_obj, fwin->overlay_file,
|
|
|
|
"e/desktop/background");
|
2012-05-03 05:13:34 -07:00
|
|
|
// ext = strrchr(fwin->overlay_file, '.');
|
|
|
|
// if (ext && !strcasecmp(ext, ".edj"))
|
|
|
|
// e_icon_file_edje_set(fwin->over_obj, fwin->overlay_file, "e/desktop/background");
|
|
|
|
// else
|
|
|
|
// e_icon_file_set(fwin->over_obj, fwin->overlay_file);
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
2012-05-03 05:13:34 -07:00
|
|
|
// else
|
|
|
|
// e_icon_file_edje_set(fwin->over_obj, NULL, NULL);
|
2011-01-05 14:36:21 -08:00
|
|
|
evas_object_show(fwin->over_obj);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2012-07-13 03:52:57 -07:00
|
|
|
_e_fwin_icon_mouse_out(fwin, NULL, NULL);
|
2012-09-12 09:42:29 -07:00
|
|
|
if (fwin->zone)
|
|
|
|
{
|
|
|
|
e_fm2_path_get(page->fm_obj, &dev, &path);
|
2012-09-13 00:18:13 -07:00
|
|
|
eina_stringshare_replace(&fwin->path->dev, dev);
|
|
|
|
eina_stringshare_replace(&fwin->path->path, path);
|
2012-09-12 09:42:29 -07:00
|
|
|
return;
|
|
|
|
}
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_window_title_set(page);
|
2012-09-03 01:53:13 -07:00
|
|
|
if (page->setting) return;
|
|
|
|
if (page->flist) e_fm2_deselect_all(page->flist);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2012-07-31 06:31:35 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_favorite_selected(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-07-31 06:31:35 -07:00
|
|
|
{
|
|
|
|
E_Fwin_Page *page;
|
|
|
|
Eina_List *selected;
|
|
|
|
|
|
|
|
page = data;
|
|
|
|
selected = e_fm2_selected_list_get(page->flist);
|
|
|
|
if (!selected) return;
|
2012-09-03 01:53:13 -07:00
|
|
|
page->setting = 1;
|
2012-07-31 06:31:35 -07:00
|
|
|
_e_fwin_file_open_dialog(page, selected, 0);
|
|
|
|
eina_list_free(selected);
|
2012-09-03 01:53:13 -07:00
|
|
|
page->setting = 0;
|
2012-07-31 06:31:35 -07:00
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_selected(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
Eina_List *selected;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
if (!selected) return;
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_file_open_dialog(page, selected, 0);
|
2009-04-10 15:02:32 -07:00
|
|
|
eina_list_free(selected);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_selection_change(void *data,
|
2012-08-03 07:23:34 -07:00
|
|
|
Evas_Object *obj,
|
2015-03-18 15:09:09 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
2009-04-10 15:02:32 -07:00
|
|
|
for (l = fwins; l; l = l->next)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (l->data != page->fwin)
|
|
|
|
e_fwin_all_unsel(l->data);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
2012-08-03 07:23:34 -07:00
|
|
|
evas_object_focus_set(obj, 1);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_all_change(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
Efreet_Desktop *desktop = NULL;
|
|
|
|
|
|
|
|
fad = data;
|
|
|
|
desktop = efreet_util_desktop_file_id_find(fad->app2);
|
2011-01-05 14:36:21 -08:00
|
|
|
if ((desktop) && (desktop->exec))
|
2009-04-10 15:02:32 -07:00
|
|
|
e_widget_entry_text_set(fad->o_entry, desktop->exec);
|
2010-03-25 22:34:34 -07:00
|
|
|
if (desktop)
|
|
|
|
efreet_desktop_free(desktop);
|
2012-10-25 04:29:22 -07:00
|
|
|
else
|
|
|
|
e_widget_entry_text_set(fad->o_entry, fad->app2);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_key_down(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
2012-07-06 06:35:03 -07:00
|
|
|
void *event_info)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev;
|
|
|
|
E_Fwin *fwin;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
fwin = page->fwin;
|
2009-04-10 15:02:32 -07:00
|
|
|
ev = event_info;
|
|
|
|
|
|
|
|
if (evas_key_modifier_is_set(ev->modifiers, "Control"))
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!strcmp(ev->key, "n"))
|
|
|
|
{
|
|
|
|
const char *dev, *path;
|
|
|
|
|
|
|
|
e_fm2_path_get(page->fm_obj, &dev, &path);
|
2015-03-18 14:40:04 -07:00
|
|
|
e_fwin_new(dev, path);
|
2011-01-05 14:36:21 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!strcmp(ev->key, "w"))
|
|
|
|
{
|
2012-07-06 07:11:16 -07:00
|
|
|
e_object_del(E_OBJECT(fwin));
|
2011-01-05 14:36:21 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!strcmp(ev->key, "a"))
|
|
|
|
{
|
|
|
|
e_fm2_all_sel(page->fm_obj);
|
|
|
|
return;
|
|
|
|
}
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-15 19:45:57 -08:00
|
|
|
static void
|
2015-11-20 06:09:38 -08:00
|
|
|
_e_fwin_cb_page_obj_del(void *data EINA_UNUSED,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas *evas EINA_UNUSED,
|
2015-11-20 06:09:38 -08:00
|
|
|
Evas_Object *obj,
|
2015-03-18 15:09:09 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2011-02-15 19:45:57 -08:00
|
|
|
{
|
2015-11-20 06:09:38 -08:00
|
|
|
evas_object_smart_callback_del(obj, "dir_changed",
|
2011-02-15 19:45:57 -08:00
|
|
|
_e_fwin_changed);
|
2015-11-20 06:09:38 -08:00
|
|
|
evas_object_smart_callback_del(obj, "dir_deleted",
|
2011-02-15 19:45:57 -08:00
|
|
|
_e_fwin_deleted);
|
2015-11-20 06:09:38 -08:00
|
|
|
evas_object_smart_callback_del(obj, "selected",
|
2011-02-15 19:45:57 -08:00
|
|
|
_e_fwin_selected);
|
2015-11-20 06:09:38 -08:00
|
|
|
evas_object_smart_callback_del(obj, "selection_change",
|
2011-02-15 19:45:57 -08:00
|
|
|
_e_fwin_selection_change);
|
2015-11-20 06:09:38 -08:00
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
|
2011-02-15 19:45:57 -08:00
|
|
|
_e_fwin_cb_page_obj_del);
|
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
/* fwin zone callbacks */
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_zone_cb_mouse_down(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas *evas EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin;
|
|
|
|
|
|
|
|
fwin = data;
|
|
|
|
if (!fwin) return;
|
|
|
|
e_fwin_all_unsel(fwin);
|
2012-08-03 03:34:47 -07:00
|
|
|
e_fm2_typebuf_clear(fwin->cur_page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_zone_move_resize(void *data, int type EINA_UNUSED, void *event)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
2012-10-11 01:03:19 -07:00
|
|
|
E_Event_Zone_Move_Resize *ev = event;
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
int x, y, w, h, sx, sy, sw, sh;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!fwin) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (fwin->zone != ev->zone) return ECORE_CALLBACK_PASS_ON;
|
2012-10-11 01:03:19 -07:00
|
|
|
if (!fwin->cur_page->scrollframe_obj) return ECORE_CALLBACK_RENEW;
|
|
|
|
e_zone_useful_geometry_get(ev->zone, &x, &y, &w, &h);
|
|
|
|
evas_object_geometry_get(fwin->cur_page->scrollframe_obj, &sx, &sy, &sw, &sh);
|
|
|
|
/* if same, do nothing */
|
|
|
|
if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) return ECORE_CALLBACK_RENEW;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_geometry_set(fwin->cur_page->scrollframe_obj, x, y, w, h);
|
2012-10-11 01:03:19 -07:00
|
|
|
e_fm2_refresh(fwin->cur_page->fm_obj);
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_zone_del(void *data,
|
2012-07-06 06:35:03 -07:00
|
|
|
int type,
|
2011-01-05 14:36:21 -08:00
|
|
|
void *event)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
E_Event_Zone_Del *ev;
|
2007-08-12 02:54:33 -07:00
|
|
|
E_Fwin *fwin;
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (type != E_EVENT_ZONE_DEL) return ECORE_CALLBACK_PASS_ON;
|
2007-08-12 02:54:33 -07:00
|
|
|
fwin = data;
|
2009-04-10 15:02:32 -07:00
|
|
|
ev = event;
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!fwin) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (fwin->zone != ev->zone) return ECORE_CALLBACK_PASS_ON;
|
2009-04-10 15:02:32 -07:00
|
|
|
e_object_del(E_OBJECT(fwin));
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2012-09-14 05:46:23 -07:00
|
|
|
static int
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_cb_dir_handler_test(void *data EINA_UNUSED, Evas_Object *obj, const char *path)
|
2012-09-14 05:46:23 -07:00
|
|
|
{
|
2013-11-26 09:32:00 -08:00
|
|
|
if (ecore_file_is_dir(path)) return 1;
|
|
|
|
if (e_fm2_real_path_get(obj))
|
|
|
|
{
|
|
|
|
evas_object_data_set(obj, "fileman_terminal_realpath", (void*)1);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2012-09-14 05:46:23 -07:00
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_cb_dir_handler(void *data EINA_UNUSED, Evas_Object *obj, const char *path)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2012-09-14 05:46:23 -07:00
|
|
|
char buf[PATH_MAX];
|
2013-11-26 09:32:00 -08:00
|
|
|
Eina_Stringshare *rp;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2012-09-14 05:46:23 -07:00
|
|
|
if (!getcwd(buf, sizeof(buf))) return;
|
2013-11-26 09:32:00 -08:00
|
|
|
rp = e_fm2_real_path_get(obj);
|
|
|
|
if (rp && (rp != path) && (evas_object_data_del(obj, "fileman_terminal_realpath"))) //icon menu; use rp
|
|
|
|
path = rp;
|
2013-07-14 19:45:19 -07:00
|
|
|
if (chdir(path) < 0) perror("chdir");
|
2015-03-13 14:47:36 -07:00
|
|
|
e_exec(e_zone_current_get(), tdesktop, NULL, NULL, "fileman");
|
2013-07-14 19:45:19 -07:00
|
|
|
if (chdir(buf) < 0) perror("chdir");
|
2007-08-12 02:54:33 -07:00
|
|
|
/* FIXME: if info != null then check mime type and offer options based
|
|
|
|
* on that
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_parent(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Menu *m EINA_UNUSED,
|
|
|
|
E_Menu_Item *mi EINA_UNUSED)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
|
|
|
e_fm2_parent_go(data);
|
|
|
|
}
|
|
|
|
|
2009-04-03 21:14:01 -07:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_menu_open_fast(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Menu *m EINA_UNUSED,
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Menu_Item *mi)
|
2009-04-03 21:14:01 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-03 21:14:01 -07:00
|
|
|
Efreet_Desktop *desk;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
2009-04-03 21:14:01 -07:00
|
|
|
desk = e_object_data_get(E_OBJECT(mi));
|
|
|
|
|
2010-08-19 09:29:01 -07:00
|
|
|
if ((page) && (desk))
|
|
|
|
_e_fwin_desktop_run(desk, page, EINA_TRUE);
|
2009-04-03 21:14:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_menu_extend_open_with(void *data,
|
2011-01-05 14:36:21 -08:00
|
|
|
E_Menu *m)
|
2009-04-03 21:14:01 -07:00
|
|
|
{
|
|
|
|
Eina_List *selected = NULL, *apps = NULL, *l;
|
|
|
|
E_Menu_Item *mi;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-03 21:14:01 -07:00
|
|
|
Efreet_Desktop *desk = NULL;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
2009-04-03 21:14:01 -07:00
|
|
|
if (!selected) return;
|
|
|
|
|
2012-07-06 20:24:53 -07:00
|
|
|
apps = _e_fwin_suggested_apps_list_get(selected, NULL, NULL);
|
2009-04-03 21:14:01 -07:00
|
|
|
EINA_LIST_FOREACH(apps, l, desk)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!desk) continue;
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, desk->name);
|
|
|
|
e_util_desktop_menu_item_icon_add(desk, 24, mi);
|
|
|
|
e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_fast, page);
|
|
|
|
e_object_data_set(E_OBJECT(mi), desk);
|
2009-04-03 21:14:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (apps)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_separator_set(mi, 1);
|
2009-04-03 21:14:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Other application..."));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "document-open");
|
2009-04-28 10:38:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_with, page);
|
2009-04-03 21:14:01 -07:00
|
|
|
|
|
|
|
e_menu_pre_activate_callback_set(m, NULL, NULL);
|
|
|
|
|
|
|
|
eina_list_free(apps);
|
|
|
|
eina_list_free(selected);
|
|
|
|
}
|
|
|
|
|
2012-09-14 09:51:38 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_path(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2012-09-14 09:51:38 -07:00
|
|
|
{
|
|
|
|
const char *path;
|
|
|
|
E_Fwin_Page *page;
|
2014-11-02 18:35:13 -08:00
|
|
|
Ecore_Window xwin;
|
2012-09-14 09:51:38 -07:00
|
|
|
|
|
|
|
path = e_fm2_real_path_get(data);
|
|
|
|
page = evas_object_data_get(data, "fm_page");
|
|
|
|
if (page->fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
xwin = elm_win_window_id_get(page->fwin->win);
|
2012-09-14 09:51:38 -07:00
|
|
|
else
|
2015-03-13 14:44:24 -07:00
|
|
|
xwin = e_comp->ee_win;
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2012-09-14 09:51:38 -07:00
|
|
|
ecore_x_selection_clipboard_set(xwin, path, strlen(path) + 1);
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2012-09-14 09:51:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_clone(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2012-09-14 09:51:38 -07:00
|
|
|
{
|
|
|
|
E_Fwin *fwin = data;
|
|
|
|
E_Action *act_fm;
|
|
|
|
|
|
|
|
/* path of least resistance! */
|
|
|
|
act_fm = e_action_find("fileman");
|
|
|
|
if (!act_fm) return;
|
2014-11-02 18:35:13 -08:00
|
|
|
act_fm->func.go(NULL, e_win_client_get(fwin->win)->icccm.class + 8);
|
2012-09-14 09:51:38 -07:00
|
|
|
}
|
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_menu_extend_start(void *data,
|
2012-09-14 09:51:38 -07:00
|
|
|
Evas_Object *obj,
|
2012-07-06 06:35:03 -07:00
|
|
|
E_Menu *m,
|
2012-12-06 01:47:06 -08:00
|
|
|
E_Fm2_Icon_Info *info)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2012-09-14 09:51:38 -07:00
|
|
|
E_Menu_Item *mi = NULL;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-03 21:14:01 -07:00
|
|
|
E_Menu *subm;
|
2012-07-15 13:05:58 -07:00
|
|
|
Eina_List *selected = NULL;
|
2012-10-04 05:11:17 -07:00
|
|
|
Eina_Bool set = EINA_FALSE;
|
2012-12-17 02:54:52 -08:00
|
|
|
char buf[PATH_MAX] = {0};
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
2012-07-15 13:05:58 -07:00
|
|
|
|
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
|
|
|
|
2012-09-14 03:17:31 -07:00
|
|
|
#ifdef ENABLE_FILES
|
2012-12-17 02:54:52 -08:00
|
|
|
if (info && info->file && (info->link || S_ISDIR(info->statinfo.st_mode)))
|
2012-12-06 01:47:06 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), info->file);
|
2012-12-17 02:54:52 -08:00
|
|
|
subm = e_mod_menu_add(m, (buf[0]) ? buf : e_fm2_real_path_get(page->fm_obj));
|
2012-09-14 03:29:23 -07:00
|
|
|
|
|
|
|
if (((!page->fwin->zone) || fileman_config->view.desktop_navigation) && e_fm2_has_parent_get(obj))
|
|
|
|
{
|
2012-09-14 08:48:35 -07:00
|
|
|
mi = e_menu_item_new_relative(subm, NULL);
|
|
|
|
e_menu_item_label_set(mi, _("Go To Parent Directory"));
|
2012-09-14 03:29:23 -07:00
|
|
|
e_menu_item_icon_edje_set(mi,
|
|
|
|
e_theme_edje_file_get("base/theme/fileman",
|
|
|
|
"e/fileman/default/button/parent"),
|
|
|
|
"e/fileman/default/button/parent");
|
|
|
|
e_menu_item_callback_set(mi, _e_fwin_parent, obj);
|
|
|
|
}
|
2012-09-14 09:51:38 -07:00
|
|
|
if (!page->fwin->zone)
|
|
|
|
{
|
|
|
|
mi = e_menu_item_new_relative(subm, mi);
|
|
|
|
e_menu_item_label_set(mi, _("Clone Window"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "window-duplicate");
|
|
|
|
e_menu_item_callback_set(mi, _e_fwin_clone, page->fwin);
|
|
|
|
}
|
|
|
|
|
|
|
|
mi = e_menu_item_new_relative(subm, mi);
|
|
|
|
e_menu_item_label_set(mi, _("Copy Path"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "edit-copy");
|
|
|
|
e_menu_item_callback_set(mi, _e_fwin_path, obj);
|
|
|
|
|
|
|
|
mi = e_menu_item_new_relative(subm, mi);
|
|
|
|
e_menu_item_separator_set(mi, EINA_TRUE);
|
|
|
|
|
2012-09-14 03:17:31 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_separator_set(mi, EINA_TRUE);
|
|
|
|
#endif
|
2012-09-14 03:38:32 -07:00
|
|
|
if (!selected) return;
|
2007-08-12 02:54:33 -07:00
|
|
|
mi = e_menu_item_new(m);
|
2012-10-04 05:11:17 -07:00
|
|
|
while (eina_list_count(selected) == 1)
|
|
|
|
{
|
|
|
|
if (_e_fwin_file_is_exec(eina_list_data_get(selected)) == E_FWIN_EXEC_NONE) break;
|
|
|
|
|
|
|
|
e_menu_item_label_set(mi, _("Run"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "system-run");
|
|
|
|
set = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!set)
|
|
|
|
{
|
|
|
|
e_menu_item_label_set(mi, _("Open"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "document-open");
|
|
|
|
}
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _e_fwin_cb_menu_open, page);
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Open with..."));
|
2009-04-10 15:02:32 -07:00
|
|
|
e_util_menu_item_theme_icon_set(mi, "document-open");
|
2007-08-12 02:54:33 -07:00
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
subm = e_menu_new();
|
|
|
|
e_menu_item_submenu_set(mi, subm);
|
2009-04-28 10:38:09 -07:00
|
|
|
e_menu_pre_activate_callback_set(subm, _e_fwin_cb_menu_extend_open_with, page);
|
2012-07-15 13:05:58 -07:00
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_separator_set(mi, 1);
|
2012-12-21 15:26:47 -08:00
|
|
|
eina_list_free(selected);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_menu_open(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Menu *m EINA_UNUSED,
|
|
|
|
E_Menu_Item *mi EINA_UNUSED)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
Eina_List *selected;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
if (!selected) return;
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_file_open_dialog(page, selected, 0);
|
2009-04-10 15:02:32 -07:00
|
|
|
eina_list_free(selected);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_menu_open_with(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Menu *m EINA_UNUSED,
|
|
|
|
E_Menu_Item *mi EINA_UNUSED)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
Eina_List *selected = NULL;
|
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = data;
|
|
|
|
selected = e_fm2_selected_list_get(page->fm_obj);
|
2009-04-10 15:02:32 -07:00
|
|
|
if (!selected) return;
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_file_open_dialog(page, selected, 1);
|
2009-04-10 15:02:32 -07:00
|
|
|
eina_list_free(selected);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2012-09-13 03:49:22 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_border_set(E_Fwin_Page *page, E_Fwin *fwin, E_Fm2_Icon_Info *ici)
|
|
|
|
{
|
|
|
|
Evas_Object *oic;
|
|
|
|
const char *itype = NULL;
|
|
|
|
int ix, iy, iw, ih, nx, ny, found = 0;
|
|
|
|
E_Remember *rem = NULL;
|
|
|
|
Eina_List *ll;
|
2012-09-14 00:02:06 -07:00
|
|
|
const char *file = NULL, *group = NULL, *class;
|
2012-09-13 03:49:22 -07:00
|
|
|
int w, h, zw, zh;
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Client *ec;
|
2012-09-13 03:49:22 -07:00
|
|
|
/* E_Fm2_Custom_File *cf; */
|
|
|
|
|
|
|
|
if (ici->label)
|
2014-11-02 18:35:13 -08:00
|
|
|
elm_win_title_set(fwin->win, ici->label);
|
2012-09-13 03:49:22 -07:00
|
|
|
else if (ici->file)
|
2014-11-02 18:35:13 -08:00
|
|
|
elm_win_title_set(fwin->win, ici->file);
|
2012-09-13 03:49:22 -07:00
|
|
|
oic = e_fm2_icon_get(evas_object_evas_get(ici->fm),
|
|
|
|
ici->ic, NULL, NULL, 0, &itype);
|
|
|
|
if (!oic) return;
|
2014-11-02 18:35:13 -08:00
|
|
|
ec = e_win_client_get(fwin->win);
|
|
|
|
eina_stringshare_replace(&ec->internal_icon, NULL);
|
|
|
|
eina_stringshare_replace(&ec->internal_icon_key, NULL);
|
2012-09-13 03:49:22 -07:00
|
|
|
if (!strcmp(evas_object_type_get(oic), "edje"))
|
|
|
|
{
|
|
|
|
edje_object_file_get(oic, &file, &group);
|
2014-11-02 18:35:13 -08:00
|
|
|
ec->internal_icon = eina_stringshare_ref(file);
|
|
|
|
ec->internal_icon_key = eina_stringshare_ref(group);
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-19 09:00:10 -08:00
|
|
|
e_icon_file_get(oic, &file, &group);
|
2014-11-02 18:35:13 -08:00
|
|
|
ec->internal_icon = eina_stringshare_ref(file);
|
|
|
|
ec->internal_icon_key = eina_stringshare_ref(group);
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
evas_object_del(oic);
|
2014-11-02 18:35:13 -08:00
|
|
|
if (ec->placed) return;
|
2012-09-13 03:49:22 -07:00
|
|
|
|
2013-02-07 00:20:42 -08:00
|
|
|
if (e_config->remember_internal_fm_windows_globally)
|
|
|
|
class = fwin_class;
|
|
|
|
else
|
|
|
|
class = eina_stringshare_printf("e_fwin::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
|
2014-11-02 18:35:13 -08:00
|
|
|
e_zone_useful_geometry_get(e_comp_object_util_zone_get(fwin->win),
|
2012-12-03 06:03:13 -08:00
|
|
|
NULL, NULL, &zw, &zh);
|
2012-09-13 03:49:22 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->remembers, ll, rem)
|
2012-12-03 06:03:13 -08:00
|
|
|
if (rem->class == class)
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
|
|
|
found = 1;
|
2012-12-03 06:03:13 -08:00
|
|
|
rem->prop.w = E_CLAMP(rem->prop.w, DEFAULT_WIDTH, zw);
|
|
|
|
rem->prop.h = E_CLAMP(rem->prop.h, DEFAULT_HEIGHT, zh);
|
|
|
|
rem->prop.pos_x = E_CLAMP(rem->prop.pos_x, 0, zw - rem->prop.w);
|
|
|
|
rem->prop.pos_y = E_CLAMP(rem->prop.pos_y, 0, zh - rem->prop.h);
|
2012-09-13 03:49:22 -07:00
|
|
|
break;
|
|
|
|
}
|
2013-02-07 00:20:42 -08:00
|
|
|
if (!e_config->remember_internal_fm_windows_globally)
|
|
|
|
eina_stringshare_del(class);
|
2012-09-13 03:49:22 -07:00
|
|
|
|
|
|
|
if (found) return;
|
|
|
|
|
|
|
|
/* No custom info, so just put window near icon */
|
|
|
|
e_fm2_icon_geometry_get(ici->ic, &ix, &iy, &iw, &ih);
|
|
|
|
nx = (ix + (iw / 2));
|
|
|
|
ny = (iy + (ih / 2));
|
|
|
|
if (page->fwin->win)
|
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
nx += ec->x;
|
|
|
|
ny += ec->y;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* checking width and height */
|
|
|
|
/* TODO add config for preffered
|
|
|
|
initial size? */
|
2012-09-13 23:53:21 -07:00
|
|
|
w = DEFAULT_WIDTH;
|
2012-09-13 03:49:22 -07:00
|
|
|
if (w > zw)
|
|
|
|
w = zw;
|
|
|
|
|
2012-09-13 23:53:21 -07:00
|
|
|
h = DEFAULT_HEIGHT;
|
2012-09-13 03:49:22 -07:00
|
|
|
if (h > zh)
|
|
|
|
h = zh;
|
|
|
|
|
|
|
|
/* iff going out of zone - adjust to be in */
|
2014-11-02 18:35:13 -08:00
|
|
|
if ((ec->zone->x + ec->zone->w) < (w + nx))
|
2012-09-13 03:49:22 -07:00
|
|
|
nx -= w;
|
2014-11-02 18:35:13 -08:00
|
|
|
if ((ec->zone->y + ec->zone->h) < (h + ny))
|
2012-09-13 03:49:22 -07:00
|
|
|
ny -= h;
|
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
evas_object_geometry_set(fwin->win, nx, ny, w, h);
|
|
|
|
ec->placed = 1;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static E_Fwin *
|
|
|
|
_e_fwin_open(E_Fwin_Page *page, E_Fm2_Icon_Info *ici, Eina_Bool force, int *need_dia)
|
|
|
|
{
|
|
|
|
E_Fwin *fwin = NULL;
|
|
|
|
char buf[PATH_MAX + sizeof("removable:")];
|
|
|
|
Eina_Bool new_fwin;
|
|
|
|
|
|
|
|
new_fwin = (force || ((!fileman_config->view.open_dirs_in_place || page->fwin->zone)));
|
|
|
|
|
|
|
|
if ((ici->link) && (ici->mount))
|
|
|
|
{
|
|
|
|
if (new_fwin)
|
|
|
|
{
|
|
|
|
if (page->fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(ici->link, "/");
|
2012-09-13 03:49:22 -07:00
|
|
|
else if (page->fwin->zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(ici->link, "/");
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-18 02:20:49 -07:00
|
|
|
_e_fwin_border_set(page, page->fwin, ici);
|
2012-09-13 03:49:22 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, ici->link, "/");
|
2012-09-18 02:20:49 -07:00
|
|
|
return page->fwin;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((ici->link) && (ici->removable))
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "removable:%s", ici->link);
|
|
|
|
if (new_fwin)
|
|
|
|
{
|
|
|
|
if (page->fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(buf, "/");
|
2012-09-13 03:49:22 -07:00
|
|
|
else if (page->fwin->zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(buf, "/");
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-18 02:20:49 -07:00
|
|
|
_e_fwin_border_set(page, page->fwin, ici);
|
2012-09-13 03:49:22 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, buf, "/");
|
2012-09-18 02:20:49 -07:00
|
|
|
return page->fwin;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (ici->real_link)
|
|
|
|
{
|
|
|
|
if (S_ISDIR(ici->statinfo.st_mode))
|
|
|
|
{
|
|
|
|
if (new_fwin)
|
|
|
|
{
|
|
|
|
if (page->fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(NULL, ici->real_link);
|
2012-09-13 03:49:22 -07:00
|
|
|
else if (page->fwin->zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(NULL, ici->real_link);
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-18 02:20:49 -07:00
|
|
|
_e_fwin_border_set(page, page->fwin, ici);
|
2012-09-13 03:49:22 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, NULL, ici->real_link);
|
2012-09-18 02:20:49 -07:00
|
|
|
return page->fwin;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (need_dia) *need_dia = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
if (S_ISDIR(ici->statinfo.st_mode))
|
|
|
|
{
|
|
|
|
if (new_fwin)
|
|
|
|
{
|
|
|
|
if (page->fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(NULL, ici->link ?: buf);
|
2012-09-13 03:49:22 -07:00
|
|
|
else if (page->fwin->zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
fwin = _e_fwin_new(NULL, ici->link ?: buf);
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-18 02:20:49 -07:00
|
|
|
_e_fwin_border_set(page, page->fwin, ici);
|
2012-09-13 03:49:22 -07:00
|
|
|
e_fm2_path_set(page->fm_obj, NULL, ici->link ?: buf);
|
2012-09-18 02:20:49 -07:00
|
|
|
return page->fwin;
|
2012-09-13 03:49:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (need_dia) *need_dia = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!fwin) return NULL;
|
2014-11-02 18:35:13 -08:00
|
|
|
if ((!fwin->win) || (!e_win_client_get(fwin->win)))
|
2012-09-13 03:49:22 -07:00
|
|
|
{
|
|
|
|
_e_fwin_free(fwin);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
_e_fwin_border_set(page, fwin, ici);
|
|
|
|
|
|
|
|
return fwin;
|
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
/* 'open with' dialog*/
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_file_open_dialog(E_Fwin_Page *page,
|
2012-07-06 06:35:03 -07:00
|
|
|
Eina_List *files,
|
|
|
|
int always)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2012-09-13 03:49:22 -07:00
|
|
|
E_Fwin *fwin = page->fwin;
|
2007-08-12 02:54:33 -07:00
|
|
|
E_Dialog *dia;
|
|
|
|
Evas_Coord mw, mh;
|
2012-08-05 00:52:15 -07:00
|
|
|
Evas_Object *o, *of, *ol, *ot;
|
2007-08-12 02:54:33 -07:00
|
|
|
Evas *evas;
|
2012-10-25 04:29:22 -07:00
|
|
|
Eina_List *l = NULL, *ll, *apps = NULL, *mlist = NULL;
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *cats = NULL;
|
2007-12-03 10:56:33 -08:00
|
|
|
Efreet_Desktop *desk = NULL;
|
2007-08-12 02:54:33 -07:00
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
E_Fm2_Icon_Info *ici;
|
2012-08-22 00:32:12 -07:00
|
|
|
char buf[PATH_MAX + sizeof("removable:")];
|
2012-07-06 20:24:53 -07:00
|
|
|
Eina_Bool has_default = EINA_FALSE;
|
2012-08-05 00:52:15 -07:00
|
|
|
int need_dia = 0, n = 0;;
|
|
|
|
|
|
|
|
n = eina_list_count(files);
|
2007-08-12 02:54:33 -07:00
|
|
|
|
|
|
|
if (fwin->fad)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
e_object_del(E_OBJECT(fwin->fad->dia));
|
|
|
|
fwin->fad = NULL;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
if (!always)
|
|
|
|
{
|
2012-09-13 03:49:22 -07:00
|
|
|
if ((fileman_config->view.open_dirs_in_place) && (!page->fwin->zone))
|
|
|
|
_e_fwin_open(page, eina_list_data_get(files), EINA_FALSE, &need_dia);
|
|
|
|
else
|
2011-01-05 14:36:21 -08:00
|
|
|
{
|
2012-09-13 03:49:22 -07:00
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
_e_fwin_open(page, ici, EINA_FALSE, &need_dia);
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
|
|
|
if (!need_dia) return;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2012-07-06 20:24:53 -07:00
|
|
|
apps = _e_fwin_suggested_apps_list_get(files, &mlist, &has_default);
|
2007-08-12 02:54:33 -07:00
|
|
|
|
2012-08-01 00:52:17 -07:00
|
|
|
// fprintf(stderr, "GOGOGOGOOGOGOG\n");
|
2007-08-12 02:54:33 -07:00
|
|
|
if (!always)
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
/* FIXME: well this is simplisitic - if only 1 mime type is being
|
|
|
|
* opened then look for the previously used app for that mimetype and
|
|
|
|
* if found, use that.
|
|
|
|
*
|
|
|
|
* we could get more sophisitcated.
|
|
|
|
* 1. find apps for each mimetype in mlist. if all prev used apps are
|
|
|
|
* the same, then use previously used app.
|
|
|
|
* OR if this fails
|
|
|
|
* 2. find all apps for each mimetype. find the one used the most.
|
|
|
|
* if that app can handle all mimetypes in the list - use that. if not
|
|
|
|
* find the next most often listed app - if that can handle all apps,
|
|
|
|
* use it, if not fall back again - and so on - if all apps listed do
|
|
|
|
* not contain 1 that handles all the mime types - fall back to dialog
|
|
|
|
*/
|
2012-07-06 20:24:53 -07:00
|
|
|
if ((has_default) || (eina_list_count(mlist) <= 1))
|
2012-07-06 06:35:03 -07:00
|
|
|
{
|
|
|
|
char *file;
|
|
|
|
char pcwd[4096];
|
|
|
|
Eina_List *files_list = NULL;
|
|
|
|
|
|
|
|
need_dia = 1;
|
2012-08-01 00:52:17 -07:00
|
|
|
//fprintf(stderr, "XXXXX %i %p\n", has_default, apps);
|
2012-07-06 20:24:53 -07:00
|
|
|
if ((has_default) && (apps)) desk = apps->data;
|
|
|
|
else if (mlist) desk = e_exehist_mime_desktop_get(mlist->data);
|
2012-08-01 00:52:17 -07:00
|
|
|
//fprintf(stderr, "mlist = %p\n", mlist);
|
2013-07-14 19:45:19 -07:00
|
|
|
if (!getcwd(pcwd, sizeof(pcwd))) perror("getcwd");
|
|
|
|
if (chdir(e_fm2_real_path_get(page->fm_obj)) < 0) perror("chdir");
|
2012-07-06 06:35:03 -07:00
|
|
|
|
|
|
|
files_list = NULL;
|
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
|
|
|
|
files_list = eina_list_append(files_list, strdup(ici->file));
|
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
{
|
|
|
|
E_Fwin_Exec_Type ext;
|
|
|
|
|
|
|
|
ext = _e_fwin_file_is_exec(ici);
|
|
|
|
if (ext != E_FWIN_EXEC_NONE)
|
|
|
|
{
|
|
|
|
_e_fwin_file_exec(page, ici, ext);
|
|
|
|
need_dia = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (desk)
|
|
|
|
{
|
|
|
|
if (fwin->win)
|
|
|
|
{
|
2014-11-02 18:35:13 -08:00
|
|
|
if (e_exec(e_comp_object_util_zone_get(fwin->win), desk, NULL, files_list, "fwin"))
|
2011-01-05 14:36:21 -08:00
|
|
|
need_dia = 0;
|
2012-07-06 06:35:03 -07:00
|
|
|
}
|
|
|
|
else if (fwin->zone)
|
|
|
|
{
|
|
|
|
if (e_exec(fwin->zone, desk, NULL, files_list, "fwin"))
|
|
|
|
need_dia = 0;
|
|
|
|
}
|
2012-07-19 21:48:59 -07:00
|
|
|
if (!need_dia)
|
|
|
|
{
|
|
|
|
if (mlist)
|
|
|
|
e_exehist_mime_desktop_add(mlist->data, desk);
|
|
|
|
}
|
2012-07-06 06:35:03 -07:00
|
|
|
}
|
|
|
|
EINA_LIST_FREE(files_list, file)
|
|
|
|
free(file);
|
|
|
|
|
2013-07-14 19:45:19 -07:00
|
|
|
if (chdir(pcwd) < 0) perror("chdir");
|
2012-07-06 06:35:03 -07:00
|
|
|
if (!need_dia)
|
|
|
|
{
|
2012-07-19 21:48:59 -07:00
|
|
|
EINA_LIST_FREE(apps, desk) efreet_desktop_free(desk);
|
2012-07-06 06:35:03 -07:00
|
|
|
mlist = eina_list_free(mlist);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2007-08-12 02:54:33 -07:00
|
|
|
if (fwin->win)
|
2014-11-02 18:35:13 -08:00
|
|
|
dia = e_dialog_new(NULL,
|
2011-01-05 14:36:21 -08:00
|
|
|
"E", "_fwin_open_apps");
|
2007-08-12 02:54:33 -07:00
|
|
|
else if (fwin->zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
dia = e_dialog_new(NULL,
|
2011-01-05 14:36:21 -08:00
|
|
|
"E", "_fwin_open_apps");
|
|
|
|
else return; /* make clang happy */
|
2012-12-20 02:07:30 -08:00
|
|
|
|
2014-12-22 06:02:05 -08:00
|
|
|
e_dialog_resizable_set(dia, 1);
|
2012-12-20 02:07:30 -08:00
|
|
|
|
2012-12-13 06:13:39 -08:00
|
|
|
fad = E_NEW(E_Fwin_Apps_Dialog, 1);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_dialog_title_set(dia, _("Open with..."));
|
2009-03-06 14:18:15 -08:00
|
|
|
e_dialog_button_add(dia, _("Open"), "document-open",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_cb_open, fad);
|
2009-03-06 14:18:15 -08:00
|
|
|
e_dialog_button_add(dia, _("Close"), "window-close",
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_cb_close, fad);
|
2007-08-12 02:54:33 -07:00
|
|
|
|
|
|
|
fad->dia = dia;
|
|
|
|
fad->fwin = fwin;
|
|
|
|
fwin->fad = fad;
|
|
|
|
dia->data = fad;
|
|
|
|
e_object_free_attach_func_set(E_OBJECT(dia), _e_fwin_cb_dialog_free);
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
evas = evas_object_evas_get(dia->win);
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2012-07-15 13:53:13 -07:00
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
|
|
|
|
2012-07-15 14:54:58 -07:00
|
|
|
l = eina_list_free(l);
|
|
|
|
|
2012-08-05 00:52:15 -07:00
|
|
|
#if 1
|
|
|
|
o = e_widget_filepreview_add(evas, 96 * e_scale, 96 * e_scale, 1);
|
|
|
|
fad->o_filepreview = o;
|
|
|
|
if (n == 1)
|
|
|
|
{
|
|
|
|
ici = eina_list_data_get(files);
|
|
|
|
of = e_widget_framelist_add(evas, ici->file, 0);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
e_widget_filepreview_path_set(o, buf, ici->mime);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), P_("%d file", "%d files", n), n);
|
|
|
|
of = e_widget_framelist_add(evas, buf, 0);
|
|
|
|
ot = e_widget_toolbar_add(evas, 24 * e_scale, 24 * e_scale);
|
|
|
|
e_widget_toolbar_scrollable_set(ot, 1);
|
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
e_widget_toolbar_item_append(ot, NULL, ici->file, _e_fwin_file_open_dialog_preview_set, page, ici);
|
|
|
|
e_widget_toolbar_item_select(ot, 0);
|
|
|
|
e_widget_framelist_object_append(of, ot);
|
|
|
|
}
|
|
|
|
|
|
|
|
e_widget_framelist_object_append(of, o);
|
|
|
|
#else
|
|
|
|
// Here each file has its own widget, created at start, resulting on a longish time to show the dialog.
|
|
|
|
// However, this doesn't display artefacts as the previous method, so is kept here for reference.
|
|
|
|
if (n == 1)
|
2012-07-15 13:53:13 -07:00
|
|
|
{
|
|
|
|
ici = eina_list_data_get(files);
|
|
|
|
of = e_widget_framelist_add(evas, ici->file, 0);
|
2012-08-05 00:52:15 -07:00
|
|
|
o = e_widget_filepreview_add(evas, 96 * e_scale, 96 * e_scale, 1);
|
2012-07-15 13:53:13 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
e_widget_filepreview_path_set(o, buf, ici->mime);
|
|
|
|
e_widget_framelist_object_append(of, o);
|
2012-08-05 00:52:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), P_("%d file", "%d files", n), n);
|
|
|
|
of = e_widget_framelist_add(evas, buf, 0);
|
|
|
|
ot = e_widget_toolbook_add(evas, 24 * e_scale, 24 * e_scale);
|
|
|
|
EINA_LIST_FOREACH(files, l, ici)
|
|
|
|
{
|
|
|
|
o = e_widget_filepreview_add(evas, 96 * e_scale, 96 * e_scale, 1);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
e_widget_filepreview_path_set(o, buf, ici->mime);
|
|
|
|
e_widget_toolbook_page_append(ot, NULL, ici->file, o, 1, 1, 1, 1, .5, .5);
|
|
|
|
}
|
|
|
|
e_widget_toolbook_page_show(ot, 0);
|
|
|
|
e_widget_framelist_object_append(of, ot);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2009-04-03 18:20:32 -07:00
|
|
|
// Make frame with list of applications
|
|
|
|
of = e_widget_framelist_add(evas, _("Known Applications"), 0);
|
2007-12-03 09:06:56 -08:00
|
|
|
o = e_widget_ilist_add(evas, 24, 24, &(fad->app2));
|
|
|
|
e_widget_on_change_hook_set(o, _e_fwin_cb_all_change, fad);
|
|
|
|
fad->o_all = o;
|
|
|
|
evas_event_freeze(evas);
|
|
|
|
edje_freeze();
|
|
|
|
e_widget_ilist_freeze(o);
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2009-04-03 18:20:32 -07:00
|
|
|
// Adding Specific Applications list into widget
|
2010-03-25 22:34:34 -07:00
|
|
|
if (apps)
|
2012-10-25 02:29:26 -07:00
|
|
|
e_widget_ilist_header_append(o, NULL, _("Suggested Applications"));
|
2012-08-05 00:52:15 -07:00
|
|
|
mlist = eina_list_free(mlist);
|
2012-10-25 04:29:22 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(apps, l, ll, desk)
|
2009-04-03 18:20:32 -07:00
|
|
|
{
|
|
|
|
Evas_Object *icon = NULL;
|
2012-10-25 04:29:22 -07:00
|
|
|
const char *val;
|
2011-01-05 14:36:21 -08:00
|
|
|
|
2009-04-03 18:20:32 -07:00
|
|
|
if (!desk) continue;
|
|
|
|
icon = e_util_desktop_icon_add(desk, 24, evas);
|
2012-10-25 04:29:22 -07:00
|
|
|
val = efreet_util_path_to_file_id(desk->orig_path);
|
|
|
|
if (!val) val = eina_stringshare_add(desk->exec);
|
|
|
|
if (val)
|
|
|
|
e_widget_ilist_append(o, icon, desk->name, NULL, NULL, val);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* not executable, don't keep in list */
|
|
|
|
apps = eina_list_remove_list(apps, l);
|
|
|
|
efreet_desktop_free(desk);
|
|
|
|
}
|
2009-04-03 18:20:32 -07:00
|
|
|
}
|
2009-04-04 16:28:37 -07:00
|
|
|
|
2009-04-03 18:20:32 -07:00
|
|
|
// Building All Applications list
|
2007-12-03 10:56:33 -08:00
|
|
|
cats = efreet_util_desktop_name_glob_list("*");
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
cats = eina_list_sort(cats, 0, _e_fwin_dlg_cb_desk_sort);
|
|
|
|
EINA_LIST_FREE(cats, desk)
|
2010-03-25 22:34:34 -07:00
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!eina_list_data_find(l, desk) && !eina_list_data_find(apps, desk))
|
|
|
|
l = eina_list_append(l, desk);
|
|
|
|
else
|
|
|
|
efreet_desktop_free(desk);
|
2010-03-25 22:34:34 -07:00
|
|
|
}
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
l = eina_list_sort(l, -1, _e_fwin_dlg_cb_desk_list_sort);
|
2007-12-03 09:06:56 -08:00
|
|
|
|
2009-04-03 18:20:32 -07:00
|
|
|
// Adding All Applications list into widget
|
2010-03-25 22:34:34 -07:00
|
|
|
if (l)
|
2009-04-03 18:20:32 -07:00
|
|
|
e_widget_ilist_header_append(o, NULL, _("All Applications"));
|
2009-02-27 03:10:28 -08:00
|
|
|
EINA_LIST_FREE(l, desk)
|
2007-12-03 09:06:56 -08:00
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
Evas_Object *icon = NULL;
|
2007-12-03 10:56:33 -08:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!desk) continue;
|
|
|
|
icon = e_util_desktop_icon_add(desk, 24, evas);
|
|
|
|
e_widget_ilist_append(o, icon, desk->name, NULL, NULL,
|
|
|
|
efreet_util_path_to_file_id(desk->orig_path));
|
|
|
|
efreet_desktop_free(desk);
|
2007-12-03 09:06:56 -08:00
|
|
|
}
|
|
|
|
|
2010-03-25 22:34:34 -07:00
|
|
|
EINA_LIST_FREE(apps, desk)
|
2011-01-05 14:36:21 -08:00
|
|
|
efreet_desktop_free(desk);
|
2009-04-03 18:20:32 -07:00
|
|
|
|
2007-12-03 09:06:56 -08:00
|
|
|
e_widget_ilist_go(o);
|
|
|
|
e_widget_ilist_thaw(o);
|
|
|
|
edje_thaw();
|
|
|
|
evas_event_thaw(evas);
|
2012-08-05 00:52:15 -07:00
|
|
|
e_widget_size_min_set(o, 160, 160);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_widget_framelist_object_append(of, o);
|
2012-07-15 13:53:13 -07:00
|
|
|
e_widget_list_object_append(ol, of, 1, 1, 0.5);
|
2007-10-23 14:57:15 -07:00
|
|
|
|
2007-12-03 09:06:56 -08:00
|
|
|
o = e_widget_label_add(evas, _("Custom Command"));
|
2012-07-15 13:53:13 -07:00
|
|
|
e_widget_list_object_append(ol, o, 1, 0, 0.5);
|
2015-01-11 09:20:38 -08:00
|
|
|
fad->o_entry = e_widget_entry_add(dia->win, &(fad->exec_cmd),
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_cb_exec_cmd_changed, fad, NULL);
|
2012-07-15 13:53:13 -07:00
|
|
|
e_widget_list_object_append(ol, fad->o_entry, 1, 0, 0.5);
|
2007-10-23 14:57:15 -07:00
|
|
|
|
2012-07-15 13:53:13 -07:00
|
|
|
e_widget_size_min_get(ol, &mw, &mh);
|
|
|
|
e_dialog_content_set(dia, ol, mw, mh);
|
|
|
|
evas_object_event_callback_add(ol, EVAS_CALLBACK_KEY_DOWN, _e_fwin_file_open_dialog_cb_key_down, page);
|
2007-08-12 02:54:33 -07:00
|
|
|
e_dialog_show(dia);
|
2009-03-15 10:41:46 -07:00
|
|
|
e_dialog_border_icon_set(dia, "preferences-applications");
|
2010-05-02 07:47:11 -07:00
|
|
|
e_widget_focus_steal(fad->o_entry);
|
2009-05-17 14:22:14 -07:00
|
|
|
}
|
|
|
|
|
2012-08-05 00:52:15 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_file_open_dialog_preview_set(void *data1, void *data2)
|
|
|
|
{
|
|
|
|
E_Fwin_Page *page = data1;
|
|
|
|
E_Fm2_Icon_Info *ici = data2;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
|
|
|
|
e_widget_filepreview_path_set(page->fwin->fad->o_filepreview, buf, ici->mime);
|
|
|
|
}
|
|
|
|
|
2009-05-17 14:22:14 -07:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_file_open_dialog_cb_key_down(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *o EINA_UNUSED,
|
2012-07-06 06:35:03 -07:00
|
|
|
void *event_info)
|
2009-05-17 14:22:14 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
E_Fwin_Page *page = data;
|
|
|
|
E_Fwin *fwin = page->fwin;
|
|
|
|
|
2014-03-13 10:00:57 -07:00
|
|
|
if (!strcmp(ev->key, "Escape"))
|
2009-05-17 14:22:14 -07:00
|
|
|
_e_fwin_cb_close(fwin->fad, fwin->fad->dia);
|
2014-03-13 10:00:57 -07:00
|
|
|
else if ((!strcmp(ev->key, "Return")) ||
|
|
|
|
(!strcmp(ev->key, "KP_Enter")))
|
2009-05-17 14:22:14 -07:00
|
|
|
_e_fwin_cb_open(fwin->fad, fwin->fad->dia);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static int
|
|
|
|
_e_fwin_dlg_cb_desk_sort(const void *p1,
|
|
|
|
const void *p2)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
Efreet_Desktop *d1, *d2;
|
|
|
|
|
|
|
|
d1 = (Efreet_Desktop *)p1;
|
|
|
|
d2 = (Efreet_Desktop *)p2;
|
|
|
|
|
|
|
|
if (!d1->name) return 1;
|
|
|
|
if (!d2->name) return -1;
|
|
|
|
return strcmp(d1->name, d2->name);
|
|
|
|
}
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static int
|
|
|
|
_e_fwin_dlg_cb_desk_list_sort(const void *data1,
|
|
|
|
const void *data2)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
const Efreet_Desktop *d1, *d2;
|
|
|
|
|
|
|
|
if (!(d1 = data1)) return 1;
|
|
|
|
if (!(d2 = data2)) return -1;
|
|
|
|
return strcmp(d1->name, d2->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_exec_cmd_changed(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
void *data2 EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin_Apps_Dialog *fad = NULL;
|
|
|
|
Efreet_Desktop *desktop = NULL;
|
|
|
|
|
|
|
|
if (!(fad = data)) return;
|
|
|
|
|
2010-03-25 22:34:34 -07:00
|
|
|
if (fad->app2)
|
2009-04-10 15:02:32 -07:00
|
|
|
desktop = efreet_util_desktop_file_id_find(fad->app2);
|
|
|
|
|
|
|
|
if (!desktop) return;
|
2010-03-25 22:34:34 -07:00
|
|
|
if (strcmp(desktop->exec, fad->exec_cmd))
|
|
|
|
{
|
2011-01-05 14:36:21 -08:00
|
|
|
eina_stringshare_del(fad->app2);
|
|
|
|
fad->app2 = NULL;
|
|
|
|
if (fad->o_all) e_widget_ilist_unselect(fad->o_all);
|
2010-03-25 22:34:34 -07:00
|
|
|
}
|
|
|
|
efreet_desktop_free(desktop);
|
2009-04-10 15:02:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_open(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Dialog *dia EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
Efreet_Desktop *desktop = NULL;
|
|
|
|
|
|
|
|
fad = data;
|
|
|
|
if (fad->app2)
|
|
|
|
desktop = efreet_util_desktop_file_id_find(fad->app2);
|
|
|
|
|
2014-04-04 11:33:15 -07:00
|
|
|
if ((!desktop) && (!fad->exec_cmd)) return;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
// Create a fake .desktop for custom command.
|
2011-01-05 14:36:21 -08:00
|
|
|
if (!desktop)
|
|
|
|
{
|
|
|
|
desktop = efreet_desktop_empty_new("");
|
|
|
|
if (strchr(fad->exec_cmd, '%'))
|
|
|
|
{
|
|
|
|
desktop->exec = strdup(fad->exec_cmd);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
desktop->exec = malloc(strlen(fad->exec_cmd) + 4);
|
|
|
|
if (desktop->exec)
|
|
|
|
snprintf(desktop->exec, strlen(fad->exec_cmd) + 4, "%s %%U", fad->exec_cmd);
|
|
|
|
}
|
|
|
|
}
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2015-02-08 08:53:45 -08:00
|
|
|
if ((fad->exec_cmd) && (strcmp(fad->exec_cmd, "")))
|
2009-05-17 14:54:34 -07:00
|
|
|
_e_fwin_desktop_run(desktop, fad->fwin->cur_page, EINA_FALSE);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2010-03-25 22:34:34 -07:00
|
|
|
efreet_desktop_free(desktop);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
e_object_del(E_OBJECT(fad->dia));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_cb_close(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
E_Dialog *dia EINA_UNUSED)
|
2009-04-10 15:02:32 -07:00
|
|
|
{
|
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
|
|
|
|
fad = data;
|
|
|
|
e_object_del(E_OBJECT(fad->dia));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_fwin_cb_dialog_free(void *obj)
|
|
|
|
{
|
|
|
|
E_Dialog *dia;
|
|
|
|
E_Fwin_Apps_Dialog *fad;
|
|
|
|
|
|
|
|
dia = (E_Dialog *)obj;
|
|
|
|
fad = dia->data;
|
|
|
|
eina_stringshare_del(fad->app2);
|
|
|
|
E_FREE(fad->exec_cmd);
|
|
|
|
fad->fwin->fad = NULL;
|
|
|
|
E_FREE(fad);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* scrolling ability */
|
2007-08-12 02:54:33 -07:00
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_pan_set(Evas_Object *obj,
|
2012-07-06 06:35:03 -07:00
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = evas_object_data_get(obj, "fm_page");
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_pan_set(obj, x, y);
|
2009-04-28 10:38:09 -07:00
|
|
|
if (x > page->fm_pan.max_x) x = page->fm_pan.max_x;
|
|
|
|
if (y > page->fm_pan.max_y) y = page->fm_pan.max_y;
|
2007-08-12 02:54:33 -07:00
|
|
|
if (x < 0) x = 0;
|
|
|
|
if (y < 0) y = 0;
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_pan.x = x;
|
|
|
|
page->fm_pan.y = y;
|
|
|
|
_e_fwin_pan_scroll_update(page);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_pan_get(Evas_Object *obj,
|
2012-07-06 06:35:03 -07:00
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = evas_object_data_get(obj, "fm_page");
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_pan_get(obj, x, y);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_pan.x = *x;
|
|
|
|
page->fm_pan.y = *y;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_pan_max_get(Evas_Object *obj,
|
2012-07-06 06:35:03 -07:00
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = evas_object_data_get(obj, "fm_page");
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_pan_max_get(obj, x, y);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_pan.max_x = *x;
|
|
|
|
page->fm_pan.max_y = *y;
|
|
|
|
_e_fwin_pan_scroll_update(page);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-05 14:36:21 -08:00
|
|
|
_e_fwin_pan_child_size_get(Evas_Object *obj,
|
2012-07-06 06:35:03 -07:00
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page;
|
2011-01-05 14:36:21 -08:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
page = evas_object_data_get(obj, "fm_page");
|
2007-08-12 02:54:33 -07:00
|
|
|
e_fm2_pan_child_size_get(obj, w, h);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_pan.w = *w;
|
|
|
|
page->fm_pan.h = *h;
|
|
|
|
_e_fwin_pan_scroll_update(page);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_pan_scroll_update(E_Fwin_Page *page)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
|
|
|
Edje_Message_Int_Set *msg;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
if ((page->fm_pan.x == page->fm_pan_last.x) &&
|
|
|
|
(page->fm_pan.y == page->fm_pan_last.y) &&
|
|
|
|
(page->fm_pan.max_x == page->fm_pan_last.max_x) &&
|
|
|
|
(page->fm_pan.max_y == page->fm_pan_last.max_y) &&
|
|
|
|
(page->fm_pan.w == page->fm_pan_last.w) &&
|
|
|
|
(page->fm_pan.h == page->fm_pan_last.h)) return;
|
2007-08-12 02:54:33 -07:00
|
|
|
msg = alloca(sizeof(Edje_Message_Int_Set) -
|
2011-01-05 14:36:21 -08:00
|
|
|
sizeof(int) + (6 * sizeof(int)));
|
2007-08-12 02:54:33 -07:00
|
|
|
msg->count = 6;
|
2009-04-28 10:38:09 -07:00
|
|
|
msg->val[0] = page->fm_pan.x;
|
|
|
|
msg->val[1] = page->fm_pan.y;
|
|
|
|
msg->val[2] = page->fm_pan.max_x;
|
|
|
|
msg->val[3] = page->fm_pan.max_y;
|
|
|
|
msg->val[4] = page->fm_pan.w;
|
|
|
|
msg->val[5] = page->fm_pan.h;
|
2007-08-12 02:54:33 -07:00
|
|
|
// printf("SEND MSG %i %i | %i %i | %ix%i\n",
|
2009-04-28 10:38:09 -07:00
|
|
|
// page->fm_pan.x, page->fm_pan.y,
|
|
|
|
// page->fm_pan.max_x, page->fm_pan.max_y,
|
|
|
|
// page->fm_pan.w, page->fm_pan.h);
|
2012-07-03 05:31:51 -07:00
|
|
|
if (page->fwin->under_obj && page->fwin->wallpaper_is_edj)
|
2009-04-28 10:38:09 -07:00
|
|
|
edje_object_message_send(page->fwin->under_obj, EDJE_MESSAGE_INT_SET, 1, msg);
|
|
|
|
if (page->fwin->over_obj)
|
|
|
|
edje_object_message_send(page->fwin->over_obj, EDJE_MESSAGE_INT_SET, 1, msg);
|
2012-07-31 06:31:35 -07:00
|
|
|
if (page->scr)
|
|
|
|
edje_object_message_send(e_scrollframe_edje_object_get(page->scr), EDJE_MESSAGE_INT_SET, 1, msg);
|
2009-04-28 10:38:09 -07:00
|
|
|
page->fm_pan_last.x = page->fm_pan.x;
|
|
|
|
page->fm_pan_last.y = page->fm_pan.y;
|
|
|
|
page->fm_pan_last.max_x = page->fm_pan.max_x;
|
|
|
|
page->fm_pan_last.max_y = page->fm_pan.max_y;
|
|
|
|
page->fm_pan_last.w = page->fm_pan.w;
|
|
|
|
page->fm_pan_last.h = page->fm_pan.h;
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
/* e_fm_op_registry */
|
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_op_registry_listener_cb(void *data,
|
2011-01-05 14:36:21 -08:00
|
|
|
const E_Fm2_Op_Registry_Entry *ere)
|
2007-08-12 02:54:33 -07:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
Evas_Object *o = data;
|
2012-08-22 00:32:12 -07:00
|
|
|
char buf[4096];
|
2009-04-10 15:02:32 -07:00
|
|
|
char *total;
|
2010-03-21 05:51:36 -07:00
|
|
|
int mw, mh;
|
2012-10-31 02:37:21 -07:00
|
|
|
Edje_Message_Float msg;
|
|
|
|
|
2010-03-21 05:51:36 -07:00
|
|
|
// Don't show if the operation keep less than 1 second
|
|
|
|
if (ere->start_time + 1.0 > ecore_loop_time_get()) return;
|
2009-04-10 15:02:32 -07:00
|
|
|
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
// Update icon
|
2009-04-10 15:02:32 -07:00
|
|
|
switch (ere->op)
|
2011-01-05 14:36:21 -08:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FM_OP_COPY:
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_emit(o, "e,action,icon,copy", "e");
|
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FM_OP_MOVE:
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_emit(o, "e,action,icon,move", "e");
|
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
case E_FM_OP_REMOVE:
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_emit(o, "e,action,icon,delete", "e");
|
|
|
|
break;
|
|
|
|
|
2012-11-02 06:45:47 -07:00
|
|
|
case E_FM_OP_SECURE_REMOVE:
|
|
|
|
edje_object_signal_emit(o, "e,action,icon,secure_delete", "e");
|
|
|
|
break;
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
default:
|
2012-11-02 06:45:47 -07:00
|
|
|
edje_object_signal_emit(o, "e,action,icon,unknown", "e");
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
|
|
|
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
// Update information text
|
|
|
|
switch (ere->status)
|
2011-01-05 14:36:21 -08:00
|
|
|
{
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
case E_FM2_OP_STATUS_ABORTED:
|
2011-01-05 14:36:21 -08:00
|
|
|
switch (ere->op)
|
|
|
|
{
|
|
|
|
case E_FM_OP_COPY:
|
|
|
|
snprintf(buf, sizeof(buf), _("Copying is aborted"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_FM_OP_MOVE:
|
|
|
|
snprintf(buf, sizeof(buf), _("Moving is aborted"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_FM_OP_REMOVE:
|
|
|
|
snprintf(buf, sizeof(buf), _("Deleting is aborted"));
|
|
|
|
break;
|
|
|
|
|
2012-11-02 06:45:47 -07:00
|
|
|
case E_FM_OP_SECURE_REMOVE:
|
|
|
|
snprintf(buf, sizeof(buf), _("Secure deletion is aborted"));
|
|
|
|
break;
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
default:
|
|
|
|
snprintf(buf, sizeof(buf), _("Unknown operation from slave is aborted"));
|
|
|
|
}
|
|
|
|
break;
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
|
|
|
|
default:
|
2011-01-05 14:36:21 -08:00
|
|
|
total = e_util_size_string_get(ere->total);
|
|
|
|
switch (ere->op)
|
|
|
|
{
|
|
|
|
case E_FM_OP_COPY:
|
|
|
|
if (ere->finished)
|
|
|
|
snprintf(buf, sizeof(buf), _("Copy of %s done"), total);
|
|
|
|
else
|
2012-07-17 05:10:49 -07:00
|
|
|
snprintf(buf, sizeof(buf), _("Copying %s (eta: %s)"), total, e_util_time_str_get(ere->eta));
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case E_FM_OP_MOVE:
|
|
|
|
if (ere->finished)
|
|
|
|
snprintf(buf, sizeof(buf), _("Move of %s done"), total);
|
|
|
|
else
|
2012-07-17 05:10:49 -07:00
|
|
|
snprintf(buf, sizeof(buf), _("Moving %s (eta: %s)"), total, e_util_time_str_get(ere->eta));
|
2011-01-05 14:36:21 -08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case E_FM_OP_REMOVE:
|
|
|
|
if (ere->finished)
|
|
|
|
snprintf(buf, sizeof(buf), _("Delete done"));
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), _("Deleting files..."));
|
|
|
|
break;
|
|
|
|
|
2012-11-02 06:45:47 -07:00
|
|
|
case E_FM_OP_SECURE_REMOVE:
|
|
|
|
if (ere->finished)
|
|
|
|
snprintf(buf, sizeof(buf), _("Secure delete done"));
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), _("Securely deleting files..."));
|
|
|
|
break;
|
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
default:
|
2012-10-29 05:40:14 -07:00
|
|
|
snprintf(buf, sizeof(buf), _("Unknown operation from slave %d"), ere->id);
|
2011-01-05 14:36:21 -08:00
|
|
|
}
|
|
|
|
E_FREE(total);
|
|
|
|
}
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
edje_object_part_text_set(o, "e.text.info", buf);
|
2009-04-10 15:02:32 -07:00
|
|
|
|
|
|
|
if (ere->needs_attention)
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_emit(o, "e,action,set,need_attention", "e");
|
2009-04-10 15:02:32 -07:00
|
|
|
else
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_emit(o, "e,action,set,normal", "e");
|
2012-10-31 02:37:21 -07:00
|
|
|
|
|
|
|
if ((ere->finished) || (ere->status == E_FM2_OP_STATUS_ABORTED))
|
|
|
|
{
|
|
|
|
if (!evas_object_data_get(o, "stopped"))
|
|
|
|
{
|
|
|
|
evas_object_data_set(o, "stopped", o);
|
|
|
|
edje_object_signal_emit(o, "e,state,busy,stop", "e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ere->percent > 0)
|
|
|
|
{
|
|
|
|
if (!evas_object_data_get(o, "started"))
|
|
|
|
{
|
|
|
|
evas_object_data_set(o, "started", o);
|
|
|
|
edje_object_signal_emit(o, "e,state,busy,start", "e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update element
|
|
|
|
edje_object_part_drag_size_set(o, "e.gauge.bar",
|
|
|
|
((double)(ere->percent)) / 100.0, 1.0);
|
|
|
|
msg.val = ((double)(ere->percent)) / 100.0;
|
|
|
|
edje_object_message_send(o, EDJE_MESSAGE_FLOAT, 1, &msg);
|
|
|
|
edje_object_size_min_get(o, &mw, &mh);
|
|
|
|
if ((mw == 0) || (mh == 0))
|
|
|
|
edje_object_size_min_calc(o, &mw, &mh);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mw *= e_scale;
|
|
|
|
mh *= e_scale;
|
|
|
|
}
|
|
|
|
evas_object_resize(o, mw, mh);
|
|
|
|
evas_object_show(o);
|
2007-08-12 02:54:33 -07:00
|
|
|
}
|
2007-08-12 16:04:38 -07:00
|
|
|
|
2012-06-14 06:08:46 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_fwin_op_registry_free_check(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2012-06-14 06:08:46 -07:00
|
|
|
{
|
|
|
|
Ecore_Timer *t;
|
|
|
|
|
|
|
|
t = evas_object_data_get(obj, "_e_fwin_op_registry_thingy");
|
|
|
|
if (!t) return;
|
|
|
|
ecore_timer_del(t);
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-04-10 15:02:32 -07:00
|
|
|
_e_fwin_op_registry_free_data_delayed(void *data)
|
2007-12-13 21:57:16 -08:00
|
|
|
{
|
2012-06-14 06:08:46 -07:00
|
|
|
evas_object_event_callback_del_full(data, EVAS_CALLBACK_FREE, _e_fwin_op_registry_free_check, data);
|
2011-01-05 14:36:21 -08:00
|
|
|
evas_object_del((Evas_Object *)data);
|
2009-04-10 15:02:32 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2007-12-13 21:57:16 -08:00
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
static void
|
|
|
|
_e_fwin_op_registry_free_data(void *data)
|
2007-08-12 16:04:38 -07:00
|
|
|
{
|
2012-06-14 06:08:46 -07:00
|
|
|
Ecore_Timer *t;
|
2017-02-03 13:52:28 -08:00
|
|
|
t = ecore_timer_loop_add(5.0, _e_fwin_op_registry_free_data_delayed, data);
|
2012-06-14 06:08:46 -07:00
|
|
|
evas_object_data_set(data, "_e_fwin_op_registry_thingy", t);
|
|
|
|
evas_object_event_callback_add(data, EVAS_CALLBACK_FREE, _e_fwin_op_registry_free_check, data);
|
2007-08-12 16:04:38 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_op_registry_entry_add_cb(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
EINA_UNUSED int type,
|
2012-07-06 06:35:03 -07:00
|
|
|
void *event)
|
2007-08-12 16:04:38 -07:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
E_Fm2_Op_Registry_Entry *ere = (E_Fm2_Op_Registry_Entry *)event;
|
2009-04-28 10:38:09 -07:00
|
|
|
E_Fwin_Page *page = data;
|
2009-04-10 15:02:32 -07:00
|
|
|
Evas_Object *o;
|
2007-08-12 16:04:38 -07:00
|
|
|
|
2012-11-02 06:45:47 -07:00
|
|
|
if ((ere->op != E_FM_OP_COPY) && (ere->op != E_FM_OP_MOVE) &&
|
|
|
|
(ere->op != E_FM_OP_REMOVE) && (ere->op != E_FM_OP_SECURE_REMOVE))
|
2011-01-05 14:36:21 -08:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2007-11-09 15:33:23 -08:00
|
|
|
|
2009-04-28 10:38:09 -07:00
|
|
|
o = edje_object_add(evas_object_evas_get(page->scrollframe_obj));
|
2009-04-10 15:02:32 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/fileman",
|
|
|
|
"e/fileman/default/progress");
|
2007-12-03 09:06:56 -08:00
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
// Append the element to the box
|
2012-07-31 06:31:35 -07:00
|
|
|
edje_object_part_box_append(e_scrollframe_edje_object_get(page->scr),
|
2009-04-10 15:02:32 -07:00
|
|
|
"e.box.operations", o);
|
|
|
|
evas_object_size_hint_align_set(o, 1.0, 1.0); //FIXME this should be theme-configurable
|
2009-04-03 21:14:01 -07:00
|
|
|
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
// add abort button callback with id of operation in registry
|
2011-01-05 14:36:21 -08:00
|
|
|
edje_object_signal_callback_add(o, "e,fm,operation,abort", "",
|
|
|
|
_e_fwin_op_registry_abort_cb, (void *)(long)ere->id);
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
//Listen to progress changes
|
|
|
|
e_fm2_op_registry_entry_listener_add(ere, _e_fwin_op_registry_listener_cb,
|
|
|
|
o, _e_fwin_op_registry_free_data);
|
2009-04-03 21:14:01 -07:00
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2007-12-03 09:06:56 -08:00
|
|
|
}
|
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
static void
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_op_registry_entry_iter(E_Fwin_Page *page)
|
2007-12-03 09:06:56 -08:00
|
|
|
{
|
2009-04-10 15:02:32 -07:00
|
|
|
Eina_Iterator *itr;
|
|
|
|
E_Fm2_Op_Registry_Entry *ere;
|
2007-12-03 09:06:56 -08:00
|
|
|
|
2009-04-10 15:02:32 -07:00
|
|
|
itr = e_fm2_op_registry_iterator_new();
|
|
|
|
EINA_ITERATOR_FOREACH(itr, ere)
|
2009-04-28 10:38:09 -07:00
|
|
|
_e_fwin_op_registry_entry_add_cb(page, 0, ere);
|
2009-04-10 15:02:32 -07:00
|
|
|
eina_iterator_free(itr);
|
2007-12-03 09:06:56 -08:00
|
|
|
}
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
|
2011-01-05 14:36:21 -08:00
|
|
|
static void
|
2012-07-06 06:35:03 -07:00
|
|
|
_e_fwin_op_registry_abort_cb(void *data,
|
2015-03-18 15:09:09 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
{
|
|
|
|
int id;
|
2010-08-19 09:29:01 -07:00
|
|
|
|
2009-09-03 09:32:48 -07:00
|
|
|
id = (long)data;
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
if (!id) return;
|
|
|
|
e_fm2_operation_abort(id);
|
|
|
|
}
|
2011-01-05 14:36:21 -08:00
|
|
|
|