Skip to content

Instantly share code, notes, and snippets.

@emoon
Last active August 3, 2016 03:09
Show Gist options
  • Save emoon/8ded430a049a2c4c0067b6c114a1748b to your computer and use it in GitHub Desktop.
Save emoon/8ded430a049a2c4c0067b6c114a1748b to your computer and use it in GitHub Desktop.
#define PDMENUFUNCS_GLOBAL "Menu Service 1"
typedef uint64_t PDMenuHandle;
typedef uint64_t PDMenuItem;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
enum {
PDMENU_FLAGS_ENABLED = 1 << 1,
PDMENU_FLAGS_DISABLED = 1 << 2,
PDMENU_FLAGS_SEPARATOR = 1 << 3,
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct PDMenuFuncs {
PDMenuHandle (*create_menu)(const char* name);
void (*insert_menu)(PDMenuHandle parent, PDMenuHandle child);
void (*destroy_menu)(PDMenuHandle handle);
PDMenuItem (*insert_menu_item)(PDMenuHandle menu, const char* name, uint32_t id);
void (*remove_menu_item)(PDMenuItem handle);
void (*set_flags)(PDMenuItem item, uint32_t flags);
void (*set_shortcut_key)(PDMenuItem item, uint32_t accel_key, uint32_t modifier);
} PDMenuFuncs;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment