/* gutterrenderertext.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 GutterRendererText class

#include <gtksourceviewmm/gutterrenderer.h>
#include <gtksourceviewmm/markup.h>

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

namespace Gsv
{

// TODO: write docs.
class GutterRendererText : public GutterRenderer
{
  _CLASS_GTKOBJECT(GutterRendererText, GtkSourceGutterRendererText, GTK_SOURCE_GUTTER_RENDERER_TEXT, GutterRenderer, GtkSourceGutterRenderer)
public:
  _CTOR_DEFAULT()

  // TODO: probably just set_text and set_markup will be better instead of funny overloads.
  _IGNORE(gtk_source_gutter_renderer_text_set_markup)
  void set_text(const Markup& markup);

  _IGNORE(gtk_source_gutter_renderer_text_set_text)
  void set_text(const Glib::ustring& text);

#m4 _CONVERSION(`const Markup&', `const gchar*', `($3).get_c_str()')
  _WRAP_METHOD(void measure(const Markup& markup, int& width, int& height), gtk_source_gutter_renderer_text_measure_markup)

  _WRAP_METHOD(void measure(const Glib::ustring& text, int& width, int& height), gtk_source_gutter_renderer_text_measure)

  _WRAP_PROPERTY("text", Glib::ustring)
  _WRAP_PROPERTY("markup", Glib::ustring)
};

} // namespace Gsv


