OSDN Git Service

stop using trunk or dist directory in rec10 project.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / scenegraph.h
diff --git a/tstools/DtsEdit/src/gpac/scenegraph.h b/tstools/DtsEdit/src/gpac/scenegraph.h
deleted file mode 100644 (file)
index 580491e..0000000
+++ /dev/null
@@ -1,761 +0,0 @@
-/*\r
- *                     GPAC - Multimedia Framework C SDK\r
- *\r
- *                     Copyright (c) Jean Le Feuvre 2000-2005\r
- *                                     All rights reserved\r
- *\r
- *  This file is part of GPAC / Scene Graph sub-project\r
- *\r
- *  GPAC is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU Lesser General Public License as published by\r
- *  the Free Software Foundation; either version 2, or (at your option)\r
- *  any later version.\r
- *   \r
- *  GPAC is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU Lesser General Public License for more details.\r
- *   \r
- *  You should have received a copy of the GNU Lesser General Public\r
- *  License along with this library; see the file COPYING.  If not, write to\r
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
- *\r
- */\r
-\r
-\r
-#ifndef _GF_SCENEGRAPH_H_\r
-#define _GF_SCENEGRAPH_H_\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#include <gpac/list.h>\r
-#include <gpac/math.h>\r
-\r
-/*\r
-       TAG definitions are static, in order to be able to mix nodes from different standard\r
-       in a single scenegraph. These TAGs are only used internally (they do not match any\r
-       binary encoding)\r
-*/\r
-enum {\r
-       /*undefined node: just the base node class, used for parsing*/\r
-       TAG_UndefinedNode = 0,\r
-       /*all MPEG-4/VRML/X3D proto instances have this tag*/\r
-       TAG_ProtoNode,\r
-\r
-       /*reserved TAG ranges per standard*/\r
-\r
-       /*range for MPEG4*/\r
-       GF_NODE_RANGE_FIRST_MPEG4,\r
-       GF_NODE_RANGE_LAST_MPEG4 = GF_NODE_RANGE_FIRST_MPEG4+512,\r
-\r
-       /*range for X3D*/\r
-       GF_NODE_RANGE_FIRST_X3D, \r
-       GF_NODE_RANGE_LAST_X3D = GF_NODE_RANGE_FIRST_X3D+512,\r
-\r
-       /*all nodes after this are always parent nodes*/\r
-       GF_NODE_RANGE_LAST_VRML,\r
-\r
-       /*DOM container for BIFS/LASeR/etc updates*/\r
-       TAG_DOMUpdates,\r
-\r
-       /*all nodes below MUST be parent nodes*/\r
-       GF_NODE_FIRST_PARENT_NODE_TAG,\r
-\r
-       /*DOM text node*/\r
-       TAG_DOMText,\r
-       /*all nodes below MUST use the base DOM structure (with dyn attribute list)*/\r
-       GF_NODE_FIRST_DOM_NODE_TAG,\r
-       \r
-       /*full node*/\r
-       TAG_DOMFullNode = GF_NODE_FIRST_DOM_NODE_TAG,\r
-\r
-       /*range for SVG*/\r
-       GF_NODE_RANGE_FIRST_SVG, \r
-       GF_NODE_RANGE_LAST_SVG = GF_NODE_RANGE_FIRST_SVG+100,\r
-\r
-       /*range for XBL*/\r
-       GF_NODE_RANGE_FIRST_XBL, \r
-       TAG_XBL_bindings = GF_NODE_RANGE_FIRST_XBL,\r
-       TAG_XBL_binding,\r
-       TAG_XBL_content,\r
-       TAG_XBL_children,\r
-       TAG_XBL_implementation,\r
-       TAG_XBL_constructor,\r
-       TAG_XBL_destructor,\r
-       TAG_XBL_field,\r
-       TAG_XBL_property,\r
-       TAG_XBL_getter,\r
-       TAG_XBL_setter,\r
-       TAG_XBL_method,\r
-       TAG_XBL_parameter,\r
-       TAG_XBL_body,\r
-       TAG_XBL_handlers,\r
-       TAG_XBL_handler,\r
-       TAG_XBL_resources,\r
-       TAG_XBL_stylesheet,\r
-       TAG_XBL_image,\r
-       GF_NODE_RANGE_LAST_XBL,\r
-};\r
-\r
-\r
-\r
-/*private handler for this library on all nodes*/\r
-#define BASE_NODE      struct _nodepriv *sgprivate;\r
-\r
-/*base node type*/\r
-typedef struct _base_node\r
-{\r
-       BASE_NODE\r
-} GF_Node;\r
-\r
-/*child storage - this is not integrated in the base node, because of VRML/MPEG-4 USE: a node\r
-may be present at different places in the tree, hence have different "next" siblings.*/\r
-typedef struct _child_node\r
-{\r
-       struct _child_node *next;\r
-       GF_Node *node;\r
-} GF_ChildNodeItem;\r
-\r
-/*grouping nodes macro :\r
-       children: list of children SFNodes\r
-*/\r
-\r
-#define CHILDREN                                                                       \\r
-       struct _child_node *children;\r
-\r
-typedef struct\r
-{\r
-       BASE_NODE\r
-       CHILDREN\r
-} GF_ParentNode;\r
-\r
-/*adds a child to a given container*/\r
-GF_Err gf_node_list_add_child(GF_ChildNodeItem **list, GF_Node *n);\r
-/*adds a child to a given container, updating last position*/\r
-GF_Err gf_node_list_add_child_last(GF_ChildNodeItem **list, GF_Node *n, GF_ChildNodeItem **last_child);\r
-/*inserts a child to a given container - if pos doesn't match, append the child*/\r
-GF_Err gf_node_list_insert_child(GF_ChildNodeItem **list, GF_Node *n, u32 pos);\r
-/*removes a child to a given container - return 0 if child not found*/\r
-Bool gf_node_list_del_child(GF_ChildNodeItem **list, GF_Node *n);\r
-/*finds a child in a given container, returning its 0-based index if found, -1 otherwise*/\r
-s32 gf_node_list_find_child(GF_ChildNodeItem *list, GF_Node *n);\r
-/*finds a child in a given container given its index, returning the child or NULL if not found\r
-if pos is <0, returns the last child*/\r
-GF_Node *gf_node_list_get_child(GF_ChildNodeItem *list, s32 pos);\r
-/*gets the number of children in a given container*/\r
-u32 gf_node_list_get_count(GF_ChildNodeItem *list);\r
-/*deletes node entry at given idx, returning node if found, NULL otherwise*/\r
-GF_Node *gf_node_list_del_child_idx(GF_ChildNodeItem **list, u32 pos);\r
-\r
-\r
-\r
-/*tag is set upon creation and cannot be modified*/\r
-u32 gf_node_get_tag(GF_Node*);\r
-/*set node def\r
-       @ID: node ID, !=0 set def node - if a different node with the same ID exists, returns error. \r
-You may change the node ID by recalling the function with a different ID value. You may get a node ID\r
-by calling the gf_sg_get_next_available_node_id function\r
-       @defName: optional readable name (script, MPEGJ). To change the name, recall the function with a different name and the same ID\r
-*/\r
-GF_Err gf_node_set_id(GF_Node*n, u32 nodeID, const char *nodeDEFName);\r
-/*get def name of the node , NULL if not set*/\r
-const char *gf_node_get_name(GF_Node*);\r
-/*get def name of the node , or the string representation of the node pointer if not set*/\r
-const char *gf_node_get_log_name(GF_Node*);\r
-/*get def ID of the node, 0 if node not def*/\r
-u32 gf_node_get_id(GF_Node*);\r
-/* gets node built-in name (eg 'Appearance', ..) */\r
-const char *gf_node_get_class_name(GF_Node *Node);\r
-\r
-u32 gf_sg_node_get_tag_by_class_name(const char *name, u32 xmlns);\r
-\r
-/*unset the node ID*/\r
-GF_Err gf_node_remove_id(GF_Node *p);\r
-\r
-/*get/set user private stack*/\r
-void *gf_node_get_private(GF_Node*);\r
-void gf_node_set_private(GF_Node*, void *);\r
-\r
-/*set traversal callback function. If a node has no associated callback, the traversing of the \r
-graph won't propagate below it. It is the app responsability to setup traversing functions as needed\r
-VRML/MPEG4:  Instanciated Protos are handled internally as well as interpolators, valuators and scripts\r
-@is_destroy: set when the node is about to be destroyed\r
-*/\r
-GF_Err gf_node_set_callback_function(GF_Node *, void (*NodeFunction)(GF_Node *node, void *traverse_state, Bool is_destroy) );\r
-\r
-/*register a node (DEFed or not), specifying parent if any.\r
-A node must be registered whenever used by something (a parent node, a command, whatever) to prevent its \r
-destruction (think of it as a reference counting).\r
-NOTE: NODES ARE CREATED WITHOUT BEING REGISTERED\r
-*/\r
-GF_Err gf_node_register(GF_Node *node, GF_Node *parent_node);\r
-\r
-/*unregister a node from parent (node may or not be DEF'ed). Parent may be NULL (DEF root node, commands).\r
-This MUST be called whenever a node is destroyed (removed from a parent node)\r
-If this is the last instance of the node, the node is destroyed\r
-NOTE: NODES ARE CREATED WITHOUT BEING REGISTERED, hence they MUST be registered at least once before \r
-being destroyed\r
-*/\r
-GF_Err gf_node_unregister(GF_Node *node, GF_Node *parent_node);\r
-/*deletes all node instances in the given list*/\r
-void gf_node_unregister_children(GF_Node *node, GF_ChildNodeItem *childrenlist);\r
-\r
-/*get all parents of the node and replace the old_node by the new node in all parents\r
-Note: if the new node is not DEFed, only the first instance of "old_node" will be replaced, the other ones deleted*/\r
-GF_Err gf_node_replace(GF_Node *old_node, GF_Node *new_node, Bool updateOrderedGroup);\r
-\r
-/*returns number of instances for this node*/\r
-u32 gf_node_get_num_instances(GF_Node *node);\r
-\r
-\r
-/*calls node traverse callback routine on this node*/\r
-void gf_node_traverse(GF_Node *node, void *udta);\r
-/*allows a node to be re-rendered - by default a node in its render phase will never be rendered a second time. \r
-Use this function to enable a second render for this node - this must be called while node is being rendered*/\r
-void gf_node_allow_cyclic_traverse(GF_Node *node);\r
-\r
-/*blindly calls traverse callback on all children nodes */\r
-void gf_node_traverse_children(GF_Node *node, void *renderStack);\r
-/*returns number of parent for this node (parent are kept regardless of DEF state)*/\r
-u32 gf_node_get_parent_count(GF_Node *node);\r
-/*returns desired parent for this node (parent are kept regardless of DEF state)\r
-idx is 0-based parent index*/\r
-GF_Node *gf_node_get_parent(GF_Node *node, u32 idx);\r
-\r
-\r
-enum\r
-{\r
-       /*flag set whenever a field of the node has been modified*/\r
-       GF_SG_NODE_DIRTY = 1,\r
-       /*flag set whenever a child node of this node has been modified\r
-       NOTE: unloaded extern protos always invalidate their parent subgraph to get a chance\r
-       of being loaded. It is the user responsability to clear the CHILD_DIRTY flag before traversing\r
-       if relying on this flag for sub-tree discarding (eg, culling or similar)*/\r
-       GF_SG_CHILD_DIRTY = 1<<1,\r
-\r
-       /*flag set by bindable nodes to indicate a modification of the bindable stack. This is \r
-       only used for offscreen rendering of Layer3D*/\r
-       GF_SG_VRML_BINDABLE_DIRTY = 1<<2,\r
-\r
-       /*flag set whenever a ColorTransform node is removed from a parent node*/\r
-       GF_SG_VRML_COLOR_DIRTY = 1<<3,\r
-\r
-\r
-       /*SVG-specific flags due to mix of geometry and appearance & co attributes*/\r
-       /*SVG geometry changed is the same as base flag*/\r
-       GF_SG_SVG_GEOMETRY_DIRTY                = GF_SG_NODE_DIRTY,\r
-       GF_SG_SVG_COLOR_DIRTY                   = GF_SG_VRML_BINDABLE_DIRTY,\r
-       GF_SG_SVG_DISPLAYALIGN_DIRTY    = 1<<3,\r
-       GF_SG_SVG_FILL_DIRTY                    = 1<<4,\r
-       GF_SG_SVG_FILLOPACITY_DIRTY             = 1<<5,\r
-       GF_SG_SVG_FILLRULE_DIRTY                = 1<<6,\r
-       GF_SG_SVG_FONTFAMILY_DIRTY              = 1<<7,\r
-       GF_SG_SVG_FONTSIZE_DIRTY                = 1<<8,\r
-       GF_SG_SVG_FONTSTYLE_DIRTY               = 1<<9,\r
-       GF_SG_SVG_FONTVARIANT_DIRTY             = 1<<10,\r
-       GF_SG_SVG_FONTWEIGHT_DIRTY              = 1<<11,\r
-       GF_SG_SVG_LINEINCREMENT_DIRTY   = 1<<12,\r
-       GF_SG_SVG_OPACITY_DIRTY                 = 1<<13,\r
-       GF_SG_SVG_SOLIDCOLOR_OR_OPACITY_DIRTY           = 1<<14,\r
-       GF_SG_SVG_STOPCOLOR_OR_OPACITY_DIRTY            = 1<<15,\r
-       GF_SG_SVG_STROKE_DIRTY                  = 1<<16,\r
-       GF_SG_SVG_STROKEDASHARRAY_DIRTY = 1<<17,\r
-       GF_SG_SVG_STROKEDASHOFFSET_DIRTY= 1<<18,\r
-       GF_SG_SVG_STROKELINECAP_DIRTY   = 1<<19,\r
-       GF_SG_SVG_STROKELINEJOIN_DIRTY  = 1<<20,\r
-       GF_SG_SVG_STROKEMITERLIMIT_DIRTY= 1<<21,\r
-       GF_SG_SVG_STROKEOPACITY_DIRTY   = 1<<22,\r
-       GF_SG_SVG_STROKEWIDTH_DIRTY             = 1<<23,\r
-       GF_SG_SVG_TEXTPOSITION_DIRTY    = 1<<24,\r
-       GF_SG_SVG_DISPLAY_DIRTY                 = 1<<25,\r
-       GF_SG_SVG_VECTOREFFECT_DIRTY    = 1<<26,\r
-       GF_SG_SVG_XLINK_HREF_DIRTY              = 1<<27,\r
-};\r
-\r
-/*set dirty flags.\r
-if @flags is 0, sets the base flags on (GF_SG_NODE_DIRTY).\r
-if @flags is not 0, adds the flags to the node dirty state\r
-\r
-If @invalidate_parents is set, all parent subtrees for this node are marked as GF_SG_CHILD_DIRTY\r
-Note: parent subtree marking aborts if a node in the subtree is already marked with GF_SG_CHILD_DIRTY\r
-which means tat if you never clean the dirty flags, no propagation will take place\r
-*/\r
-void gf_node_dirty_set(GF_Node *node, u32 flags, Bool dirty_parents);\r
-\r
-/*mark all parent subtrees for this node as GF_SG_CHILD_DIRTY\r
-Note: parent subtree marking aborts if a node in the subtree is already marked with GF_SG_CHILD_DIRTY\r
-which means that if you never clean the dirty flags, no propagation will take place\r
-*/\r
-void gf_node_dirty_parents(GF_Node *node);\r
-\r
-/*set dirty flag off. It is the user responsability to clear dirty flags\r
-if @flags is 0, all flags are set off\r
-if @flags is not 0, removes the indicated flags from the node dirty state\r
-*/\r
-void gf_node_dirty_clear(GF_Node *node, u32 flags);\r
-\r
-/*if the node is in a dirty state, resets it and the state of all its children*/\r
-void gf_node_dirty_reset(GF_Node *node);\r
-\r
-/*get dirty flag value*/\r
-u32 gf_node_dirty_get(GF_Node *node);\r
-\r
-/*Notes on GF_FieldInfo\r
-all scene graph implementations should answer node field query with this interface. \r
-In case an implementation does not use this:\r
-       - the implementation shall handle the parent node dirty flag itself most of the time\r
-       - the implementation shall NOT allow referencing of a graph node in a parent graph node (when inlining\r
-content) otherwise the app is guaranteed to crash.\r
-*/\r
-\r
-/*other fieldTypes may be ignored by implmentation not using VRML/MPEG4 native types*/\r
-\r
-typedef struct\r
-{      \r
-       /*0-based index of the field in the node*/\r
-       u32 fieldIndex;\r
-       /*field type - VRML/MPEG4 types are listed in scenegraph_vrml.h*/\r
-       u32 fieldType;\r
-       /*far ptr to the field (eg GF_Node **, GF_List**, MFInt32 *, ...)*/\r
-       void *far_ptr;\r
-       /*field name*/\r
-       const char *name;\r
-       /*NDT type in case of SF/MFNode field - cf BIFS specific tools*/\r
-       u32 NDTtype;\r
-       /*event type*/\r
-       u32 eventType;\r
-       /*eventin handler if any*/\r
-       void (*on_event_in)(GF_Node *pNode);\r
-} GF_FieldInfo;\r
-\r
-/*returns number of field for this node*/\r
-u32 gf_node_get_field_count(GF_Node *node);\r
-\r
-/*fill the field info structure for the given field*/\r
-GF_Err gf_node_get_field(GF_Node *node, u32 FieldIndex, GF_FieldInfo *info);\r
-\r
-/*get the field by its name*/\r
-GF_Err gf_node_get_field_by_name(GF_Node *node, char *name, GF_FieldInfo *field);\r
-\r
-typedef struct __tag_scene_graph GF_SceneGraph;\r
-\r
-/*scene graph constructor*/\r
-GF_SceneGraph *gf_sg_new();\r
-\r
-/*creates a sub scene graph (typically used with Inline node): independent graph with same private stack, \r
-and user callbacks as parent. All routes triggered in this subgraph are executed in the parent graph (this \r
-means you only have to activate routes on the main graph)\r
-NOTE: the resulting graph is not destroyed when the parent graph is \r
-*/\r
-GF_SceneGraph *gf_sg_new_subscene(GF_SceneGraph *scene);\r
-\r
-/*destructor*/\r
-void gf_sg_del(GF_SceneGraph *sg);\r
-/*reset the full graph - all nodes, routes and protos are destroyed*/\r
-void gf_sg_reset(GF_SceneGraph *sg);\r
-\r
-/*parses the given XML document and returns a scene graph composed of GF_DOMFullNode*/\r
-GF_Err gf_sg_new_from_xml_doc(const char *src, GF_SceneGraph **scene);\r
-\r
-/*set/get user private data*/\r
-void gf_sg_set_private(GF_SceneGraph *sg, void *user_priv);\r
-void *gf_sg_get_private(GF_SceneGraph *sg);\r
-\r
-/*set the scene timer (fct returns time in sec)*/\r
-void gf_sg_set_scene_time_callback(GF_SceneGraph *scene, Double (*GetSceneTime)(void *user_priv) );\r
-\r
-enum\r
-{\r
-       /*function called upon node creation. \r
-               ctxdata is not used*/\r
-       GF_SG_CALLBACK_INIT = 0,\r
-       /*function called upon node modification. You typically will set some of the dirty flags here.\r
-               ctxdata is the fieldInfo pointer of the modified field*/\r
-       GF_SG_CALLBACK_MODIFIED,\r
-       /*function called when the a "set dirty" propagates to root node of the graph\r
-               ctxdata is not used*/\r
-       GF_SG_CALLBACK_GRAPH_DIRTY,\r
-};\r
-\r
-/*set node callback: function called upon node creation. \r
-Application should instanciate the node rendering stack and any desired callback*/\r
-void gf_sg_set_node_callback(GF_SceneGraph *sg, void (*NodeCallback)(void *user_priv, u32 type, GF_Node *node, void *ctxdata) );\r
-\r
-/*get/set the root node of the graph*/\r
-GF_Node *gf_sg_get_root_node(GF_SceneGraph *sg);\r
-void gf_sg_set_root_node(GF_SceneGraph *sg, GF_Node *node);\r
-\r
-/*finds a registered node by ID*/\r
-GF_Node *gf_sg_find_node(GF_SceneGraph *sg, u32 nodeID);\r
-/*finds a registered node by DEF name*/\r
-GF_Node *gf_sg_find_node_by_name(GF_SceneGraph *sg, char *name);\r
-\r
-/*used to signal modification of a node, indicating which field is modified - exposed for BIFS codec, \r
-should not be needed by other apps*/\r
-void gf_node_changed(GF_Node *node, GF_FieldInfo *fieldChanged);\r
-\r
-/*returns the graph this node belongs to*/\r
-GF_SceneGraph *gf_node_get_graph(GF_Node *node);\r
-\r
-/*Set size info for the graph - by default graphs have no size and are in meter metrics (VRML like)\r
-if any of width or height is 0, the graph has no size info*/\r
-void gf_sg_set_scene_size_info(GF_SceneGraph *sg, u32 width, u32 Height, Bool usePixelMetrics);\r
-/*returns 1 if pixelMetrics*/\r
-Bool gf_sg_use_pixel_metrics(GF_SceneGraph *sg);\r
-/*returns 0 if no size info, otherwise 1 and set width/height*/\r
-Bool gf_sg_get_scene_size_info(GF_SceneGraph *sg, u32 *width, u32 *Height);\r
-\r
-/*creates a node of the given tag. sg is the parent scenegraph of the node,\r
-eg the root one for scene nodes or the proto one for proto code (cf proto)\r
-Note:\r
-       - NODE IS NOT REGISTERED (no instances) AND CANNOT BE DESTROYED UNTIL REGISTERED\r
-       - this doesn't perform application setup for the node, this must be done by the caller\r
-*/\r
-GF_Node *gf_node_new(GF_SceneGraph *sg, u32 tag);\r
-/*inits node (either internal stack or user-defined) - usually called once the node has been fully loaded*/\r
-void gf_node_init(GF_Node *node);\r
-\r
-/*clones a node in the given graph and register with parent cloned. The cloning handles ID based on id_suffix:\r
- id_suffix = NULL: all IDs are removed from the cloned subtree, (each node instance will become a hard copy)\r
- id_suffix = "": ID will be kept exactly as they where in the original subtree - this may lead to errors due to \r
-               the presence of the same ID depending on the standard (DOM, ...).\r
- id_suffix = anything: all IDs are translated ($(name) -> $(name)id_suffix) and bynary IDs are generated on the fly\r
-*/\r
-GF_Node *gf_node_clone(GF_SceneGraph *inScene, GF_Node *orig, GF_Node *cloned_parent, char *id_suffix, Bool deep);\r
-\r
-/*gets scene time for scene this node belongs too, 0 if timeline not specified*/\r
-Double gf_node_get_scene_time(GF_Node *node);\r
-\r
-/*retuns next available NodeID*/\r
-u32 gf_sg_get_next_available_node_id(GF_SceneGraph *sg);\r
-/*retuns max ID used in graph*/\r
-u32 gf_sg_get_max_node_id(GF_SceneGraph *sg);\r
-\r
-const char *gf_node_get_name_and_id(GF_Node*node, u32 *id);\r
-\r
-\r
-enum\r
-{\r
-       GF_SG_FOCUS_AUTO = 1,\r
-       GF_SG_FOCUS_NEXT,\r
-       GF_SG_FOCUS_PREV,\r
-       GF_SG_FOCUS_NORTH,\r
-       GF_SG_FOCUS_NORTH_EAST,\r
-       GF_SG_FOCUS_EAST,\r
-       GF_SG_FOCUS_SOUTH_EAST,\r
-       GF_SG_FOCUS_SOUTH,\r
-       GF_SG_FOCUS_SOUTH_WEST,\r
-       GF_SG_FOCUS_WEST,\r
-       GF_SG_FOCUS_NORTH_WEST\r
-};\r
-\r
-typedef struct\r
-{\r
-       const char *url;\r
-       const char **params;\r
-       u32 nb_params;\r
-} GF_JSAPIURI;\r
-\r
-typedef struct\r
-{\r
-       const char *section;\r
-       const char *key;\r
-       const char *key_val;\r
-} GF_JSAPIOPT;\r
-\r
-       /*for script message option*/\r
-typedef struct\r
-{\r
-       GF_Err e;\r
-       const char *msg;\r
-} GF_JSAPIINFO;\r
-\r
-\r
-typedef union\r
-{\r
-       u32 opt;\r
-       Fixed val;\r
-       GF_Point2D pt;\r
-       GF_Rect rc;\r
-       Double time;\r
-       GF_BBox bbox;\r
-       GF_Matrix mx;\r
-       GF_JSAPIURI uri;\r
-       GF_JSAPIOPT gpac_cfg;\r
-       GF_Node *node;\r
-       struct __gf_download_manager *dnld_man;\r
-       GF_SceneGraph *scene;\r
-       void *term;\r
-       GF_JSAPIINFO info;\r
-} GF_JSAPIParam;\r
-\r
-enum\r
-{\r
-       /*!push message from script engine.*/\r
-       GF_JSAPI_OP_MESSAGE,\r
-       /*!get scene URI.*/\r
-       GF_JSAPI_OP_GET_SCENE_URI,\r
-       /*!get current user agent scale.*/\r
-       GF_JSAPI_OP_GET_SCALE,\r
-       /*!set current user agent scale.*/\r
-       GF_JSAPI_OP_SET_SCALE,\r
-       /*!get current user agent rotation.*/\r
-       GF_JSAPI_OP_GET_ROTATION,\r
-       /*!set current user agent rotation.*/\r
-       GF_JSAPI_OP_SET_ROTATION,\r
-       /*!get current user agent translation.*/\r
-       GF_JSAPI_OP_GET_TRANSLATE,\r
-       /*!set current user agent translation.*/\r
-       GF_JSAPI_OP_SET_TRANSLATE,\r
-       /*!get node time.*/\r
-       GF_JSAPI_OP_GET_TIME,\r
-       /*!set node time.*/\r
-       GF_JSAPI_OP_SET_TIME,\r
-       /*!get current viewport.*/\r
-       GF_JSAPI_OP_GET_VIEWPORT,\r
-       /*!get object bounding box in object local coord system.*/\r
-       GF_JSAPI_OP_GET_LOCAL_BBOX,\r
-       /*!get object bounding box in world (screen) coord system.*/\r
-       GF_JSAPI_OP_GET_SCREEN_BBOX,\r
-       /*!get transform matrix at object.*/\r
-       GF_JSAPI_OP_GET_TRANSFORM,\r
-       /*!move focus according to opt value.*/\r
-       GF_JSAPI_OP_MOVE_FOCUS,\r
-       /*!set focus to given node.*/\r
-       GF_JSAPI_OP_GET_FOCUS,\r
-       /*!set focus to given node.*/\r
-       GF_JSAPI_OP_SET_FOCUS,\r
-       /*!replace target scene URL*/\r
-       GF_JSAPI_OP_LOAD_URL,\r
-       /*!get option by section and key*/\r
-       GF_JSAPI_OP_GET_OPT,\r
-       /*!get option by section and key*/\r
-       GF_JSAPI_OP_SET_OPT,\r
-       /*!retrieve download manager*/\r
-       GF_JSAPI_OP_GET_DOWNLOAD_MANAGER,\r
-       /*!get navigation speed if any*/\r
-       GF_JSAPI_OP_GET_SPEED,\r
-       /*!get current frame rate*/\r
-       GF_JSAPI_OP_GET_FPS,\r
-       /*!set current title*/\r
-       GF_JSAPI_OP_SET_TITLE,\r
-       /*!gets DCCI scenegraph if any*/\r
-       GF_JSAPI_OP_GET_DCCI,\r
-       /*!gets subscene for current node if any*/\r
-       GF_JSAPI_OP_GET_SUBSCENE,\r
-       /*!resolves relative Xlink based on xml:base*/\r
-       GF_JSAPI_OP_RESOLVE_XLINK,\r
-       /*!evaluates if the given IRI is available for playback (returns 1) or not. If the IRI is\r
-       NULL, this evaluates whether the scene is ready for composition (canvas setup) or not.*/\r
-       GF_JSAPI_OP_EVAL_IRI,\r
-\r
-       /*!gets GPAC terminal*/\r
-       GF_JSAPI_OP_GET_TERM,\r
-\r
-       /*!pauses an SVG element*/\r
-       GF_JSAPI_OP_PAUSE_SVG,\r
-       /*!resumes an SVG ELEMENT*/\r
-       GF_JSAPI_OP_RESUME_SVG,\r
-       /*!gets the DPI*/\r
-       GF_JSAPI_OP_GET_DPI_X,\r
-       GF_JSAPI_OP_GET_DPI_Y,\r
-};\r
-/*\r
-interface to various get/set options:\r
-       type: operand type, one of the above\r
-       node: target node, scene root node or NULL\r
-       param: i/o param, depending on operand type\r
-*/\r
-typedef Bool (*gf_sg_script_action)(void *callback, u32 type, GF_Node *node, GF_JSAPIParam *param);\r
-\r
-/*assign API to scene graph - by default, sub-graphs inherits the API if set*/\r
-void gf_sg_set_script_action(GF_SceneGraph *scene, gf_sg_script_action script_act, void *cbk);\r
-\r
-/*load script into engine - this should be called only for script in main scene, loading of scripts\r
-in protos is done internally when instanciating the proto*/\r
-void gf_sg_script_load(GF_Node *script);\r
-\r
-/*returns true if current lib has javascript support*/\r
-Bool gf_sg_has_scripting();\r
-\r
-\r
-\r
-/*\r
-                       scene graph command tools used for BIFS and LASeR\r
-               These are used to store updates in memory without applying changes to the graph, \r
-       for dumpers, encoders ... \r
-               The commands can then be applied through this lib\r
-*/\r
-\r
-/*\r
-               Currently defined possible modifications\r
-*/\r
-enum\r
-{\r
-       /*BIFS commands*/\r
-       GF_SG_SCENE_REPLACE = 0,\r
-       GF_SG_NODE_REPLACE,\r
-       GF_SG_FIELD_REPLACE, \r
-       GF_SG_INDEXED_REPLACE,\r
-       GF_SG_ROUTE_REPLACE,\r
-       GF_SG_NODE_DELETE,\r
-       GF_SG_INDEXED_DELETE,\r
-       GF_SG_ROUTE_DELETE,\r
-       GF_SG_NODE_INSERT,\r
-       GF_SG_INDEXED_INSERT,\r
-       GF_SG_ROUTE_INSERT,\r
-       /*extended updates (BIFS-only)*/\r
-       GF_SG_PROTO_INSERT,\r
-       GF_SG_PROTO_DELETE,\r
-       GF_SG_PROTO_DELETE_ALL,\r
-       GF_SG_MULTIPLE_REPLACE,\r
-       GF_SG_MULTIPLE_INDEXED_REPLACE,\r
-       GF_SG_GLOBAL_QUANTIZER,\r
-       /*same as NodeDelete, and also updates OrderedGroup.order when deleting a child*/\r
-       GF_SG_NODE_DELETE_EX,\r
-\r
-       /*BIFS*/\r
-       GF_SG_FIELD_REPLACE_OP, \r
-       GF_SG_INDEXED_REPLACE_OP,\r
-\r
-       GF_SG_LAST_BIFS_COMMAND,\r
-\r
-\r
-       /*LASER commands*/\r
-       GF_SG_LSR_NEW_SCENE,\r
-       GF_SG_LSR_REFRESH_SCENE,\r
-       GF_SG_LSR_ADD,\r
-       GF_SG_LSR_CLEAN,\r
-       GF_SG_LSR_REPLACE,\r
-       GF_SG_LSR_DELETE,\r
-       GF_SG_LSR_INSERT,\r
-       GF_SG_LSR_RESTORE,\r
-       GF_SG_LSR_SAVE,\r
-       GF_SG_LSR_SEND_EVENT,\r
-       GF_SG_LSR_ACTIVATE,\r
-       GF_SG_LSR_DEACTIVATE,\r
-\r
-       GF_SG_UNDEFINED\r
-};\r
-\r
-\r
-/*\r
-                               single command wrapper\r
-\r
-  NOTE: In order to maintain node registry, the nodes replaced/inserted MUST be registered with \r
-  their parents even when the command is never applied. Registering shall be performed \r
-  with gf_node_register (see below).\r
-  If you fail to do so, a node may be destroyed when destroying a command while still used\r
-  in another command or in the graph - this will just crash.\r
-*/\r
-\r
-/*structure used to store field info, pos and static pointers to GF_Node/MFNode in commands*/\r
-typedef struct\r
-{\r
-       u32 fieldIndex;\r
-       /*field type*/\r
-       u32 fieldType;\r
-       /*field pointer for multiple replace/multiple indexed replace - if multiple indexed replace, must be the SF field being changed*/\r
-       void *field_ptr;\r
-       /*replace/insert/delete pos - -1 is append except in multiple indexed replace*/\r
-       s32 pos;\r
-\r
-       /*Whenever field pointer is of type GF_Node, store the node here and set the far pointer to this address.*/\r
-       GF_Node *new_node;\r
-       /*Whenever field pointer is of type MFNode, store the node list here and set the far pointer to this address.*/\r
-       GF_ChildNodeItem *node_list;\r
-} GF_CommandField;\r
-\r
-typedef struct\r
-{\r
-       GF_SceneGraph *in_scene;\r
-       u32 tag;\r
-\r
-       /*node the command applies to - may be NULL*/\r
-       GF_Node *node;\r
-\r
-       /*list of GF_CommandField for all field commands replace/ index insert / index replace / index delete / MultipleReplace / MultipleIndexedreplace \r
-       the content is destroyed when deleting the command*/\r
-       GF_List *command_fields;\r
-\r
-       /*may be NULL, and may be present with any command inserting a node*/\r
-       GF_List *scripts_to_load;\r
-       /*for authoring purposes - must be cleaned by user*/\r
-       Bool unresolved;\r
-       char *unres_name;\r
-       \r
-       /*scene replace command: \r
-               root node is stored in com->node\r
-               protos are stored in com->new_proto_list\r
-               routes are stored as RouteInsert in the same frame\r
-               BIFS only\r
-       */\r
-       Bool use_names;\r
-\r
-       /*proto list to insert - BIFS only*/\r
-       GF_List *new_proto_list;\r
-       /*proto ID list to delete - BIFS only*/\r
-       u32 *del_proto_list;\r
-       u32 del_proto_list_size;\r
-\r
-\r
-       /*route insert, replace and delete (BIFS only)\r
-               fromNodeID is also used to identify operandElementId in LASeR Add/Replace\r
-\r
-       OR\r
-               sendEvent\r
-       */\r
-//     union {\r
-               u32 RouteID;\r
-               u32 send_event_name;\r
-//     };\r
-//     union {\r
-               char *def_name;\r
-               char *send_event_string;\r
-//     };\r
-//     union {\r
-               u32 fromNodeID;\r
-               s32 send_event_integer;\r
-//     };\r
-       u32 fromFieldIndex;\r
-\r
-//     union {\r
-               u32 toNodeID;\r
-               s32 send_event_x;\r
-//     };\r
-//     union {\r
-               u32 toFieldIndex;\r
-               s32 send_event_y;\r
-//     };\r
-       Bool aggregated;\r
-} GF_Command;\r
-\r
-\r
-/*creates command - graph only needed for SceneReplace*/\r
-GF_Command *gf_sg_command_new(GF_SceneGraph *in_scene, u32 tag);\r
-/*deletes command*/\r
-void gf_sg_command_del(GF_Command *com);\r
-/*apply command to graph - the command content is kept unchanged for authoring purposes - THIS NEEDS TESTING AND FIXING\r
-@time_offset: offset for time fields if desired*/\r
-GF_Err gf_sg_command_apply(GF_SceneGraph *inScene, GF_Command *com, Double time_offset);\r
-/*apply list if command to graph - the command content is kept unchanged for authoring purposes\r
-@time_offset: offset for time fields if desired*/\r
-GF_Err gf_sg_command_apply_list(GF_SceneGraph *graph, GF_List *comList, Double time_offset);\r
-/*returns new commandFieldInfo structure and registers it with command*/\r
-GF_CommandField *gf_sg_command_field_new(GF_Command *com);\r
-/*clones the command in another graph - needed for uncompressed conditional in protos\r
-if force_clone is not set and the target graph is the same as the command graph, nodes are just registered\r
-with the new commands rather than cloned*/\r
-GF_Command *gf_sg_command_clone(GF_Command *com, GF_SceneGraph *inGraph, Bool force_clone);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-\r
-\r
-#endif /*_GF_SCENEGRAPH_H_*/\r
-\r
-\r