canvas_x11_shm.h 734 Bytes
#ifndef __canvas_x11_shm_h__
#define __canvas_x11_shm_h__

#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>

#include <sys/ipc.h>
#include <sys/shm.h>

#include "canvas_x11.h"
#include "xclass.h"

class canvas_x11_shm : public canvas_x11 {
    protected:
        XShmSegmentInfo shminfo;

        virtual void create_buffer(void) {}

    public:
        canvas_x11_shm(unsigned, unsigned);
        virtual ~canvas_x11_shm();

        virtual void open_screen(void) {}
        virtual void blit_screen(void);
};

class canvas_x11_shm_factory : public canvas_factory {
    public:
        canvas* create(unsigned xs, unsigned ys) const {
            return new canvas_x11_shm(xs, ys);
        }
};

#endif // __canvas_x11_shm_h__