From: Axel S. <A....@ke...> - 2005-10-18 07:39:16
|
...and I though it was already late yesterday. On Tue, 2005-10-18 at 01:46 +0100, Duncan Coutts wrote: > On Mon, 2005-10-17 at 23:52 +0100, Axel Simon wrote: > > Since the Events structure has now changed, some of the demos will be > > broken. > > Since we're breaking the event structure I thought I'd do some more > cleanups: > > renamed short names to their longer form: > eventModif -> eventModifier > eventCMode -> eventCrossingMode > eventNType -> eventNotifyType > eventXPar -> eventXParent > eventYPar -> eventYParent > eventWMask -> eventWindowMask > eventWState -> eventWindowState > > I also renamed the 'virtual' Proximity event member from eventTouches to > eventInContact since it follows more closely how the documentation > describes it. I suppose that doesn't even break any code :-) > Instead of defining ffi imports locally, use the versions from > Graphics.UI.Gtk.Gdk.Keys. > > Removed the unused Event data constructor. At the moment there are some Events that are not bound. So I see that you now error in those cases. I guess that's just as well. > Made the eventTime record have type Word32 rather than Integer. > > The WindowState type should is a flags type so: > eventWindowMask, eventWindowState :: [WindowState] > > Use unsafeInterleaveIO to delay the call to keyvalName in marshKey. I > expect that people very rarely use this field of the Key record. So to > save allocating a String each key press the call can be delayed until it > is actually used. Even better in my opinion would be to remove the > eventKeyName member entirely and replace it with the cheeper > eventKeyVal :: KeyVal. If people really need the key name then they can > use Graphics.UI.Gtk.Gdk.keyvalName :: KeyVal -> IO String I think the rationale here was that you can easily pattern match against the Event including the key name. But unsafeInterleaveIO is certainly a good thing. > I've committed these changes in cvs so you can see exaclty what I'm > talking about. If you think any of these changes need reverting then > that's fine. I'm happy with all of these. Axel. |