WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=83d2776805041e3ed870eb4451b9a120cc3e1369

commit 83d2776805041e3ed870eb4451b9a120cc3e1369
Author: Lauro Moura <lauromo...@expertisesolutions.com.br>
Date:   Fri Dec 11 14:31:29 2015 -0800

    Wiki page event changed with summary [] by Lauro Moura
---
 pages/api/javascript/ecore/event.txt | 174 ++++++++++++++++++++++++++---------
 1 file changed, 128 insertions(+), 46 deletions(-)

diff --git a/pages/api/javascript/ecore/event.txt 
b/pages/api/javascript/ecore/event.txt
index c39f3bc..2d202f3 100644
--- a/pages/api/javascript/ecore/event.txt
+++ b/pages/api/javascript/ecore/event.txt
@@ -2,137 +2,219 @@
 
 [[api:javascript:ecore|Back to the JS Ecore page]]
 
-WORKINPROGRESS
+**DRAFT**
+
+Ecore events provide two main features that are of use to those using ecore: 
creating events and being notified of events.
+
+Those two will usually be used in different contexts, creating events is 
mainly done by libraries wrapping some system functionality while being 
notified of events is mainly a necessity of applications.
+
+For a program to be notified of events it's interested in it needs to have a 
function to process the event and to register that function as the callback to 
the event, that's all.
 
 ==== Constants ====
 
 === Signal type ===
 
-   * ''efl.Ecore.Event.NONE''
-   * ''efl.Ecore.Event.SIGNAL_USER''
-   * ''efl.Ecore.Event.SIGNAL_HUP''
-   * ''efl.Ecore.Event.SIGNAL_EXIT''
-   * ''efl.Ecore.Event.SIGNAL_POWER''
-   * ''efl.Ecore.Event.SIGNAL_REALTIME''
+   * ''efl.Ecore.Event.NONE'' - None event.
+   * ''efl.Ecore.Event.SIGNAL_USER'' - User signal event.
+   * ''efl.Ecore.Event.SIGNAL_HUP'' - Hup signal event.
+   * ''efl.Ecore.Event.SIGNAL_EXIT'' - Exit signal event.
+   * ''efl.Ecore.Event.SIGNAL_POWER'' - Power signal event.
+   * ''efl.Ecore.Event.SIGNAL_REALTIME'' - Realtime signal event.
 
 === Hardware state ===
 
-   * ''efl.Ecore.Event.MEMORY_STATE''
-   * ''efl.Ecore.Event.POWER_STATE''
+   * ''efl.Ecore.Event.MEMORY_STATE'' - Memory state changed.
+   * ''efl.Ecore.Event.POWER_STATE'' - Power state changed.
 
-   * ''efl.Ecore.Event.MEMORY_STATE_NORMAL''
-   * ''efl.Ecore.Event.MEMORY_STATE_LOW''
+   * ''efl.Ecore.Event.MEMORY_STATE_NORMAL'' - Memory state normal.
+   * ''efl.Ecore.Event.MEMORY_STATE_LOW'' - Memory state low.
 
-   * ''efl.Ecore.Event.POWER_STATE_MAINS''
-   * ''efl.Ecore.Event.POWER_STATE_BATTERY''
-   * ''efl.Ecore.Event.POWER_STATE_LOW''
+   * ''efl.Ecore.Event.POWER_STATE_MAINS'' - Connected to power supply.
+   * ''efl.Ecore.Event.POWER_STATE_BATTERY'' - Running on battery power.
+   * ''efl.Ecore.Event.POWER_STATE_LOW'' - Low on battery power.
 
 === Changes ===
 
-   * ''efl.Ecore.Event.LOCALE_CHANGED''
-   * ''efl.Ecore.Event.HOSTNAME_CHANGED''
-   * ''efl.Ecore.Event.SYSTEM_TIMEDATE_CHANGED''
+   * ''efl.Ecore.Event.LOCALE_CHANGED'' - System locale changed.
+   * ''efl.Ecore.Event.HOSTNAME_CHANGED'' - System hostname changed.
+   * ''efl.Ecore.Event.SYSTEM_TIMEDATE_CHANGED'' - System time and date 
changed.
 
 ==== Functions ====
 
-=== add() ===
+=== add(type) ===
 
 Syntax
 
 <code javascript>
+var event = efl.Ecore.Event.add(type)
 </code>
 
 Parameters
 
-   * parameter
+   * type - The event type to add to the end of the event queue.
 
-Return type
+Return value
 
-   * return type
+   * object - An object wrapping the event.
 
-Lorem ipsum...
+If it succeeds, an event of type type will be added to the queue for 
processing by event handlers added by ''efl.Ecore.Event.addHandler()''. You can 
call ''del()'' on the returned object to cancel the event.
 
-=== addHandler() ===
+=== addFilter(func_start, func_filter, func_end) ===
 
 Syntax
 
 <code javascript>
