// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gtkmm/fontchooser.h>
#include <gtkmm/private/fontchooser_p.h>

/* Copyright 2011 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 <gtk/gtk.h>


namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::FontChooser> wrap(GtkFontChooser* object, bool take_copy)
{
  return Glib::RefPtr<Gtk::FontChooser>( dynamic_cast<Gtk::FontChooser*> (Glib::wrap_auto_interface<Gtk::FontChooser> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Interface_Class& FontChooser_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &FontChooser_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = gtk_font_chooser_get_type();
  }

  return *this;
}

void FontChooser_Class::iface_init_function(void* g_iface, void*)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != 0); 


}


Glib::ObjectBase* FontChooser_Class::wrap_new(GObject* object)
{
  return new FontChooser((GtkFontChooser*)(object));
}


/* The implementation: */

FontChooser::FontChooser()
:
  Glib::Interface(fontchooser_class_.init())
{}

FontChooser::FontChooser(GtkFontChooser* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

FontChooser::FontChooser(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

FontChooser::~FontChooser()
{}

// static
void FontChooser::add_interface(GType gtype_implementer)
{
  fontchooser_class_.init().add_interface(gtype_implementer);
}

FontChooser::CppClassType FontChooser::fontchooser_class_; // initialize static member

GType FontChooser::get_type()
{
  return fontchooser_class_.init().get_type();
}


GType FontChooser::get_base_type()
{
  return gtk_font_chooser_get_type();
}


Glib::RefPtr<Pango::FontFamily> FontChooser::get_font_family()
{

  Glib::RefPtr<Pango::FontFamily> retvalue = Glib::wrap(gtk_font_chooser_get_font_family(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Pango::FontFamily> FontChooser::get_font_family() const
{
  return const_cast<FontChooser*>(this)->get_font_family();
}

Glib::RefPtr<Pango::FontFace> FontChooser::get_font_face()
{

  Glib::RefPtr<Pango::FontFace> retvalue = Glib::wrap(gtk_font_chooser_get_font_face(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Pango::FontFace> FontChooser::get_font_face() const
{
  return const_cast<FontChooser*>(this)->get_font_face();
}

int FontChooser::get_font_size() const
{
  return gtk_font_chooser_get_font_size(const_cast<GtkFontChooser*>(gobj()));
}

Pango::FontDescription FontChooser::get_font_desc() const
{
  return Glib::wrap(const_cast<PangoFontDescription*>(gtk_font_chooser_get_font_desc(const_cast<GtkFontChooser*>(gobj()))), false);
}

void FontChooser::set_font_desc(const Pango::FontDescription& font_desc)
{
gtk_font_chooser_set_font_desc(gobj(), (font_desc).gobj()); 
}

Glib::ustring FontChooser::get_font() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_font_chooser_get_font(const_cast<GtkFontChooser*>(gobj())));
}

void FontChooser::set_font(const Glib::ustring& font)
{
gtk_font_chooser_set_font(gobj(), font.c_str()); 
}

Glib::ustring FontChooser::get_preview_text() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_font_chooser_get_preview_text(const_cast<GtkFontChooser*>(gobj())));
}

void FontChooser::set_preview_text(const Glib::ustring& fontname)
{
gtk_font_chooser_set_preview_text(gobj(), fontname.c_str()); 
}

bool FontChooser::get_show_preview_entry() const
{
  return gtk_font_chooser_get_show_preview_entry(const_cast<GtkFontChooser*>(gobj()));
}

void FontChooser::set_show_preview_entry(bool show_preview_entry)
{
gtk_font_chooser_set_show_preview_entry(gobj(), static_cast<int>(show_preview_entry)); 
}


} // namespace Gtk


