13
0
livetrax/libs/tk/ytkmm/fontbutton.cc
Robin Gareus ad51c7c2ba
Localize stripped down gtk2
This is intended mainly for GNU/Linux distros who will remove
GTK2 support in the near future.
2024-01-06 21:52:48 +01:00

344 lines
8.4 KiB
C++

// Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
#include <glibmm.h>
#include <gtkmm/fontbutton.h>
#include <gtkmm/private/fontbutton_p.h>
// -*- c++ -*-
/* $Id: fontbutton.ccg,v 1.1 2003/10/12 09:38:11 murrayc Exp $ */
/*
*
* Copyright 2003 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtk.h>
namespace Gtk
{
} // namespace Gtk
namespace
{
static const Glib::SignalProxyInfo FontButton_signal_font_set_info =
{
"font-set",
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};
} // anonymous namespace
namespace Glib
{
Gtk::FontButton* wrap(GtkFontButton* object, bool take_copy)
{
return dynamic_cast<Gtk::FontButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}
} /* namespace Glib */
namespace Gtk
{
/* The *_Class implementation: */
const Glib::Class& FontButton_Class::init()
{
if(!gtype_) // create the GType if necessary
{
// Glib::Class has to know the class init function to clone custom types.
class_init_func_ = &FontButton_Class::class_init_function;
// This is actually just optimized away, apparently with no harm.
// Make sure that the parent type has been created.
//CppClassParent::CppObjectType::get_type();
// Create the wrapper type, with the same class/instance size as the base type.
register_derived_type(gtk_font_button_get_type());
// Add derived versions of interfaces, if the C type implements any interfaces:
}
return *this;
}
void FontButton_Class::class_init_function(void* g_class, void* class_data)
{
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
CppClassParent::class_init_function(klass, class_data);
klass->font_set = &font_set_callback;
}
void FontButton_Class::font_set_callback(GtkFontButton* self)
{
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
// Non-gtkmmproc-generated custom classes implicitly call the default
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
// generated classes can use this optimisation, which avoids the unnecessary
// parameter conversions if there is no possibility of the virtual function
// being overridden:
if(obj_base && obj_base->is_derived_())
{
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
if(obj) // This can be NULL during destruction.
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
// Call the virtual member method, which derived classes might override.
obj->on_font_set();
return;
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
BaseClassType *const base = static_cast<BaseClassType*>(
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
);
// Call the original underlying C function:
if(base && base->font_set)
(*base->font_set)(self);
}
Glib::ObjectBase* FontButton_Class::wrap_new(GObject* o)
{
return manage(new FontButton((GtkFontButton*)(o)));
}
/* The implementation: */
FontButton::FontButton(const Glib::ConstructParams& construct_params)
:
Gtk::Button(construct_params)
{
}
FontButton::FontButton(GtkFontButton* castitem)
:
Gtk::Button((GtkButton*)(castitem))
{
}
FontButton::~FontButton()
{
destroy_();
}
FontButton::CppClassType FontButton::fontbutton_class_; // initialize static member
GType FontButton::get_type()
{
return fontbutton_class_.init().get_type();
}
GType FontButton::get_base_type()
{
return gtk_font_button_get_type();
}
FontButton::FontButton()
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(0),
Gtk::Button(Glib::ConstructParams(fontbutton_class_.init()))
{
}
FontButton::FontButton(const Glib::ustring& font_name)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(0),
Gtk::Button(Glib::ConstructParams(fontbutton_class_.init(), "font_name", font_name.c_str(), static_cast<char*>(0)))
{
}
Glib::ustring FontButton::get_title() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_title(const_cast<GtkFontButton*>(gobj())));
}
void FontButton::set_title(const Glib::ustring& title)
{
gtk_font_button_set_title(gobj(), title.c_str());
}
bool FontButton::get_use_font() const
{
return gtk_font_button_get_use_font(const_cast<GtkFontButton*>(gobj()));
}
void FontButton::set_use_font(bool use_font)
{
gtk_font_button_set_use_font(gobj(), static_cast<int>(use_font));
}
bool FontButton::get_use_size() const
{
return gtk_font_button_get_use_size(const_cast<GtkFontButton*>(gobj()));
}
void FontButton::set_use_size(bool use_size)
{
gtk_font_button_set_use_size(gobj(), static_cast<int>(use_size));
}
Glib::ustring FontButton::get_font_name() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_font_name(const_cast<GtkFontButton*>(gobj())));
}
bool FontButton::set_font_name(const Glib::ustring& fontname)
{
return gtk_font_button_set_font_name(gobj(), fontname.c_str());
}
bool FontButton::get_show_style() const
{
return gtk_font_button_get_show_style(const_cast<GtkFontButton*>(gobj()));
}
void FontButton::set_show_style(bool show_style)
{
gtk_font_button_set_show_style(gobj(), static_cast<int>(show_style));
}
bool FontButton::get_show_size() const
{
return gtk_font_button_get_show_size(const_cast<GtkFontButton*>(gobj()));
}
void FontButton::set_show_size(bool show_size)
{
gtk_font_button_set_show_size(gobj(), static_cast<int>(show_size));
}
Glib::SignalProxy0< void > FontButton::signal_font_set()
{
return Glib::SignalProxy0< void >(this, &FontButton_signal_font_set_info);
}
Glib::PropertyProxy< Glib::ustring > FontButton::property_title()
{
return Glib::PropertyProxy< Glib::ustring >(this, "title");
}
Glib::PropertyProxy_ReadOnly< Glib::ustring > FontButton::property_title() const
{
return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "title");
}
Glib::PropertyProxy< Glib::ustring > FontButton::property_font_name()
{
return Glib::PropertyProxy< Glib::ustring >(this, "font-name");
}
Glib::PropertyProxy_ReadOnly< Glib::ustring > FontButton::property_font_name() const
{
return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "font-name");
}
Glib::PropertyProxy< bool > FontButton::property_use_font()
{
return Glib::PropertyProxy< bool >(this, "use-font");
}
Glib::PropertyProxy_ReadOnly< bool > FontButton::property_use_font() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "use-font");
}
Glib::PropertyProxy< bool > FontButton::property_use_size()
{
return Glib::PropertyProxy< bool >(this, "use-size");
}
Glib::PropertyProxy_ReadOnly< bool > FontButton::property_use_size() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "use-size");
}
Glib::PropertyProxy< bool > FontButton::property_show_style()
{
return Glib::PropertyProxy< bool >(this, "show-style");
}
Glib::PropertyProxy_ReadOnly< bool > FontButton::property_show_style() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "show-style");
}
Glib::PropertyProxy< bool > FontButton::property_show_size()
{
return Glib::PropertyProxy< bool >(this, "show-size");
}
Glib::PropertyProxy_ReadOnly< bool > FontButton::property_show_size() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "show-size");
}
void Gtk::FontButton::on_font_set()
{
BaseClassType *const base = static_cast<BaseClassType*>(
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
);
if(base && base->font_set)
(*base->font_set)(gobj());
}
} // namespace Gtk