app.hh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. //{{{ Application Class
  9. //
  10. //$Id: app.hh,v 1.22 1998/06/02 23:50:20 jc Exp $
  11. #ifndef I4_APP_HH
  12. #define I4_APP_HH
  13. class i4_window_manager_class;
  14. class i4_parent_window_class;
  15. class i4_graphical_style_class;
  16. #include "video/display.hh"
  17. #include "device/device.hh"
  18. #include "palette/pal.hh"
  19. #include "file/file.hh"
  20. class i4_application_class : public i4_event_handler_class
  21. {
  22. protected:
  23. i4_bool finished;
  24. i4_display_class *display;
  25. i4_window_manager_class *wm;
  26. i4_application_class() {}
  27. i4_display_class::mode *find_mode(w16 &width, w16 &height, int driver_id);
  28. virtual void handle_no_displays();
  29. virtual void receive_event(i4_event *ev);
  30. virtual void get_input();
  31. virtual void calc_model();
  32. virtual void refresh();
  33. virtual void init();
  34. virtual void uninit();
  35. void memory_init();
  36. void resource_init(char *resource_file,
  37. void *resource_buffer);
  38. void display_init();
  39. void display_uninit();
  40. // normal the app use the registry to decide which display
  41. // to use. if no registry item available it uses the first display
  42. virtual i4_bool get_display_name(char *name, int max_len);
  43. public:
  44. virtual void quit() { finished=i4_T; }
  45. // when you are not doing time critical return i4_T so i4 will give time to other processes
  46. virtual i4_bool idle() { return i4_T; }
  47. virtual ~i4_application_class();
  48. virtual void run();
  49. i4_parent_window_class *get_root_window();
  50. i4_graphical_style_class *get_style();
  51. i4_window_manager_class *get_window_manager() { return wm; }
  52. i4_display_class *get_display() { return display; }
  53. };
  54. extern i4_application_class *i4_current_app;
  55. #endif