1 /*
2 * Cogl
3 *
4 * A Low Level GPU Graphics and Utilities API
5 *
6 * Copyright (C) 2011 Intel Corporation.
7 *
8 * Permission is hereby granted, free of charge, to any person
9 * obtaining a copy of this software and associated documentation
10 * files (the "Software"), to deal in the Software without
11 * restriction, including without limitation the rights to use, copy,
12 * modify, merge, publish, distribute, sublicense, and/or sell copies
13 * of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 *
28 * Authors:
29 * Robert Bragg <robert@linux.intel.com>
30 */
31
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35
36 #include "cogl-renderer-private.h"
37 #include "cogl-win32-renderer.h"
38
39 CoglFilterReturn
cogl_win32_renderer_handle_event(CoglRenderer * renderer,MSG * event)40 cogl_win32_renderer_handle_event (CoglRenderer *renderer,
41 MSG *event)
42 {
43 return _cogl_renderer_handle_native_event (renderer, event);
44 }
45
46 void
cogl_win32_renderer_add_filter(CoglRenderer * renderer,CoglWin32FilterFunc func,void * data)47 cogl_win32_renderer_add_filter (CoglRenderer *renderer,
48 CoglWin32FilterFunc func,
49 void *data)
50 {
51 _cogl_renderer_add_native_filter (renderer,
52 (CoglNativeFilterFunc)func, data);
53 }
54
55 void
cogl_win32_renderer_remove_filter(CoglRenderer * renderer,CoglWin32FilterFunc func,void * data)56 cogl_win32_renderer_remove_filter (CoglRenderer *renderer,
57 CoglWin32FilterFunc func,
58 void *data)
59 {
60 _cogl_renderer_remove_native_filter (renderer,
61 (CoglNativeFilterFunc)func, data);
62 }
63
64 void
cogl_win32_renderer_set_event_retrieval_enabled(CoglRenderer * renderer,CoglBool enable)65 cogl_win32_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
66 CoglBool enable)
67 {
68 _COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
69 /* NB: Renderers are considered immutable once connected */
70 _COGL_RETURN_IF_FAIL (!renderer->connected);
71
72 renderer->win32_enable_event_retrieval = enable;
73 }
74