#include <sdltimer.h>
Collaboration diagram for Wt::SDLTimer:
Public Member Functions | |
SDLTimer (Object *receiver, int id, int interval) | |
~SDLTimer () | |
void | scheduleNext () |
int | interval () const |
Static Public Member Functions | |
static void | init () |
static void | quit () |
Static Private Member Functions | |
static void | handleTimerEvent (const SDL_Event *event) |
Private Attributes | |
Event | sdl_timer_event |
SDL_TimerID | timerid_ |
int | interval_ |
Classes | |
class | Event |
Definition at line 33 of file sdltimer.h.
Definition at line 51 of file sdltimer.cpp.
References scheduleNext().
00051 : 00052 sdl_timer_event(Event(receiver, id)), 00053 timerid_(interval ? SDL_AddTimer(interval, 00054 timer_callback, &sdl_timer_event) : 00055 0), 00056 interval_(interval) { 00057 scheduleNext(); 00058 }
Here is the call graph for this function:
Wt::SDLTimer::~SDLTimer | ( | ) |
void Wt::SDLTimer::handleTimerEvent | ( | const SDL_Event * | event | ) | [static, private] |
Definition at line 77 of file sdltimer.cpp.
References Wt::SDLTimer::Event::id(), Wt::Application::postEvent(), Wt::SDLTimer::Event::receiver(), and sdl_timer_event.
Referenced by init().
00077 { 00078 Event *sdl_timer_event = static_cast<Event *>(event->user.data1); 00079 Application::postEvent(sdl_timer_event->receiver(), 00080 new TimerEvent(sdl_timer_event->id())); 00081 delete sdl_timer_event; 00082 }
Here is the call graph for this function:
void Wt::SDLTimer::init | ( | ) | [static] |
Definition at line 70 of file sdltimer.cpp.
References handleTimerEvent(), Wt::Singleton< DERIVED >::instance(), and Wt::SDLEvent::Time.
Referenced by Wt::Application::Application().
00070 { 00071 SDLEvent& sdlevent = *SDLEvent::instance(); 00072 sdlevent[SDLEvent::Time] = &handleTimerEvent; 00073 }
Here is the call graph for this function:
int Wt::SDLTimer::interval | ( | ) | const [inline] |
Definition at line 38 of file sdltimer.h.
References interval_.
00038 { 00039 return interval_; 00040 }
void Wt::SDLTimer::quit | ( | ) | [static] |
void Wt::SDLTimer::scheduleNext | ( | ) |
Definition at line 65 of file sdltimer.cpp.
References interval_, sdl_timer_event, and Wt::timer_callback().
Referenced by Wt::Object::event(), and SDLTimer().
00065 { 00066 if (!interval_) 00067 timer_callback(interval_, &sdl_timer_event); 00068 }
Here is the call graph for this function:
int Wt::SDLTimer::interval_ [private] |
Event Wt::SDLTimer::sdl_timer_event [private] |
SDL_TimerID Wt::SDLTimer::timerid_ [private] |
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.