00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef HOTSPOTWIDGET_H
00023 #define HOTSPOTWIDGET_H
00024
00025 #include <gtkmm/drawingarea.h>
00026 #include <gtkmm/image.h>
00027 #include <vector>
00028
00029 #include "case.h"
00030
00035 class HotspotWidget: public Gtk::DrawingArea {
00036 public:
00038 HotspotWidget();
00039
00044 void update_coords(int x, int y);
00045
00050 void update_dimensions(int w, int h);
00051
00055 void set_image(const Glib::RefPtr<Gdk::Pixbuf> &pb) { m_Pixbuf=pb; }
00056
00060 Case::Hotspot get_hotspot() const { return m_Hotspot; }
00061
00063 sigc::signal<void, int, int> signal_point_changed() const { return m_SigPointChanged; }
00064
00066 sigc::signal<void, int, int> signal_dimensions_changed() const { return m_SigDimensionsChanged; }
00067
00068 private:
00069
00070 sigc::signal<void, int, int> m_SigPointChanged;
00071 sigc::signal<void, int, int> m_SigDimensionsChanged;
00072
00073
00074 virtual void on_realize();
00075
00076
00077 virtual bool on_expose_event(GdkEventExpose *e);
00078
00079
00080 virtual bool on_button_press_event(GdkEventButton *e);
00081
00082
00083 virtual bool on_motion_notify_event(GdkEventMotion *e);
00084
00085
00086 Glib::RefPtr<Gdk::Pixbuf> m_Pixbuf;
00087
00088
00089 Glib::RefPtr<Gdk::GC> m_GC;
00090
00091
00092 Gdk::Color m_Red;
00093
00095 bool m_MouseDown;
00096
00098 Case::Hotspot m_Hotspot;
00099 };
00100
00101 #endif