-
Notifications
You must be signed in to change notification settings - Fork 0
/
twApplication.h
107 lines (94 loc) · 2.73 KB
/
twApplication.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef TWAPPLICATION_H_INCLUDED
#define TWAPPLICATION_H_INCLUDED
#define SLOT(slot) (bool (twObject::*)(void)) &slot
#include <iostream>
#include <vector>
#ifdef WIN32
#include <windows.h>
#include "GLEW/glew.h"
#include "twSize.h"
#include "twPosition.h"
#include "twColor.h"
#include "twArea.h"
#include "twButton.h"
#include "twWindow.h"
#include "twDialog.h"
#include "twText.h"
#include "twSlider.h"
#include "twTimer.h"
#include "twTextEdit.h"
#include "twRichEdit.h"
#include "twMenu.h"
#include "twToolBar.h"
#include "twTabsBox.h"
#include "twImage.h"
#include "twListView.h"
#include "twSprite.h"
#include "twShape.h"
#include "twSound.h"
#include "twCheckBox.h"
#include "twListBox.h"
#include "twProgressBar.h"
#include "twStatusBar.h"
#include "twTrayIcon.h"
#include "twGraphicsArea.h"
#include "twCalendar.h"
#include "twFTP.h"
#include "twMysql.h"
#include "twFileInfo.h"
#include "twDir.h"
#endif
#include "twString.h"
#include "twObject.h"
#include "twNetwork.h"
#include "twTCPClient.h"
#include "twUDPSocket.h"
#include "twTCPServer.h"
#include "twHTTP.h"
class twApplication : public twObject
{
public:
enum event{Update};
twApplication(int argc = 0, char *argv[] = 0);
int show();
void setSleepMode(bool sleepMode);
bool getSleepMode();
static twString getArg(int index = 1);
static void quit();
static void sleep(int ms);
static void setArg(int argc, char *argv[]);
static int getElapsedTime();
void update();
int addTCPClient(twObject *client);
int addTCPServer(twObject *server);
int addUDPSocket(twObject *socket);
void removeTCPClient(twObject *client);
void removeTCPServer(twObject *server);
void removeUDPSocket(twObject *socket);
#ifdef WIN32
static twString getComputerName();
static twString getUserName();
static twString getSystemDirectory();
static twString getWindowsDirectory();
static twString getCurrentDirectory();
static void open(twString file);
static twSize getScreenSize();
static twSize getWorkArea();
void setNetworkUpdateDelay(int ms);
int getNetworkUpdateDelay();
static twPosition getCursorPosition();
#endif
private:
std::vector<twObject*> m_TCPClient;
std::vector<twObject*> m_UDPSocket;
std::vector<twObject*> m_TCPServer;
#ifdef WIN32
twTimer *networkTimer;
MSG message;
#endif
int modeDAffichage;
bool m_sleepMode;
int msNetworkTimer;
};
int twRand(int min, int max = 0);
#endif // TWAPPLICATION_H_INCLUDED