+function func_start() {...};
+function func_filter(loop_data, eventType) {...};
+function func_end(loop_data) {...};
+efl.Ecore.Event.addFilter(func_start, func_filter, func_end)
 </code>
 
 Parameters
 
-   * parameter
+   * func_start - Function to call just before filtering and return data.
+   * func_filter - Function to call on each event.
+   * func_end - Function to call after the queue has been filtered.
 
-Return type
+Return value
 
-   * return type
+   * object - A filter handle on success, NULL otherwise.
 
-Lorem ipsum...
+Adds a callback to filter events from the event queue. Filters are called on 
the queue just before Event handler processing to try and remove redundant 
events. Just as processing is about to start ''func_start'' is called, the 
return value of this functions is passed to ''func_filter'' as ''loop_data''. 
''func_filter'' is also passed the event type. If this ''func_filter'' returns 
''false'', the event is removed from the queue, if it returns ''true'', the 
event is kept. When processing i [...]
 
-=== getCurrentType() ===
+=== addHandler(type, func) ===
 
 Syntax
 
 <code javascript>
+function mycallback(type) { ... };
+var handler = efl.Ecore.Event.addHandler(type, mycallback);
 </code>
 
 Parameters
 
-   * parameter
+   * type - The type of the event this handler will get called for.
+   * func - The function to call when the event is found in the queue.
 
-Return type
+Return value
 
-   * return type
+   * object - A new Event handler, or NULL on failure.
 
-Lorem ipsum...
+Add an event handler to the list of handlers. This will, on success, return a 
handle to the event handler object that was created, that can be used later to 
remove the handler using the ''del()'' method on it. The type parameter is the 
integer of the event type that will trigger this callback to be called. The 
callback func is called when this event is processed and will be passed the 
event type.
 
-=== addSignalUserHandler() ===
+=== addSignalUserHandler(callback) ===
 
 Syntax
 
 <code javascript>
+function mycallback(type) { ... };
+var handler = efl.Ecore.Event.addSignalUserHandler(mycallback);
 </code>
 
 Parameters
 
-   * parameter
+   * func - The function to call when the event is found in the queue.
 
-Return type
+Return value
 
-   * return type
+   * object - A new Event handler, or NULL on failure.
 
-Lorem ipsum...
+Adds an event handler for the ''efl.Ecore.Event.SIGNAL_USER'' event type.
 
-=== addSignalExitHandler() ===
+=== addSignalExitHandler(callback) ===
 
 Syntax
 
 <code javascript>
+function mycallback(type) { ... };
+var handler = efl.Ecore.Event.addSignalExitHandler(mycallback);
 </code>
 
 Parameters
 
-   * parameter
+   * func - The function to call when the event is found in the queue.
 
-Return type
+Return value
 
-   * return type
+   * object - A new Event handler, or NULL on failure.
 
-Lorem ipsum...
+Adds an event handler for the ''efl.Ecore.Event.SIGNAL_EXIT'' event type.
 
 === addSignalRealtimeHandler() ===
 
 Syntax
 
 <code javascript>
+function mycallback(type) { ... };
+var handler = efl.Ecore.Event.addSignalRealtimeHandler(mycallback);
 </code>
 
 Parameters
 
-   * parameter
+   * func - The function to call when the event is found in the queue.
+
+Return value
+
+   * object - A new Event handler, or NULL on failure.
+
+Adds an event handler for the ''efl.Ecore.Event.SIGNAL_REALTIME'' event type.
+
+=== getCurrentType() ===
+
+Syntax
+
+<code javascript>
+var type = efl.Ecore.Event.getCurrentType()
+</code>
+
+Return value
+
+   * integer - The current event type being handled if inside a handler 
callback, ''efl.Ecore.Event.NONE'' otherwise.
+
+If the program is currently inside an Ecore event handler callback this will 
return the type of the current event being processed.
+
+=== newType() ===
+
+Syntax
+
+<code javascript>
+var eventType = efl.Ecore.Event.newType()
+</code>
 
-Return type
+Return value
 
-   * return type
+   * integer - A new event type id.
+
+This function allocates a new event type id and returns it. Once an event type 
has been allocated it can never be de-allocated during the life of the program. 
There is no guarantee of the contents of this event ID, or how it is 
calculated, except that the ID will be unique to the current instance of the 
process.
+
+==== Methods ====
+
+=== eventObj.del() ===
+
+Syntax
+
+<code javascript>
+eventObj.del();
+</code>
+
+Deletes from the queue an event that was added through ''efl.Ecore.Event.add''.
+
+=== filterObj.del() ===
+
+Syntax
+
+<code javascript>
+filterObj.del();
+</code>
+
+Deletes from the queue an filter that was added through 
''efl.Ecore.Event.addFilter''.
+
+=== handlerObj.del() ===
+
+Syntax
+
+<code javascript>
+handlerObj.del();
+</code>
 
-Lorem ipsum...
+Deletes from the queue an handler that was added through 
''efl.Ecore.Event.addHandler'' & friends.

-- 


Reply via email to