Package libavg :: Module avg :: Class AreaNode

Class AreaNode


Base class for elements in the avg tree that define an area on the screen. Is responsible for coordinate transformations and event handling.

Instance Methods
AreaNode
getElementByPos(pos)
Returns the topmost child node that is at the position given.
mediasize
getMediaSize()
Returns the size in pixels of the media in the node.

Inherited from unreachable.instance: __new__

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

    Inherited from Node
 
__eq__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
__ne__(...)
abspos
getAbsPos(relpos)
Transforms a position in coordinates relative to the node to a position in window coordinates.
node
getParent()
Returns the container (AVGNode or DivNode) the node is in.
relpos
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.
None
unlink(kill)
Removes a node from it's parent container.
Properties
  angle
The angle that the node is rotated to in radians.
  height
  pivot
The position of the point that the node is rotated around.
  pivotx
Deprecated.
  pivoty
Deprecated.
  pos
The position of the node's top left corner relative to it's parent node.
  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__

    Inherited from Node
  active
If this attribute is true, the node behaves as usual.
  id
A unique identifier that can be used to reference the node.
  opacity
A measure of the node's transparency.
  sensitive
A node only reacts to events if sensitive is true.
Method Details

getElementByPos(pos)

 

Returns the topmost child node that is at the position given. pos is in coordinates relative to the called node. The algorithm used is the same as the cursor hit test algorithm used for events.

Returns: AreaNode

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 return the video size if decoding has started or (0,0) if not. Decoding starts after play() or pause() is called and the node can be rendered.

Returns: mediasize

Property Details

angle

The angle that the node is rotated to in radians. 0 is unchanged, 3.14 is upside-down.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

height

Get Method:
unreachable(...)
Set Method:
unreachable(...)

pivot

The position of the point that the node is rotated around. Default is the center of the node.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

pivotx

Deprecated.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

pivoty

Deprecated.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

pos

The position of the node's top left corner relative to it's parent node.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

size

Get Method:
unreachable(...)
Set Method:
unreachable(...)

width

Get Method:
unreachable(...)
Set Method:
unreachable(...)

x

The position of the node's left edge relative to it's parent node.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

y

The position of the node's top edge relative to it's parent node.

Get Method:
unreachable(...)
Set Method:
unreachable(...)