Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# sdlmm_eventhandler.h

Go to the documentation of this file.

    00001 /*
    00002  * SDLmm - a C++ wrapper for SDL and related libraries
    00003  * Copyright © 2001 David Hedbor <david@hedbor.org>
    00004  *
    00005  * This program is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU General Public License as
    00007  * published by the Free Software Foundation; either version 2 of the
    00008  * License, or (at your option) any later version.
    00009  *
    00010  * This program is distributed in the hope that it will be useful, but
    00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU General Public License
    00016  * along with this program; if not, write to the Free Software
    00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018  *
    00019  */
    00020
    00021 #ifndef SDLMM_EVENTHANDLER_H
    00022 #define SDLMM_EVENTHANDLER_H
    00023
    00024 namespace SDLmm {
    00026
    00035   class EventHandler {
    00036   public:
    00038
    00039
    00040
    00055     virtual bool HandleKeyboardEvent(SDL_keysym &keysym, bool pressed) {
    00056       return false;
    00057     }
    00058
    00060
    00076     virtual bool HandleKeyPressEvent(SDL_keysym &keysym) {
    00077       return HandleKeyboardEvent(keysym, true);
    00078     }
    00079
    00081
    00095     virtual bool HandleKeyReleaseEvent(SDL_keysym &keysym) {
    00096       return HandleKeyboardEvent(keysym, false);
    00097     }
    00099
    00101
    00102
    00103
    00127     virtual bool HandleMouseMotionEvent(Uint8 state, Uint16 x, Uint16 y,
    00128                                         Sint16 xrel, Sint16 yrel) {
    00129       return false;
    00130     }
    00131
    00133
    00155     virtual bool HandleMouseButtonEvent(Uint8 button, Uint16 x, Uint16 y,
    00156                                         bool pressed) {
    00157       return false;
    00158     }
    00159
    00161
    00181     virtual bool HandleMouseButtonPressEvent(Uint8 button,
    00182                                              Uint16 x, Uint16 y) {
    00183       return HandleMouseButtonEvent(button, x, y, true);
    00184     }
    00185
    00187
    00207     virtual bool HandleMouseButtonReleaseEvent(Uint8 button,
    00208                                                Uint16 x, Uint16 y) {
    00209       return HandleMouseButtonEvent(button, x, y, false);
    00210     }
    00212
    00214
    00215
    00216
    00230     virtual bool HandleJoyAxisEvent(Uint8 joystick, Uint8 axis,
    00231                                     Sint16 value) {
    00232       return false;
    00233     }
    00234
    00236
    00257     virtual bool HandleJoyButtonEvent(Uint8 joystick, Uint8 button,
    00258                                       bool pressed) {
    00259       return false;
    00260     }
    00261
    00263
    00283     virtual bool HandleJoyButtonPressEvent(Uint8 joystick, Uint8 button) {
    00284       return HandleJoyButtonEvent(joystick, button, true);
    00285     }
    00286
    00288
    00308     virtual bool HandleJoyButtonReleaseEvent(Uint8 joystick, Uint8 button) {
    00309       return HandleJoyButtonEvent(joystick, button, false);
    00310     }
    00311
    00313
    00344     virtual bool HandleJoyHatEvent(Uint8 joystick, Uint8 hat, Uint8 value) {
    00345       return false;
    00346     }
    00347
    00349
    00369     virtual bool HandleJoyBallEvent(Uint8 joystick, Uint8 ball,
    00370                                     Sint16 xrel, Sint16 yrel) {
    00371       return false;
    00372     }
    00373
    00375
    00377
    00378
    00379
    00402     virtual bool HandleActiveEvent(bool gain, Uint8 state) {
    00403       return false;
    00404     }
    00405
    00407
    00424     virtual bool HandleResizeEvent(int w, int h) {
    00425       return false;
    00426     }
    00427
    00429
    00451     virtual bool HandleSysWMEvent() {
    00452       return false;
    00453     }
    00454
    00456
    00473
    00475
    00476     virtual bool HandleUserEvent(Uint8 type, int code,
    00477                                  void *data1, void *data2) {
    00478       return false;
    00479     }
    00480
    00482
    00499     virtual bool HandleQuitEvent() {
    00500       return false;
    00501     }
    00503
    00505
    00517     virtual bool HandleEvent(SDL_Event &event) {
    00518       return false;
    00519     }
    00520
    00521   };
    00522 }
    00523
    00524 #endif // SDLMM_EVENTHANDLER_H
    00525

Documentation automatically generated by written by Dimitri van Heesch. | Project hosted at