// Generated by gtkmmproc -- DO NOT MODIFY! #include #include #include // -*- c++ -*- /* $Id$ */ /* * * Copyright 1998-1999 The Gtk-- Development Team * Copyright 2001 Free Software Foundation * * 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. */ namespace Pango { Glib::ArrayHandle Coverage::to_bytes() const { guchar* bytes = 0; int n_bytes = 0; pango_coverage_to_bytes(const_cast(gobj()), &bytes, &n_bytes); return Glib::ArrayHandle(bytes, n_bytes, Glib::OWNERSHIP_SHALLOW); } } /* namespace Pango */ namespace { } // anonymous namespace // static GType Glib::Value::value_type() { return pango_coverage_level_get_type(); } /* Why reinterpret_cast(gobject) is needed: * * A Coverage instance is in fact always a PangoCoverage instance. * Unfortunately, PangoCoverage cannot be a member of Coverage, * because it is an opaque struct. Also, the C interface does not provide * any hooks to install a destroy notification handler, thus we cannot * wrap it dynamically either. * * The cast works because Coverage does not have any member data, and * it is impossible to derive from it. This is ensured by not implementing * the (protected) default constructor. The ctor is protected rather than * private just to avoid a compile warning. */ namespace Glib { Glib::RefPtr wrap(PangoCoverage* object, bool take_copy) { if(take_copy && object) pango_coverage_ref(object); // See the comment at the top of this file, if you want to know why the cast works. return Glib::RefPtr(reinterpret_cast(object)); } } // namespace Glib namespace Pango { // static Glib::RefPtr Coverage::create() { // See the comment at the top of this file, if you want to know why the cast works. return Glib::RefPtr(reinterpret_cast(pango_coverage_new())); } void Coverage::reference() const { // See the comment at the top of this file, if you want to know why the cast works. pango_coverage_ref(reinterpret_cast(const_cast(this))); } void Coverage::unreference() const { // See the comment at the top of this file, if you want to know why the cast works. pango_coverage_unref(reinterpret_cast(const_cast(this))); } PangoCoverage* Coverage::gobj() { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } const PangoCoverage* Coverage::gobj() const { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } PangoCoverage* Coverage::gobj_copy() const { // See the comment at the top of this file, if you want to know why the cast works. PangoCoverage *const gobject = reinterpret_cast(const_cast(this)); pango_coverage_ref(gobject); return gobject; } Glib::RefPtr Coverage::create(const guchar* bytes, int n_bytes) { return Glib::wrap(pango_coverage_from_bytes(const_cast(bytes), n_bytes)); } CoverageLevel Coverage::get(int index) const { return ((CoverageLevel)(pango_coverage_get(const_cast(gobj()), index))); } void Coverage::set(int index, CoverageLevel level) { pango_coverage_set(gobj(), index, ((PangoCoverageLevel)(level))); } void Coverage::max(const Glib::RefPtr& other) const { pango_coverage_max(const_cast(gobj()), Glib::unwrap(other)); } } // namespace Pango