This repository has been archived by the owner on Dec 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,211 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="LuaDefaultObjectMetatable" inherits="LuaObjectMetatable" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
The default LuaObjectMetatable used by the LuaAPI class as the object_metatable value. | ||
</brief_description> | ||
<description> | ||
This metatable by default checks if the object has a lua_fields method. If it does depending on how permissice is set. The listed fields will be allowed or disallowed. | ||
This metatable also checks if the object overrides any of the metamethods, if it does it will call the overridden method. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="permissive" type="bool" setter="set_permissive" getter="get_permissive" default="true"> | ||
Sets weather the Objects lua_fields method is treated as a whitelist or a blacklist. If true, the fields method is treated as a blacklist and returned fields will be disallowed. If false, the fields method is treated as a whitelist and returned fields will be allowed. | ||
</member> | ||
</members> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="LuaObjectMetatable" inherits="RefCounted" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> | ||
<brief_description> | ||
Represents a Lua Object Metatable. | ||
</brief_description> | ||
<description> | ||
This interface class allows for the definition of lua metamethods to be used for an objects metatable. Objects can define a [code]lua_metatable[/code] property that returns a LuaObjectMetatable. This metatable will be used for the object when it is passed to Lua. If one does not exists the luaAPI.object_metatable will be used instead. | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="__add" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The addition (+) operation. If any operand for an addition is not a number, Lua will try to call a metamethod. It starts by checking the first operand (even if it is a number); if that operand does not define a metamethod for __add, then Lua will check the second operand. If Lua can find a metamethod, it calls the metamethod with the two operands as arguments, and the result of the call (adjusted to one value) is the result of the operation. Otherwise, if no metamethod is found, Lua raises an error. | ||
</description> | ||
</method> | ||
<method name="__band" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The bitwise AND (&) operation. Behavior similar to the addition operation, except that Lua will try a metamethod if any operand is neither an integer nor a float coercible to an integer | ||
</description> | ||
</method> | ||
<method name="__bnot" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
The bitwise NOT (unary ~) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__bor" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The bitwise OR (|) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__bxor" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The bitwise exclusive OR (binary ~) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__call" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="args" type="LuaTuple" /> | ||
<description> | ||
The bitwise NOT (unary ~) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__concat" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The concatenation (..) operation. Behavior similar to the addition operation, except that Lua will try a metamethod if any operand is neither a string nor a number (which is always coercible to a string). | ||
</description> | ||
</method> | ||
<method name="__div" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The division (/) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__eq" qualifiers="virtual"> | ||
<return type="bool" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The equal (==) operation. Behavior similar to the addition operation, except that Lua will try a metamethod only when the values being compared are either both tables or both full userdata and they are not primitively equal. The result of the call is always converted to a boolean. | ||
</description> | ||
</method> | ||
<method name="__gc" qualifiers="virtual"> | ||
<return type="LuaError" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
https://www.lua.org/manual/5.4/manual.html#2.5.3 | ||
</description> | ||
</method> | ||
<method name="__idiv" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The floor division (//) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__index" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="index" type="String" /> | ||
<description> | ||
The indexing access operation table[key]. This event happens when table is not a table or when key is not present in table. The metavalue is looked up in the metatable of table. | ||
|
||
The metavalue for this event can be either a function, a table, or any value with an __index metavalue. If it is a function, it is called with table and key as arguments, and the result of the call (adjusted to one value) is the result of the operation. Otherwise, the final result is the result of indexing this metavalue with key. This indexing is regular, not raw, and therefore can trigger another __index metavalue. | ||
</description> | ||
</method> | ||
<method name="__le" qualifiers="virtual"> | ||
<return type="bool" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The less equal (<=) operation. Behavior similar to the less than operation. | ||
</description> | ||
</method> | ||
<method name="__len" qualifiers="virtual"> | ||
<return type="int" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
The length (#) operation. If the object is not a string, Lua will try its metamethod. If there is a metamethod, Lua calls it with the object as argument, and the result of the call (always adjusted to one value) is the result of the operation. If there is no metamethod but the object is a table, then Lua uses the table length operation. Otherwise, Lua raises an error. | ||
</description> | ||
</method> | ||
<method name="__lt" qualifiers="virtual"> | ||
<return type="bool" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The less than (<) operation. Behavior similar to the addition operation, except that Lua will try a metamethod only when the values being compared are neither both numbers nor both strings. Moreover, the result of the call is always converted to a boolean. | ||
</description> | ||
</method> | ||
<method name="__metatable" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a __metatable field, returns the associated value. Otherwise, returns the metatable of the given object. | ||
</description> | ||
</method> | ||
<method name="__mod" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The modulo (%) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__mul" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The multiplication (*) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__newindex" qualifiers="virtual"> | ||
<return type="LuaError" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="index" type="String" /> | ||
<param index="3" name="value" type="Variant" /> | ||
<description> | ||
The indexing assignment table[key] = value. Like the index event, this event happens when table is not a table or when key is not present in table. The metavalue is looked up in the metatable of table. | ||
|
||
Like with indexing, the metavalue for this event can be either a function, a table, or any value with an __newindex metavalue. If it is a function, it is called with table, key, and value as arguments. Otherwise, Lua repeats the indexing assignment over this metavalue with the same key and value. This assignment is regular, not raw, and therefore can trigger another __newindex metavalue. | ||
|
||
Whenever a __newindex metavalue is invoked, Lua does not perform the primitive assignment. If needed, the metamethod itself can call rawset to do the assignment. | ||
</description> | ||
</method> | ||
<method name="__pow" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The exponentiation (^) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__shl" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The bitwise left shift (<<) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__shr" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The bitwise right shift (>>) operation. Behavior similar to the bitwise AND operation. | ||
</description> | ||
</method> | ||
<method name="__sub" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<param index="2" name="other" type="Variant" /> | ||
<description> | ||
The subtraction (-) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
<method name="__tostring" qualifiers="virtual"> | ||
<return type="String" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
The tostring operation. Used when tostring is called on the object. | ||
</description> | ||
</method> | ||
<method name="__unm" qualifiers="virtual"> | ||
<return type="Variant" /> | ||
<param index="0" name="obj" type="Object" /> | ||
<param index="1" name="lua" type="LuaAPI" /> | ||
<description> | ||
The negation (unary -) operation. Behavior similar to the addition operation. | ||
</description> | ||
</method> | ||
</methods> | ||
|
||
</methods> | ||
<members> | ||
</members> | ||
<constants> | ||
</constants> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.