⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scenegraph_dev.h

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 H
📖 第 1 页 / 共 2 页
字号:
Bool gf_smil_timing_is_active(GF_Node *node);void gf_smil_timing_init_runtime_info(GF_Node *timed_elt);void gf_smil_timing_delete_runtime_info(GF_Node *timed_elt, SMIL_Timing_RTI *rti);Fixed gf_smil_timing_get_normalized_simple_time(SMIL_Timing_RTI *rti, Double scene_time);/*returns 1 if an animation changed a value in the rendering tree */s32 gf_smil_timing_notify_time(SMIL_Timing_RTI *rti, Double scene_time);void gf_smil_set_media_duration(SMIL_Timing_RTI *rti, Double media_duration);/* SMIL Animation Structures *//* This structure is used per animated attribute,   it contains:    - all the animations applying to the same attribute,    - the specified value before any inheritance has been applied nor any animation started 	    (as specified in the SVG document),    - the presentation value passed from one animation to the next one, at the same level in the tree	- a boolean indicating if the animated attribute is in fact a property      and if the attribute is a property:	- a pointer to presentation value passed from the previous level in the tree	- a pointer to the value of the color property (for handling of 'currentColor'), from previous level in the tree	- the location of the attribute in the elt structure when it was created 	  (used for fast comparison of SVG properties when animating from/to/by/values/... inherited values)*/typedef struct {	GF_List *anims;	GF_FieldInfo specified_value;	GF_FieldInfo presentation_value;	Bool is_property;	GF_FieldInfo parent_presentation_value;	GF_FieldInfo current_color_value;	void *orig_dom_ptr;	/* flag set by any animation to inform other animations that there base value has changed */	Bool presentation_value_changed;	/* flag used for rendering */	u32 dirty_flags;} SMIL_AttributeAnimations;/* This structure is per animation element,    it holds the result of the animation and    some info to make animation computation faster */typedef struct {	SMIL_AttributeAnimations *owner;	Bool is_first_anim;	/* animation element */	GF_Node *anim_elt;	SMILAnimationAttributesPointers *animp;	SMILTimingAttributesPointers *timingp;	XLinkAttributesPointers *xlinkp;	/* in case of animateTransform without from or to, the underlying value is the identity transform */	GF_Matrix2D identity;	GF_FieldInfo default_transform_value;	/* result of the animation */	GF_FieldInfo interpolated_value;		/* has the interpolated value changed since last cycle */	Bool interpolated_value_changed;	/* last value of the animation, used in accumulation phase */	GF_FieldInfo last_specified_value;	/* temporary value needed when the type of 	   the key values is different from the target attribute type */	GF_FieldInfo tmp_value;	s32		previous_key_index;	Fixed	previous_coef;	u32		previous_keytime_index;	Bool set_done;	GF_Path *path;	u8 rotate;	GF_PathIterator *path_iterator;	Fixed length;} SMIL_Anim_RTI;void gf_smil_anim_init_node(GF_Node *node);void gf_smil_anim_init_discard(GF_Node *node);void gf_smil_anim_init_runtime_info(GF_Node *node);void gf_smil_anim_delete_runtime_info(SMIL_Anim_RTI *rai);void gf_smil_anim_delete_animations(GF_Node *e);void gf_smil_anim_remove_from_target(GF_Node *anim, GF_Node *target);void gf_sg_handle_dom_event(GF_Node *hdl, GF_DOM_Event *event);void gf_smil_setup_events(GF_Node *node);Bool svg_script_execute_handler(GF_Node *node, GF_DOM_Event *event);void gf_smil_anim_reset_variables(SMIL_Anim_RTI *rai);SMIL_Anim_RTI *gf_smil_anim_get_anim_runtime_from_timing(SMIL_Timing_RTI *rti);#endif////		MF Fields tools//	WARNING: MF / SF Nodes CANNOT USE THESE FUNCTIONS////return the size (in bytes) of fixed fields (buffers are handled as a char ptr , 1 byte)u32 gf_sg_vrml_get_sf_size(u32 FieldType);/*BASE node (GF_Node) destructor*/void gf_node_free(GF_Node *node);/*node destructor dispatcher: redirects destruction for each graph type: VRML/MPEG4, X3D, SVG...)*/void gf_node_del(GF_Node *node);/*creates an undefined GF_Node - for parsing only*/GF_Node *gf_sg_new_base_node();/*returns field type from its name*/u32 gf_sg_field_type_by_name(char *fieldType);/*			Proto node*//*field interface to codec. This is used to do the node decoding, index translationand all QP/BIFS Anim parsing. */struct _protofield{	u8 EventType;	u8 FieldType;	/*if UseName, otherwise fieldN*/	char *FieldName;	/*default field value*/	void *def_value;		GF_Node *def_sfnode_value;	GF_ChildNodeItem *def_mfnode_value;	/*for instanciation - if externProto dit not specify field val*/	u8 val_not_loaded;	/*coding indexes*/	u32 IN_index, OUT_index, DEF_index, ALL_index;	/*Quantization*/	u32 QP_Type, hasMinMax;	void *qp_min_value, *qp_max_value;	/*this is for QP=13 only*/	u32 NumBits;	/*Animation*/	u32 Anim_Type;	void *userpriv;	void (*OnDelete)(void *ptr);};GF_ProtoFieldInterface *gf_sg_proto_new_field_interface(u32 FieldType);/*proto field instance. since it is useless to duplicate all coding info, names and the likewe seperate proto declaration and proto instanciation*/typedef struct {	u8 EventType;	u8 FieldType;	u8 has_been_accessed;	void *field_pointer;} GF_ProtoField;struct _proto{	/*1 - Prototype interface*/	u32 ID;	char *Name;	GF_List *proto_fields;	/*pointer to parent scene graph*/	struct __tag_scene_graph *parent_graph;	/*pointer to proto scene graph*/	struct __tag_scene_graph *sub_graph;	/*2 - proto implementation as declared in the bitstream*/	GF_List *node_code;	/*num fields*/	u32 NumIn, NumOut, NumDef, NumDyn;	void *userpriv;	void (*OnDelete)(void *ptr);	/*URL of extern proto lib (if none, URL is empty)*/	MFURL ExternProto;	/*list of instances*/	GF_List *instances;};/*proto field API*/u32 gf_sg_proto_get_num_fields(GF_Node *node, u8 code_mode);GF_Err gf_sg_proto_get_field(GF_Proto *proto, GF_Node *node, GF_FieldInfo *field);typedef struct _proto_instance{	/*this is a node*/	BASE_NODE	/*Prototype interface for coding and field addressing*/	GF_Proto *proto_interface;	/*proto implementation at run-time (aka the state of the nodes may differ accross	different instances of the proto)*/	GF_List *fields;	/*a proto doesn't have one root SFnode but a collection of nodes for implementation*/	GF_List *node_code;	/*node for proto rendering, first of all declared nodes*/	GF_Node *RenderingNode;#ifndef GF_NODE_USE_POINTERS	/*in case the PROTO is destroyed*/	char *proto_name;#endif	/*scripts are loaded once all IS routes are activated and node code is loaded*/	GF_List *scripts_to_load;	Bool is_loaded;} GF_ProtoInstance;/*destroy proto*/void gf_sg_proto_del_instance(GF_ProtoInstance *inst);GF_Err gf_sg_proto_get_field_index(GF_ProtoInstance *proto, u32 index, u32 code_mode, u32 *all_index);Bool gf_sg_proto_get_aq_info(GF_Node *Node, u32 FieldIndex, u8 *QType, u8 *AType, Fixed *b_min, Fixed *b_max, u32 *QT13_bits);GF_Err gf_sg_proto_get_field_ind_static(GF_Node *Node, u32 inField, u8 IndexMode, u32 *allField);GF_Node *gf_sg_proto_create_node(GF_SceneGraph *scene, GF_Proto *proto, GF_ProtoInstance *from_inst);void gf_sg_proto_instanciate(GF_ProtoInstance *proto_node);/*get tag of first node in proto code - used for validation only*/u32 gf_sg_proto_get_render_tag(GF_Proto *proto);/*to call when a proto field has been modified (at creation or through commands, modifications through events are handled internally).node can be the proto instance or a node from the proto codethis will call NodeChanged if needed, forward to proto/node or trigger any route if needed*/void gf_sg_proto_check_field_change(GF_Node *node, u32 fieldIndex);s32 gf_sg_proto_get_field_index_by_name(GF_Proto *proto, GF_Node *node, char *name);/*		Script node*/typedef struct {	//extra script fields	GF_List *fields;	//BIFS coding stuff	u32 numIn, numDef, numOut;	/*pointer to original tables*/#ifdef GF_NODE_USE_POINTERS	GF_Err (*gf_sg_script_get_field)(GF_Node *node, GF_FieldInfo *info);	GF_Err (*gf_sg_script_get_field_index)(GF_Node *node, u32 inField, u8 IndexMode, u32 *allField);#endif#ifdef GPAC_HAS_SPIDERMONKEY	JSContext *js_ctx;	struct JSObject *js_obj;	struct JSObject *js_browser;	/*all attached objects (eg, not created by the script) are stored here so that we don't	allocate them again and again when getting properties. Garbage collection is performed (if needed)	on these objects after each eventIn execution*/	GF_List *js_cache;#endif	void (*JS_PreDestroy)(GF_Node *node);	void (*JS_EventIn)(GF_Node *node, GF_FieldInfo *in_field);	Bool is_loaded;} GF_ScriptPriv;/*setup script stack*/void gf_sg_script_init(GF_Node *node);/*get script field*/GF_Err gf_sg_script_get_field(GF_Node *node, GF_FieldInfo *info);/*get effective field count per event mode*/u32 gf_sg_script_get_num_fields(GF_Node *node, u8 IndexMode);/*translate field index from inMode to ALL mode*/GF_Err gf_sg_script_get_field_index(GF_Node *Node, u32 inField, u8 IndexMode, u32 *allField);/*create dynamic fields in the clone*/GF_Err gf_sg_script_prepare_clone(GF_Node *dest, GF_Node *orig);struct _scriptfield{	u32 eventType;	u32 fieldType;	char *name;	s32 IN_index, OUT_index, DEF_index;	u32 ALL_index;	//real field	void *pField;	Double last_route_time;	Bool activate_event_out;};#ifdef GPAC_HAS_SPIDERMONKEYJSContext *gf_sg_ecmascript_new();void gf_sg_ecmascript_del(JSContext *);void gf_sg_script_init_sm_api(GF_ScriptPriv *sc, GF_Node *script);JSBool gf_sg_script_eventout_set_prop(JSContext *c, JSObject *obj, jsval id, jsval *val);typedef struct {	GF_FieldInfo field;	GF_Node *owner;	JSObject *obj;	/*JS list for MFFields or NULL*/	JSObject *js_list;	/*when creating SFnode from inside the script, the node is stored here untill attached to an object*/	GF_Node *temp_node;	GF_ChildNodeItem *temp_list;	/*when not owned by a node*/	void *field_ptr;} GF_JSField;void gf_sg_script_to_node_field(JSContext *c, jsval v, GF_FieldInfo *field, GF_Node *owner, GF_JSField *parent);jsval gf_sg_script_to_smjs_field(GF_ScriptPriv *priv, GF_FieldInfo *field, GF_Node *parent, Bool no_cache);#ifndef GPAC_DISABLE_SVGvoid JSScript_LoadSVG(GF_Node *node);typedef struct __tag_svg_script_ctx {	Bool (*script_execute)(struct __tag_scene_graph *sg, char *utf8_script, GF_DOM_Event *event);	Bool (*handler_execute)(GF_Node *n, GF_DOM_Event *event);	u32 nb_scripts;	/*global script context for the scene*/	JSContext *js_ctx;	/*global object*/	JSObject *global;	/*global event object - used to update the associated DOMEvent (JS private stack) when dispatching events*/	JSObject *event;} GF_SVGJS;#endif	/*GPAC_DISABLE_SVG*//*initialize DOM Core (subset) + xmlHTTPRequest API. The global object MUST have private data storageand its private data MUST be a scenegraph. This scenegraph is only used to create new documentsand setup the callback pointers*/void dom_js_load(JSContext *c, JSObject *global);/*unloads the DOM core support (to be called upon destruction only, once the JSContext has been destroyedto releases all resources used by DOM JS)*/void dom_js_unload();/*defines a new global object "document" of type Document*/void dom_js_define_document(JSContext *c, JSObject *global, GF_SceneGraph *doc);/*defines a new global object "evt" of type Event*/JSObject *dom_js_define_event(JSContext *c, JSObject *global);jsval dom_element_construct(JSContext *c, GF_Node *n);GF_Node *dom_get_node(JSContext *c, JSObject *obj, Bool *is_doc);JSBool dom_event_add_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval);JSBool dom_event_remove_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval);#endif	/*GPAC_HAS_SPIDERMONKEY*/SVG_Element *gf_svg_create_node(u32 tag);Bool gf_svg_node_init(GF_Node *node);void gf_svg_node_del(GF_Node *node);Bool gf_svg_node_changed(GF_Node *node, GF_FieldInfo *field);const char *gf_svg_get_element_name(u32 tag);SVGAttribute *gf_svg_create_attribute_from_datatype(u32 data_type, u32 attribute_tag);GF_Err gf_svg_get_attribute_by_name(GF_Node *node, char *name, Bool create_if_not_found, Bool set_default, GF_FieldInfo *field);void *gf_svg_get_property_pointer(SVG_Element *elt, void *input_attribute,								   SVGPropertiesPointers *output_property_context);Bool gf_svg_is_property(GF_Node *node, GF_FieldInfo *target_attribute);/*exported for LASeR paring*/u32 svg_parse_point(SVG_Point *p, char *value_string);/*activates node. This is used by LASeR:activate and whenever a node is inserted in the scenethrough DOM*/GF_Err gf_node_activate(GF_Node *node);/*deactivates node. This is used by LASeR:deactivate and whenever a node is removed from the scenethrough DOM*/GF_Err gf_node_deactivate(GF_Node *node);/*post a listener to be added - this is only used by LASeR:activate and DOM.addEventListener. This is to ensure that when a node is processing an event creating a new listener on this node, this listenerwill not be triggered*/void gf_dom_listener_post_add(GF_Node *obs, GF_Node *listener);/*process all pending add_listener request*/void gf_dom_listener_process_add(GF_SceneGraph *sg);#ifdef GPAC_ENABLE_SVG_SASVG_SA_Element *gf_svg_sa_create_node(u32 ElementTag);const char *gf_svg_sa_get_element_name(u32 tag);Bool gf_svg_sa_node_changed(GF_Node *node, GF_FieldInfo *field);void gf_svg_sa_element_del(SVG_SA_Element *elt);void gf_svg_sa_reset_base_element(SVG_SA_Element *p);GF_Err gf_svg_sa_get_attribute_info(GF_Node *node, GF_FieldInfo *info);u32 gf_svg_sa_get_attribute_count(GF_Node *);void gf_svg_sa_init_core(SVG_SA_Element *p);void gf_svg_sa_init_conditional(SVG_SA_Element *p);void gf_svg_sa_init_sync(SVG_SA_Element *p);void gf_svg_sa_init_anim(SVG_SA_Element *p);void gf_svg_sa_init_timing(SVG_SA_Element *p);void gf_svg_sa_init_focus(SVG_SA_Element *p);void gf_svg_sa_init_properties(SVG_SA_Element *p);void gf_svg_sa_init_xlink(SVG_SA_Element *p);void gf_svg_sa_delete_xlink(SVG_SA_Element *elt, XLinkAttributes *p);s32 gf_svg_sa_get_attribute_index_by_name(GF_Node *node, char *name);Bool gf_svg_sa_node_init(GF_Node *node);void *gf_svg_sa_get_property_pointer(SVGPropertiesPointers *rendering_property_context, 								  SVGProperties *elt_property_context, 								  void *input_attribute);#endif#ifdef GPAC_ENABLE_SVG_SANIBool gf_svg_sani_node_init(GF_Node *node);Bool gf_svg_sani_node_changed(GF_Node *node, GF_FieldInfo *field);void gf_svg_sani_element_del(SVG_SANI_Element *elt);u32 gf_svg_sani_get_attribute_count(GF_Node *node);const char *gf_svg_sani_get_element_name(u32 tag);SVG_SANI_Element *gf_svg_sani_create_node(u32 ElementTag);GF_Err gf_svg_sani_get_attribute_info(GF_Node *node, GF_FieldInfo *info);u32 gf_svg_sani_get_rendering_flag_if_modified(SVG_SANI_Element *n, GF_FieldInfo *info);void gf_svg_sani_init_core(SVG_SANI_Element *p);void gf_svg_sani_init_focus(SVG_SANI_Element *p);void gf_svg_sani_init_xlink(SVG_SANI_Element *p);void gf_svg_sani_init_timing(SVG_SANI_Element *p);void gf_svg_sani_init_sync(SVG_SANI_Element *p);void gf_svg_sani_init_anim(SVG_SANI_Element *p);void gf_svg_sani_init_conditional(SVG_SANI_Element *p);void gf_svg_sani_reset_base_element(SVG_SANI_Element *p);u32 gf_svg_sani_type_by_class_name(const char *element_name);#endif#ifdef GPAC_ENABLE_SVG_SA_BASEvoid gf_svg_sa_delete_conditional(SVGConditionalAttributes *p);void gf_svg_sa_delete_sync(SMILSyncAttributes *p);void gf_svg_sa_delete_anim(SMILAnimationAttributes *p, GF_SceneGraph *sg);void gf_svg_sa_delete_timing(SMILTimingAttributes *p);void gf_svg_sa_init_lsr_conditional(SVGCommandBuffer *script);void gf_svg_sa_reset_lsr_conditional(SVGCommandBuffer *script);Bool gf_svg_sa_is_animation_tag(u32 tag);u32 gf_svg_sa_get_rendering_flag_if_modified(SVG_SA_Element *n, GF_FieldInfo *info);#endif#endif	/*_GF_SCENEGRAPH_DEV_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -