diff options
author | Robert Bragg <robert.bragg@intel.com> | 2014-03-17 14:41:53 +0000 |
---|---|---|
committer | Robert Bragg <robert.bragg@intel.com> | 2014-03-24 19:37:23 +0000 |
commit | 02502db76eb595e2fb42bb4b22256238e5c4ea1a (patch) | |
tree | bf7a87798716c4e0a78bb00336afd2b48f866b65 | |
parent | 3a8ce32c291838906ce765919f885b5e4422b8ac (diff) | |
download | cogl-02502db76eb595e2fb42bb4b22256238e5c4ea1a.tar.gz |
xlib: remove deprecated apis
This removes some deprecated cogl_xlib_ code that depends on a global
CoglContext. Note: we keep cogl-xlib.h as a top-level header for xlib
specific apis. Since we now have no longer include cogl-xlib.h
internally this slightly simplifies the guarding inside the header to
trigger an error from now on if the header is use internally, as we do
for cogl.h.
-rw-r--r-- | cogl/Makefile.sources | 2 | ||||
-rw-r--r-- | cogl/cogl-xlib-private.h | 42 | ||||
-rw-r--r-- | cogl/cogl-xlib.c | 87 | ||||
-rw-r--r-- | cogl/cogl-xlib.h | 41 | ||||
-rw-r--r-- | cogl/winsys/cogl-texture-pixmap-x11.c | 2 |
5 files changed, 4 insertions, 170 deletions
diff --git a/cogl/Makefile.sources b/cogl/Makefile.sources index 4e4f86dd..9e340f37 100644 --- a/cogl/Makefile.sources +++ b/cogl/Makefile.sources @@ -297,8 +297,6 @@ cogl_xlib_sources_c = \ cogl-x11-renderer-private.h \ cogl-xlib-renderer-private.h \ cogl-xlib-renderer.c \ - cogl-xlib.c \ - cogl-xlib-private.h \ winsys/cogl-texture-pixmap-x11.c \ winsys/cogl-texture-pixmap-x11-private.h diff --git a/cogl/cogl-xlib-private.h b/cogl/cogl-xlib-private.h deleted file mode 100644 index fa3fd3d8..00000000 --- a/cogl/cogl-xlib-private.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Cogl - * - * A Low-Level GPU Graphics and Utilities API - * - * Copyright (C) 2010,2011 Intel Corporation. - * - * 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: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * 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. - * - * - */ - -#ifndef __COGL_XLIB_PRIVATE_H -#define __COGL_XLIB_PRIVATE_H - -#include <X11/Xlib.h> - -void -_cogl_xlib_query_damage_extension (void); - -int -_cogl_xlib_get_damage_base (void); - -#endif /* __COGL_XLIB_PRIVATE_H */ diff --git a/cogl/cogl-xlib.c b/cogl/cogl-xlib.c deleted file mode 100644 index f83747eb..00000000 --- a/cogl/cogl-xlib.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Cogl - * - * A Low-Level GPU Graphics and Utilities API - * - * Copyright (C) 2010,2011 Intel Corporation. - * - * 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: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Robert Bragg <robert@linux.intel.com> - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <cogl-xlib.h> - -#include <cogl-object-private.h> -#include <cogl-context-private.h> -#include <cogl-framebuffer-private.h> -#include <cogl-display-private.h> -#include <cogl-renderer-private.h> -#include <cogl-xlib-renderer-private.h> - -#include <X11/Xlib.h> -#include <X11/extensions/Xdamage.h> - -#include "cogl-xlib.h" -#include "cogl-xlib-private.h" - -/* These three functions are wrappers around the equivalent renderer - functions. They can be removed once all xlib-based backends in - Clutter know about the renderer */ -CoglFilterReturn -cogl_xlib_handle_event (XEvent *xevent) -{ - _COGL_GET_CONTEXT (ctx, COGL_FILTER_CONTINUE); - - /* Pass the event on to the renderer */ - return cogl_xlib_renderer_handle_event (ctx->display->renderer, xevent); -} - -void -_cogl_xlib_query_damage_extension (void) -{ - int damage_error; - Display *display; - - _COGL_GET_CONTEXT (ctxt, NO_RETVAL); - - /* Check whether damage events are supported on this display */ - display = cogl_xlib_renderer_get_display (ctxt->display->renderer); - if (!XDamageQueryExtension (display, &ctxt->damage_base, &damage_error)) - ctxt->damage_base = -1; -} - -int -_cogl_xlib_get_damage_base (void) -{ - CoglX11Renderer *x11_renderer; - _COGL_GET_CONTEXT (ctxt, -1); - - x11_renderer = - (CoglX11Renderer *) _cogl_xlib_renderer_get_data (ctxt->display->renderer); - return x11_renderer->damage_base; -} diff --git a/cogl/cogl-xlib.h b/cogl/cogl-xlib.h index 8d25d826..3131ea23 100644 --- a/cogl/cogl-xlib.h +++ b/cogl/cogl-xlib.h @@ -31,56 +31,21 @@ #include <X11/Xlib.h> -/* NB: this is a top-level header that can be included directly but we - * want to be careful not to define __COGL_H_INSIDE__ when this is - * included internally while building Cogl itself since - * __COGL_H_INSIDE__ is used in headers to guard public vs private api - * definitions - */ -#ifndef COGL_COMPILATION +#ifdef COGL_COMPILATION +#error "<cogl/cogl-xlib.h> shouldn't be included internally" +#endif /* Note: When building Cogl .gir we explicitly define * __COGL_XLIB_H_INSIDE__ */ #ifndef __COGL_XLIB_H_INSIDE__ #define __COGL_XLIB_H_INSIDE__ -#endif - -/* Note: When building Cogl .gir we explicitly define - * __COGL_H_INSIDE__ */ -#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ #define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif -#endif /* COGL_COMPILATION */ - #include <cogl/cogl-types.h> #include <cogl/cogl-xlib-renderer.h> -COGL_BEGIN_DECLS - -/* - * cogl_xlib_handle_event: - * @xevent: pointer to XEvent structure - * - * This function processes a single X event; it can be used to hook - * into external X 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. - * - * Stability: Unstable - */ -CoglFilterReturn -cogl_xlib_handle_event (XEvent *xevent); - -COGL_END_DECLS - - /* The gobject introspection scanner seems to parse public headers in * isolation which means we need to be extra careful about how we * define and undefine __COGL_H_INSIDE__ used to detect when internal diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c index 534f717f..9a6b4607 100644 --- a/cogl/winsys/cogl-texture-pixmap-x11.c +++ b/cogl/winsys/cogl-texture-pixmap-x11.c @@ -53,7 +53,7 @@ #include "cogl-object-private.h" #include "cogl-winsys-private.h" #include "cogl-pipeline-opengl-private.h" -#include "cogl-xlib.h" +#include "cogl-xlib-renderer.h" #include "cogl-error-private.h" #include "cogl-texture-gl-private.h" #include "cogl-private.h" |