Hi all,

I was digging into Xinput2 after raster initial commit introducing xi2
APIs to handle input devices and their properties.

At the time, we are capable of retrieving the name and the properties.
The `XIDeviceInfo` structure has much more.

typedef struct
{
    int                 deviceid;
    char                *name;
    int                 use;
    int                 attachment;
    Bool                enabled;
    int                 num_classes;
    XIAnyClassInfo      **classes;
} XIDeviceInfo;

Full description is available here:
https://www.x.org/archive/X11R7.5/doc/man/man3/XIQueryDevice.3.html#toc

The use field can have the following values:
- XIMasterPointer
- XIMasterKeyboard
- XISlavePointer
- XISlaveKeyboard
- XIFloatingSlave

According to the value of the `use` field, the `attachment` field
specifies the deviceid of the paired master keyboard/pointer
I am wondering if instead of having a getter for this field, we should
have a function like this one:
> bool ecore_x_input_device_is_master_keyboard();
> bool ecore_x_input_device_is_master_pointer();
> bool ecore_x_input_device_is_slave_keyboard();
> bool ecore_x_input_device_is_slave_pointer();
> bool ecore_x_input_device_is_floating_slave();

Otherwise, we should stick with
> ecore_x_input_device_use_get
And the caller can then check the value.

Regarding `attachment` and `enabled`, I believe two simple getters
should do just fine.
> bool ecore_x_input_is_enabled();
> int ecore_x_input_attachment_device_get();

XIAnyClassInfo may be addressed later on.

What are your thoughts about this structuring? Any
feedback/suggestions/corrections?

Best,
Raffaele
-- 
_______________________________________
Raffaele Spinelli, Ph.D.
Web:  www.rafspiny.eu


_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to