Meta.drop

Drop

class lxu.meta.drop.Drop

Base class for defining Drop servers. The client will subclass this base class, filling in the methods that they require. It’s then instantiated as a metaclass to be promoted to server.

add_custom(name)
enabled(dest)

Called multiple times during drag to determine if this drop server supports the destination under the mouse.

recognize_any(source)

Called once on the start of drag/drop to detect if this drop server supports this source.

recognize_array(array)

Called once on the start of drag/drop to detect if this drop server supports this array source.

DropAction

class lxu.meta.drop.DropAction

Base class for defining Drop actions.

enabled(dest)

Tests if this action is enabled relative to this destination. Simple actions just return true or false; custom actions call add_custom().

exec_act()

Implement to execute the action.

exec_custom(index)

Implement to execute a custom action given by index.

name_msg(msg)

Get the name for the action if it’s different from the name in the message table. The string version is called first, and if that returns null then the message version is used.

name_str()

Get the name for the action if it’s different from the name in the message table. The string version is called first, and if that returns null then the message version is used.

MetaServer

class lxu.meta.drop.MetaServer

The server meta node defines a plug-in server. The name and class guid must be specified, and the alloc() method (defined by the client, returns the server class. There is also a dictionary of server tags.

add(sub)

Add another meta object as a child of this one.

add_tag(key, value)
alloc()

Return the signature for this metaclass. Depends on type.

dump(prefix)

Output the contents of the meta node tree with indenting.

find_any(type, guid, miss)

Find a node with matching type/guid, searching first inside this node but searching higher up the tree until somthing matches.

find_sub(type, guid)

Find first node with a matching type/guid under this node.

flatten()

Return this meta and all sub-metas in a list.

get_ifcs(guid)

Get the list of interfaces matching the given guid under this node. The list is returned as tuples: ((class, meta), …)

init_ifcs(guid)

Initialize the _sub_ifcs attribute as a list of interfaces. If no guid is given we use the metaclass guid itself.

pre_init()

Do any self-modification or other steps before initialization. Return true as long as there is more to do.

set_username(base, key)
test(type, guid)

Test this meta node against a type and guid and return true for match. All testing allows for type or guid to be None for wildcard.

Meta_Drop

class lxu.meta.drop.Meta_Drop

This is the metaclass for the Drop server type.

add(sub)

Add another meta object as a child of this one.

add_action(name, action, custom)

Actions are added one at a time. The name is the key used for the default action name in the message table. Custom drop actions can add their own actions, but are not mappable.

add_tag(key, value)
alloc()

(internal) We set the index of each action and build the tag string that identifies non-custom actions

alloc_inst()

(internal) Allocate the instance and set actions to use it.

dump(prefix)

Output the contents of the meta node tree with indenting.

find_any(type, guid, miss)

Find a node with matching type/guid, searching first inside this node but searching higher up the tree until somthing matches.

find_sub(type, guid)

Find first node with a matching type/guid under this node.

flatten()

Return this meta and all sub-metas in a list.

get_ifcs(guid)

Get the list of interfaces matching the given guid under this node. The list is returned as tuples: ((class, meta), …)

init_ifcs(guid)

Initialize the _sub_ifcs attribute as a list of interfaces. If no guid is given we use the metaclass guid itself.

pre_init()

Do any self-modification or other steps before initialization. Return true as long as there is more to do.

set_source_type(type)
set_username(base, key)
test(type, guid)

Test this meta node against a type and guid and return true for match. All testing allows for type or guid to be None for wildcard.

impl_Server

class lxu.meta.drop.impl_Server

This internal class implements the actual Drop server. It defers to the metaclass state and the client subclass for specific behaviors.

drop_ActionList(source, dest, add)
drop_Drop(source, dest, action)
drop_Preview(source, dest, action, draw)
drop_Recognize(source)