Package libavg :: Module avg :: Class Node

Class Node




Base class for all elements in the avg tree.

Instance Methods
 
__eq__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
__ne__(...)
 
getAbsPos(relpos)
Transforms a position in coordinates relative to the node to a position in window coordinates.
 
getMediaSize()
Returns the size in pixels of the media in the node.
 
getParent()
Returns the container (AVGNode or DivNode) the node is in.
 
getRelPos(abspos)
Transforms a position in window coordinates to a position in coordinates relative to the node.
 
releaseEventCapture(cursorid)
Restores normal mouse operation after a call to setEventCapture().
 
setEventCapture(cursorid)
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position.
 
setEventHandler(type, source, pyfunc)
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs.
 
unlink()
Removes a node from it's parent container.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties
  active
If this attribute is true, the node behaves as usual.
  angle
The angle that the node is rotated to in radians.
  height
  id
A unique identifier that can be used to reference the node.
  opacity
A measure of the node's transparency.
  pivotx
x coordinate of the point that the node is rotated around.
  pivoty
y coordinate of the point that the node is rotated around.
  pos
The position of the node's top left corner relative to it's parent node.
  sensitive
A node only reacts to events if sensitive is true.
  size
  width
  x
The position of the node's left edge relative to it's parent node.
  y
The position of the node's top edge relative to it's parent node.

Inherited from object: __class__

Method Details

__hash__(...)
(Hashing function)

 
hash(x)
Overrides: object.__hash__
(inherited documentation)

__init__(...)
(Constructor)

 
Raises an exception This class cannot be instantiated from Python
Overrides: object.__init__

getAbsPos(relpos)

 
Transforms a position in coordinates relative to the node to a position in window coordinates.
Parameters:
  • relpos - Relative coordinate to transform.
Returns:
abspos

getMediaSize()

 
Returns the size in pixels of the media in the node. Image nodes return the bitmap size, Camera nodes the size of a camera frame and Words nodes the amount of space the text takes. Video nodes the video size if decoding has started or (0,0) if not.
Returns:
mediasize

getParent()

 
Returns the container (AVGNode or DivNode) the node is in. For the root node, returns None.
Returns:
node

getRelPos(abspos)

 
Transforms a position in window coordinates to a position in coordinates relative to the node.
Parameters:
  • abspos - Absolute coordinate to transform.
Returns:
relpos

releaseEventCapture(cursorid)

 
Restores normal mouse operation after a call to setEventCapture().
Parameters:
  • cursorid - The id of the tracker cursor to release (optional).

setEventCapture(cursorid)

 
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position. cursorid is optional; if left out, the mouse cursor is captured. If not, events from a specific tracker cursor are captured. If the node doesn't handle the event, it propagates to its parent normally. This function is useful for the implementation of user interface elements such as scroll bars. Only one node can capture a cursor at any one time. Normal operation can be restored by calling releaseEventCapture().
Parameters:
  • cursorid - The id of the tracker cursor to capture (optional).

setEventHandler(type, source, pyfunc)

 
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs. This function is similar to the event handler node attributes (e.g. oncursordown). It is more specific since it takes the event source as a parameter and allows the use of any python callable as callback function.
Parameters:
  • type - One of the event types KEYUP, KEYDOWN, CURSORMOTION, CURSORUP, CURSORDOWN, CURSOROVER, CURSOROUT, RESIZE or QUIT.
  • source - MOUSE for mouse events, TOUCH for multitouch touch events, TRACK for multitouch track events or other tracking, NONE for keyboard events. Sources can be or'ed together to set a handler for several sources at once.
  • pyfunc - The python callable to invoke.

unlink()

 
Removes a node from it's parent container. Equivalent to node.getParent().removeChild(node.getParent().indexOf(node)).
Returns:
None


Property Details

active

If this attribute is true, the node behaves as usual. If not, it is neither drawn nor does it react to events. Videos are paused.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

angle

The angle that the node is rotated to in radians. 0 is unchanged, 3.14 is upside-down.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

height

Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

id

A unique identifier that can be used to reference the node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

opacity

A measure of the node's transparency. 0.0 is completely transparent, 1.0 is completely opaque. Opacity is relative to the parent node's opacity.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

pivotx

x coordinate of the point that the node is rotated around. Default is the center of the node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

pivoty

y coordinate of the point that the node is rotated around. Default is the center of the node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

pos

The position of the node's top left corner relative to it's parent node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

sensitive

A node only reacts to events if sensitive is true.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

size

Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

width

Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

x

The position of the node's left edge relative to it's parent node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

y

The position of the node's top edge relative to it's parent node.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)