Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.64 KB | None | 0 0
  1. #ifndef _MENU_H
  2. #define _MENU_H
  3.  
  4. #include "event.h"
  5.  
  6. struct _Menu
  7. {
  8.     char *text;
  9.     char enabled, moveover;
  10.     struct _Menu *next;
  11.     Event *func;
  12. };
  13. typedef struct _Menu Menu;
  14.  
  15. struct _FormMenu
  16. {
  17.     Menu *menu;
  18.     char *text;
  19.     char moveover, pressed;
  20.     struct _FormMenu *next;
  21. };
  22. typedef struct _FormMenu FormMenu;
  23.  
  24. void InitFormMenuItem(FormMenu *menu);
  25. /* Initialize a form menu item, give default values */
  26.  
  27. void AddFormMenu(FormMenu *menu, char *title);
  28. /* Add an form menu item to an existing chain */
  29.  
  30. void DrawFormMenu(void *null);
  31. /* Draw all the form menus */
  32.  
  33. void IsMoveOverFormMenu(void *n);
  34. /* Judging if mouse is moving over a form menu */
  35.  
  36. void DrawMoveOverFormMenu(void *n);
  37. /* Draw the highlight effect of moving-over form menu */
  38.  
  39. void IsClickFormMenu(void *n);
  40. /* Judging if clicked an form menu */
  41.  
  42. void DoubleOver(void *n);
  43. /* Only a workaround for form menus */
  44.  
  45. void DrawClickFormMenu(void *n);
  46. /* Draw click effect for form menus */
  47.  
  48. void InitMenuItem(Menu *menu);
  49. /* Menu item initialization */
  50.  
  51. void AddMenu(Menu *menu, char enabled, char *title, Event *func);
  52. /* Add a menu item to an existing menu chain */
  53.  
  54. void DrawMenu(void *n, Menu *menu, int x, int y);
  55. /* Draw a menu */
  56.  
  57. void IsMoveOverMenu(void *n);
  58. /* Judging if moving over a menu item */
  59.  
  60. void DrawMoveOverMenu(void *n);
  61. /* Draw if moving over a menu item */
  62.  
  63. void ClearMenuMoveOver(void *n);
  64. /* Clear all move over states */
  65.  
  66. Menu *GetUpMenu(FormMenu *formmenu, Menu *menu);
  67. /* Get the upper menu item */
  68.  
  69. Menu *GetDownMenu(FormMenu *formmenu, Menu *menu);
  70. /* Get the down menu item */
  71.  
  72. FormMenu *GetLeftFormMenu();
  73. /* Get left form menu item */
  74.  
  75. FormMenu *GetRightFormMenu();
  76. /* Get right form menu item */
  77.  
  78. FormMenu *FindPressedFormMenu(void *n);
  79. /* Find the currently pressed form menu */
  80.  
  81. Menu *FindMoveOverMenu(void *n);
  82. /* Find the currently moving over menu item */
  83.  
  84. void MenuUp(void *n);
  85. /* Menu up! */
  86.  
  87. void MenuDown(void *n);
  88. /* Menu down! */
  89.  
  90. void FormMenuLeft(void *n);
  91. /* Move left form menu */
  92.  
  93. void FormMenuRight(void *n);
  94. /* Move right form menu */
  95.  
  96. void AddMenuToFormMenu(Menu *menu, FormMenu *formmenu);
  97. /* Add a menu to a form menu */
  98.  
  99. void OpenMenu(FormMenu *menu, int n);
  100. /* Open a form menu */
  101.  
  102. void OpenMenu0(void *n);
  103. /* Open the first form menu */
  104.  
  105. void OpenMenu1(void *n);
  106. /* Open the second form menu */
  107.  
  108. void OpenMenu2(void *n);
  109. /* Open the third form menu */
  110.  
  111. void OpenMenu3(void *n);
  112. /* Open the forth form menu */
  113.  
  114. void OpenMenu4(void *n);
  115. /* Open the fifth form menu */
  116.  
  117. void ChildTitleContextMenu(void *n);
  118. /* Context menu operations */
  119.  
  120. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement