CanvasItem
Object Hierarchy:
Description:
CanvasItem defines the interface that canvas items must implement, and contains methods for operating on canvas items.
All known implementing classes:
Namespace: Goo
Package: goocanvas-2.0
Content:
Properties:
- public abstract bool can_focus { get; set; }
- public abstract string description { owned get; set; }
- public abstract CanvasItem parent { get; set; }
- public abstract CanvasPointerEvents pointer_events { get; set; }
- public abstract string title { owned get; set; }
- public abstract string tooltip { owned get; set; }
The tooltip to display for the item, or null to display no tooltip.
- public abstract Matrix? transform { owned get; set; }
- public abstract CanvasItemVisibility visibility { get; set; }
- public abstract double visibility_threshold { get; set; }
Static methods:
- public static unowned ParamSpec class_find_child_property (ObjectClass iclass, string property_name)
This function is only intended to be used when implementing new canvas items, specifically layout container items such as CanvasTable.
- public static void class_install_child_property (ObjectClass iclass, uint property_id, ParamSpec pspec)
This function is only intended to be used when implementing new canvas items, specifically layout container items such as CanvasTable.
- public static (unowned ParamSpec)[] class_list_child_properties (ObjectClass iclass)
This function is only intended to be used when implementing new canvas items, specifically layout container items such as CanvasTable.
Methods:
- public abstract void add_child (CanvasItem child, int position)
Adds a child item to a container item at the given stack position.
- public abstract void allocate_area (Context cr, CanvasBounds requested_area, CanvasBounds allocated_area, double x_offset, double y_offset)
This function is only intended to be used when implementing new canvas items, specifically layout items such as CanvasTable.
- public void animate (double x, double y, double scale, double degrees, bool absolute, int duration, int step_time, CanvasAnimateType type)
Animates an item from its current position to the given offsets, scale and rotation.
- public void ensure_updated ()
This function is only intended to be used when implementing new canvas items.
- public int find_child (CanvasItem child)
Attempts to find the given child item with the container's stack.
- public abstract void get_bounds (out CanvasBounds bounds)
Gets the bounds of the item.
- public abstract unowned Canvas get_canvas ()
Returns the Canvas containing the given CanvasItem.
- public abstract unowned CanvasItem get_child (int child_num)
Gets the child item at the given stack position.
- public void get_child_properties (CanvasItem child, ...)
Gets the values of one or more child properties of
child
. - public void get_child_properties_valist (CanvasItem child, va_list var_args)
Gets the values of one or more child properties of
child
. - public abstract void get_child_property (CanvasItem child, uint property_id, Value value, ParamSpec pspec)
Gets a child property of
child
. - public abstract bool get_is_static ()
Returns true if the item is static.
- public abstract unowned List<CanvasItem> get_items_at (double x, double y, Context cr, bool is_pointer_event, bool parent_is_visible, List<CanvasItem> found_items)
This function is only intended to be used when implementing new canvas items, specifically container items such as CanvasGroup.
- public abstract unowned CanvasItemModel get_model ()
Gets the model of the given canvas item.
- public abstract int get_n_children ()
Gets the number of children of the container.
- public abstract unowned CanvasItem get_parent ()
Gets the parent of the given item.
- public abstract bool get_requested_area (Context cr, CanvasBounds requested_area)
This function is only intended to be used when implementing new canvas items, specifically layout items such as CanvasTable.
- public abstract bool get_requested_area_for_width (Context cr, double width, CanvasBounds requested_area)
This function is only intended to be used when implementing new canvas items, specifically layout items such as CanvasTable.
- public abstract double get_requested_height (Context cr, double width)
This function is only intended to be used when implementing new canvas items, specifically layout items such as CanvasTable.
- public bool get_simple_transform (out double x, out double y, out double scale, out double rotation)
This function can be used to get the position, scale and rotation of an item, providing that the item has a simple transformation matrix (e.
- public abstract unowned CanvasStyle get_style ()
Gets the item's style.
- public abstract bool get_transform (out Matrix transform)
Gets the transformation matrix of an item.
- public abstract bool get_transform_for_child (CanvasItem child, out Matrix transform)
Gets the transformation matrix of an item combined with any special transform needed for the given child.
- public bool is_container ()
Tests to see if the given item is a container.
- public abstract bool is_visible ()
Checks if the item is visible.
- public void lower (CanvasItem? below)
Lowers an item in the stacking order.
- public abstract void move_child (int old_position, int new_position)
Moves a child item to a new stack position within the container.
- public abstract void paint (Context cr, CanvasBounds bounds, double scale)
This function is only intended to be used when implementing new canvas items, specifically container items such as CanvasGroup.
- public void raise (CanvasItem? above)
Raises an item in the stacking order.
- public void remove ()
Removes an item from its parent.
- public abstract void remove_child (int child_num)
Removes the child item at the given position.
- public abstract void request_update ()
This function is only intended to be used when implementing new canvas items.
- public void rotate (double degrees, double cx, double cy)
Rotates the item's coordinate system by the given amount, about the given origin.
- public void scale (double sx, double sy)
Scales the item's coordinate system by the given amounts.
- public abstract void set_canvas (Canvas canvas)
This function is only intended to be used when implementing new canvas items, specifically container items such as CanvasGroup.
- public void set_child_properties (CanvasItem child, ...)
Sets the values of one or more child properties of
child
. - public void set_child_properties_valist (CanvasItem child, va_list var_args)
Sets the values of one or more child properties of
child
. - public abstract void set_child_property (CanvasItem child, uint property_id, Value value, ParamSpec pspec)
Sets a child property of
child
. - public abstract void set_is_static (bool is_static)
Notifies the item that it is static.
- public abstract void set_model (CanvasItemModel model)
Sets the model of the given canvas item.
- public abstract void set_parent (CanvasItem parent)
This function is only intended to be used when implementing new canvas items (specifically container items such as CanvasGroup).
- public void set_simple_transform (double x, double y, double scale, double rotation)
A convenience function to set the item's transformation matrix.
- public abstract void set_style (CanvasStyle style)
Sets the item's style, by copying the properties from the given style.
- public abstract void set_transform (Matrix? transform)
Sets the transformation matrix of an item.
- public void skew_x (double degrees, double cx, double cy)
Skews the item's coordinate system along the x axis by the given amount, about the given origin.
- public void skew_y (double degrees, double cx, double cy)
Skews the item's coordinate system along the y axis by the given amount, about the given origin.
- public void stop_animation ()
Stops any current animation for the given item, leaving it at its current position.
- public void translate (double tx, double ty)
Translates the origin of the item's coordinate system by the given amounts.
- public abstract void update (bool entire_tree, Context cr, CanvasBounds bounds)
This function is only intended to be used when implementing new canvas items, specifically container items such as CanvasGroup.
Signals:
- public virtual signal void animation_finished (bool stopped)
Emitted when the item animation has finished.
- public virtual signal bool button_press_event (CanvasItem target, EventButton event)
Emitted when a mouse button is pressed in an item.
- public virtual signal bool button_release_event (CanvasItem target, EventButton event)
Emitted when a mouse button is released in an item.
- public virtual signal void child_notify (ParamSpec pspec)
Emitted for each child property that has changed.
- public virtual signal bool enter_notify_event (CanvasItem target, EventCrossing event)
Emitted when the mouse enters an item.
- public virtual signal bool focus_in_event (CanvasItem target, EventFocus event)
Emitted when the item receives the keyboard focus.
- public virtual signal bool focus_out_event (CanvasItem target, EventFocus event)
Emitted when the item loses the keyboard focus.
- public virtual signal bool grab_broken_event (CanvasItem target, EventGrabBroken event)
Emitted when the item's keyboard or pointer grab was lost unexpectedly.
- public virtual signal bool key_press_event (CanvasItem target, EventKey event)
Emitted when a key is pressed and the item has the keyboard focus.
- public virtual signal bool key_release_event (CanvasItem target, EventKey event)
Emitted when a key is released and the item has the keyboard focus.
- public virtual signal bool leave_notify_event (CanvasItem target, EventCrossing event)
Emitted when the mouse leaves an item.
- public virtual signal bool motion_notify_event (CanvasItem target, EventMotion event)
Emitted when the mouse moves within an item.
- public virtual signal bool query_tooltip (double x, double y, bool keyboard_tooltip, Tooltip tooltip)
Emitted when the mouse has paused over the item for a certain amount of time, or the tooltip was requested via the keyboard.
- public virtual signal bool scroll_event (CanvasItem target, EventScroll event)
Emitted when a button in the 4 to 7 range is pressed.
Inherited Members:
All known members inherited from class GLib.Object