00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <gtkmm.h>
00021
00022 #include <papyrusmm/viewport.h>
00023 #include <papyrus/rectangle.h>
00024 #include <papyrus/image.h>
00025 #include <papyrus/circle.h>
00026 #include <papyrus/text.h>
00027 #include <papyrus/polyline.h>
00028 #include <papyrus/polygon.h>
00029 #include <papyrus/regularpolygon.h>
00030
00031 class Simple : public Gtk::Window
00032 {
00033
00034 public:
00035 Simple();
00036 virtual ~Simple();
00037
00038 protected:
00039
00040
00041
00042 Gtk::VBox m_vbox;
00043 Gtk::Frame m_frame;
00044 Gtk::HScale m_slider;
00045 Gtk::HScale m_zoom;
00046 Gtk::CheckButton m_animate;
00047 PapyrusGtk::Viewport m_viewport;
00048 Papyrus::Rectangle::pointer m_rect;
00049 Papyrus::Image::pointer m_png;
00050 Papyrus::Circle::pointer m_circle;
00051 Papyrus::Text::pointer m_text;
00052 Papyrus::Polyline::pointer m_lines;
00053 Papyrus::Polygon::pointer m_polygon;
00054 Papyrus::Rectangle::pointer m_bboxrect;
00055 Papyrus::Group::pointer m_bbox;
00056 Papyrus::RegularPolygon::pointer m_regularpolygon;
00057 Papyrus::Group::pointer m_grouped;
00058
00059 void slider_changed();
00060 void zoom_changed();
00061 bool animate_step();
00062 void animate_toggled();
00063 void on_sig_size_allocate(Gtk::Allocation&);
00064
00065 void adjust_canvas(int width, int height);
00066
00067 void draw_scene();
00068
00069 void update_bbox(double x, double y);
00070
00071 bool on_click(GdkEventButton* button);
00072
00073 };