object: add class property initializer

This callback is used to set default value in following patch "object:
add object_property_set_defaut_{bool,str,int,uint}()".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200110153039.1379601-7-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-01-10 19:30:19 +04:00 committed by Paolo Bonzini
parent ba806ffbdf
commit 2a1be4b348
2 changed files with 28 additions and 2 deletions

View file

@ -309,6 +309,8 @@ typedef struct InterfaceInfo InterfaceInfo;
*/
typedef struct ObjectProperty ObjectProperty;
/**
* ObjectPropertyAccessor:
* @obj: the object that owns the property
@ -356,7 +358,16 @@ typedef void (ObjectPropertyRelease)(Object *obj,
const char *name,
void *opaque);
typedef struct ObjectProperty
/**
* ObjectPropertyInit:
* @obj: the object that owns the property
* @prop: the property to set
*
* Called when a property is initialized.
*/
typedef void (ObjectPropertyInit)(Object *obj, ObjectProperty *prop);
struct ObjectProperty
{
gchar *name;
gchar *type;
@ -365,8 +376,9 @@ typedef struct ObjectProperty
ObjectPropertyAccessor *set;
ObjectPropertyResolve *resolve;
ObjectPropertyRelease *release;
ObjectPropertyInit *init;
void *opaque;
} ObjectProperty;
};
/**
* ObjectUnparent: