/*
 * Copyright (C) 1998-2002 The gtkmm Development Team
 *
 * This library is free software, ) you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, ) either
 * version 2.1 of the License, or(at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY, ) without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library, ) if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/stylecontext.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/iconsource.h>
//#include <gtkmm/widget.h>
#include <gtkmm/stockid.h>

_DEFS(gtkmm,gtk)

#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
#undef GTK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#m4 _POP()

_IS_DEPRECATED // This whole file is deprecated.

namespace Gtk
{

class StyleContext;
class Widget;



/** This manages a set of variants of a particular icon
 * An IconSet contains variants for different sizes and widget states.
 * 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.
 * @deprecated Use Gtk::IconTheme instead.
 */
class IconSet final
{
  //GtkIconSet is registered as a boxed type, but it has ref/unref functions instead of copy/free,
  //so we use it via RefPtr.
  _CLASS_OPAQUE_REFCOUNTED(IconSet, GtkIconSet, gtk_icon_set_new, gtk_icon_set_ref, gtk_icon_set_unref)
  _IGNORE(gtk_icon_set_ref, gtk_icon_set_unref, gtk_icon_set_get_sizes)

public:
  //TODO: Documentation
  static Glib::RefPtr<IconSet> create(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);

  _WRAP_METHOD(Glib::RefPtr<IconSet> copy() const, gtk_icon_set_copy)

  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> render_icon_pixbuf(const Glib::RefPtr<StyleContext>& context, IconSize size), gtk_icon_set_render_icon_pixbuf)
  _IGNORE(gtk_icon_set_render_icon) //deprecated.

  _WRAP_METHOD(void add_source(const IconSource& source), gtk_icon_set_add_source)

  std::vector<IconSize> get_sizes() const;

  _WRAP_METHOD(static Glib::RefPtr<IconSet> lookup_default(const Gtk::StockID& stock_id), gtk_icon_factory_lookup_default, refreturn)

  _IGNORE(gtk_icon_set_render_icon_surface)
};

} //namespace Gtk


