cr-style.h revision cc34471355d340f13c2745632cc3e986791e8064
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
/*
* This file is part of The Croco Library
*
*
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Author: Dodji Seketeli.
* See COPYRIGHTS file for copyright information.
*/
#ifndef __CR_STYLE_H__
#define __CR_STYLE_H__
#include "cr-utils.h"
#include "cr-statement.h"
#include "cr-fonts.h"
/**
*@file
*The declaration of the #CRStyle class.
*/
enum CRBorderStyle
{
BORDER_STYLE_NONE = 0,
} ;
enum CRDisplayType
{
} ;
enum CRPositionType
{
} ;
enum CRFloatType
{
} ;
enum CRWhiteSpaceType
{
} ;
#define BORDER_THIN 2
#define BORDER_MEDIUM 4
#define BORDER_THICK 6
/**
*A numerical css property value.
*This data type is actually split in 3 parts:
*1/the specified value
*2/the computed value
*3/the actual value.
*To understand the semantic of these three parts,
*see css2 spec chap 6.1 ("Specified, computed and actual values.").
*/
typedef struct _CRNumPropVal CRNumPropVal ;
struct _CRNumPropVal
{
/**specified value*/
/**computed value*/
/**actual value*/
} ;
/**
*An rgb css property value.
*This data type is actually split in 3 parts:
*1/the specified value
*2/the computed value
*3/the actual value.
*To understand the semantic of these three parts,
*see css2 spec chap 6.1 ("Specified, computed and actual values.").
*/
typedef struct _CRRgbPropVal CRRgbPropVal ;
struct _CRRgbPropVal
{
/**specified value*/
/**computed value*/
/**actual value*/
} ;
enum CRNumProp
{
NUM_PROP_TOP=0,
NUM_PROP_LEFT,/*3*/
NUM_PROP_PADDING_LEFT,/*7*/
NUM_PROP_BORDER_LEFT,/*11*/
NUM_PROP_MARGIN_LEFT,/*15*/
/*must be last*/
} ;
enum CRRgbProp
{
/*must be last*/
} ;
enum CRBorderStyleProp
{
/*must be last*/
} ;
enum CRBoxOffsetProp
{
BOX_OFFSET_PROP_TOP = 0,
/*must be last*/
} ;
typedef struct _CRFontSizeVal CRFontSizeVal ;
struct _CRFontSizeVal {
/*specified value*/
CRFontSize sv ;
/*computed value*/
CRFontSize cv ;
/*actual value*/
CRFontSize av ;
} ;
/**
*The css2 style class.
*Contains computed and actual values
*inferred from the declarations found
*in the stylesheets.
*See css2 spec chapter 6.
*/
struct _CRStyle
{
/**
*numerical properties.
*the properties are indexed by
*enum #CRNumProp.
*/
/**
*color properties.
*They are indexed by enum #CRRgbProp .
*/
/**
*border style properties.
*They are indexed by enum #CRBorderStyleProp .
*/
/**box display type*/
enum CRDisplayType display ;
/**the positioning scheme*/
enum CRPositionType position ;
/**the float property*/
enum CRFloatType float_type ;
/*
*the 'font-family' property.
*/
/**
*the 'font-size' property.
*/
enum CRFontStyle font_style ;
enum CRFontVariant font_variant ;
enum CRFontWeight font_weight ;
enum CRFontStretch font_stretch ;
/**
* the 'tex' properties
*/
enum CRWhiteSpaceType white_space;
} ;
guint a_nb_indent) ;
guint a_nb_indent) ;
guint a_nb_indent) ;
guint a_nb_indent) ;
guint a_nb_indent) ;
guint a_nb_indent) ;
CRDeclaration *a_decl) ;
guint a_nb_indent) ;
#endif /*__CR_STYLE_H__*/