Session Items Factory

WpSiFactory

GObject
    ╰──WpSiFactory

A factory for session items.

The most simple way to register a new item implementation would be:

 GVariantBuilder b = G_VARIANT_BUILDER_INIT ("a(ssymv)");
 g_variant_builder_add (&b, ...);
 wp_si_factory_register (core, wp_si_factory_new_simple (
    "foobar", FOO_TYPE_BAR, g_variant_builder_end (&b)));

And the most simple way to construct an item from a registered factory:

 item = wp_session_item_make (core, "foobar");

Members

parent_instance (GObject) –
No description available

Class structure

WpSiFactoryClass

Fields
parent_class (GObjectClass) –
No description available

Constructors

wp_si_factory_new_simple

WpSiFactory *
wp_si_factory_new_simple (const gchar* factory_name,
                          GType si_type)

Parameters:

factory_name

the factory name; must be a static string!

si_type

the WpSessionItem subclass type to instantiate for constructing items

Returns ( [transfer: full])

the new factory


Methods

wp_si_factory_construct

WpSessionItem *
wp_si_factory_construct (WpSiFactory * self,
                         WpCore * core)

Creates a new instance of the session item that is constructed by this factory

Parameters:

self

the factory

core
No description available
Returns ( [transfer: full])

a new session item instance


wp_si_factory_get_name

const gchar*
wp_si_factory_get_name (WpSiFactory * self)

Parameters:

self

the factory

Returns

the factory name


Functions

wp_si_factory_find

WpSiFactory *
wp_si_factory_find (WpCore * core,
                    const gchar* factory_name)

Parameters:

core

the core

factory_name

the lookup name

Returns ( [transfer: full][nullable])

the factory matching the lookup name


wp_si_factory_register

wp_si_factory_register (WpCore * core,
                        WpSiFactory * factory)

Registers the factory on the core.

Parameters:

core

the core

factory ( [transfer: full])

the factory to register


Properties

name

“name” gchar*

Flags : Read / Write / Construct Only


Virtual Methods

construct

WpSessionItem *
construct (WpSiFactory * self,
           WpCore * core)

Parameters:

self
No description available
core
No description available
Returns
No description available

Constants

WP_TYPE_SI_FACTORY

#define WP_TYPE_SI_FACTORY (wp_si_factory_get_type ())

The WpSiFactory GType


The results of the search are