VirtualScrollableSurface.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 **
00004 ** Copyright (C) 2006-2010 The TBT Team.
00005 **
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 **
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 **
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
00015 */
00016 
00017 #ifndef VIRTUALSCROLLABLESURFACE_HH_
00018 # define VIRTUALSCROLLABLESURFACE_HH_
00019 
00020 # include "Input.hh"
00021 # include "VirtualSurface.hh"
00022 
00028 class VirtualScrollableSurface : public VirtualSurface
00029 {
00030 public:
00031   VirtualScrollableSurface(const std::string& name,
00032                            Input& input,
00033                            const Point& real_size,
00034                            const Point& virtual_size);
00035   VirtualScrollableSurface(const std::string& name,
00036                            Input& input,
00037                            SDL_Surface* surf,
00038                            const Point& virtual_size);
00039   ~VirtualScrollableSurface();
00040 
00042   //   only if the visible/printed surface is larger than logical surface.
00045   void setAutomaticAdjust(bool enable);
00046   
00049   void moveScreenRect(const Point& to);
00050 
00056   virtual Rect getRenderRect() const;
00057 
00064   virtual Rect getScreenRect() const;
00065 
00066   virtual void setPos(const Point& to);
00067   
00068   virtual void update();
00069 
00070   virtual void blit(Surface& to);
00071   virtual void blit(Surface& to, const Rect& to_rect, const Rect& from_rect);
00072 
00073 private:
00074   void adjustSize(const Rect& rect);
00075 
00076   Input&        inp_;
00077 
00078   Point         real_size_;     
00079   Point         vpos_;          
00080   Point         dec_;           
00081   unsigned      last_updated_;  
00082 
00085   bool      adjust_to_center_;
00086   bool      adjust_x_;        
00087   bool      adjust_y_;        
00088   Point     adjust_orig_pos_; 
00089 };
00090 
00091 #endif /* !VIRTUALSCROLLABLESURFACE_HH_ */
Generated on Mon Apr 5 21:17:14 2010 for Stechec/TBT by  doxygen 1.6.3