On Wed, Mar 24, 2010 at 08:39:29AM -0700, Alan Irwin wrote: > On 2010-03-23 14:45-0700 Alan W. Irwin wrote: > > > The other issue I want to bring up now is that there is obviously a tonne of > > infrastructure for X events in xwin.c. It's not perfect for our current > > -dev xwin needs, and I understand no details of the code, but just from the > > lines of code involved, I believe it is doing much more than what you are > > now doing with xcairo. Once you understand that event infrastructure for > > -dev xwin and have fixed it up for our current -dev xwin needs I assume you > > will want to move the part of it that would be commonly useful for all our > > X-related devices to the PLplot core library, and then adapt xcairo to use > > that common infrastructure. This would help support the ultimate goal which > > is that X events are handled exactly the same way for all our X-related > > devices. > > Hi Hazen: > > The last part of the above paragraph is obviously a bad idea since we don't > want our core library to depend on X for the dynamic drivers case. So to > reframe the paragraph above, our ultimate goal should be common X event > handling for all device drivers that depend on X. Thus, I expect there will > be the same code used to handle X events in say xwin.c (for PLD_xwin=ON) and > cairo.c (for PLD_xcairo=ON). Instead of maintaining separate copies of that > code I suggest it be placed in its own separate file, and that common source > file be compiled as part of the xwin and cairo device drivers (or any other > device driver that can use it to help with X event handling).
I've gone ahead and had a first go at implementing plGetCursor support for qtwidget. It now works more or less the same as xwin. With Qt there is a fair bit of translating of Qt codes into X codes for compatibility with other drivers. With this is mind we might want to consider providing our own macros for these codes since not all Qt platforms are X11 platforms. This adds another layer of complication to the need for shared code. Having said that there is still a fair bit of shared code for locate mode. Filling in the PLGraphicsIn structure is a driver dependent act, but once that is done then the code can be shared. I made one visible change to the qt driver behaviour. Page advance now happens on mouse press not mouse release, consistent with the xwin driver. Both xwin and qt only return from plGetCursor on button press, but it would be easy to extend to button release (as for xcairo). I have also not (yet) implemented the new extensions for returning a descriptive string in the xwin or qt drivers. Andrew ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
