foobar2000 SDK  2015-01-14
Functions
menu_helpers.cpp File Reference

Go to the source code of this file.

Functions

static unsigned calc_total_action_count ()
 
static bool g_is_checked (const GUID &p_command, const GUID &p_subcommand, const pfc::list_base_const_t< metadb_handle_ptr > &data, const GUID &caller)
 
static bool run_context_command_internal (const GUID &p_command, const GUID &p_subcommand, const pfc::list_base_const_t< metadb_handle_ptr > &data, const GUID &caller)
 

Function Documentation

static unsigned calc_total_action_count ( )
static

Definition at line 117 of file menu_helpers.cpp.

118 {
121  unsigned ret = 0;
122  while(e.next(ptr))
123  ret += ptr->get_num_items();
124  return ret;
125 }
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
static bool g_is_checked ( const GUID p_command,
const GUID p_subcommand,
const pfc::list_base_const_t< metadb_handle_ptr > &  data,
const GUID caller 
)
static

Definition at line 41 of file menu_helpers.cpp.

42 {
44  if (!menu_item_resolver::g_resolve_context_command(p_command, ptr, index)) return false;
45 
46  unsigned displayflags = 0;
47  pfc::string_formatter dummystring;
48  if (!ptr->item_get_display_data(dummystring,displayflags,index,p_subcommand,data,caller)) return false;
49  return (displayflags & contextmenu_item_node::FLAG_CHECKED) != 0;
50 
51 }
string8_fastalloc string_formatter
Definition: string_base.h:614
static bool g_resolve_context_command(const GUID &id, service_ptr_t< class contextmenu_item > &out, t_uint32 &out_index)
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
uint32_t t_uint32
Definition: int_types.h:5
static bool run_context_command_internal ( const GUID p_command,
const GUID p_subcommand,
const pfc::list_base_const_t< metadb_handle_ptr > &  data,
const GUID caller 
)
static

Definition at line 12 of file menu_helpers.cpp.

12  {
13  if (data.get_count() == 0) return false;
15  if (!menu_item_resolver::g_resolve_context_command(p_command, ptr, index)) return false;
16 
17  {
18  TRACK_CALL_TEXT("menu_helpers::run_command(), by GUID");
19  ptr->item_execute_simple(index, p_subcommand, data, caller);
20  }
21 
22  return true;
23 }
virtual t_size get_count() const =0
static bool g_resolve_context_command(const GUID &id, service_ptr_t< class contextmenu_item > &out, t_uint32 &out_index)
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
uint32_t t_uint32
Definition: int_types.h:5