summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_loop.eo
blob: 283d583e006eddf3fcf3185592e9e3ce596d65a0 (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
class Efl.Loop (Eo.Base)
{
   [[The Efl Main Loop

   Efl main loop provide a clean and tiny event loop library with many modules to
   do lots of convenient things for a programmer, to save time and effort. It's
   small and lean, designed to work from embedded systems all the way up to large
   and powerful multi-cpu workstations. The main loop has a number of primitives to
   be used with its main loop. It serializes all the primitives and allows for
   great responsiveness without the need for threads (or any other concurrency), but
   provide them if you need to.
   ]]
   legacy_prefix: null;
   methods {
      iterate {
         [[Runs a single iteration of the main loop to process everything on the
         queue.]]
      }
      iterate_may_block {
      	 [[Runs a single iteration of the main loop to process everything on the
      	 queue with block/non-blocking status.]]
         return: int;
         params {
            may_block: int; [[A flag if the main loop has a possibility of blocking.]]
         }
      }
      begin {
         [[Runs the application main loop.]]
      }
      quit {
         [[Quits the main loop once all the events currently on the queue have
         been processed.]]
      }
      job {
         [[Will execute that promise in the near future.]]
         params {
            @inout promise: promise<void*>*; [[The promise that will be triggered.]]
	    @in data: const(void)* @optional; [[The data to be given when the promise is done.]]
	 }
      }
      timeout {
         [[Will trigger this promise when the specified timeout occur.]]
	 params {
            @inout promise: promise<void*>*; [[The promise that will be triggered.]]
	    @in time: double; [[The time from now in second that the main loop will wait before triggering it.]]
	    @in data: const(void)* @optional; [[The data to be given when the promise is done.]]
	 }
      }
   }
   events {
      idle,enter @restart; [[Event occurs once the main loop enters the idle state.]]
      idle,exit @restart; [[Event occurs once the main loop exits the idle state.]]
      idle @restart; [[Event occurs once the main loop is idler. Be carefull, this will spin your CPU high if you keep listening on this event.]]
      /* TODO: All of the legacy ecore events. (Ecore.h header) */
   }
   implements {
      Eo.Base.constructor;
      Eo.Base.provider_find;
   }
}