aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorv-rob <robinsonvincent89@gmail.com>2020-05-06 10:36:02 -0700
committerGitHub <noreply@github.com>2020-05-06 19:36:02 +0200
commit664800b2adda44039a85c3566b4ed958abff8b95 (patch)
treeeebc1a69335938833321ddb3cd6382b26e58db99 /doc
parent4f9a5f67ee745d78fdc3e173972a3df110f989cf (diff)
downloadminetest-664800b2adda44039a85c3566b4ed958abff8b95.tar.gz
minetest-664800b2adda44039a85c3566b4ed958abff8b95.tar.bz2
minetest-664800b2adda44039a85c3566b4ed958abff8b95.zip
FormSpec: Add universal style selector `*` (#9718)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 948e0f89e..961e1ff37 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2567,7 +2567,7 @@ Elements
* Set the style for the element(s) matching `selector` by name.
* `selector` can be one of:
- * `<name>` - An element name.
+ * `<name>` - An element name. Includes `*`, which represents every element.
* `<name>:<state>` - An element name, a colon, and one or more states.
* `state` is a list of states separated by the `+` character.
* If a state is provided, the style will only take effect when the element is in that state.
@@ -2580,7 +2580,7 @@ Elements
* Set the style for the element(s) matching `selector` by type.
* `selector` can be one of:
- * `<type>` - An element type.
+ * `<type>` - An element type. Includes `*`, which represents every element.
* `<type>:<state>` - An element type, a colon, and one or more states.
* `state` is a list of states separated by the `+` character.
* If a state is provided, the style will only take effect when the element is in that state.
@@ -2647,6 +2647,8 @@ A name/type can optionally be a comma separated list of names/types, like so:
world_delete,world_create,world_configure
button,image_button
+A `*` type can be used to select every element in the formspec.
+
Any name/type in the list can also be accompanied by a `+`-separated list of states, like so:
world_delete:hovered+pressed
l com"> You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #pragma once #include <cassert> #include "threading/thread.h" #include "connection.h" namespace con { class Connection; class ConnectionSendThread : public Thread { public: friend class UDPPeer; ConnectionSendThread(unsigned int max_packet_size, float timeout); void *run(); void Trigger(); void setParent(Connection *parent) { assert(parent != NULL); // Pre-condition m_connection = parent; } void setPeerTimeout(float peer_timeout) { m_timeout = peer_timeout; } private: void runTimeouts(float dtime); void rawSend(const BufferedPacket &packet); bool rawSendAsPacket(session_t peer_id, u8 channelnum, const SharedBuffer<u8> &data, bool reliable); void processReliableCommand(ConnectionCommand &c); void processNonReliableCommand(ConnectionCommand &c); void serve(Address bind_address); void connect(Address address); void disconnect(); void disconnect_peer(session_t peer_id); void send(session_t peer_id, u8 channelnum, const SharedBuffer<u8> &data); void sendReliable(ConnectionCommand &c); void sendToAll(u8 channelnum, const SharedBuffer<u8> &data); void sendToAllReliable(ConnectionCommand &c); void sendPackets(float dtime); void sendAsPacket(session_t peer_id, u8 channelnum, const SharedBuffer<u8> &data, bool ack = false); void sendAsPacketReliable(BufferedPacket &p, Channel *channel); bool packetsQueued(); Connection *m_connection = nullptr; unsigned int m_max_packet_size; float m_timeout; std::queue<OutgoingPacket> m_outgoing_queue; Semaphore m_send_sleep_semaphore; unsigned int m_iteration_packets_avaialble; unsigned int m_max_commands_per_iteration = 1; unsigned int m_max_data_packets_per_iteration; unsigned int m_max_packets_requeued = 256; }; class ConnectionReceiveThread : public Thread { public: ConnectionReceiveThread(unsigned int max_packet_size); void *run(); void setParent(Connection *parent) { assert(parent); // Pre-condition m_connection = parent; } private: void receive(SharedBuffer<u8> &packetdata, bool &packet_queued); // Returns next data from a buffer if possible // If found, returns true; if not, false. // If found, sets peer_id and dst bool getFromBuffers(session_t &peer_id, SharedBuffer<u8> &dst); bool checkIncomingBuffers( Channel *channel, session_t &peer_id, SharedBuffer<u8> &dst); /* Processes a packet with the basic header stripped out. Parameters: packetdata: Data in packet (with no base headers) peer_id: peer id of the sender of the packet in question channelnum: channel on which the packet was sent reliable: true if recursing into a reliable packet */ SharedBuffer<u8> processPacket(Channel *channel, const SharedBuffer<u8> &packetdata, session_t peer_id, u8 channelnum, bool reliable); SharedBuffer<u8> handlePacketType_Control(Channel *channel, const SharedBuffer<u8> &packetdata, Peer *peer, u8 channelnum, bool reliable); SharedBuffer<u8> handlePacketType_Original(Channel *channel, const SharedBuffer<u8> &packetdata, Peer *peer, u8 channelnum, bool reliable); SharedBuffer<u8> handlePacketType_Split(Channel *channel, const SharedBuffer<u8> &packetdata, Peer *peer, u8 channelnum, bool reliable); SharedBuffer<u8> handlePacketType_Reliable(Channel *channel, const SharedBuffer<u8> &packetdata, Peer *peer, u8 channelnum, bool reliable); struct PacketTypeHandler { SharedBuffer<u8> (ConnectionReceiveThread::*handler)(Channel *channel, const SharedBuffer<u8> &packet, Peer *peer, u8 channelnum, bool reliable); }; static const PacketTypeHandler packetTypeRouter[PACKET_TYPE_MAX]; Connection *m_connection = nullptr; }; }