-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtk_LunAero.hpp
294 lines (271 loc) · 6.85 KB
/
gtk_LunAero.hpp
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
282
283
284
285
286
287
288
289
290
291
292
293
294
/*
* C_LunAero/gtk_LunAero.hpp - GUI Headers for LunAero_C
* Copyright (C) <2020> <Wesley T. Honeycutt>
*
* 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 GTK_LUNAERO_H
#define GTK_LUNAERO_H
// Standard C++ includes
#include <string>
#include <iostream>
// Module specific includes
#include <gtk/gtk.h> // provides GTK3
// User Includes
#include "LunAero.hpp"
// Declare Functions
void screen_size();
void activate(GtkApplication *app, gpointer user_data);
gboolean key_event_preview(GtkWidget *widget, GdkEventKey *event);
gboolean key_event_running(GtkWidget *widget, GdkEventKey *event);
gboolean abort_check(GtkWidget* data);
gboolean g_framecheck(gpointer data);
gboolean key_event(GtkWidget *widget, GdkEventKey *event);
std::string get_css_string();
void first_record_killer(GtkWidget* data);
gboolean cb_subsequent(GtkWidget* data);
void mot_stop_command();
void mot_up_command();
void mot_down_command();
void mot_left_command();
void mot_right_command();
/**
* Modifier value for determining the font size. Customizable from settings.cfg
*/
inline int FONT_MOD = 20;
/**
* Frequency in milliseconds to check the frame for moon centering. Customizable from settings.cfg
*/
inline int FRAMECHECK_FREQ = 50;
/**
* Keybinding for quit command
* Customizable from settings.cfg
*/
inline std::string KV_QUIT = "q";
/**
* Keybinding for left manual motor movement.
* Customizable from settings.cfg
*/
inline std::string KV_LEFT = "Left";
/**
* Keybinding for right manual motor movement.
* Customizable from settings.cfg
*/
inline std::string KV_RIGHT = "Right";
/**
* Keybinding for up manual motor movement.
* Customizable from settings.cfg
*/
inline std::string KV_UP = "Up";
/**
* Keybinding for down manual motor movement.
* Customizable from settings.cfg
*/
inline std::string KV_DOWN = "Down";
/**
* Keybinding for motor stop command.
* Customizable from settings.cfg
*/
inline std::string KV_STOP = "space";
/**
* Keybinding for raspivid refresh command.
* Customizable from settings.cfg
*/
inline std::string KV_REFRESH = "z";
/**
* Keybinding for greatly increasing the shutter speed.
* Customizable from settings.cfg
*/
inline std::string KV_S_UP_UP = "g";
/**
* Keybinding for greatly decreasing the shutter speed.
* Customizable from settings.cfg
*/
inline std::string KV_S_DOWN_DOWN = "b";
/**
* Keybinding for increasing the shutter speed.
* Customizable from settings.cfg
*/
inline std::string KV_S_UP = "h";
/**
* Keybinding for decreasing the shutter speed.
* Customizable from settings.cfg
*/
inline std::string KV_S_DOWN = "n";
/**
* Keybinding for cycling the ISO value.
* Customizable from settings.cfg
*/
inline std::string KV_ISO = "i";
/**
* Keybinding for beginning the recording/entering automatic mode
* Customizable from settings.cfg
*/
inline std::string KV_RUN = "Return";
/**
* This is a class to hold the various GTK widgets and whatnots.
*/
class gtk_class {
public:
/**
* GTK Main Application
*/
inline static GtkApplication *app;
/**
* Main GTK window
*/
inline static GtkWidget *window;
/**
* GTK CSS provider
*/
inline static GtkCssProvider *provider;
// Grids
/**
* Primary grid for window layout.
*/
inline static GtkWidget *grid;
/**
* Grid to hold the directional movement pad
*/
inline static GtkWidget *dirgrid;
/**
* Grid to hold function buttons
*/
inline static GtkWidget *funcgrid;
/**
* Grid to hold our fakebuttons
*/
inline static GtkWidget *fakegrid;
// Button Containers
/**
* Quit button container
*/
inline static GtkWidget *button_box_quit;
/**
* Container for all of the fake buttons
*/
inline static GtkWidget *button_box_fakes;
/**
* Container for all of the directional pad buttons
*/
inline static GtkWidget *button_box_dirgrid;
/**
* Container for the camera refresh button
*/
inline static GtkWidget *button_box_redeploy;
/**
* Container for all of the ISO/Shutter editing buttons
*/
inline static GtkWidget *button_box_funcs;
/**
* Container for the "start recording" button
*/
inline static GtkWidget *button_box_activate;
// Buttons
/**
* exit button
*/
inline static GtkWidget *exit_button;
/**
* movement up button
*/
inline static GtkWidget *button_up;
/**
* movement down button
*/
inline static GtkWidget *button_down;
/**
* movement left button
*/
inline static GtkWidget *button_left;
/**
* movement right button
*/
inline static GtkWidget *button_right;
/**
* movement stop button
*/
inline static GtkWidget *button_stop;
/**
* refresh preview camera button
*/
inline static GtkWidget *button_camera_command;
/**
* increase shutter value button
*/
inline static GtkWidget *button_shutter_up;
/**
* decrease shutter value button
*/
inline static GtkWidget *button_shutter_down;
/**
* greatly increase shutter button
*/
inline static GtkWidget *button_shutter_up_up;
/**
* greately decrease shutter button
*/
inline static GtkWidget *button_shutter_down_down;
/**
* cycle ISO button
*/
inline static GtkWidget *button_iso;
/**
* begin recording button
*/
inline static GtkWidget *button_record;
// Text Holders
/**
* Container to hold the status (ISO/Shutter/Blur and Running)
*/
inline static GtkWidget *text_status;
/**
* Container for shutter speed label
*/
inline static GtkWidget *text_shutter;
/**
* Container for some blank lines that help arrange the grid
*/
inline static GtkWidget *text_description;
// More fake buttons to shield the real fake button!
/**
* fake button - does nothing
*/
inline static GtkWidget *fakebutton;
/**
* fake button - does nothing
*/
inline static GtkWidget *fakebutton2;
/**
* fake button - does nothing
*/
inline static GtkWidget *fakebutton3;
/**
* fake button - does nothing
*/
inline static GtkWidget *fakebutton4;
/**
* fake button - does nothing
*/
inline static GtkWidget *fakebutton5;
/**
* Holds the CSS string. Not an actual widtet!
*/
inline static const std::string css_string = get_css_string();
/**
* Holds the key_id of a button pressed on the user's keyboard.
*/
inline static gulong key_id;
};
#endif