2011-06-28 13:16:24 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 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, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2012-06-20 17:49:08 +00:00
|
|
|
#if !defined(__COGL_XLIB_H_INSIDE__) && !defined(COGL_COMPILATION)
|
2011-10-17 16:55:35 +00:00
|
|
|
#error "Only <cogl/cogl-xlib.h> can be included directly."
|
2011-06-28 13:16:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __COGL_XLIB_RENDERER_H__
|
|
|
|
#define __COGL_XLIB_RENDERER_H__
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
2012-02-18 01:19:17 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#define __COGL_H_INSIDE__
|
|
|
|
#include <cogl/cogl-renderer.h>
|
2011-06-28 13:16:24 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cogl_xlib_renderer_handle_event:
|
|
|
|
* @event: pointer to an XEvent structure
|
|
|
|
*
|
|
|
|
* This function processes a single event; it can be used to hook into
|
|
|
|
* external event retrieval (for example that done by Clutter or
|
|
|
|
* GDK).
|
|
|
|
*
|
|
|
|
* Return value: #CoglFilterReturn. %COGL_FILTER_REMOVE indicates that
|
|
|
|
* Cogl has internally handled the event and the caller should do no
|
|
|
|
* further processing. %COGL_FILTER_CONTINUE indicates that Cogl is
|
|
|
|
* either not interested in the event, or has used the event to update
|
|
|
|
* internal state without taking any exclusive action.
|
|
|
|
*/
|
|
|
|
CoglFilterReturn
|
|
|
|
cogl_xlib_renderer_handle_event (CoglRenderer *renderer,
|
|
|
|
XEvent *event);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CoglXlibFilterFunc:
|
|
|
|
* @event: pointer to an XEvent structure
|
|
|
|
* @data: The data that was given when the filter was added
|
|
|
|
*
|
|
|
|
* A callback function that can be registered with
|
|
|
|
* cogl_xlib_renderer_add_filter(). The function should return
|
|
|
|
* %COGL_FILTER_REMOVE if it wants to prevent further processing or
|
|
|
|
* %COGL_FILTER_CONTINUE otherwise.
|
|
|
|
*/
|
|
|
|
typedef CoglFilterReturn (* CoglXlibFilterFunc) (XEvent *event,
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cogl_xlib_renderer_add_filter:
|
|
|
|
*
|
|
|
|
* Adds a callback function that will receive all native events. The
|
|
|
|
* function can stop further processing of the event by return
|
|
|
|
* %COGL_FILTER_REMOVE.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_xlib_renderer_add_filter (CoglRenderer *renderer,
|
|
|
|
CoglXlibFilterFunc func,
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cogl_xlib_renderer_remove_filter:
|
|
|
|
*
|
|
|
|
* Removes a callback that was previously added with
|
|
|
|
* cogl_xlib_renderer_add_filter().
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_xlib_renderer_remove_filter (CoglRenderer *renderer,
|
|
|
|
CoglXlibFilterFunc func,
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cogl_xlib_renderer_get_foreign_display:
|
|
|
|
*
|
|
|
|
* Return value: the foreign Xlib display that will be used by any Xlib based
|
|
|
|
* winsys backend. The display needs to be set with
|
|
|
|
* cogl_xlib_renderer_set_foreign_display() before this function is called.
|
|
|
|
*/
|
|
|
|
Display *
|
|
|
|
cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cogl_xlib_renderer_set_foreign_display:
|
|
|
|
*
|
|
|
|
* Sets a foreign Xlib display that Cogl will use for and Xlib based winsys
|
|
|
|
* backend.
|
2011-12-16 18:50:49 +00:00
|
|
|
*
|
|
|
|
* Note that calling this function will automatically call
|
|
|
|
* cogl_xlib_renderer_set_event_retrieval_enabled() to disable Cogl's
|
|
|
|
* event retrieval. Cogl still needs to see all of the X events so the
|
|
|
|
* application should also use cogl_xlib_renderer_handle_event() if it
|
|
|
|
* uses this function.
|
2011-06-28 13:16:24 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
|
|
|
|
Display *display);
|
|
|
|
|
2011-12-16 18:50:49 +00:00
|
|
|
/**
|
|
|
|
* cogl_xlib_renderer_set_event_retrieval_enabled:
|
|
|
|
* @renderer: A #CoglRenderer
|
|
|
|
* @enable: The new value
|
|
|
|
*
|
|
|
|
* Sets whether Cogl should automatically retrieve events from the X
|
|
|
|
* display. This defaults to %TRUE unless
|
|
|
|
* cogl_xlib_renderer_set_foreign_display() is called. It can be set
|
|
|
|
* to %FALSE if the application wants to handle its own event
|
|
|
|
* retrieval. Note that Cogl still needs to see all of the X events to
|
|
|
|
* function properly so the application should call
|
|
|
|
* cogl_xlib_renderer_handle_event() for each event if it disables
|
|
|
|
* automatic event retrieval.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
CoglBool enable);
|
2011-12-16 18:50:49 +00:00
|
|
|
|
2011-06-28 13:16:24 +00:00
|
|
|
Display *
|
|
|
|
cogl_xlib_renderer_get_display (CoglRenderer *renderer);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __COGL_XLIB_RENDERER_H__ */
|