1 /* 2 Copyright (C) 2005 by Ruben Henner Zilibowitz <rzilibowitz@users.sourceforge.net> 3 Part of the Toy Cars Project http://toycars.sourceforge.net 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the license. 7 This program is distributed in the hope that it will be useful, 8 but WITHOUT ANY WARRANTY. 9 10 See the COPYING file for more details. 11 */ 12 13 /* 14 * ScView.h 15 * Scoobie 16 * 17 * Created by Ruben Henner Zilibowitz on 25/11/04. 18 * 19 */ 20 21 #ifndef SCVIEW_H 22 #define SCVIEW_H 23 24 #ifdef HAVE_CONFIG_H 25 #include "config.h" 26 #endif 27 28 #include "ScTypes.h" 29 #include "ScAnimation.h" 30 31 class ScView 32 { 33 public: 34 ScView(const ScPortRect& inScreen, const ScRect& inView, ScAnimation &inAnimation); ~ScView()35 ~ScView() {} 36 37 void draw(); 38 39 void scrollTo(ScFloat centre_x, ScFloat centre_y); 40 void scrollBy(ScFloat dx, ScFloat dy); 41 getViewRect()42 ScRect& getViewRect() { return view; } getPortRect()43 ScPortRect getPortRect() { return screen; } 44 45 void resize(int width, int height); 46 47 static ScRect const *sActiveViewRect; 48 49 protected: 50 ScPortRect screen; 51 ScRect view; 52 ScAnimation &animation; 53 }; 54 55 #endif 56