add platform specific function which may override invoked command
[git-cheetah/kirill.git] / common / cheetahmenu.h
blobb600770cd45640621fa0b4f761463f4454c0a07b
1 #ifndef CHEETAHMENU_H
2 #define CHEETAHMENU_H
4 void build_cheetah_menu(struct git_data *data, void *platform_data);
6 /*
7 * Prototypes of functions that must be provided by the client
8 */
9 void reset_platform(void *platform);
10 BOOL build_separator(struct git_data *data, const struct menu_item *item,
11 void *platform);
12 BOOL build_item(struct git_data *data, const struct menu_item *item,
13 void *platform);
15 void *start_submenu(struct git_data *, const struct menu_item *item,
16 void *platform);
17 void end_submenu(void *parent, void *submenu);
19 void check_menu_item(void *platform, int checked);
22 * This lets a platform override the command called by an item
24 typedef enum {
25 MENU_GUI,
26 MENU_INIT,
27 MENU_HISTORY,
28 MENU_BASH,
29 MENU_BLAME,
30 MENU_CITOOL,
31 MENU_ADDALL,
32 MENU_BRANCH,
33 } menu_commands;
35 typedef void (*free_func_t)(void *);
37 const char **menu_get_platform_argv(menu_commands cmd, const void *data,
38 free_func_t *free_platform_argv, void **argv_data);
41 * Cheetah-specific flags and functions
43 * Generally, nobody is interested in these flags & functions, but
44 * they may be useful for unit testing.
46 * 2 bits to indicate each choise are required because
47 * menu_item.selection is used as a mask and there are
48 * actually three choices:
49 * - selected;
50 * - not selected;
51 * - irrelevant
53 #define MENU_ITEM_FILE (1 << 0)
54 #define MENU_ITEM_DIR (1 << 1)
55 #define MENU_ITEM_NOREPO (1 << 2)
56 #define MENU_ITEM_REPO (1 << 3)
57 #define MENU_ITEM_TRACK (1 << 4)
58 #define MENU_ITEM_NOTRACK (1 << 5)
60 UINT cheetah_menu_mask(struct git_data *this_);
62 #endif /* CHEETAHMENU_H */