Breaking changes for expr_color
expr_color is a temporary class name for new color type experiment.
This commit is contained in:
@@ -98,10 +98,10 @@ namespace nana
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned uint_t;
|
||||
typedef unsigned color_t;
|
||||
typedef unsigned color_t; //deprecated
|
||||
typedef long long long_long_t;
|
||||
|
||||
const color_t null_color = 0xFFFFFFFF;
|
||||
//const color_t null_color = 0xFFFFFFFF; //deprecated
|
||||
|
||||
union pixel_argb_t
|
||||
{
|
||||
@@ -141,6 +141,7 @@ namespace nana
|
||||
red = 0xFF0000,
|
||||
white = 0xFFFFFF,
|
||||
|
||||
//temporary defintions, these will be replaced by color schema
|
||||
button_face_shadow_start = 0xF5F4F2,
|
||||
button_face_shadow_end = 0xD5D2CA,
|
||||
button_face = 0xD4D0C8,
|
||||
@@ -158,12 +159,17 @@ namespace nana
|
||||
expr_color(unsigned red, unsigned green, unsigned blue);
|
||||
expr_color(unsigned red, unsigned green, unsigned blue, double alpha);
|
||||
|
||||
void blend(const expr_color& bgcolor, bool ignore_bgcolor_alpha);
|
||||
expr_color& alpha(double); ///< Sets alpha channel
|
||||
expr_color& from_rgb(unsigned red, unsigned green, unsigned blue); ///< immutable alpha channel
|
||||
expr_color& from_hsl(double hue, double saturation, double lightness); ///< immutable alpha channel
|
||||
|
||||
expr_color& blend(const expr_color& bgcolor, bool ignore_bgcolor_alpha);
|
||||
|
||||
///< Blends two colors with the specified alpha, and the alpha values that come with these two colors are both ignored.
|
||||
void blend(const expr_color& bgcolor, double alpha);
|
||||
expr_color& blend(const expr_color& bgcolor, double alpha);
|
||||
|
||||
bool invisible() const;
|
||||
pixel_color_t px_color() const;
|
||||
pixel_argb_t argb() const;
|
||||
pixel_rgba_t rgba() const;
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace detail
|
||||
~drawable_impl_type();
|
||||
|
||||
void fgcolor(nana::color_t); //deprecated
|
||||
unsigned get_color() const;
|
||||
void set_color(nana::color_t);
|
||||
void set_text_color(nana::color_t);
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace nana
|
||||
os_insert = 0x2D, os_del
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
namespace color //deprecated
|
||||
{
|
||||
enum
|
||||
@@ -115,6 +115,7 @@ namespace nana
|
||||
highlight = 0x1CC4F7
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
enum class cursor
|
||||
{
|
||||
|
||||
@@ -177,9 +177,9 @@ namespace detail
|
||||
|
||||
struct
|
||||
{
|
||||
color_t foreground; //deprecated
|
||||
color_t background; //deprecated
|
||||
color_t active; //deprecated
|
||||
//color_t foreground; //deprecated
|
||||
//color_t background; //deprecated
|
||||
//color_t active; //deprecated
|
||||
|
||||
expr_color fgcolor;
|
||||
expr_color bgcolor;
|
||||
|
||||
@@ -120,12 +120,12 @@ namespace nana{
|
||||
good_r.x = good_r.y = 1;
|
||||
good_r.width = r.width - 2;
|
||||
good_r.height = r.height - 2;
|
||||
pixbuf.rectangle(good_r, wd->colors.active, 0.95, false);
|
||||
pixbuf.rectangle(good_r, wd->colors.activated.px_color().value, 0.95, false);
|
||||
|
||||
good_r.x = good_r.y = 0;
|
||||
good_r.width = r.width;
|
||||
good_r.height = r.height;
|
||||
pixbuf.rectangle(good_r, wd->colors.active, 0.4, false);
|
||||
pixbuf.rectangle(good_r, wd->colors.activated.px_color().value, 0.4, false);
|
||||
|
||||
pixbuf.pixel(0, 0, px0);
|
||||
pixbuf.pixel(r.width - 1, 0, px1);
|
||||
|
||||
@@ -202,12 +202,14 @@ namespace API
|
||||
void modal_window(window); ///< Blocks the routine til the specified window is closed.
|
||||
void wait_for(window);
|
||||
|
||||
/*
|
||||
color_t foreground(window); //deprecated
|
||||
color_t foreground(window, color_t); //deprecated
|
||||
color_t background(window); //deprecated
|
||||
color_t background(window, color_t); //deprecated
|
||||
color_t active(window); //deprecated
|
||||
color_t active(window, color_t); //deprecated
|
||||
*/
|
||||
|
||||
expr_color fgcolor(window);
|
||||
expr_color fgcolor(window, const expr_color&);
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace nana
|
||||
|
||||
categorize(window wd, const rectangle& r = rectangle(), bool visible = true)
|
||||
{
|
||||
this->get_drawer_trigger().template create_event_agent(*this);
|
||||
this->get_drawer_trigger().create_event_agent(*this);
|
||||
this->create(wd, r, visible);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,15 +169,15 @@ namespace nana
|
||||
|
||||
combox();
|
||||
combox(window, bool visible);
|
||||
combox(window, const nana::string& text, bool visible = true);
|
||||
combox(window, const nana::char_t* text, bool visible = true);
|
||||
combox(window, nana::string, bool visible = true);
|
||||
combox(window, const nana::char_t*, bool visible = true);
|
||||
combox(window, const rectangle& r = rectangle(), bool visible = true);
|
||||
|
||||
void clear();
|
||||
void editable(bool);
|
||||
bool editable() const;
|
||||
void set_accept(std::function<bool(nana::char_t)>);
|
||||
combox& push_back(const nana::string&);
|
||||
combox& push_back(nana::string);
|
||||
std::size_t the_number_of_options() const;
|
||||
std::size_t option() const; ///< Index of the last selected, from drop-down list, item.
|
||||
void option(std::size_t); ///< Select the text specified by index
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace nana
|
||||
void week_name(unsigned index, const nana::string&);
|
||||
void month_name(unsigned index, const nana::string&);
|
||||
private:
|
||||
void _m_init_color();
|
||||
//void _m_init_color(); //deprecated
|
||||
where _m_pos_where(graph_reference, int x, int y);
|
||||
void _m_draw(graph_reference);
|
||||
void _m_draw_topbar(graph_reference);
|
||||
@@ -91,10 +91,10 @@ namespace nana
|
||||
|
||||
struct color_tag
|
||||
{
|
||||
nana::color_t highlight;
|
||||
nana::color_t selected;
|
||||
nana::color_t normal;
|
||||
nana::color_t bkcolor;
|
||||
::nana::expr_color highlight;
|
||||
::nana::expr_color selected;
|
||||
::nana::expr_color normal;
|
||||
::nana::expr_color bgcolor;
|
||||
}color_;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,11 +37,9 @@ namespace nana
|
||||
{
|
||||
std::vector<std::shared_ptr<item_interface>> items;
|
||||
|
||||
std::size_t max_items; // the number of items display.
|
||||
mutable std::size_t index; // the result of the selection.
|
||||
std::size_t max_items{10}; // the number of items display.
|
||||
mutable std::size_t index{::nana::npos}; // the result of the selection.
|
||||
mutable bool have_selected;
|
||||
|
||||
module_def();
|
||||
};
|
||||
|
||||
class item_renderer
|
||||
@@ -51,7 +49,7 @@ namespace nana
|
||||
typedef paint::graphics& graph_reference;
|
||||
enum state_t{StateNone, StateHighlighted};
|
||||
|
||||
virtual ~item_renderer() = 0;
|
||||
virtual ~item_renderer() = default;
|
||||
virtual void image(bool enabled, unsigned pixels) = 0;
|
||||
virtual void render(widget_reference, graph_reference, const nana::rectangle&, const item_interface*, state_t) = 0;
|
||||
virtual unsigned item_pixels(graph_reference) const = 0;
|
||||
|
||||
@@ -24,12 +24,11 @@ namespace nana
|
||||
class trigger: public drawer_trigger
|
||||
{
|
||||
public:
|
||||
trigger();
|
||||
void attached(widget_reference, graph_reference) override;
|
||||
void refresh(graph_reference) override;
|
||||
void resized(graph_reference, const arg_resized&) override;
|
||||
//void resized(graph_reference, const arg_resized&) override; //deprecated
|
||||
private:
|
||||
widget* wd_;
|
||||
widget* wd_{nullptr};
|
||||
};
|
||||
}//end namespace form
|
||||
}//end namespace drawerbase
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace nana
|
||||
checks check_style;
|
||||
};
|
||||
|
||||
virtual ~renderer_interface() = 0;
|
||||
virtual ~renderer_interface() = default;
|
||||
|
||||
virtual void background(graph_reference, window) = 0;
|
||||
virtual void item(graph_reference, const nana::rectangle&, const attr&) = 0;
|
||||
|
||||
@@ -25,13 +25,10 @@ namespace nana
|
||||
{
|
||||
class drawer: public drawer_trigger
|
||||
{
|
||||
public:
|
||||
drawer();
|
||||
private:
|
||||
void attached(widget_reference, graph_reference) override;
|
||||
void refresh(graph_reference) override;
|
||||
private:
|
||||
window window_;
|
||||
window window_{nullptr};
|
||||
};
|
||||
}// end namespace panel
|
||||
}//end namespace drawerbase
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace nana
|
||||
void attached(widget_reference, graph_reference) override;
|
||||
void load(const nana::char_t* file);
|
||||
void load(const nana::paint::image&);
|
||||
void set_shadow_background(unsigned begin_color, unsigned end_color, bool horizontal);
|
||||
void set_shadow_background(const ::nana::expr_color& from, const ::nana::expr_color& to, bool horizontal);
|
||||
bool bgstyle(bool is_stretch, nana::arrange, int beg, int end);
|
||||
private:
|
||||
void refresh(graph_reference) override;
|
||||
@@ -35,13 +35,14 @@ namespace nana
|
||||
widget* widget_;
|
||||
nana::paint::graphics* graph_;
|
||||
|
||||
struct runtime_type
|
||||
struct
|
||||
{
|
||||
runtime_type();
|
||||
unsigned background_shadow_start;
|
||||
unsigned background_shadow_end;
|
||||
//unsigned background_shadow_start; //deprecated
|
||||
//unsigned background_shadow_end;
|
||||
::nana::expr_color gradual_from;
|
||||
::nana::expr_color gradual_to;
|
||||
bool horizontal;
|
||||
}runtime_;
|
||||
}bground_;
|
||||
|
||||
struct back_image_tag
|
||||
{
|
||||
@@ -72,8 +73,8 @@ namespace nana
|
||||
int end ///< specify the stretchy area of image.
|
||||
);
|
||||
|
||||
/// Fills a gradual change color in background.
|
||||
void set_shadow_background(unsigned begin_color, unsigned end_color, bool horizontal);
|
||||
/// Fills a gradual-change color in background. If One of colors is invisible or clr_from is equal to clr_to, it draws background in bgcolor.
|
||||
void set_gradual_background(const ::nana::expr_color& clr_from, const ::nana::expr_color& clr_to, bool horizontal);
|
||||
void transparent(bool);
|
||||
bool transparent() const;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace nana
|
||||
class trigger: public drawer_trigger
|
||||
{
|
||||
public:
|
||||
trigger();
|
||||
unsigned value() const;
|
||||
unsigned value(unsigned);
|
||||
unsigned inc();
|
||||
@@ -41,13 +40,13 @@ namespace nana
|
||||
bool _m_check_changing(unsigned) const;
|
||||
private:
|
||||
static const unsigned border = 2;
|
||||
widget * widget_;
|
||||
nana::paint::graphics* graph_;
|
||||
unsigned draw_width_;
|
||||
bool has_value_;
|
||||
bool unknown_;
|
||||
unsigned max_;
|
||||
unsigned value_;
|
||||
widget * widget_{nullptr};
|
||||
nana::paint::graphics* graph_{nullptr};
|
||||
unsigned draw_width_{static_cast<unsigned>(-1)};
|
||||
bool has_value_{true};
|
||||
bool unknown_{false};
|
||||
unsigned max_{100};
|
||||
unsigned value_{0};
|
||||
}; //end class drawer
|
||||
}
|
||||
}//end namespace drawerbase
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace nana
|
||||
bool _m_check() const;
|
||||
void _m_adjust_scroll(graph_reference);
|
||||
void _m_background(graph_reference);
|
||||
void _m_button_frame(graph_reference, int x, int y, unsigned width, unsigned height, int state);
|
||||
void _m_button_frame(graph_reference, ::nana::rectangle, int state);
|
||||
void _m_draw_scroll(graph_reference, int state);
|
||||
void _m_draw_button(graph_reference, int x, int y, unsigned width, unsigned height, buttons what, int state);
|
||||
void _m_draw_button(graph_reference, ::nana::rectangle, buttons what, int state);
|
||||
private:
|
||||
metrics_type &metrics_;
|
||||
bool vertical_;
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace nana{ namespace widgets
|
||||
|
||||
struct ext_renderer_tag
|
||||
{
|
||||
std::function<void(graph_reference, const nana::rectangle& text_area, nana::color_t)> background;
|
||||
std::function<void(graph_reference, const nana::rectangle& text_area, const ::nana::expr_color&)> background;
|
||||
};
|
||||
|
||||
text_editor(window, graph_reference);
|
||||
@@ -151,7 +151,7 @@ namespace nana{ namespace widgets
|
||||
/// Set the text_editor whether it is line wrapped, it returns false if the state is not changed.
|
||||
bool line_wrapped(bool);
|
||||
|
||||
void border_renderer(std::function<void(graph_reference, nana::color_t bgcolor)>);
|
||||
void border_renderer(std::function<void(graph_reference, const ::nana::expr_color& bgcolor)>);
|
||||
|
||||
bool load(const nana::char_t*);
|
||||
|
||||
@@ -227,15 +227,15 @@ namespace nana{ namespace widgets
|
||||
skeletons::textbase<nana::char_t>& textbase();
|
||||
const skeletons::textbase<nana::char_t>& textbase() const;
|
||||
private:
|
||||
nana::color_t _m_bgcolor() const;
|
||||
::nana::expr_color _m_bgcolor() const;
|
||||
bool _m_scroll_text(bool vertical);
|
||||
void _m_on_scroll(const arg_mouse&);
|
||||
void _m_scrollbar();
|
||||
nana::size _m_text_area() const;
|
||||
::nana::size _m_text_area() const;
|
||||
void _m_get_scrollbar_size();
|
||||
void _m_reset();
|
||||
nana::upoint _m_put(nana::string);
|
||||
nana::upoint _m_erase_select();
|
||||
::nana::upoint _m_put(nana::string);
|
||||
::nana::upoint _m_erase_select();
|
||||
|
||||
bool _m_make_select_string(nana::string&) const;
|
||||
static bool _m_resolve_text(const nana::string&, std::vector<std::pair<std::size_t, std::size_t>> & lines);
|
||||
@@ -262,7 +262,7 @@ namespace nana{ namespace widgets
|
||||
|
||||
//_m_draw_string
|
||||
//@brief: Draw a line of string
|
||||
void _m_draw_string(int top, nana::color_t color, const nana::upoint& str_pos, const nana::string&, bool if_mask) const;
|
||||
void _m_draw_string(int top, const ::nana::expr_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
|
||||
@@ -308,7 +308,7 @@ namespace nana{ namespace widgets
|
||||
unsigned scroll_pixels;
|
||||
unsigned vscroll;
|
||||
unsigned hscroll;
|
||||
std::function<void(nana::paint::graphics&, nana::color_t)> border_renderer;
|
||||
std::function<void(nana::paint::graphics&, const ::nana::expr_color&)> border_renderer;
|
||||
}text_area_;
|
||||
|
||||
struct selection
|
||||
|
||||
@@ -439,16 +439,16 @@ namespace nana{ namespace widgets{ namespace skeletons
|
||||
};
|
||||
};
|
||||
|
||||
nana::string font;
|
||||
::nana::string font;
|
||||
std::size_t font_size;
|
||||
bool bold;
|
||||
bool bold_empty; //bold should be ignored if bold_empty is true
|
||||
aligns::t text_align;
|
||||
nana::color_t bgcolor; //If the color is not specified, it will be ignored, and the system will search for its parent.
|
||||
nana::color_t fgcolor; //ditto
|
||||
::nana::expr_color bgcolor; //If the color is not specified, it will be ignored, and the system will search for its parent.
|
||||
::nana::expr_color fgcolor; //ditto
|
||||
|
||||
nana::string target;
|
||||
nana::string url;
|
||||
::nana::string target;
|
||||
::nana::string url;
|
||||
|
||||
fblock * parent;
|
||||
};
|
||||
@@ -741,41 +741,45 @@ namespace nana{ namespace widgets{ namespace skeletons
|
||||
switch(tknizer.read())
|
||||
{
|
||||
case token::number:
|
||||
fp->fgcolor = tknizer.number();
|
||||
{
|
||||
pixel_color_t px;
|
||||
px.value = static_cast<unsigned>(tknizer.number());
|
||||
fp->fgcolor = {px.element.red, px.element.green, px.element.blue};
|
||||
}
|
||||
break;
|
||||
case token::red:
|
||||
fp->fgcolor = 0xFF0000;
|
||||
fp->fgcolor = colors::red;
|
||||
break;
|
||||
case token::green:
|
||||
fp->fgcolor = 0xFF00;
|
||||
fp->fgcolor = colors::green;
|
||||
break;
|
||||
case token::blue:
|
||||
fp->fgcolor = 0xFF;
|
||||
fp->fgcolor = colors::blue;
|
||||
break;
|
||||
case token::white:
|
||||
fp->fgcolor = 0xFFFFFF;
|
||||
fp->fgcolor = colors::white;
|
||||
break;
|
||||
case token::black:
|
||||
fp->fgcolor = 0x0;
|
||||
fp->fgcolor = colors::black;
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("");
|
||||
}
|
||||
break;
|
||||
case token::red: //support the omitting of color.
|
||||
fp->fgcolor = 0xFF0000;
|
||||
fp->fgcolor = colors::red;
|
||||
break;
|
||||
case token::green: //support the omitting of color.
|
||||
fp->fgcolor = 0xFF00;
|
||||
fp->fgcolor = colors::green;
|
||||
break;
|
||||
case token::blue: //support the omitting of color.
|
||||
fp->fgcolor = 0xFF;
|
||||
fp->fgcolor = colors::blue;
|
||||
break;
|
||||
case token::white: //support the omitting of color.
|
||||
fp->fgcolor = 0xFFFFFF;
|
||||
fp->fgcolor = colors::white;
|
||||
break;
|
||||
case token::black: //support the omitting of color.
|
||||
fp->fgcolor = 0x0;
|
||||
fp->fgcolor = colors::black;
|
||||
break;
|
||||
case token::baseline:
|
||||
fp->text_align = fblock::aligns::baseline;
|
||||
@@ -867,10 +871,6 @@ namespace nana{ namespace widgets{ namespace skeletons
|
||||
fbp->bold_empty = true;
|
||||
fbp->text_align = fblock::aligns::baseline;
|
||||
|
||||
//Refer to the definition for the color specification.
|
||||
fbp->bgcolor = 0xFFFFFFFF;
|
||||
fbp->fgcolor = 0xFFFFFFFF;
|
||||
|
||||
fbp->parent = nullptr;
|
||||
|
||||
fblocks_.push_back(fbp);
|
||||
@@ -910,8 +910,7 @@ namespace nana{ namespace widgets{ namespace skeletons
|
||||
v.data_ptr = new data_text(idstr);
|
||||
break;
|
||||
default:
|
||||
int * debug = 0; //for debug
|
||||
*debug = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
line.push_back(v);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace nana
|
||||
class provider
|
||||
{
|
||||
public:
|
||||
virtual ~provider() = 0;
|
||||
virtual ~provider() = default;
|
||||
virtual nana::string adorn_trace(unsigned vmax, unsigned vadorn) const = 0;
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace nana
|
||||
unsigned vcur_scale; //pixels of vcur scale.
|
||||
};
|
||||
|
||||
virtual ~renderer() = 0;
|
||||
virtual ~renderer() = default;
|
||||
|
||||
virtual void background(window, graph_reference, bool isglass) = 0;
|
||||
virtual void adorn(window, graph_reference, const adorn_t&) = 0;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace nana
|
||||
class event_agent_interface
|
||||
{
|
||||
public:
|
||||
virtual ~event_agent_interface() = 0;
|
||||
virtual ~event_agent_interface() = default;
|
||||
virtual void added(std::size_t) = 0;
|
||||
virtual void activated(std::size_t) = 0;
|
||||
virtual bool removed(std::size_t) = 0;
|
||||
@@ -67,18 +67,18 @@ namespace nana
|
||||
{
|
||||
public:
|
||||
typedef item_renderer item_renderer_type;
|
||||
typedef nana::paint::graphics & graph_reference;
|
||||
typedef ::nana::paint::graphics & graph_reference;
|
||||
enum state_t{disable, normal, highlight, press};
|
||||
|
||||
struct item_t
|
||||
{
|
||||
nana::rectangle r;
|
||||
nana::color_t bgcolor;
|
||||
nana::color_t fgcolor;
|
||||
::nana::rectangle r;
|
||||
::nana::expr_color bgcolor;
|
||||
::nana::expr_color fgcolor;
|
||||
};
|
||||
|
||||
virtual ~item_renderer() = 0;
|
||||
virtual void background(graph_reference, const nana::rectangle& r, nana::color_t bgcolor) = 0;
|
||||
virtual ~item_renderer() = default;
|
||||
virtual void background(graph_reference, const nana::rectangle& r, const ::nana::expr_color& bgcolor) = 0;
|
||||
virtual void item(graph_reference, const item_t&, bool active, state_t) = 0;
|
||||
virtual void close_fly(graph_reference, const nana::rectangle&, bool active, state_t) = 0;
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace nana
|
||||
std::size_t length() const;
|
||||
bool close_fly(bool);
|
||||
void relate(size_t, window);
|
||||
void tab_color(std::size_t, bool is_bgcolor, nana::color_t);
|
||||
void tab_color(std::size_t, bool is_bgcolor, const ::nana::expr_color&);
|
||||
void tab_image(size_t, const nana::paint::image&);
|
||||
void text(std::size_t, const nana::string&);
|
||||
nana::string text(std::size_t) const;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace nana
|
||||
void typeface_changed(graph_reference) override;
|
||||
private:
|
||||
void _m_text_area(unsigned width, unsigned height);
|
||||
void _m_draw_border(graph_reference, nana::color_t bgcolor);
|
||||
void _m_draw_border(graph_reference, const ::nana::expr_color& bgcolor);
|
||||
private:
|
||||
widget* widget_;
|
||||
struct status_type
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace nana
|
||||
void mouse_up(graph_reference, const arg_mouse&) override;
|
||||
private:
|
||||
size_type _m_which(int x, int y, bool want_if_disabled) const;
|
||||
void _m_draw_background(nana::color_t);
|
||||
void _m_draw_background(const ::nana::expr_color&);
|
||||
void _m_draw();
|
||||
void _m_owner_sized(const arg_resized&);
|
||||
private:
|
||||
@@ -87,7 +87,7 @@ namespace nana
|
||||
public:
|
||||
typedef std::size_t size_type; ///< A type to count the number of elements.
|
||||
|
||||
toolbar();
|
||||
toolbar() = default;
|
||||
toolbar(window, bool visible);
|
||||
toolbar(window, const rectangle& = rectangle(), bool visible = true);
|
||||
|
||||
|
||||
@@ -73,12 +73,14 @@ namespace nana
|
||||
void move(int x, int y);
|
||||
void move(const rectangle&);
|
||||
|
||||
/*
|
||||
void foreground(nana::color_t); //deprecated
|
||||
nana::color_t foreground() const;
|
||||
void background(nana::color_t);
|
||||
nana::color_t background() const;
|
||||
*/
|
||||
|
||||
void fgcolor(const nana::expr_color&); //deprecated
|
||||
void fgcolor(const nana::expr_color&);
|
||||
nana::expr_color fgcolor() const;
|
||||
void bgcolor(const nana::expr_color&);
|
||||
nana::expr_color bgcolor() const;
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace gadget
|
||||
enum t{to_east, to_southeast, to_south, to_southwest, to_west, to_northwest, to_north, to_northeast};
|
||||
};
|
||||
|
||||
void arrow_16_pixels(nana::paint::graphics&, int x, int y, unsigned color, uint32_t style, directions::t direction);
|
||||
void close_16_pixels(nana::paint::graphics&, int x, int y, uint32_t style, uint32_t color);
|
||||
void cross(nana::paint::graphics&, int x, int y, uint32_t size, uint32_t thickness, nana::color_t color); //deprecated
|
||||
void arrow_16_pixels(nana::paint::graphics&, int x, int y, const expr_color&, uint32_t style, directions::t direction);
|
||||
void close_16_pixels(nana::paint::graphics&, int x, int y, uint32_t style, const expr_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::expr_color&);
|
||||
|
||||
}//end namespace gadget
|
||||
|
||||
@@ -99,12 +99,13 @@ namespace nana
|
||||
|
||||
bool text_metrics(unsigned & ascent, unsigned& descent, unsigned& internal_leading) const;
|
||||
|
||||
unsigned bidi_string(int x, int y, color_t, const char_t *, std::size_t len);
|
||||
void string(int x, int y, color_t, const ::nana::string&, std::size_t len);
|
||||
void string(int x, int y, color_t, const ::nana::string&);
|
||||
void string(int x, int y, color_t, const char_t*, std::size_t len);
|
||||
void string(int x, int y, color_t, const char_t*);
|
||||
//unsigned bidi_string(int x, int y, color_t, const char_t *, std::size_t len); //deprecated
|
||||
//void string(int x, int y, color_t, const ::nana::string&, std::size_t len);
|
||||
//void string(int x, int y, color_t, const ::nana::string&);
|
||||
//void string(int x, int y, color_t, const char_t*, std::size_t len);
|
||||
//void string(int x, int y, color_t, const char_t*);
|
||||
|
||||
/*
|
||||
void set_pixel(int x, int y, color_t);
|
||||
void rectangle(int x, int y, unsigned width, unsigned height, color_t, bool solid);
|
||||
void rectangle(color_t, bool solid);
|
||||
@@ -119,8 +120,9 @@ namespace nana
|
||||
void line(int x1, int y1, int x2, int y2, color_t); ///< Draws a line from point (x1, y1) to point (x2, y2) in the specified color.
|
||||
void line(const point& beg, const point& end, color_t);
|
||||
void lines(const point* points, std::size_t n_of_points, color_t);
|
||||
void line_begin(int x, int y);
|
||||
void line_to(int x, int y, color_t);
|
||||
*/
|
||||
void line_begin(int x, int y);
|
||||
|
||||
void bitblt(int x, int y, const graphics& source); ///< Transfers the source to the specified point.
|
||||
void bitblt(const ::nana::rectangle& r_dst, native_window_type src); ///< Transfers the color data corresponding to r_dst from the src window to this graphics.
|
||||
@@ -141,7 +143,7 @@ namespace nana
|
||||
void rgb_to_wb(); ///< Transform a color graphics into black&white.
|
||||
|
||||
void stretch(const ::nana::rectangle& src_r, graphics& dst, const ::nana::rectangle& r) const;
|
||||
void stretch(graphics& dst, const ::nana::rectangle& r) const;
|
||||
void stretch(graphics& dst, const ::nana::rectangle&) const;
|
||||
|
||||
void flush();
|
||||
|
||||
@@ -152,20 +154,36 @@ namespace nana
|
||||
void release();
|
||||
void save_as_file(const char*);
|
||||
|
||||
static color_t mix(color_t colorX, color_t colorY, double persent); //deprecated
|
||||
//static color_t mix(color_t colorX, color_t colorY, double persent); //deprecated
|
||||
|
||||
void set_color(const ::nana::expr_color&);
|
||||
void set_text_color(const ::nana::expr_color&);
|
||||
|
||||
unsigned bidi_string(const nana::point&, const char_t *, std::size_t len);
|
||||
void string(nana::point, const char_t*, std::size_t len);
|
||||
void string(const nana::point&, const char_t*);
|
||||
void string(const nana::point&, const nana::string&);
|
||||
|
||||
void line(const nana::point&, const nana::point&);
|
||||
void blend(const ::nana::rectangle& r, const ::nana::expr_color&, double fade_rate);
|
||||
|
||||
void set_pixel(int x, int y, const ::nana::expr_color&);
|
||||
void set_pixel(int x, int y);
|
||||
|
||||
void string(point, const char_t*, std::size_t len);
|
||||
void string(const point&, const char_t*);
|
||||
void string(const point&, const ::nana::string&);
|
||||
void string(const point&, const ::nana::string&, const expr_color&);
|
||||
|
||||
void line(const point&, const point&);
|
||||
void line(const point&, const point&, const expr_color&);
|
||||
void line_to(const point&, const expr_color&);
|
||||
void line_to(const point&);
|
||||
|
||||
void rectangle(bool solid);
|
||||
void rectangle(bool solid, const expr_color&);
|
||||
void rectangle(const ::nana::rectangle&, bool solid);
|
||||
void rectangle(const ::nana::rectangle&, bool solid, const expr_color&);
|
||||
void frame_rectangle(const ::nana::rectangle&, const expr_color& left, const expr_color& top, const expr_color& right, const expr_color& bottom);
|
||||
|
||||
void gradual_rectangle(const ::nana::rectangle&, const ::nana::expr_color& from, const ::nana::expr_color& to, bool vertical);
|
||||
void gradual_rectangle(const ::nana::rectangle&, const expr_color& from, const expr_color& to, bool vertical);
|
||||
void round_rectangle(const ::nana::rectangle&, unsigned radius_x, unsigned radius_y, const expr_color&, bool solid, const expr_color& color_if_solid);
|
||||
private:
|
||||
std::shared_ptr< ::nana::detail::drawable_impl_type> dwptr_;
|
||||
font font_shadow_;
|
||||
|
||||
@@ -13,13 +13,16 @@ 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);
|
||||
void render(int x, int y, nana::color_t, const nana::char_t*, std::size_t len, unsigned restricted_pixels, bool omitted);
|
||||
//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
|
||||
|
||||
void render(int x, int y, nana::color_t, const nana::char_t*, std::size_t len, unsigned restricted_pixels);
|
||||
nana::size extent_size(int x, int y, const nana::char_t*, std::size_t len, unsigned restricted_pixels) const;
|
||||
|
||||
void render(const nana::point&, const nana::char_t*, std::size_t len, unsigned restricted_pixels, bool omiited);
|
||||
void render(const point&, const char_t*, std::size_t len);
|
||||
void render(const point&, const char_t*, std::size_t len, unsigned restricted_pixels, bool omitted);
|
||||
void render(const point&, const char_t*, std::size_t len, unsigned restricted_pixels);
|
||||
private:
|
||||
graph_reference graph_;
|
||||
align text_align_;
|
||||
|
||||
Reference in New Issue
Block a user