X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2F3dengfx%2Fsrc%2Ffxwt%2Ffxwt.hpp;fp=src%2F3dengfx%2Fsrc%2Ffxwt%2Ffxwt.hpp;h=b7684c2f887bf5074adaa7cc011d5cf6e8b1518b;hb=6e23259dbabaeb1711a2a5ca25b9cb421f693759;hp=0000000000000000000000000000000000000000;hpb=fe068fa879814784c45e0cb2e65dac489e8f5594;p=summerhack diff --git a/src/3dengfx/src/fxwt/fxwt.hpp b/src/3dengfx/src/fxwt/fxwt.hpp new file mode 100644 index 0000000..b7684c2 --- /dev/null +++ b/src/3dengfx/src/fxwt/fxwt.hpp @@ -0,0 +1,78 @@ +/* +This file is part of fxwt, the window system toolkit of 3dengfx. + +Copyright (c) 2004, 2005 John Tsiombikas + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* main fxwt event handling and system abstraction. + * + * Author: John Tsiombikas 2004 + */ + +#ifndef _FXWT_HPP_ +#define _FXWT_HPP_ + +#include + +#include "text.hpp" +#include "init.hpp" +#include "keysyms.hpp" + +namespace fxwt { + + enum { + BN_LEFT = 1, + BN_MIDDLE = 2, + BN_RIGHT = 3, + BN_WHEELUP = 4, + BN_WHEELDOWN = 5 + }; + + extern std::list disp_handlers; + extern std::list idle_handlers; + extern std::list keyb_handlers; + extern std::list motion_handlers; + extern std::list button_handlers; + + extern bool button_state[6]; + extern int screenx, screeny; + + void init(); + + void set_display_handler(void (*handler)()); + void set_idle_handler(void (*handler)()); + void set_keyboard_handler(void (*handler)(int)); + void set_motion_handler(void (*handler)(int, int)); + void set_button_handler(void (*handler)(int, int, int, int)); + + void remove_display_handler(void (*handler)()); + void remove_idle_handler(void (*handler)()); + void remove_keyboard_handler(void (*handler)(int)); + void remove_motion_handler(void (*handler)(int, int)); + void remove_button_handler(void (*handler)(int, int, int, int)); + + bool mouse_button_pressed(int bn); + + Vector2 get_mouse_pos_normalized(); + + void set_window_title(const char *title); + void swap_buffers(); + + int main_loop(); +} + +#endif /* _FXWT_HPP_ */