1 /* === S Y N F I G ========================================================= */
2 /*! \file dock_navigator.h
3 ** \brief Navigator Dock Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_DOCK_NAVIGATOR_H
26 #define __SYNFIG_DOCK_NAVIGATOR_H
28 /* === H E A D E R S ======================================================= */
29 #include "sigc++/signal.h"
31 #include <gtkmm/drawingarea.h>
32 #include <gdkmm/pixbuf.h>
33 #include <gtkmm/adjustment.h>
34 #include <gtkmm/label.h>
36 #include <synfig/renddesc.h>
38 #include "canvasview.h"
39 #include "dock_canvasspecific.h"
40 #include "widget_distance.h"
42 #include <ETL/smart_ptr>
44 /* === M A C R O S ========================================================= */
46 /* === T Y P E D E F S ===================================================== */
48 /* === C L A S S E S & S T R U C T S ======================================= */
53 class Widget_NavView : public Gtk::Table
55 //handle to out parent canvas
56 CanvasView::LooseHandle canvview;
58 Glib::RefPtr<Gdk::Pixbuf> prev;
62 Gtk::DrawingArea drawto;
65 Gtk::Adjustment adj_zoom;
66 Gtk::Label zoom_print;
71 //asyncronous rendering stuff
72 etl::handle<AsyncRenderer> renderer;
73 etl::smart_ptr<synfig::Surface> surface;
76 //drawing functionality
77 void on_start_render(); //breaks out into asynchronous rendering
78 void on_finish_render();
79 void on_draw(); //renders the small thing we have
80 void on_dirty_preview(); //dirties the preview for rerender
82 //for the zoom buttons
86 //handles the zoom scroller
87 bool on_scroll_event(GdkEvent *event);
88 void on_number_modify();
91 bool on_mouse_event(GdkEvent * e);
93 //draws the gotten bitmap on the draw area
94 bool on_expose_draw(GdkEventExpose *exp=0);
96 //for when the canvasview view changes (boolean value scrolling solves cyclic problems)
97 void on_workarea_view_change();
100 Widget_NavView(CanvasView::LooseHandle cv = CanvasView::LooseHandle());
103 etl::loose_handle<studio::CanvasView> get_canvas_view() {return canvview;}
106 class Dock_Navigator : public Dock_CanvasSpecific
108 Widget_NavView dummy;
114 virtual void changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);
117 }; // END of namespace studio
119 /* === E N D =============================================================== */