#define GWORKAREA_H
#include "GPainter.h"
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
#include "frontends/WorkArea.h"
+#include <gtkmm.h>
+#include <gtk/gtk.h>
+
#include <X11/Xft/Xft.h>
class LColor_color;
+class LyXView;
+
+namespace lyx {
+namespace frontend {
-class ColorCache
-{
- typedef std::map<LColor_color, Gdk::Color *> Map;
+class ColorCache {
+public:
+ typedef std::map<LColor_color, boost::shared_ptr<Gdk::Color> > Map;
typedef Map::iterator MapIt;
- typedef std::map<LColor_color, XftColor *> Map2;
+ typedef std::map<LColor_color, boost::shared_ptr<XftColor> > Map2;
typedef Map2::iterator MapIt2;
-public:
- ~ColorCache();
Gdk::Color * getColor(LColor_color);
XftColor * getXftColor(LColor_color);
void cacheColor(LColor_color, Gdk::Color *);
extern ColorCache colorCache;
-class ColorHandler
-{
+class ColorHandler {
public:
- ColorHandler(GWorkArea& owner) : owner_(owner) {}
+ ColorHandler(GWorkArea & owner) : owner_(owner) {}
XftColor * getXftColor(LColor_color clr);
Gdk::Color * getGdkColor(LColor_color clr);
private:
};
-class GWorkArea : public WorkArea, public SigC::Object
-{
+class GWorkArea : public WorkArea, public sigc::trackable {
public:
- GWorkArea(int width, int height);
+ GWorkArea(LyXView & owner, int width, int height);
~GWorkArea();
virtual Painter & getPainter();
/// a selection exists
virtual void haveSelection(bool) const;
///
- virtual string const getClipboard() const;
+ virtual std::string const getClipboard() const;
///
- virtual void putClipboard(string const &) const;
+ virtual void putClipboard(std::string const &) const;
void inputCommit(gchar * str);
private:
bool onExpose(GdkEventExpose * event);
bool onConfigure(GdkEventConfigure * event);
void onScroll();
+ bool onScrollWheel(GdkEventScroll * event);
bool onButtonPress(GdkEventButton * event);
bool onButtonRelease(GdkEventButton * event);
bool onMotionNotify(GdkEventMotion * event);
bool onKeyPress(GdkEventKey * event);
- void onClipboardGet(Gtk::SelectionData& selection_data, guint info);
+ void onClipboardGet(Gtk::SelectionData & selection_data, guint info);
void onClipboardClear();
Gtk::HBox hbox_;
Gtk::DrawingArea workArea_;
XftDraw * draw_;
ColorHandler colorHandler_;
GtkIMContext * imContext_;
- string inputCache_;
+ std::string inputCache_;
};
+} // namespace frontend
+} // namespace lyx
+
#endif