GUPnP Reference Manual | ||||
---|---|---|---|---|
GUPnPResourceFactory; 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 _GUPnPResourceFactory GUPnPResourceFactory;
This struct contains private data only, and should be accessed using the functions below.
GUPnPResourceFactory* gupnp_resource_factory_new (void);
Create a new GUPnPResourceFactory object.
Returns : |
A GUPnPResourceFactory object. |
GUPnPResourceFactory* gupnp_resource_factory_get_default (void);
Get the default singleton GUPnPResourceFactory object.
Returns : |
A 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.
|
A GUPnPResourceFactory. |
|
The UPnP type name of the resource. |
|
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
.
|
A GUPnPResourceFactory. |
|
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.
|
A GUPnPResourceFactory. |
|
The UPnP type name of the resource. |
|
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
.
|
A GUPnPResourceFactory. |
|
The UPnP type name of the resource. |
Returns : |
TRUE if GType assignment was removed successfully, FALSE
otherwise.
|