/* gutterrendererpixbuf.h
 *
 * Copyright (C) 2010, 2011 Krzesimir Nowak
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/// \file
/// \brief GutterRendererPixbuf class

#include <glibmm/refptr.h>
#include <gdkmm/pixbuf.h>
#include <gtksourceviewmm/gutterrenderer.h>

_DEFS(gtksourceviewmm,gtksourceview)
_PINCLUDE(gtksourceviewmm/private/gutterrenderer_p.h)

namespace Gsv
{

// TODO: write docs.
class GutterRendererPixbuf : public GutterRenderer
{
  _CLASS_GTKOBJECT(GutterRendererPixbuf, GtkSourceGutterRendererPixbuf, GTK_SOURCE_GUTTER_RENDERER_PIXBUF, GutterRenderer, GtkSourceGutterRenderer)
public:
  _CTOR_DEFAULT()

  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf(), gtk_source_gutter_renderer_pixbuf_get_pixbuf, refreturn)

  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const, gtk_source_gutter_renderer_pixbuf_get_pixbuf, constversion)

#m4 _CONVERSION(`const Glib::RefPtr<const Gdk::Pixbuf>&', `GdkPixbuf*', `const_cast<GdkPixbuf*>(Glib::unwrap($3))')
  _WRAP_METHOD(void set_pixbuf(const Glib::RefPtr<const Gdk::Pixbuf>& pixbuf), gtk_source_gutter_renderer_pixbuf_set_pixbuf)

  _WRAP_METHOD(std::string get_stock_id() const, gtk_source_gutter_renderer_pixbuf_get_stock_id)

  _WRAP_METHOD(void set_stock_id(const std::string& stock_id), gtk_source_gutter_renderer_pixbuf_set_stock_id)

#m4 _CONVERSION(`GIcon*', `Glib::RefPtr<Gio::Icon>', `Glib::wrap($3)')
  _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon(), gtk_source_gutter_renderer_pixbuf_get_gicon, refreturn)

  _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_icon() const, gtk_source_gutter_renderer_pixbuf_get_gicon, constversion)

#m4 _CONVERSION(`const Glib::RefPtr<Gio::Icon>&', `GIcon*', `Glib::unwrap($3)')
  _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gio::Icon>& icon), gtk_source_gutter_renderer_pixbuf_set_gicon)

  _WRAP_METHOD(std::string get_icon_name() const, gtk_source_gutter_renderer_pixbuf_get_icon_name)

  _WRAP_METHOD(void set_icon_name(const std::string& icon_name), gtk_source_gutter_renderer_pixbuf_set_icon_name)

  _WRAP_PROPERTY("pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
  _WRAP_PROPERTY("stock-id", std::string)
  _WRAP_PROPERTY("icon-name", std::string)
  _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
};

} // namespace Gsv


