-
Notifications
You must be signed in to change notification settings - Fork 2
/
flmonitor.cxx
281 lines (257 loc) · 14.7 KB
/
flmonitor.cxx
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
// generated by Fast Light User Interface Designer (fluid) version 1.0305
#include "flmonitor.h"
#include <stdio.h>
#include <stdlib.h>
#include "headerf.h"
Fl_Double_Window *win1=(Fl_Double_Window *)0;
static void cb_1(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 640x480 " );
}
static void cb_2(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 800x600 " );
}
static void cb_6(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 1680x1050 " );
}
static void cb_5(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 1366x768 " );
}
static void cb_Settings(Fl_Button*, void*) {
system( " cd ; screen -d -m flmonitor-settings " );
}
static void cb_3(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 1024x768 " );
}
static void cb_9(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 1920x1080 " );
}
static void cb_0(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 320x240 " );
}
static void cb_4(Fl_Button*, void*) {
system( " screen -d -m xrandr -s 1280x720 " );
}
static void cb_(Fl_Button*, void*) {
system( " cd ; xrandr > /tmp/xrandr.info ; screen -d -m flview /tmp/xrandr.info " );
}
#include <FL/Fl_Image.H>
static const unsigned char idata_window_new[] =
{255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,
255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,
255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,
255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,17,
16,105,220,61,63,134,254,59,63,135,253,55,60,134,253,53,60,134,253,52,59,134,
253,50,58,134,253,48,57,134,253,45,56,134,253,44,54,134,253,42,54,134,253,40,52,
134,253,37,52,134,253,37,52,134,253,33,50,134,253,32,49,134,253,30,48,134,253,
28,47,134,253,26,46,135,253,23,44,132,254,4,8,104,214,0,0,95,18,65,69,140,254,
179,222,250,255,165,216,255,255,159,209,253,255,154,206,253,255,149,203,253,255,
143,200,253,255,139,197,253,255,134,194,253,255,128,191,253,255,123,188,253,255,
118,185,253,255,113,182,253,255,108,179,253,255,103,176,253,255,97,173,253,255,
93,170,253,255,87,168,253,255,84,167,255,255,76,161,248,255,18,41,138,250,0,0,
86,63,66,72,144,254,130,193,253,255,81,160,251,255,80,156,249,255,77,156,249,
255,73,154,249,255,71,152,249,255,68,151,249,255,65,149,249,255,62,146,249,255,
60,144,249,255,57,143,249,255,54,140,249,255,51,139,249,255,48,138,249,255,45,
136,249,255,43,133,249,255,40,132,249,255,37,132,251,255,55,146,250,255,20,45,
143,249,0,0,89,58,62,73,148,253,98,150,226,255,100,141,221,255,111,150,223,255,
110,149,223,255,111,149,223,255,111,149,223,255,111,150,223,255,111,150,223,255,
111,149,223,255,112,150,223,255,112,150,223,255,112,150,223,255,112,150,223,255,
112,150,223,255,112,150,223,255,112,151,223,255,113,152,223,255,112,149,221,255,
53,122,227,255,15,44,147,249,0,0,91,58,51,66,149,253,131,169,226,255,240,243,
248,255,255,255,254,255,255,255,253,255,255,255,253,255,255,255,253,255,255,255,
253,255,255,255,253,255,255,255,253,255,255,255,253,255,255,255,253,255,255,255,
253,255,255,255,252,255,255,255,252,255,255,255,252,255,255,255,250,255,255,255,
250,255,255,255,248,255,84,140,225,255,6,41,148,249,0,0,96,58,49,67,152,253,126,
167,227,255,239,242,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,254,255,253,253,253,255,252,251,252,255,249,249,250,255,247,
247,249,255,246,246,247,255,248,245,245,255,80,137,226,255,6,42,151,249,0,1,100,
58,47,68,153,253,124,165,227,255,239,242,249,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,255,
255,254,254,254,255,253,253,253,255,252,252,253,255,249,249,251,255,248,248,250,
255,246,246,249,255,243,243,247,255,242,242,245,255,245,243,243,255,77,136,226,
255,4,44,153,249,0,5,102,58,45,69,156,253,121,164,227,255,239,242,249,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,254,254,254,255,253,253,254,255,252,252,252,255,249,249,251,255,248,
248,250,255,246,246,249,255,244,244,247,255,241,241,245,255,240,240,244,255,243,
241,242,255,76,135,227,255,3,45,155,249,0,8,105,58,43,69,158,253,119,162,227,
255,240,242,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,254,254,255,255,254,254,254,255,253,253,253,255,251,251,252,255,249,249,251,
255,248,248,250,255,245,245,248,255,243,243,246,255,242,242,247,255,240,244,249,
255,238,238,243,255,242,238,240,255,73,133,226,255,1,47,157,249,0,13,108,58,40,
70,160,253,116,160,227,255,240,242,249,255,255,255,255,255,255,255,255,255,255,
255,255,255,254,254,255,255,254,254,254,255,253,253,254,255,251,251,252,255,250,
250,252,255,248,248,250,255,246,246,248,255,244,244,246,255,242,241,245,255,240,
242,247,255,230,224,236,255,233,235,242,255,239,236,238,255,72,132,226,255,0,48,
159,249,0,15,111,58,38,71,163,253,114,159,227,255,240,243,249,255,255,255,255,
255,255,255,255,255,255,255,255,255,254,254,254,255,253,253,254,255,251,251,252,
255,250,250,251,255,248,248,250,255,246,246,248,255,246,250,253,255,245,252,255,
255,242,252,255,255,222,188,185,255,213,124,63,255,218,173,164,255,240,246,252,
255,58,131,240,255,0,49,169,249,0,20,115,58,36,72,166,253,111,158,227,255,240,
243,249,255,255,255,255,255,254,254,255,255,254,254,254,255,252,252,253,255,251,
251,252,255,250,250,251,255,248,248,250,255,246,246,248,255,246,250,253,255,226,
203,198,255,205,145,123,255,227,217,229,255,216,165,153,255,238,175,48,255,220,
168,132,255,227,219,238,255,152,105,119,255,54,47,114,249,0,22,128,58,33,74,168,
253,108,156,227,255,241,243,249,255,255,255,255,255,254,254,254,255,253,253,254,
255,251,251,252,255,250,250,252,255,248,248,250,255,245,245,249,255,243,243,246,
255,243,248,254,255,204,148,125,255,230,182,103,255,212,148,114,255,199,120,112,
255,241,194,74,255,210,137,116,255,215,143,102,255,255,217,16,255,147,77,58,249,
0,11,132,58,30,75,169,253,107,154,227,255,241,243,249,255,255,255,255,255,253,
253,253,255,251,251,252,255,249,249,251,255,248,248,250,255,246,246,249,255,243,
243,247,255,242,242,246,255,244,252,255,255,227,212,218,255,209,152,116,255,240,
206,131,255,210,113,50,255,239,189,80,255,220,126,44,255,252,221,54,255,181,143,
84,255,10,35,153,248,114,8,66,53,28,75,172,253,104,153,226,255,241,243,249,255,
255,255,255,255,251,251,252,255,249,249,251,255,247,247,250,255,246,246,249,255,
244,244,246,255,242,242,246,255,240,241,247,255,217,193,190,255,208,170,156,255,
193,122,111,255,207,120,59,255,255,236,125,255,253,240,115,255,255,244,88,255,
233,149,42,255,120,64,104,255,96,68,111,254,213,20,11,142,25,76,175,253,103,152,
226,255,242,243,249,255,255,255,255,255,255,255,253,255,255,255,251,255,255,253,
250,255,253,250,248,255,250,247,246,255,252,252,251,255,238,227,231,255,205,141,
87,255,238,191,127,255,243,201,134,255,238,194,117,255,254,236,134,255,255,255,
142,255,254,246,101,255,244,203,59,255,252,212,32,255,255,230,15,255,232,133,27,
251,27,81,179,254,91,144,225,255,195,206,233,255,207,216,238,255,202,213,237,
255,202,212,236,255,200,211,235,255,200,210,234,255,199,208,234,255,198,209,234,
255,196,209,234,255,171,150,162,255,158,126,131,255,160,101,105,255,206,114,57,
255,255,243,130,255,255,248,121,255,255,250,93,255,229,139,39,255,132,70,93,255,
112,87,104,254,207,32,16,171,29,82,177,254,72,148,243,255,55,132,236,255,52,128,
235,255,49,127,235,255,46,125,235,255,43,123,235,255,40,122,235,255,37,120,236,
255,34,117,236,255,32,116,236,255,29,125,252,255,23,104,228,255,138,101,111,255,
251,220,132,255,220,136,61,255,237,192,80,255,224,145,47,255,255,224,58,255,161,
116,90,255,6,43,178,248,67,32,114,55,2,53,155,196,12,68,169,245,11,69,172,244,
10,67,171,243,9,67,171,243,9,67,171,243,7,66,171,243,6,66,171,243,6,65,171,243,
5,64,171,243,4,64,171,243,0,57,176,242,91,67,99,253,255,226,132,255,170,121,
96,251,96,28,61,250,245,204,80,255,122,55,71,251,159,100,66,251,255,229,38,255,
165,76,53,237,72,17,94,16,0,49,151,2,0,45,147,16,0,44,147,18,0,45,147,18,0,46,
147,18,0,47,147,18,0,47,147,18,0,47,147,18,0,47,147,18,0,47,147,18,0,47,147,18,
0,42,152,6,103,31,52,127,190,69,17,223,92,2,38,67,128,40,52,174,255,215,81,
255,132,69,76,197,75,4,83,51,217,69,8,220,213,33,7,142,212,0,0,0,0,50,152,0,0,
49,151,0,0,48,151,0,0,49,151,0,0,49,151,0,0,50,151,0,0,50,151,0,0,50,151,0,0,
50,151,0,0,50,151,0,0,50,151,0,0,49,158,0,88,13,50,0,135,0,0,0,139,0,7,0,169,
16,4,125,214,117,39,252,171,32,19,155,143,9,31,0,182,1,1,0,197,0,0,0,208,0,0,0};
static Fl_Image *image_window_new() {
static Fl_Image *image = new Fl_RGB_Image(idata_window_new, 22, 22, 4, 0);
return image;
}
static void cb_Cancel(Fl_Button*, void*) {
exit( 0 );
/*
default connected 1280x720+0+0 0mm x 0mm
1920x1080 0.00
1280x720 0.00*
*/;
}
static const unsigned char idata_exit[] =
{255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,
255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,
255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,
255,0,168,0,0,0,167,0,0,0,164,0,0,0,160,0,0,40,164,3,2,151,177,35,33,230,189,66,
64,250,187,62,60,250,169,31,29,232,145,5,4,158,134,0,0,45,131,0,0,0,123,0,0,0,
120,0,0,0,255,255,255,0,255,255,255,0,168,0,0,0,167,0,0,0,161,0,0,103,188,54,51,
245,227,164,161,255,251,230,228,255,231,206,204,255,229,184,184,255,250,183,180,
255,223,119,115,255,169,38,35,251,127,0,0,118,123,0,0,4,120,0,0,0,255,255,255,0,
255,255,255,0,167,0,0,0,163,0,0,103,201,84,80,255,251,235,233,255,255,255,255,
255,241,225,225,255,198,160,161,255,195,154,154,255,233,159,159,255,255,174,173,
255,249,134,132,255,182,49,46,255,120,0,0,118,120,0,0,0,255,255,255,0,255,255,
255,0,163,0,0,42,188,55,53,247,251,234,232,255,255,255,255,255,237,208,208,255,
228,176,176,255,227,197,197,255,226,197,197,255,216,116,116,255,227,115,115,255,
240,113,114,255,250,98,96,255,159,25,23,252,113,0,0,50,255,255,255,0,255,255,
255,0,164,1,1,150,229,169,165,255,255,255,255,255,219,172,172,255,205,157,157,
255,201,122,122,255,228,193,193,255,228,191,191,255,195,89,89,255,207,162,162,
255,204,79,79,255,247,75,76,255,217,51,50,255,117,3,2,171,255,255,255,0,255,255,
255,0,177,29,24,231,252,163,144,255,238,190,184,255,217,174,175,255,241,225,225,
255,201,95,94,255,228,188,188,255,229,188,188,255,194,61,61,255,239,222,222,255,
221,180,181,255,213,31,30,255,221,49,42,255,133,15,14,240,255,255,255,0,255,255,
255,0,187,55,49,250,250,89,60,255,214,56,47,255,238,232,234,255,221,148,148,255,
228,114,115,255,232,196,196,255,232,199,199,255,219,49,50,255,216,103,102,255,
244,241,241,255,187,47,48,255,197,20,14,255,146,20,18,252,255,255,255,0,255,255,
255,0,185,53,48,250,243,77,51,255,215,64,53,255,237,226,228,255,218,95,92,255,
230,94,90,255,225,155,157,255,225,155,156,255,218,39,36,255,208,47,46,255,241,
232,231,255,193,79,80,255,190,9,5,255,143,17,15,252,255,255,255,0,255,255,255,0,
169,35,32,233,236,86,61,255,218,50,40,255,240,243,244,255,214,75,74,255,200,4,0,
255,197,25,11,255,193,20,11,255,182,1,0,255,200,60,61,255,245,244,245,255,192,
56,57,255,189,10,7,255,127,11,10,242,255,255,255,0,255,255,255,0,148,8,8,159,
216,88,73,255,222,31,18,255,234,183,186,255,237,208,210,255,205,27,27,255,189,0,
0,255,183,0,0,255,193,19,20,255,234,199,200,255,238,204,203,255,182,9,7,255,
179,19,14,255,101,3,3,179,255,255,255,0,255,255,255,0,138,0,0,46,170,43,39,251,
229,78,60,255,217,40,34,255,242,214,216,255,239,227,226,255,228,146,149,255,227,
143,146,255,241,221,222,255,246,227,228,255,198,45,46,255,191,13,9,255,136,13,
11,253,89,0,0,58,255,255,255,0,255,255,255,0,142,0,0,0,130,0,0,115,178,52,48,
255,222,60,45,255,218,37,31,255,233,137,137,255,239,197,198,255,240,199,200,255,
232,146,145,255,204,35,34,255,193,10,8,255,153,15,13,255,88,0,0,131,93,0,0,1,
255,255,255,0,255,255,255,0,143,0,0,0,132,0,0,4,122,0,0,120,156,34,31,254,194,
46,37,255,208,24,17,255,212,21,15,255,210,17,12,255,197,6,3,255,176,11,8,255,
136,12,10,255,88,0,0,135,87,0,0,10,94,0,0,0,255,255,255,0,255,255,255,0,143,0,0,
0,133,0,0,0,123,0,0,0,114,0,0,52,117,7,7,169,135,15,14,240,142,15,12,252,139,
12,9,252,123,9,8,242,101,4,3,177,86,0,0,60,88,0,0,0,89,0,0,0,94,0,0,0,255,255,
255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,
255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,
255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0};
static Fl_Image *image_exit() {
static Fl_Image *image = new Fl_RGB_Image(idata_exit, 16, 16, 4, 0);
return image;
}
Fl_Double_Window* make_window() {
{ win1 = new Fl_Double_Window(315, 195, "Screen");
{ Fl_Group* o = new Fl_Group(5, 35, 305, 120);
o->box(FL_DOWN_BOX);
{ Fl_Button* o = new Fl_Button(10, 65, 120, 20, "&1: 640x480");
o->callback((Fl_Callback*)cb_1);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(10, 90, 120, 20, "&2: 800x600");
o->callback((Fl_Callback*)cb_2);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(185, 90, 120, 20, "&6: 1680x1050");
o->callback((Fl_Callback*)cb_6);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(185, 65, 120, 20, "&5: 1366x768");
o->callback((Fl_Callback*)cb_5);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(235, 135, 70, 15, "Settings");
o->callback((Fl_Callback*)cb_Settings);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(10, 115, 120, 20, "&3: 1024x768");
o->callback((Fl_Callback*)cb_3);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(185, 115, 120, 20, "&9: 1920x1080");
o->callback((Fl_Callback*)cb_9);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(10, 40, 120, 20, "&0: 320x240");
o->callback((Fl_Callback*)cb_0);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(185, 40, 120, 20, "&4: 1280x720");
o->callback((Fl_Callback*)cb_4);
} // Fl_Button* o
{ Fl_Button* o = new Fl_Button(185, 135, 50, 15, "(...)");
o->callback((Fl_Callback*)cb_);
} // Fl_Button* o
o->end();
} // Fl_Group* o
{ Fl_Box* o = new Fl_Box(5, 5, 305, 25, " FLMONITOR");
o->box(FL_ENGRAVED_BOX);
o->image( image_window_new() );
o->labelfont(1);
o->align(Fl_Align(256));
} // Fl_Box* o
{ Fl_Button* o = new Fl_Button(5, 160, 305, 25, " &Cancel");
o->image( image_exit() );
o->callback((Fl_Callback*)cb_Cancel);
o->align(Fl_Align(256));
} // Fl_Button* o
win1->end();
win1->resizable(win1);
} // Fl_Double_Window* win1
return win1;
}
int main( int argc, char *argv[]) {
printf( " == FLTK == \n" );
////////////////////////////////////////////////////////
if ( argc == 2)
if ( strcmp( argv[1] , "" ) != 0 )
{
chdir( argv[ 1 ] );
}
char mydirnow[2500];
printf( "Current Directory: %s \n", getcwd( mydirnow, 2500 ) );
make_window();
win1->show();
Fl::run();
}