* Document mouse event callback system in LUA
authordavemds <davemds@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 9 Mar 2010 00:55:36 +0000 (00:55 +0000)
committerdavemds <davemds@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 9 Mar 2010 00:55:36 +0000 (00:55 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@47063 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

doc/Doxyfile
src/lib/edje_lua.c

index c9c7dd6..2cd7cc9 100644 (file)
@@ -194,6 +194,7 @@ ALIASES               += edcsection{2}="<tr class=\"section\"><td class=\"sectio
 ALIASES               += luaclass{2}="\anchor \1 \n<div class=\"luaclass\">\2</div>"
 ALIASES               += attributes="<div class=\"luaattrib\">Attributes:</div>"
 ALIASES               += methods="<div class=\"luaattrib\">Methods:</div>"
+ALIASES               += events="<div class=\"luaattrib\">Events:</div>"
 ALIASES               += setters="<div class=\"luaattrib\">Setters:</div>"
 ALIASES               += seealso{2}="<b>See also:</b> <a href='\2'>\1</a>\n"
 ALIASES               += seealso{1}="<b>See also:</b> \1\n"
index 5cb8ba4..652748c 100644 (file)
@@ -1373,8 +1373,28 @@ const luaL_Reg lTransition_fn[] = {
 @page luaref
 @luaclass{Object,General Object Class}
 
-Within the lua_script scope, Edje objects (groups, parts, etc) have the
-following basic attributes and methods:
+This is the base class, many other classes are children of this.
+
+You can attach event callbacks to this class using a classic c approach:
+@code
+function mouse_move_cb(self, ...)
+    print("mouse_move", ...)
+end
+
+rect = ed:rectangle()
+rect.mouse_events = true
+rect.mouse_move = mouse_move_cb
+@endcode
+or you can also do the same in a more lua-fashion style
+@code
+rect = ed:rectangle {
+    mouse_events = true,
+    mouse_move = function (self, ...)
+                    print ('mouse_move', ...)
+                 end
+}
+@endcode
+
 
 @seealso{Evas Object Docs,http://docs.enlightenment.org/auto/evas/group__Evas__Object__Group.html}
 */
@@ -2326,6 +2346,16 @@ const luaL_Reg lObject_set[] = {
    {"mouse_events", _edje_lua_object_set_mouse_events},
    {NULL, NULL}                        // sentinel
 };
+/**
+@page luaref
+@events
+@li Object.mouse_in: func(self,output_x,output_y,canvas_x,canvas_y)
+@li Object.mouse_out: func(self,output_x,output_y,canvas_x,canvas_y)
+@li Object.mouse_down: func(self,button,output_x,output_y,canvas_x,canvas_y)
+@li Object.mouse_up: func(self,button,output_x,output_y,canvas_x,canvas_y)
+@li Object.mouse_move: func(self,buttons,output_x,output_y,canvas_x,canvas_y)
+@li Object.mouse_wheel: func(self,z,output_x,output_y,canvas_x,canvas_y)
+*/
 
 const Edje_Lua_Reg *cRectangle[] = {
    &mClass,