summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_poll.c
diff options
context:
space:
mode:
authorJonas M. Gastal <jgastal@profusion.mobi>2012-03-15 19:31:09 +0000
committerJonas M. Gastal <jgastal@profusion.mobi>2012-03-15 19:31:09 +0000
commit7248d7a9700989b4bdb4e5a017cfd19ce9fee377 (patch)
tree3f3e5eae27a4e83992616581b4f99b2a64a9cc98 /legacy/ecore/src/lib/ecore/ecore_poll.c
parent76dc9d2e82020fddc06b64983d1ecaa86b019922 (diff)
Ecore poller docs.
SVN revision: 69424
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore_poll.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_poll.c94
1 files changed, 0 insertions, 94 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_poll.c b/legacy/ecore/src/lib/ecore/ecore_poll.c
index 732850b16f..bf4da6af60 100644
--- a/legacy/ecore/src/lib/ecore/ecore_poll.c
+++ b/legacy/ecore/src/lib/ecore/ecore_poll.c
@@ -189,20 +189,6 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
189 return ECORE_CALLBACK_RENEW; 189 return ECORE_CALLBACK_RENEW;
190} 190}
191 191
192/**
193 * @addtogroup Ecore_Poller_Group
194 *
195 * @{
196 */
197
198/**
199 * Sets the time between ticks (in seconds) for the given ticker clock.
200 * @param type The ticker type to adjust
201 * @param poll_time The time (in seconds) between ticks of the clock
202 *
203 * This will adjust the time between ticks of the given ticker type defined
204 * by @p type to the time period defined by @p poll_time.
205 */
206EAPI void 192EAPI void
207ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__, 193ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
208 double poll_time) 194 double poll_time)
@@ -211,65 +197,12 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
211 _ecore_poller_next_tick_eval(); 197 _ecore_poller_next_tick_eval();
212} 198}
213 199
214/**
215 * Gets the time between ticks (in seconds) for the given ticker clock.
216 * @param type The ticker type to query
217 * @return The time in seconds between ticks of the ticker clock
218 *
219 * This will get the time between ticks of the specified ticker clock.
220 */
221EAPI double 200EAPI double
222ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__) 201ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
223{ 202{
224 return poll_interval; 203 return poll_interval;
225} 204}
226 205
227/**
228 * Creates a poller to call the given function at a particular tick interval.
229 * @param type The ticker type to attach the poller to
230 * @param interval The poll interval
231 * @param func The given function. If @p func returns 1, the poller is
232 * rescheduled for the next tick interval.
233 * @param data Data to pass to @p func when it is called.
234 * @return A poller object on success. @c NULL on failure.
235 *
236 * This function adds a poller callback that is to be called regularly
237 * along with all other poller callbacks so the pollers are synchronized with
238 * all other pollers running off the same poller type and at the same tick
239 * interval. This should be used for polling things when polling is desired
240 * or required, and you do not have specific requirements on the exact times
241 * to poll and want to avoid extra process wakeups for polling. This will
242 * save power as the CPU has more of a chance to go into a low power state
243 * the longer it is asleep for, so this should be used if you are at all
244 * power conscious.
245 *
246 * The @p type parameter defines the poller tick type (there is a virtual
247 * clock ticking all the time - though ecore avoids making it tick when
248 * there will not be any work to do at that tick point). There is only one
249 * ticker at the moment - that is ECORE_POLLER_CORE. This is here for future
250 * expansion if multiple clocks with different frequencies are really required.
251 * The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125
252 * seconds.
253 *
254 * The @p interval is the number of ticker ticks that will pass by in between
255 * invocations of the @p func callback. This must be between 1 and 32768
256 * inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768).
257 * If it is 1, then the function will be called every tick. if it is 2, then it
258 * will be called every 2nd tick, if it is 8, then every 8th tick etc. Exactly
259 * which tick is undefined, as only the interval between calls can be defined.
260 * Ecore will endeavour to keep pollers synchronised and to call as many in
261 * 1 wakeup event as possible.
262 *
263 * This function adds a poller and returns its handle on success and NULL on
264 * failure. The function @p func will be called at tick intervals described
265 * above. The function will be passed the @p data pointer as its parameter.
266 *
267 * When the poller @p func is called, it must return a value of either
268 * 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
269 * returns 1, it will be called again at the next tick, or if it returns
270 * 0 it will be deleted automatically making any references/handles for it
271 * invalid.
272 */
273EAPI Ecore_Poller * 206EAPI Ecore_Poller *
274ecore_poller_add(Ecore_Poller_Type type __UNUSED__, 207ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
275 int interval, 208 int interval,
@@ -307,16 +240,6 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
307 return poller; 240 return poller;
308} 241}
309 242
310/**
311 * Changes the polling interval rate of @p poller.
312 *
313 * @param poller The Ecore_Poller to change the interval of
314 * @param interval The tick interval to set; must be a power of 2 but <= 32768
315 * @return Returns true on success, false on failure
316 *
317 * This allows the changing of a poller's polling interval. It is useful when you want to alter
318 * a poll rate without deleting and re-creating a poller.
319 */
320EAPI Eina_Bool 243EAPI Eina_Bool
321ecore_poller_poller_interval_set(Ecore_Poller *poller, 244ecore_poller_poller_interval_set(Ecore_Poller *poller,
322 int interval) 245 int interval)
@@ -353,14 +276,6 @@ ecore_poller_poller_interval_set(Ecore_Poller *poller,
353 return EINA_TRUE; 276 return EINA_TRUE;
354} 277}
355 278
356/**
357 * Gets the polling interval rate of @p poller.
358 *
359 * @param poller The Ecore_Poller to change the interval of
360 * @return Returns the interval, in ticks, that @p poller polls at
361 *
362 * This returns a poller's polling interval, or 0 on error.
363 */
364EAPI int 279EAPI int
365ecore_poller_poller_interval_get(Ecore_Poller *poller) 280ecore_poller_poller_interval_get(Ecore_Poller *poller)
366{ 281{
@@ -382,15 +297,6 @@ ecore_poller_poller_interval_get(Ecore_Poller *poller)
382 return interval; 297 return interval;
383} 298}
384 299
385/**
386 * Delete the specified poller from the timer list.
387 * @param poller The poller to delete.
388 * @return The data pointer set for the timer when @ref ecore_poller_add was
389 * called. @c NULL is returned if the function is unsuccessful.
390 *
391 * Note: @p poller must be a valid handle. If the poller function has already
392 * returned 0, the handle is no longer valid (and does not need to be delete).
393 */
394EAPI void * 300EAPI void *
395ecore_poller_del(Ecore_Poller *poller) 301ecore_poller_del(Ecore_Poller *poller)
396{ 302{