| 1 |
/*************************************************************************** |
| 2 |
eventmanager.cpp - description |
| 3 |
------------------- |
| 4 |
begin : Fri Sep 15 2000 |
| 5 |
copyright : (C) 2000 by Waldemar Baraldi |
| 6 |
email : [email protected] |
| 7 |
***************************************************************************/ |
| 8 |
|
| 9 |
/*************************************************************************** |
| 10 |
* * |
| 11 |
* This program is free software; you can redistribute it and/or modify * |
| 12 |
* it under the terms of the GNU General Public License as published by * |
| 13 |
* the Free Software Foundation; either version 2 of the License, or * |
| 14 |
* (at your option) any later version. * |
| 15 |
* * |
| 16 |
***************************************************************************/ |
| 17 |
|
| 18 |
#include "eventmanager.h"cxx . . $ `<file>/src/eventmanager.h`/ |
| 19 |
|
| 20 |
EventManagercxx . . $ EventManager#::EventManagercxx . . $ EventManager#EventManager(49f6e7a06ebc5aa8).(){ |
| 21 |
|
| 22 |
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNOREcxx . . $ `<external>/11062667682718636558/SDL_events.h:235:9`!); |
| 23 |
SDL_EventState(SDL_MOUSEBUTTONDOWN, SDL_IGNOREcxx . . $ `<external>/11062667682718636558/SDL_events.h:235:9`!); |
| 24 |
SDL_EventState(SDL_MOUSEBUTTONUP, SDL_IGNOREcxx . . $ `<external>/11062667682718636558/SDL_events.h:235:9`!); |
| 25 |
SDL_EventState(SDL_KEYUP, SDL_IGNOREcxx . . $ `<external>/11062667682718636558/SDL_events.h:235:9`!); |
| 26 |
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAYcxx . . $ `<external>/7651474761296421915/SDL_keyboard.h:45:9`!, SDL_DEFAULT_REPEAT_INTERVALcxx . . $ `<external>/7651474761296421915/SDL_keyboard.h:46:9`!); |
| 27 |
lista_streamscxx . . $ EventManager#lista_streams.=new Listcxx . . $ List#(); |
| 28 |
} |
| 29 |
|
| 30 |
EventManagercxx . . $ EventManager#::~cxx . . $ EventManager#`~EventManager`(ced63f7c635d850d).EventManagercxx . . $ EventManager#(){ |
| 31 |
lista_streamscxx . . $ EventManager#lista_streams.->emptycxx . . $ List#empty(b45ddcbc8423892c).(true); |
| 32 |
delete lista_streamscxx . . $ EventManager#lista_streams.; |
| 33 |
} |
| 34 |
|
| 35 |
void EventManagercxx . . $ EventManager#::addStreamcxx . . $ EventManager#addStream(bd52e798fbdcdd33).(EventStreamcxx . . $ EventStream# * s){ |
| 36 |
lista_streamscxx . . $ EventManager#lista_streams.->insertcxx . . $ List#insert(77801c3fa529a778).(lista_streamscxx . . $ EventManager#lista_streams.->getEndcxx . . $ List#getEnd(614bd0134ee89c3a).(), s); |
| 37 |
} |
| 38 |
|
| 39 |
void EventManagercxx . . $ EventManager#::removeStreamcxx . . $ EventManager#removeStream(bd52e798fbdcdd33).(EventStreamcxx . . $ EventStream# * s){ |
| 40 |
lista_streamscxx . . $ EventManager#lista_streams.->removecxx . . $ List#remove(da900e49d65ef0fc).(lista_streamscxx . . $ EventManager#lista_streams.->indexOfcxx . . $ List#indexOf(482d5cb2a3992a34).(s)); |
| 41 |
} |
| 42 |
|
| •43 |
void EventManagercxx . . $ EventManager#::pumpEventscxx . . $ EventManager#pumpEvents(b45ddcbc8423892c).(bool wait){ |
| 44 |
SDL_Event event; |
| 45 |
Indexcxx . . $ Index# * stream; |
| 46 |
bool got=false; |
| 47 |
|
| 48 |
do{ |
| 49 |
while (SDL_PollEvent(&event)>0){ |
| 50 |
got=true; |
| 51 |
switch (event.type){ |
| 52 |
case SDL_KEYDOWN:{ |
| 53 |
stream=lista_streamscxx . . $ EventManager#lista_streams.->getFirstcxx . . $ List#getFirst(614bd0134ee89c3a).(); |
| 54 |
while ((stream!=lista_streamscxx . . $ EventManager#lista_streams.->getEndcxx . . $ List#getEnd(614bd0134ee89c3a).()) && |
| 55 |
((EventStreamcxx . . $ EventStream#*)(lista_streamscxx . . $ EventManager#lista_streams.->getObjectcxx . . $ List#getObject(a6ae6972207746c4).(stream)))->putcxx . . $ EventStream#put(c639a5ad6be24f82).(event.key.keysym.sym)){ |
| 56 |
stream=lista_streamscxx . . $ EventManager#lista_streams.->getNextcxx . . $ List#getNext(72af0511b327ff3e).(stream); |
| 57 |
} |
| 58 |
} |
| 59 |
default:break; |
| 60 |
} |
| 61 |
} |
| 62 |
if (wait && !got) SDL_WaitEvent(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 63 |
}while (wait && !got); |
| 64 |
} |
| 65 |
|