synfig-core
1.0.3
|
Writeme. More...
#include "savecanvas.h"
#include "general.h"
#include "valuenode.h"
#include "valuenodes/valuenode_animated.h"
#include "valuenodes/valuenode_const.h"
#include "valuenodes/valuenode_linear.h"
#include "valuenodes/valuenode_staticlist.h"
#include "valuenodes/valuenode_dynamiclist.h"
#include "valuenodes/valuenode_reference.h"
#include "valuenodes/valuenode_subtract.h"
#include "valuenodes/valuenode_bline.h"
#include "valuenodes/valuenode_bone.h"
#include "valuenodes/valuenode_wplist.h"
#include "valuenodes/valuenode_dilist.h"
#include "dashitem.h"
#include "time.h"
#include "keyframe.h"
#include "layer.h"
#include "string.h"
#include "paramdesc.h"
#include "weightedvalue.h"
#include "pair.h"
#include "zstreambuf.h"
#include "importer.h"
#include "cairoimporter.h"
#include <libxml++/libxml++.h>
#include <ETL/stringf>
#include "gradient.h"
#include <errno.h>
#include <libxml/tree.h>
Macros | |
#define | COLOR_VALUE_TYPE_FORMAT "%f" |
#define | VECTOR_VALUE_TYPE_FORMAT "%0.10f" |
#define | TIME_TYPE_FORMAT "%0.3f" |
#define | VIEW_BOX_FORMAT "%f %f %f %f" |
Functions | |
xmlpp::Element * | encode_canvas (xmlpp::Element *root, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_value_node (xmlpp::Element *root, ValueNode::ConstHandle value_node, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_value_node_bone (xmlpp::Element *root, ValueNode::ConstHandle value_node, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_value_node_bone_id (xmlpp::Element *root, ValueNode::ConstHandle value_node, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_keyframe (xmlpp::Element *root, const Keyframe &kf, float fps) |
xmlpp::Element * | encode_interpolation (xmlpp::Element *root, Interpolation value, String attribute) |
xmlpp::Element * | encode_static (xmlpp::Element *root, bool s) |
xmlpp::Element * | encode_real (xmlpp::Element *root, Real v) |
xmlpp::Element * | encode_time (xmlpp::Element *root, Time t) |
xmlpp::Element * | encode_integer (xmlpp::Element *root, int i) |
xmlpp::Element * | encode_bool (xmlpp::Element *root, bool b) |
xmlpp::Element * | encode_string (xmlpp::Element *root, const String &str) |
xmlpp::Element * | encode_vector (xmlpp::Element *root, Vector vect) |
xmlpp::Element * | encode_color (xmlpp::Element *root, Color color) |
xmlpp::Element * | encode_angle (xmlpp::Element *root, Angle theta) |
xmlpp::Element * | encode_segment (xmlpp::Element *root, Segment seg) |
xmlpp::Element * | encode_bline_point (xmlpp::Element *root, BLinePoint bline_point) |
xmlpp::Element * | encode_width_point (xmlpp::Element *root, WidthPoint width_point) |
xmlpp::Element * | encode_dash_item (xmlpp::Element *root, DashItem dash_item) |
xmlpp::Element * | encode_gradient (xmlpp::Element *root, Gradient x) |
xmlpp::Element * | encode_value (xmlpp::Element *root, const ValueBase &data, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_list (xmlpp::Element *root, std::vector< ValueBase > list, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_transformation (xmlpp::Element *root, const Transformation &transformation) |
xmlpp::Element * | encode_weighted_value (xmlpp::Element *root, types_namespace::TypeWeightedValueBase &type, const ValueBase &data, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_pair (xmlpp::Element *root, types_namespace::TypePairBase &type, const ValueBase &data, Canvas::ConstHandle canvas) |
xmlpp::Element * | encode_animated (xmlpp::Element *root, ValueNode_Animated::ConstHandle value_node, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_subtract (xmlpp::Element *root, ValueNode_Subtract::ConstHandle value_node, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_static_list (xmlpp::Element *root, ValueNode_StaticList::ConstHandle value_node, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_dynamic_list (xmlpp::Element *root, ValueNode_DynamicList::ConstHandle value_node, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_linkable_value_node (xmlpp::Element *root, LinkableValueNode::ConstHandle value_node, Canvas::ConstHandle canvas=0) |
xmlpp::Element * | encode_layer (xmlpp::Element *root, Layer::ConstHandle layer) |
xmlpp::Element * | encode_canvas_toplevel (xmlpp::Element *root, Canvas::ConstHandle canvas) |
Variables | |
ReleaseVersion | save_canvas_version = ReleaseVersion(RELEASE_VERSION_END-1) |
int | valuenode_too_new_count |
save_canvas_external_file_callback_t | save_canvas_external_file_callback = NULL |
void * | save_canvas_external_file_user_data = NULL |
Writeme.
$Id$
#define COLOR_VALUE_TYPE_FORMAT "%f" |
Referenced by encode_color().
#define VECTOR_VALUE_TYPE_FORMAT "%0.10f" |
Referenced by encode_real(), and encode_vector().
#define TIME_TYPE_FORMAT "%0.3f" |
Referenced by encode_canvas().
Referenced by encode_canvas().
xmlpp::Element * encode_canvas | ( | xmlpp::Element * | root, |
Canvas::ConstHandle | canvas | ||
) |
If children is not empty (there are exported canvases in the current canvas) they must be listed in the defs section regardless the result of check the Value Node list (exported value nodes in the canvas) and if the canvas is in line or not. Inline canvases cannot have exported canvases inside.
References encode_keyframe(), encode_layer(), encode_value(), encode_value_node(), encode_value_node_bone(), synfig::Color::get_a(), synfig::RendDesc::get_antialias(), synfig::Color::get_b(), synfig::RendDesc::get_bg_color(), synfig::RendDesc::get_br(), synfig::RendDesc::get_frame_rate(), synfig::Color::get_g(), synfig::RendDesc::get_h(), synfig::Color::get_r(), synfig::Time::get_string(), synfig::RendDesc::get_time_end(), synfig::RendDesc::get_time_start(), synfig::RendDesc::get_tl(), synfig::RendDesc::get_w(), synfig::RendDesc::get_x_res(), synfig::RendDesc::get_y_res(), TIME_TYPE_FORMAT, and VIEW_BOX_FORMAT.
Referenced by encode_canvas_toplevel(), and encode_value().
xmlpp::Element * encode_value_node | ( | xmlpp::Element * | root, |
ValueNode::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas | ||
) |
References _, encode_animated(), encode_dynamic_list(), encode_linkable_value_node(), encode_static_list(), encode_subtract(), encode_value(), encode_value_node_bone_id(), and synfig::error().
Referenced by encode_animated(), encode_canvas(), encode_dynamic_list(), encode_layer(), encode_linkable_value_node(), encode_static_list(), and encode_subtract().
xmlpp::Element * encode_value_node_bone | ( | xmlpp::Element * | root, |
ValueNode::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas | ||
) |
References _, encode_linkable_value_node(), and synfig::error().
Referenced by encode_canvas().
xmlpp::Element * encode_value_node_bone_id | ( | xmlpp::Element * | root, |
ValueNode::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas | ||
) |
References synfig::Type::description, synfig::Type::Description::name, and synfig::type_bone_object.
Referenced by encode_value(), and encode_value_node().
xmlpp::Element* encode_keyframe | ( | xmlpp::Element * | root, |
const Keyframe & | kf, | ||
float | fps | ||
) |
References synfig::Keyframe::active(), synfig::Keyframe::get_description(), synfig::Time::get_string(), and synfig::Keyframe::get_time().
Referenced by encode_canvas().
xmlpp::Element* encode_interpolation | ( | xmlpp::Element * | root, |
Interpolation | value, | ||
String | attribute | ||
) |
xmlpp::Element* encode_static | ( | xmlpp::Element * | root, |
bool | s | ||
) |
Referenced by encode_value().
xmlpp::Element* encode_real | ( | xmlpp::Element * | root, |
Real | v | ||
) |
References VECTOR_VALUE_TYPE_FORMAT.
Referenced by encode_bline_point(), encode_dash_item(), encode_value(), encode_weighted_value(), and encode_width_point().
xmlpp::Element* encode_time | ( | xmlpp::Element * | root, |
Time | t | ||
) |
References synfig::Time::get_string().
Referenced by encode_value().
xmlpp::Element* encode_integer | ( | xmlpp::Element * | root, |
int | i | ||
) |
Referenced by encode_dash_item(), encode_value(), and encode_width_point().
xmlpp::Element* encode_bool | ( | xmlpp::Element * | root, |
bool | b | ||
) |
Referenced by encode_value().
xmlpp::Element* encode_string | ( | xmlpp::Element * | root, |
const String & | str | ||
) |
Referenced by encode_value().
xmlpp::Element* encode_vector | ( | xmlpp::Element * | root, |
Vector | vect | ||
) |
References VECTOR_VALUE_TYPE_FORMAT.
Referenced by encode_bline_point(), encode_segment(), encode_transformation(), and encode_value().
xmlpp::Element* encode_color | ( | xmlpp::Element * | root, |
Color | color | ||
) |
References COLOR_VALUE_TYPE_FORMAT, synfig::Color::get_a(), synfig::Color::get_b(), synfig::Color::get_g(), and synfig::Color::get_r().
Referenced by encode_gradient(), and encode_value().
xmlpp::Element* encode_angle | ( | xmlpp::Element * | root, |
Angle | theta | ||
) |
Referenced by encode_transformation(), and encode_value().
xmlpp::Element* encode_segment | ( | xmlpp::Element * | root, |
Segment | seg | ||
) |
References encode_vector(), synfig::Segment::p1, synfig::Segment::p2, synfig::Segment::t1, and synfig::Segment::t2.
Referenced by encode_value().
xmlpp::Element* encode_bline_point | ( | xmlpp::Element * | root, |
BLinePoint | bline_point | ||
) |
References synfig::Type::description, encode_real(), encode_vector(), synfig::BLinePoint::get_origin(), synfig::BLinePoint::get_split_tangent_both(), synfig::BLinePoint::get_tangent1(), synfig::BLinePoint::get_tangent2(), synfig::BLinePoint::get_vertex(), synfig::BLinePoint::get_width(), synfig::Type::Description::name, and synfig::type_bline_point.
Referenced by encode_value().
xmlpp::Element* encode_width_point | ( | xmlpp::Element * | root, |
WidthPoint | width_point | ||
) |
References synfig::Type::description, encode_integer(), encode_real(), synfig::WidthPoint::get_position(), synfig::WidthPoint::get_side_type_after(), synfig::WidthPoint::get_side_type_before(), synfig::WidthPoint::get_width(), synfig::Type::Description::name, and synfig::type_width_point.
Referenced by encode_value().
xmlpp::Element* encode_dash_item | ( | xmlpp::Element * | root, |
DashItem | dash_item | ||
) |
References synfig::Type::description, encode_integer(), encode_real(), synfig::DashItem::get_length(), synfig::DashItem::get_offset(), synfig::DashItem::get_side_type_after(), synfig::DashItem::get_side_type_before(), synfig::Type::Description::name, and synfig::type_dash_item.
Referenced by encode_value().
xmlpp::Element* encode_gradient | ( | xmlpp::Element * | root, |
Gradient | x | ||
) |
References synfig::Gradient::begin(), encode_color(), synfig::Gradient::end(), and synfig::Gradient::sort().
Referenced by encode_value().
xmlpp::Element * encode_value | ( | xmlpp::Element * | root, |
const ValueBase & | data, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References _, synfig::Type::description, encode_angle(), encode_bline_point(), encode_bool(), encode_canvas(), encode_color(), encode_dash_item(), encode_gradient(), encode_integer(), encode_interpolation(), encode_list(), encode_pair(), encode_real(), encode_segment(), encode_static(), encode_string(), encode_time(), encode_transformation(), encode_value_node_bone_id(), encode_vector(), encode_weighted_value(), encode_width_point(), synfig::error(), synfig::ValueBase::get(), synfig::ValueBase::get_interpolation(), synfig::ValueBase::get_list(), synfig::ValueBase::get_static(), synfig::ValueBase::get_type(), synfig::Type::Description::local_name, synfig::Type::Description::name, synfig::type_angle, synfig::type_bline_point, synfig::type_bone_valuenode, synfig::type_bool, synfig::type_canvas, synfig::type_color, synfig::type_dash_item, synfig::type_gradient, synfig::type_integer, synfig::type_list, synfig::type_nil, synfig::type_real, synfig::type_segment, synfig::type_string, synfig::type_time, synfig::type_transformation, synfig::type_vector, and synfig::type_width_point.
Referenced by encode_canvas(), encode_layer(), encode_linkable_value_node(), encode_list(), encode_pair(), encode_value_node(), and encode_weighted_value().
xmlpp::Element* encode_list | ( | xmlpp::Element * | root, |
std::vector< ValueBase > | list, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References encode_value().
Referenced by encode_value().
xmlpp::Element* encode_transformation | ( | xmlpp::Element * | root, |
const Transformation & | transformation | ||
) |
References synfig::Transformation::angle, encode_angle(), encode_vector(), synfig::Transformation::offset, synfig::Transformation::scale, and synfig::Transformation::skew_angle.
Referenced by encode_value().
xmlpp::Element* encode_weighted_value | ( | xmlpp::Element * | root, |
types_namespace::TypeWeightedValueBase & | type, | ||
const ValueBase & | data, | ||
Canvas::ConstHandle | canvas | ||
) |
xmlpp::Element* encode_pair | ( | xmlpp::Element * | root, |
types_namespace::TypePairBase & | type, | ||
const ValueBase & | data, | ||
Canvas::ConstHandle | canvas | ||
) |
xmlpp::Element* encode_animated | ( | xmlpp::Element * | root, |
ValueNode_Animated::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
xmlpp::Element* encode_subtract | ( | xmlpp::Element * | root, |
ValueNode_Subtract::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References encode_value_node(), and synfig::warning().
Referenced by encode_value_node().
xmlpp::Element* encode_static_list | ( | xmlpp::Element * | root, |
ValueNode_StaticList::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References encode_value_node().
Referenced by encode_value_node().
xmlpp::Element* encode_dynamic_list | ( | xmlpp::Element * | root, |
ValueNode_DynamicList::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References encode_value_node().
Referenced by encode_value_node().
xmlpp::Element* encode_linkable_value_node | ( | xmlpp::Element * | root, |
LinkableValueNode::ConstHandle | value_node, | ||
Canvas::ConstHandle | canvas = 0 |
||
) |
References encode_value(), encode_value_node(), synfig::get_file_version(), valuenode_too_new_count, and synfig::warning().
Referenced by encode_value_node(), and encode_value_node_bone().
xmlpp::Element* encode_layer | ( | xmlpp::Element * | root, |
Layer::ConstHandle | layer | ||
) |
References encode_value(), encode_value_node(), synfig::error(), synfig::ValueBase::get(), synfig::ValueBase::get_static(), synfig::ValueBase::get_type(), synfig::ValueBase::is_valid(), save_canvas_external_file_callback, save_canvas_external_file_user_data, synfig::ValueBase::set(), synfig::type_canvas, and synfig::type_string.
Referenced by encode_canvas().
xmlpp::Element* encode_canvas_toplevel | ( | xmlpp::Element * | root, |
Canvas::ConstHandle | canvas | ||
) |
References encode_canvas(), valuenode_too_new_count, and synfig::warning().
Referenced by synfig::canvas_to_string(), and synfig::save_canvas().
ReleaseVersion save_canvas_version = ReleaseVersion(RELEASE_VERSION_END-1) |
Referenced by synfig::get_file_version(), and synfig::set_file_version().
int valuenode_too_new_count |
Referenced by encode_canvas_toplevel(), and encode_linkable_value_node().
save_canvas_external_file_callback_t save_canvas_external_file_callback = NULL |
Referenced by encode_layer(), and synfig::set_save_canvas_external_file_callback().
void* save_canvas_external_file_user_data = NULL |
Referenced by encode_layer(), and synfig::set_save_canvas_external_file_callback().