-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
101 lines (86 loc) · 2.41 KB
/
window.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
/*
* graphic depictions, a visual workbench for graphs
*
* Copyright (C) 2016 Matvey Soloviev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _WINDOW_H_
#define _WINDOW_H_
#include <GL/glx.h>
#include "stdafx.h"
#define KEY_LEFT (XK_Left&0xff)
#define KEY_UP (XK_Up&0xff)
#define KEY_RIGHT (XK_Right&0xff)
#define KEY_DOWN (XK_Down&0xff)
#define KEY_SHIFT (XK_Shift_L&0xff)
#define KEY_CTRL (XK_Control_L&0xff)
#define KEY_DELETE (XK_Delete&0xff)
#define KEY_ENTER (XK_Return&0xff)
#define KEY_BACKSPACE (XK_BackSpace&0xff)
#define KEY_HOME (XK_Home&0xff)
#define KEY_END (XK_End&0xff)
#define KEY_ESC (XK_Escape&0xff)
#define KEY_TAB (XK_Tab&0xff)
#define KEY_X 'x'
#define KEY_Y 'y'
#define KEY_Z 'z'
#define KEY_E 'e'
#define KEY_Q 'q'
#define KEY_U 'u'
#define KEY_I 'i'
#define KEY_O 'o'
#define KEY_A 'a'
#define KEY_S 's'
#define KEY_D 'd'
#define KEY_F 'f'
#define KEY_G 'g'
#define KEY_H 'h'
#define KEY_J 'j'
#define KEY_K 'k'
#define KEY_B 'b'
#define KEY_N 'n'
#define KEY_M 'm'
#define KEY_C 'c'
#define KEY_V 'v'
#define KEY_Z 'z'
static int KEY_GROUP_ACCEL[10]={'1','2','3','4','5','6','7','8','9','0'};
#define WHEIGHT 480
#define WWIDTH 640
class CSMainWindow {
protected:
bool isActive;
bool isClosed;
public:
int w,h;
int px,py; //button pressing coords
Display *g_pDisplay;
Window g_window;
XVisualInfo *visualInfo;
GLXContext glxContext,glxContext2;
CSMainWindow() {isActive=false;isClosed=false;}
void Create();
void Destroy();
void InitGL();
void Show();
bool IsActive() { return isActive; }
void SetActive() { isActive=true; }
void SetInactive() { isActive=false; }
bool IsClosed() { return isClosed; }
void Close() { isClosed=true; }
void SetWindowTitle(const char *title);
char *GetFilename(char *title, bool save);
int CheckMessages();
};
#endif