src/SAL_eventhandler.h

00001 /*
00002     SAL - Simple Application Library
00003     Copyright (C) 2006-2006 Kronon
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019     Kronon
00020     kronon88@users.sourceforge.net
00021 */
00022 
00023 //SAL event handling
00024 //Created by Kronon
00025 
00026 //All the events that come into the program are handled by this file.
00027 
00028 #ifndef SAL_EVENT_HANDLER_H
00029 #define SAL_EVENT_HANDLER_H
00030 
00031 //Library's
00032 
00033 #include "SAL.h"
00034 
00035 //SDL lib's
00036 #include "SDL/SDL.h"
00037 
00038 int SAL_search_object(int x, int y, SAL_gui_object *& target);                                  //Search for an object with mouse position
00039 int SAL_search_object(Uint16 unicode, SAL_gui_object *& target);                                //Search for an object with fastkey
00040 int SAL_start_event_listener(int & mouse_delay, int & keyboard_delay);
00041 
00042 //Add handlers
00043 int salSetActionHandler(int (*action)(int action_id));
00044 int salSetMouseHandler(int (*mouse)(int x, int y, char button, char pressed));
00045 int salSetKeyboardHandler(int (*keyboard)(SDLKey key, SDLMod mod));
00046 
00047 //Threads
00048 int SAL_event_listener(void * unused);
00049 int SAL_mouse_listener(void * unused);
00050 int SAL_keyboard_listener(void * unused);
00051 
00052 #endif