FoFo

FoFo — Abstract base formatting object

Functions

Properties

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

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── FoObject
            ╰── FoNode
                ╰── FoFo
                    ├── FoMarkerParent
                    ├── FoCharacter
                    ├── FoColorProfile
                    ├── FoPageMasterReference
                    ├── FoDeclarations
                    ├── FoExternalGraphic
                    ├── FoFloat
                    ├── FoFootnoteBody
                    ├── FoFootnote
                    ├── FoInitialPropertySet
                    ├── FoInstreamForeignObject
                    ├── FoLayoutMasterSet
                    ├── FoLeader
                    ├── FoMarker
                    ├── FoMultiCase
                    ├── FoMultiProperties
                    ├── FoMultiPropertySet
                    ├── FoMultiSwitch
                    ├── FoMultiToggle
                    ├── FoPageNumberCitation
                    ├── FoPageNumber
                    ├── FoPageSequence
                    ├── FoPageMaster
                    ├── FoRegion
                    ├── FoRepeatablePageMasterAlternatives
                    ├── FoRetrieveMarker
                    ├── FoRoot
                    ├── FoStaticContent
                    ├── FoTableColumn
                    ├── FoText
                    ├── FoTitle
                    ╰── FoTree

Known Derived Interfaces

FoFo is required by FoBlockFoIface, FoInlineFoIface and FoTableBorderFoIface.

Description

Abstract base formatting object of formatting object system.

Functions

fo_fo_error_quark ()

GQuark
fo_fo_error_quark (void);

Gets the GQuark identifying FoFo errors.

Returns

GQuark identifying FoFo errors.


fo_fo_set_context ()

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

Sets the context of fo_fo to new_context

Parameters

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

Parameters

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.

Parameters

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

Parameters

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

Parameters

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.

Parameters

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);

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.

Parameters

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);

Resolves the values of the properties of fo_node .

Parameters

fo_node

FoNode for which to resolve property attributes.

 

data

Context in which to resolve the properties.

 

Returns

TRUE if an error occurred, FALSE otherwise.


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,
                                   gboolean continue_after_error,
                                   FoDebugFlag debug_level,
                                   FoWarningFlag warning_mode,
                                   GError **error);

Resolves the properties of the children of this_fo .

Parameters

this_fo

FoFo for which to resolve properties.

 

this_fo_parent_area

Parent FoArea to which to add new areas.

 

new_area

New area, if any.

 

prop_eval_hash

Map of property names to property eval functions.

 

fo_doc

Output FoDoc.

 

continue_after_error

Whether to continue after any formatting errors.

 

debug_level

Debug level.

 

warning_mode

Warning mode.

 

error

Indication of any error that occurred.

 

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 .

Parameters

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 .

Parameters

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_area_new is deprecated and should not be used in newly-written code.

Use fo_fo_area_new2 in new code.

Creates a new FoArea for fo and adds it as the last child of parent_area .

Parameters

fo

FoFo for which to create a new area.

 

fo_doc

Output FoDoc

 

parent_area

FoArea to which to add new area.

 

new_area

New area.

 

debug_level

Debug level.

 

fo_fo_area_new2 ()

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

Creates a new FoArea corresponding to fo .

Parameters

fo

FoFo for which to create area.

 

context

Context in which to create area.

 

error

Indication of any error that occurred.

 

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.

Parameters

fo

FoFo to trim

 

fo_fo_validate_content_empty ()

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

Validates that fo does not contain any child FoFo

Parameters

fo

FoFo to validate.

 

error

GError indicating any error.

 

Returns

FALSE if fo is empty.


fo_fo_validate_content_block_plus ()

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

Validates the fo contains one or more FoBlockFo formatting objects.

Parameters

fo

FoFo to validate.

 

error

GError indicating any error.

 

Returns

FALSE if content matches.


fo_fo_validate_pcdata_or_inline ()

