![]() |
![]() |
![]() |
GUPnP Reference Manual | ![]() |
---|---|---|---|---|
GUPnPResourceFactory; GUPnPResourceFactoryClass; GUPnPResourceFactory* gupnp_resource_factory_new (void); GUPnPResourceFactory* gupnp_resource_factory_get_default (void); void gupnp_resource_factory_register_resource_type (GUPnPResourceFactory *factory, const char *upnp_type, GType type); gboolean gupnp_resource_factory_unregister_resource_type (GUPnPResourceFactory *factory, const char *upnp_type); void gupnp_resource_factory_register_resource_proxy_type (GUPnPResourceFactory *factory, const char *upnp_type, GType type); gboolean gupnp_resource_factory_unregister_resource_proxy_type (GUPnPResourceFactory *factory, const char *upnp_type);
GUPnPResourceFactory objects are used by GUPnPControlPoint, GUPnPDeviceProxy and GUPnPDevice to create resource proxy and resource objects. Register UPnP type - GType pairs to have resource or resource proxy objects created with the specified GType whenever an object for a resource of the specified UPnP type is requested. The GTypes need to be derived from the relevant resource or resource proxy type (e.g. a device proxy type needs to be derived from GUPnPDeviceProxy).
typedef struct { GObject parent; GUPnPResourceFactoryPrivate *priv; } GUPnPResourceFactory;
typedef struct { GObjectClass parent_class; /* future padding */ void (* _gupnp_reserved1) (void); void (* _gupnp_reserved2) (void); void (* _gupnp_reserved3) (void); void (* _gupnp_reserved4) (void); } GUPnPResourceFactoryClass;
GUPnPResourceFactory* gupnp_resource_factory_new (void);
Returns : | A new GUPnPResourceFactory object. |
GUPnPResourceFactory* gupnp_resource_factory_get_default (void);
Returns : | The default singleton GUPnPResourceFactory object. |
void gupnp_resource_factory_register_resource_type (GUPnPResourceFactory *factory, const char *upnp_type, GType type);
Registers the GType type
for the resource of UPnP type upnp_type
. After
this call, the factory factory
will create object of GType type
each time
it is asked to create a resource object for UPnP type upnp_type
.
Note: GType type
must be a derived type of GUPNP_TYPE_DEVICE if resource is
a device or GUPNP_TYPE_SERVICE if its a service.
factory : |
A GUPnPResourceFactory. |
upnp_type : |
The UPnP type name of the resource. |
type : |
The requested GType assignment for the resource. |
gboolean gupnp_resource_factory_unregister_resource_type (GUPnPResourceFactory *factory, const char *upnp_type);
Unregisters the GType assignment for the resource of UPnP type upnp_type
.
factory : |
A GUPnPResourceFactory. |
upnp_type : |
The UPnP type name of the resource. |
Returns : | TRUE if GType assignment was removed successfully, FALSE otherwise. |
void gupnp_resource_factory_register_resource_proxy_type (GUPnPResourceFactory *factory, const char *upnp_type, GType type);
Registers the GType type
for the proxy of resource of UPnP type upnp_type
.
After this call, the factory factory
will create object of GType type
each
time it is asked to create a resource proxy object for UPnP type upnp_type
.
Note: GType type
must be a derived type of GUPNP_TYPE_DEVICE_PROXY if
resource is a device or GUPNP_TYPE_SERVICE_PROXY if its a service.
factory : |
A GUPnPResourceFactory. |
upnp_type : |
The UPnP type name of the resource. |
type : |
The requested GType assignment for the resource proxy. |
gboolean gupnp_resource_factory_unregister_resource_proxy_type (GUPnPResourceFactory *factory, const char *upnp_type);
Unregisters the GType assignment for the proxy of resource of UPnP type
upnp_type
.
factory : |
A GUPnPResourceFactory. |
upnp_type : |
The UPnP type name of the resource. |
Returns : | TRUE if GType assignment was removed successfully, FALSE otherwise. |