7 ui_element_config_impl(
const GUID & guid) : m_guid(guid) {}
8 ui_element_config_impl(
const GUID & guid,
const void * buffer,
t_size size) : m_guid(guid) {
9 m_content.set_data_fromptr(reinterpret_cast<const t_uint8*>(buffer),size);
12 void * get_data_var() {
return m_content.get_ptr();}
13 void set_data_size(
t_size size) {m_content.set_size(size);}
16 const void *
get_data()
const {
return m_content.get_ptr();}
31 data->set_data_size(bytes);
32 in->read_object(data->get_data_var(),bytes,abort);
37 if (bytes <
sizeof(
GUID))
throw exception_io_data_truncation();
56 p_out =
"Playlist Renderers";
return true;
58 p_out =
"Media Library Viewers";
return true;
60 p_out =
"Selection Information";
return true;
62 p_out =
"Playback Visualization";
return true;
64 p_out =
"Playback Information";
return true;
66 p_out =
"Utility";
return true;
68 p_out =
"Containers";
return true;
81 if (query_color(p_what,ret))
return ret;
83 if (idx < 0)
return 0;
84 return GetSysColor(idx);
95 ui_element::ptr ptr;
if (!g_find(ptr,p_guid))
return false;
96 ptr->get_name(p_out);
return true;
100 ui_element_instance_callback_v2::ptr v2;
102 PFC_ASSERT(!
"Should not get here - somebody implemented ui_element_instance_callback but not ui_element_instance_callback_v2.");
105 return v2->is_elem_visible(elem);
121 ui_element_instance_callback_v3::ptr v3;
122 if (!this->
service_query_t(v3)) { PFC_ASSERT(!
"Outdated UI Element host implementation");
return 0; }
123 return v3->notify(source, what, param1, param2, param2size);
static const GUID ui_element_subclass_utility
Configuration of a UI element.
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
bool ui_element_subclass_description(const GUID &id, pfc::string_base &p_out)
static bool service_by_guid(service_ptr_t< what > &out, const GUID &theID)
virtual const void * get_data() const =0
Returns raw configuration data pointer.
bool is_elem_visible_(service_ptr_t< class ui_element_instance > elem)
bool is_border_needed(ui_element_instance *source)
static const GUID ui_element_host_notify_set_elem_label
Set to ui_element_instance_callback_v3 to set our element's label. Param1 is ignored, param2 is a pointer to a UTF-8 string containing the new label. Return value is 1 if the label is user-visible, 0 if the host does not support displaying overridden labels.
abort_callback_impl abort_callback_dummy
virtual t_size get_data_size() const =0
Returns raw configuration data size, in bytes.
static const GUID ui_element_host_notify_get_dialog_texture
ui_element_config::ptr subelement(t_size size)
static const GUID ui_element_host_notify_is_border_needed
bool set_elem_label(ui_element_instance *source, const char *label)
t_ui_color query_std_color(const GUID &p_what)
Helper - a wrapper around query_color(), if the color is not user-overridden, returns relevant system...
static int ui_color_to_sys_color_index(const GUID &p_guid)
static const GUID ui_element_subclass_selection_information
static const GUID ui_element_subclass_playback_information
static const GUID ui_element_subclass_containers
static const GUID ui_element_subclass_media_library_viewers
t_uint32 get_dialog_texture(ui_element_instance *source)
static bool g_find(service_ptr_t< ui_element > &out, const GUID &id)
Instance of a UI element.
static const GUID ui_element_subclass_playlist_renderers
static const GUID ui_element_subclass_playback_visualisation
static bool g_get_name(pfc::string_base &p_out, const GUID &p_guid)
bool service_query_t(service_ptr_t< T > &p_out)
Queries whether the object supports specific interface and retrieves a pointer to that interface...
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
t_size notify_(ui_element_instance *source, const GUID &what, t_size param1, const void *param2, t_size param2size)
virtual bool get_element_group(pfc::string_base &p_out)
Retrieves a human-readable description of the element's function to use for grouping in the element l...
virtual GUID get_guid() const =0
Returns GUID of the UI element this configuration data belongs to.
static service_ptr_t< ui_element_config > g_create(const GUID &id, const void *data, t_size size)
Helper.