remove bedrock::emit_drawer()
This commit is contained in:
parent
6b1cba1357
commit
88b9149f54
@ -87,7 +87,6 @@ namespace detail
|
|||||||
void manage_form_loader(core_window_t*, bool insert_or_remove);
|
void manage_form_loader(core_window_t*, bool insert_or_remove);
|
||||||
public:
|
public:
|
||||||
bool emit(event_code, core_window_t*, const event_arg&, bool ask_update, thread_context*);
|
bool emit(event_code, core_window_t*, const event_arg&, bool ask_update, thread_context*);
|
||||||
bool emit_drawer(event_code, core_window_t*, const event_arg&, thread_context*);
|
|
||||||
private:
|
private:
|
||||||
void _m_emit_core(event_code, core_window_t*, bool draw_only, const event_arg&);
|
void _m_emit_core(event_code, core_window_t*, bool draw_only, const event_arg&);
|
||||||
void _m_event_filter(event_code, core_window_t*, thread_context*);
|
void _m_event_filter(event_code, core_window_t*, thread_context*);
|
||||||
|
|||||||
@ -398,29 +398,6 @@ namespace detail
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd)
|
|
||||||
{
|
|
||||||
if(wd_manager().available(wd) == false)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
core_window_t * prev_wd;
|
|
||||||
if(thrd)
|
|
||||||
{
|
|
||||||
prev_wd = thrd->event_window;
|
|
||||||
thrd->event_window = wd;
|
|
||||||
_m_event_filter(evt_code, wd, thrd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(wd->other.upd_state == core_window_t::update_state::none)
|
|
||||||
wd->other.upd_state = core_window_t::update_state::lazy;
|
|
||||||
|
|
||||||
_m_emit_core(evt_code, wd, true, arg);
|
|
||||||
|
|
||||||
if(thrd) thrd->event_window = prev_wd;
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void assign_arg(arg_mouse& arg, basic_window* wd, unsigned msg, const XEvent& evt)
|
void assign_arg(arg_mouse& arg, basic_window* wd, unsigned msg, const XEvent& evt)
|
||||||
{
|
{
|
||||||
arg.window_handle = reinterpret_cast<window>(wd);
|
arg.window_handle = reinterpret_cast<window>(wd);
|
||||||
@ -554,7 +531,7 @@ namespace detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Arg>
|
template<typename Arg>
|
||||||
void emit_drawer(void(::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd)
|
void draw_invoker(void(::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd)
|
||||||
{
|
{
|
||||||
if(bedrock::instance().wd_manager().available(wd) == false)
|
if(bedrock::instance().wd_manager().available(wd) == false)
|
||||||
return;
|
return;
|
||||||
@ -790,7 +767,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
//call the drawer mouse up event for restoring the surface graphics
|
//call the drawer mouse up event for restoring the surface graphics
|
||||||
msgwnd->flags.action = mouse_action::normal;
|
msgwnd->flags.action = mouse_action::normal;
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -848,7 +825,7 @@ namespace detail
|
|||||||
msgwnd->flags.action = mouse_action::over;
|
msgwnd->flags.action = mouse_action::over;
|
||||||
|
|
||||||
click_arg.window_handle = reinterpret_cast<window>(msgwnd);
|
click_arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||||
emit_drawer(&drawer::click, msgwnd, click_arg, &context);
|
draw_invoker(&drawer::click, msgwnd, click_arg, &context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,7 +839,7 @@ namespace detail
|
|||||||
auto evt_ptr = retain.get();
|
auto evt_ptr = retain.get();
|
||||||
|
|
||||||
arg.evt_code = event_code::mouse_up;
|
arg.evt_code = event_code::mouse_up;
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
|
|
||||||
if(click_arg.window_handle)
|
if(click_arg.window_handle)
|
||||||
evt_ptr->click.emit(click_arg);
|
evt_ptr->click.emit(click_arg);
|
||||||
@ -1076,7 +1053,7 @@ namespace detail
|
|||||||
pressed_wd_space = msgwnd;
|
pressed_wd_space = msgwnd;
|
||||||
auto retain = msgwnd->together.events_ptr;
|
auto retain = msgwnd->together.events_ptr;
|
||||||
|
|
||||||
emit_drawer(&drawer::mouse_down, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_down, msgwnd, arg, &context);
|
||||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1168,7 +1145,7 @@ namespace detail
|
|||||||
brock.get_key_state(arg);
|
brock.get_key_state(arg);
|
||||||
msgwnd->together.events_ptr->key_char.emit(arg);
|
msgwnd->together.events_ptr->key_char.emit(arg);
|
||||||
if(arg.ignore == false && wd_manager.available(msgwnd))
|
if(arg.ignore == false && wd_manager.available(msgwnd))
|
||||||
brock.emit_drawer(event_code::key_char, msgwnd, arg, &context);
|
draw_invoker(&drawer::key_char, msgwnd, arg, &context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(brock.set_keyboard_shortkey(false))
|
if(brock.set_keyboard_shortkey(false))
|
||||||
@ -1224,7 +1201,7 @@ namespace detail
|
|||||||
arg.pos.y = 0;
|
arg.pos.y = 0;
|
||||||
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||||
|
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
pressed_wd_space = nullptr;
|
pressed_wd_space = nullptr;
|
||||||
|
|||||||
@ -756,7 +756,7 @@ namespace detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Arg>
|
template<typename Arg>
|
||||||
void emit_drawer(void (::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd)
|
void draw_invoker(void (::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd)
|
||||||
{
|
{
|
||||||
if (bedrock::instance().wd_manager().available(wd) == false)
|
if (bedrock::instance().wd_manager().available(wd) == false)
|
||||||
return;
|
return;
|
||||||
@ -990,7 +990,7 @@ namespace detail
|
|||||||
msgwnd->flags.action = mouse_action::normal;
|
msgwnd->flags.action = mouse_action::normal;
|
||||||
|
|
||||||
arg.evt_code = event_code::mouse_up;
|
arg.evt_code = event_code::mouse_up;
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1031,7 +1031,7 @@ namespace detail
|
|||||||
if ((::nana::mouse::left_button == arg.button) && (pressed_wd == msgwnd))
|
if ((::nana::mouse::left_button == arg.button) && (pressed_wd == msgwnd))
|
||||||
{
|
{
|
||||||
click_arg.window_handle = reinterpret_cast<window>(msgwnd);
|
click_arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||||
emit_drawer(&drawer::click, msgwnd, click_arg, &context);
|
draw_invoker(&drawer::click, msgwnd, click_arg, &context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1039,7 +1039,7 @@ namespace detail
|
|||||||
if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled)
|
if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled)
|
||||||
{
|
{
|
||||||
arg.evt_code = event_code::mouse_up;
|
arg.evt_code = event_code::mouse_up;
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
|
|
||||||
if (click_arg.window_handle)
|
if (click_arg.window_handle)
|
||||||
retain->click.emit(click_arg);
|
retain->click.emit(click_arg);
|
||||||
@ -1169,7 +1169,8 @@ namespace detail
|
|||||||
arg_wheel arg;
|
arg_wheel arg;
|
||||||
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
||||||
assign_arg(arg, scrolled_wd, pmdec);
|
assign_arg(arg, scrolled_wd, pmdec);
|
||||||
brock.emit_drawer(event_code::mouse_wheel, scrolled_wd, arg, &context);
|
|
||||||
|
draw_invoker(&drawer::mouse_wheel, scrolled_wd, arg, &context);
|
||||||
brock.wd_manager().do_lazy_refresh(scrolled_wd, false);
|
brock.wd_manager().do_lazy_refresh(scrolled_wd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1450,7 +1451,7 @@ namespace detail
|
|||||||
pressed_wd_space = msgwnd;
|
pressed_wd_space = msgwnd;
|
||||||
auto retain = msgwnd->together.events_ptr;
|
auto retain = msgwnd->together.events_ptr;
|
||||||
|
|
||||||
emit_drawer(&drawer::mouse_down, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_down, msgwnd, arg, &context);
|
||||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1496,7 +1497,7 @@ namespace detail
|
|||||||
|
|
||||||
msgwnd->together.events_ptr->key_char.emit(arg);
|
msgwnd->together.events_ptr->key_char.emit(arg);
|
||||||
if ((false == arg.ignore) && wd_manager.available(msgwnd))
|
if ((false == arg.ignore) && wd_manager.available(msgwnd))
|
||||||
brock.emit_drawer(event_code::key_char, msgwnd, arg, &context);
|
draw_invoker(&drawer::key_char, msgwnd, arg, &context);
|
||||||
|
|
||||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
@ -1536,7 +1537,7 @@ namespace detail
|
|||||||
arg.pos.y = 0;
|
arg.pos.y = 0;
|
||||||
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||||
|
|
||||||
emit_drawer(&drawer::mouse_up, msgwnd, arg, &context);
|
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||||
}
|
}
|
||||||
pressed_wd_space = nullptr;
|
pressed_wd_space = nullptr;
|
||||||
@ -1793,27 +1794,6 @@ namespace detail
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd)
|
|
||||||
{
|
|
||||||
if (bedrock_object.wd_manager().available(wd) == false)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
core_window_t* prev_event_wd;
|
|
||||||
if (thrd)
|
|
||||||
{
|
|
||||||
prev_event_wd = thrd->event_window;
|
|
||||||
thrd->event_window = wd;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wd->other.upd_state == core_window_t::update_state::none)
|
|
||||||
wd->other.upd_state = core_window_t::update_state::lazy;
|
|
||||||
|
|
||||||
_m_emit_core(evt_code, wd, true, arg);
|
|
||||||
|
|
||||||
if (thrd) thrd->event_window = prev_event_wd;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const wchar_t* translate(cursor id)
|
const wchar_t* translate(cursor id)
|
||||||
{
|
{
|
||||||
const wchar_t* name = IDC_ARROW;
|
const wchar_t* name = IDC_ARROW;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user