Module gwy :: Class VectorLayer
[hide private]
[frames] | no frames]

Class VectorLayer

source code

Instance Methods [hide private]
 
set_selection_key(key)
Sets the selection object to use by a vector layer.
source code
 
get_selection_key()
Gets the key identifying selection this vector layer displays.
source code
 
ensure_selection()
Ensures a vector layer's selection exist in data container.
source code
 
get_focus()
Gets focused object index.
source code
 
set_focus(focus)
Focues on one selection object.
source code
 
get_editable()
Gets editability of a vector layer.
source code
 
set_editable(editable)
Sets a vector layer editability.
source code
 
UNIMPLEMENTED_draw(drawable, target)
Draws layer on given drawable (which should be a DataView window).
source code
 
UNIMPLEMENTED_button_press(event)
Sends a mouse button press event to a layer.
source code
 
UNIMPLEMENTED_button_release(event)
Sends a mouse button release event to a layer.
source code
 
UNIMPLEMENTED_motion_notify(event)
Sends a mouse pointer motion notification event to a layer.
source code
 
UNIMPLEMENTED_key_press(event)
Sends a key press event to a layer.
source code
 
UNIMPLEMENTED_key_release(event)
Sends a key release event to a layer.
source code
 
object_chosen(id)
Emits "object-chosen" signal on a vector layer.
source code
Method Details [hide private]

set_selection_key(key)

source code 

Sets the selection object to use by a vector layer.

Parameters:
  • key - Container string key identifying the selection object. (string)

get_selection_key()

source code 

Gets the key identifying selection this vector layer displays.

Returns:
The string key, or NULL if it isn't set.

ensure_selection()

source code 

Ensures a vector layer's selection exist in data container.

This method can be called only when layer is plugged into a data view and it has a selection key set. If the data container contains a selection under the specified key the selection is returned. If there is none, a selection of appropriate type is created and put to the container first.

Provided the above conditions are met this method is suitable for just obtaining the selection object a vector layer uses too.

Returns:
The layer's selection (no reference is added).

get_focus()

source code 

Gets focused object index.

Returns:
Focued object index, or -1 if no object is focused.

set_focus(focus)

source code 

Focues on one selection object.

When a selection object is focused, it becomes the only one user can interact with. More precisely, "object-chosen" signal is emitted only for this object, and if the layer is editable only this object can be modified by the user.

Parameters:
  • focus - Index of object to focus on, use -1 to unfocus (allow interaction with any object). (int)
Returns:
True if the object was focused, False on failure. Failure can be caused by user currently moving another object, wrong object index, or the feature being unimplemented in layer.

get_editable()

source code 

Gets editability of a vector layer.

Returns:
True if layer is edtiable, False if it is not editable.

set_editable(editable)

source code 

Sets a vector layer editability.

It is an error to attempt to set a layer non-editabile while it is being edited.

When a layer is set noneditable, the user cannot change the selection. However, "object-chosen" signal is still emitted.

Parameters:
  • editable - True to set layer editable, False to set it noneditable. (bool)

UNIMPLEMENTED_draw(drawable, target)

source code 

Draws layer on given drawable (which should be a DataView window).

Parameters:
  • drawable - A drawable to draw on. (GdkDrawable*)
  • target - Rendering target. (RenderingTarget)

UNIMPLEMENTED_button_press(event)

source code 

Sends a mouse button press event to a layer.

This method primarily exists for DataView to forward events to layers. You should rarely need it.

Parameters:
  • event - A Gdk mouse button event. (GdkEventButton*)
Returns:
True if the event was handled. In practice, it returns False.

UNIMPLEMENTED_button_release(event)

source code 

Sends a mouse button release event to a layer.

This method primarily exists for DataView to forward events to layers. You should rarely need it.

Parameters:
  • event - A Gdk mouse button event. (GdkEventButton*)
Returns:
True if the event was handled. In practice, it returns False.

UNIMPLEMENTED_motion_notify(event)

source code 

Sends a mouse pointer motion notification event to a layer.

This method primarily exists for DataView to forward events to layers. You should rarely need it.

Parameters:
  • event - A Gdk mouse pointer motion notification event. It can be a hint. (GdkEventMotion*)
Returns:
True if the event was handled. In practice, it returns False.

UNIMPLEMENTED_key_press(event)

source code 

Sends a key press event to a layer.

This method primarily exists for DataView to forward events to layers. You should rarely need it.

Parameters:
  • event - A Gdk key event. (GdkEventKey*)
Returns:
True if the event was handled. In practice, it returns False.

UNIMPLEMENTED_key_release(event)

source code 

Sends a key release event to a layer.

This method primarily exists for DataView to forward events to layers. You should rarely need it.

Parameters:
  • event - A Gdk key event. (GdkEventKey*)
Returns:
True if the event was handled. In practice, it returns False.

object_chosen(id)

source code 

Emits "object-chosen" signal on a vector layer.

This function is primarily intended for layer implementations.

Parameters:
  • id - Index of the chosen object. (int)