summaryrefslogtreecommitdiff
path: root/src/bin/e_fm.h
blob: 1509e50e0b247583f78e9fc34caa8f2a5ef49eb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#ifdef E_TYPEDEFS

/* IGNORE this code for now! */

typedef enum _E_Fm2_View_Mode
{
   E_FM2_VIEW_MODE_ICONS, /* regular layout row by row like text */
   E_FM2_VIEW_MODE_GRID_ICONS, /* regular grid layout */
   E_FM2_VIEW_MODE_CUSTOM_ICONS, /* icons go anywhere u drop them (desktop) */
     
     /* FIXME: not going to implement this at this stage */
   E_FM2_VIEW_MODE_CUSTOM_GRID_ICONS, /* icons go anywhere u drop them but align to a grid */
     /* FIXME: not going to implement this at this stage */
   E_FM2_VIEW_MODE_CUSTOM_SMART_GRID_ICONS, /* icons go anywhere u drop them but try align to icons nearby */
     /* FIXME: not going to implement this at this stage */
   E_FM2_VIEW_MODE_LIST /* vertical fileselector list */
} E_Fm2_View_Mode;

typedef enum _E_Fm2_Menu_Flags
{
   E_FM2_MENU_NO_REFRESH           = (1 << 0),
   E_FM2_MENU_NO_SHOW_HIDDEN       = (1 << 1),
   E_FM2_MENU_NO_REMEMBER_ORDERING = (1 << 2),
   E_FM2_MENU_NO_NEW_DIRECTORY     = (1 << 3),
   E_FM2_MENU_NO_DELETE            = (1 << 4),
   E_FM2_MENU_NO_RENAME            = (1 << 5),
   E_FM2_MENU_NO_CUT               = (1 << 6),
   E_FM2_MENU_NO_COPY              = (1 << 7),
   E_FM2_MENU_NO_PASTE             = (1 << 8),
   E_FM2_MENU_NO_SYMLINK           = (1 << 9),
   E_FM2_MENU_NO_VIEW_MENU         = (1 << 10),
   E_FM2_MENU_NO_INHERIT_PARENT    = (1 << 11)
} E_Fm2_Menu_Flags;

typedef enum _E_Fm2_View_Flags
{
  E_FM2_VIEW_NO_FLAGS           = 0,
  E_FM2_VIEW_LOAD_DIR_CUSTOM    = (1 << 0),
  E_FM2_VIEW_SAVE_DIR_CUSTOM    = (1 << 1),
  E_FM2_VIEW_INHERIT_DIR_CUSTOM = (1 << 2),
  E_FM2_VIEW_DIR_CUSTOM         = (E_FM2_VIEW_LOAD_DIR_CUSTOM |
				   E_FM2_VIEW_SAVE_DIR_CUSTOM |
				   E_FM2_VIEW_INHERIT_DIR_CUSTOM)
} E_Fm2_View_Flags;

typedef struct _E_Fm2_Config      E_Fm2_Config;
typedef struct _E_Fm2_Icon        E_Fm2_Icon;
typedef struct _E_Fm2_Icon_Info   E_Fm2_Icon_Info;

#define E_FM_SHARED_DATATYPES
#include "e_fm_shared.h"
#undef E_FM_SHARED_DATATYPES

#else
#ifndef E_FM_H
#define E_FM_H

struct _E_Fm2_Config
{
   /* general view mode */
   struct {
      E_Fm2_View_Mode mode;
      unsigned char   open_dirs_in_place;
      unsigned char   selector;
      unsigned char   single_click;
      unsigned char   no_subdir_jump;
      unsigned char   no_subdir_drop;
      unsigned char   always_order;
      unsigned char   link_drop;
      unsigned char   fit_custom_pos;
      unsigned int    single_click_delay;
   } view;
   /* display of icons */
   struct {
      struct {
	 int w, h;
      } icon, list;
      struct {
	 unsigned char w, h;
      } fixed;
      struct {
	 unsigned char show;
      } extension;
      const char *key_hint;
   } icon;
   /* how to sort files */
   struct {
      struct {
	 unsigned char no_case;
	 struct {
	    unsigned char first;
	    unsigned char last;
	 } dirs;
      } sort;
   } list;
   /* control how you can select files */
   struct {
      unsigned char single, windows_modifiers;
   } selection;
   /* the background - if any, and how to handle it */
   /* FIXME: not implemented yet */
   struct {
      const char *background, *frame, *icons;
      unsigned char fixed;
   } theme;
};

