Switch from Nz prefix to namespace Nz for linux

Former-commit-id: 64eeaf3c633254b04910ebd4576fd9e910002be0
This commit is contained in:
Youri Hubaut
2015-09-27 15:58:49 +02:00
parent 752518ef14
commit 37586e7283
49 changed files with 3918 additions and 3732 deletions

View File

@@ -7,88 +7,93 @@
#ifndef NAZARA_SCOPEDXCB_HPP
#define NAZARA_SCOPEDXCB_HPP
#include <Nazara/Prerequesites.hpp>
#include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h>
class NzScopedXCBConnection
namespace Nz
{
public:
NzScopedXCBConnection();
~NzScopedXCBConnection();
class ScopedXCBConnection
{
public:
ScopedXCBConnection();
~ScopedXCBConnection();
operator xcb_connection_t*() const;
operator xcb_connection_t*() const;
private:
xcb_connection_t* m_connection;
};
private:
xcb_connection_t* m_connection;
};
class NzScopedXCBEWMHConnection
{
public:
NzScopedXCBEWMHConnection(xcb_connection_t* connection);
~NzScopedXCBEWMHConnection();
class ScopedXCBEWMHConnection
{
public:
ScopedXCBEWMHConnection(xcb_connection_t* connection);
~ScopedXCBEWMHConnection();
xcb_ewmh_connection_t* operator ->() const;
xcb_ewmh_connection_t* operator ->() const;
operator xcb_ewmh_connection_t*() const;
operator xcb_ewmh_connection_t*() const;
private:
xcb_ewmh_connection_t* m_ewmhConnection;
};
private:
xcb_ewmh_connection_t* m_ewmhConnection;
};
template <typename T>
class NzScopedXCB
{
public:
NzScopedXCB(T* pointer);
~NzScopedXCB();
template <typename T>
class ScopedXCB
{
public:
ScopedXCB(T* pointer);
~ScopedXCB();
T* operator ->() const;
T** operator &();
T* operator ->() const;
T** operator &();
operator bool() const;
operator bool() const;
T* get() const;
T* get() const;
private:
T* m_pointer;
};
private:
T* m_pointer;
};
class NzXCBGContext
{
public:
NzXCBGContext(xcb_connection_t* connection);
~NzXCBGContext();
class XCBGContext
{
public:
XCBGContext(xcb_connection_t* connection);
~XCBGContext();
bool Create(xcb_drawable_t drawable, uint32_t value_mask, const uint32_t* value_list);
bool Create(xcb_drawable_t drawable, uint32_t value_mask, const uint32_t* value_list);
void Destroy();
void Destroy();
operator xcb_gcontext_t() const;
operator xcb_gcontext_t() const;
private:
xcb_connection_t* m_connection;
xcb_gcontext_t m_gcontext;
};
private:
xcb_connection_t* m_connection;
xcb_gcontext_t m_gcontext;
};
class NzXCBPixmap
{
public:
NzXCBPixmap();
NzXCBPixmap(xcb_connection_t* connection);
~NzXCBPixmap();
class XCBPixmap
{
public:
XCBPixmap();
XCBPixmap(xcb_connection_t* connection);
~XCBPixmap();
void Connect(xcb_connection_t* connection);
bool Create(uint8_t depth, xcb_drawable_t drawable, uint16_t width, uint16_t height);
bool CreatePixmapFromBitmapData(xcb_drawable_t drawable, uint8_t* data, uint32_t width, uint32_t height, uint32_t depth, uint32_t fg, uint32_t bg, xcb_gcontext_t* gcp);
void Connect(xcb_connection_t* connection);
bool Create(uint8_t depth, xcb_drawable_t drawable, uint16_t width, uint16_t height);
bool CreatePixmapFromBitmapData(xcb_drawable_t drawable, uint8_t* data, uint32_t width, uint32_t height, uint32_t depth, uint32_t fg, uint32_t bg, xcb_gcontext_t* gcp);
void Destroy();
void Destroy();
operator xcb_pixmap_t() const;
operator xcb_pixmap_t() const;
private:
xcb_connection_t* m_connection;
xcb_pixmap_t m_pixmap;
};
private:
xcb_connection_t* m_connection;
xcb_pixmap_t m_pixmap;
};
}
#include <Nazara/Utility/X11/ScopedXCB.inl>