startup.hh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #ifndef G1_NET_STARTUP_HH
  9. #define G1_NET_STARTUP_HH
  10. #include "window/window.hh"
  11. #include "time/timedev.hh"
  12. #include "g1_limits.hh"
  13. class i4_text_input_class;
  14. class i4_graphical_style_class;
  15. class i4_event;
  16. class i4_event_handler_class;
  17. class i4_finder_socket;
  18. class i4_notifier_socket;
  19. class i4_button_class;
  20. class i4_event_reaction_class;
  21. class i4_net_protocol;
  22. class g1_net_window_class : public i4_parent_window_class
  23. {
  24. protected:
  25. i4_image_class *bg;
  26. i4_time_device_class::id poll_event_id;
  27. i4_graphical_style_class *style;
  28. i4_net_protocol *protocol;
  29. int poll_delay, poll_id;
  30. i4_event_reaction_class *create_orec(int mess_id);
  31. public:
  32. virtual void object_message(int id) { ; }
  33. virtual void poll() { ; }
  34. g1_net_window_class(w16 w, w16 h,
  35. i4_graphical_style_class *style,
  36. i4_net_protocol *protocol,
  37. char *bg_res,
  38. int poll_delay, int poll_event_id);
  39. virtual void receive_event(i4_event *ev);
  40. virtual void parent_draw(i4_draw_context_class &context);
  41. virtual ~g1_net_window_class();
  42. };
  43. class g1_startup_window : public g1_net_window_class
  44. {
  45. i4_button_class **buts;
  46. int t_buts;
  47. i4_text_input_class *hostname, *username;
  48. i4_finder_socket *find;
  49. enum { START_SERVER, QUIT_NET_GAME, POLL, LAST };
  50. void free_buts();
  51. void grab_uname();
  52. public:
  53. virtual void object_message(int id);
  54. virtual void poll();
  55. g1_startup_window(w16 w, w16 h,
  56. i4_graphical_style_class *style,
  57. i4_net_protocol *protocol);
  58. char *name() { return "net_startup"; }
  59. ~g1_startup_window();
  60. };
  61. class g1_server_start_window : public g1_net_window_class
  62. {
  63. i4_notifier_socket *note;
  64. i4_window_class *names[G1_MAX_PLAYERS];
  65. enum { START_NET_GAME, QUIT_NET_GAME, POLL };
  66. public:
  67. g1_server_start_window(w16 w, w16 h,
  68. i4_graphical_style_class *style,
  69. i4_net_protocol *protocol);
  70. virtual void object_message(int id);
  71. virtual void poll();
  72. char *name() { return "server_menu"; }
  73. ~g1_server_start_window();
  74. };
  75. class g1_client_wait_window : public g1_net_window_class
  76. {
  77. enum { QUIT_NET_GAME, POLL };
  78. public:
  79. g1_client_wait_window(w16 w, w16 h,
  80. i4_graphical_style_class *style,
  81. i4_net_protocol *protocol);
  82. virtual void object_message(int id);
  83. virtual void poll();
  84. char *name() { return "client_wait"; }
  85. ~g1_client_wait_window();
  86. };
  87. #endif