Uli Schlachter
ab4c151ed8
Add signals before using them
...
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 23:00:36 +02:00
Julien Danjou
6d332f07a0
lua{class,object}: rename signals functions
...
I knew this was wrong at the beginning, f*ck.
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Julien Danjou
f523b37e1d
lua{class,object}: {add,remove}_signal() take lua_CFunction as arg
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:14:55 +02:00
Julien Danjou
f7746a198c
luaclass: take care of inheritance garbage collection
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:27:49 +02:00
Uli Schlachter
2b75950a8c
Add some missing class type checks
...
Some functions didn't check the class of objects they were passed but just
casted them to the type they expected. This lead to code like e.g. the following
to crash awesome:
c.titlebar = c
This adds a new function luaA_object_ref_class() which works like
luaA_object_ref(), but which also checks the class of the object.
Additionally, this function is now used in all necessary places.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 13:58:31 +02:00
Brian Gianforcaro
3145e3145e
Grammar/spelling corrections in comments and docs.
...
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00
Julien Danjou
2a252cd4da
luaobject: add signal_object_emit
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou
376c0daaaf
luaobject: add export property macro
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou
dc61d258f0
luaclass: optimize type handling
...
We use lua_class_t pointer as key in the registry to store metatable we
will compare.
lauxlib uses a string, which sucks, because it forces to do a
pushliteral() each time you want to get a metatable from the registry,
which is slower.
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou
5dbae0e34f
luaobject: remove prefix##_push_item()
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou
1cc50b8a29
luaobject: remove useless custom function
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou
537506a0c1
luaclass: add property array handling in classes
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:45:10 +02:00
Julien Danjou
047d04d438
luaobject: import __tostring as object meta function
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 16:09:14 +02:00
Julien Danjou
706d545076
luaclass: register class in an array
...
That should permit class identification.
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:19 +02:00
Julien Danjou
c1d99f0960
luaobject: emit signal on new object
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:18 +02:00
Julien Danjou
dea2b6303a
luaobject: import signals meta methods in objects
...
Signed-off-by: Julien Danjou <julien@danjou.info>
Conflicts:
2009-07-29 15:48:18 +02:00
Julien Danjou
7ecce446ad
luaobject: generate Lua API function for add, remove and emit signal
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:18 +02:00
Julien Danjou
eed9864ab0
luaobject: add signals
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:18 +02:00
Julien Danjou
a1b113901c
luaobject: change global refering method
...
We now store elements in registry:
registry.pointer = userdata
And count references.
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:40:51 +02:00
Julien Danjou
339fb53d56
luaobject: add and use item system
...
Now, each object can store items.
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:29:30 +02:00
Julien Danjou
a8115bd45e
luaobject: ref take index number as argument
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-16 17:15:20 +02:00
Julien Danjou
6b24af7238
luaobject: define an common object and a standard gc
2009-06-16 16:17:31 +02:00
Ciaran McCreesh
933dc50db9
Fix build with assertions enabled.
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-04 08:56:14 +02:00
Julien Danjou
a1480ef7d8
luaobject: import
...
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00