/* -*- 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 COPYRIGTHS file for copyright information
*/
#include <string.h>
#include "cr-style.h"
/**
*@file
*The definition of the #CRStyle class.
*/
/**
*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 transform the literal form of
*a property value into a strongly typed value.
*/
enum CRPropertyID {
PROP_ID_NOT_KNOWN = 0,
/*should be the last one. */
};
struct _CRPropertyDesc {
};
{"padding-top", PROP_ID_PADDING_TOP},
{"padding-right", PROP_ID_PADDING_RIGHT},
{"padding-bottom", PROP_ID_PADDING_BOTTOM},
{"padding-left", PROP_ID_PADDING_LEFT},
{"padding", PROP_ID_PADDING},
{"border-top-width", PROP_ID_BORDER_TOP_WIDTH},
{"border-right-width", PROP_ID_BORDER_RIGHT_WIDTH},
{"border-bottom-width", PROP_ID_BORDER_BOTTOM_WIDTH},
{"border-left-width", PROP_ID_BORDER_LEFT_WIDTH},
{"border-width", PROP_ID_BORDER_WIDTH},
{"border-top-style", PROP_ID_BORDER_TOP_STYLE},
{"border-right-style", PROP_ID_BORDER_RIGHT_STYLE},
{"border-bottom-style", PROP_ID_BORDER_BOTTOM_STYLE},
{"border-left-style", PROP_ID_BORDER_LEFT_STYLE},
{"border-style", PROP_ID_BORDER_STYLE},
{"border-top", PROP_ID_BORDER_TOP},
{"border-right", PROP_ID_BORDER_RIGHT},
{"border-bottom", PROP_ID_BORDER_BOTTOM},
{"border-left", PROP_ID_BORDER_LEFT},
{"border", PROP_ID_BORDER},
{"margin-top", PROP_ID_MARGIN_TOP},
{"margin-right", PROP_ID_MARGIN_RIGHT},
{"margin-bottom", PROP_ID_MARGIN_BOTTOM},
{"margin-left", PROP_ID_MARGIN_LEFT},
{"margin", PROP_ID_MARGIN},
{"display", PROP_ID_DISPLAY},
{"position", PROP_ID_POSITION},
{"top", PROP_ID_TOP},
{"right", PROP_ID_RIGHT},
{"bottom", PROP_ID_BOTTOM},
{"left", PROP_ID_LEFT},
{"float", PROP_ID_FLOAT},
{"width", PROP_ID_WIDTH},
{"color", PROP_ID_COLOR},
{"border-top-color", PROP_ID_BORDER_TOP_COLOR},
{"border-right-color", PROP_ID_BORDER_RIGHT_COLOR},
{"border-bottom-color", PROP_ID_BORDER_BOTTOM_COLOR},
{"border-left-color", PROP_ID_BORDER_LEFT_COLOR},
{"background-color", PROP_ID_BACKGROUND_COLOR},
{"font-family", PROP_ID_FONT_FAMILY},
{"font-size", PROP_ID_FONT_SIZE},
{"font-style", PROP_ID_FONT_STYLE},
{"font-weight", PROP_ID_FONT_WEIGHT},
{"white-space", PROP_ID_WHITE_SPACE},
/*must be the last one */
{NULL, (enum CRPropertyID) 0}
};
/**
*are:
*key => name of the css property found in gv_prop_table
*value => matching property id found in gv_prop_table.
*So this hash table is here just to retrieval of a property id
*from a property name.
*/
/**
*incremented by each new instance of #CRStyle
*and decremented at the it destroy time.
*When this reaches zero, gv_prop_hash is destroyed.
*/
struct CRNumPropEnumDumpInfo {
};
{NUM_PROP_TOP, "top"},
{NUM_PROP_RIGHT, "right"},
{NUM_PROP_BOTTOM, "bottom"},
{NUM_PROP_LEFT, "left"},
{NUM_PROP_PADDING_TOP, "padding-top"},
{NUM_PROP_PADDING_RIGHT, "padding-right"},
{NUM_PROP_PADDING_BOTTOM, "padding-bottom"},
{NUM_PROP_PADDING_LEFT, "padding-left"},
{NUM_PROP_BORDER_TOP, "border-top"},
{NUM_PROP_BORDER_RIGHT, "border-right"},
{NUM_PROP_BORDER_BOTTOM, "border-bottom"},
{NUM_PROP_BORDER_LEFT, "border-left"},
{NUM_PROP_MARGIN_TOP, "margin-top"},
{NUM_PROP_MARGIN_RIGHT, "margin-right"},
{NUM_PROP_MARGIN_BOTTOM, "margin-bottom"},
{NUM_PROP_MARGIN_LEFT, "margin-left"},
{NUM_PROP_WIDTH, "width"},
};
struct CRRgbPropEnumDumpInfo {
};
{RGB_PROP_BORDER_TOP_COLOR, "border-top-color"},
{RGB_PROP_BORDER_RIGHT_COLOR, "border-right-color"},
{RGB_PROP_BORDER_BOTTOM_COLOR, "bottom-color"},
{RGB_PROP_BORDER_LEFT_COLOR, "left-color"},
{RGB_PROP_COLOR, "color"},
{RGB_PROP_BACKGROUND_COLOR, "background-color"},
};
struct CRBorderStylePropEnumDumpInfo {
};
= {
{BORDER_STYLE_PROP_TOP, "border-style-top"},
{BORDER_STYLE_PROP_RIGHT, "border-style-right"},
{BORDER_STYLE_PROP_BOTTOM, "boder-style-bottom"},
{BORDER_STYLE_PROP_LEFT, "border-style-left"},
{(enum CRBorderStyleProp) 0, NULL}
};
static enum CRStatus
cr_style_init_properties (void);
enum CRDirection {
DIR_TOP = 0,
/*must be the last one */
};
a_code);
static enum CRStatus
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
static enum CRStatus
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
enum CRDirection a_dir);
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static enum CRStatus
static const gchar *
{
sizeof (struct CRNumPropEnumDumpInfo);
cr_utils_trace_info ("A field has been added "
"to 'enum CRNumProp' and no matching"
" entry has been "
"added to gv_num_prop_dump_infos table.\n"
"Please add the missing matching entry");
return NULL;
}
cr_utils_trace_info ("mismatch between the order of fields in"
" 'enum CRNumProp' and "
"the order of entries in "
"the gv_num_prop_dump_infos table");
return NULL;
}
}
static const gchar *
{
sizeof (struct CRRgbPropEnumDumpInfo);
cr_utils_trace_info ("A field has been added "
"to 'enum CRRgbProp' and no matching"
" entry has been "
"added to gv_rgb_prop_dump_infos table.\n"
"Please add the missing matching entry");
return NULL;
}
cr_utils_trace_info ("mismatch between the order of fields in"
" 'enum CRRgbProp' and "
"the order of entries in "
"the gv_rgb_props_dump_infos table");
return NULL;
}
}
static const gchar *
{
sizeof (struct CRBorderStylePropEnumDumpInfo);
cr_utils_trace_info ("A field has been added "
"to 'enum CRBorderStyleProp' and no matching"
" entry has been "
"added to gv_border_style_prop_dump_infos table.\n"
"Please add the missing matching entry");
return NULL;
}
cr_utils_trace_info ("mismatch between the order of fields in"
" 'enum CRBorderStyleProp' and "
"the order of entries in "
"the gv_border_style_props_dump_infos table");
return NULL;
}
}
static enum CRStatus
cr_style_init_properties (void)
{
if (!gv_prop_hash) {
gulong i = 0;
if (!gv_prop_hash) {
cr_utils_trace_info ("Out of memory");
return CR_ERROR;
}
/*load gv_prop_hash from gv_prop_table */
for (i = 0; gv_prop_table[i].name; i++) {
}
}
return CR_OK;
}
static enum CRPropertyID
{
if (!gv_prop_hash) {
}
if (!raw_id) {
return PROP_ID_NOT_KNOWN;
}
}
static enum CRStatus
{
return CR_BAD_PARAM_ERROR;
switch (a_dir) {
case DIR_TOP:
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
break;
case DIR_LEFT:
break;
default:
return CR_BAD_PARAM_ERROR;
}
&& !strncmp ((const char *) "inherit",
sizeof ("inherit")-1)) {
return CR_OK;
} else
return CR_UNKNOWN_TYPE_ERROR;
}
case NUM_LENGTH_EM:
case NUM_LENGTH_EX:
case NUM_LENGTH_PX:
case NUM_LENGTH_IN:
case NUM_LENGTH_CM:
case NUM_LENGTH_MM:
case NUM_LENGTH_PT:
case NUM_LENGTH_PC:
case NUM_PERCENTAGE:
break;
default:
break;
}
return status;
}
static enum CRStatus
enum CRDirection a_dir)
{
switch (a_dir) {
case DIR_TOP:
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
break;
case DIR_LEFT:
break;
default:
return CR_BAD_PARAM_ERROR;
break;
}
if (!strncmp ("thin",
sizeof ("thin")-1)) {
} else if (!strncmp
("medium",
sizeof ("medium")-1)) {
} else if (!strncmp ("thick",
sizeof ("thick")-1)) {
} else {
return CR_UNKNOWN_TYPE_ERROR;
}
}
}
return CR_UNKNOWN_TYPE_ERROR;
}
return status;
}
static enum CRStatus
{
if (!cur_term)
return CR_ERROR ;
int dir;
direction) ;
}
if (!cur_term)
return CR_OK ;
DIR_RIGHT) ;
DIR_LEFT) ;
if (!cur_term)
return CR_OK ;
DIR_BOTTOM) ;
if (!cur_term)
return CR_OK ;
DIR_LEFT) ;
return CR_OK ;
}
static enum CRStatus
{
switch (a_dir) {
case DIR_TOP:
border_style_ptr = &a_style->
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
border_style_ptr = &a_style->
break;
case DIR_LEFT:
border_style_ptr = &a_style->
break;
default:
break;
}
return CR_UNKNOWN_TYPE_ERROR;
}
if (!strncmp ("none",
sizeof ("none")-1)) {
} else if (!strncmp ("hidden",
sizeof ("hidden")-1)) {
} else if (!strncmp ("dotted",
sizeof ("dotted")-1)) {
} else if (!strncmp ("dashed",
} else if (!strncmp ("solid",
} else if (!strncmp ("double",
} else if (!strncmp ("groove",
} else if (!strncmp ("ridge",
sizeof ("ridge")-1)) {
} else if (!strncmp ("inset",
sizeof ("inset")-1)) {
} else if (!strncmp ("outset",
sizeof ("outset")-1)) {
} else if (!strncmp ("inherit",
sizeof ("inherit")-1)) {
} else {
}
return status;
}
static enum CRStatus
{
return CR_ERROR ;
}
int dir;
direction) ;
}
return CR_OK ;
}
DIR_RIGHT) ;
DIR_LEFT) ;
return CR_OK ;
}
DIR_BOTTOM) ;
return CR_OK ;
}
DIR_LEFT) ;
return CR_OK ;
}
static enum CRStatus
enum CRDirection a_dir)
{
switch (a_dir) {
case DIR_TOP:
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
break;
case DIR_LEFT:
break;
default:
break;
}
case TERM_IDENT:
"inherit")) {
"auto")) {
} else {
}
break ;
case TERM_NUMBER:
break;
default:
break;
}
return status;
}
struct CRPropDisplayValPair {
};
static enum CRStatus
{
{"none", DISPLAY_NONE},
{"inline", DISPLAY_INLINE},
{"block", DISPLAY_BLOCK},
{"run-in", DISPLAY_RUN_IN},
{"compact", DISPLAY_COMPACT},
{"marker", DISPLAY_MARKER},
{"table", DISPLAY_TABLE},
{"inline-table", DISPLAY_INLINE_TABLE},
{"table-row-group", DISPLAY_TABLE_ROW_GROUP},
{"table-header-group", DISPLAY_TABLE_HEADER_GROUP},
{"table-footer-group", DISPLAY_TABLE_FOOTER_GROUP},
{"table-row", DISPLAY_TABLE_ROW},
{"table-column-group", DISPLAY_TABLE_COLUMN_GROUP},
{"table-column", DISPLAY_TABLE_COLUMN},
{"table-cell", DISPLAY_TABLE_CELL},
{"table-caption", DISPLAY_TABLE_CAPTION},
{"inherit", DISPLAY_INHERIT},
{NULL, DISPLAY_NONE}
};
case TERM_IDENT:
{
int i = 0;
break;
for (i = 0; disp_vals_map[i].prop_name; i++) {
if (!strncmp
(disp_vals_map[i].prop_name,
disp_vals_map[i].type;
break;
}
}
}
break;
default:
break;
}
return CR_OK;
}
struct CRPropPositionValPair {
};
static enum CRStatus
{
{"static", POSITION_STATIC},
{"relative", POSITION_RELATIVE},
{"absolute", POSITION_ABSOLUTE},
{"fixed", POSITION_FIXED},
{"inherit", POSITION_INHERIT},
/*must alwas be the last one */
};
case TERM_IDENT:
{
int i = 0;
break;
for (i = 0; position_vals_map[i].name; i++) {
strlen (position_vals_map[i].
name))) {
break;
}
}
}
break;
default:
break;
}
return status;
}
static enum CRStatus
enum CRDirection a_dir)
{
return CR_UNKNOWN_PROP_VAL_ERROR;
}
switch (a_dir) {
case DIR_TOP:
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
break;
case DIR_LEFT:
break;
default:
break;
}
if (!strncmp ("inherit",
sizeof ("inherit")-1)) {
} else if (!strncmp ("auto",
sizeof ("auto")-1)) {
}
}
return CR_OK;
}
static enum CRStatus
{
/*the default float type as specified by the css2 spec */
/*unknow type, the float type is set to it's default value */
return CR_OK;
}
if (!strncmp ("none",
sizeof ("none")-1)) {
} else if (!strncmp ("left",
sizeof ("left")-1)) {
} else if (!strncmp ("right",
sizeof ("right")-1)) {
} else if (!strncmp ("inherit",
sizeof ("inherit")-1)) {
}
return CR_OK;
}
static enum CRStatus
{
&& a_value,
if (!strncmp ("auto",
sizeof ("auto")-1)) {
} else if (!strncmp ("inherit",
sizeof ("inherit")-1)) {
}
}
}
}
return CR_OK;
}
static enum CRStatus
{
&& a_value, CR_BAD_PARAM_ERROR);
return status;
}
static enum CRStatus
{
return status;
}
/**
*Sets border-top-color, border-right-color,
*border-bottom-color or border-left-color properties
*in the style structure. The value is taken from a
*css2 term of type IDENT or RGB.
*@param a_style the style structure to set.
*@param a_value the css2 term to take the color information from.
*@param a_dir the direction (TOP, LEFT, RIGHT, or BOTTOM).
*@return CR_OK upon successfull completion, an error code otherwise.
*/
static enum CRStatus
enum CRDirection a_dir)
{
switch (a_dir) {
case DIR_TOP:
break;
case DIR_RIGHT:
break;
case DIR_BOTTOM:
break;
case DIR_LEFT:
break;
default:
cr_utils_trace_info ("unknown DIR type");
return CR_BAD_PARAM_ERROR;
}
}
}
}
}
return status;
}
static enum CRStatus
enum CRDirection a_dir)
{
}
}
}
return CR_OK;
}
static enum CRStatus
{
int dir;
(enum CRDirection)dir);
}
return CR_OK;
}
static enum CRStatus
{
/*filter the eventual non NUMBER terms some user can have written here*/
}
if (!cur_term)
return CR_ERROR ;
int dir;
}
/*filter non NUMBER terms that some users can have written here...*/
}
/*the user can have just written padding: 1px*/
if (!cur_term)
return CR_OK;
}
if (!cur_term)
return CR_OK;
}
if (!cur_term)
return CR_OK;
return status;
}
static enum CRStatus
{
}
if (!cur_term)
return CR_OK;
int dir;
}
}
if (!cur_term)
return CR_OK;
}
if (!cur_term)
return CR_OK;
}
if (!cur_term)
return CR_OK;
return status;
}
static enum CRStatus
{
{
goto out;
}
case TERM_IDENT:
{
&& !strcmp
"sans-serif")) {
&& !strcmp
"serif")) {
"cursive")) {
"fantasy")) {
"monospace")) {
} else {
/*
*unknown property value.
*ignore it.
*/
continue;
}
}
break;
case TERM_STRING:
{
}
}
break;
default:
break;
}
if (cur_ff2) {
}
}
out:
if (font_family) {
if (a_style->font_family) {
}
font_family = NULL ;
}
return CR_OK;
}
static enum CRStatus
{
sizeof (CRFontSizeVal)) ;
/*
if (!a_style->font_size) {
a_style->font_size = cr_font_size_new ();
if (!a_style->font_size) {
return CR_INSTANCIATION_FAILED_ERROR;
}
} else {
cr_font_size_clear (a_style->font_size);
}
*/
return CR_OK;
}
static enum CRStatus
{
case TERM_IDENT:
"xx-small")) {
"x-small")) {
"small")) {
"large")) {
"x-large")) {
"xx-large")) {
"larger")) {
"smaller")) {
} else {
cr_utils_trace_info ("Unknow value of font-size") ;
return CR_UNKNOWN_PROP_VAL_ERROR;
}
break;
case TERM_NUMBER:
}
break;
default:
return CR_UNKNOWN_PROP_VAL_ERROR;
}
return CR_OK;
}
static enum CRStatus
{
case TERM_IDENT:
} else if (!strcmp
"italic")) {
} else if (!strcmp
"oblique")) {
} else if (!strcmp
"inherit")) {
} else {
}
}
break;
default:
break;
}
return status;
}
static enum CRStatus
{
case TERM_IDENT:
"normal")) {
"bold")) {
"bolder")) {
"lighter")) {
"inherit")) {
} else {
}
}
break;
case TERM_NUMBER:
} else {
}
}
break;
default:
break;
}
return status;
}
static enum CRStatus
{
case TERM_IDENT:
"pre")) {
"nowrap")) {
"inherit")) {
} else {
}
}
break;
default:
break;
}
return status;
}
/******************
*Public methods
******************/
/**
*Default constructor of #CRStyle.
*@param a_set_props_to_initial_values if TRUE, the style properties
*will be set to the default values. Only the style properties of the
*root box should be set to their initial values.
*Otherwise, the style values are set to their default value.
*Read the CSS2 spec, chapters 6.1.1 to 6.2.
*/
CRStyle *
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
if (a_set_props_to_initial_values == TRUE) {
} else {
}
return result;
}
/**
*Sets the style properties to their default values according to the css2 spec
* i.e inherit if the property is inherited, its initial value otherwise.
*@param a_this the current instance of #CRStyle.
*@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
{
glong i = 0;
for (i = 0; i < NB_NUM_PROPS; i++)
{
switch (i)
{
case NUM_PROP_WIDTH:
case NUM_PROP_TOP:
case NUM_PROP_RIGHT:
case NUM_PROP_BOTTOM:
case NUM_PROP_LEFT:
break;
case NUM_PROP_PADDING_TOP:
case NUM_PROP_PADDING_RIGHT:
case NUM_PROP_PADDING_BOTTOM:
case NUM_PROP_PADDING_LEFT:
case NUM_PROP_BORDER_TOP:
case NUM_PROP_BORDER_RIGHT:
case NUM_PROP_BORDER_BOTTOM:
case NUM_PROP_BORDER_LEFT:
case NUM_PROP_MARGIN_TOP:
case NUM_PROP_MARGIN_RIGHT:
case NUM_PROP_MARGIN_BOTTOM:
case NUM_PROP_MARGIN_LEFT:
0, NUM_LENGTH_PX);
break;
default:
cr_utils_trace_info ("Unknown property");
break;
}
}
for (i = 0; i < NB_RGB_PROPS; i++) {
switch (i) {
/*default foreground color is black */
case RGB_PROP_COLOR:
/*
*REVIEW: color is inherited and the default value is
*ua dependant.
*/
TRUE) ;
break;
/*default background color is white */
/* TODO: the default value should be transparent */
TRUE) ;
break;
default:
/*
*TODO: for BORDER_COLOR the initial value should
* be the same as COLOR
*/
FALSE);
break;
}
}
for (i = 0; i < NB_BORDER_STYLE_PROPS; i++) {
}
/* To make the inheritance resolution possible and efficient */
return CR_OK;
}
/**
*Sets the style properties to their initial value according to the css2 spec.
*This function should be used to initialize the style of the root element
*of an xml tree.
*Some properties are user agent dependant like font-family, and
*are not initialized, read the spec to make you renderer compliant.
*@param a_this the current instance of #CRStyle.
*@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
{
glong i = 0;
for (i = 0; i < NB_NUM_PROPS; i++) {
switch (i) {
case NUM_PROP_WIDTH:
break ;
case NUM_PROP_TOP:
case NUM_PROP_RIGHT:
case NUM_PROP_BOTTOM:
case NUM_PROP_LEFT:
break;
case NUM_PROP_PADDING_TOP:
case NUM_PROP_PADDING_RIGHT:
case NUM_PROP_PADDING_BOTTOM:
case NUM_PROP_PADDING_LEFT:
case NUM_PROP_BORDER_TOP:
case NUM_PROP_BORDER_RIGHT:
case NUM_PROP_BORDER_BOTTOM:
case NUM_PROP_BORDER_LEFT:
case NUM_PROP_MARGIN_TOP:
case NUM_PROP_MARGIN_RIGHT:
case NUM_PROP_MARGIN_BOTTOM:
case NUM_PROP_MARGIN_LEFT:
0, NUM_LENGTH_PX);
break;
default:
cr_utils_trace_info ("Unknown property");
break;
}
}
for (i = 0; i < NB_RGB_PROPS; i++) {
switch (i) {
/*default foreground color is black */
case RGB_PROP_COLOR:
break;
/*default background color is white */
TRUE) ;
break;
default:
break;
}
}
for (i = 0; i < NB_BORDER_STYLE_PROPS; i++) {
}
return CR_OK;
}
/**
*Resolves the inherited properties.
*The function sets the "inherited" properties to either the value of
*their parent properties.
*This function is *NOT* recursive. So the inherited properties of
*the parent style must have been resolved prior to calling this function.
*@param a_this the instance where
*@return CR_OK if a root node is found and the propagation is successful,
*an error code otherwise
*/
enum CRStatus
{
glong i = 0;
return CR_OK ;
for (i=0 ; i < NB_NUM_PROPS ;i++) {
}
}
for (i=0; i < NB_RGB_PROPS; i++) {
}
}
for (i = 0; i < NB_BORDER_STYLE_PROPS; i++) {
a_this->border_style_props[i] =
}
}
}
}
}
}
}
}
}
/*NULL is inherit marker for font_famiy*/
}
}
return ret;
}
/**
*Walks through a css2 property declaration, and populated the
*according field(s) in the #CRStyle structure.
*value(s)
*@param a_this the instance of #CRStyle to set.
*@param a_decl the declaration from which the #CRStyle fields are set.
*@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
{
&& a_decl
switch (prop_id) {
case PROP_ID_PADDING_TOP:
break;
case PROP_ID_PADDING_RIGHT:
break;
case PROP_ID_PADDING_BOTTOM:
break;
case PROP_ID_PADDING_LEFT:
break;
case PROP_ID_PADDING:
break;
case PROP_ID_BORDER_TOP_WIDTH:
DIR_TOP);
break;
break;
break;
DIR_LEFT);
break;
case PROP_ID_BORDER_WIDTH:
break ;
case PROP_ID_BORDER_TOP_STYLE:
DIR_TOP);
break;
break;
break;
DIR_LEFT);
break;
case PROP_ID_BORDER_STYLE:
break ;
case PROP_ID_BORDER_TOP_COLOR:
DIR_TOP);
break;
break;
break;
break;
case PROP_ID_BORDER_TOP:
DIR_TOP);
break;
case PROP_ID_BORDER_RIGHT:
break;
case PROP_ID_BORDER_BOTTOM:
break;
case PROP_ID_BORDER_LEFT:
DIR_LEFT);
break;
case PROP_ID_MARGIN_TOP:
DIR_TOP);
break;
case PROP_ID_BORDER:
break;
case PROP_ID_MARGIN_RIGHT:
break;
case PROP_ID_MARGIN_BOTTOM:
break;
case PROP_ID_MARGIN_LEFT:
DIR_LEFT);
break;
case PROP_ID_MARGIN:
break;
case PROP_ID_DISPLAY:
break;
case PROP_ID_POSITION:
break;
case PROP_ID_TOP:
break;
case PROP_ID_RIGHT:
break;
case PROP_ID_BOTTOM:
break;
case PROP_ID_LEFT:
break;
case PROP_ID_FLOAT:
break;
case PROP_ID_WIDTH:
break;
case PROP_ID_COLOR:
break;
case PROP_ID_BACKGROUND_COLOR:
break;
case PROP_ID_FONT_FAMILY:
break;
case PROP_ID_FONT_SIZE:
break;
case PROP_ID_FONT_STYLE:
break;
case PROP_ID_FONT_WEIGHT:
break;
case PROP_ID_WHITE_SPACE:
break;
default:
return CR_UNKNOWN_TYPE_ERROR;
}
return status;
}
/**
*Increases the reference count
*of the current instance of #CRStyle.
*@param a_this the current instance of #CRStyle.
*@return CR_OK upon successfull completion, an error code
*otherwise.
*/
enum CRStatus
{
return CR_OK;
}
/**
*Decreases the reference count of
*the current instance of #CRStyle.
*If the reference count reaches 0, the
*instance of #CRStyle is destoyed.
*@param a_this the current instance of #CRStyle.
*@return TRUE if the instance has been destroyed, FALSE
*otherwise.
*/
{
return TRUE;
}
return FALSE;
}
/**
*Duplicates the current instance of #CRStyle .
*The newly created instance of #CRStyle must be
*freed using cr_style_destroy ().
*@param a_this the current instance of #CRStyle.
*@return the newly duplicated instance of #CRStyle.
*/
CRStyle *
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
*Copies a style data structure into another.
*TODO: this is actually broken because it's based
*on memcpy although some data stuctures of CRStyle should
*be properly duplicated.
*@param a_dest the destination style datastructure
*@param a_src the source style datastructure.
*@return CR_OK upon succesfull completion, an error code otherwise
*/
enum CRStatus
{
return CR_OK;
}
/**
*dump a CRNumpPropVal in a string.
*@param a_prop_val the numerical property value to dump
*@param a_str the string to dump the numerical propertie into.
*Note that the string value is appended to a_str.
*@param a_nb_indent the number white chars of indentation.
*/
enum CRStatus
{
if (!tmp_str) {
goto cleanup;
}
if (!tmp_str) {
goto cleanup;
}
if (!tmp_str) {
goto cleanup;
}
if (tmp_str) {
}
if (str) {
}
return status;
}
enum CRStatus
{
if (!tmp_str) {
goto cleanup;
}
if (!tmp_str) {
goto cleanup;
}
if (!tmp_str) {
goto cleanup;
}
if (tmp_str) {
}
if (str) {
}
return status;
}
enum CRStatus
{
switch (a_prop) {
case BORDER_STYLE_NONE:
break;
case BORDER_STYLE_HIDDEN:
break;
case BORDER_STYLE_DOTTED:
break;
case BORDER_STYLE_DASHED:
break;
case BORDER_STYLE_SOLID:
break;
case BORDER_STYLE_DOUBLE:
break;
case BORDER_STYLE_GROOVE:
break;
case BORDER_STYLE_RIDGE:
break;
case BORDER_STYLE_INSET:
break;
case BORDER_STYLE_OUTSET:
break;
default:
break;
}
return CR_OK;
}
enum CRStatus
{
switch (a_code) {
case DISPLAY_NONE:
break;
case DISPLAY_INLINE:
break;
case DISPLAY_BLOCK:
break;
case DISPLAY_LIST_ITEM:
break;
case DISPLAY_RUN_IN:
break;
case DISPLAY_COMPACT:
break;
case DISPLAY_MARKER:
break;
case DISPLAY_TABLE:
break;
case DISPLAY_INLINE_TABLE:
break;
case DISPLAY_TABLE_ROW_GROUP:
break;
break;
break;
case DISPLAY_TABLE_ROW:
break;
break;
case DISPLAY_TABLE_COLUMN:
break;
case DISPLAY_TABLE_CELL:
break;
case DISPLAY_TABLE_CAPTION:
break;
case DISPLAY_INHERIT:
break;
default:
break;
}
return CR_OK;
}
enum CRStatus
{
switch (a_code) {
case POSITION_STATIC:
break;
case POSITION_RELATIVE:
break;
case POSITION_ABSOLUTE:
break;
case POSITION_FIXED:
break;
case POSITION_INHERIT:
break;
default:
}
return CR_OK;
}
enum CRStatus
{
switch (a_code) {
case FLOAT_NONE:
break;
case FLOAT_LEFT:
break;
case FLOAT_RIGHT:
break;
case FLOAT_INHERIT:
break;
default:
break;
}
return CR_OK;
}
enum CRStatus
{
switch (a_code) {
case WHITE_SPACE_NORMAL:
break;
case WHITE_SPACE_PRE:
break;
case WHITE_SPACE_NOWRAP:
break;
case WHITE_SPACE_INHERIT:
break;
default:
break;
}
return CR_OK;
}
/**
*Serializes in instance of #CRStyle into
*a string
*@param a_this the instance of #CRStyle to serialize
*@param a_str the string to serialise the style into.
*if *a_str is NULL, a new GString is instanciated, otherwise
*the style serialisation is appended to the existed *a_str
*@param the number of white space char to use for indentation.
*@return CR_OK upon successful completion, an error code otherwise.
*/
enum CRStatus
{
gint i = 0;
if (!*a_str) {
} else {
}
/*loop over the num_props and to_string() them */
for (i = NUM_PROP_TOP; i < NB_NUM_PROPS; i++) {
/*
*to_string() the name of the num_prop
*(using num_prop_code_to_string)
*before outputing it value
*/
if (tmp_str) {
} else {
}
}
/*loop over the rgb_props and to_string() them all */
for (i = RGB_PROP_BORDER_TOP_COLOR; i < NB_RGB_PROPS; i++) {
if (tmp_str) {
} else {
}
}
/*loop over the border_style_props and to_string() them */
for (i = BORDER_STYLE_PROP_TOP; i < NB_BORDER_STYLE_PROPS; i++) {
if (tmp_str) {
} else {
}
border_style_props[i], str,
0);
}
if (tmp_str) {
} else {
}
if (tmp_str) {
tmp_str) ;
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
if (tmp_str) {
} else {
}
return CR_OK;
}
/**
*Destructor of the #CRStyle class.
*@param a_this the instance to destroy.
*/
void
{
}