Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-style.c File Reference

The definition of the CRStyle class. More...

#include <string.h>
#include "cr-style.h"

Go to the source code of this file.

Data Structures

struct  _CRPropertyDesc
struct  CRPropDisplayValPair
struct  CRPropPositionValPair

Typedefs

typedef _CRPropertyDesc CRPropertyDesc

Enumerations

enum  CRPropertyID {
  PROP_ID_NOT_KNOWN = 0, PROP_ID_PADDING_TOP, PROP_ID_PADDING_RIGHT, PROP_ID_PADDING_BOTTOM,
  PROP_ID_PADDING_LEFT, PROP_ID_PADDING, PROP_ID_BORDER_TOP_WIDTH, PROP_ID_BORDER_RIGHT_WIDTH,
  PROP_ID_BORDER_BOTTOM_WIDTH, PROP_ID_BORDER_LEFT_WIDTH, PROP_ID_BORDER_TOP_STYLE, PROP_ID_BORDER_RIGHT_STYLE,
  PROP_ID_BORDER_BOTTOM_STYLE, PROP_ID_BORDER_LEFT_STYLE, PROP_ID_BORDER_TOP_COLOR, PROP_ID_BORDER_RIGHT_COLOR,
  PROP_ID_BORDER_BOTTOM_COLOR, PROP_ID_BORDER_LEFT_COLOR, PROP_ID_BORDER_TOP, PROP_ID_BORDER_RIGHT,
  PROP_ID_BORDER_BOTTOM, PROP_ID_BORDER_LEFT, PROP_ID_BORDER, PROP_ID_MARGIN_TOP,
  PROP_ID_MARGIN_RIGHT, PROP_ID_MARGIN_BOTTOM, PROP_ID_MARGIN_LEFT, PROP_ID_MARGIN,
  PROP_ID_DISPLAY, PROP_ID_POSITION, PROP_ID_TOP, PROP_ID_RIGHT,
  PROP_ID_BOTTOM, PROP_ID_LEFT, PROP_ID_FLOAT, PROP_ID_WIDTH,
  PROP_ID_COLOR, PROP_ID_BACKGROUND_COLOR, PROP_ID_FONT_FAMILY, PROP_ID_FONT_SIZE,
  PROP_ID_FONT_STYLE, PROP_ID_FONT_WEIGHT, NB_PROP_IDS
}
 A property ID. More...

enum  CRDirection {
  DIR_TOP = 0, DIR_RIGHT, DIR_BOTTOM, DIR_LEFT,
  NB_DIRS
}

Functions

CRStylecr_style_new (void)
 Default constructor of CRStyle.

enum CRStatus cr_style_set_style_from_decl (CRStyle *a_this, CRDeclaration *a_decl)
 Walks through a css2 property declaration, and populated the according field(s) in the CRStyle structure.

enum CRStatus cr_style_ref (CRStyle *a_this)
 Increases the reference count of the current instance of CRStyle.

gboolean cr_style_unref (CRStyle *a_this)
 Decreases the reference count of the current instance of CRStyle.

CRStylecr_style_dup (CRStyle *a_this)
 Duplicates the current instance of CRStyle .

enum CRStatus cr_style_to_pango_font_attributes (CRStyle *a_style, PangoAttrList *a_pgo_attrs, gulong a_text_len)
void cr_style_destroy (CRStyle *a_this)
 Destructor of the CRStyle class.


Variables

const gulong gv_predefined_abs_font_size_tab [NB_PREDEFINED_ABSOLUTE_FONT_SIZES]


Detailed Description

The definition of the CRStyle class.

Definition in file cr-style.c.


Typedef Documentation

typedef struct _CRPropertyDesc CRPropertyDesc
 

Definition at line 94 of file cr-style.c.


Enumeration Type Documentation

enum CRDirection
 

Enumeration values:
DIR_TOP 
DIR_RIGHT 
DIR_BOTTOM 
DIR_LEFT 
NB_DIRS 

Definition at line 178 of file cr-style.c.

enum CRPropertyID
 

A property ID.

Each supported css property has an ID which is an entry into a property "population" jump table. each entry of the property population jump table contains code to tranform the literal form of a property value into a strongly typed value.

Enumeration values:
PROP_ID_NOT_KNOWN 
PROP_ID_PADDING_TOP 
PROP_ID_PADDING_RIGHT 
PROP_ID_PADDING_BOTTOM 
PROP_ID_PADDING_LEFT 
PROP_ID_PADDING 
PROP_ID_BORDER_TOP_WIDTH 
PROP_ID_BORDER_RIGHT_WIDTH 
PROP_ID_BORDER_BOTTOM_WIDTH 
PROP_ID_BORDER_LEFT_WIDTH 
PROP_ID_BORDER_TOP_STYLE 
PROP_ID_BORDER_RIGHT_STYLE 
PROP_ID_BORDER_BOTTOM_STYLE 
PROP_ID_BORDER_LEFT_STYLE 
PROP_ID_BORDER_TOP_COLOR 
PROP_ID_BORDER_RIGHT_COLOR 
PROP_ID_BORDER_BOTTOM_COLOR 
PROP_ID_BORDER_LEFT_COLOR 
PROP_ID_BORDER_TOP 
PROP_ID_BORDER_RIGHT 
PROP_ID_BORDER_BOTTOM 
PROP_ID_BORDER_LEFT 
PROP_ID_BORDER 
PROP_ID_MARGIN_TOP 
PROP_ID_MARGIN_RIGHT 
PROP_ID_MARGIN_BOTTOM 
PROP_ID_MARGIN_LEFT 
PROP_ID_MARGIN 
PROP_ID_DISPLAY 
PROP_ID_POSITION 
PROP_ID_TOP 
PROP_ID_RIGHT 
PROP_ID_BOTTOM 
PROP_ID_LEFT 
PROP_ID_FLOAT 
PROP_ID_WIDTH 
PROP_ID_COLOR 
PROP_ID_BACKGROUND_COLOR 
PROP_ID_FONT_FAMILY 
PROP_ID_FONT_SIZE 
PROP_ID_FONT_STYLE 
PROP_ID_FONT_WEIGHT 
NB_PROP_IDS 

Definition at line 45 of file cr-style.c.

Referenced by cr_style_set_style_from_decl().


Function Documentation

void cr_style_destroy CRStyle a_this  ) 
 

Destructor of the CRStyle class.

Parameters:
a_this the instance to destroy.

Definition at line 2396 of file cr-style.c.

Referenced by cr_style_unref().

CRStyle* cr_style_dup CRStyle a_this  ) 
 

Duplicates the current instance of CRStyle .

The newly created instance of CRStyle must be freed using cr_style_destroy ().

Parameters:
a_this the current instance of CRStyle.
Returns:
the newly duplicated instance of CRStyle.

Definition at line 2171 of file cr-style.c.

References cr_style_new(), cr_utils_trace_info, and CRStyle.

CRStyle* cr_style_new void   ) 
 

Default constructor of CRStyle.

Definition at line 1844 of file cr-style.c.

References cr_utils_trace_info, and CRStyle.

Referenced by cr_sel_eng_get_matched_style(), and cr_style_dup().

enum CRStatus cr_style_ref CRStyle a_this  ) 
 

Increases the reference count of the current instance of CRStyle.

Parameters:
a_this the current instance of CRStyle.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 2127 of file cr-style.c.

References CR_BAD_PARAM_ERROR, and CR_OK.

enum CRStatus cr_style_set_style_from_decl CRStyle a_this,
CRDeclaration a_decl
 

Walks through a css2 property declaration, and populated the according field(s) in the CRStyle structure.

If the properties or their value(s) are/is not known, sets the corresponding field(s) of CRStyle to its/their default value(s)

Parameters:
a_this the instance of CRStyle to set.
a_decl the declaration from which the CRStyle fields are set.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 1875 of file cr-style.c.

