summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo_base.eo
blob: 47bdc1389ae86d155c7b19d1d6e0a8557b67e632 (plain) (blame)
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
abstract Eo.Base ()
{
   eo_prefix: eo;
   legacy_prefix: null;

   properties {
      parent {
         set {
            /*@ Set the parent of an object
Parents keep references to their children so in order to delete objects that have parents you need to set parent to NULL or use eo_del() that does that for you (and also unrefs the object). */
         }
         get {
            /*@ Get the parent of an object */
         }
         values {
            Eo* parent; /*@ the new parent */
         }
      }
      event_global_freeze_count @class {
         get {
            /*@ return freeze events of object.
Return event freeze count. */
         }
         values {
            int fcount; /*@ The event freeze count of the object */
         }
      }
      event_freeze_count {
         get {
            /*@ return freeze events of object.
Return event freeze count. */
         }
         values {
            int fcount; /*@ The event freeze count of the object */
         }
      }
      finalized {
         /*@ True if the object is already finalized, false otherwise. */
         get {
         }
         values {
            bool finalized;
         }
      }
   }
   methods {
      constructor {
         /*@ Call the object's constructor.
Should not be used with #eo_do. Only use it with #eo_do_super. */
      }
      destructor {
         /*@ Call the object's destructor.
Should not be used with #eo_do. Only use it with #eo_do_super. */
      }
      finalize {
         /*@ Called at the end of #eo_add. Should not be called, just overridden. */
         return: Eo *; /*@ The new object created, can be NULL if the finalize func decided to abort (though it should free the created object on it's own). */
      }
      wref_add {
         /*@ Add a new weak reference to obj.
This function registers the object handle pointed by wref to obj so when obj is deleted it'll be updated to NULL. This functions should be used when you want to keep track of an object in a safe way, but you don't want to prevent it from being freed. */
         params {
            @out Eo* wref;
         }
      }
      wref_del {
         /*@ Delete the weak reference passed. */
         params {
            @in Eo** wref;
         }
      }
      key_data_set {
         /*@ Set generic data to object. */
         params {
            @in const(char)* key; /*@ the key associated with the data */
            @in const(void)* data; /*@ the data to set */
            @in eo_key_data_free_func free_func; /*@ the func to free data with (NULL means */
         }
      }
      key_data_get {
         /*@ Get generic data from object. */
         params {
            @in const(char)* key; /*@ the key associated with the data */
         }
         return: void *; /* the data for the key */
      }
      key_data_del {
         /*@ Del generic data from object. */
         params {
            @in const(char)* key; /*@ the key associated with the data */
         }
      }
      event_thaw {
         /*@ thaw events of object.
Lets event callbacks be called for the object. */
      }
      event_freeze {
         /*@ freeze events of object.
Prevents event callbacks from being called for the object. */
      }
      event_global_thaw @class {
         /*@ thaw events of object.
Lets event callbacks be called for the object. */
      }
      event_global_freeze @class {
         /*@ freeze events of object.
Prevents event callbacks from being called for the object. */
      }
      event_callback_priority_add {
         /*@ Add a callback for an event with a specific priority.
callbacks of the same priority are called in reverse order of creation. */
         params {
            @in const(Eo_Event_Description)* desc; /*@ The description of the event to listen to */
            @in Eo_Callback_Priority priority; /*@ The priority of the callback */
            @in Eo_Event_Cb cb; /*@ the callback to call */
            @in const(void)* data; /*@ additional data to pass to the callback */
         }
      }
      event_callback_del {
         /*@ Del a callback with a specific data associated to it for an event. */
         params {
            @in const(Eo_Event_Description)* desc; /*@ The description of the event to listen to */
            @in Eo_Event_Cb func; /*@ the callback to delete */
            @in const(void)* user_data; /*@ The data to compare */
         }
      }
      event_callback_array_priority_add {
         /*@ Add a callback array for an event with a specific priority.
callbacks of the same priority are called in reverse order of creation. */
         params {
            @in const(Eo_Callback_Array_Item)* array; /*@ an #Eo_Callback_Array_Item of events to listen to */
            @in Eo_Callback_Priority priority; /*@ The priority of the callback */
            @in const(void)* data; /*@ additional data to pass to the callback */
         }
      }
      event_callback_array_del {
         /*@ Del a callback array with a specific data associated to it for an event. */
         params {
            @in const(Eo_Callback_Array_Item)* array; /*@ an #Eo_Callback_Array_Item of events to listen to */
            @in const(void)* user_data; /*@ The data to compare */
         }
      }
      event_callback_call {
         /*@ Call the callbacks for an event of an object. */
         params {
            @in const(Eo_Event_Description)* desc; /*@ The description of the event to call */
            @in void *event_info; /*@ Extra event info to pass to the callbacks */
         }
         return: bool; /* @c EINA_TRUE if one of the callbacks aborted the call, @c EINA_FALSE otherwise */
      }
      event_callback_forwarder_add {
         /*@ Add an event callback forwarder for an event and an object. */
         params {
            @in const(Eo_Event_Description)* desc; /*@ The description of the event to listen to */
            @in Eo* new_obj; /*@ The object to emit events from */
         }
      }
      event_callback_forwarder_del {
         /*@ Remove an event callback forwarder for an event and an object. */
         params {
            @in const(Eo_Event_Description)* desc; /*@ The description of the event to listen to */
            @in Eo* new_obj; /*@ The object to emit events from */
         }
      }
      dbg_info_get {
         /*@ Get dbg information from the object. */
         params {
            @in Eo_Dbg_Info* root_node; /*@ node of the tree */
         }
      }
      children_iterator_new {
         /*@ Get an iterator on all childrens */
         return: free(own(iterator<Eo *> *), eina_iterator_free) @warn_unused;
      }
      composite_attach @protected { /* XXX: Still BETA! */
           /**
            * @brief Make an object a composite object of another.
            *
            * The class of comp_obj must be part of the extensions of the class of the parent.
            * It is not possible to attach more then 1 composite of the same class.
            * This functions also sets the parent of comp_obj to parent.
            *
            * @see eo_composite_detach()
            * @see eo_composite_part_is()
            * @ingroup Eo_Composite_Objects
            */
           params {
                @in Eo *comp_obj; /*@ the object that will be used to composite the parent. */
           }
           return: bool; /*@ EINA_TRUE if successfull. EINA_FALSE otherwise. */
      }
      composite_detach @protected { /* XXX: Still BETA! */
           /**
            * @brief Detach a composite object from another object.
            *
            * This functions also sets the parent of comp_obj to @c NULL.
            *
            * @see eo_composite_attach()
            * @see eo_composite_part_is()
            * @ingroup Eo_Composite_Objects
            */
           params {
                @in Eo *comp_obj; /*@ the object that will be removed from the parent. */
           }
           return: bool; /*@ EINA_TRUE if successfull. EINA_FALSE otherwise. */
      }
      composite_part_is @protected { /* XXX: Still BETA! */
           /**
            * @brief Check if an object is part of a composite object.
            *
            * @see eo_composite_attach()
            * @see eo_composite_part_is()
            * @ingroup Eo_Composite_Objects
            */
           return: bool; /*@ EINA_TRUE if it is. EINA_FALSE otherwise. */
      }
   }
   implements {
        class.constructor;
        class.destructor;
   }
   events {
      callback,add; /*@ A callback was added. */
      callback,del; /*@ A callback was deleted. */
      del; /*@ Obj is being deleted. */
   }
}