| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
// To exclude this file from the documentation when build-deprecated-api=false. |
| 18 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 19 |
|
| 20 |
#include <gtkmm/stylecontext.h> |
| 21 |
#include <gdkmm/pixbuf.h> |
| 22 |
#include <gtkmm/iconsource.h> |
| 23 |
//#include <gtkmm/widget.h> |
| 24 |
#include <gtkmm/stockid.h> |
| 25 |
|
| 26 |
_DEFS(gtkmm,gtk) |
| 27 |
|
| 28 |
#m4 _PUSH(SECTION_CC_PRE_INCLUDES) |
| 29 |
#undef GTK_DISABLE_DEPRECATED |
| 30 |
#define GDK_DISABLE_DEPRECATION_WARNINGS 1 |
| 31 |
#m4 _POP() |
| 32 |
|
| 33 |
_IS_DEPRECATED // This whole file is deprecated. |
| 34 |
|
| 35 |
namespace Gtk |
| 36 |
{ |
| 37 |
|
| 38 |
class GTKMM_API StyleContext; |
| 39 |
class GTKMM_API Widget; |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
/** This manages a set of variants of a particular icon |
| 44 |
* An IconSet contains variants for different sizes and widget states. |
| 45 |
* Icons in an icon factory are named by a stock ID, which is a simple string identifying the icon. Each GtkStyle has a list of GtkIconFactory derived from the current theme; those icon factories are consulted first when searching for an icon. If the theme doesn't set a particular icon, GTK+ looks for the icon in a list of default icon factories, maintained by gtk_icon_factory_add_default() and gtk_icon_factory_remove_default(). Applications with icons should add a default icon factory with their icons, which will allow themes to override the icons for the application. |
| 46 |
* @deprecated Use Gtk::IconTheme instead. |
| 47 |
*/ |
| 48 |
class GTKMM_API IconSet final |
| 49 |
{ |
| 50 |
//GtkIconSet is registered as a boxed type, but it has ref/unref functions instead of copy/free, |
| 51 |
//so we use it via RefPtr. |
| 52 |
_CLASS_OPAQUE_REFCOUNTED(IconSet, GtkIconSet, gtk_icon_set_new, gtk_icon_set_ref, gtk_icon_set_unref, GTKMM_API) |
| 53 |
_IGNORE(gtk_icon_set_ref, gtk_icon_set_unref, gtk_icon_set_get_sizes) |
| 54 |
|
| 55 |
public: |
| 56 |
//TODO: Documentation |
| 57 |
static Glib::RefPtr<IconSet> create(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf); |
| 58 |
|
| 59 |
_WRAP_METHOD(Glib::RefPtr<IconSet> copy() const, gtk_icon_set_copy) |
| 60 |
|
| 61 |
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> render_icon_pixbuf(const Glib::RefPtr<StyleContext>& context, IconSize size), gtk_icon_set_render_icon_pixbuf) |
| 62 |
_IGNORE(gtk_icon_set_render_icon) //deprecated. |
| 63 |
|
| 64 |
_WRAP_METHOD(void add_source(const IconSource& source), gtk_icon_set_add_source) |
| 65 |
|
| 66 |
std::vector<IconSize> get_sizes() const; |
| 67 |
|
| 68 |
_WRAP_METHOD(static Glib::RefPtr<IconSet> lookup_default(const Gtk::StockID& stock_id), gtk_icon_factory_lookup_default, refreturn) |
| 69 |
|
| 70 |
_IGNORE(gtk_icon_set_render_icon_surface) |
| 71 |
}; |
| 72 |
|
| 73 |
} //namespace Gtk |