Ok, I'm about to start some serious implementation on the wintab dll. What I need now is some giudance as to how to proceed, regarding integration with X11 code.
Please comment on anything mentioned below. If this is too concise, please ask for further clasification.
*****Requirement for interfacing with X11*****
To access the graphics tablet, the dll must access the XInput extension to X11. Therefore it needs some level of cooperation/integration with x11_drv. The reqirements are:
Access to an XDisplay object.
Event dispatch code similar to event.c It must be able to claim XInput events, and expose them through the wintab32.dll interface. Wintab32.dll is defined as having it's own event dispatch system, totally distinct from the win32 system.
Access to an X window that contains the wine/win32 window client area. This is available in a win32 property named: __wine_x11_client_window. It is also accessible through x11_drv internals. If necessary, could always use the DefaultRootWindow(display)!.
*********Assumptions******
It is bad practice/impossible to call functions from one dll in another, if they are not defined in the .spec file. I'm also assuming the same applies to variables.
A call to XOpenDisplay(NULL) will ensure the same display is accessed as in X11_Drv.
It is a good idea to call XInput functions in the wintab32.dll.
It is a good idea to access the X11 windows needed by the Win32 window's propery. will reqire that the GetProp and GlobalFindAtom functions in wine.
Wintab can be given it's own version of WaitForMultipleObjectsEx that will deal solely with XInput events. I'm also assuming that there is no reason why XInput events should occur in
***********Questions*******
Is function X11DRV_MsgWaitForMultipleObjectsEx really the place where all X11 events enter the system before being translated into win32/16 events?
It appears to be a principle of wine design that all X11 code should live in the x11_drv dll. Therefore, when complete, where should XInput code live?
*************Design principles**********
Genericity. I would like anything in X11_drv to be as generic as possible. So, Initially, I'd like to keep code in X11_drv to a minimun.
Therefore, Given the ideas above, all XInput code is in wintab32.dll!
********** And that's it! ***********
Well that's the lot, Please comment Cheers -Rob.
Right, can now ignore my original post, and comment on the following.
Ok, I've sort of found a template for the X11_drv wintab seperation: The tablate is the direct X drirect draw, and open GL dlls.
These dlls do the following: X11_drv thread synchronisation Grab the X device the GDI code uses. (I only want to grab the same display string, and build my own XDisplay object). Get the X window handle from a win32 window handle.
This is all that's needed to attach the wintab dll to the XInput code.
I shall put no extra code in the X11_drv. All XInput calls will live in the wintab dll.
One fly may appear in the ointment: It is possible for the X11 driver to insert wintab messages into wthe win32 message queue. This can be handled entirely inside the wintab dll, but the tablet messages may get out of sync with the rest of the windows messages. If the messages do get out of sync, then wintab may need to hook into the event code int x11_drv/event.c.
For the moment I'm assuming this won't happen.
That's all for now Merry Christmas -Rob.