aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_fm_op_registry.h
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2009-03-18 01:33:06 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2009-03-18 01:33:06 +0000
commit92cab40cdaeecd1060facd7bcd9be6f58741090f (patch)
tree94d711708f30863ce93d0f2bd3dd0516108e92fa /src/bin/e_fm_op_registry.h
parentuse ECORE_EVENT_MODIFIER (diff)
downloadenlightenment-92cab40cdaeecd1060facd7bcd9be6f58741090f.tar.gz
add filemanager operation registry.
This huge commit will add e_fm2_op_registry, a central place that will store all on-going operations. You will find that it will report when operations are added, remove and when they change, for example when they change progress. Please notice that the recommended way to present information is to add listener to specific entries, as opposed to use E_EVENT_FM_OP_REGISTRY_CHANGED since it will be called immediately and you do not have to filter which entry is being changed. Entries will be associated with the e_fm object that originated it. With that one can get the Ecore_X_Window and request the window to be raised from somewhere else (ie: gadman/gadget). If object is deleted (ie: window is closed), the pointer will be made NULL and it will be a "windowless operation". TO DO (I need someone to do those): - e_fwin: windows should present on-going operations as an overlay, Dave Andreolli already started such work, it's just a matter of using the new infrastructure. - create a new gadget that present all on-going operations and maybe a history. It would be nice to show the e_fwin of if the entry is clicked, as well as a cancel button and a progress bar. See "places" module, make them similar. SVN revision: 39541
Diffstat (limited to 'src/bin/e_fm_op_registry.h')
-rw-r--r--src/bin/e_fm_op_registry.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/bin/e_fm_op_registry.h b/src/bin/e_fm_op_registry.h
new file mode 100644
index 000000000..44de284d0
--- /dev/null
+++ b/src/bin/e_fm_op_registry.h
@@ -0,0 +1,67 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+#ifdef E_TYPEDEFS
+
+typedef enum _E_Fm2_Op_Status
+{
+ E_FM2_OP_STATUS_UNKNOWN = 0,
+ E_FM2_OP_STATUS_IN_PROGRESS,
+ E_FM2_OP_STATUS_SUCCESSFUL,
+ E_FM2_OP_STATUS_ABORTED,
+ E_FM2_OP_STATUS_ERROR
+} E_Fm2_Op_Status;
+
+typedef struct _E_Fm2_Op_Registry_Entry E_Fm2_Op_Registry_Entry;
+
+#else
+#ifndef E_FM_OP_REGISTRY_H
+#define E_FM_OP_REGISTRY_H
+
+struct _E_Fm2_Op_Registry_Entry
+{
+ int id;
+ int percent; /* XXX use char? */
+ size_t done;
+ size_t total;
+ Evas_Object *e_fm;
+ const char *src; /* stringshared */
+ const char *dst; /* stringshared */
+ double start_time;
+ int duration; /* XXX use double? */
+ E_Fm_Op_Type op;
+ E_Fm2_Op_Status status;
+ Eina_Bool needs_attention:1;
+ Eina_Bool finished:1;
+};
+
+extern EAPI int E_EVENT_FM_OP_REGISTRY_ADD;
+extern EAPI int E_EVENT_FM_OP_REGISTRY_DEL;
+extern EAPI int E_EVENT_FM_OP_REGISTRY_CHANGED;
+
+EAPI int e_fm2_op_registry_entry_ref(E_Fm2_Op_Registry_Entry *entry);
+EAPI int e_fm2_op_registry_entry_unref(E_Fm2_Op_Registry_Entry *entry);
+
+EAPI Ecore_X_Window e_fm2_op_registry_entry_xwin_get(const E_Fm2_Op_Registry_Entry *entry);
+
+EAPI E_Fm2_Op_Registry_Entry *e_fm2_op_registry_entry_get(int id);
+
+EAPI void e_fm2_op_registry_entry_listener_add(E_Fm2_Op_Registry_Entry *entry, void (*cb)(void *data, const E_Fm2_Op_Registry_Entry *entry), const void *data, void (*free_data)(void *data));
+EAPI void e_fm2_op_registry_entry_listener_del(E_Fm2_Op_Registry_Entry *entry, void (*cb)(void *data, const E_Fm2_Op_Registry_Entry *entry), const void *data);
+
+EAPI Eina_Iterator *e_fm2_op_registry_iterator_new(void);
+EAPI Eina_List *e_fm2_op_registry_get_all(void);
+EAPI void e_fm2_op_registry_get_all_free(Eina_List *list);
+
+EAPI unsigned int e_fm2_op_registry_init(void);
+EAPI unsigned int e_fm2_op_registry_shutdown(void);
+
+/* E internal/private functions, symbols not exported outside e binary (e_fm.c mainly) */
+Eina_Bool e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op);
+Eina_Bool e_fm2_op_registry_entry_del(int id);
+void e_fm2_op_registry_entry_changed(const E_Fm2_Op_Registry_Entry *entry);
+void e_fm2_op_registry_entry_e_fm_set(E_Fm2_Op_Registry_Entry *entry, Evas_Object *e_fm);
+void e_fm2_op_registry_entry_files_set(E_Fm2_Op_Registry_Entry *entry, const char *src, const char *dst);
+
+#endif
+#endif