Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

x_util.h

// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_GPU_X_UTIL_H_
#define CHROME_GPU_X_UTIL_H_

// Some X-Windows specific stuff. This can be included on any platform, and will
// be a NOP on non-Linux ones.

#include "build/build_config.h"
#include "chrome/gpu/gpu_config.h"

#if defined(OS_LINUX)

// Forward declares ------------------------------------------------------------
//
// X Windows headers do a lot of evil stuff, like "#define Status int" which
// will cause many problems when combined with our other header files (like
// ones that define a class local enum called "Status."
//
// These definitions are not Kosher, but allow us to remove this dependency and
// actually compile X at all.

typedef unsigned long XID;

extern "C" {

typedef struct _XDisplay Display;
typedef struct __GLXcontextRec *GLXContext;

}  // extern "C"

// Utils -----------------------------------------------------------------------

// scoped_ptr functor for XFree(). Use as follows:
//   scoped_ptr_mallox<XVisualInfo, ScopedPtrXFree> foo(...);
// where "XVisualInfo" is any X type that is freed with XFree.
class ScopedPtrXFree {
 public:
  void operator()(void* x) const;
};

#endif  // OS_LINUX

#endif  // CHROME_GPU_X_UTIL_H_

Generated by  Doxygen 1.6.0   Back to index