OSDN Git Service

first
[psychlops/cpp.git] / psychlops / platform / win32 / psychlops_app_state_Win32.h
1 /*
2  *  psychlops_app_state_Win32.h
3  *  Psychlops Standard Library (Win32)
4  *
5  *  Last Modified 2007/06/22 by Kenchi HOSOKAWA
6  *  (C) 2006 Kenchi HOSOKAWA, Kazushi MARUYA and Takao SATO
7  */
8
9
10 #ifndef HEADER_PSYCHLOPS_APP_STATE_WIN32
11 #define HEADER_PSYCHLOPS_APP_STATE_WIN32
12
13
14 #include <windows.h>
15
16 namespace Psychlops {
17
18
19         class APIInputProperties;
20         class APICanvasProperties;
21         class APICanvasPropertiesWindow;
22         void initialize();
23
24         class APIApplicationProperties {
25                 friend class APIInputProperties;
26                 friend class APICanvasProperties;
27                 friend class APICanvasPropertiesWindow;
28                 friend void initialize();
29
30                 private:
31                 HINSTANCE hInstance_;                   //      Handle for Application INSTANCE
32                 HINSTANCE hPrevInstance_;               //      Legacy of Win16 API
33                 LPSTR lpCmdLine_;                               //      Synonym of arg* of ordinary C-language "main(int argc, char **argv)" function
34                 int iCmdShow_;                                  //      To show or not to show when the application starts
35
36                 unsigned long thread_state_[5];
37
38                 public:
39                 char* pClassName;
40                 char* pAppName;
41
42                 public:
43                 HANDLE primaryThread;           // Handle for primary thread of Psychrops process
44                 DWORD primaryThreadID;          //      ID of primary thread of Psychrops process
45
46                 public:
47                 APIApplicationProperties();
48                 APIApplicationProperties(HINSTANCE _hInstance, HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int _iCmdShow);
49                 ~APIApplicationProperties();
50
51                 void set(HINSTANCE _hInstance, HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int _iCmdShow);
52                 DWORD getPrimaryThreadID();
53                 static LRESULT CALLBACK proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
54                 void setThreadPriority( unsigned int priority );
55                 int getThreadPriority();
56
57                 static void analyzeAPIError();
58                 static APIApplicationProperties startupinfo;
59
60                 private:
61                 void initialize();
62         };
63
64
65 }       /*      <- namespace Psychlops  */
66
67
68 #endif