[gtkmm] Gtk::IconInfo: Rename one of the overloaded load_symbolic()
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk::IconInfo: Rename one of the overloaded load_symbolic()
- Date: Wed, 28 Dec 2016 18:18:55 +0000 (UTC)
commit ed0537d4edf257de4df9b11ef3de81c6f6c7c0a3
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Wed Dec 28 19:16:26 2016 +0100
Gtk::IconInfo: Rename one of the overloaded load_symbolic()
* demos/gtk-demo/example_iconbrowser.cc:
* gtk/src/iconinfo.[ccg|hg]: Rename load_symbolic(context) to
load_symbolic_for_context() for consistency. Make load_icon() and one of
the other load_symbolic() non-const. This also increases consistency.
The other load_*() methods are non-const. It's not clear from the gtk+ docs
whether the gtk_icon_info_load_*() functions can modify the GtkIconInfo
object. The source code shows that they can.
demos/gtk-demo/example_iconbrowser.cc | 2 +-
gtk/src/iconinfo.ccg | 20 +++-----------------
gtk/src/iconinfo.hg | 10 ++++------
3 files changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 75964a3..47b660f 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -972,7 +972,7 @@ Glib::RefPtr<Gdk::Pixbuf> DetailDialog::get_icon(int size_index)
try
{
bool is_symbolic = false;
- pixbuf = info.load_symbolic(context, is_symbolic);
+ pixbuf = info.load_symbolic_for_context(context, is_symbolic);
}
catch (const Glib::Error& err)
{
diff --git a/gtk/src/iconinfo.ccg b/gtk/src/iconinfo.ccg
index 310b727..0ad43bd 100644
--- a/gtk/src/iconinfo.ccg
+++ b/gtk/src/iconinfo.ccg
@@ -66,7 +66,7 @@ IconInfo::operator bool() const
}
-Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color, const
Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic) const
+Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color, const
Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic)
{
GError* gerror = nullptr;
gboolean c_was_symbolic = false;
@@ -78,11 +78,11 @@ Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Gdk::RGBA& fg, const Gdk
return retvalue;
}
-Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Glib::RefPtr<StyleContext>& style, bool&
was_symbolic)
+Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic_for_context(const Glib::RefPtr<StyleContext>& context,
bool& was_symbolic)
{
GError* gerror = nullptr;
gboolean c_was_symbolic = false;
- auto retvalue = Glib::wrap(gtk_icon_info_load_symbolic_for_context(gobj(), Glib::unwrap(style),
&c_was_symbolic, &(gerror)));
+ auto retvalue = Glib::wrap(gtk_icon_info_load_symbolic_for_context(gobj(), Glib::unwrap(context),
&c_was_symbolic, &(gerror)));
was_symbolic = c_was_symbolic;
if(gerror)
::Glib::Error::throw_exception(gerror);
@@ -91,20 +91,6 @@ Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Glib::RefPtr<StyleContex
}
-/* deprecated
-Glib::RefPtr<Gdk::Pixbuf> IconInfo::load_symbolic(const Glib::RefPtr<Style>& style, StateType state, bool&
was_symbolic) const
-{
- GError* gerror = nullptr;
- gboolean c_was_symbolic = false;
- auto retvalue = Glib::wrap(gtk_icon_info_load_symbolic_for_style(const_cast<GtkIconInfo*>(gobj()),
Glib::unwrap(style), ((GtkStateType)(state)), &c_was_symbolic, &(gerror)));
- was_symbolic = c_was_symbolic;
- if(gerror)
- ::Glib::Error::throw_exception(gerror);
-
- return retvalue;
-}
-*/
-
void IconInfo::load_icon_async(const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>&
cancellable)
{
// Create a copy of the slot.
diff --git a/gtk/src/iconinfo.hg b/gtk/src/iconinfo.hg
index 3755f43..4a571b2 100644
--- a/gtk/src/iconinfo.hg
+++ b/gtk/src/iconinfo.hg
@@ -50,13 +50,13 @@ public:
_WRAP_METHOD(int get_base_scale() const, gtk_icon_info_get_base_scale)
_WRAP_METHOD(Glib::ustring get_filename() const, gtk_icon_info_get_filename)
- _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon() const, gtk_icon_info_load_icon, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon(), gtk_icon_info_load_icon, errthrow)
#m4 _CONVERSION(`cairo_surface_t*',`::Cairo::RefPtr< ::Cairo::Surface>',`::Cairo::make_refptr_for_instance<
::Cairo::Surface>(new Cairo::Surface($3, true /* do not take reference */))')
_WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> load_surface(const Glib::RefPtr<Gdk::Window>& for_window),
gtk_icon_info_load_surface, errthrow)
//TODO: Documentation
- Glib::RefPtr<Gdk::Pixbuf> load_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color, const
Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic) const;
+ Glib::RefPtr<Gdk::Pixbuf> load_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color, const
Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic);
_IGNORE(gtk_icon_info_load_symbolic)
/** Asynchronously load, render and scale an icon previously looked up from the icon theme using
Gtk::IconTheme::lookup_icon().
@@ -80,7 +80,6 @@ public:
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon_finish(const Glib::RefPtr<Gio::AsyncResult>& result),
gtk_icon_info_load_icon_finish, errthrow)
-
/** Loads an icon, modifying it to match the system colors for the foreground, success, warning and error
colors provided.
* If the icon is not a symbolic one, this method will return the result from load_icon().
* This method uses the regular foreground color and the symbolic colors with the names "success_color",
@@ -88,13 +87,12 @@ public:
*
* This allows loading symbolic icons that will match the system theme.
*
- * @param style A StyleContext.
+ * @param Context A StyleContext.
* @param was_symbolic Whether the loaded icon was a symbolic one and whether the fg color was applied to
it.
*/
- Glib::RefPtr<Gdk::Pixbuf> load_symbolic(const Glib::RefPtr<StyleContext>& style, bool& was_symbolic);
+ Glib::RefPtr<Gdk::Pixbuf> load_symbolic_for_context(const Glib::RefPtr<StyleContext>& context, bool&
was_symbolic);
_IGNORE(gtk_icon_info_load_symbolic_for_context)
- //TODO: When we can break ABI: Rename these to load_symbolic_async(), or rename load_symbolic(context) to
load_symbolic_for_context() for consistency.
/** Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using
Gtk::IconTheme::lookup_icon().
* For more details, see load_symbolic() which is the synchronous version of this call.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]