cogl-renderer: Move the XEvent filters to be generic for all renderers

Instead of having cogl_renderer_xlib_add_filter and friends there is
now cogl_renderer_add_native_filter which can be used regardless of
the backend. The callback function for the filter now just takes a
void pointer instead of an XEvent pointer which should be interpreted
differently depending on the backend. For example, on Xlib it would
still be an XEvent but on Windows it could be a MSG. This simplifies
the code somewhat because the _cogl_xlib_add_filter no longer needs to
have its own filter list when a stub renderer is used because there is
always a renderer available.

cogl_renderer_xlib_handle_event has also been renamed to
cogl_renderer_handle_native_event. This just forwards the event on to
all of the listeners. The backend renderer is expected to register its
own event filter if it wants to process the events in some way.
This commit is contained in:
Neil Roberts
2011-04-13 16:41:41 +01:00
parent cbbf76f280
commit f6ae9decaa
11 changed files with 190 additions and 245 deletions

View File

@ -37,6 +37,8 @@ struct _CoglRenderer
#ifdef COGL_HAS_XLIB_SUPPORT
Display *foreign_xdpy;
#endif
/* List of callback functions that will be given every native event */
GSList *event_filters;
void *winsys;
};