summaryrefslogtreecommitdiff
path: root/src/lib/eio/eio_model_private.h
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2016-04-20 17:07:53 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-04-29 13:21:24 -0300
commit0c76f82a31b1ad06a4da4c12f1a02139e0d0c6fa (patch)
tree254f0542b8fc5ea1af14936da8e6806262f3f8a6 /src/lib/eio/eio_model_private.h
parent42346e22f4c06634e180c44cf63924dbc50a5184 (diff)
Efl, Eio, Eldbus, Elementary: new model API use eina_promise
Efl - efl_model_base changed to use eina_promise Eio - eio_model use efl_model_base with promise Eldbus - elddbus models use promise now Elementary - elm_view_list and elm_view_form use new models with promise updated all related examples and tests
Diffstat (limited to '')
-rw-r--r--src/lib/eio/eio_model_private.h33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/lib/eio/eio_model_private.h b/src/lib/eio/eio_model_private.h
index adeb9cf..edf64fb 100644
--- a/src/lib/eio/eio_model_private.h
+++ b/src/lib/eio/eio_model_private.h
@@ -14,7 +14,7 @@ struct _Eio_Model_Monitor_Data
14 int mon_event_child_del[3]; /**< plus EIO_MONITOR_ERROR */ 14 int mon_event_child_del[3]; /**< plus EIO_MONITOR_ERROR */
15}; 15};
16 16
17enum { 17typedef enum _Eio_Property_Name {
18 EIO_MODEL_PROP_FILENAME = 0, 18 EIO_MODEL_PROP_FILENAME = 0,
19 EIO_MODEL_PROP_PATH, 19 EIO_MODEL_PROP_PATH,
20 EIO_MODEL_PROP_MTIME, 20 EIO_MODEL_PROP_MTIME,
@@ -22,7 +22,7 @@ enum {
22 EIO_MODEL_PROP_IS_LNK, 22 EIO_MODEL_PROP_IS_LNK,
23 EIO_MODEL_PROP_SIZE, 23 EIO_MODEL_PROP_SIZE,
24 EIO_MODEL_PROP_LAST 24 EIO_MODEL_PROP_LAST
25}; 25} _Eio_Property_Name;
26 26
27static const char* _eio_model_prop_names[] = 27static const char* _eio_model_prop_names[] =
28{ 28{
@@ -34,18 +34,37 @@ static const char* _eio_model_prop_names[] =
34 [EIO_MODEL_PROP_SIZE] = "size" 34 [EIO_MODEL_PROP_SIZE] = "size"
35}; 35};
36 36
37typedef struct _Eio_Property_Promise _Eio_Property_Promise;
38struct _Eio_Property_Promise
39{
40 _Eio_Property_Name property;
41 Eina_Promise_Owner* promise;
42};
43
44typedef struct _Eio_Children_Slice_Promise _Eio_Children_Slice_Promise;
45struct _Eio_Children_Slice_Promise
46{
47 unsigned start;
48 unsigned count;
49 Eina_Promise_Owner* promise;
50};
51
52typedef struct _Eio_Model_Data _Eio_Model_Data;
37struct _Eio_Model_Data 53struct _Eio_Model_Data
38{ 54{
39 Eo *obj; 55 Eo *obj;
40 char *path; 56 char *path;
41 Eina_Array *properties_name; 57 Eina_Array *properties_name;
42 Eina_Value *properties_value[EIO_MODEL_PROP_LAST]; 58 Eina_Bool is_listed : 1;
43 Efl_Model_Load load; 59 Eina_Bool is_listing : 1;
44 int load_pending;
45 Eina_List *children_list; 60 Eina_List *children_list;
61 Eina_List *property_promises;
62 Eina_List *children_promises;
46 /**< EIO data */ 63 /**< EIO data */
47 Eio_File *file; 64 Eio_File *stat_file;
48 Eina_Bool is_dir; 65 Eio_File *listing_file;
66 Eio_File *move_file;
67 Eio_File *del_file;
49 Eio_Monitor *monitor; 68 Eio_Monitor *monitor;
50 Eio_Model_Monitor_Data mon; 69 Eio_Model_Monitor_Data mon;
51 int cb_count_child_add; /**< monitor reference counter for child add event */ 70 int cb_count_child_add; /**< monitor reference counter for child add event */