struct _E_Fm2_Icon_Info
{
   Evas_Object      *fm;
   E_Fm2_Icon       *ic;
   const char       *file;
   const char       *mime;
   const char       *label;
   const char       *comment;
   const char       *generic;
   const char       *icon;
   const char       *link;
   const char       *real_link;
   const char       *category;
   struct stat       statinfo;
   unsigned char     icon_type;
   unsigned char     mount : 1;
   unsigned char     removable : 1;
   unsigned char     removable_full : 1;
   unsigned char     deleted : 1;
   unsigned char     broken_link : 1;
};

EAPI int                   e_fm2_init(void);
EAPI int                   e_fm2_shutdown(void);
EAPI Evas_Object          *e_fm2_add(Evas *evas);
EAPI void                  e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path);
EAPI void                  e_fm2_custom_theme_set(Evas_Object *obj, const char *path);
EAPI void                  e_fm2_custom_theme_content_set(Evas_Object *obj, const char *content);
EAPI void                  e_fm2_underlay_show(Evas_Object *obj);
EAPI void                  e_fm2_underlay_hide(Evas_Object *obj);
EAPI void                  e_fm2_all_unsel(Evas_Object *obj);
EAPI void                  e_fm2_all_sel(Evas_Object *obj);
EAPI void                  e_fm2_path_get(Evas_Object *obj, const char **dev, const char **path);
EAPI void                  e_fm2_refresh(Evas_Object *obj);
EAPI const char           *e_fm2_real_path_get(Evas_Object *obj);
EAPI int                   e_fm2_has_parent_get(Evas_Object *obj);
EAPI void                  e_fm2_parent_go(Evas_Object *obj);
EAPI void                  e_fm2_config_set(Evas_Object *obj, E_Fm2_Config *cfg);
EAPI E_Fm2_Config         *e_fm2_config_get(Evas_Object *obj);
EAPI Eina_List            *e_fm2_selected_list_get(Evas_Object *obj);
EAPI Eina_List            *e_fm2_all_list_get(Evas_Object *obj);
EAPI void                  e_fm2_select_set(Evas_Object *obj, const char *file, int select);
EAPI void                  e_fm2_file_show(Evas_Object *obj, const char *file);
EAPI void                  e_fm2_icon_menu_replace_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void                  e_fm2_icon_menu_start_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void                  e_fm2_icon_menu_end_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void                  e_fm2_icon_menu_flags_set(Evas_Object *obj, E_Fm2_Menu_Flags flags);
EAPI E_Fm2_Menu_Flags      e_fm2_icon_menu_flags_get(Evas_Object *obj);
EAPI void                  e_fm2_view_flags_set(Evas_Object *obj, E_Fm2_View_Flags flags);
EAPI E_Fm2_View_Flags      e_fm2_view_flags_get(Evas_Object *obj);
EAPI void                  e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj);
EAPI void                  e_fm2_icons_update(Evas_Object *obj);

EAPI void                  e_fm2_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
EAPI void                  e_fm2_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
EAPI void                  e_fm2_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
EAPI void                  e_fm2_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);

EAPI void                  e_fm2_all_icons_update(void);

EAPI void                  e_fm2_operation_abort(int id);

EAPI Evas_Object *
  e_fm2_icon_get(Evas *evas, E_Fm2_Icon *ic,
		 void (*gen_func) (void *data, Evas_Object *obj, void *event_info),
		 void *data, int force_gen, const char **type_ret);
EAPI E_Fm2_Icon_Info *e_fm2_icon_file_info_get(E_Fm2_Icon *ic);
EAPI void        e_fm2_icon_geometry_get(E_Fm2_Icon *ic, int *x, int *y, int *w, int *h);

EAPI void        e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e);
EAPI void        e_fm2_client_del(Ecore_Ipc_Event_Client_Del *e);

EAPI int        _e_fm2_client_mount(const char *udi, const char *mountpoint);
EAPI int        _e_fm2_client_unmount(const char *udi);
EAPI void        _e_fm2_file_force_update(const char *path);
    
#endif
#endif