forked from yvt/xtbook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
XTBEventManager.cpp
57 lines (49 loc) · 1.21 KB
/
XTBEventManager.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// XTBEventManager.cpp
// XTBook
//
// Created by Kawada Tomoaki on 5/29/11.
// Copyright 2011 Nexhawks. All rights reserved.
//
#include "XTBEventManager.h"
#include <exception>
#include "platform.h"
#include <tcw/twStrConv.h>
#include <tcw/twApp.h>
XTBEventManager::XTBEventManager(){
}
XTBEventManager::~XTBEventManager(){
}
bool XTBEventManager::dealEvent(SDL_Event &ev){
try{
return twSDLEvent::dealEvent(ev);
}catch(const std::exception& ex){
XTBLog("exception '%s' while processing an event.",
ex.what());
}catch(const std::wstring& str){
XTBLog("exception '%s' while processing an event.",
twW2M(str).c_str());
}catch(const std::string& str){
XTBLog("exception '%s' while processing an event.",
str.c_str());
}catch(const wchar_t *str){
XTBLog("exception '%s' while processing an event.",
twW2M(str).c_str());
}catch(const char *str){
XTBLog("exception '%s' while processing an event.",
str);
}catch(...){
XTBLog("unknown exception while processing an event.");
}
return true;
}
twEvent *twCreateEvent(){
return new XTBEventManager();
}
twApp *twCreateApp(){
twApp *app=new twApp();
#ifdef _WIN32_WCE
app->setAutoSize(twSize(480, 320));
#endif
return app;
}