srpcgen: Use 'const char*' for string parameters
[chromium-blink-merge.git] / content / common / gpu / x_util.h
blob6e2423cbfbaf9e9e972dc61b00b4e8c3bd177558
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_GPU_X_UTIL_H_
6 #define CHROME_GPU_X_UTIL_H_
7 #pragma once
9 // Some X-Windows specific stuff. This can be included on any platform, and will
10 // be a NOP on non-Linux ones.
12 #include "build/build_config.h"
13 #include "content/common/gpu/gpu_config.h"
15 #if defined(USE_X11)
17 // Forward declares ------------------------------------------------------------
19 // X Windows headers do a lot of evil stuff, like "#define Status int" which
20 // will cause many problems when combined with our other header files (like
21 // ones that define a class local enum called "Status."
23 // These definitions are not Kosher, but allow us to remove this dependency and
24 // actually compile X at all.
26 typedef unsigned long XID;
28 extern "C" {
30 typedef struct _XDisplay Display;
31 typedef struct __GLXcontextRec *GLXContext;
33 } // extern "C"
35 // Utils -----------------------------------------------------------------------
37 // scoped_ptr functor for XFree(). Use as follows:
38 // scoped_ptr_mallox<XVisualInfo, ScopedPtrXFree> foo(...);
39 // where "XVisualInfo" is any X type that is freed with XFree.
40 class ScopedPtrXFree {
41 public:
42 void operator()(void* x) const;
45 #endif // USE_X11
47 #endif // CHROME_GPU_X_UTIL_H_