2010-05-19 15:13:07 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* A Low Level GPU Graphics and Utilities API
|
2010-05-19 15:13:07 +00:00
|
|
|
*
|
2010-11-05 12:28:33 +00:00
|
|
|
* Copyright (C) 2011 Intel Corporation.
|
2010-05-19 15:13:07 +00:00
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person
|
|
|
|
* obtaining a copy of this software and associated documentation
|
|
|
|
* files (the "Software"), to deal in the Software without
|
|
|
|
* restriction, including without limitation the rights to use, copy,
|
|
|
|
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
|
|
* of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2010-05-19 15:13:07 +00:00
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
2010-05-19 15:13:07 +00:00
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
|
|
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2010-05-19 15:13:07 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
#ifndef __COGL_RENDERER_XLIB_PRIVATE_H
|
|
|
|
#define __COGL_RENDERER_XLIB_PRIVATE_H
|
2010-05-19 15:13:07 +00:00
|
|
|
|
2018-05-21 19:57:38 +00:00
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
#include "cogl-object-private.h"
|
|
|
|
#include "cogl-xlib-private.h"
|
2011-06-28 13:16:24 +00:00
|
|
|
#include "cogl-x11-renderer-private.h"
|
2011-12-16 18:50:49 +00:00
|
|
|
#include "cogl-context.h"
|
2012-11-12 16:31:16 +00:00
|
|
|
#include "cogl-output.h"
|
2010-06-04 09:38:30 +00:00
|
|
|
|
2011-06-28 13:16:24 +00:00
|
|
|
typedef struct _CoglXlibRenderer
|
2010-11-05 12:28:33 +00:00
|
|
|
{
|
2011-06-28 13:16:24 +00:00
|
|
|
CoglX11Renderer _parent;
|
2010-05-19 15:13:07 +00:00
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
Display *xdpy;
|
2010-05-19 15:13:07 +00:00
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
/* Current top of the XError trap state stack. The actual memory for
|
|
|
|
these is expected to be allocated on the stack by the caller */
|
|
|
|
CoglXlibTrapState *trap_state;
|
2011-12-16 18:50:49 +00:00
|
|
|
|
2012-11-12 16:31:16 +00:00
|
|
|
unsigned long outputs_update_serial;
|
2015-07-22 19:17:52 +00:00
|
|
|
|
|
|
|
XVisualInfo *xvisinfo;
|
2011-06-28 13:16:24 +00:00
|
|
|
} CoglXlibRenderer;
|
2010-11-05 12:28:33 +00:00
|
|
|
|
2018-11-24 12:04:47 +00:00
|
|
|
gboolean
|
2019-06-18 06:02:10 +00:00
|
|
|
_cogl_xlib_renderer_connect (CoglRenderer *renderer, GError **error);
|
2010-11-05 12:28:33 +00:00
|
|
|
|
|
|
|
void
|
2011-06-28 13:16:24 +00:00
|
|
|
_cogl_xlib_renderer_disconnect (CoglRenderer *renderer);
|
2010-05-19 15:13:07 +00:00
|
|
|
|
2010-06-04 09:38:30 +00:00
|
|
|
/*
|
2011-06-28 13:16:24 +00:00
|
|
|
* cogl_xlib_renderer_trap_errors:
|
2010-06-04 09:38:30 +00:00
|
|
|
* @state: A temporary place to store data for the trap.
|
|
|
|
*
|
2011-06-28 13:16:24 +00:00
|
|
|
* Traps every X error until _cogl_xlib_renderer_untrap_errors()
|
2011-05-25 21:23:06 +00:00
|
|
|
* called. You should allocate an uninitialised CoglXlibTrapState
|
|
|
|
* struct on the stack to pass to this function. The same pointer
|
2011-06-28 13:16:24 +00:00
|
|
|
* should later be passed to _cogl_xlib_renderer_untrap_errors().
|
2011-05-25 21:23:06 +00:00
|
|
|
*
|
2011-06-28 13:16:24 +00:00
|
|
|
* Calls to _cogl_xlib_renderer_trap_errors() can be nested as long as
|
|
|
|
* _cogl_xlib_renderer_untrap_errors() is called with the
|
2011-05-25 21:23:06 +00:00
|
|
|
* corresponding state pointers in reverse order.
|
2010-06-04 09:38:30 +00:00
|
|
|
*/
|
|
|
|
void
|
2011-06-28 13:16:24 +00:00
|
|
|
_cogl_xlib_renderer_trap_errors (CoglRenderer *renderer,
|
2010-11-05 12:28:33 +00:00
|
|
|
CoglXlibTrapState *state);
|
2010-06-04 09:38:30 +00:00
|
|
|
|
|
|
|
/*
|
2011-06-28 13:16:24 +00:00
|
|
|
* cogl_xlib_renderer_untrap_errors:
|
|
|
|
* @state: The state that was passed to _cogl_xlib_renderer_trap_errors().
|
2010-06-04 09:38:30 +00:00
|
|
|
*
|
|
|
|
* Removes the X error trap and returns the current status.
|
|
|
|
*
|
|
|
|
* Return value: the trapped error code, or 0 for success
|
|
|
|
*/
|
|
|
|
int
|
2011-06-28 13:16:24 +00:00
|
|
|
_cogl_xlib_renderer_untrap_errors (CoglRenderer *renderer,
|
2010-11-05 12:28:33 +00:00
|
|
|
CoglXlibTrapState *state);
|
2010-06-04 09:38:30 +00:00
|
|
|
|
2011-12-12 13:27:33 +00:00
|
|
|
CoglXlibRenderer *
|
|
|
|
_cogl_xlib_renderer_get_data (CoglRenderer *renderer);
|
|
|
|
|
2013-04-16 22:46:03 +00:00
|
|
|
int64_t
|
|
|
|
_cogl_xlib_renderer_get_dispatch_timeout (CoglRenderer *renderer);
|
2011-12-16 18:50:49 +00:00
|
|
|
|
2012-11-12 16:31:16 +00:00
|
|
|
CoglOutput *
|
|
|
|
_cogl_xlib_renderer_output_for_rectangle (CoglRenderer *renderer,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
#endif /* __COGL_RENDERER_XLIB_PRIVATE_H */
|