FoFo

FoFo — Base formatting object object

Synopsis




struct      FoFo;
struct      FoFoClass;
#define     FO_FO_ERROR
GQuark      fo_fo_error_quark               (void);
enum        FoFoError;
struct      FoFoAreaNew2Context;
struct      FoFoAreaIterator;
FoFo*       fo_fo_new                       (void);
void        fo_fo_debug_dump_properties     (FoFo *fo,
                                             gint depth);
void        fo_fo_set_context               (FoFo *fo_fo,
                                             FoContext *new_context);
FoContext*  fo_fo_get_context               (FoFo *fo_fo);
void        fo_fo_update_from_context       (FoFo *fo_fo,
                                             FoContext *context);
FoFo*       fo_fo_get_flow                  (FoFo *fo_fo);
FoFo*       fo_fo_get_tree                  (FoFo *fo_fo);
gboolean    fo_fo_get_generate_reference_area
                                            (FoFo *fo_fo);
gboolean    fo_fo_get_allow_mixed_content   (FoFo *fo_fo);
gboolean    fo_fo_validate_content          (FoFo *fo,
                                             GError **error);
gboolean    fo_fo_resolve_property_attributes
                                            (FoNode *fo_node,
                                             gpointer data);
void        fo_fo_children_properties_resolve
                                            (FoFo *this_fo,
                                             FoArea *this_fo_parent_area,
                                             FoArea **new_area,
                                             GHashTable *prop_eval_hash,
                                             FoDoc *fo_doc,
                                             gint debug_level,
                                             GError **error);
void        fo_fo_validate                  (FoFo *fo,
                                             FoContext *current_context,
                                             FoContext *parent_context,
                                             GError **error);
FoFo*       fo_fo_clone                     (FoFo *original);
void        fo_fo_area_new                  (FoFo *fo,
                                             FoDoc *fo_doc,
                                             FoArea *parent_area,
                                             FoArea **new_area,
                                             guint debug_level);
void        fo_fo_area_new2                 (FoFo *fo,
                                             FoFoAreaNew2Context *context,
                                             GError **error);
void        fo_fo_trim_whitespace_children  (FoFo *fo);
gboolean    fo_fo_validate_content_empty    (FoFo *fo,
                                             GError **error);
gboolean    fo_fo_validate_content_block_plus
                                            (FoFo *fo,
                                             GError **error);
void        fo_fo_validate_pcdata_or_inline (FoNode *fo_node,
                                             gboolean *is_not_pcdata_inline);
void        fo_fo_validate_block_or_whitespace
                                            (FoNode *fo_node,
                                             gboolean *is_not_block_or_whitespace);
void        fo_fo_validate_pcdata_inline_block_neutral
                                            (FoNode *fo_node,
                                             gboolean *is_not_pcdata_inline_block_neutral);
FoFoAreaIterator* fo_fo_get_area_iterator   (FoFo *fo);
FoArea*     fo_fo_area_iterator_get_area    (const FoFoAreaIterator *iterator);
gboolean    fo_fo_area_iterator_next        (FoFoAreaIterator *iterator);

Object Hierarchy


  GObject
   +----FoObject
         +----FoNode
               +----FoFo

Properties


  "allow-mixed-content"  gboolean             : Read
  "context"              FoContext            : Read
  "flow"                 FoFo                 : Read
  "generate-reference-area" gboolean             : Read
  "tree"                 FoFo                 : Read

Description

Details

struct FoFo

struct FoFo;


struct FoFoClass

struct FoFoClass;


FO_FO_ERROR

#define     FO_FO_ERROR


fo_fo_error_quark ()

GQuark      fo_fo_error_quark               (void);

Returns : GQuark identifying FoFo errors.

enum FoFoError

typedef enum
{
  FO_FO_ERROR_FAILED,            /* Generic error code */
  FO_FO_ERROR_WARNING,	         /* Non-fatal error */
  FO_FO_ERROR_EMPTY,             /* FO should not be empty */
  FO_FO_ERROR_NOT_EMPTY,         /* FO should be empty */
  FO_FO_ERROR_NOT_BLOCK,         /* FO should contain (%block;)+ */
  FO_FO_ERROR_INVALID_CHILD,     /* FO not allowed as child of parent FO */
  FO_FO_ERROR_INVALID_CONTENT,   /* FO content does not match content model */
  FO_FO_ERROR_ENUMERATION_TOKEN, /* Unrecognised enumeration token */
  FO_FO_ERROR_DATATYPE,          /* Invalid datatype value for property */
  FO_FO_ERROR_LAST
} FoFoError;


struct FoFoAreaNew2Context

struct FoFoAreaNew2Context {

  FoDoc   *fo_doc;
  FoArea  *parent_area;
  FoArea **new_area;
  guint    debug_level;
};


struct FoFoAreaIterator

struct FoFoAreaIterator;


fo_fo_new ()

FoFo*       fo_fo_new                       (void);

Creates a new FoFo initialized to default value.

Returns : the new FoFo

fo_fo_debug_dump_properties ()

void        fo_fo_debug_dump_properties     (FoFo *fo,
                                             gint depth);

Log debug messages for most of the instance variables and some of the class variables of fo.

fo : FoFo whose properties to dump
depth : Indication of relative depth to be applied to the output.

fo_fo_set_context ()

void        fo_fo_set_context               (FoFo *fo_fo,
                                             FoContext *new_context);

Sets the context of fo_fo to new_context

fo_fo : The FoFo object
new_context : The new context

fo_fo_get_context ()

FoContext*  fo_fo_get_context               (FoFo *fo_fo);

