Canola  0.8.D001
canola/window/card_reader.h
Go to the documentation of this file.
00001 //
00002 // canola - canon canola 1614p emulator
00003 // Copyright (C) 2012 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, version 3, as
00007 // published by the Free Software Foundation.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License along
00015 // with this program. If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef CANOLA_WINDOW_CARD_READER_H
00019 #define CANOLA_WINDOW_CARD_READER_H
00020 
00021 #include <lib/config.h>
00022 #include <gtkmm.h>
00023 #include <vector>
00024 #include <boost/shared_ptr.hpp>
00025 
00026 #include <canola/calculator/proxy.h>
00027 
00028 class calculator_gnome;
00029 
00035 class window_card_reader:
00036     public Gtk::Window
00037 {
00038 public:
00039     typedef Glib::RefPtr<window_card_reader> pointer;
00040 
00044     virtual ~window_card_reader();
00045 
00054     static pointer create(calculator_gnome *dst);
00055 
00069     bool start(const std::string &src, bool binary = false);
00070 
00075     bool is_busy();
00076 
00077 private:
00082     window_card_reader(calculator_gnome *dst);
00083 
00088     calculator_proxy dst;
00089 
00094     Gtk::Fixed layout;
00095 
00096     typedef Glib::RefPtr<Gdk::Pixbuf> pixbuf_ptr_t;
00097 
00098     typedef std::vector<pixbuf_ptr_t> card_pixbufs_t;
00099 
00105     card_pixbufs_t card_pixbufs;
00106 
00107     typedef boost::shared_ptr<Gtk::Image> gtk_image_ptr_t;
00108 
00109     typedef std::vector<gtk_image_ptr_t> card_image_widgets_t;
00110 
00115     card_image_widgets_t card_image_widgets;
00116 
00121     bool empty(void) const;
00122 
00128     sigc::connection animation_timer;
00129 
00136     double pixels_per_second;
00137 
00144     int pixels_per_instruction;
00145 
00151     int current_address;
00152 
00158     size_t current_card_number;
00159 
00166     bool currently_moving_left;
00167 
00174     double current_card_started;
00175 
00180     bool on_animation_timer(void);
00181 
00186     void done(void);
00187 
00192     window_card_reader();
00193 
00201     window_card_reader(const window_card_reader &rhs);
00202 
00210     window_card_reader &operator=(const window_card_reader &rhs);
00211 };
00212 
00213 #endif // CANOLA_WINDOW_CARD_READER_H