MAFW Reference Manual | ||||
---|---|---|---|---|
MafwExtension; #define MAFW_EXTENSION_ERROR #define MAFW_EXTENSION_SUPPORTS_ERROR_POLICY(self) #define MAFW_EXTENSION_SUPPORTS_MUTE (self) #define MAFW_EXTENSION_SUPPORTS_VOLUME (self) #define MAFW_EXTENSION_SUPPORTS_XID (self) #define MAFW_EXTENSION_SUPPORTS_AUTOPAINT (self) #define MAFW_EXTENSION_SUPPORTS_COLORKEY (self) enum MafwExtensionError; MafwExtensionProperty; void (*MafwExtensionPropertyCallback) (MafwExtension *self, const gchar *name, GValue *value, gpointer udata, const GError *error); const gchar* mafw_extension_get_name (MafwExtension *self); const gchar* mafw_extension_get_uuid (MafwExtension *self); void mafw_extension_set_name (MafwExtension *self, const gchar *name); const gchar* mafw_extension_get_plugin (MafwExtension *self); void mafw_extension_add_property (MafwExtension *self, const gchar *name, GType type); void mafw_extension_emit_property_changed (MafwExtension *self, const gchar *property, const GValue *value); void mafw_extension_get_property (MafwExtension *self, const gchar *name, MafwExtensionPropertyCallback cb, gpointer udata); const GPtrArray* mafw_extension_list_properties (MafwExtension *self); gboolean mafw_extension_set_property (MafwExtension *self, const gchar *name, const GValue *value); gboolean mafw_extension_set_property_boolean (MafwExtension *self, const gchar *name, gboolean value); gboolean mafw_extension_set_property_char (MafwExtension *self, const gchar *name, gchar value); gboolean mafw_extension_set_property_double (MafwExtension *self, const gchar *name, gdouble value); gboolean mafw_extension_set_property_float (MafwExtension *self, const gchar *name, gfloat value); gboolean mafw_extension_set_property_int (MafwExtension *self, const gchar *name, gint value); gboolean mafw_extension_set_property_int64 (MafwExtension *self, const gchar *name, gint64 value); gboolean mafw_extension_set_property_long (MafwExtension *self, const gchar *name, glong value); gboolean mafw_extension_set_property_string (MafwExtension *self, const gchar *name, const gchar *value); gboolean mafw_extension_set_property_uchar (MafwExtension *self, const gchar *name, guchar value); gboolean mafw_extension_set_property_uint (MafwExtension *self, const gchar *name, guint value); gboolean mafw_extension_set_property_uint64 (MafwExtension *self, const gchar *name, guint64 value); gboolean mafw_extension_set_property_ulong (MafwExtension *self, const gchar *name, gulong value);
"name" gchar* : Read / Write / Construct "plugin" gchar* : Read / Write / Construct Only "uuid" gchar* : Read / Write / Construct Only
Common definitions for runtime properties of MAFW renderer and sources. See
functions mafw_extension_add_property()
, mafw_extension_get_property()
,
mafw_extension_set_property()
etc. for details. Use MAFW_EXTENSION_SUPPORTS_* to
declare support for the given property.
#define MAFW_EXTENSION_ERROR g_quark_from_static_string("com.nokia.mafw.error.extension")
Gets a quark for common renderer/source errors
#define MAFW_EXTENSION_SUPPORTS_ERROR_POLICY(self)
Adds property for selecting an error policy.
self : |
MafwExtension instance to add the property on |
#define MAFW_EXTENSION_SUPPORTS_MUTE(self)
Adds property for selecting mute
self : |
MafwExtension instance to add the property on |
#define MAFW_EXTENSION_SUPPORTS_VOLUME(self)
Adds property for selecting volume
self : |
MafwExtension instance to add the property on |
#define MAFW_EXTENSION_SUPPORTS_XID(self)
Adds property for selecting a xid
self : |
MafwExtension instance to add the property on |
typedef enum { /* Common errors */ MAFW_EXTENSION_ERROR_EXTENSION_NOT_AVAILABLE, MAFW_EXTENSION_ERROR_UNSUPPORTED_OPERATION, MAFW_EXTENSION_ERROR_NETWORK_DOWN, MAFW_EXTENSION_ERROR_SERVICE_NOT_RESPONDING, MAFW_EXTENSION_ERROR_EXTENSION_NOT_RESPONDING, MAFW_EXTENSION_ERROR_INVALID_PROPERTY, MAFW_EXTENSION_ERROR_SET_PROPERTY, MAFW_EXTENSION_ERROR_GET_PROPERTY, MAFW_EXTENSION_ERROR_ACCESS_DENIED, MAFW_EXTENSION_ERROR_INVALID_PARAMS, MAFW_EXTENSION_ERROR_OUT_OF_MEMORY, MAFW_EXTENSION_ERROR_FAILED } MafwExtensionError;
MAFW error code definitions for common errors for all renderers and sources.
typedef struct { gchar *name; GType type; } MafwExtensionProperty;
Information about a run-time property.
gchar *name ; |
name of the property. |
GType type ; |
the GType of the property. |
void (*MafwExtensionPropertyCallback) (MafwExtension *self, const gchar *name, GValue *value, gpointer udata, const GError *error);
Callback for asynchronous run-time property retrieval. Ownership
of value
is passed to the callee. If error
is set, value
is
NULL
.
self : |
a MafwExtension instance. |
name : |
the name of the returned property. |
value : |
the value of the property, owned by the callee. |
udata : |
additional data. |
error : |
non-NULL if an error occurred. Freed by the caller.
|
const gchar* mafw_extension_get_name (MafwExtension *self);
Queries the name of the extension.
self : |
a MafwExtension instance. |
Returns : | the name of the extension. The value is owned by the MafwExtension and should never be modified or freed. |
const gchar* mafw_extension_get_uuid (MafwExtension *self);
Queries the UUID of the extension.
self : |
a MafwExtension instance. |
Returns : | the UUID of the object. The value is owned by the MafwExtension and should never be modified or freed. |
void mafw_extension_set_name (MafwExtension *self, const gchar *name);
Sets the name of the extension to name
.
self : |
a MafwExtension instance. |
name : |
the new name of the extension. |
const gchar* mafw_extension_get_plugin (MafwExtension *self);
Queries the name of the plugin that created self
.
self : |
a MafwExtension instance. |
Returns : | MafwExtension:name, owned by the extension, not modifiable by the user. |
void mafw_extension_add_property (MafwExtension *self, const gchar *name, GType type);
Adds name
to the list of supported properties of this MafwExtension
instance. This function exists for the convenience of subclasses
(to call e.g. in their list_extension_properties implementation). It
does nothing if a property already exists with the given name.
self : |
a MafwExtension instance. |
name : |
the name of the property. |
type : |
the GType of the property. |
void mafw_extension_emit_property_changed (MafwExtension *self, const gchar *property, const GValue *value);
Emits "property-changed" with property
as detail. This is
a helper function for subclasses, who should call this after the
property change initiated with mafw_extension_set_property()
is in
effect.
self : |
a MafwExtension instance. |
property : |
property to signal |
value : |
GValue with property value. |
void mafw_extension_get_property (MafwExtension *self, const gchar *name, MafwExtensionPropertyCallback cb, gpointer udata);
Queries a run-time property asynchronously. The callback will be always invoked (with a GError if appropriate).
self : |
a MafwExtension instance. |
name : |
name of a property. |
cb : |
a function to call with the result. |
udata : |
additional data passed to cb .
|
const GPtrArray* mafw_extension_list_properties (MafwExtension *self);
List the SiSo properties.
self : |
a MafwExtension instance. |
Returns : | a GPtrArray containing pointers to MafwExtensionProperty structures. The caller should NOT modify it in any way. It is assumed that the returned list will not change after the first invocation of this function (callers may cache it). |
gboolean mafw_extension_set_property (MafwExtension *self, const gchar *name, const GValue *value);
Sets the run-time property named name
on self
. This may happen
asynchronously, so the new value may not be in effect for a while.
If the change is in effect "property-changed" will be
emitted. If some error happens, the interested is notified using
"error" (codes from MafwExtensionError).
self : |
a MafwExtension instance. |
name : |
name of the property. |
value : |
the value to set. |
Returns : | FALSE if the property does not exists or it's type is
different than of value .
|
gboolean mafw_extension_set_property_boolean (MafwExtension *self, const gchar *name, gboolean value);
Sets a value of type gboolean.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_char (MafwExtension *self, const gchar *name, gchar value);
Sets a value of type gchar.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_double (MafwExtension *self, const gchar *name, gdouble value);
Sets a value of type gdouble.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_float (MafwExtension *self, const gchar *name, gfloat value);
Sets a value of type gfloat.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_int (MafwExtension *self, const gchar *name, gint value);
Sets a value of type gint.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_int64 (MafwExtension *self, const gchar *name, gint64 value);
Sets a value of type gint64.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_long (MafwExtension *self, const gchar *name, glong value);
Sets a value of type glong.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_string (MafwExtension *self, const gchar *name, const gchar *value);
Sets a property of value gchar*.
self : |
a MafwExtension object |
name : |
property name |
value : |
value |
Returns : | TRUE on success, FALSE otherwise
|
gboolean mafw_extension_set_property_uchar (MafwExtension *self, const gchar *name, guchar value);
Sets a value of type guchar.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_uint (MafwExtension *self, const gchar *name, guint value);
Sets a value of type guint.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_uint64 (MafwExtension *self, const gchar *name, guint64 value);
Sets a value of type guint64.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
gboolean mafw_extension_set_property_ulong (MafwExtension *self, const gchar *name, gulong value);
Sets a value of type gulong.
self : |
a MafwExtension instance |
name : |
name |
value : |
value |
Returns : | TRUE if success, FALSE otherwise.
|
"name"
property"name" gchar* : Read / Write / Construct
The name of the extension.
Default value: ""
"plugin"
property"plugin" gchar* : Read / Write / Construct Only
Name of the plugin which created the extension. MUST be given at construction-time and it is not modifiable afterwards.
Default value: NULL
"error"
signalvoid user_function (MafwExtension *self, guint domain, gint code, gchar *message, gpointer user_data) : Run First
A signal indicating that a spontaneous error has occured.
self : |
a MafwExtension instance. |
domain : |
GQuark representing the error domain string. |
code : |
an error code. |
message : |
Error description string |
user_data : |
user data set when the signal handler was connected. |
"property-changed"
signalvoid user_function (MafwExtension *self, gchar *name, GValue *val, gpointer user_data) : Run First / Has Details
A detailed signal indicating that a run-time property has
changed ("property-changed::foo" is emitted if a property
named "foo" changed). Note that `changed' does not
necessary mean a different value, but the fact that someone
has issued mafw_extension_set_property()
. The handler prototype
looks like the following:
void property_changed(MafwExtension *object, const gchar *name, const GValue *value);
self : |
a MafwExtension instance. |
name : |
the name of the changed property. |
val : |
a GValue representing the new value. |
user_data : |
user data set when the signal handler was connected. |