CongEditorNode

CongEditorNode

Synopsis

#define             DEBUG_EDITOR_NODE_LIFETIMES
                    CongEditorNode;
#define             CONG_EDITOR_NODE                    (obj)
#define             CONG_EDITOR_NODE_CLASS              (klass)
#define             IS_CONG_EDITOR_NODE                 (obj)
enum                CongFlowType;
CongEditorNode *    cong_editor_node_construct          (CongEditorNode *editor_node,
                                                         CongEditorWidget3 *widget,
                                                         CongTraversalNode *traversal_node);
CongEditorNode *    cong_editor_node_manufacture        (CongEditorWidget3 *widget,
                                                         CongTraversalNode *traversal_node);
CongEditorWidget3 * cong_editor_node_get_widget         (CongEditorNode *editor_node);
CongDocument *      cong_editor_node_get_document       (CongEditorNode *editor_node);
CongNodePtr         cong_editor_node_get_node           (CongEditorNode *editor_node);
CongTraversalNode * cong_editor_node_get_traversal_node (CongEditorNode *editor_node);
CongEditorNode *    cong_editor_node_get_traversal_parent
                                                        (CongEditorNode *editor_node);
gboolean            cong_editor_node_is_selected        (CongEditorNode *editor_node);
void                cong_editor_node_private_set_selected
                                                        (CongEditorNode *editor_node,
                                                         gboolean is_selected);
CongEditorArea *    cong_editor_node_generate_block_area
                                                        (CongEditorNode *editor_node);
CongEditorLineFragments * cong_editor_node_generate_line_areas_recursive
                                                        (CongEditorNode *editor_node,
                                                         gint line_width,
                                                         gint initial_indent);
void                cong_editor_node_line_regeneration_required
                                                        (CongEditorNode *editor_node);
gboolean            cong_editor_node_is_referenced_entity_decl
                                                        (CongEditorNode *editor_node);
CongEditorNode *    cong_editor_node_get_prev           (CongEditorNode *editor_node);
CongEditorNode *    cong_editor_node_get_next           (CongEditorNode *editor_node);
CongEditorChildPolicy * cong_editor_node_get_child_policy
                                                        (CongEditorNode *editor_node);
void                cong_editor_node_set_child_policy   (CongEditorNode *editor_node,
                                                         CongEditorChildPolicy *child_policy);
CongEditorChildPolicy * cong_editor_node_get_parents_child_policy
                                                        (CongEditorNode *editor_node);
void                cong_editor_node_set_parents_child_policy
                                                        (CongEditorNode *editor_node,
                                                         CongEditorChildPolicy *child_policy);

Object Hierarchy

  GObject
   +----CongEditorNode
         +----CongEditorNodeElement

Signals

  "is-selected-changed"                            : Run First
  "line-regeneration-required"                     : Run First

Description

Details

DEBUG_EDITOR_NODE_LIFETIMES

#define DEBUG_EDITOR_NODE_LIFETIMES 0


CongEditorNode

typedef struct _CongEditorNode CongEditorNode;

A CongEditorNode is a per-editor-widget GObject, and represents a node that is visited in a traversal of the xml tree. Hence there is generally a 1-1 mapping between xml nodes and CongEditorNodes. When an xmlnode is added or removed from the tree, even temporarily, then a corresponding CongEditorNode is added/removed.

However. if you have an entity ref, then the nodes below the entity decls get visited multiple times in a traversal, hence there are multiple CongEditorNodes for such nodes, one for below the entity decl, and one below every entity ref.

In order to support this every editor node know both which xml node it represents, and which "traversal parent" it has. So although it is generally the case that the traversal parent is the parent of the xml node, it is NOT always the case.

The motivating example is for the immediate children of entity references, for which the parent of the xml node is the entity declaration, not the entity reference. In this case, the traversal parent IS the entity reference node.

The traversal parent is stored as a pointer to the relevant CongEditorNode, rather than a CongNodePtr.


CONG_EDITOR_NODE()

