Class
CogViewport
Description [src]
class Cog.Viewport : GObject.Object {
parent_instance: GObject
}
Observable set of views, one of which can be visible.
Provides a container for CogView
objects, which can be
observed for changes by means of the CogViewport::add
and CogViewport::remove
signals.
Each view associated with the viewport can be retrieved with
cog_viewport_get_nth_view()
, and the number of views obtained
with cog_viewport_get_n_views()
. These can be used to iterate
over the views, but for convenience the cog_viewport_foreach()
method is provided as well.
The CogViewport:visible-view
tracks the currently
visible view among the ones associated with the viewport, which
can be manipulated with cog_viewport_set_visible_view()
and
inspected with cog_viewport_get_visible_view()
.
Optionally, platform plug-in implementations can provide their own viewport class implementation by overriding the CogPlatform.get_viewport_type method.
Available since: | 0.20 |
Constructors
cog_viewport_new
Creates a new instance of a viewport implementation and sets its properties.
Functions
cog_viewport_get_impl_type
Get the type of the viewport implementation in use.
Instance methods
cog_viewport_add
Adds a view to a viewport.
cog_viewport_contains
Checks whether a viewport contains a given view.
cog_viewport_foreach
Applies a function to each view in the viewport.
cog_viewport_get_n_views
Gets the number of views in a viewport.
cog_viewport_get_nth_view
Gets a view from the viewport given its index.
cog_viewport_get_visible_view
Gets the visible view.
cog_viewport_remove
Removes a view from the viewport.
cog_viewport_set_visible_view
Sets the visible view for the viewport.
Properties
Cog.Viewport:visible-view
Signals
Cog.Viewport::add
Emitted after a view has been added to the viewport.
Cog.Viewport::remove
Emitted after a view has been removed from the viewport.
Signals inherited from GObject (1)
GObject.Object::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.