/* -*- mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- * vim: ts=4 sw=4 noet ai cindent syntax=cpp * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifdef BUILD_X11 #ifndef X11_H_ #define X11_H_ #include #include #include #ifdef BUILD_XFT #include #endif #ifdef BUILD_XDBE #include #endif #include "setting.hh" #define ATOM(a) XInternAtom(display, #a, False) #ifdef OWN_WINDOW enum window_type { TYPE_NORMAL = 0, TYPE_DOCK, TYPE_PANEL, 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 struct conky_window { Window root, window, desktop; Drawable drawable; Visual *visual; Colormap colourmap; GC gc; long border_inner_margin, border_outer_margin, border_width; #ifdef BUILD_XDBE XdbeBackBuffer back_buffer; #endif #ifdef BUILD_XFT XftDraw *xftdraw; #endif int width; int height; #ifdef OWN_WINDOW int x; int y; unsigned long hints; #endif }; #ifdef BUILD_XDBE extern int use_xdbe; #endif #ifdef BUILD_XFT extern int use_xft; #endif #if defined(BUILD_ARGB) && defined(OWN_WINDOW) /* true if use_argb_visual=true and argb visual was found*/ extern bool have_argb_visual; #endif extern Display *display; extern int display_width; extern int display_height; extern int screen; extern int workarea[4]; extern struct conky_window window; extern char window_created; void init_X11(const char*); void init_window(int width, int height, int back_colour, char **argv, int argc); void destroy_window(void); void create_gc(void); void set_transparent_background(Window win); void get_x11_desktop_info(Display *display, Atom atom); void set_struts(int); void print_monitor(struct text_object *, char *, int); void print_monitor_number(struct text_object *, char *, int); void print_desktop(struct text_object *, char *, int); void print_desktop_number(struct text_object *, char *, int); void print_desktop_name(struct text_object *, char *, int); void free_desktop_info(void); #ifdef BUILD_XDBE void xdbe_swap_buffers(void); #endif /* BUILD_XDBE */ /* alignments */ enum alignment { TOP_LEFT, TOP_RIGHT, TOP_MIDDLE, BOTTOM_LEFT, BOTTOM_RIGHT, BOTTOM_MIDDLE, MIDDLE_LEFT, MIDDLE_MIDDLE, MIDDLE_RIGHT, NONE }; extern conky::config_setting text_alignment; extern conky::config_setting out_to_x; #ifdef OWN_WINDOW extern conky::config_setting own_window; extern conky::config_setting set_transparent; extern conky::config_setting own_window_class; extern conky::config_setting own_window_title; extern conky::config_setting own_window_type; #ifdef BUILD_ARGB extern conky::config_setting use_argb_visual; /* range of 0-255 for alpha */ extern conky::config_setting> own_window_argb_value; #endif #endif /*OWN_WINDOW*/ #endif /*X11_H_*/ #endif /* BUILD_X11 */