diff --git a/build/codeblocks/nana.cbp b/build/codeblocks/nana.cbp
index b2021965..b2a80a96 100644
--- a/build/codeblocks/nana.cbp
+++ b/build/codeblocks/nana.cbp
@@ -52,6 +52,7 @@
+
diff --git a/build/codeblocks/nana.layout b/build/codeblocks/nana.layout
index 469d6a54..f332844d 100644
--- a/build/codeblocks/nana.layout
+++ b/build/codeblocks/nana.layout
@@ -1,51 +1,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -56,14 +31,9 @@
-
+
-
-
-
-
-
-
+
@@ -71,14 +41,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -86,34 +71,24 @@
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
+
@@ -121,11 +96,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -136,19 +141,14 @@
-
-
-
-
-
-
+
-
+
diff --git a/build/vc2013/nana.v12.suo b/build/vc2013/nana.v12.suo
index d9bff60c..55c501ac 100644
Binary files a/build/vc2013/nana.v12.suo and b/build/vc2013/nana.v12.suo differ
diff --git a/build/vc2013/nana.vcxproj b/build/vc2013/nana.vcxproj
index 292712b0..c5c19e78 100644
--- a/build/vc2013/nana.vcxproj
+++ b/build/vc2013/nana.vcxproj
@@ -99,6 +99,7 @@
+
diff --git a/build/vc2013/nana.vcxproj.filters b/build/vc2013/nana.vcxproj.filters
index 3309f037..5d2bb2ae 100644
--- a/build/vc2013/nana.vcxproj.filters
+++ b/build/vc2013/nana.vcxproj.filters
@@ -291,5 +291,8 @@
Source Files\nana
+
+ Source Files\nana\gui\detail
+
\ No newline at end of file
diff --git a/include/nana/config.hpp b/include/nana/config.hpp
index 8c25d372..418871f1 100644
--- a/include/nana/config.hpp
+++ b/include/nana/config.hpp
@@ -18,7 +18,6 @@
//Windows:
#define NANA_WINDOWS 1
#define PLATFORM_SPEC_HPP
- #define GUI_BEDROCK_HPP
//Test if it is MINGW
#if defined(__MINGW32__)
@@ -31,8 +30,6 @@
#define NANA_LINUX 1
#define NANA_X11 1
#define PLATFORM_SPEC_HPP
- #define GUI_BEDROCK_HPP
-
#define STD_CODECVT_NOT_SUPPORTED
#endif
diff --git a/include/nana/gui/detail/basic_window.hpp b/include/nana/gui/detail/basic_window.hpp
index 2c70bd56..f1b54021 100644
--- a/include/nana/gui/detail/basic_window.hpp
+++ b/include/nana/gui/detail/basic_window.hpp
@@ -14,7 +14,7 @@
#define NANA_GUI_DETAIL_BASIC_WINDOW_HPP
#include "drawer.hpp"
#include "events_holder.hpp"
-#include "../basis.hpp"
+#include "widget_colors.hpp"
#include
#include
#include
@@ -181,6 +181,8 @@ namespace detail
color bgcolor;
color activated;
}colors;
+
+ widget_colors* expr_colors{ nullptr };
struct
{
diff --git a/include/nana/gui/detail/bedrock.hpp b/include/nana/gui/detail/bedrock.hpp
index d58cc680..b91c728f 100644
--- a/include/nana/gui/detail/bedrock.hpp
+++ b/include/nana/gui/detail/bedrock.hpp
@@ -16,6 +16,7 @@
#include "events_operation.hpp"
#include "runtime_manager.hpp"
#include "general_events.hpp"
+#include "color_schemes.hpp"
#include "internal_scope_guard.hpp"
namespace nana
@@ -76,6 +77,9 @@ namespace detail
void set_cursor(core_window_t*, nana::cursor, thread_context*);
void define_state_cursor(core_window_t*, nana::cursor, thread_context*);
void undefine_state_cursor(core_window_t*, thread_context*);
+
+ widget_colors& get_scheme_template(scheme_factory_base&&);
+ std::unique_ptr make_scheme(scheme_factory_base&&);
public:
window_manager_t wd_manager;
events_operation evt_operation;
@@ -92,6 +96,8 @@ namespace detail
private:
static bedrock bedrock_object;
+ struct pi_data;
+ pi_data* pi_data_;
struct private_impl;
private_impl *impl_;
};//end class bedrock
diff --git a/include/nana/gui/detail/bedrock_pi_data.hpp b/include/nana/gui/detail/bedrock_pi_data.hpp
new file mode 100644
index 00000000..b54e658f
--- /dev/null
+++ b/include/nana/gui/detail/bedrock_pi_data.hpp
@@ -0,0 +1,18 @@
+#ifndef NANA_DETAIL_BEDROCK_PI_DATA_HPP
+#define NANA_DETAIL_BEDROCK_PI_DATA_HPP
+
+#include
+#include "color_schemes.hpp"
+
+namespace nana
+{
+ namespace detail
+ {
+ struct bedrock::pi_data
+ {
+ color_schemes scheme;
+
+ };
+ }
+}
+#endif
diff --git a/include/nana/gui/detail/color_schemes.hpp b/include/nana/gui/detail/color_schemes.hpp
new file mode 100644
index 00000000..25f75079
--- /dev/null
+++ b/include/nana/gui/detail/color_schemes.hpp
@@ -0,0 +1,80 @@
+/*
+* Color Schemes
+* Nana C++ Library(http://www.nanapro.org)
+* Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com)
+*
+* 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/gui/color_schemes.hpp
+* @description:
+*/
+#ifndef NANA_DETAIL_COLOR_SCHEMES_HPP
+#define NANA_DETAIL_COLOR_SCHEMES_HPP
+
+#include "widget_colors.hpp"
+#include
+
+namespace nana
+{
+ namespace detail
+ {
+ class scheme_factory_base
+ {
+ public:
+ struct factory_identifier{};
+ virtual ~scheme_factory_base() = default;
+
+ virtual factory_identifier* get_id() const = 0;
+ virtual std::unique_ptr create() = 0;
+ virtual std::unique_ptr create(widget_colors&) = 0;
+ };
+
+ template
+ class scheme_factory
+ : public scheme_factory_base
+ {
+ private:
+ factory_identifier* get_id() const override
+ {
+ return &fid_;
+ }
+
+ std::unique_ptr create() override
+ {
+ return std::unique_ptr(new Scheme);
+ }
+
+ std::unique_ptr create(widget_colors& other) override
+ {
+ return std::unique_ptr{new Scheme(static_cast(other))};
+ }
+ private:
+ static factory_identifier fid_;
+ };
+
+ template
+ scheme_factory_base::factory_identifier scheme_factory::fid_;
+
+ class color_schemes
+ {
+ struct implement;
+ color_schemes(const color_schemes&) = delete;
+ color_schemes(color_schemes&&) = delete;
+ color_schemes& operator=(const color_schemes&) = delete;
+ color_schemes& operator=(color_schemes&&) = delete;
+ public:
+ using scheme = widget_colors;
+
+ color_schemes();
+ ~color_schemes();
+
+ scheme& scheme_template(scheme_factory_base&&);
+ std::unique_ptr create(scheme_factory_base&&);
+ private:
+ implement * impl_;
+ };
+ }//end namespace detail;
+}//end namespace nana
+#endif
\ No newline at end of file
diff --git a/include/nana/gui/detail/general_events.hpp b/include/nana/gui/detail/general_events.hpp
index 486373d8..2d802b86 100644
--- a/include/nana/gui/detail/general_events.hpp
+++ b/include/nana/gui/detail/general_events.hpp
@@ -28,21 +28,21 @@ namespace nana
class event_interface
{
public:
- virtual ~event_interface(){}
+ virtual ~event_interface() = default;
virtual void remove(event_handle) = 0;
};
class docker_interface
{
public:
- virtual ~docker_interface(){}
+ virtual ~docker_interface() = default;
virtual event_interface* get_event() const = 0;
};
class event_arg_interface
{
public:
- virtual ~event_arg_interface(){}
+ virtual ~event_arg_interface() = default;
};
void events_operation_register(event_handle);
@@ -471,6 +471,7 @@ namespace nana
basic_event move;
basic_event resizing;
basic_event resized;
+
basic_event destroy;
};
diff --git a/include/nana/gui/detail/widget_colors.hpp b/include/nana/gui/detail/widget_colors.hpp
new file mode 100644
index 00000000..90bd25b5
--- /dev/null
+++ b/include/nana/gui/detail/widget_colors.hpp
@@ -0,0 +1,44 @@
+/*
+* Color Schemes
+* Nana C++ Library(http://www.nanapro.org)
+* Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com)
+*
+* 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/gui/color_schemes.hpp
+* @description:
+*/
+#ifndef NANA_DETAIL_WIDGET_COLORS_HPP
+#define NANA_DETAIL_WIDGET_COLORS_HPP
+
+#include
+#include
+namespace nana
+{
+ class color_proxy
+ {
+ public:
+ color_proxy(const color_proxy&);
+ color_proxy(color_rgb);
+ color_proxy(colors);
+ color_proxy& operator=(const color_proxy&);
+ color_proxy& operator=(const ::nana::color&);
+ color get_color() const;
+ operator color() const;
+ private:
+ std::shared_ptr color_;
+ };//end namespace color_proxy
+
+ struct widget_colors
+ {
+ virtual ~widget_colors() = default;
+
+ color_proxy activated{ static_cast(0x60C8FD) };
+ color_proxy background{colors::button_face};
+ color_proxy foreground{colors::black};
+ };
+}
+
+#endif
\ No newline at end of file
diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp
index 0c85d589..91a46cf0 100644
--- a/include/nana/gui/programming_interface.hpp
+++ b/include/nana/gui/programming_interface.hpp
@@ -13,7 +13,7 @@
#ifndef NANA_GUI_PROGRAMMING_INTERFACE_HPP
#define NANA_GUI_PROGRAMMING_INTERFACE_HPP
#include
-#include GUI_BEDROCK_HPP
+#include "detail/bedrock.hpp"
#include "effects.hpp"
#include "detail/general_events.hpp"
#include
@@ -45,6 +45,16 @@ namespace API
}
bool set_events(window, const std::shared_ptr&);
+
+ template
+ std::unique_ptr make_scheme()
+ {
+ return std::unique_ptr(
+ static_cast(::nana::detail::bedrock::instance().make_scheme(::nana::detail::scheme_factory()).release()));
+ }
+
+ void set_scheme(window, widget_colors*);
+ widget_colors* get_scheme(window);
void attach_drawer(widget&, drawer_trigger&);
nana::string window_caption(window);
@@ -66,6 +76,13 @@ namespace API
void exit();
+ template
+ Scheme& get_scheme()
+ {
+ auto & brock = ::nana::detail::bedrock::instance();
+ return static_cast(brock.get_scheme_template(::nana::detail::scheme_factory{}));
+ }
+
nana::string transform_shortkey_text(nana::string text, nana::string::value_type &shortkey, nana::string::size_type *skpos);
bool register_shortkey(window, unsigned long);
void unregister_shortkey(window);
diff --git a/include/nana/gui/widgets/combox.hpp b/include/nana/gui/widgets/combox.hpp
index 0a46eed1..03f319d9 100644
--- a/include/nana/gui/widgets/combox.hpp
+++ b/include/nana/gui/widgets/combox.hpp
@@ -14,6 +14,7 @@
#define NANA_GUI_WIDGETS_COMBOX_HPP
#include "widget.hpp"
#include "float_listbox.hpp"
+#include "skeletons/text_editor_scheme.hpp"
#include
#include
#include
@@ -160,7 +161,7 @@ namespace nana
}//end namespace drawerbase
class combox
- : public widget_object,
+ : public widget_object,
public nana::concepts::any_objective
{
public:
diff --git a/include/nana/gui/widgets/form.hpp b/include/nana/gui/widgets/form.hpp
index 9f4d1e2a..0f64c54a 100644
--- a/include/nana/gui/widgets/form.hpp
+++ b/include/nana/gui/widgets/form.hpp
@@ -47,6 +47,7 @@ namespace nana
form(window, const rectangle&, const appearance& = {});
void modality() const;
+ void wait_for_this();
};
class nested_form : public widget_object
diff --git a/include/nana/gui/widgets/skeletons/text_editor.hpp b/include/nana/gui/widgets/skeletons/text_editor.hpp
index ca011a0b..d24d04d8 100644
--- a/include/nana/gui/widgets/skeletons/text_editor.hpp
+++ b/include/nana/gui/widgets/skeletons/text_editor.hpp
@@ -14,9 +14,9 @@
#ifndef NANA_GUI_SKELETONS_TEXT_EDITOR_HPP
#define NANA_GUI_SKELETONS_TEXT_EDITOR_HPP
#include "textbase.hpp"
+#include "text_editor_scheme.hpp"
#include
#include
-#include
namespace nana{ namespace widgets
{
@@ -128,18 +128,18 @@ namespace nana{ namespace widgets
class undo_input_text;
class undo_move_text;
public:
- typedef nana::char_t char_type;
+ typedef ::nana::char_t char_type;
typedef textbase::size_type size_type;
typedef textbase::string_type string_type;
- typedef nana::paint::graphics & graph_reference;
+ typedef ::nana::paint::graphics & graph_reference;
struct ext_renderer_tag
{
std::function background;
};
- text_editor(window, graph_reference);
+ text_editor(window, graph_reference, const text_editor_scheme*);
~text_editor();
bool respone_keyboard(nana::char_t, bool enterable);
@@ -263,10 +263,10 @@ namespace nana{ namespace widgets
//_m_draw_string
//@brief: Draw a line of string
void _m_draw_string(int top, const ::nana::color&, const nana::upoint& str_pos, const nana::string&, bool if_mask) const;
- //_m_draw
- //@brief: Draw a character at a position specified by caret pos.
- //@return: true if beyond the border
- bool _m_draw(nana::char_t, std::size_t secondary_before);
+ //_m_update_caret_line
+ //@brief: redraw whole line specified by caret pos.
+ //@return: true if caret overs the border
+ bool _m_update_caret_line(std::size_t secondary_before);
bool _m_get_sort_select_points(nana::upoint&, nana::upoint&) const;
void _m_offset_y(int y);
@@ -279,6 +279,8 @@ namespace nana{ namespace widgets
undoable undo_;
nana::window window_;
graph_reference graph_;
+ const text_editor_scheme* scheme_;
+
skeletons::textbase textbase_;
nana::char_t mask_char_{0};
diff --git a/include/nana/gui/widgets/skeletons/text_editor_scheme.hpp b/include/nana/gui/widgets/skeletons/text_editor_scheme.hpp
new file mode 100644
index 00000000..00806b3b
--- /dev/null
+++ b/include/nana/gui/widgets/skeletons/text_editor_scheme.hpp
@@ -0,0 +1,22 @@
+
+#ifndef NANA_WIDGETS_SKELETONS_TEXT_EDITOR_SCHEME_HPP
+#define NANA_WIDGETS_SKELETONS_TEXT_EDITOR_SCHEME_HPP
+
+#include "../../detail/widget_colors.hpp"
+
+namespace nana
+{
+ namespace widgets
+ {
+ namespace skeletons
+ {
+ struct text_editor_scheme
+ : public ::nana::widget_colors
+ {
+ color_proxy selection{static_cast(0x3399FF)};
+ color_proxy selection_text{colors::white};
+ };
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/include/nana/gui/widgets/textbox.hpp b/include/nana/gui/widgets/textbox.hpp
index d4ba85f3..5c3a060e 100644
--- a/include/nana/gui/widgets/textbox.hpp
+++ b/include/nana/gui/widgets/textbox.hpp
@@ -13,6 +13,7 @@
#define NANA_GUI_WIDGET_TEXTBOX_HPP
#include
#include "skeletons/textbase_export_interface.hpp"
+#include "skeletons/text_editor_scheme.hpp"
namespace nana
{
@@ -96,7 +97,7 @@ namespace nana
/// Allow users to enter and edit text by typing on the keyboard.
class textbox
- :public widget_object
+ :public widget_object
{
public:
/// The default constructor without creating the widget.
diff --git a/include/nana/gui/widgets/widget.hpp b/include/nana/gui/widgets/widget.hpp
index 02455c00..234da335 100644
--- a/include/nana/gui/widgets/widget.hpp
+++ b/include/nana/gui/widgets/widget.hpp
@@ -117,14 +117,17 @@ namespace nana
};
/// Base class of all the classes defined as a widget window. Defaultly a widget_tag
- template
+ template
class widget_object: public widget
{
protected:
typedef DrawerTrigger drawer_trigger_t;
public:
+ using scheme_type = Scheme;
+
widget_object()
- : events_(std::make_shared())
+ : events_{ std::make_shared() },
+ scheme_{ API::dev::make_scheme() }
{}
~widget_object()
@@ -143,12 +146,13 @@ namespace nana
return create(parent_wd, rectangle(), visible);
}
- bool create(window parent_wd, const rectangle & r = rectangle(), bool visible = true) ///< in a widget/root window specified by parent_wd.
+ bool create(window parent_wd, const rectangle & r = {}, bool visible = true) ///< in a widget/root window specified by parent_wd.
{
if(parent_wd && this->empty())
{
handle_ = API::dev::create_widget(parent_wd, r, this);
API::dev::set_events(handle_, events_);
+ API::dev::set_scheme(handle_, scheme_.get());
API::dev::attach_signal(handle_, *this, &widget_object::signal);
API::dev::attach_drawer(*this, trigger_);
if(visible)
@@ -174,6 +178,11 @@ namespace nana
{
return API::widget_borderless(handle_);
}
+
+ scheme_type& scheme() const
+ {
+ return *scheme_;
+ }
protected:
DrawerTrigger& get_drawer_trigger()
{
@@ -212,18 +221,20 @@ namespace nana
window handle_{nullptr};
DrawerTrigger trigger_;
std::shared_ptr events_;
+ std::unique_ptr scheme_;
};//end class widget_object
/// Base class of all the classes defined as a non-graphics-buffer widget window. The second template parameter DrawerTrigger is always ignored.\see nana::panel
- template
- class widget_object: public widget
+ template
+ class widget_object: public widget
{
protected:
typedef DrawerTrigger drawer_trigger_t;
public:
+ using scheme_type = Scheme;
widget_object()
- : events_(std::make_shared())
+ : events_{ std::make_shared() }, scheme_{ API::dev::make_scheme() }
{}
~widget_object()
@@ -248,6 +259,7 @@ namespace nana
{
handle_ = API::dev::create_lite_widget(parent_wd, r, this);
API::dev::set_events(handle_, events_);
+ API::dev::set_scheme(handle_, scheme_.get());
if(visible)
API::show_window(handle_, true);
this->_m_complete_creation();
@@ -259,6 +271,11 @@ namespace nana
{
return handle_;
}
+
+ scheme_type& scheme() const
+ {
+ return *scheme_;
+ }
private:
void signal(detail::signals::code code, const detail::signals& sig)
{
@@ -286,16 +303,18 @@ namespace nana
private:
window handle_{nullptr};
std::shared_ptr events_;
+ std::unique_ptr scheme_;
};//end class widget_object
/// Base class of all the classes defined as a root window. \see nana::form
- template
- class widget_object: public widget
+ template
+ class widget_object: public widget
{
protected:
typedef DrawerTrigger drawer_trigger_t;
public:
+ using scheme_type = Scheme;
widget_object()
{
@@ -303,13 +322,13 @@ namespace nana
_m_bind_and_attach();
}
- widget_object(const rectangle& r, const appearance& apr = appearance())
+ widget_object(const rectangle& r, const appearance& apr = {})
{
handle_ = API::dev::create_window(nullptr, false, r, apr, this);
_m_bind_and_attach();
}
- widget_object(window owner, bool nested, const rectangle& r = rectangle(), const appearance& apr = appearance())
+ widget_object(window owner, bool nested, const rectangle& r = {}, const appearance& apr = {})
{
handle_ = API::dev::create_window(owner, nested, r, apr, this);
_m_bind_and_attach();
@@ -376,6 +395,11 @@ namespace nana
API::set_window_z_order(handle_, wd_after, action_if_no_wd_after);
return *this;
}
+
+ scheme_type& scheme() const
+ {
+ return *scheme_;
+ }
protected:
DrawerTrigger& get_drawer_trigger()
{
@@ -410,6 +434,9 @@ namespace nana
{
events_ = std::make_shared();
API::dev::set_events(handle_, events_);
+
+ scheme_ = API::dev::make_scheme();
+ API::dev::set_scheme(handle_, scheme_.get());
API::dev::attach_signal(handle_, *this, &widget_object::signal);
API::dev::attach_drawer(*this, trigger_);
}
@@ -422,21 +449,24 @@ namespace nana
window handle_;
DrawerTrigger trigger_;
std::shared_ptr events_;
+ std::unique_ptr scheme_;
};//end class widget_object
/// Base class of all the classes defined as a frame window. \see nana::frame
- template
- class widget_object: public widget{};
+ template
+ class widget_object: public widget{};
/// Especialization. Base class of all the classes defined as a frame window. \see nana::frame
- template
- class widget_object: public widget
+ template
+ class widget_object: public widget
{
protected:
typedef int drawer_trigger_t;
public:
+ using scheme_type = Scheme;
+
widget_object()
- : events_(std::make_shared())
+ : events_{ std::make_shared() }, scheme_{ API::dev::make_scheme() }
{}
~widget_object()
@@ -461,6 +491,7 @@ namespace nana
{
handle_ = API::dev::create_frame(parent_wd, r, this);
API::dev::set_events(handle_, events_);
+ API::dev::set_scheme(handle_, scheme_.get());
API::dev::attach_signal(handle_, *this, &widget_object::signal);
API::show_window(handle_, visible);
this->_m_complete_creation();
@@ -472,6 +503,11 @@ namespace nana
{
return handle_;
}
+
+ scheme_type& scheme() const
+ {
+ return *scheme_;
+ }
private:
virtual drawer_trigger* get_drawer_trigger()
{
@@ -504,6 +540,7 @@ namespace nana
private:
window handle_{nullptr};
std::shared_ptr events_;
+ std::unique_ptr scheme_;
};//end class widget_object
}//end namespace nana
#endif
diff --git a/include/nana/paint/gadget.hpp b/include/nana/paint/gadget.hpp
index fcc77dd1..6a900548 100644
--- a/include/nana/paint/gadget.hpp
+++ b/include/nana/paint/gadget.hpp
@@ -28,7 +28,6 @@ namespace gadget
void arrow_16_pixels(nana::paint::graphics&, int x, int y, const color&, uint32_t style, directions::t direction);
void close_16_pixels(nana::paint::graphics&, int x, int y, uint32_t style, const color&);
- //void cross(nana::paint::graphics&, int x, int y, uint32_t size, uint32_t thickness, nana::color_t color); //deprecated
void cross(nana::paint::graphics&, int x, int y, uint32_t size, uint32_t thickness, const nana::color&);
}//end namespace gadget
diff --git a/include/nana/paint/text_renderer.hpp b/include/nana/paint/text_renderer.hpp
index 7ee77050..28bb4e8f 100644
--- a/include/nana/paint/text_renderer.hpp
+++ b/include/nana/paint/text_renderer.hpp
@@ -13,11 +13,6 @@ namespace nana
text_renderer(graph_reference graph, align = align::left);
- //void render(int x, int y, nana::color_t, const nana::char_t*, std::size_t len); //deprecated
- //void render(int x, int y, nana::color_t, const nana::char_t*, std::size_t len, unsigned restricted_pixels, bool omitted); //deprecated
-
- //void render(int x, int y, nana::color_t, const nana::char_t*, std::size_t len, unsigned restricted_pixels); //deprecated
-
nana::size extent_size(int x, int y, const nana::char_t*, std::size_t len, unsigned restricted_pixels) const;
void render(const point&, const char_t*, std::size_t len);
diff --git a/source/detail/linux_X11/platform_spec.cpp b/source/detail/linux_X11/platform_spec.cpp
index d0016e88..1bbbdec5 100644
--- a/source/detail/linux_X11/platform_spec.cpp
+++ b/source/detail/linux_X11/platform_spec.cpp
@@ -22,7 +22,7 @@
#include
#include
#include
-#include GUI_BEDROCK_HPP
+#include
#include
#include
#include
diff --git a/source/gui/detail/basic_window.cpp b/source/gui/detail/basic_window.cpp
index cf02f1d3..51089f73 100644
--- a/source/gui/detail/basic_window.cpp
+++ b/source/gui/detail/basic_window.cpp
@@ -49,9 +49,7 @@ namespace nana
void caret_descriptor::effective_range(nana::rectangle rect)
{
//Chech rect
- if( (rect.width && rect.height) &&
- (rect.x + rect.width > 0) &&
- (rect.y + rect.height > 0))
+ if (rect.width && rect.height && rect.right() > 0 && rect.bottom() > 0)
{
if(rect.x < 0)
{
@@ -151,9 +149,9 @@ namespace nana
size.width -= (rect.x - pos.x);
pos.x = rect.x;
}
- else if(pos.x + size.width > rect.x + rect.width)
+ else if(pos.x + size.width > rect.right())
{
- size.width -= pos.x + size.width - (rect.x + rect.width);
+ size.width -= pos.x + size.width - rect.right();
}
if(pos.y < rect.y)
@@ -161,8 +159,8 @@ namespace nana
size.width -= (rect.y - pos.y);
pos.y = rect.y;
}
- else if(pos.y + size.height > rect.y + rect.height)
- size.height -= pos.y + size.height - (rect.y + rect.height);
+ else if(pos.y + size.height > rect.bottom())
+ size.height -= pos.y + size.height - rect.bottom();
if(out_of_range_)
{
@@ -228,7 +226,7 @@ namespace nana
: widget_ptr(wdg), other(category::root_tag::value)
{
drawer.bind(this);
- _m_init_pos_and_size(0, rectangle());
+ _m_init_pos_and_size(nullptr, rectangle());
this->_m_initialize(owner);
}
diff --git a/source/gui/detail/bedrock_pi.cpp b/source/gui/detail/bedrock_pi.cpp
index 66dec171..7fddd857 100644
--- a/source/gui/detail/bedrock_pi.cpp
+++ b/source/gui/detail/bedrock_pi.cpp
@@ -12,7 +12,7 @@
#include
#include PLATFORM_SPEC_HPP
-#include GUI_BEDROCK_HPP
+#include
#include
#include
#include
@@ -120,6 +120,16 @@ namespace nana
}
}
+ widget_colors& bedrock::get_scheme_template(scheme_factory_base&& factory)
+ {
+ return pi_data_->scheme.scheme_template(std::move(factory));
+ }
+
+ std::unique_ptr bedrock::make_scheme(scheme_factory_base&& factory)
+ {
+ return pi_data_->scheme.create(std::move(factory));
+ }
+
void bedrock::_m_emit_core(event_code evt_code, core_window_t* wd, bool draw_only, const ::nana::detail::event_arg_interface& event_arg)
{
switch (evt_code)
diff --git a/source/gui/detail/color_schemes.cpp b/source/gui/detail/color_schemes.cpp
new file mode 100644
index 00000000..6a7006ff
--- /dev/null
+++ b/source/gui/detail/color_schemes.cpp
@@ -0,0 +1,78 @@
+#include
+#include