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

cr-box.c File Reference

The definition file of the CRBox class. More...

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

Go to the source code of this file.

Functions

CRBoxDatacr_box_data_new (xmlNode *a_node)
 Instanciates a new CRBoxData.

void cr_box_data_destroy (CRBoxData *a_this)
 Destructor of CRBoxData.

CRBoxContentcr_box_content_new_from_text (guchar *a_text)
 Instanciates a new CRBoxContent and set the content to text content.

void cr_box_content_destroy (CRBoxContent *a_this)
 Destructor of CRBoxContent.

CRBoxModelcr_box_model_new (void)
 Creates a new box model.

void cr_box_model_destroy (CRBoxModel *a_this)
void cr_box_model_ref (CRBoxModel *a_this)
gboolean cr_box_model_unref (CRBoxModel *a_this)
CRBoxcr_box_new (CRStyle *a_style, gboolean a_default_style)
 Instanciates a new box.

enum CRStatus cr_box_append_child (CRBox *a_this, CRBox *a_to_append)
 Appends a child box to at the end of the current box's children.

enum CRStatus cr_box_insert_sibling (CRBox *a_prev, CRBox *a_next, CRBox *a_to_insert)
 Inserts a sibling box between two adjacent sibling nodes.

enum CRStatus cr_box_to_string (CRBox *a_this, gulong a_nb_indent, GString **a_string)
 This is for debug purposes ...

enum CRStatus cr_box_dump_to_file (CRBox *a_this, gulong a_nb_indent, FILE *a_filep)
enum CRStatus cr_box_ref (CRBox *a_this)
 Increments the reference count of the current instance of CRBox.

gboolean cr_box_unref (CRBox *a_this)
 Decrements the current instance's ref count.

void cr_box_destroy (CRBox *a_this)
 Destructor of CRBox.


Detailed Description

The definition file of the CRBox class.

Definition in file cr-box.c.


Function Documentation

enum CRStatus cr_box_append_child CRBox a_this,
CRBox a_to_append
 

Appends a child box to at the end of the current box's children.

Parameters:
a_this the current box.
a_to_append,the box to append. CR_OK upon successfull completion, an error code otherwise.

Definition at line 396 of file cr-box.c.

References _CRBox::box_model, _CRBox::children, CR_BAD_PARAM_ERROR, CR_OK, _CRBox::next, _CRBox::parent, and _CRBox::prev.

void cr_box_content_destroy CRBoxContent a_this  ) 
 

Destructor of CRBoxContent.

Parameters:
a_this the current instance of CRBoxContent to be destroyed.

Definition at line 264 of file cr-box.c.

References cr_utils_trace_info, TEXT_CONTENT_TYPE, _CRBoxContent::type, and _CRBoxContent::u.

Referenced by cr_box_destroy().

CRBoxContent* cr_box_content_new_from_text guchar *  a_text  ) 
 

Instanciates a new CRBoxContent and set the content to text content.

Parameters:
a_text the text content.

Definition at line 240 of file cr-box.c.

References cr_utils_trace_info, TEXT_CONTENT_TYPE, _CRBoxContent::type, and _CRBoxContent::u.

void cr_box_data_destroy CRBoxData a_this  ) 
 

Destructor of CRBoxData.

Parameters:
a_this the current instance of CRBoxData to be destroyed.

Definition at line 226 of file cr-box.c.

CRBoxData* cr_box_data_new xmlNode *  a_node  ) 
 

Instanciates a new CRBoxData.

Parameters:
a_node the xml node to store in the box.
Returns:
the newly built CRBoxData, or null if an error arises.

Definition at line 204 of file cr-box.c.

References cr_utils_trace_info, and _CRBoxData::xml_node.

void cr_box_destroy CRBox a_this  ) 
 

Destructor of CRBox.

recursively destroys all the children nodes of the current node.

Parameters:
a_this the current box to destroy.

Definition at line 701 of file cr-box.c.

References _CRBox::children, _CRBox::content, cr_box_content_destroy(), cr_style_unref(), _CRBox::next, _CRBox::prev, and _CRBox::style.

