remove deprecated code

This commit is contained in:
Jinhao 2018-06-24 15:49:32 +08:00
parent 03336210a5
commit a781a8790f
4 changed files with 5 additions and 70 deletions

View File

@ -120,8 +120,6 @@ namespace nana
///Only supports the wide string, because it is very hard to specify the begin and end position in a UTF-8 string. ///Only supports the wide string, because it is very hard to specify the begin and end position in a UTF-8 string.
::nana::size glyph_extent_size(std::wstring_view text, std::size_t begin, std::size_t end) const; ::nana::size glyph_extent_size(std::wstring_view text, std::size_t begin, std::size_t end) const;
//bool glyph_pixels(std::wstring_view text, unsigned* pxbuf) const; //deprecated
/// Returns a buffer which stores the pixel of each charater stored in text. /// Returns a buffer which stores the pixel of each charater stored in text.
/** /**
* @param text The text to be requested. * @param text The text to be requested.

View File

@ -71,9 +71,7 @@ namespace nana{
caption_dimension.width += 1; caption_dimension.width += 1;
std::string div = "vert margin=[0," + std::to_string(gap) + "," + std::to_string(gap + 5) + "," + std::to_string(gap) + "]"; std::string div = "vert margin=[0," + std::to_string(gap) + "," + std::to_string(gap + 5) + "," + std::to_string(gap) + "]";
#if 0
div += "<weight=" + std::to_string(caption_dimension.height) + " <weight=5><" + field_title + " weight=" + std::to_string(caption_dimension.width + 1) + ">>";
#else
div += "<weight=" + std::to_string(caption_dimension.height) + " "; div += "<weight=" + std::to_string(caption_dimension.height) + " ";
if (align::left == caption_align) if (align::left == caption_align)
@ -88,9 +86,7 @@ namespace nana{
else if (align::center == caption_align) else if (align::center == caption_align)
div += "<>"; div += "<>";
div += ">"; div += "><<vert margin=5 " + std::string(field_options) + ">";
#endif
div += "<<vert margin=5 " + std::string(field_options) + ">";
if (!usr_div_str.empty()) if (!usr_div_str.empty())
div += "<" + usr_div_str + ">>"; div += "<" + usr_div_str + ">>";

View File

@ -85,27 +85,10 @@ namespace nana {
cv_scroll(std::make_shared<cv_scroll_rep>()) cv_scroll(std::make_shared<cv_scroll_rep>())
{ {
API::events(handle).mouse_wheel.connect_unignorable([this](const arg_wheel& arg) { API::events(handle).mouse_wheel.connect_unignorable([this](const arg_wheel& arg) {
#if 0
scroll_interface * scroll = nullptr;
switch (arg.which)
{
case arg_wheel::wheel::vertical:
scroll = &vert;
break;
case arg_wheel::wheel::horizontal:
scroll = &horz;
break;
default:
//Other button is not unsupported.
return;
}
#else
auto const scroll = cv_scroll->scroll(arg.which);
if (nullptr == scroll)
return;
#endif
if (!API::empty_window(arg.window_handle)) auto const scroll = cv_scroll->scroll(arg.which);
if (scroll && (!API::empty_window(arg.window_handle)))
{ {
auto align_px = (scroll->value() % scroll->step()); auto align_px = (scroll->value() % scroll->step());
if (align_px) if (align_px)

View File

@ -494,48 +494,6 @@ namespace paint
return sz; return sz;
} }
#if 0
bool graphics::glyph_pixels(std::wstring_view text, unsigned* pxbuf) const //deprecated
{
if (nullptr == impl_->handle || nullptr == impl_->handle->context || nullptr == pxbuf) return false;
if (text.empty()) return true;
unsigned tab_pixels = impl_->handle->string.tab_length * impl_->handle->string.whitespace_pixels;
#if defined(NANA_WINDOWS)
int * dx = new int[text.size()];
SIZE extents;
::GetTextExtentExPoint(impl_->handle->context, text.data(), static_cast<int>(text.size()), 0, 0, dx, &extents);
pxbuf[0] = (text[0] == '\t' ? tab_pixels : dx[0]);
for (std::size_t i = 1; i < text.size(); ++i)
{
pxbuf[i] = (text[i] == '\t' ? tab_pixels : dx[i] - dx[i - 1]);
}
delete[] dx;
#elif defined(NANA_X11) && defined(NANA_USE_XFT)
auto disp = nana::detail::platform_spec::instance().open_display();
auto xft = reinterpret_cast<XftFont*>(impl_->handle->font->native_handle());
XGlyphInfo extents;
for (std::size_t i = 0; i < len; ++i)
{
if (text[i] != '\t')
{
FT_UInt glyphs = ::XftCharIndex(disp, xft, text[i]);
::XftGlyphExtents(disp, xft, &glyphs, 1, &extents);
pxbuf[i] = extents.xOff;
}
else
pxbuf[i] = tab_pixels;
}
#endif
return true;
}
#endif
std::unique_ptr<unsigned[]> graphics::glyph_pixels(std::wstring_view text) const std::unique_ptr<unsigned[]> graphics::glyph_pixels(std::wstring_view text) const
{ {
if (nullptr == impl_->handle || nullptr == impl_->handle->context) return {}; if (nullptr == impl_->handle || nullptr == impl_->handle->context) return {};