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 |
|
---|
17 | class i4_text_input_class;
|
---|
18 | class i4_graphical_style_class;
|
---|
19 | class i4_event;
|
---|
20 | class i4_event_handler_class;
|
---|
21 | class i4_finder_socket;
|
---|
22 | class i4_notifier_socket;
|
---|
23 | class i4_button_class;
|
---|
24 | class i4_event_reaction_class;
|
---|
25 | class i4_net_protocol;
|
---|
26 |
|
---|
27 | class g1_net_window_class : public i4_parent_window_class
|
---|
28 | {
|
---|
29 | protected:
|
---|
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);
|
---|
37 | public:
|
---|
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 |
|
---|
53 | class 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();
|
---|
64 | public:
|
---|
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 |
|
---|
76 | class 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 };
|
---|
82 | public:
|
---|
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 |
|
---|
95 | class g1_client_wait_window : public g1_net_window_class
|
---|
96 | {
|
---|
97 | enum { QUIT_NET_GAME, POLL };
|
---|
98 |
|
---|
99 | public:
|
---|
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 |
|
---|