Referenced by cr_box_model_destroy(), cr_box_new(), cr_box_unref(), and cr_box_view_new_from_xml_css_bufs().

enum CRStatus cr_box_dump_to_file CRBox a_this,
gulong  a_nb_indent,
FILE *  a_filep
 

Definition at line 609 of file cr-box.c.

References CR_BAD_PARAM_ERROR, cr_box_to_string(), CR_ERROR, CR_OK, cr_utils_trace_info, and CRStatus.

enum CRStatus cr_box_insert_sibling CRBox a_prev,
CRBox a_next,
CRBox a_to_insert
 

Inserts a sibling box between two adjacent sibling nodes.

Parameters:
a_prev the box after which we have to insert a new one.
a_next the box before which we have to insert a new one.
a_to_insert the node to insert.

Definition at line 432 of file cr-box.c.

References _CRBox::box_model, CR_BAD_PARAM_ERROR, CR_OK, _CRBox::next, _CRBox::parent, and _CRBox::prev.

void cr_box_model_destroy CRBoxModel a_this  ) 
 

Definition at line 321 of file cr-box.c.

References _CRBoxModel::box, and cr_box_destroy().

Referenced by cr_box_model_unref().

CRBoxModel* cr_box_model_new void   ) 
 

Creates a new box model.

This box model contains an empty box tree. Box tree may be added by calling cr_box_append_child().

Returns:
the newly built instance of CRBoxModel, or NULL if an error arises.

Definition at line 298 of file cr-box.c.

References _CRBoxModel::box, BOX_TYPE_BOX_MODEL, and cr_utils_trace_info.

Referenced by cr_lay_eng_create_box_model().

void cr_box_model_ref CRBoxModel a_this  ) 
 

Definition at line 332 of file cr-box.c.

References _CRBoxModel::ref_count.

gboolean cr_box_model_unref CRBoxModel a_this  ) 
 

Definition at line 341 of file cr-box.c.

References cr_box_model_destroy(), and _CRBoxModel::ref_count.

CRBox* cr_box_new CRStyle a_style,
gboolean  a_default_style
 

Instanciates a new box.

Everything is initialized to zero in it.

Returns:
the newly created box.

Definition at line 364 of file cr-box.c.

References cr_box_destroy(), CR_OK, and cr_utils_trace_info.

enum CRStatus cr_box_ref CRBox a_this  ) 
 

Increments the reference count of the current instance of CRBox.

Definition at line 659 of file cr-box.c.

References CR_BAD_PARAM_ERROR, and _CRBox::ref_count.

Referenced by cr_box_view_set_box_model().

enum CRStatus cr_box_to_string CRBox a_this,
gulong  a_nb_indent,
GString **  a_string
 

This is for debug purposes ...

Gives a string representation of the box tree.

Returns:
the build string of NULL in case of an error.

Definition at line 462 of file cr-box.c.

References _CRBox::border_edge, _CRBox::box_data, BOX_TYPE_ANONYMOUS_BLOCK, BOX_TYPE_ANONYMOUS_INLINE, BOX_TYPE_BLOCK, BOX_TYPE_BOX_MODEL, BOX_TYPE_COMPACT, BOX_TYPE_INLINE, BOX_TYPE_RUN_IN, _CRBox::children, CR_BAD_PARAM_ERROR, CR_ERROR, CR_OK, cr_utils_dump_n_chars2(), cr_utils_trace_info, _CRBox::inner_edge, _CRBox::next, _CRBox::outer_edge, _CRBox::padding_edge, _CRBox::parent, _CRBox::prev, _CRBox::type, and _CRBoxData::xml_node.

Referenced by cr_box_dump_to_file().

gboolean cr_box_unref CRBox a_this  ) 
 

Decrements the current instance's ref count.

If the ref count reaches zero, the instance is destroyed.

Parameters:
a_this the current instance.
Returns:
TRUE if the ref count reached zero and the instance has been destroyed, FALSE otherwise.

Definition at line 677 of file cr-box.c.

References cr_box_destroy(), and _CRBox::ref_count.

Referenced by cr_box_view_destroy(), and cr_box_view_set_box_model().


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