📄 scenegraph_svg.h
字号:
SVG_StrokeDashArray stroke_dasharray; SVG_Length stroke_dashoffset; SVG_StrokeLineCap stroke_linecap; SVG_StrokeLineJoin stroke_linejoin; SVG_Number stroke_miterlimit; SVG_Length stroke_width; SVG_VectorEffect vector_effect; /* Full 1.1 props, i.e. not implemented *//* SVG_FontVariant *font_variant; SVG_String *font; SVG_String *font_size_adjust; SVG_String *font_stretch; SVG_String *direction; SVG_String *letter_spacing; SVG_String *text_decoration; SVG_String *unicode_bidi; SVG_String *word_spacing; SVG_String *clip; SVG_String *cursor; SVG_String *clip_path; SVG_String *clip_rule; SVG_String *mask; SVG_String *enable_background; SVG_String *filter; SVG_String *flood_color; SVG_String *flood_opacity; SVG_String *lighting_color; SVG_String *color_interpolation; SVG_String *color_interpolation_filters; SVG_String *color_profile; SVG_String *marker; SVG_String *marker_end; SVG_String *marker_mid; SVG_String *marker_start; SVG_String *alignment_baseline; SVG_String *baseline_shift; SVG_String *dominant_baseline; SVG_String *glyph_orientation_horizontal; SVG_String *glyph_orientation_vertical; SVG_String *kerning; SVG_String *writing_mode;*/} SVGProperties;/************************************* * Generic SVG element functions * *************************************/void gf_svg_properties_init_pointers(SVGPropertiesPointers *svg_props);void gf_svg_properties_reset_pointers(SVGPropertiesPointers *svg_props);void gf_svg_apply_animations(GF_Node *node, SVGPropertiesPointers *render_svg_props);Bool gf_svg_has_appearance_flag_dirty(u32 flags);Bool gf_svg_is_element_transformable(u32 tag);void *gf_svg_create_attribute_value(u32 attribute_type);void gf_svg_delete_attribute_value(u32 type, void *value, GF_SceneGraph *sg);/* a == b */Bool gf_svg_attributes_equal(GF_FieldInfo *a, GF_FieldInfo *b);/* a = b */GF_Err gf_svg_attributes_copy(GF_FieldInfo *a, GF_FieldInfo *b, Bool clamp);/* c = a + b */GF_Err gf_svg_attributes_add(GF_FieldInfo *a, GF_FieldInfo *b, GF_FieldInfo *c, Bool clamp);Bool gf_svg_attribute_is_interpolatable(u32 type) ;/* c = coef * a + (1 - coef) * b */GF_Err gf_svg_attributes_interpolate(GF_FieldInfo *a, GF_FieldInfo *b, GF_FieldInfo *c, Fixed coef, Bool clamp);/* c = alpha * a + beta * b */GF_Err gf_svg_attributes_muladd(Fixed alpha, GF_FieldInfo *a, Fixed beta, GF_FieldInfo *b, GF_FieldInfo *c, Bool clamp);GF_Err gf_svg_get_attribute_by_tag(GF_Node *node, u32 attribute_tag, Bool create_if_not_found, Bool set_default, GF_FieldInfo *field);char *gf_svg_attribute_type_to_string(u32 att_type);GF_Err gf_svg_parse_attribute(GF_Node *n, GF_FieldInfo *info, char *attribute_content, u8 anim_value_type);void gf_svg_parse_style(GF_Node *n, char *style);GF_Err gf_svg_dump_attribute(GF_Node *elt, GF_FieldInfo *info, char *attValue);GF_Err gf_svg_dump_attribute_indexed(GF_Node *elt, GF_FieldInfo *info, char *attValue);Bool gf_svg_store_embedded_data(XMLRI *iri, const char *cache_dir, const char *base_filename);void gf_svg_path_build(GF_Path *path, GF_List *commands, GF_List *points);void gf_svg_register_iri(GF_SceneGraph *sg, XMLRI *iri);void gf_svg_unregister_iri(GF_SceneGraph *sg, XMLRI *iri);GF_Err gf_svg_parse_element_id(GF_Node *n, const char *nodename, Bool warning_if_defined);const char *gf_svg_get_system_paint_server_name(u32 paint_type);u32 gf_svg_get_system_paint_server_type(const char *name);Bool gf_smil_notify_timed_elements(GF_SceneGraph *sg);void gf_smil_timing_insert_clock(GF_Node *elt, Bool is_end, Double clock);/******************************************************************************* * * SVG Scene Graph for dynamic allocation of attributes * * *******************************************************************************//*SVG attributes are just DOM ones*/typedef struct __dom_base_attribute SVGAttribute;typedef struct __dom_full_attribute SVGExtendedAttribute;typedef struct __dom_base_node SVG_Element;typedef struct __xml_ev_handler SVG_handlerElement;typedef struct _all_atts SVGAllAttributes;void gf_svg_flatten_attributes(SVG_Element *e, SVGAllAttributes *all_atts);const char *gf_svg_get_attribute_name(u32 tag);u32 gf_svg_apply_inheritance(SVGAllAttributes *all_atts, SVGPropertiesPointers *render_svg_props) ;u32 gf_svg_get_attribute_type(u32 tag);SVGAttribute *gf_svg_create_attribute(GF_Node *node, u32 tag);u32 gf_svg_get_attribute_tag(u32 element_tag, const char *attribute_name);u32 gf_svg_get_element_tag(const char *element_name);/******************************************************************************* * * SVG Scene Graph for both static allocation implementations * *******************************************************************************/#ifdef GPAC_ENABLE_SVG_SA_BASEtypedef struct {/* SVG_ID id / xml_id; are actually nodeID in the sgprivate structure */ XMLRI base; SVG_LanguageID lang; XML_Space space; SVG_String _class; SVG_Boolean eRR;} XMLCoreAttributes;typedef struct { SVG_FocusHighlight focusHighlight; Bool focusable; SVG_Focus nav_next, nav_prev; SVG_Focus nav_down, nav_down_left, nav_down_right; SVG_Focus nav_left, nav_right; SVG_Focus nav_up, nav_up_left, nav_up_right;} SVGFocusAttributes;typedef struct { XMLRI href; SVG_ContentType type; SVG_String title; XMLRI arcrole; XMLRI role; SVG_String show; SVG_String actuate;} XLinkAttributes;typedef struct { SMIL_Times begin, end; SVG_Clock clipBegin, clipEnd; SMIL_Duration dur; SMIL_RepeatCount repeatCount; SMIL_Duration repeatDur; SMIL_Restart restart; SMIL_Fill fill; SMIL_Duration max; SMIL_Duration min; struct _smil_timing_rti *runtime; /* contains values for runtime handling of the SMIL timing */} SMILTimingAttributes;typedef struct { SMIL_SyncBehavior syncBehavior, syncBehaviorDefault; SMIL_SyncTolerance syncTolerance, syncToleranceDefault; SVG_Boolean syncMaster; SVG_String syncReference;} SMILSyncAttributes;typedef struct { SMIL_AttributeName attributeName; SMIL_AttributeType attributeType; SMIL_AnimateValue to, by, from; SMIL_AnimateValues values; SMIL_CalcMode calcMode; SMIL_Accumulate accumulate; SMIL_Additive additive; SMIL_KeySplines keySplines; SMIL_KeyTimes keyTimes; SVG_TransformType type; SVG_Boolean lsr_enabled;} SMILAnimationAttributes;typedef struct { SVG_ListOfIRI requiredExtensions; SVG_ListOfIRI requiredFeatures; SVG_FontList requiredFonts; SVG_FormatList requiredFormats; SVG_LanguageIDs systemLanguage;} SVGConditionalAttributes;typedef struct{ char *data; u32 data_size; GF_List *com_list; void (*exec_command_list)(void *script);} SVGCommandBuffer;u32 gf_svg_sa_node_type_by_class_name(const char *element_name);#endif/******************************************************************************* * * SVG Scene Graph for static allocation and inheritance * * *******************************************************************************/#ifdef GPAC_ENABLE_SVG_SA/* Common structure for all SVG elements */#define BASE_SVG_ELEMENT \ BASE_NODE \ CHILDREN \ SVG_String textContent; \ XMLCoreAttributes *core; \ SVGProperties *properties; \ SVGConditionalAttributes *conditional; \ SVGFocusAttributes *focus; \ SMILTimingAttributes *timing; \ SMILTimingAttributesPointers *timingp; \ SMILAnimationAttributes *anim; \ SMILAnimationAttributesPointers *animp; \ SMILSyncAttributes *sync; \ XLinkAttributes *xlink; \ XLinkAttributesPointers *xlinkp; \typedef struct { BASE_SVG_ELEMENT} SVG_SA_Element;/* Common structure for all SVG elements potentially transformable they have a transform attribute split in two: boolean to indicate if transform is ref + matrix they have an implicit pseudo-attribute which holds the supplemental transform computed by animateMotions elements */ #define TRANSFORMABLE_SVG_ELEMENT \ BASE_SVG_ELEMENT \ SVG_Transform transform; \ GF_Matrix2D *motionTransform; typedef struct _svg_transformable_element { TRANSFORMABLE_SVG_ELEMENT} SVGTransformableElement;u32 gf_svg_sa_apply_inheritance(SVG_SA_Element *elt, SVGPropertiesPointers *render_svg_props);#endif/******************************************************************************* * * SVG Scene Graph for static allocation and no inheritance * * *******************************************************************************/#ifdef GPAC_ENABLE_SVG_SANI#define BASE_SVG_SANI_ELEMENT \ BASE_NODE \ CHILDREN \ SVG_String textContent; \ XMLCoreAttributes *core; \ SVGConditionalAttributes *conditional; \ SVGFocusAttributes *focus; \ SMILTimingAttributes *timing; \ SMILTimingAttributesPointers *timingp; \ SMILAnimationAttributes *anim; \ SMILAnimationAttributesPointers *animp; \ SMILSyncAttributes *sync; \ XLinkAttributes *xlink; \ XLinkAttributesPointers *xlinkp;typedef struct _svg_sani_element { BASE_SVG_SANI_ELEMENT} SVG_SANI_Element;/* Common structure for all SVG elements potentially transformable they have a transform attribute split in two: boolean to indicate if transform is ref + matrix they have an implicit pseudo-attribute which holds the supplemental transform computed by animateMotions elements */ #define TRANSFORMABLE_SVG_SANI_ELEMENT \ BASE_SVG_SANI_ELEMENT \ SVG_Transform transform; \ GF_Matrix2D *motionTransform; typedef struct _svg_sani_transformable_element { TRANSFORMABLE_SVG_SANI_ELEMENT} SVG_SANI_TransformableElement;/************************************* * Generic SVG_SANI_ element functions * *************************************//*the exported functions used by the scene graph*/void gf_svg_sani_apply_animations(GF_Node *node);Bool gf_svg_sani_has_appearance_flag_dirty(u32 flags);Bool is_svg_sani_animation_tag(u32 tag);Bool gf_svg_sani_is_element_transformable(u32 tag);#endif /*GPAC_ENABLE_SVG_SANI*/#ifdef __cplusplus}#endif#endif //_GF_SG_SVG_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -