4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2011 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #if !defined(__COGL_XLIB_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <cogl/cogl-xlib.h> can be included directly."
28 #ifndef __COGL_XLIB_RENDERER_H__
29 #define __COGL_XLIB_RENDERER_H__
34 #define __COGL_H_INSIDE__
35 #include <cogl/cogl-renderer.h>
39 #define cogl_xlib_renderer_handle_event \
40 cogl_xlib_renderer_handle_event_EXP
42 * cogl_xlib_renderer_handle_event:
43 * @event: pointer to an XEvent structure
45 * This function processes a single event; it can be used to hook into
46 * external event retrieval (for example that done by Clutter or
49 * Return value: #CoglFilterReturn. %COGL_FILTER_REMOVE indicates that
50 * Cogl has internally handled the event and the caller should do no
51 * further processing. %COGL_FILTER_CONTINUE indicates that Cogl is
52 * either not interested in the event, or has used the event to update
53 * internal state without taking any exclusive action.
56 cogl_xlib_renderer_handle_event (CoglRenderer *renderer,
61 * @event: pointer to an XEvent structure
62 * @data: The data that was given when the filter was added
64 * A callback function that can be registered with
65 * cogl_xlib_renderer_add_filter(). The function should return
66 * %COGL_FILTER_REMOVE if it wants to prevent further processing or
67 * %COGL_FILTER_CONTINUE otherwise.
69 typedef CoglFilterReturn (* CoglXlibFilterFunc) (XEvent *event,
72 #define cogl_xlib_renderer_add_filter cogl_xlib_renderer_add_filter_EXP
74 * cogl_xlib_renderer_add_filter:
76 * Adds a callback function that will receive all native events. The
77 * function can stop further processing of the event by return
78 * %COGL_FILTER_REMOVE.
81 cogl_xlib_renderer_add_filter (CoglRenderer *renderer,
82 CoglXlibFilterFunc func,
85 #define cogl_xlib_renderer_remove_filter \
86 cogl_xlib_renderer_remove_filter_EXP
88 * cogl_xlib_renderer_remove_filter:
90 * Removes a callback that was previously added with
91 * cogl_xlib_renderer_add_filter().
94 cogl_xlib_renderer_remove_filter (CoglRenderer *renderer,
95 CoglXlibFilterFunc func,
98 #define cogl_xlib_renderer_get_foreign_display \
99 cogl_xlib_renderer_get_foreign_display_EXP
101 * cogl_xlib_renderer_get_foreign_display:
103 * Return value: the foreign Xlib display that will be used by any Xlib based
104 * winsys backend. The display needs to be set with
105 * cogl_xlib_renderer_set_foreign_display() before this function is called.
108 cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer);
110 #define cogl_xlib_renderer_set_foreign_display \
111 cogl_xlib_renderer_set_foreign_display_EXP
113 * cogl_xlib_renderer_set_foreign_display:
115 * Sets a foreign Xlib display that Cogl will use for and Xlib based winsys
118 * Note that calling this function will automatically call
119 * cogl_xlib_renderer_set_event_retrieval_enabled() to disable Cogl's
120 * event retrieval. Cogl still needs to see all of the X events so the
121 * application should also use cogl_xlib_renderer_handle_event() if it
122 * uses this function.
125 cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
129 * cogl_xlib_renderer_set_event_retrieval_enabled:
130 * @renderer: A #CoglRenderer
131 * @enable: The new value
133 * Sets whether Cogl should automatically retrieve events from the X
134 * display. This defaults to %TRUE unless
135 * cogl_xlib_renderer_set_foreign_display() is called. It can be set
136 * to %FALSE if the application wants to handle its own event
137 * retrieval. Note that Cogl still needs to see all of the X events to
138 * function properly so the application should call
139 * cogl_xlib_renderer_handle_event() for each event if it disables
140 * automatic event retrieval.
143 * Stability: unstable
146 cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
149 #define cogl_xlib_renderer_get_display cogl_xlib_renderer_get_display_EXP
151 cogl_xlib_renderer_get_display (CoglRenderer *renderer);
155 #endif /* __COGL_XLIB_RENDERER_H__ */