/* -*- C++ -*- * Copyright ©2005 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef OUTPUT_XROOT_H #define OUTPUT_XROOT_H #include "magellan/output.h" #include "config.h" #ifdef HAVE_BOOST_THREAD #include #endif extern "C" { #include } class Output_XRoot : public Output { public: Output_XRoot(int update); virtual ~Output_XRoot(); virtual void setpixel(const ivec2& pos, int r, int g, int b); virtual void commit(); virtual void textmetrics(const std::string&, const std::string&, ivec2&, ivec2&, ivec2&) { } virtual void drawtext(const std::string&, const std::string&, Output::RenderFlags) { } static Output* parser( ConfigLexer*, const std::string&, const std::string& ); virtual bool repeated(void) const { return update >= 0; } virtual int updatetime(void) const { return update; } private: Display* display; int screen; Window root; Colormap colourmap; XImage* pixmap; GC maingc; int depth; // Height, width defined in superclass as xmax, ymax int red_shift, red_length; int green_shift, green_length; int blue_shift, blue_length; int update; #ifdef HAVE_BOOST_THREAD boost::mutex lock; #endif int get_minbit(unsigned long x) const; }; #endif