void
fo_fo_validate_pcdata_or_inline (FoNode *fo_node,
                                 gboolean *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_fo_validate_pcdata_inline_block_neutral ()

void
fo_fo_validate_pcdata_inline_block_neutral
                               (FoNode *fo_node,
                                gpointer data);

Validates that the content of fo_node is only #PCDATA or FoInline or FoNeutral formatting objects.

Parameters

fo_node

FoFo to validate

 

data

Pointer to gboolean storing result

 

fo_fo_get_area_iterator ()

FoFoAreaIterator *
fo_fo_get_area_iterator (FoFo *fo);

Gets a FoFoAreaIterator for iterating over the areas generated by fo .

Parameters

fo

FoFo for which to get iterator.

 

Returns

A FoFoAreaIterator.


fo_fo_area_iterator_get_area ()

FoArea *
fo_fo_area_iterator_get_area (const FoFoAreaIterator *iterator);

Gets the current FoArea pointed to by iterator .

Parameters

iterator

FoFoAreaIterator for which to get current area.

 

Returns

The current FoArea.


fo_fo_area_iterator_next ()

gboolean
fo_fo_area_iterator_next (FoFoAreaIterator *iterator);

Makes iterator point to the next FoArea in its list.

Parameters

iterator

FoFoAreaIterator to modify

 

Returns

TRUE if there is a next FoArea, FALSE if not.

Types and Values

FoFo

typedef struct _FoFo FoFo;

FoFoClass

typedef struct _FoFoClass FoFoClass;

FO_FO_ERROR

#define FO_FO_ERROR (fo_fo_error_quark ())

enum FoFoError

Members

FO_FO_ERROR_FAILED

   

FO_FO_ERROR_WARNING

   

FO_FO_ERROR_EMPTY

   

FO_FO_ERROR_NOT_EMPTY

   

FO_FO_ERROR_NOT_BLOCK

   

FO_FO_ERROR_INVALID_CHILD

   

FO_FO_ERROR_INVALID_CONTENT

   

FO_FO_ERROR_ENUMERATION_TOKEN

   

FO_FO_ERROR_DATATYPE

   

FO_FO_ERROR_DATATYPE_REPLACE

   

FO_FO_ERROR_DATATYPE_NULL

   

FO_FO_ERROR_UNSUPPORTED_PROPERTY

   

FO_FO_ERROR_NO_IMAGE

   

FO_FO_ERROR_LAST

   

struct FoFoAreaNew2Context

struct FoFoAreaNew2Context {
  FoDoc        *fo_doc;
  FoArea       *parent_area;
  FoArea      **new_area;
  gboolean      truncate;
  gboolean      continue_after_error;
  FoDebugFlag   debug_level;
  FoWarningFlag warning_mode;
};

Context for creating a new area for an FoFo.

Members

FoDoc *fo_doc;

FoDoc to contain area

 

FoArea *parent_area;

Parent FoArea to which to link new_area

 

FoArea **new_area;

Pointer to new area created by a fo_area_new2() function truncate Whether to truncate further processing

 

gboolean truncate;

   

gboolean continue_after_error;

Whether to continue after an error occurs

 

FoDebugFlag debug_level;

Level of debug output to produce

 

FoWarningFlag warning_mode;

Level of warnings to produce

 

FoFoAreaIterator

typedef struct _FoFoAreaIterator FoFoAreaIterator;

Property Details

The “allow-mixed-content” property

  “allow-mixed-content”      gboolean

Whether or not the formatting object allows mixed content.

Owner: FoFo

Flags: Read

Default value: FALSE


The “context” property

  “context”                  FoContext *

Set of current formatting object properties.

Owner: FoFo

Flags: Read


The “flow” property

  “flow”                     FoFo *

Ancestor fo:flow node in the formatting object tree.

Owner: FoFo

Flags: Read


The “generate-reference-area” property

  “generate-reference-area”  gboolean

Whether or not the formatting object generates a reference area.

Owner: FoFo

Flags: Read

Default value: FALSE


The “tree” property

  “tree”                     FoFo *

Top of the formatting object tree.

Owner: FoFo

Flags: Read