/[LeafOK_CVS]/lbbs/include/menu.h
ViewVC logotype

Diff of /lbbs/include/menu.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 by sysadm, Thu May 15 05:14:57 2025 UTC Revision 1.25 by sysadm, Fri Jun 20 11:27:47 2025 UTC
# Line 19  Line 19 
19    
20  #include "common.h"  #include "common.h"
21  #include "trie_dict.h"  #include "trie_dict.h"
22    #include "bbs_cmd.h"
23  #include <stdint.h>  #include <stdint.h>
 #include <sys/shm.h>  
24    
25  #define MAX_MENUITEM_LENGTH 50  #define MAX_MENU_NAME_LENGTH 30
26  #define MAX_ITEMS_PER_MENU 30  #define MAX_ITEMS_PER_MENU 256
27  #define MAX_MENUNAME_LENGTH 256  #define MAX_MENUITEM_NAME_LENGTH 256
28  #define MAX_MENUACTION_LENGTH 20  #define MAX_MENUITEM_TEXT_LENGTH 100
29  #define MAX_MENUTITLE_LENGTH 50  #define MAX_MENUITEM_ACTION_LENGTH 30
30    #define MAX_MENUTITLE_TEXT_LENGTH 50
31  #define MAX_MENU_SCR_NAME_LENGTH 20  #define MAX_MENU_SCR_NAME_LENGTH 20
32  #define MAX_MENU_SCR_BUF_LENGTH 2000  #define MAX_MENU_SCR_BUF_LENGTH 2000
33  #define MAX_MENUS 256  #define MAX_MENUS 256
# Line 39  typedef uint64_t MENU_SCREEN_ID; Line 40  typedef uint64_t MENU_SCREEN_ID;
40    
41  struct menu_item_t  struct menu_item_t
42  {  {
43          int16_t row, col, r_row, r_col;          int16_t row, col;
44          char action[MAX_MENUACTION_LENGTH];          char action[MAX_MENUITEM_ACTION_LENGTH];
45          MENU_ID action_menu_id;          MENU_ID action_menu_id;
46          int8_t submenu, display;          bbs_cmd_handler action_cmd_handler;
47            int8_t submenu;
48          int priv, level;          int priv, level;
49          char name[MAX_MENUNAME_LENGTH];          char name[MAX_MENUITEM_NAME_LENGTH];
50          char text[MAX_MENUITEM_LENGTH];          char text[MAX_MENUITEM_TEXT_LENGTH];
51  };  };
52  typedef struct menu_item_t MENU_ITEM;  typedef struct menu_item_t MENU_ITEM;
53    
# Line 53  struct menu_title_t Line 55  struct menu_title_t
55  {  {
56          int16_t row, col;          int16_t row, col;
57          int8_t show;          int8_t show;
58          char text[MAX_MENUTITLE_LENGTH];          char text[MAX_MENUTITLE_TEXT_LENGTH];
59  };  };
60  typedef struct menu_title_t MENU_TITLE;  typedef struct menu_title_t MENU_TITLE;
61    
# Line 67  typedef struct menu_screen_t MENU_SCREEN Line 69  typedef struct menu_screen_t MENU_SCREEN
69    
70  struct menu_t  struct menu_t
71  {  {
72          char name[MAX_MENUNAME_LENGTH];          char name[MAX_MENU_NAME_LENGTH];
73          MENU_TITLE title;          MENU_TITLE title;
74            char screen_name[MAX_MENU_SCR_NAME_LENGTH];
75          MENU_SCREEN_ID screen_id;          MENU_SCREEN_ID screen_id;
76          int8_t screen_show;          int8_t screen_show;
77          int16_t screen_row, screen_col;          int16_t screen_row, screen_col;
78          MENU_ITEM_ID items[MAX_ITEMS_PER_MENU];          MENU_ITEM_ID items[MAX_ITEMS_PER_MENU];
79          int16_t item_count;          int16_t item_count;
80            int16_t page_row, page_col;
81            int16_t page_item_limit;
82            int8_t use_filter;
83            bbs_cmd_handler filter_handler;
84  };  };
85  typedef struct menu_t MENU;  typedef struct menu_t MENU;
86    
# Line 94  struct menu_set_t Line 101  struct menu_set_t
101          MENU_ID menu_id_path[MAX_MENU_DEPTH];          MENU_ID menu_id_path[MAX_MENU_DEPTH];
102          int16_t menu_item_pos[MAX_MENU_DEPTH];          int16_t menu_item_pos[MAX_MENU_DEPTH];
103          int16_t choose_step;          int16_t choose_step;
104            int8_t menu_item_display[MAX_ITEMS_PER_MENU];
105            int16_t menu_item_r_row[MAX_ITEMS_PER_MENU];
106            int16_t menu_item_r_col[MAX_ITEMS_PER_MENU];
107            int16_t menu_item_page_id[MAX_ITEMS_PER_MENU];
108  };  };
109  typedef struct menu_set_t MENU_SET;  typedef struct menu_set_t MENU_SET;
110    
# Line 102  extern MENU_SET *p_bbs_menu; Line 113  extern MENU_SET *p_bbs_menu;
113  extern int load_menu(MENU_SET *p_menu_set, const char *conf_file);  extern int load_menu(MENU_SET *p_menu_set, const char *conf_file);
114  extern int unload_menu(MENU_SET *p_menu_set);  extern int unload_menu(MENU_SET *p_menu_set);
115    
116  extern int load_menu_shm(MENU_SET *p_menu_set);  extern int set_menu_shm_readonly(MENU_SET *p_menu_set);
117  extern int unload_menu_shm(MENU_SET *p_menu_set);  extern int detach_menu_shm(MENU_SET *p_menu_set);
118    
119    extern int display_menu_cursor(MENU_SET *p_menu_set, int show);
120  extern int menu_control(MENU_SET *p_menu_set, int key);  extern int menu_control(MENU_SET *p_menu_set, int key);
121  extern int display_menu(MENU_SET *p_menu_set);  extern int display_menu(MENU_SET *p_menu_set);
122    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1