synfig-studio  1.0.3
dock_navigator.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_DOCK_NAVIGATOR_H
26 #define __SYNFIG_DOCK_NAVIGATOR_H
27 
28 /* === H E A D E R S ======================================================= */
29 #include "sigc++/signal.h"
30 
31 #include <gtkmm/drawingarea.h>
32 #include <gdkmm/pixbuf.h>
33 #include <gtkmm/adjustment.h>
34 #include <gtkmm/label.h>
35 
36 #include <synfig/renddesc.h>
37 
38 #include "canvasview.h"
41 
42 #include <ETL/smart_ptr>
43 
44 /* === M A C R O S ========================================================= */
45 
46 /* === T Y P E D E F S ===================================================== */
47 
48 /* === C L A S S E S & S T R U C T S ======================================= */
49 
50 namespace studio {
51 class AsyncRenderer;
52 
53 class Widget_NavView : public Gtk::Table
54 {
55  //handle to out parent canvas
56  CanvasView::LooseHandle canvview;
57 
58  Glib::RefPtr<Gdk::Pixbuf> prev;
59  bool dirty;
60 
61  //The drawing stuff
62  Gtk::DrawingArea drawto;
63 
64  //The input stuff
65  Glib::RefPtr<Gtk::Adjustment> adj_zoom;
66  Gtk::Label zoom_print;
67 
68  //zoom window stuff
69  bool scrolling;
70 
71  //asynchronous rendering stuff
72  etl::handle<AsyncRenderer> renderer;
73  etl::smart_ptr<synfig::Surface> surface;
74  cairo_surface_t* cairo_surface;
75  bool rendering;
76 
77  //drawing functionality
78  void on_start_render(); //breaks out into asynchronous rendering
79  void on_finish_render();
80  void on_draw(); //renders the small thing we have
81  void on_dirty_preview(); //dirties the preview for rerender
82 
83  //for the zoom buttons
84  void on_zoom_in();
85  void on_zoom_out();
86 
87  //handles the zoom scroller
88  using Gtk::Widget::on_scroll_event;
89  bool on_scroll_event(GdkEvent *event);
90  void on_number_modify();
91 
92  //
93  bool on_mouse_event(GdkEvent * e);
94 
95  //draws the gotten bitmap on the draw area
96  bool on_drawto_draw(const Cairo::RefPtr<Cairo::Context> &cr);
97 
98  //for when the canvasview view changes (boolean value scrolling solves cyclic problems)
99  void on_workarea_view_change();
100 
101 public:
103  ~Widget_NavView();
104 
105  etl::loose_handle<studio::CanvasView> get_canvas_view() {return canvview;}
106 };
107 
109 {
110  Widget_NavView dummy;
111 
112 public:
113  Dock_Navigator();
114  ~Dock_Navigator();
115 
116  virtual void changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);
117 };
118 
119 }; // END of namespace studio
120 
121 /* === E N D =============================================================== */
122 
123 #endif