13
0
livetrax/libs/gtkmm2/gtk/gtkmm/pagesetup.cc

278 lines
7.0 KiB
C++
Raw Normal View History

// Generated by gtkmmproc -- DO NOT MODIFY!
#include <gtkmm/pagesetup.h>
#include <gtkmm/private/pagesetup_p.h>
/* Copyright (C) 2006 The gtkmm Development Team
*
* 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.
*/
#include <gtk/gtkpagesetup.h>
#include <gtk/gtktypebuiltins.h>
namespace Gtk
{
void PageSetup::save_to_key_file(Glib::KeyFile& key_file)
{
gtk_page_setup_to_key_file(gobj(), (key_file).gobj(), 0);
}
} //namespace
namespace
{
} // anonymous namespace
namespace Glib
{
Glib::RefPtr<Gtk::PageSetup> wrap(GtkPageSetup* object, bool take_copy)
{
return Glib::RefPtr<Gtk::PageSetup>( dynamic_cast<Gtk::PageSetup*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
//We use dynamic_cast<> in case of multiple inheritance.
}
} /* namespace Glib */
namespace Gtk
{
/* The *_Class implementation: */
const Glib::Class& PageSetup_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_ = &PageSetup_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_page_setup_get_type());
// Add derived versions of interfaces, if the C type implements any interfaces:
}
return *this;
}
void PageSetup_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);
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
Glib::ObjectBase* PageSetup_Class::wrap_new(GObject* object)
{
return new PageSetup((GtkPageSetup*)object);
}
/* The implementation: */
GtkPageSetup* PageSetup::gobj_copy()
{
reference();
return gobj();
}
PageSetup::PageSetup(const Glib::ConstructParams& construct_params)
:
Glib::Object(construct_params)
{}
PageSetup::PageSetup(GtkPageSetup* castitem)
:
Glib::Object((GObject*)(castitem))
{}
PageSetup::~PageSetup()
{}
PageSetup::CppClassType PageSetup::pagesetup_class_; // initialize static member
GType PageSetup::get_type()
{
return pagesetup_class_.init().get_type();
}
GType PageSetup::get_base_type()
{
return gtk_page_setup_get_type();
}
PageSetup::PageSetup()
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(0),
Glib::Object(Glib::ConstructParams(pagesetup_class_.init()))
{
}
Glib::RefPtr<PageSetup> PageSetup::create()
{
return Glib::RefPtr<PageSetup>( new PageSetup() );
}
PageOrientation PageSetup::get_orientation() const
{
return (PageOrientation)gtk_page_setup_get_orientation(const_cast<GtkPageSetup*>(gobj()));
}
void PageSetup::set_orientation(PageOrientation orientation)
{
gtk_page_setup_set_orientation(gobj(), ((GtkPageOrientation)(orientation)));
}
PaperSize PageSetup::get_paper_size()
{
return Glib::wrap(gtk_page_setup_get_paper_size(gobj()), true);
}
const PaperSize PageSetup::get_paper_size() const
{
return const_cast<PageSetup*>(this)->get_paper_size();
}
void PageSetup::set_paper_size(const PaperSize& paper_size)
{
gtk_page_setup_set_paper_size(gobj(), const_cast<GtkPaperSize*>((paper_size).gobj()));
}
double PageSetup::get_top_margin(Unit unit) const
{
return gtk_page_setup_get_top_margin(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
void PageSetup::set_top_margin(double margin, Unit unit)
{
gtk_page_setup_set_top_margin(gobj(), margin, ((GtkUnit)(unit)));
}
double PageSetup::get_bottom_margin(Unit unit) const
{
return gtk_page_setup_get_bottom_margin(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
void PageSetup::set_bottom_margin(double margin, Unit unit)
{
gtk_page_setup_set_bottom_margin(gobj(), margin, ((GtkUnit)(unit)));
}
double PageSetup::get_left_margin(Unit unit) const
{
return gtk_page_setup_get_left_margin(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
void PageSetup::set_left_margin(double margin, Unit unit)
{
gtk_page_setup_set_left_margin(gobj(), margin, ((GtkUnit)(unit)));
}
double PageSetup::get_right_margin(Unit unit) const
{
return gtk_page_setup_get_right_margin(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
void PageSetup::set_right_margin(double margin, Unit unit)
{
gtk_page_setup_set_right_margin(gobj(), margin, ((GtkUnit)(unit)));
}
void PageSetup::set_paper_size_and_default_margins(const PaperSize& paper_size)
{
gtk_page_setup_set_paper_size_and_default_margins(gobj(), const_cast<GtkPaperSize*>((paper_size).gobj()));
}
double PageSetup::get_paper_width(Unit unit) const
{
return gtk_page_setup_get_paper_width(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
double PageSetup::get_paper_height(Unit unit) const
{
return gtk_page_setup_get_paper_height(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
double PageSetup::get_page_width(Unit unit) const
{
return gtk_page_setup_get_page_width(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
double PageSetup::get_page_height(Unit unit) const
{
return gtk_page_setup_get_page_height(const_cast<GtkPageSetup*>(gobj()), ((GtkUnit)(unit)));
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool PageSetup::save_to_file(const std::string& file_name) const
#else
bool PageSetup::save_to_file(const std::string& file_name, std::auto_ptr<Glib::Error>& error) const
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
bool retvalue = gtk_page_setup_to_file(const_cast<GtkPageSetup*>(gobj()), file_name.c_str(), &(gerror));
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
}
void PageSetup::save_to_key_file(Glib::KeyFile& key_file, const Glib::ustring& group_name)
{
gtk_page_setup_to_key_file(gobj(), (key_file).gobj(), group_name.c_str());
}
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED
} // namespace Gtk