Blame gettext-tools/gnulib-lib/libcroco/cr-fonts.h

Packit Bot 06c835
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
Packit Bot 06c835
Packit Bot 06c835
/*
Packit Bot 06c835
 * This file is part of The Croco Library
Packit Bot 06c835
 *
Packit Bot 06c835
 * This program is free software; you can redistribute it and/or
Packit Bot 06c835
 * modify it under the terms of version 3 of 
Packit Bot 06c835
 * the GNU General Public
Packit Bot 06c835
 * License as published by the Free Software Foundation.
Packit Bot 06c835
 *
Packit Bot 06c835
 * This program is distributed in the hope that it will be useful,
Packit Bot 06c835
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 06c835
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Bot 06c835
 * GNU General Public License for more details.
Packit Bot 06c835
 *
Packit Bot 06c835
 * You should have received a copy of the 
Packit Bot 06c835
 * GNU General Public License
Packit Bot 06c835
 * along with this program; if not, write to the Free Software
Packit Bot 06c835
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
Packit Bot 06c835
 * USA
Packit Bot 06c835
 *
Packit Bot 06c835
 * Author: Dodji Seketeli
Packit Bot 06c835
 * See COPYRIGHTS file for copyright information.
Packit Bot 06c835
 */
Packit Bot 06c835
Packit Bot 06c835
#ifndef __CR_FONTS_H__
Packit Bot 06c835
#define __CR_FONTS_H__
Packit Bot 06c835
Packit Bot 06c835
#include "cr-utils.h"
Packit Bot 06c835
#include "cr-num.h"
Packit Bot 06c835
Packit Bot 06c835
/**
Packit Bot 06c835
 *@file
Packit Bot 06c835
 *Various type declarations about font selection related
Packit Bot 06c835
 *properties.
Packit Bot 06c835
 */
