wireplumber/modules/module-lua-scripting/wplua
George Kiagiadakis 8892204f24 wplua/sandbox: support mixing static methods and constructors in class identifiers
Global class identifiers, such as "Node", "SessionItem", "Conf", etc
are so far defined either as methods, which are constructors for
the GObject class, or as tables, which contain "static" methods, i.e.
methods that can be called without an instance.

In some cases, we may want to mix a class being both instantiatable
with a constructor and also have static methods. To support this,
allow the class identifier be declared as a table with the constructor
being defined as the "__new" method. This change allows calling the
table as a method and execute "__new" underneath.

For instance:
```
json = Conf.get_section_as_json("foobar") -- static method
conf = Conf("/foo/bar") -- constructor, equivalent to Conf.__new("/foo/bar")
```

See also !629
2024-04-09 13:15:50 +00:00
..
boxed.c core: change the component arguments to be WpSpaJson instead of GVariant 2023-05-25 18:29:58 +03:00
closure.c wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
gresource.xml wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
meson.build meson: move the common CFLAGS to project-wide scope 2024-03-09 15:58:01 +02:00
object.c wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
private.h log: implement a log topics system, like pipewire 2023-05-16 20:42:28 +03:00
sandbox.lua wplua/sandbox: support mixing static methods and constructors in class identifiers 2024-04-09 13:15:50 +00:00
userdata.c wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
value.c m-lua-scripting: check argument type is table to avoid crashing 2023-10-13 22:47:57 +03:00
wplua.c log: implement a log topics system, like pipewire 2023-05-16 20:42:28 +03:00
wplua.h lua: sandbox: remove all traces of the minimal_std flag, as it's no longer used 2022-04-23 20:14:59 +03:00