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>
28 typedef std::map<LColor_color, Gdk::Color *> Map;
29 typedef Map::iterator MapIt;
30 typedef std::map<LColor_color, XftColor *> Map2;
31 typedef Map2::iterator MapIt2;
34 Gdk::Color * getColor(LColor_color);
35 XftColor * getXftColor(LColor_color);
36 void cacheColor(LColor_color, Gdk::Color *);
37 void cacheXftColor(LColor_color, XftColor *);
44 extern ColorCache colorCache;
49 ColorHandler(GWorkArea& owner) : owner_(owner) {}
50 XftColor * getXftColor(LColor_color clr);
51 Gdk::Color * getGdkColor(LColor_color clr);
57 class GWorkArea : public WorkArea, public SigC::Object
60 GWorkArea(LyXView & owner, int width, int height);
63 virtual Painter & getPainter();
65 virtual int workWidth() const;
67 virtual int workHeight() const;
68 /// return x position of window
70 /// return y position of window
73 Glib::RefPtr<Gdk::Window> getWindow();
74 Display * getDisplay() const;
75 Glib::RefPtr<Gdk::Pixmap> getPixmap();
76 Glib::RefPtr<Gdk::GC> getGC();
77 Glib::RefPtr<Gdk::Colormap> getColormap();
78 XftDraw * getXftDraw();
79 ColorHandler & getColorHandler();
81 virtual void setScrollbarParams(int height, int pos, int line_height);
82 /// a selection exists
83 virtual void haveSelection(bool) const;
85 virtual std::string const getClipboard() const;
87 virtual void putClipboard(std::string const &) const;
88 void inputCommit(gchar * str);
90 bool onExpose(GdkEventExpose * event);
91 bool onConfigure(GdkEventConfigure * event);
93 bool onButtonPress(GdkEventButton * event);
94 bool onButtonRelease(GdkEventButton * event);
95 bool onMotionNotify(GdkEventMotion * event);
96 bool onKeyPress(GdkEventKey * event);
97 void onClipboardGet(Gtk::SelectionData& selection_data, guint info);
98 void onClipboardClear();
100 Gtk::DrawingArea workArea_;
101 Gtk::VScrollbar vscrollbar_;
102 /// The pixmap overlay on the workarea
103 Glib::RefPtr<Gdk::Pixmap> workAreaPixmap_;
104 Glib::RefPtr<Gdk::GC> workAreaGC_;
105 /// the xforms-specific painter
108 ColorHandler colorHandler_;
109 GtkIMContext * imContext_;
110 std::string inputCache_;