Wp.SiFactory

g GObject.Object GObject.Object Wp.SiFactory Wp.SiFactory GObject.Object->Wp.SiFactory

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

find (core, factory_name)

class

new_simple (factory_name, si_type)

construct (core)

get_name ()

Virtual Methods

Inherited:

GObject.Object (7)

do_construct (core)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

The factory’s name

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Wp.SiFactory(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Wp.SiFactoryClass

A factory for session items. The most simple way to register a new item implementation would be:

wp_si_factory_register (core,
wp_si_factory_new_simple (

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

item = wp_session_item_make (core,

classmethod find(core, factory_name)
Parameters:
  • core (Wp.Core) – the core

  • factory_name (str) – the lookup name

Returns:

the factory matching the lookup name

Return type:

Wp.SiFactory or None

Looks up a factory matching a name.

classmethod new_simple(factory_name, si_type)
Parameters:
  • factory_name (str) – the factory name; must be a static string!

  • si_type (GObject.GType) – the Wp.SessionItem subclass type to instantiate for constructing items

Returns:

the new factory

Return type:

Wp.SiFactory

Creates a simple factory that constructs objects of a given GObject.GType.

construct(core)
Parameters:

core (Wp.Core) – the core

Returns:

a new session item instance

Return type:

Wp.SessionItem

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

get_name()
Returns:

the factory name

Return type:

str

Gets the name of the factory.

do_construct(core) virtual
Parameters:

core (Wp.Core) – the core

Returns:

a new session item instance

Return type:

Wp.SessionItem

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

Property Details

Wp.SiFactory.props.name
Name:

name

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The factory’s name