2009-07-28 21:44:22 +00:00
|
|
|
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */
|
|
|
|
|
2009-05-31 14:48:16 +00:00
|
|
|
#ifdef X11
|
2008-06-14 18:41:12 +00:00
|
|
|
#ifndef X11_H_
|
|
|
|
#define X11_H_
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
|
|
|
|
#ifdef XFT
|
|
|
|
#include <X11/Xft/Xft.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_XDBE
|
|
|
|
#include <X11/extensions/Xdbe.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ATOM(a) XInternAtom(display, #a, False)
|
|
|
|
|
|
|
|
#ifdef OWN_WINDOW
|
|
|
|
enum _window_type {
|
|
|
|
TYPE_NORMAL = 0,
|
|
|
|
TYPE_DOCK,
|
2009-06-13 21:36:28 +00:00
|
|
|
TYPE_PANEL,
|
2008-06-14 18:41:12 +00:00
|
|
|
TYPE_DESKTOP,
|
|
|
|
TYPE_OVERRIDE
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _window_hints {
|
|
|
|
HINT_UNDECORATED = 0,
|
|
|
|
HINT_BELOW,
|
|
|
|
HINT_ABOVE,
|
|
|
|
HINT_STICKY,
|
|
|
|
HINT_SKIP_TASKBAR,
|
|
|
|
HINT_SKIP_PAGER
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SET_HINT(mask, hint) (mask |= (1 << hint))
|
|
|
|
#define TEST_HINT(mask, hint) (mask & (1 << hint))
|
|
|
|
#endif
|
|
|
|
|
2009-08-07 07:24:24 +00:00
|
|
|
struct conky_window {
|
2008-06-14 18:41:12 +00:00
|
|
|
Window root, window, desktop;
|
|
|
|
Drawable drawable;
|
2009-07-08 08:09:06 +00:00
|
|
|
Visual *visual;
|
|
|
|
Colormap colourmap;
|
2008-06-14 18:41:12 +00:00
|
|
|
GC gc;
|
2009-07-08 08:09:06 +00:00
|
|
|
long border_inner_margin, border_outer_margin, border_width;
|
|
|
|
|
2008-06-14 18:41:12 +00:00
|
|
|
#ifdef HAVE_XDBE
|
|
|
|
XdbeBackBuffer back_buffer;
|
|
|
|
#endif
|
|
|
|
#ifdef XFT
|
|
|
|
XftDraw *xftdraw;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
#ifdef OWN_WINDOW
|
|
|
|
char class_name[256];
|
|
|
|
char title[256];
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
unsigned int type;
|
|
|
|
unsigned long hints;
|
|
|
|
#endif
|
2009-08-07 07:24:24 +00:00
|
|
|
};
|
2008-06-14 18:41:12 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XDBE
|
|
|
|
extern int use_xdbe;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef XFT
|
|
|
|
extern int use_xft;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern Display *display;
|
|
|
|
extern int display_width;
|
|
|
|
extern int display_height;
|
|
|
|
extern int screen;
|
|
|
|
|
|
|
|
extern int workarea[4];
|
|
|
|
|
2009-08-07 07:24:24 +00:00
|
|
|
extern struct conky_window window;
|
|
|
|
|
2009-04-01 17:06:31 +00:00
|
|
|
void init_X11(const char*);
|
2008-06-14 18:41:12 +00:00
|
|
|
void init_window(int use_own_window, int width, int height, int set_trans,
|
|
|
|
int back_colour, char **argv, int argc);
|
2009-05-20 03:34:43 +00:00
|
|
|
void destroy_window(void);
|
2008-06-14 18:41:12 +00:00
|
|
|
void create_gc(void);
|
|
|
|
void set_transparent_background(Window win);
|
|
|
|
long get_x11_color(const char *);
|
2009-07-14 14:57:51 +00:00
|
|
|
void get_x11_desktop_info(Display *display, Atom atom);
|
2009-06-13 21:36:28 +00:00
|
|
|
void set_struts(int);
|
2008-06-14 18:41:12 +00:00
|
|
|
|
2009-08-05 21:41:29 +00:00
|
|
|
#ifdef HAVE_XDBE
|
|
|
|
void xdbe_swap_buffers(void);
|
|
|
|
#endif /* HAVE_XDBE */
|
|
|
|
|
2008-06-14 18:41:12 +00:00
|
|
|
#endif /*X11_H_*/
|
2009-05-31 14:48:16 +00:00
|
|
|
#endif /* X11 */
|