add last backwards-compatible version

This commit is contained in:
2021-12-14 00:33:46 -07:00
parent 68b10d413b
commit b0dd3f07f3
335 changed files with 4746 additions and 19627 deletions

View File

@@ -34,7 +34,7 @@ public:
//! Helper for reading data from ui_element_config.
class ui_element_config_parser : public stream_reader_formatter<> {
public:
ui_element_config_parser(ui_element_config::ptr in) : m_data(in), _m_stream(in->get_data(),in->get_data_size()), stream_reader_formatter(_m_stream,fb2k::noAbort) {}
ui_element_config_parser(ui_element_config::ptr in) : m_data(in), _m_stream(in->get_data(),in->get_data_size()), stream_reader_formatter(_m_stream,_m_abort) {}
void reset() {_m_stream.reset();}
t_size get_remaining() const {return _m_stream.get_remaining();}
@@ -43,13 +43,14 @@ public:
ui_element_config::ptr subelement(const GUID & id, t_size dataSize);
private:
const ui_element_config::ptr m_data;
abort_callback_dummy _m_abort;
stream_reader_memblock_ref _m_stream;
};
//! Helper creating ui_element_config from your data.
class ui_element_config_builder : public stream_writer_formatter<> {
public:
ui_element_config_builder() : stream_writer_formatter(_m_stream,fb2k::noAbort) {}
ui_element_config_builder() : stream_writer_formatter(_m_stream,_m_abort) {}
ui_element_config::ptr finish(const GUID & id) {
return ui_element_config::g_create(id,_m_stream.m_buffer);
}
@@ -57,6 +58,7 @@ public:
_m_stream.m_buffer.set_size(0);
}
private:
abort_callback_dummy _m_abort;
stream_writer_buffer_simple _m_stream;
};
@@ -96,9 +98,23 @@ static const GUID ui_font_statusbar = { 0xc7fd555b, 0xbd15, 0x4f74, { 0x93, 0xe,
static const GUID ui_font_console = { 0xb08c619d, 0xd3d1, 0x4089, { 0x93, 0xb2, 0xd5, 0xb, 0x87, 0x2d, 0x1a, 0x25 } };
//! @returns -1 when the GUID is unknown / unmappable, index that can be passed over to GetSysColor() otherwise.
int ui_color_to_sys_color_index(const GUID & p_guid);
GUID ui_color_from_sys_color_index( int idx );
static int ui_color_to_sys_color_index(const GUID & p_guid) {
if (p_guid == ui_color_text) {
return COLOR_WINDOWTEXT;
} else if (p_guid == ui_color_background) {
return COLOR_WINDOW;
} else if (p_guid == ui_color_highlight) {
return COLOR_HOTLIGHT;
} else if (p_guid == ui_color_selection) {
return COLOR_HIGHLIGHT;
} else {
return -1;
}
}
struct ui_element_min_max_info {
ui_element_min_max_info() : m_min_width(0), m_max_width(~0), m_min_height(0), m_max_height(~0) {}
@@ -138,9 +154,6 @@ public:
//! Helper - a wrapper around query_color(), if the color is not user-overridden, returns relevant system color.
t_ui_color query_std_color(const GUID & p_what);
#ifdef _WIN32
t_ui_color getSysColor( int sysColorIndex );
#endif
bool is_elem_visible_(service_ptr_t<class ui_element_instance> elem);
@@ -516,6 +529,14 @@ public:
virtual HWND highlight_element( HWND wndElem ) = 0;
};
class NOVTABLE ui_element_typable_window_manager : public service_base {
FB2K_MAKE_SERVICE_COREAPI(ui_element_typable_window_manager)
public:
virtual void add(HWND wnd) = 0;
virtual void remove(HWND wnd) = 0;
virtual bool is_registered(HWND wnd) = 0;
};
//! Dispatched through ui_element_instance::notify() when host changes color settings. Other parameters are not used and should be set to zero.
static const GUID ui_element_notify_colors_changed = { 0xeedda994, 0xe3d2, 0x441a, { 0xbe, 0x47, 0xa1, 0x63, 0x5b, 0x71, 0xab, 0x60 } };
static const GUID ui_element_notify_font_changed = { 0x7a6964a8, 0xc797, 0x4737, { 0x90, 0x55, 0x7d, 0x84, 0xe7, 0x3d, 0x63, 0x6e } };