Base object type

WpFeatureActivationTransition

GObject
    ╰──WpTransition
        ╰──WpFeatureActivationTransition

A WpTransition that is used by WpObject to implement feature activation.


Class structure

WpFeatureActivationTransitionClass

Fields
parent_class (WpTransitionClass) –
No description available

Methods

wp_feature_activation_transition_get_requested_features

WpObjectFeatures
wp_feature_activation_transition_get_requested_features (WpFeatureActivationTransition * self)

Parameters:

self

the transition

Returns

the features that were requested to be activated in this transition; this contains the features as they were passed in wp_object_activate and therefore it may contain unsupported or already active features


WpObject

GObject
    ╰──WpObject
        ╰──WpPlugin
        ╰──WpProxy
        ╰──WpSessionItem

Base class for objects that may have optional activatable features.

Members

parent_instance (GObject) –
No description available

Class structure

WpObjectClass

Fields
parent_class (GObjectClass) –
No description available

Methods

wp_object_activate

wp_object_activate (WpObject * self,
                    WpObjectFeatures features,
                    GCancellable* cancellable,
                    GAsyncReadyCallback callback,
                    gpointer user_data)

Callback version of wp_object_activate_closure

Parameters:

self

the object

features

the features to enable

cancellable ( [nullable])

a cancellable for the async operation

callback ( [scope async])

a function to call when activation is complete

user_data ( [closure])

data for callback


wp_object_activate_closure

wp_object_activate_closure (WpObject * self,
                            WpObjectFeatures features,
                            GCancellable* cancellable,
                            GClosure* closure)

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.

Note that closure may be invoked in sync while this method is being called, if there are no features to activate.

Parameters:

self

the object

features

the features to enable

cancellable ( [nullable])

a cancellable for the async operation

closure ( [transfer: full])

the closure to use when activation is completed


wp_object_activate_finish

gboolean
wp_object_activate_finish (WpObject * self,
                           GAsyncResult* res,
                           GError** error)

Parameters:

self

the object

res

the async operation result

error ( [out][optional])

the error of the operation, if any

Returns

TRUE if the requested features were activated, FALSE if there was an error


wp_object_deactivate

wp_object_deactivate (WpObject * self,
                      WpObjectFeatures features)

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.

Parameters:

self

the object

features

the features to deactivate


wp_object_get_active_features

WpObjectFeatures
wp_object_get_active_features (WpObject * self)

Parameters:

self

the object

Returns

a bitset containing the active features of this object


wp_object_get_core

WpCore *
wp_object_get_core (WpObject * self)

Parameters:

self

the object

Returns ( [transfer: full])

the core associated with this object


wp_object_get_supported_features

WpObjectFeatures
wp_object_get_supported_features (WpObject * self)

Parameters:

self

the object

Returns

a bitset containing the supported features of this object; note that supported features may change at runtime


wp_object_update_features

wp_object_update_features (WpObject * self,
                           WpObjectFeatures activated,
                           WpObjectFeatures deactivated)

Private method to be called by subclasses. 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.

Parameters:

self
No description available
activated
No description available
deactivated
No description available

Properties

active-features

“active-features” guint

Flags : Read


core

“core” WpCore *

Flags : Read / Write / Construct Only


supported-features

“supported-features” guint

Flags : Read


Virtual Methods

activate_execute_step

activate_execute_step (WpObject * self,
                       WpFeatureActivationTransition * transition,
                       guint step,
                       WpObjectFeatures missing)

Parameters:

self
No description available
transition
No description available
step
No description available
missing
No description available

activate_get_next_step

guint
activate_get_next_step (WpObject * self,
                        WpFeatureActivationTransition * transition,
                        guint step,
                        WpObjectFeatures missing)

Parameters:

self
No description available
transition
No description available
step
No description available
missing
No description available
Returns
No description available

deactivate

deactivate (WpObject * self,
            WpObjectFeatures features)

Parameters:

self
No description available
features
No description available

get_supported_features

WpObjectFeatures
get_supported_features (WpObject * self)

Parameters:

self
No description available
Returns
No description available

Constants

WP_TYPE_FEATURE_ACTIVATION_TRANSITION

#define WP_TYPE_FEATURE_ACTIVATION_TRANSITION \
    (wp_feature_activation_transition_get_type ())

The WpFeatureActivationTransition GType


WP_TYPE_OBJECT

#define WP_TYPE_OBJECT (wp_object_get_type ())

The WpObject GType


Aliases

WpObjectFeatures

typedef guint WpObjectFeatures

Flags that specify functionality that is available on this class.

Use wp_object_activate to enable more features, wp_object_get_supported_features to see which features are supported and wp_object_get_active_features to find out which features are already enabled. Features can also be deactivated later using wp_object_deactivate.

Actual feature flags are to be specified by subclasses and their interfaces. WP_OBJECT_FEATURES_ALL is a special value that can be used to activate all the supported features in any given object.


The results of the search are