Gets the "context" of fo_fo

fo_fo : The FoFo object
Returns : The context

fo_fo_update_from_context ()

void        fo_fo_update_from_context       (FoFo *fo_fo,
                                             FoContext *context);

Calls the FoFo-specific _update_from_context() function to update the FoFo's property values from the larger set of property values maintained in the FoContext.

fo_fo : FoFo to be updated
context : FoContext from which to update the FoFo

fo_fo_get_flow ()

FoFo*       fo_fo_get_flow                  (FoFo *fo_fo);

Gets the flow of fo_fo

fo_fo : The FoFo object
Returns : The flow

fo_fo_get_tree ()

FoFo*       fo_fo_get_tree                  (FoFo *fo_fo);

Gets the tree of fo_fo

fo_fo : The FoFo object
Returns : The tree

fo_fo_get_generate_reference_area ()

gboolean    fo_fo_get_generate_reference_area
                                            (FoFo *fo_fo);

Gets whether or not the FO generates reference areas.

fo_fo : The FoFo object
Returns : The generate-reference-area class property value

fo_fo_get_allow_mixed_content ()

gboolean    fo_fo_get_allow_mixed_content   (FoFo *fo_fo);

Gets whether or not the FO allows mixed content (i.e. text nodes).

fo_fo : The FoFo object
Returns : The allow_mixed_content class property value.

fo_fo_validate_content ()

gboolean    fo_fo_validate_content          (FoFo *fo,
                                             GError **error);

Calls the FoFo-specific _validate_content() function to validate the FoFo's content model and returns the value returned by that function.

fo : FoFo whose content is to be validated
error : GError
Returns : FALSE if no content model error, otherwise TRUE

fo_fo_resolve_property_attributes ()

gboolean    fo_fo_resolve_property_attributes
                                            (FoNode *fo_node,
                                             gpointer data);

fo_node :
data :
Returns :

fo_fo_children_properties_resolve ()

void        fo_fo_children_properties_resolve
                                            (FoFo *this_fo,
                                             FoArea *this_fo_parent_area,
                                             FoArea **new_area,
                                             GHashTable *prop_eval_hash,
                                             FoDoc *fo_doc,
                                             gint debug_level,
                                             GError **error);

this_fo :
this_fo_parent_area :
new_area :
prop_eval_hash :
fo_doc :
debug_level :
error :

fo_fo_validate ()

void        fo_fo_validate                  (FoFo *fo,
                                             FoContext *current_context,
                                             FoContext *parent_context,
                                             GError **error);

Validate and/or munge the properties of fo.

fo : FoFo to validate.
current_context : FoContext of fo.
parent_context : FoContext of parent of fo.
error : GError indicating any error that occurs

fo_fo_clone ()

FoFo*       fo_fo_clone                     (FoFo *original);

Make a clone of original and insert the clone after original in the fo tree. Set instance properties of the clone to match original.

original : Fo object to be cloned
Returns : Clone of original

fo_fo_area_new ()

void        fo_fo_area_new                  (FoFo *fo,
                                             FoDoc *fo_doc,
                                             FoArea *parent_area,
                                             FoArea **new_area,
                                             guint debug_level);

fo :
fo_doc :
parent_area :
new_area :
debug_level :

fo_fo_area_new2 ()

void        fo_fo_area_new2                 (FoFo *fo,
                                             FoFoAreaNew2Context *context,
                                             GError **error);

fo :
context :
error :

fo_fo_trim_whitespace_children ()

void        fo_fo_trim_whitespace_children  (FoFo *fo);

Remove any "whitespace" children of fo. I.e., unlink and unref any children that are FoText that contain only whitespace or are FoWrapperWhitespace nodes.

Leaves fo with no "whitespace" children.

fo : FoFo to trim

fo_fo_validate_content_empty ()

gboolean    fo_fo_validate_content_empty    (FoFo *fo,
                                             GError **error);

fo :
error :
Returns :

fo_fo_validate_content_block_plus ()

gboolean    fo_fo_validate_content_block_plus
                                            (FoFo *fo,
                                             GError **error);

fo :
error :
Returns :

fo_fo_validate_pcdata_or_inline ()

void        fo_fo_validate_pcdata_or_inline (FoNode *fo_node,
                                             gboolean *is_not_pcdata_inline);

fo_node :
is_not_pcdata_inline :

fo_fo_validate_block_or_whitespace ()

void        fo_fo_validate_block_or_whitespace
                                            (FoNode *fo_node,
                                             gboolean *is_not_block_or_whitespace);

fo_node :
is_not_block_or_whitespace :

fo_fo_validate_pcdata_inline_block_neutral ()

void        fo_fo_validate_pcdata_inline_block_neutral
                                            (FoNode *fo_node,
                                             gboolean *is_not_pcdata_inline_block_neutral);

fo_node :
is_not_pcdata_inline_block_neutral :

fo_fo_get_area_iterator ()

FoFoAreaIterator* fo_fo_get_area_iterator   (FoFo *fo);

fo :
Returns :

fo_fo_area_iterator_get_area ()

FoArea*     fo_fo_area_iterator_get_area    (const FoFoAreaIterator *iterator);

iterator :
Returns :

fo_fo_area_iterator_next ()

gboolean    fo_fo_area_iterator_next        (FoFoAreaIterator *iterator);

iterator :
Returns :

Properties

"allow-mixed-content" (gboolean : Read)

"context" (FoContext : Read)

"flow" (FoFo : Read)

"generate-reference-area" (gboolean : Read)

"tree" (FoFo : Read)