Blame pango/src/fontdescription.hg

Packit 78284e
/* $Id: fontdescription.hg,v 1.2 2006/06/08 20:39:39 murrayc Exp $ */
Packit 78284e
Packit 78284e
/* fontdescription.h
Packit 78284e
 *
Packit 78284e
 * Copyright (C) 1998-2002 The gtkmm Development Team
Packit 78284e
 *
Packit 78284e
 * This library is free software; you can redistribute it and/or
Packit 78284e
 * modify it under the terms of the GNU Lesser General Public
Packit 78284e
 * License as published by the Free Software Foundation; either
Packit 78284e
 * version 2.1 of the License, or (at your option) any later version.
Packit 78284e
 *
Packit 78284e
 * This library is distributed in the hope that it will be useful,
Packit 78284e
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 78284e
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 78284e
 * Lesser General Public License for more details.
Packit 78284e
 *
Packit 78284e
 * You should have received a copy of the GNU Lesser General Public
Packit 78284e
 * License along with this library; if not, write to the Free
Packit 78284e
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit 78284e
 */
Packit 78284e
Packit 78284e
#include <glibmm/value.h>
Packit 78284e
#include <pango/pango-font.h>
Packit 78284e
Packit 78284e
_DEFS(pangomm,pango)
Packit 78284e
Packit 78284e
namespace Pango
Packit 78284e
{
Packit 78284e
Packit 78284e
_CC_INCLUDE(pango/pango-enum-types.h)
Packit 78284e
_WRAP_ENUM(Style, PangoStyle)
Packit 78284e
_WRAP_ENUM(Variant, PangoVariant)
Packit 78284e
_WRAP_ENUM(Stretch, PangoStretch)
Packit 78284e
_WRAP_ENUM(Weight, PangoWeight)
Packit 78284e
_WRAP_ENUM(FontMask, PangoFontMask)
Packit 78284e
_WRAP_ENUM(Gravity, PangoGravity)
Packit 78284e
Packit 78284e
/** A Pango::FontDescription represents the description of an ideal font.
Packit 78284e
 * It is used both to list what fonts are available on the system and also for specifying the characteristics of a font to load.
Packit 78284e
 */
Packit 78284e
class FontDescription
Packit 78284e
{
Packit 78284e
  _CLASS_BOXEDTYPE(FontDescription, PangoFontDescription, pango_font_description_new, pango_font_description_copy, pango_font_description_free)
Packit 78284e
  _IGNORE(pango_font_description_free, pango_font_description_copy, pango_font_description_copy_static, pango_font_description_equal)
Packit 78284e
Packit 78284e
  /* These functions are dangerous! The first casts the "const" from the parameter away
Packit 78284e
   * copying the pointer and keep it hanging around.
Packit 78284e
   * So desc.set_family_static("some_family") would lead to a segfault.
Packit 78284e
   * The latter makes a shallow copy of the parameter's "family" data member.
Packit 78284e
   * So if the FontDescription you passed in dies, a pointer to its (deleted)
Packit 78284e
   * family data member still hangs around!
Packit 78284e
   * This is why we can't wrap these functions!
Packit 78284e
   */
Packit 78284e
  _IGNORE(pango_font_description_set_family_static, pango_font_description_merge_static)
Packit 78284e
Packit 78284e
public:
Packit 78284e
  /** Constructs a font description from a string representation.
Packit 78284e
   * @a font_name must have the form
Packit 78284e
   * "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated
Packit 78284e
   * list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace
Packit 78284e
   * separated list of words where each WORD describes one of style, variant, weight,
Packit 78284e
   * or stretch, and SIZE is an decimal number (size in points). Any one of the
Packit 78284e
   * options may be absent. If FAMILY-LIST is absent, then the family_name field
Packit 78284e
   * of the resulting font description will be initialized to 0. If STYLE-OPTIONS
Packit 78284e
   * is missing, then all style options will be set to the default values. If SIZE
Packit 78284e
   * is missing, the size in the resulting font description will be set to 0.
Packit 78284e
   * @param font_name String representation of a font description.
Packit 78284e
   */
Packit 78284e
  explicit FontDescription(const Glib::ustring& font_name);
Packit 78284e
Packit 78284e
  _WRAP_METHOD(guint hash() const, pango_font_description_hash)
Packit 78284e
  _WRAP_METHOD(void set_family(const Glib::ustring& family), pango_font_description_set_family)
Packit 78284e
  _WRAP_METHOD(Glib::ustring get_family() const, pango_font_description_get_family)
Packit 78284e
  _WRAP_METHOD(void set_style(Style style), pango_font_description_set_style)
Packit 78284e
  _WRAP_METHOD(Style get_style() const, pango_font_description_get_style)
Packit 78284e
  _WRAP_METHOD(void set_variant(Variant variant),pango_font_description_set_variant)
Packit 78284e
  _WRAP_METHOD(Variant get_variant() const, pango_font_description_get_variant)
Packit 78284e
  _WRAP_METHOD(void set_weight(Weight weight), pango_font_description_set_weight)
Packit 78284e
  _WRAP_METHOD(Weight get_weight() const, pango_font_description_get_weight)
Packit 78284e
  _WRAP_METHOD(void set_stretch(Stretch stretch), pango_font_description_set_stretch)
Packit 78284e
  _WRAP_METHOD(Stretch get_stretch() const, pango_font_description_get_stretch)
Packit 78284e
  _WRAP_METHOD(void set_size(int size), pango_font_description_set_size)
Packit 78284e
  _WRAP_METHOD(int get_size() const, pango_font_description_get_size)
Packit 78284e
  _WRAP_METHOD(void set_absolute_size(double size), pango_font_description_set_absolute_size)
Packit 78284e
  _WRAP_METHOD(bool get_size_is_absolute() const, pango_font_description_get_size_is_absolute)
Packit 78284e
  _WRAP_METHOD(void set_gravity(Gravity gravity), pango_font_description_set_gravity)
Packit 78284e
  _WRAP_METHOD(Gravity get_gravity() const, pango_font_description_get_gravity)
Packit 78284e
  _WRAP_METHOD(FontMask get_set_fields() const, pango_font_description_get_set_fields)
Packit 78284e
  _WRAP_METHOD(void unset_fields(FontMask to_unset), pango_font_description_unset_fields)
Packit 78284e
  _WRAP_METHOD(void merge(const FontDescription& desc_to_merge, bool replace_existing), pango_font_description_merge)
Packit 78284e
  _WRAP_METHOD(bool better_match(const FontDescription& old_match, const FontDescription& new_match) const, pango_font_description_better_match)
Packit 78284e
  _WRAP_METHOD(Glib::ustring to_string() const, pango_font_description_to_string)
Packit 78284e
  _WRAP_METHOD(Glib::ustring to_filename() const, pango_font_description_to_filename)
Packit 78284e
Packit 78284e
#m4begin
Packit 78284e
  _WRAP_EQUAL(pango_font_description_equal)
Packit 78284e
#m4end
Packit 78284e
};
Packit 78284e
Packit 78284e
} //namespace Pango
Packit 78284e