00001 00005 /* Copyright © 2009 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 #ifndef VIEWPORT_H_ 00012 #define VIEWPORT_H_ 00013 00014 #include <gtkmm/table.h> 00015 #include <gtkmm/scrollbar.h> 00016 #include <gtkmm/adjustment.h> 00017 00018 #include <libtrack/document/Document.h> 00019 00020 #include "View.h" 00021 00025 class Viewport : public Gtk::Table 00026 { 00027 public: 00032 Viewport(); 00033 00039 Viewport(Viewport & viewport); 00040 00041 virtual ~Viewport(); 00042 typedef View::ViewAngle ViewAngle; 00043 00044 void set_document(Document::Document & document); 00045 00048 void update(); 00049 00051 void set_angle(const ViewAngle angle); 00052 00054 void zoom_in(); 00056 void zoom_out(); 00057 00059 void scale_to_fit(); 00060 00062 void realize_view(); 00063 00074 sigc::signal<void, boost::shared_ptr<Document::DocumentDelta> > signal_command(); 00075 00077 sigc::signal<void, boost::shared_ptr<Document::DocumentDelta> > signal_preview_command(); 00078 00080 sigc::signal<void> signal_preview_cancel(); 00081 protected: 00083 void create(); 00084 00089 void resize_adjustments(); 00090 00094 bool on_h_scrollbar_change_value(Gtk::ScrollType scroll, double new_value); 00098 bool on_v_scrollbar_change_value(Gtk::ScrollType scroll, double new_value); 00099 00100 virtual bool on_scroll_event(GdkEventScroll* event); 00101 00102 // scrollbars 00103 Gtk::Adjustment m_h_scroll_adjustment; 00104 Gtk::HScrollbar m_h_scroll_bar; 00105 Gtk::Adjustment m_v_scroll_adjustment; 00106 Gtk::VScrollbar m_v_scroll_bar; 00108 View m_view; 00109 00111 Document::Document * document; 00112 }; 00113 00114 #endif /*VIEWPORT_H_*/
Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.