mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
input-linux: Register properties as class properties
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200921221045.699690-10-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
29ee2a1832
commit
7da4e3bb11
1 changed files with 14 additions and 13 deletions
|
@ -489,19 +489,6 @@ static void input_linux_set_grab_toggle(Object *obj, int value,
|
||||||
|
|
||||||
static void input_linux_instance_init(Object *obj)
|
static void input_linux_instance_init(Object *obj)
|
||||||
{
|
{
|
||||||
object_property_add_str(obj, "evdev",
|
|
||||||
input_linux_get_evdev,
|
|
||||||
input_linux_set_evdev);
|
|
||||||
object_property_add_bool(obj, "grab_all",
|
|
||||||
input_linux_get_grab_all,
|
|
||||||
input_linux_set_grab_all);
|
|
||||||
object_property_add_bool(obj, "repeat",
|
|
||||||
input_linux_get_repeat,
|
|
||||||
input_linux_set_repeat);
|
|
||||||
object_property_add_enum(obj, "grab-toggle", "GrabToggleKeys",
|
|
||||||
&GrabToggleKeys_lookup,
|
|
||||||
input_linux_get_grab_toggle,
|
|
||||||
input_linux_set_grab_toggle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void input_linux_class_init(ObjectClass *oc, void *data)
|
static void input_linux_class_init(ObjectClass *oc, void *data)
|
||||||
|
@ -509,6 +496,20 @@ static void input_linux_class_init(ObjectClass *oc, void *data)
|
||||||
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
|
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
|
||||||
|
|
||||||
ucc->complete = input_linux_complete;
|
ucc->complete = input_linux_complete;
|
||||||
|
|
||||||
|
object_class_property_add_str(oc, "evdev",
|
||||||
|
input_linux_get_evdev,
|
||||||
|
input_linux_set_evdev);
|
||||||
|
object_class_property_add_bool(oc, "grab_all",
|
||||||
|
input_linux_get_grab_all,
|
||||||
|
input_linux_set_grab_all);
|
||||||
|
object_class_property_add_bool(oc, "repeat",
|
||||||
|
input_linux_get_repeat,
|
||||||
|
input_linux_set_repeat);
|
||||||
|
object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys",
|
||||||
|
&GrabToggleKeys_lookup,
|
||||||
|
input_linux_get_grab_toggle,
|
||||||
|
input_linux_set_grab_toggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo input_linux_info = {
|
static const TypeInfo input_linux_info = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue