| 1 | /*************************************************************************** |
| 2 | ui.h - description |
| 3 | ------------------- |
| 4 | begin : june 6th, 2003 |
| 5 | copyright : (C) 2003 by Duong Khang NGUYEN |
| 6 | email : neoneurone @ gmail com |
| 7 | |
| 8 | $Id: ui.h 375 2008-10-28 14:47:15Z neoneurone $ |
| 9 | ***************************************************************************/ |
| 10 | |
| 11 | /*************************************************************************** |
| 12 | * * |
| 13 | * This program is free software; you can redistribute it and/or modify * |
| 14 | * it under the terms of the GNU General Public License as published by * |
| 15 | * the Free Software Foundation; either version 2 of the License, or * |
| 16 | * any later version. * |
| 17 | * * |
| 18 | ***************************************************************************/ |
| 19 | |
| 20 | #ifndef _OPENCITY_UI_H_ |
| 21 | #define _OPENCITY_UI_H_ 1 |
| 22 | |
| 23 | #include "macros.h" |
| 24 | #include "SDL.h" |
| 25 | |
| 26 | //======================================================================== |
| 27 | /** This is the base class for all other User Interface classes. It |
| 28 | offers an interface that the derived class must implement in order |
| 29 | to deal with the user's inputs |
| 30 | */ |
| 31 | class UI { |
| 32 | public: |
| 33 | UI(); |
| 34 | virtual ~UI(); |
| 35 | |
| 36 | |
| 37 | //======================================================================== |
| 38 | /** This method handles the keyboard events such as: key down or up |
| 39 | \param rcsEvent The SDL keyboard event |
| 40 | */ |
| 41 | virtual void |
| 42 | Keyboard( const SDL_KeyboardEvent& rcEvent ) = 0; |
| 43 | |
| 44 | |
| 45 | //======================================================================== |
| 46 | /** This method handles the mouse motion event |
| 47 | \param rcsEvent The SDL mouse motion event |
| 48 | */ |
| 49 | virtual void |
| 50 | MouseMotion( const SDL_MouseMotionEvent& rcEvent ) = 0; |
| 51 | |
| 52 | |
| 53 | //======================================================================== |
| 54 | /** This method handles the mouse action event such as: mouse button |
| 55 | clicks or releases |
| 56 | \param rcsEvent The SDL mouse action event |
| 57 | */ |
| 58 | virtual void |
| 59 | MouseButton( const SDL_MouseButtonEvent& rcEvent ) = 0; |
| 60 | |
| 61 | |
| 62 | //======================================================================== |
| 63 | /** The expose event is received when the display needs to be updated. |
| 64 | \param rcsEvent The SDL expose event |
| 65 | */ |
| 66 | virtual void |
| 67 | Expose( const SDL_ExposeEvent& rcEvent ) = 0; |
| 68 | |
| 69 | |
| 70 | //======================================================================== |
| 71 | /** The resize event is received when display window is resized |
| 72 | \param rcsEvent The SDL resize |
| 73 | */ |
| 74 | virtual void |
| 75 | Resize( const SDL_ResizeEvent& rcEvent )= 0; |
| 76 | |
| 77 | }; |
| 78 | #endif |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 |