mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
f6ae9decaa
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.
77 lines
2.0 KiB
C
77 lines
2.0 KiB
C
/*
|
|
* Cogl
|
|
*
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
*
|
|
* Copyright (C) 2010,2011 Intel Corporation.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef __COGL_XLIB_PRIVATE_H
|
|
#define __COGL_XLIB_PRIVATE_H
|
|
|
|
#include "cogl/cogl.h"
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
typedef struct _CoglXlibTrapState CoglXlibTrapState;
|
|
|
|
struct _CoglXlibTrapState
|
|
{
|
|
/* These values are intended to be internal to
|
|
* _cogl_xlib_{un,}trap_errors but they need to be in the header so
|
|
* that the struct can be allocated on the stack */
|
|
int (* old_error_handler) (Display *, XErrorEvent *);
|
|
int trapped_error_code;
|
|
CoglXlibTrapState *old_state;
|
|
};
|
|
|
|
void
|
|
_cogl_xlib_query_damage_extension (void);
|
|
|
|
int
|
|
_cogl_xlib_get_damage_base (void);
|
|
|
|
void
|
|
_cogl_xlib_trap_errors (CoglXlibTrapState *state);
|
|
|
|
int
|
|
_cogl_xlib_untrap_errors (CoglXlibTrapState *state);
|
|
|
|
/*
|
|
* _cogl_xlib_add_filter:
|
|
*
|
|
* Adds a callback function that will receive all X11 events. The
|
|
* function can stop further processing of the event by return
|
|
* %COGL_XLIB_FILTER_REMOVE.
|
|
*/
|
|
void
|
|
_cogl_xlib_add_filter (CoglNativeFilterFunc func,
|
|
void *data);
|
|
|
|
/*
|
|
* _cogl_xlib_remove_filter:
|
|
*
|
|
* Removes a callback that was previously added with
|
|
* _cogl_xlib_add_filter().
|
|
*/
|
|
void
|
|
_cogl_xlib_remove_filter (CoglNativeFilterFunc func,
|
|
void *data);
|
|
|
|
#endif /* __COGL_XLIB_PRIVATE_H */
|