diffing dir...
Wed Jun 30 23:08:36 EDT 2010 Andy Stewart <laz...@gm...>
* Add mainDoEvent.
Ignore-this: 37cd08eb71f1eb3e77f09f04a02c5e3
{
hunk ./gtk/Graphics/UI/Gtk/General/General.chs 52
+ mainDoEvent,
hunk ./gtk/Graphics/UI/Gtk/General/General.chs 91
+import Graphics.UI.Gtk.Gdk.EventM (EventM)
+import Control.Monad.Reader (ask)
+import Control.Monad.Trans (liftIO)
hunk ./gtk/Graphics/UI/Gtk/General/General.chs 254
+-- | Processes a single GDK event. This is public only to allow filtering of events between GDK and
+-- GTK+. You will not usually need to call this function directly.
+-- [_$_]
+-- While you should not call this function directly, you might want to know how exactly events are
+-- handled. So here is what this function does with the event:
+-- [_$_]
+-- 1. Compress enter/leave notify events. If the event passed build an enter/leave pair together with
+-- the next event (peeked from GDK) both events are thrown away. This is to avoid a backlog of
+-- (de-)highlighting widgets crossed by the pointer.
+-- [_$_]
+-- 2. Find the widget which got the event. If the widget can't be determined the event is thrown away
+-- unless it belongs to a INCR transaction. In that case it is passed to
+-- 'selectionIncrEvent'.
+-- [_$_]
+-- 3. Then the event is passed on a stack so you can query the currently handled event with
+-- 'getCurrentEvent'.
+-- [_$_]
+-- 4. The event is sent to a widget. If a grab is active all events for widgets that are not in the
+-- contained in the grab widget are sent to the latter with a few exceptions:
+-- [_$_]
+-- * Deletion and destruction events are still sent to the event widget for obvious reasons.
+-- [_$_]
+-- * Events which directly relate to the visual representation of the event widget.
+-- [_$_]
+-- * Leave events are delivered to the event widget if there was an enter event delivered to it
+-- before without the paired leave event.
+-- [_$_]
+-- * Drag events are not redirected because it is unclear what the semantics of that would be.
+-- [_$_]
+-- Another point of interest might be that all key events are first passed through the key snooper
+-- functions if there are any. Read the description of 'keySnooperInstall' if you need this
+-- feature.
+-- [_$_]
+-- 5. After finishing the delivery the event is popped from the event stack.
+mainDoEvent :: EventM t ()
+mainDoEvent = do
+ ptr <- ask
+ liftIO $ {#call main_do_event #} (castPtr ptr)
+
}
|