Packit Bot 06c835
G_BEGIN_DECLS
Packit Bot 06c835
Packit Bot 06c835
Packit Bot 06c835
enum CRFontFamilyType
Packit Bot 06c835
{
Packit Bot 06c835
	FONT_FAMILY_SANS_SERIF,
Packit Bot 06c835
	FONT_FAMILY_SERIF,	
Packit Bot 06c835
	FONT_FAMILY_CURSIVE,
Packit Bot 06c835
	FONT_FAMILY_FANTASY,
Packit Bot 06c835
	FONT_FAMILY_MONOSPACE,
Packit Bot 06c835
	FONT_FAMILY_NON_GENERIC,
Packit Bot 06c835
	FONT_FAMILY_INHERIT,
Packit Bot 06c835
	/**/
Packit Bot 06c835
	NB_FONT_FAMILIE_TYPES
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
typedef struct _CRFontFamily CRFontFamily ;
Packit Bot 06c835
Packit Bot 06c835
struct _CRFontFamily
Packit Bot 06c835
{
Packit Bot 06c835
	enum CRFontFamilyType type ;
Packit Bot 06c835
Packit Bot 06c835
	/*
Packit Bot 06c835
	 *The name of the font family, in case
Packit Bot 06c835
	 *it is non generic.
Packit Bot 06c835
	 *Is set only if the type is FONT_FAMILY_NON_GENERIC.
Packit Bot 06c835
	 */
Packit Bot 06c835
	guchar *name ;
Packit Bot 06c835
Packit Bot 06c835
	CRFontFamily *next ;
Packit Bot 06c835
	CRFontFamily *prev ;
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
Packit Bot 06c835
/**
Packit Bot 06c835
 *The different types
Packit Bot 06c835
 *of absolute font size.
Packit Bot 06c835
 *This is used by the 'font-size'
Packit Bot 06c835
 *property defined in css2 spec
Packit Bot 06c835
 *in chapter 15.2.4 .
Packit Bot 06c835
 *These values a indexes of 
Packit Bot 06c835
 *table of size so please, do not
Packit Bot 06c835
 *change their definition order unless
Packit Bot 06c835
 *you know what you are doing.
Packit Bot 06c835
 */
Packit Bot 06c835
enum CRPredefinedAbsoluteFontSize
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_SIZE_XX_SMALL=0,
Packit Bot 06c835
        FONT_SIZE_X_SMALL,
Packit Bot 06c835
        FONT_SIZE_SMALL,
Packit Bot 06c835
        FONT_SIZE_MEDIUM,
Packit Bot 06c835
        FONT_SIZE_LARGE,
Packit Bot 06c835
        FONT_SIZE_X_LARGE,
Packit Bot 06c835
        FONT_SIZE_XX_LARGE,
Packit Bot 06c835
	FONT_SIZE_INHERIT,
Packit Bot 06c835
        NB_PREDEFINED_ABSOLUTE_FONT_SIZES
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
/**
Packit Bot 06c835
 *The different types
Packit Bot 06c835
 *of relative font size.
Packit Bot 06c835
 *This is used by the 'font-size'
Packit Bot 06c835
 *property defined in css2 spec
Packit Bot 06c835
 *in chapter 15.2.4 .
Packit Bot 06c835
 *These values a indexes of 
Packit Bot 06c835
 *table of size so please, do not
Packit Bot 06c835
 *change their definition order unless
Packit Bot 06c835
 *you know what you are doing.
Packit Bot 06c835
 */
Packit Bot 06c835
enum CRRelativeFontSize
Packit Bot 06c835
{        
Packit Bot 06c835
        FONT_SIZE_LARGER,
Packit Bot 06c835
        FONT_SIZE_SMALLER,
Packit Bot 06c835
        NB_RELATIVE_FONT_SIZE
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
/**
Packit Bot 06c835
 *The type of font-size property.
Packit Bot 06c835
 *Used to define the type of #CRFontSize .
Packit Bot 06c835
 *See css2 spec chapter 15.2.4 to understand.
Packit Bot 06c835
 */
Packit Bot 06c835
enum CRFontSizeType {
Packit Bot 06c835
        /**
Packit Bot 06c835
         *If the type of #CRFontSize is
Packit Bot 06c835
         *PREDEFINED_ABSOLUTE_FONT_SIZE,
Packit Bot 06c835
         *the CRFontSize::value.predefined_absolute 
Packit Bot 06c835
         *field will be defined.
Packit Bot 06c835
         */
Packit Bot 06c835
        PREDEFINED_ABSOLUTE_FONT_SIZE,
Packit Bot 06c835
        
Packit Bot 06c835
        /**
Packit Bot 06c835
         *If the type of #CRFontSize is
Packit Bot 06c835
         *ABSOLUTE_FONT_SIZE,
Packit Bot 06c835
         *the CRFontSize::value.absolute 
Packit Bot 06c835
         *field will be defined.
Packit Bot 06c835
         */
Packit Bot 06c835
        ABSOLUTE_FONT_SIZE,
Packit Bot 06c835
Packit Bot 06c835
        /**
Packit Bot 06c835
         *If the type of #CRFontSize is
Packit Bot 06c835
         *RELATIVE_FONT_SIZE,
Packit Bot 06c835
         *the CRFontSize::value.relative
Packit Bot 06c835
         *field will be defined.
Packit Bot 06c835
         */
Packit Bot 06c835
        RELATIVE_FONT_SIZE,
Packit Bot 06c835
Packit Bot 06c835
        /**
Packit Bot 06c835
         *If the type of #CRFontSize is
Packit Bot 06c835
         *INHERITED_FONT_SIZE,
Packit Bot 06c835
         *the None of the field of the CRFontSize::value enum
Packit Bot 06c835
         *will be defined.
Packit Bot 06c835
         */
Packit Bot 06c835
        INHERITED_FONT_SIZE,
Packit Bot 06c835
Packit Bot 06c835
        NB_FONT_SIZE_TYPE
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
typedef struct _CRFontSize CRFontSize ;
Packit Bot 06c835
struct _CRFontSize {
Packit Bot 06c835
        enum CRFontSizeType type ;
Packit Bot 06c835
        union  {
Packit Bot 06c835
                enum CRPredefinedAbsoluteFontSize predefined ;
Packit Bot 06c835
                enum CRRelativeFontSize relative ;
Packit Bot 06c835
                CRNum absolute ;
Packit Bot 06c835
        } value;
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontSizeAdjustType
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_SIZE_ADJUST_NONE = 0,
Packit Bot 06c835
        FONT_SIZE_ADJUST_NUMBER,
Packit Bot 06c835
        FONT_SIZE_ADJUST_INHERIT
Packit Bot 06c835
} ;
Packit Bot 06c835
typedef struct _CRFontSizeAdjust CRFontSizeAdjust ;
Packit Bot 06c835
struct _CRFontSizeAdjust
Packit Bot 06c835
{
Packit Bot 06c835
        enum CRFontSizeAdjustType type ;
Packit Bot 06c835
        CRNum *num ;
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontStyle
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_STYLE_NORMAL=0,
Packit Bot 06c835
        FONT_STYLE_ITALIC,
Packit Bot 06c835
        FONT_STYLE_OBLIQUE,
Packit Bot 06c835
        FONT_STYLE_INHERIT
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontVariant
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_VARIANT_NORMAL=0,
Packit Bot 06c835
        FONT_VARIANT_SMALL_CAPS,
Packit Bot 06c835
        FONT_VARIANT_INHERIT
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontWeight
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_WEIGHT_NORMAL = 1,
Packit Bot 06c835
        FONT_WEIGHT_BOLD = 1<<1,
Packit Bot 06c835
        FONT_WEIGHT_BOLDER = 1<<2,
Packit Bot 06c835
        FONT_WEIGHT_LIGHTER = 1<<3,
Packit Bot 06c835
        FONT_WEIGHT_100 = 1<<4,
Packit Bot 06c835
        FONT_WEIGHT_200 = 1<<5,
Packit Bot 06c835
        FONT_WEIGHT_300 = 1<<6,
Packit Bot 06c835
        FONT_WEIGHT_400 = 1<<7,
Packit Bot 06c835
        FONT_WEIGHT_500 = 1<<8,
Packit Bot 06c835
        FONT_WEIGHT_600 = 1<<9,
Packit Bot 06c835
        FONT_WEIGHT_700 = 1<<10,
Packit Bot 06c835
        FONT_WEIGHT_800 = 1<<11,
Packit Bot 06c835
        FONT_WEIGHT_900 = 1<<12,
Packit Bot 06c835
        FONT_WEIGHT_INHERIT = 1<<13,
Packit Bot 06c835
        NB_FONT_WEIGHTS
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontStretch
Packit Bot 06c835
{
Packit Bot 06c835
        FONT_STRETCH_NORMAL=0,
Packit Bot 06c835
        FONT_STRETCH_WIDER,
Packit Bot 06c835
        FONT_STRETCH_NARROWER,
Packit Bot 06c835
        FONT_STRETCH_ULTRA_CONDENSED,
Packit Bot 06c835
        FONT_STRETCH_EXTRA_CONDENSED,
Packit Bot 06c835
        FONT_STRETCH_CONDENSED,
Packit Bot 06c835
        FONT_STRETCH_SEMI_CONDENSED,
Packit Bot 06c835
        FONT_STRETCH_SEMI_EXPANDED,
Packit Bot 06c835
        FONT_STRETCH_EXPANDED,
Packit Bot 06c835
        FONT_STRETCH_EXTRA_EXPANDED,
Packit Bot 06c835
        FONT_STRETCH_ULTRA_EXPANDED,
Packit Bot 06c835
        FONT_STRETCH_INHERIT
Packit Bot 06c835
} ;
Packit Bot 06c835
Packit Bot 06c835
/**************************************
Packit Bot 06c835
 *'font-family' manipulation functions
Packit Bot 06c835
 ***************************************/
Packit Bot 06c835
CRFontFamily *
Packit Bot 06c835
cr_font_family_new (enum CRFontFamilyType a_type, guchar *a_name) ;
Packit Bot 06c835
Packit Bot 06c835
CRFontFamily *
Packit Bot 06c835
cr_font_family_append (CRFontFamily *a_this, 
Packit Bot 06c835
		       CRFontFamily *a_family_to_append) ;
Packit Bot 06c835
Packit Bot 06c835
guchar *
Packit Bot 06c835
cr_font_family_to_string (CRFontFamily *a_this,
Packit Bot 06c835
                          gboolean a_walk_font_family_list) ;
Packit Bot 06c835
Packit Bot 06c835
CRFontFamily *
Packit Bot 06c835
cr_font_family_prepend (CRFontFamily *a_this, 
Packit Bot 06c835
			CRFontFamily *a_family_to_prepend);
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus
Packit Bot 06c835
cr_font_family_destroy (CRFontFamily *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus
Packit Bot 06c835
cr_font_family_set_name (CRFontFamily *a_this, guchar *a_name) ;
Packit Bot 06c835
Packit Bot 06c835
Packit Bot 06c835
/************************************
Packit Bot 06c835
 *'font-size' manipulation functions
Packit Bot 06c835
 ***********************************/
Packit Bot 06c835
Packit Bot 06c835
CRFontSize * cr_font_size_new (void) ;
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus cr_font_size_clear (CRFontSize *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus cr_font_size_copy (CRFontSize *a_dst, 
Packit Bot 06c835
                                 CRFontSize *a_src) ;
Packit Bot 06c835
enum CRStatus cr_font_size_set_predefined_absolute_font_size (CRFontSize *a_this, 
Packit Bot 06c835
                                                              enum CRPredefinedAbsoluteFontSize a_predefined) ;
Packit Bot 06c835
enum CRStatus cr_font_size_set_relative_font_size (CRFontSize *a_this,
Packit Bot 06c835
                                                   enum CRRelativeFontSize a_relative) ;
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus cr_font_size_set_absolute_font_size (CRFontSize *a_this,
Packit Bot 06c835
                                                   enum CRNumType a_num_type,
Packit Bot 06c835
                                                   gdouble a_value) ;
Packit Bot 06c835
Packit Bot 06c835
enum CRStatus cr_font_size_set_to_inherit (CRFontSize *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
gboolean cr_font_size_is_set_to_inherit (CRFontSize *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
gchar* cr_font_size_to_string (CRFontSize *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
void cr_font_size_destroy (CRFontSize *a_font_size) ;
Packit Bot 06c835
Packit Bot 06c835
/*******************************************************
Packit Bot 06c835
 *'font-size-adjust' manipulation function declarations
Packit Bot 06c835
 *******************************************************/
Packit Bot 06c835
Packit Bot 06c835
CRFontSizeAdjust * cr_font_size_adjust_new (void) ;
Packit Bot 06c835
Packit Bot 06c835
gchar * cr_font_size_adjust_to_string (CRFontSizeAdjust *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
void cr_font_size_adjust_destroy (CRFontSizeAdjust *a_this) ;
Packit Bot 06c835
Packit Bot 06c835
void 
Packit Bot 06c835
cr_font_size_get_smaller_predefined_font_size (enum CRPredefinedAbsoluteFontSize a_font_size,
Packit Bot 06c835
                                               enum CRPredefinedAbsoluteFontSize *a_smaller_size) ;
Packit Bot 06c835
void
Packit Bot 06c835
cr_font_size_get_larger_predefined_font_size (enum CRPredefinedAbsoluteFontSize a_font_size,
Packit Bot 06c835
                                              enum CRPredefinedAbsoluteFontSize *a_larger_size) ;
Packit Bot 06c835
Packit Bot 06c835
gboolean
Packit Bot 06c835
cr_font_size_is_predefined_absolute_font_size (enum CRPredefinedAbsoluteFontSize a_font_size) ;
Packit Bot 06c835
Packit Bot 06c835
/***********************************
Packit Bot 06c835
 *various other font related functions
Packit Bot 06c835
 ***********************************/
Packit Bot 06c835
const gchar * cr_font_style_to_string (enum CRFontStyle a_code) ;
Packit Bot 06c835
Packit Bot 06c835
const gchar * cr_font_weight_to_string (enum CRFontWeight a_code)  ;
Packit Bot 06c835
Packit Bot 06c835
enum CRFontWeight
Packit Bot 06c835
cr_font_weight_get_bolder (enum CRFontWeight a_weight) ;
Packit Bot 06c835
Packit Bot 06c835
const gchar * cr_font_variant_to_string (enum CRFontVariant a_code) ;
Packit Bot 06c835
Packit Bot 06c835
const gchar * cr_font_stretch_to_string (enum CRFontStretch a_code) ;
Packit Bot 06c835
Packit Bot 06c835
G_END_DECLS
Packit Bot 06c835
Packit Bot 06c835
#endif /* __CR_FONTS_H__ */