From 1a01d23bd9a1a66699d0e68966b001236d65e313 Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 23 Jan 2012 22:31:24 +0100 Subject: cleaned up and added more documentation for DB_ACTION_** stuff --- deadbeef.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'deadbeef.h') diff --git a/deadbeef.h b/deadbeef.h index 8cb0a11a..bd3e4ffa 100644 --- a/deadbeef.h +++ b/deadbeef.h @@ -742,6 +742,15 @@ typedef struct { const char *(*pl_find_meta_raw) (DB_playItem_t *it, const char *key); } DB_functions_t; +// NOTE: an item placement must be selected like this +// if (flags & DB_ACTION_COMMON) -> main menu, or nowhere, or where GUI plugin wants +// basically, to put it into main menu, prefix the item title with the menu name +// e.g. title = "File/MyItem" --> this will add the item under File menu +// +// if (flags & PLAYLIST) -> playlist (tab) context menu +// +// if (none of the above) -> track context menu + enum { /* Action in main menu (or whereever ui prefers) */ DB_ACTION_COMMON = 1 << 0, @@ -759,14 +768,18 @@ enum { DB_ACTION_DISABLED = 1 << 4, /* Action for the playlist (tab) */ + /* this is new in 0.5.2 (API v1.2) */ DB_ACTION_PLAYLIST = 1 << 5, }; struct DB_plugin_action_s; // userdata type depends on type of action -// can be track ptr, or playlist ptr, etc +// it must be NULL for DB_ACTION_COMMON +// or ddb_playlist_t * for DB_ACTION_PLAYLIST +// or ddb_playItem_t * for none of the above (track context menu) typedef int (*DB_plugin_action_callback_t) (struct DB_plugin_action_s *action, void *userdata); +#define DDB_ACTION_CALLBACK(x)((int (*)(struct DB_plugin_action_s *action, void *userdata))x) typedef struct DB_plugin_action_s { const char *title; -- cgit v1.2.3