merge beru's changes

This commit is contained in:
Jinhao
2015-08-02 03:33:43 +08:00
parent 66c1e1ad98
commit e0ee42d184
18 changed files with 59 additions and 86 deletions

View File

@@ -172,6 +172,12 @@ namespace detail
HMODULE ole32_;
};
struct window_icons
{
::nana::paint::image sml_icon;
::nana::paint::image big_icon;
};
platform_spec();
const font_ptr_t& default_native_font() const;
@@ -182,11 +188,11 @@ namespace detail
static platform_spec& instance();
void keep_window_icon(native_window_type, const nana::paint::image&);
void keep_window_icon(native_window_type, const paint::image&sml_icon, const paint::image& big_icon);
void release_window_icon(native_window_type);
private:
font_ptr_t def_font_ptr_;
std::map<native_window_type, nana::paint::image> iconbase_;
std::map<native_window_type, window_icons> iconbase_;
};
}//end namespace detail

View File

@@ -44,7 +44,6 @@ namespace detail
#endif
static void enable_dropfiles(native_window_type, bool);
static void enable_window(native_window_type, bool);
static bool window_icon(native_window_type, const paint::image&);
// (On Windows) The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
static bool window_icon(native_window_type, const paint::image& big_icon, const paint::image& small_icon);
static void activate_owner(native_window_type);

View File

@@ -106,10 +106,8 @@ namespace detail
//@brief: Delete window handle, the handle type must be a root and a frame.
void destroy_handle(core_window_t*);
void default_icon(const paint::image&);
void default_icon(const paint::image& big_icon, const paint::image& small_icon);
void icon(core_window_t*, const paint::image&);
void icon(core_window_t*, const paint::image& big_icon, const paint::image& small_icon);
void default_icon(const paint::image& small_icon, const paint::image& big_icon);
void icon(core_window_t*, const paint::image& small_icon, const paint::image& big_icon);
//show
//@brief: show or hide a window

View File

@@ -112,10 +112,8 @@ namespace API
}
}
void window_icon_default(const paint::image&);
void window_icon_default(const paint::image& big_icon, const paint::image& small_icon);
void window_icon(window, const paint::image&);
void window_icon(window, const paint::image& big_icon, const paint::image& small_icon);
void window_icon_default(const paint::image& small_icon, const paint::image& big_icon = {});
void window_icon(window, const paint::image& small_icon, const paint::image& big_icon = {});
bool empty_window(window); ///< Determines whether a window is existing.
bool is_window(window); ///< Determines whether a window is existing, equal to !empty_window.

View File

@@ -65,7 +65,7 @@ namespace nana
label& format(bool); ///< Switches the format mode of the widget.
label& add_format_listener(std::function<void(command, const nana::string&)>);
void relate(widget& w); // as same as the "for" attribute of a label
void click_for(window associated_window); // as same as the "for" attribute of a label
/// \briefReturn the size of the text. If *allowed_width_in_pixel* is not zero, returns a
/// "corrected" size that changes lines to fit the text into the specified width

View File

@@ -16,7 +16,7 @@ namespace nana{ namespace paint{
typedef nana::paint::graphics& graph_reference;
virtual ~image_impl_interface() = 0; //The destructor is defined in ../image.cpp
virtual bool open(const nana::char_t* filename) = 0;
virtual bool open(void* buff, size_t sz) = 0; // reads image from memory
virtual bool open(const void* data, std::size_t bytes) = 0; // reads image from memory
virtual bool alpha_channel() const = 0;
virtual bool empty() const = 0;
virtual void close() = 0;

View File

@@ -37,7 +37,9 @@ namespace paint
image& operator=(const image& rhs);
image& operator=(image&&);
bool open(const nana::string& filename);
bool open_icon(void* buff, size_t sz); // opens a icon from memory
/// Opens an icon from a specified buffer
bool open_icon(const void* data, std::size_t bytes);
bool empty() const;
operator unspecified_bool_t() const;
void close();