fix incomplete type warning
This commit is contained in:
parent
880d0becf3
commit
f093f14c37
@ -126,36 +126,36 @@ namespace nana
|
|||||||
void* draw(std::function<void(paint::graphics&)> &&, bool diehard);
|
void* draw(std::function<void(paint::graphics&)> &&, bool diehard);
|
||||||
void erase(void* diehard);
|
void erase(void* diehard);
|
||||||
private:
|
private:
|
||||||
void _m_bground_pre();
|
void _m_effect_bground(bool before);
|
||||||
void _m_bground_end();
|
|
||||||
void _m_draw_dynamic_drawing_object();
|
|
||||||
bool _m_lazy_decleared() const;
|
bool _m_lazy_decleared() const;
|
||||||
|
method_state& _m_mth_state(int pos);
|
||||||
|
|
||||||
template<typename Arg, typename Mfptr>
|
template<typename Arg, typename Mfptr>
|
||||||
void _m_emit(event_code evt_code, const Arg& arg, Mfptr mfptr)
|
void _m_emit(event_code evt_code, const Arg& arg, Mfptr mfptr)
|
||||||
{
|
{
|
||||||
const int pos = static_cast<int>(evt_code);
|
const int pos = static_cast<int>(evt_code);
|
||||||
if (data_impl_->realizer && (method_state::not_overrided != data_impl_->mth_state[pos]))
|
|
||||||
{
|
|
||||||
_m_bground_pre();
|
|
||||||
|
|
||||||
if (method_state::pending == data_impl_->mth_state[pos])
|
auto realizer = this->realizer();
|
||||||
|
auto & mth_state = _m_mth_state(pos);
|
||||||
|
|
||||||
|
if (realizer && (method_state::not_overrided != mth_state))
|
||||||
{
|
{
|
||||||
(data_impl_->realizer->*mfptr)(graphics, arg);
|
_m_effect_bground(true);
|
||||||
|
|
||||||
|
if (method_state::pending == mth_state)
|
||||||
|
{
|
||||||
|
(realizer->*mfptr)(graphics, arg);
|
||||||
|
|
||||||
//Check realizer, when the window is closed in that event handler, the drawer will be
|
//Check realizer, when the window is closed in that event handler, the drawer will be
|
||||||
//detached and realizer will be a nullptr
|
//detached and realizer will be a nullptr
|
||||||
if (data_impl_->realizer)
|
if (realizer)
|
||||||
data_impl_->mth_state[pos] = (data_impl_->realizer->_m_overrided(evt_code) ? method_state::overrided : method_state::not_overrided);
|
mth_state = (realizer->_m_overrided(evt_code) ? method_state::overrided : method_state::not_overrided);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
(data_impl_->realizer->*mfptr)(graphics, arg);
|
(realizer->*mfptr)(graphics, arg);
|
||||||
|
|
||||||
if (_m_lazy_decleared())
|
if (_m_lazy_decleared())
|
||||||
{
|
_m_effect_bground(false);
|
||||||
_m_draw_dynamic_drawing_object();
|
|
||||||
_m_bground_end();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* A Drawer Implementation
|
* A Drawer Implementation
|
||||||
* Nana C++ Library(http://www.nanapro.org)
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
* Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com)
|
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||||
*
|
*
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -297,10 +297,9 @@ namespace nana
|
|||||||
if (data_impl_->realizer && !data_impl_->refreshing)
|
if (data_impl_->realizer && !data_impl_->refreshing)
|
||||||
{
|
{
|
||||||
data_impl_->refreshing = true;
|
data_impl_->refreshing = true;
|
||||||
_m_bground_pre();
|
_m_effect_bground(true);
|
||||||
data_impl_->realizer->refresh(graphics);
|
data_impl_->realizer->refresh(graphics);
|
||||||
_m_draw_dynamic_drawing_object();
|
_m_effect_bground(false);
|
||||||
_m_bground_end();
|
|
||||||
graphics.flush();
|
graphics.flush();
|
||||||
data_impl_->refreshing = false;
|
data_impl_->refreshing = false;
|
||||||
}
|
}
|
||||||
@ -372,27 +371,32 @@ namespace nana
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer::_m_bground_pre()
|
void drawer::_m_effect_bground(bool before)
|
||||||
{
|
|
||||||
if (data_impl_->window_handle->effect.bground && data_impl_->window_handle->effect.bground_fade_rate < 0.01)
|
|
||||||
data_impl_->window_handle->other.glass_buffer.paste(graphics, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawer::_m_bground_end()
|
|
||||||
{
|
|
||||||
if (data_impl_->window_handle->effect.bground && data_impl_->window_handle->effect.bground_fade_rate >= 0.01)
|
|
||||||
data_impl_->window_handle->other.glass_buffer.blend(::nana::rectangle{ data_impl_->window_handle->other.glass_buffer.size() }, graphics, nana::point(), data_impl_->window_handle->effect.bground_fade_rate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawer::_m_draw_dynamic_drawing_object()
|
|
||||||
{
|
{
|
||||||
for (auto * dw : data_impl_->draws)
|
for (auto * dw : data_impl_->draws)
|
||||||
dw->draw(graphics);
|
dw->draw(graphics);
|
||||||
|
|
||||||
|
auto & effect = data_impl_->window_handle->effect;
|
||||||
|
if (effect.bground)
|
||||||
|
{
|
||||||
|
if (before)
|
||||||
|
{
|
||||||
|
if (effect.bground_fade_rate < 0.01)
|
||||||
|
data_impl_->window_handle->other.glass_buffer.paste(graphics, 0, 0);
|
||||||
|
}
|
||||||
|
else if (effect.bground_fade_rate >= 0.01)
|
||||||
|
data_impl_->window_handle->other.glass_buffer.blend(::nana::rectangle{ data_impl_->window_handle->other.glass_buffer.size() }, graphics, nana::point(), effect.bground_fade_rate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool drawer::_m_lazy_decleared() const
|
bool drawer::_m_lazy_decleared() const
|
||||||
{
|
{
|
||||||
return (basic_window::update_state::refresh == data_impl_->window_handle->other.upd_state);
|
return (basic_window::update_state::refresh == data_impl_->window_handle->other.upd_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drawer::method_state& drawer::_m_mth_state(int pos)
|
||||||
|
{
|
||||||
|
return data_impl_->mth_state[pos];
|
||||||
|
}
|
||||||
}//end namespace detail
|
}//end namespace detail
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
Loading…
x
Reference in New Issue
Block a user