forked from RoboCup-SSL/ssl-refbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
159 lines (132 loc) · 4.1 KB
/
mainwindow.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
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <memory>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h>
#include <gtkmm/menu.h>
#include <gtkmm/menubar.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/table.h>
#include <gtkmm/window.h>
#include <sigc++/connection.h>
class GameController;
class RConServer;
class MainWindow : public Gtk::Window {
public:
MainWindow(GameController &controller);
~MainWindow();
private:
// Information about a game control button.
struct GameControlButtonInfo {
Gtk::Button MainWindow::*button;
int new_stage;
int new_command;
};
void on_timeout_time_changed();
void on_game_clock_changed();
void on_yellow_card_time_changed();
void on_teamname_changed();
void on_other_changed();
void on_teamname_yellow_changed();
void on_teamname_blue_changed();
void on_goalie_yellow_changed();
void on_goalie_blue_changed();
bool on_goalie_yellow_commit();
bool on_goalie_blue_commit();
void on_game_control_button_clicked(const GameControlButtonInfo *button);
void on_half_time_button_clicked();
void on_enable_rcon_clicked();
void update_sensitivities();
// Information about the game control buttons.
static const GameControlButtonInfo game_control_button_info[];
// The game controller.
GameController &controller;
// The remote control server.
std::unique_ptr<RConServer> rcon_server;
sigc::connection goalie_yellow_commit_connection, goalie_blue_commit_connection;
// Elements
Gtk::VBox big_vbox;
Gtk::MenuBar menu_bar;
Gtk::Menu config_menu;
Gtk::CheckMenuItem ignore_rules_menu_item;
Gtk::CheckMenuItem enable_rcon_menu_item;
Gtk::HBox halt_stop_hbox;
Gtk::Button halt_but;
Gtk::Button stop_but;
Gtk::HBox start_hbox;
Gtk::Button force_start_but;
Gtk::Button normal_start_but;
Gtk::Frame goal_frame;
Gtk::VBox goal_vbox;
Gtk::HBox goal_hbox;
Gtk::Label yellow_goal;
Gtk::Label blue_goal;
Gtk::Label vs;
Gtk::HBox teamname_hbox;
Gtk::ComboBoxText teamname_yellow;
Gtk::ComboBoxText teamname_blue;
Gtk::Button switch_colours_but;
Gtk::HBox game_status_hbox;
Gtk::VBox game_status_vbox;
Gtk::Frame game_control_frame;
Gtk::Label stage_label;
Gtk::Label time_label;
Gtk::Label timeleft_label;
Gtk::Label game_status_label;
Gtk::VButtonBox game_control_box;
Gtk::Button cancel_but;
Gtk::HBox yellow_goal_box;
Gtk::Button yellow_goal_but;
Gtk::Button yellow_subgoal_but;
Gtk::HBox blue_goal_box;
Gtk::Button blue_goal_but;
Gtk::Button blue_subgoal_but;
Gtk::VBox game_stage_control_left_vbox;
Gtk::VBox game_stage_control_right_vbox;
Gtk::Label next_stage_label_left;
Gtk::Label next_stage_label_right;
Gtk::Button firsthalf_start_but;
Gtk::Button halftime_start_but;
Gtk::Button secondhalf_start_but;
Gtk::Button overtime1_start_but;
Gtk::Button overtime2_start_but;
Gtk::Button penaltyshootout_start_but;
Gtk::Button gameover_start_but;
Gtk::HBox team_hbox;
Gtk::Frame yellow_frame;
Gtk::Table yellow_team_table;
Gtk::Button yellow_timeout_start_but;
Gtk::Label yellow_timeout_time_label;
Gtk::Label yellow_timeout_time_text;
Gtk::Label yellow_timeouts_left_label;
Gtk::Label yellow_timeouts_left_text;
Gtk::Label yellow_goalie_label;
Gtk::SpinButton yellow_goalie_spin;
Gtk::Button yellow_kickoff_but;
Gtk::Button yellow_freekick_but;
Gtk::Button yellow_penalty_but;
Gtk::Button yellow_indirect_freekick_but;
Gtk::Button yellow_yellowcard_but;
Gtk::Button yellow_redcard_but;
Gtk::Frame blue_frame;
Gtk::Table blue_team_table;
Gtk::Button blue_timeout_start_but;
Gtk::Label blue_timeout_time_label;
Gtk::Label blue_timeout_time_text;
Gtk::Label blue_timeouts_left_label;
Gtk::Label blue_timeouts_left_text;
Gtk::Label blue_goalie_label;
Gtk::SpinButton blue_goalie_spin;
Gtk::Button blue_kickoff_but;
Gtk::Button blue_freekick_but;
Gtk::Button blue_penalty_but;
Gtk::Button blue_indirect_freekick_but;
Gtk::Button blue_yellowcard_but;
Gtk::Button blue_redcard_but;
};
#endif