VirtualScrollableSurface.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 **
00004 ** Copyright (C) 2006 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 
00027 class VirtualScrollableSurface : public VirtualSurface
00028 {
00029 public:
00030   VirtualScrollableSurface(const std::string& name,
00031                            Input& input,
00032                            const Point& real_size,
00033                            const Point& virtual_size);
00034   VirtualScrollableSurface(const std::string& name,
00035                            Input& input,
00036                            SDL_Surface* surf,
00037                            const Point& virtual_size);
00038   ~VirtualScrollableSurface();
00039 
00041   //   only if the visible/printed surface is larger than logical surface.
00044   void setAutomaticAdjust(bool enable);
00045   
00046   virtual Rect getScreenRect() const;
00047 
00048   virtual void setPos(const Point& to);
00049   
00050   virtual void update();
00051 
00052   virtual void blit(Surface& to);
00053   virtual void blit(Surface& to, const Rect& to_rect, const Rect& from_rect);
00054 
00055 private:
00056   virtual Rect getRenderRect() const;
00057   void adjustSize(const Rect& rect);
00058 
00059   Input&        inp_;
00060 
00061   Point         real_size_;     
00062   Point         vpos_;          
00063   Point         dec_;           
00064   unsigned      last_updated_;  
00065 
00068   bool      adjust_to_center_;
00069   bool      adjust_x_;        
00070   bool      adjust_y_;        
00071   Point     adjust_orig_pos_; 
00072 };
00073 
00074 #endif /* !VIRTUALSCROLLABLESURFACE_HH_ */

Generated on Sat Jun 23 16:07:24 2007 for Stechec/TBT by  doxygen 1.4.7