00001 /* 00002 * This file is part of the "Archon" framework. 00003 * (http://files3d.sourceforge.net) 00004 * 00005 * Copyright © 2006 by Kristian Spangsege and Brian Kristiansen. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and 00008 * its documentation under the terms of the GNU General Public License is 00009 * hereby granted. No representations are made about the suitability of 00010 * this software for any purpose. It is provided "as is" without express 00011 * or implied warranty. See the GNU General Public License 00012 * (http://www.gnu.org/copyleft/gpl.html) for more details. 00013 * 00014 * The characters in this file are ISO8859-1 encoded. 00015 * 00016 * The documentation in this file is in "Doxygen" style 00017 * (http://www.doxygen.org). 00018 */ 00019 00020 #ifndef ARCHON_DISPLAY_WINDOW_H 00021 #define ARCHON_DISPLAY_WINDOW_H 00022 00023 #include <string> 00024 00025 #include <archon/display/drawable.H> 00026 #include <archon/display/keysyms.H> 00027 00028 namespace Archon 00029 { 00030 namespace Display 00031 { 00032 using namespace std; 00033 using namespace Utilities; 00034 00040 struct EventHandler 00041 { 00042 virtual void resize(int w, int h) {} 00043 virtual void close() {} 00044 virtual void focusIn() {} 00045 virtual void focusOut() {} 00046 virtual void mouseIn() {} 00047 virtual void mouseOut() {} 00048 virtual void mouseDown() {} 00049 virtual void mouseUp() {} 00050 virtual void mouseMove() {} 00051 virtual void mouseClick() {} 00052 virtual void keyDown(KeySym) {} 00053 virtual void keyUp(KeySym) {} 00054 virtual ~EventHandler() {} 00055 }; 00056 00057 00070 struct Window: Drawable 00071 { 00077 virtual void setTitle(string title) = 0; 00078 00091 virtual void move(int left, int top) = 0; 00092 00102 virtual void resize(int width, int height) = 0; 00103 00111 virtual int getWidth() = 0; 00112 00120 virtual int getHeight() = 0; 00121 00127 virtual void swapBuffers() = 0; 00128 00136 virtual void processEvents(EventHandler *h) = 0; 00137 }; 00138 } 00139 } 00140 00141 #endif // ARCHON_DISPLAY_WINDOW_H