Wp.Object¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The active WpObjectFeatures on this proxy |
||
r/w/co |
The |
||
r |
The object unique id |
||
r |
The supported WpObjectFeatures on this proxy |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Wp.Object(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Base class for objects that have activatable features.
- abort_activation(msg)¶
- Parameters:
msg (
str
) – the message used in the transition error
Aborts the current object activation by returning a transition error if any transitions are pending.
This is usually used to stop any pending activation if an error happened.
New in version 0.4.6.
- activate(features, cancellable, callback, *user_data)¶
- Parameters:
features (
int
) – the features to enablecancellable (
Gio.Cancellable
orNone
) – a cancellable for the async operationcallback (
Gio.AsyncReadyCallback
orNone
) – a function to call when activation is complete
Callback version of
Wp.Object.activate_closure
()
- activate_closure(features, cancellable, closure)¶
- Parameters:
features (
int
) – the features to enablecancellable (
Gio.Cancellable
orNone
) – a cancellable for the async operationclosure (
GObject.Closure
) – the closure to use when activation is completed
Activates the requested features and invokes closure when this is done. features may contain unsupported or already active features. The operation will filter them and activate only ones that are supported and inactive.
If multiple calls to this method is done, the operations will be executed one after the other to ensure features only get activated once. closure may be invoked in sync while this method is being called, if there are no features to activate.
- activate_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – the async operation result- Raises:
- Returns:
True
if the requested features were activated,False
if there was an error- Return type:
Finishes the async operation that was started with
Wp.Object.activate
()
- deactivate(features)¶
- Parameters:
features (
int
) – the features to deactivate
Deactivates the given features, leaving the object in the state it was before they were enabled.
This is seldom needed to call manually, but it can be used to save resources if some features are no longer needed.
- get_active_features()¶
- Returns:
A bitset containing the active features of this object
- Return type:
Gets the active features of this object.
- get_core()¶
- Returns:
the core associated with this object
- Return type:
Gets the core associated with this object.
- get_supported_features()¶
- Returns:
A bitset containing the supported features of this object; note that supported features may change at runtime
- Return type:
Gets the supported features of this object.
- test_active_features(features)¶
- Parameters:
features (
int
) – the features to check- Returns:
True
if all the given features are active on this object- Return type:
Checks if the given features are active on this object.
New in version 0.5.0.
- test_supported_features(features)¶
- Parameters:
features (
int
) – the features to check- Returns:
True
if all the given features are supported on this object- Return type:
Checks if the given features are supported on this object.
New in version 0.5.0.
- update_features(activated, deactivated)¶
- Parameters:
Allows subclasses to update the currently active features.
activated should contain new features and deactivated should contain features that were just deactivated. Calling this method also advances the activation transitions. Private method to be called by subclasses only.
- do_activate_execute_step(transition, step, missing) virtual¶
- Parameters:
transition (
Wp.FeatureActivationTransition
) –step (
int
) –missing (
int
) –
- do_activate_get_next_step(transition, step, missing) virtual¶
- Parameters:
transition (
Wp.FeatureActivationTransition
) –step (
int
) –missing (
int
) –
- Return type:
- do_deactivate(features) virtual¶
- Parameters:
features (
int
) – the features to deactivate
Deactivates the given features, leaving the object in the state it was before they were enabled.
This is seldom needed to call manually, but it can be used to save resources if some features are no longer needed.
Property Details¶
- Wp.Object.props.active_features¶
-
The active WpObjectFeatures on this proxy