File: ControlWindow.h

package info (click to toggle)
realtimebattle 1.0.8-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,468 kB
  • ctags: 4,788
  • sloc: cpp: 22,015; ansic: 9,551; sh: 4,627; makefile: 1,302; java: 738; yacc: 288; sed: 16
file content (156 lines) | stat: -rw-r--r-- 6,413 bytes parent folder | download | duplicates (5)
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
/*
RealTimeBattle, a robot programming game for Unix
Copyright (C) 1998-2000  Erik Ouchterlony and Ragnar Ouchterlony

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 2 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, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef __CONTROL_WINDOW__
#define __CONTROL_WINDOW__

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#ifndef NO_GRAPHICS

#include <string>
using namespace std;

struct _GtkWidget;
typedef struct _GtkWidget GtkWidget;
union _GdkEvent;
struct _GtkAdjustment;
typedef struct _GtkAdjustment GtkAdjustment;
typedef union _GdkEvent GdkEvent;
typedef void* gpointer;

struct dialog_result_t;

class ControlWindow
{
public:
  enum displayed_t { NO_WIDGETS, DEBUG_WIDGETS, REPLAY_WIDGETS };

  ControlWindow                    ( const int default_width  = -1,
                                     const int default_height = -1,
                                     const int default_x_pos  = -1,
                                     const int default_y_pos  = -1 );
  ~ControlWindow                   ();

  void set_window_title            ( const string& text );
  void remove_replay_widgets       ();
  void clear_extra_widgets         ();
  void display_debug_widgets       ();
  void display_replay_widgets      ();

  static void delete_event_occured ( GtkWidget* widget, GdkEvent* event,
                                     class ControlWindow* cw_p );
  static void quit_rtb             ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void pause                ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void step                 ( GtkWidget* widget, gpointer data );
  static void end_game             ( GtkWidget* widget, gpointer data );
  static void kill_robot           ( GtkWidget* widget, gpointer data );
  static void change_debug_level   ( GtkAdjustment *adj,
                                     class ControlWindow* cw_p );
  static void end_clicked          ( GtkWidget* widget, gpointer data ); 
  static void end_tournament       ( int result );
  static void options_clicked      ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void statistics_clicked   ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void new_tournament       ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void replay_tournament    ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void arena_window_toggle  ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void message_window_toggle( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void score_window_toggle  ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void replay               ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void rewind_pressed       ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void rewind_released      ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void fast_forward_pressed ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void fast_forward_released( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void step_forward         ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void step_backward        ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void next_game            ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void prev_game            ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void next_seq             ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void prev_seq             ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void dummy                ( GtkWidget* widget,
                                     class ControlWindow* cw_p ) {}
  static void change_current_replay_time( GtkAdjustment *adj,
                                          class ControlWindow* cw_p );
  static void destroy_filesel      ( GtkWidget* widget,
                                     class ControlWindow* cw_p );
  static void kill_and_open_filesel( int result );
  void open_replay_filesel         ();

  displayed_t get_displayed        () { return displayed; }
  GtkWidget* get_filesel           () { return filesel; }
  GtkWidget* get_window_p          () { return window_p; }

  bool is_arenawindow_checked      ();
  bool is_messagewindow_checked    ();
  bool is_scorewindow_checked      ();

  GtkWidget* get_show_arena_menu_item() { return show_arena_menu_item; }
  GtkWidget* get_show_message_menu_item() { return show_message_menu_item; }
  GtkWidget* get_show_score_menu_item() { return show_score_menu_item; }

  void set_filesel                 ( GtkWidget* fs ) { filesel = fs; }

  void set_progress_time           ( const double time );
  void change_time_limitations     ();

private:

  GtkWidget* window_p;
  GtkWidget* debug_level;
  GtkWidget* filesel;

  GtkWidget* window_hbox;
  GtkWidget* vseparator;
  GtkWidget* extra_vbox;

  GtkWidget* show_arena_menu_item;
  GtkWidget* show_message_menu_item;
  GtkWidget* show_score_menu_item;

  GtkWidget* time_control;
  GtkAdjustment* current_replay_time_adjustment;

  displayed_t displayed;
};

#endif 

#endif