You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

87 lines
2.5 KiB

  1. #ifndef X11_UI_H
  2. #define X11_UI_H
  3. #include "types.h"
  4. #define CURSOR_SEP_MASK 0
  5. #define CURSOR_OWN_MASK 1
  6. #define DIALOG_NEWGAME 0
  7. #define DIALOG_PAUSEGAME 1
  8. #define DIALOG_WARPLEVEL 2
  9. #define DIALOG_HIGHSCORE 3
  10. #define DIALOG_QUITGAME 4
  11. #define DIALOG_STORY 5
  12. #define DIALOG_RULES 6
  13. #define DIALOG_ABOUT 7
  14. #define DIALOG_SCORE 8
  15. #define DIALOG_ENDGAME 9
  16. #define DIALOG_ENTERNAME 10
  17. #define DIALOG_MAX 10
  18. void UI_restart_timer(void);
  19. void UI_kill_timer(void);
  20. void UI_pause_game(void);
  21. void UI_resume_game(void);
  22. void UI_initialize(const char *gui, int *argc, char **argv);
  23. void UI_make_main_window(int size);
  24. void UI_graphics_init(void);
  25. void UI_make_dialogs(Picture *logo, Picture *icon, Picture *about);
  26. void UI_popup_dialog(int index);
  27. void UI_set_cursor(MCursor *cursor);
  28. void UI_set_icon(Picture *icon);
  29. void UI_clear(void);
  30. void UI_refresh(void);
  31. void UI_draw(Picture *picture, int x, int y);
  32. void UI_draw_line(int x1, int y1, int x2, int y2);
  33. void UI_draw_str(const char *str, int x, int y);
  34. void UI_set_pausebutton(int action);
  35. void UI_main_loop(void);
  36. void UI_update_dialog(int index, const char *str);
  37. void UI_load_picture(const char *name, int trans, Picture **pictp);
  38. void UI_load_picture_indexed(const char *name, int index, int trans,
  39. Picture **pictp);
  40. int UI_picture_width(Picture *pict);
  41. int UI_picture_height(Picture *pict);
  42. void UI_load_cursor(const char *name, int masked, MCursor **cursorp);
  43. int
  44. UI_intersect(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
  45. const char *UI_dialog_string(int index);
  46. const char *UI_menu_string(int index);
  47. typedef struct UI_methods {
  48. void (*set_cursor)(MCursor *cursor);
  49. void (*load_cursor)(const char *name, int masked, MCursor **cursorp);
  50. void (*load_picture)(const char *name, int trans, Picture **pictp);
  51. void (*set_icon)(Picture *pict);
  52. int (*picture_width)(Picture *pict);
  53. int (*picture_height)(Picture *pict);
  54. void (*graphics_init)(void);
  55. void (*clear_window)(void);
  56. void (*refresh_window)(void);
  57. void (*draw_image)(Picture *pict, int x, int y);
  58. void (*draw_line)(int x1, int y1, int x2, int y2);
  59. void (*draw_string)(const char *str, int x, int y);
  60. void (*start_timer)(int ms);
  61. void (*stop_timer)(void);
  62. int (*timer_active)(void);
  63. void (*popup_dialog)(int index);
  64. void (*main_loop)(void);
  65. void (*initialize)(int *argc, char **argv);
  66. void (*make_main_window)(int size);
  67. void (*create_dialogs)(Picture *logo, Picture *icon, Picture *about);
  68. void (*set_pausebutton)(int active);
  69. void (*update_dialog)(int index, const char *str);
  70. } UI_methods;
  71. #endif