4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
19 #include "frontends/WorkArea.h"
21 #include <X11/Xft/Xft.h>
27 typedef std::map<LColor_color, Gdk::Color *> Map;
28 typedef Map::iterator MapIt;
29 typedef std::map<LColor_color, XftColor *> Map2;
30 typedef Map2::iterator MapIt2;
33 Gdk::Color * getColor(LColor_color);
34 XftColor * getXftColor(LColor_color);
35 void cacheColor(LColor_color, Gdk::Color *);
36 void cacheXftColor(LColor_color, XftColor *);
43 extern ColorCache colorCache;
48 ColorHandler(GWorkArea& owner) : owner_(owner) {}
49 XftColor * getXftColor(LColor_color clr);
50 Gdk::Color * getGdkColor(LColor_color clr);
56 class GWorkArea : public WorkArea, public SigC::Object
59 GWorkArea(int width, int height);
62 virtual Painter & getPainter();
64 virtual int workWidth() const;
66 virtual int workHeight() const;
67 /// return x position of window
69 /// return y position of window
72 Glib::RefPtr<Gdk::Window> getWindow();
73 Display * getDisplay() const;
74 Glib::RefPtr<Gdk::Pixmap> getPixmap();
75 Glib::RefPtr<Gdk::GC> getGC();
76 Glib::RefPtr<Gdk::Colormap> getColormap();
77 XftDraw * getXftDraw();
78 ColorHandler & getColorHandler();
80 virtual void setScrollbarParams(int height, int pos, int line_height);
81 /// a selection exists
82 virtual void haveSelection(bool) const;
84 virtual std::string const getClipboard() const;
86 virtual void putClipboard(std::string const &) const;
87 void inputCommit(gchar * str);
89 bool onExpose(GdkEventExpose * event);
90 bool onConfigure(GdkEventConfigure * event);
92 bool onButtonPress(GdkEventButton * event);
93 bool onButtonRelease(GdkEventButton * event);
94 bool onMotionNotify(GdkEventMotion * event);
95 bool onKeyPress(GdkEventKey * event);
96 void onClipboardGet(Gtk::SelectionData& selection_data, guint info);
97 void onClipboardClear();
99 Gtk::DrawingArea workArea_;
100 Gtk::VScrollbar vscrollbar_;
101 /// The pixmap overlay on the workarea
102 Glib::RefPtr<Gdk::Pixmap> workAreaPixmap_;
103 Glib::RefPtr<Gdk::GC> workAreaGC_;
104 /// the xforms-specific painter
107 ColorHandler colorHandler_;
108 GtkIMContext * imContext_;
109 std::string inputCache_;