| 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> |
| 24 |
#include <sys/shm.h> |
#include <sys/shm.h> |
| 25 |
|
|
| 26 |
#define MAX_MENUITEM_LENGTH 50 |
#define MAX_MENU_NAME_LENGTH 30 |
| 27 |
#define MAX_ITEMS_PER_MENU 30 |
#define MAX_ITEMS_PER_MENU 256 |
| 28 |
#define MAX_MENUNAME_LENGTH 256 |
#define MAX_MENUITEM_NAME_LENGTH 256 |
| 29 |
#define MAX_MENUACTION_LENGTH 20 |
#define MAX_MENUITEM_TEXT_LENGTH 100 |
| 30 |
#define MAX_MENUTITLE_LENGTH 50 |
#define MAX_MENUITEM_ACTION_LENGTH 30 |
| 31 |
|
#define MAX_MENUTITLE_TEXT_LENGTH 50 |
| 32 |
#define MAX_MENU_SCR_NAME_LENGTH 20 |
#define MAX_MENU_SCR_NAME_LENGTH 20 |
| 33 |
#define MAX_MENU_SCR_BUF_LENGTH 2000 |
#define MAX_MENU_SCR_BUF_LENGTH 2000 |
| 34 |
#define MAX_MENUS 256 |
#define MAX_MENUS 256 |
| 42 |
struct menu_item_t |
struct menu_item_t |
| 43 |
{ |
{ |
| 44 |
int16_t row, col; |
int16_t row, col; |
| 45 |
char action[MAX_MENUACTION_LENGTH]; |
char action[MAX_MENUITEM_ACTION_LENGTH]; |
| 46 |
MENU_ID action_menu_id; |
MENU_ID action_menu_id; |
| 47 |
|
bbs_cmd_handler action_cmd_handler; |
| 48 |
int8_t submenu; |
int8_t submenu; |
| 49 |
int priv, level; |
int priv, level; |
| 50 |
char name[MAX_MENUNAME_LENGTH]; |
char name[MAX_MENUITEM_NAME_LENGTH]; |
| 51 |
char text[MAX_MENUITEM_LENGTH]; |
char text[MAX_MENUITEM_TEXT_LENGTH]; |
| 52 |
}; |
}; |
| 53 |
typedef struct menu_item_t MENU_ITEM; |
typedef struct menu_item_t MENU_ITEM; |
| 54 |
|
|
| 56 |
{ |
{ |
| 57 |
int16_t row, col; |
int16_t row, col; |
| 58 |
int8_t show; |
int8_t show; |
| 59 |
char text[MAX_MENUTITLE_LENGTH]; |
char text[MAX_MENUTITLE_TEXT_LENGTH]; |
| 60 |
}; |
}; |
| 61 |
typedef struct menu_title_t MENU_TITLE; |
typedef struct menu_title_t MENU_TITLE; |
| 62 |
|
|
| 70 |
|
|
| 71 |
struct menu_t |
struct menu_t |
| 72 |
{ |
{ |
| 73 |
char name[MAX_MENUNAME_LENGTH]; |
char name[MAX_MENU_NAME_LENGTH]; |
| 74 |
MENU_TITLE title; |
MENU_TITLE title; |
| 75 |
|
char screen_name[MAX_MENU_SCR_NAME_LENGTH]; |
| 76 |
MENU_SCREEN_ID screen_id; |
MENU_SCREEN_ID screen_id; |
| 77 |
int8_t screen_show; |
int8_t screen_show; |
| 78 |
int16_t screen_row, screen_col; |
int16_t screen_row, screen_col; |
| 79 |
MENU_ITEM_ID items[MAX_ITEMS_PER_MENU]; |
MENU_ITEM_ID items[MAX_ITEMS_PER_MENU]; |
| 80 |
int16_t item_count; |
int16_t item_count; |
| 81 |
|
int16_t page_row, page_col; |
| 82 |
|
int16_t page_item_limit; |
| 83 |
}; |
}; |
| 84 |
typedef struct menu_t MENU; |
typedef struct menu_t MENU; |
| 85 |
|
|
| 103 |
int8_t menu_item_display[MAX_ITEMS_PER_MENU]; |
int8_t menu_item_display[MAX_ITEMS_PER_MENU]; |
| 104 |
int16_t menu_item_r_row[MAX_ITEMS_PER_MENU]; |
int16_t menu_item_r_row[MAX_ITEMS_PER_MENU]; |
| 105 |
int16_t menu_item_r_col[MAX_ITEMS_PER_MENU]; |
int16_t menu_item_r_col[MAX_ITEMS_PER_MENU]; |
| 106 |
|
int16_t menu_item_page_id[MAX_ITEMS_PER_MENU]; |
| 107 |
}; |
}; |
| 108 |
typedef struct menu_set_t MENU_SET; |
typedef struct menu_set_t MENU_SET; |
| 109 |
|
|