source: golgotha/src/golg/net/startup.hh

Last change on this file was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 3.0 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef G1_NET_STARTUP_HH
10#define G1_NET_STARTUP_HH
11
12
13#include "window/window.hh"
14#include "time/timedev.hh"
15#include "g1_limits.hh"
16
17class i4_text_input_class;
18class i4_graphical_style_class;
19class i4_event;
20class i4_event_handler_class;
21class i4_finder_socket;
22class i4_notifier_socket;
23class i4_button_class;
24class i4_event_reaction_class;
25class i4_net_protocol;
26
27class g1_net_window_class : public i4_parent_window_class
28{
29protected:
30  i4_image_class *bg;
31  i4_time_device_class::id poll_event_id;
32  i4_graphical_style_class *style;
33  i4_net_protocol *protocol;
34  int poll_delay, poll_id;
35
36  i4_event_reaction_class *create_orec(int mess_id);
37public:
38  virtual void object_message(int id) { ; }
39  virtual void poll() { ; }
40
41  g1_net_window_class(w16 w, w16 h,
42                      i4_graphical_style_class *style,
43                      i4_net_protocol *protocol,
44                      char *bg_res,
45                      int poll_delay, int poll_event_id);
46   
47  virtual void receive_event(i4_event *ev);
48  virtual void parent_draw(i4_draw_context_class &context);
49
50  virtual ~g1_net_window_class();
51};
52
53class g1_startup_window : public g1_net_window_class
54{
55  i4_button_class **buts;
56  int t_buts;
57  i4_text_input_class *hostname, *username;
58  i4_finder_socket *find;
59
60  enum { START_SERVER, QUIT_NET_GAME, POLL, LAST };
61
62  void free_buts();
63  void grab_uname();
64public:
65  virtual void object_message(int id);
66  virtual void poll();
67
68  g1_startup_window(w16 w, w16 h,
69                    i4_graphical_style_class *style,
70                    i4_net_protocol *protocol);
71
72  char *name() { return "net_startup"; }
73  ~g1_startup_window();
74};
75
76class g1_server_start_window : public g1_net_window_class
77{
78  i4_notifier_socket *note;
79  i4_window_class *names[G1_MAX_PLAYERS];
80
81  enum { START_NET_GAME, QUIT_NET_GAME, POLL };
82public:
83  g1_server_start_window(w16 w, w16 h,
84                         i4_graphical_style_class *style,
85                         i4_net_protocol *protocol);
86
87  virtual void object_message(int id);
88  virtual void poll();
89
90  char *name() { return "server_menu"; }
91  ~g1_server_start_window();
92};
93
94
95class g1_client_wait_window : public g1_net_window_class
96{
97  enum { QUIT_NET_GAME, POLL };
98
99public:
100  g1_client_wait_window(w16 w, w16 h,
101                         i4_graphical_style_class *style,
102                         i4_net_protocol *protocol);
103
104  virtual void object_message(int id);
105  virtual void poll();
106
107  char *name() { return "client_wait"; }
108  ~g1_client_wait_window();
109};
110
111
112#endif
113
114
Note: See TracBrowser for help on using the repository browser.