diff --git a/build/codeblocks/nana.layout b/build/codeblocks/nana.layout index f410278c..8af72c72 100644 --- a/build/codeblocks/nana.layout +++ b/build/codeblocks/nana.layout @@ -1,24 +1,54 @@ - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,9 +56,9 @@ - + - + @@ -36,9 +66,9 @@ - + - + @@ -56,19 +86,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + + + + + + @@ -81,74 +146,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/include/nana/gui/basis.hpp b/include/nana/gui/basis.hpp index a46835ad..943d6a8c 100644 --- a/include/nana/gui/basis.hpp +++ b/include/nana/gui/basis.hpp @@ -63,10 +63,9 @@ namespace nana struct frame_tag: widget_tag{ static const flags value = flags::frame; }; }// end namespace category - typedef detail::native_window_handle_impl * native_window_type; - - typedef detail::window_handle_impl* window; ///< \see [What is window class ](https://sourceforge.net/p/nanapro/discussion/general/thread/bd0fabfb/) - typedef detail::event_handle_impl* event_handle; + using native_window_type = detail::native_window_handle_impl*; + using window = detail::window_handle_impl*; ///< \see [What is window class ](https://sourceforge.net/p/nanapro/discussion/general/thread/bd0fabfb/) + using event_handle = detail::event_handle_impl*; struct keyboard diff --git a/include/nana/gui/detail/widget_colors.hpp b/include/nana/gui/detail/widget_colors.hpp index 464c4e4b..d4d81e1a 100644 --- a/include/nana/gui/detail/widget_colors.hpp +++ b/include/nana/gui/detail/widget_colors.hpp @@ -7,7 +7,7 @@ * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * -* @file: nana/gui/color_schemes.hpp +* @file: nana/gui/widget_colors.hpp * @description: */ #ifndef NANA_DETAIL_WIDGET_COLORS_HPP diff --git a/source/basic_types.cpp b/source/basic_types.cpp index c7c5cbd4..fe4aa215 100644 --- a/source/basic_types.cpp +++ b/source/basic_types.cpp @@ -2,8 +2,8 @@ * Basic Types definition * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/basic_types.cpp @@ -44,12 +44,12 @@ namespace nana {} color::color(unsigned red, unsigned green, unsigned blue) - : a_(1.0), r_(red), g_(green), b_(blue) + : r_(red), g_(green), b_(blue), a_(1.0) { } - + color::color(unsigned red, unsigned green, unsigned blue, double alpha) - : a_(alpha), r_(red), g_(green), b_(blue) + : r_(red), g_(green), b_(blue), a_(alpha) { if (alpha < 0.0) a_ = 0.0; @@ -168,7 +168,7 @@ namespace nana { return argb(); } - + pixel_argb_t color::argb() const { pixel_argb_t argb; diff --git a/source/paint/pixel_buffer.cpp b/source/paint/pixel_buffer.cpp index 8c1be210..bbb34b59 100644 --- a/source/paint/pixel_buffer.cpp +++ b/source/paint/pixel_buffer.cpp @@ -102,7 +102,7 @@ namespace nana{ namespace paint delete [] raw_pixel_buffer; throw std::runtime_error("Nana.pixel_buffer: XCreateImage failed"); } - + if(static_cast(bytes_per_line) != x11.image->bytes_per_line) { x11.image->data = nullptr; @@ -127,7 +127,7 @@ namespace nana{ namespace paint { #if defined(NANA_X11) nana::detail::platform_spec & spec = nana::detail::platform_spec::instance(); - + //Ensure that the pixmap is updated before we copy its content. ::XFlush(spec.open_display()); x11.image = ::XGetImage(spec.open_display(), drawable->pixmap, valid_r.x, valid_r.y, valid_r.width, valid_r.height, AllPlanes, ZPixmap); @@ -168,7 +168,7 @@ namespace nana{ namespace paint if(x11.image->data != reinterpret_cast(raw_pixel_buffer)) delete [] raw_pixel_buffer; - + XDestroyImage(x11.image); #else if(nullptr == drawable) //not attached @@ -228,18 +228,11 @@ namespace nana{ namespace paint auto d = rawptr; const unsigned char* s; - int src_bytes_per_line; if (is_negative) - { s = rawbits; - src_bytes_per_line = -static_cast(bytes_per_line); - } else - { s = rawbits + bytes_per_line * (height - 1); - src_bytes_per_line = static_cast(bytes_per_line); - } for(std::size_t i = 0; i < height; ++i) { @@ -311,14 +304,14 @@ namespace nana{ namespace paint } void put(Drawable dw, GC gc, int src_x, int src_y, int x, int y, unsigned width, unsigned height) - { + { auto & spec = nana::detail::platform_spec::instance(); Display * disp = spec.open_display(); const int depth = spec.screen_depth(); XImage* img = ::XCreateImage(disp, spec.screen_visual(), depth, ZPixmap, 0, 0, pixel_size.width, pixel_size.height, (16 == depth ? 16 : 32), 0); if(sizeof(pixel_color_t) * 8 == depth || 24 == depth) - { + { img->data = reinterpret_cast(raw_pixel_buffer); ::XPutImage(disp, dw, gc, img, src_x, src_y, x, y, width, height); @@ -330,7 +323,7 @@ namespace nana{ namespace paint unsigned short * const fast_table = table_holder.get(); for(int i = 0; i < 256; ++i) fast_table[i] = i * 31 / 255; - + std::size_t length = width * height; std::unique_ptr px_holder(new unsigned short[length]); @@ -347,7 +340,7 @@ namespace nana{ namespace paint { unsigned sp_line_len = pixel_size.width; auto sp = raw_pixel_buffer + (src_x + sp_line_len * src_y); - + unsigned top = 0; while(true) { @@ -363,7 +356,7 @@ namespace nana{ namespace paint img->data = reinterpret_cast(px_holder.get()); ::XPutImage(disp, dw, gc, - img, src_x, src_y, x, y, width, height); + img, src_x, src_y, x, y, width, height); } img->data = nullptr; //Set null pointer to avoid XDestroyImage destroyes the buffer. XDestroyImage(img); @@ -529,7 +522,7 @@ namespace nana{ namespace paint } img_data += image->bytes_per_line; pixbuf += want_r.width; - } + } } else {