References CR_BAD_PARAM_ERROR, CR_OK, CR_UNKNOWN_TYPE_ERROR, CRPropertyID, CRStatus, DIR_BOTTOM, DIR_LEFT, DIR_RIGHT, DIR_TOP, PROP_ID_BACKGROUND_COLOR, PROP_ID_BORDER, PROP_ID_BORDER_BOTTOM, PROP_ID_BORDER_BOTTOM_COLOR, PROP_ID_BORDER_BOTTOM_STYLE, PROP_ID_BORDER_BOTTOM_WIDTH, PROP_ID_BORDER_LEFT, PROP_ID_BORDER_LEFT_COLOR, PROP_ID_BORDER_LEFT_STYLE, PROP_ID_BORDER_LEFT_WIDTH, PROP_ID_BORDER_RIGHT, PROP_ID_BORDER_RIGHT_COLOR, PROP_ID_BORDER_RIGHT_STYLE, PROP_ID_BORDER_RIGHT_WIDTH, PROP_ID_BORDER_TOP, PROP_ID_BORDER_TOP_COLOR, PROP_ID_BORDER_TOP_STYLE, PROP_ID_BORDER_TOP_WIDTH, PROP_ID_BOTTOM, PROP_ID_COLOR, PROP_ID_DISPLAY, PROP_ID_FLOAT, PROP_ID_FONT_FAMILY, PROP_ID_FONT_SIZE, PROP_ID_FONT_STYLE, PROP_ID_FONT_WEIGHT, PROP_ID_LEFT, PROP_ID_MARGIN, PROP_ID_MARGIN_BOTTOM, PROP_ID_MARGIN_LEFT, PROP_ID_MARGIN_RIGHT, PROP_ID_MARGIN_TOP, PROP_ID_NOT_KNOWN, PROP_ID_PADDING, PROP_ID_PADDING_BOTTOM, PROP_ID_PADDING_LEFT, PROP_ID_PADDING_RIGHT, PROP_ID_PADDING_TOP, PROP_ID_POSITION, PROP_ID_RIGHT, PROP_ID_TOP, PROP_ID_WIDTH, and _CRDeclaration::property.

enum CRStatus cr_style_to_pango_font_attributes CRStyle a_style,
PangoAttrList *  a_pgo_attrs,
gulong  a_text_len
 

Definition at line 2190 of file cr-style.c.

References ABSOLUTE_FONT_SIZE, CR_BAD_PARAM_ERROR, CR_ERROR, cr_font_family_to_string(), CR_INSTANCIATION_FAILED_ERROR, CR_OK, CR_OUT_OF_BOUNDS_ERROR, cr_utils_trace_info, CRStatus, FONT_STYLE_INHERIT, FONT_STYLE_ITALIC, FONT_STYLE_NORMAL, FONT_STYLE_OBLIQUE, FONT_WEIGHT_100, FONT_WEIGHT_200, FONT_WEIGHT_300, FONT_WEIGHT_400, FONT_WEIGHT_500, FONT_WEIGHT_600, FONT_WEIGHT_700, FONT_WEIGHT_800, FONT_WEIGHT_900, FONT_WEIGHT_BOLD, FONT_WEIGHT_BOLDER, FONT_WEIGHT_INHERIT, FONT_WEIGHT_LIGHTER, FONT_WEIGHT_NORMAL, gv_predefined_abs_font_size_tab, INHERITED_FONT_SIZE, NB_PREDEFINED_ABSOLUTE_FONT_SIZES, PREDEFINED_ABSOLUTE_FONT_SIZE, and RELATIVE_FONT_SIZE.

gboolean cr_style_unref CRStyle a_this  ) 
 

Decreases the reference count of the current instance of CRStyle.

If the reference count reaches 0, the instance of CRStyle is destoyed.

Parameters:
a_this the current instance of CRStyle.
Returns:
TRUE if the instance has been destroyed, FALSE otherwise.

Definition at line 2146 of file cr-style.c.

References cr_style_destroy().

Referenced by cr_box_destroy().


Variable Documentation

const gulong gv_predefined_abs_font_size_tab[NB_PREDEFINED_ABSOLUTE_FONT_SIZES]
 

Initial value:

{
        7, 
        9,
        11, 
        14, 
        17, 
        20, 
        24         
}

Definition at line 147 of file cr-style.c.

Referenced by cr_style_to_pango_font_attributes().


Generated on Wed Oct 1 01:36:52 2003 for Libcroco by doxygen 1.3.3