polybar/include/x11/graphics.hpp

30 lines
923 B
C++
Raw Normal View History

#pragma once
#include <xcb/xcb.h>
#include "common.hpp"
2016-11-26 05:13:20 +00:00
#include "x11/connection.hpp"
2016-11-19 05:22:44 +00:00
POLYBAR_NS
namespace graphics_util {
struct root_pixmap {
2017-01-19 10:11:28 +00:00
unsigned char depth{0};
unsigned short int width{0};
unsigned short int height{0};
short int x{0};
short int y{0};
xcb_pixmap_t pixmap{0};
};
2017-01-19 10:11:28 +00:00
bool create_window(connection& conn, xcb_window_t* win, short int x = 0, short int y = 0, unsigned short int w = 1, unsigned short int h = 1,
2016-11-25 07:42:31 +00:00
xcb_window_t root = 0);
2017-01-19 10:11:28 +00:00
bool create_pixmap(connection& conn, xcb_drawable_t dst, unsigned short int w, unsigned short int h, xcb_pixmap_t* pixmap);
bool create_pixmap(connection& conn, xcb_drawable_t dst, unsigned short int w, unsigned short int h, unsigned char d, xcb_pixmap_t* pixmap);
bool create_gc(connection& conn, xcb_drawable_t drawable, xcb_gcontext_t* gc);
bool get_root_pixmap(connection& conn, root_pixmap* rpix);
}
2016-11-19 05:22:44 +00:00
POLYBAR_NS_END