#define CONG_EDITOR_NODE(obj)         G_TYPE_CHECK_INSTANCE_CAST (obj, CONG_EDITOR_NODE_TYPE, CongEditorNode)

obj :


CONG_EDITOR_NODE_CLASS()

#define CONG_EDITOR_NODE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, CONG_EDITOR_NODE_TYPE, CongEditorNodeClass)

klass :


IS_CONG_EDITOR_NODE()

#define IS_CONG_EDITOR_NODE(obj)      G_TYPE_CHECK_INSTANCE_TYPE (obj, CONG_EDITOR_NODE_TYPE)

obj :


enum CongFlowType

typedef enum 
{
	CONG_FLOW_TYPE_BLOCK,
	CONG_FLOW_TYPE_INLINE
} CongFlowType;


cong_editor_node_construct ()

CongEditorNode *    cong_editor_node_construct          (CongEditorNode *editor_node,
                                                         CongEditorWidget3 *widget,
                                                         CongTraversalNode *traversal_node);

TODO: Write me

editor_node :

widget :

traversal_node :

Returns :


cong_editor_node_manufacture ()

CongEditorNode *    cong_editor_node_manufacture        (CongEditorWidget3 *widget,
                                                         CongTraversalNode *traversal_node);

TODO: Write me

widget :

traversal_node :

Returns :


cong_editor_node_get_widget ()

CongEditorWidget3 * cong_editor_node_get_widget         (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_document ()

CongDocument *      cong_editor_node_get_document       (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_node ()

CongNodePtr         cong_editor_node_get_node           (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_traversal_node ()

CongTraversalNode * cong_editor_node_get_traversal_node (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_traversal_parent ()

CongEditorNode *    cong_editor_node_get_traversal_parent
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_is_selected ()

gboolean            cong_editor_node_is_selected        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_private_set_selected ()

void                cong_editor_node_private_set_selected
                                                        (CongEditorNode *editor_node,
                                                         gboolean is_selected);

TODO: Write me

editor_node :

is_selected :


cong_editor_node_generate_block_area ()

CongEditorArea *    cong_editor_node_generate_block_area
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_generate_line_areas_recursive ()

CongEditorLineFragments * cong_editor_node_generate_line_areas_recursive
                                                        (CongEditorNode *editor_node,
                                                         gint line_width,
                                                         gint initial_indent);

TODO: Write me

editor_node :

line_width :

initial_indent :

Returns :


cong_editor_node_line_regeneration_required ()

void                cong_editor_node_line_regeneration_required
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :


cong_editor_node_is_referenced_entity_decl ()

gboolean            cong_editor_node_is_referenced_entity_decl
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_prev ()

CongEditorNode *    cong_editor_node_get_prev           (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_next ()

CongEditorNode *    cong_editor_node_get_next           (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_get_child_policy ()

CongEditorChildPolicy * cong_editor_node_get_child_policy
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_set_child_policy ()

void                cong_editor_node_set_child_policy   (CongEditorNode *editor_node,
                                                         CongEditorChildPolicy *child_policy);

TODO: Write me

editor_node :

child_policy :


cong_editor_node_get_parents_child_policy ()

CongEditorChildPolicy * cong_editor_node_get_parents_child_policy
                                                        (CongEditorNode *editor_node);

TODO: Write me

editor_node :

Returns :


cong_editor_node_set_parents_child_policy ()

void                cong_editor_node_set_parents_child_policy
                                                        (CongEditorNode *editor_node,
                                                         CongEditorChildPolicy *child_policy);

TODO: Write me

editor_node :

child_policy :

Signal Details

The "is-selected-changed" signal

void                user_function                      (CongEditorNode *congeditornode,
                                                        gpointer        user_data)           : Run First

congeditornode :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "line-regeneration-required" signal

void                user_function                      (CongEditorNode *congeditornode,
                                                        gpointer        user_data)           : Run First

congeditornode :

the object which received the signal.

user_data :

user data set when the signal handler was connected.