2000-04-16 22:27:30 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995-2000 The LyX Team
|
|
|
|
*
|
|
|
|
* ======================================================*/
|
|
|
|
|
|
|
|
#ifndef COLOR_HANDLER_H
|
|
|
|
#define COLOR_HANDLER_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-03-07 16:18:05 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
2000-04-16 22:27:30 +00:00
|
|
|
// This is only included to provide stuff for the non-public sections
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
|
|
#include "PainterBase.h"
|
|
|
|
|
|
|
|
class LyXFont;
|
|
|
|
class WorkArea;
|
|
|
|
|
|
|
|
///
|
|
|
|
class LyXColorHandler {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
LyXColorHandler();
|
|
|
|
///
|
|
|
|
~LyXColorHandler();
|
|
|
|
///
|
|
|
|
unsigned long colorPixel(LColor::color c);
|
|
|
|
///
|
|
|
|
GC getGCForeground(LColor::color c);
|
|
|
|
///
|
|
|
|
GC getGCLinepars(PainterBase::line_style,
|
|
|
|
PainterBase::line_width, LColor::color c);
|
2000-06-26 15:33:13 +00:00
|
|
|
/// update the cache after a color definition change
|
|
|
|
void updateColor(LColor::color c);
|
|
|
|
|
2000-04-16 22:27:30 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
Display * display;
|
|
|
|
///
|
|
|
|
Colormap colormap;
|
|
|
|
///
|
|
|
|
GC colorGCcache[LColor::ignore + 1];
|
|
|
|
///
|
|
|
|
typedef std::map<int, GC> LineGCCache;
|
|
|
|
///
|
|
|
|
LineGCCache lineGCcache;
|
|
|
|
///
|
|
|
|
Pixmap drawable;
|
|
|
|
};
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2001-03-07 16:18:05 +00:00
|
|
|
extern boost::scoped_ptr<LyXColorHandler> lyxColorHandler;
|
2000-04-16 22:27:30 +00:00
|
|
|
|
|
|
|
#endif
|