summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f1b47cc)
raw | patch | inline | side by side (parent: f1b47cc)
author | joncruz <joncruz@users.sourceforge.net> | |
Sat, 5 Jul 2008 05:11:28 +0000 (05:11 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sat, 5 Jul 2008 05:11:28 +0000 (05:11 +0000) |
index efed5ea4ba9cac0bd2c7ef6660578d622db3e80b..ec980810b66230ebcf51edd071b5b8338b769b81 100644 (file)
-#include <cxxtest/TestSuite.h>\r
-\r
-#include <glib.h>\r
-#include <libnr/nr-macros.h> /* NR_DF_TEST_CLOSE */\r
-#include <sstream>\r
-\r
-/* mental disclaims all responsibility for this evil idea for testing\r
- static functions. The main disadvantages are that we retain the\r
- #define's and `using' directives of the included file. */\r
-#include "bezier-utils.cpp"\r
-\r
-using NR::Point;\r
-\r
-/* (Returns false if NaN encountered.) */\r
-static bool range_approx_equal(double const a[], double const b[], unsigned const len) {\r
- for (unsigned i = 0; i < len; ++i) {\r
- if (!( fabs( a[i] - b[i] ) < 1e-4 )) {\r
- return false;\r
- }\r
- }\r
- return true;\r
-}\r
-\r
-static inline bool point_approx_equal(NR::Point const &a, NR::Point const &b, double const eps)\r
-{\r
- using NR::X; using NR::Y;\r
- return ( NR_DF_TEST_CLOSE(a[X], b[X], eps) &&\r
- NR_DF_TEST_CLOSE(a[Y], b[Y], eps) );\r
-}\r
-\r
-static inline double square(double const x) {\r
- return x * x;\r
-}\r
-\r
-/** Determine whether the found control points are the same as previously found on some developer's\r
- machine. Doesn't call utest__fail, just writes a message to stdout for diagnostic purposes:\r
- the most important test is that the root-mean-square of errors in the estimation are low rather\r
- than that the control points found are the same.\r
-**/\r
-static void compare_ctlpts(Point const est_b[], Point const exp_est_b[])\r
-{\r
- unsigned diff_mask = 0;\r
- for (unsigned i = 0; i < 4; ++i) {\r
- for (unsigned d = 0; d < 2; ++d) {\r
- if ( fabs( est_b[i][d] - exp_est_b[i][d] ) > 1.1e-5 ) {\r
- diff_mask |= 1 << ( i * 2 + d );\r
- }\r
- }\r
- }\r
- if ( diff_mask != 0 ) {\r
- std::stringstream msg;\r
- msg << "Got different control points from previously-coded (diffs=0x" << std::hex << diff_mask << "\n";\r
- msg << " Previous:";\r
- for (unsigned i = 0; i < 4; ++i) {\r
- msg << " (" << exp_est_b[i][0] << ", " << exp_est_b[i][1] << ")"; // localizing ok\r
- }\r
- msg << "\n";\r
- msg << " Found: ";\r
- for (unsigned i = 0; i < 4; ++i) {\r
- msg << " (" << est_b[i][0] << ", " << est_b[i][1] << ")"; // localizing ok\r
- }\r
- msg << "\n";\r
- TS_WARN(msg.str().c_str());\r
- }\r
-}\r
-\r
-static void compare_rms(Point const est_b[], double const t[], Point const d[], unsigned const n,\r
- double const exp_rms_error)\r
-{\r
- double sum_errsq = 0.0;\r
- for (unsigned i = 0; i < n; ++i) {\r
- Point const fit_pt = bezier_pt(3, est_b, t[i]);\r
- Point const diff = fit_pt - d[i];\r
- sum_errsq += dot(diff, diff);\r
- }\r
- double const rms_error = sqrt( sum_errsq / n );\r
- TS_ASSERT_LESS_THAN_EQUALS( rms_error , exp_rms_error + 1.1e-6 );\r
- if ( rms_error < exp_rms_error - 1.1e-6 ) {\r
- /* The fitter code appears to have improved [or the floating point calculations differ\r
- on this machine from the machine where exp_rms_error was calculated]. */\r
- char msg[200];\r
- sprintf(msg, "N.B. rms_error regression requirement can be decreased: have rms_error=%g.", rms_error); // localizing ok\r
- TS_TRACE(msg);\r
- }\r
-}\r
-\r
-class BezierUtilsTest : public CxxTest::TestSuite {\r
-public:\r
- static Point const c[4];\r
- static double const t[24];\r
- static unsigned const n;\r
- Point d[24];\r
- static Point const src_b[4];\r
- static Point const tHat1;\r
- static Point const tHat2;\r
-\r
- BezierUtilsTest()\r
- {\r
- /* Feed it some points that can be fit exactly with a single bezier segment, and see how\r
- well it manages. */\r
- for (unsigned i = 0; i < n; ++i) {\r
- d[i] = bezier_pt(3, src_b, t[i]);\r
- }\r
- }\r
- virtual ~BezierUtilsTest() {}\r
-\r
- void testCopyWithoutNansOrAdjacentDuplicates()\r
- {\r
- NR::Point const src[] = {\r
- Point(2., 3.),\r
- Point(2., 3.),\r
- Point(0., 0.),\r
- Point(2., 3.),\r
- Point(2., 3.),\r
- Point(1., 9.),\r
- Point(1., 9.)\r
- };\r
- Point const exp_dest[] = {\r
- Point(2., 3.),\r
- Point(0., 0.),\r
- Point(2., 3.),\r
- Point(1., 9.)\r
- };\r
- g_assert( G_N_ELEMENTS(src) == 7 );\r
- Point dest[7];\r
- struct tst {\r
- unsigned src_ix0;\r
- unsigned src_len;\r
- unsigned exp_dest_ix0;\r
- unsigned exp_dest_len;\r
- } const test_data[] = {\r
- /* src start ix, src len, exp_dest start ix, exp dest len */\r
- {0, 0, 0, 0},\r
- {2, 1, 1, 1},\r
- {0, 1, 0, 1},\r
- {0, 2, 0, 1},\r
- {0, 3, 0, 2},\r
- {1, 3, 0, 3},\r
- {0, 5, 0, 3},\r
- {0, 6, 0, 4},\r
- {0, 7, 0, 4}\r
- };\r
- for (unsigned i = 0 ; i < G_N_ELEMENTS(test_data) ; ++i) {\r
- tst const &t = test_data[i];\r
- TS_ASSERT_EQUALS( t.exp_dest_len,\r
- copy_without_nans_or_adjacent_duplicates(src + t.src_ix0,\r
- t.src_len,\r
- dest) );\r
- TS_ASSERT_SAME_DATA(dest,\r
- exp_dest + t.exp_dest_ix0,\r
- t.exp_dest_len);\r
- }\r
- }\r
-\r
- void testBezierPt1()\r
- {\r
- Point const a[] = {Point(2.0, 4.0),\r
- Point(1.0, 8.0)};\r
- TS_ASSERT_EQUALS( bezier_pt(1, a, 0.0) , a[0] );\r
- TS_ASSERT_EQUALS( bezier_pt(1, a, 1.0) , a[1] );\r
- TS_ASSERT_EQUALS( bezier_pt(1, a, 0.5) , Point(1.5, 6.0) );\r
- double const t[] = {0.5, 0.25, 0.3, 0.6};\r
- for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {\r
- double const ti = t[i], si = 1.0 - ti;\r
- TS_ASSERT_EQUALS( bezier_pt(1, a, ti) , si * a[0] + ti * a[1] );\r
- }\r
- }\r
-\r
- void testBezierPt2()\r
- {\r
- Point const b[] = {Point(1.0, 2.0),\r
- Point(8.0, 4.0),\r
- Point(3.0, 1.0)};\r
- TS_ASSERT_EQUALS( bezier_pt(2, b, 0.0) , b[0] );\r
- TS_ASSERT_EQUALS( bezier_pt(2, b, 1.0) , b[2] );\r
- TS_ASSERT_EQUALS( bezier_pt(2, b, 0.5) , Point(5.0, 2.75) );\r
- double const t[] = {0.5, 0.25, 0.3, 0.6};\r
- for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {\r
- double const ti = t[i], si = 1.0 - ti;\r
- Point const exp_pt( si*si * b[0] + 2*si*ti * b[1] + ti*ti * b[2] );\r
- Point const pt(bezier_pt(2, b, ti));\r
- TS_ASSERT(point_approx_equal(pt, exp_pt, 1e-11));\r
- }\r
- }\r
-\r
- void testBezierPt3()\r
- {\r
- TS_ASSERT_EQUALS( bezier_pt(3, c, 0.0) , c[0] );\r
- TS_ASSERT_EQUALS( bezier_pt(3, c, 1.0) , c[3] );\r
- TS_ASSERT_EQUALS( bezier_pt(3, c, 0.5) , Point(4.0, 13.0/8.0) );\r
- double const t[] = {0.5, 0.25, 0.3, 0.6};\r
- for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {\r
- double const ti = t[i], si = 1.0 - ti;\r
- TS_ASSERT( LInfty( bezier_pt(3, c, ti)\r
- - ( si*si*si * c[0] +\r
- 3*si*si*ti * c[1] +\r
- 3*si*ti*ti * c[2] +\r
- ti*ti*ti * c[3] ) )\r
- < 1e-4 );\r
- }\r
- }\r
-\r
- void testComputeMaxErrorRatio()\r
- {\r
- struct Err_tst {\r
- Point pt;\r
- double u;\r
- double err;\r
- } const err_tst[] = {\r
- {c[0], 0.0, 0.0},\r
- {Point(4.0, 13.0/8.0), 0.5, 0.0},\r
- {Point(4.0, 2.0), 0.5, 9.0/64.0},\r
- {Point(3.0, 2.0), 0.5, 1.0 + 9.0/64.0},\r
- {Point(6.0, 2.0), 0.5, 4.0 + 9.0/64.0},\r
- {c[3], 1.0, 0.0},\r
- };\r
- Point d[G_N_ELEMENTS(err_tst)];\r
- double u[G_N_ELEMENTS(err_tst)];\r
- for (unsigned i = 0; i < G_N_ELEMENTS(err_tst); ++i) {\r
- Err_tst const &t = err_tst[i];\r
- d[i] = t.pt;\r
- u[i] = t.u;\r
- }\r
- g_assert( G_N_ELEMENTS(u) == G_N_ELEMENTS(d) );\r
- unsigned max_ix = ~0u;\r
- double const err_ratio = compute_max_error_ratio(d, u, G_N_ELEMENTS(d), c, 1.0, &max_ix);\r
- TS_ASSERT_LESS_THAN( fabs( sqrt(err_tst[4].err) - err_ratio ) , 1e-12 );\r
- TS_ASSERT_EQUALS( max_ix , 4 );\r
- }\r
-\r
- void testChordLengthParameterize()\r
- {\r
- /* n == 2 */\r
- {\r
- Point const d[] = {Point(2.9415, -5.8149),\r
- Point(23.021, 4.9814)};\r
- double u[G_N_ELEMENTS(d)];\r
- double const exp_u[] = {0.0, 1.0};\r
- g_assert( G_N_ELEMENTS(u) == G_N_ELEMENTS(exp_u) );\r
- chord_length_parameterize(d, u, G_N_ELEMENTS(d));\r
- TS_ASSERT_SAME_DATA(u, exp_u, G_N_ELEMENTS(exp_u));\r
- }\r
-\r
- /* Straight line. */\r
- {\r
- double const exp_u[] = {0.0, 0.1829, 0.2105, 0.2105, 0.619, 0.815, 0.999, 1.0};\r
- unsigned const n = G_N_ELEMENTS(exp_u);\r
- Point d[n];\r
- double u[n];\r
- Point const a(-23.985, 4.915), b(4.9127, 5.203);\r
- for (unsigned i = 0; i < n; ++i) {\r
- double bi = exp_u[i], ai = 1.0 - bi;\r
- d[i] = ai * a + bi * b;\r
- }\r
- chord_length_parameterize(d, u, n);\r
- TS_ASSERT(range_approx_equal(u, exp_u, n));\r
- }\r
- }\r
-\r
- void testGenerateBezier()\r
- {\r
- Point est_b[4];\r
- generate_bezier(est_b, d, t, n, tHat1, tHat2, 1.0);\r
-\r
- compare_ctlpts(est_b, src_b);\r
-\r
- /* We're being unfair here in using our t[] rather than best t[] for est_b: we\r
- may over-estimate RMS of errors. */\r
- compare_rms(est_b, t, d, n, 1e-8);\r
- }\r
-\r
- void testSpBezierFitCubicFull()\r
- {\r
- Point est_b[4];\r
- int splitpoints[2];\r
- gint const succ = sp_bezier_fit_cubic_full(est_b, splitpoints, d, n, tHat1, tHat2, square(1.2), 1);\r
- TS_ASSERT_EQUALS( succ , 1 );\r
-\r
- Point const exp_est_b[4] = {\r
- Point(5.000000, -3.000000),\r
- Point(7.5753, -0.4247),\r
- Point(4.77533, 1.22467),\r
- Point(3, 3)\r
- };\r
- compare_ctlpts(est_b, exp_est_b);\r
-\r
- /* We're being unfair here in using our t[] rather than best t[] for est_b: we\r
- may over-estimate RMS of errors. */\r
- compare_rms(est_b, t, d, n, .307911);\r
- }\r
-\r
- void testSpBezierFitCubic()\r
- {\r
- Point est_b[4];\r
- gint const succ = sp_bezier_fit_cubic(est_b, d, n, square(1.2));\r
- TS_ASSERT_EQUALS( succ , 1 );\r
-\r
- Point const exp_est_b[4] = {\r
- Point(5.000000, -3.000000),\r
- Point(7.57134, -0.423509),\r
- Point(4.77929, 1.22426),\r
- Point(3, 3)\r
- };\r
- compare_ctlpts(est_b, exp_est_b);\r
-\r
-#if 1 /* A change has been made to right_tangent. I believe that usually this change\r
- will result in better fitting, but it won't do as well for this example where\r
- we happen to be feeding a t=0.999 point to the fitter. */\r
- TS_WARN("TODO: Update this test case for revised right_tangent implementation.");\r
- /* In particular, have a test case to show whether the new implementation\r
- really is likely to be better on average. */\r
-#else\r
- /* We're being unfair here in using our t[] rather than best t[] for est_b: we\r
- may over-estimate RMS of errors. */\r
- compare_rms(est_b, t, d, n, .307983);\r
-#endif\r
- }\r
-};\r
-\r
-// This is not very neat, but since we know this header is only included by the generated CxxTest file it shouldn't give any problems\r
-Point const BezierUtilsTest::c[4] = {\r
- Point(1.0, 2.0),\r
- Point(8.0, 4.0),\r
- Point(3.0, 1.0),\r
- Point(-2.0, -4.0)};\r
-double const BezierUtilsTest::t[24] = {\r
- 0.0, .001, .03, .05, .09, .13, .18, .25, .29, .33, .39, .44,\r
- .51, .57, .62, .69, .75, .81, .91, .93, .97, .98, .999, 1.0};\r
-unsigned const BezierUtilsTest::n = G_N_ELEMENTS(BezierUtilsTest::t);\r
-Point const BezierUtilsTest::src_b[4] = {\r
- Point(5., -3.),\r
- Point(8., 0.),\r
- Point(4., 2.),\r
- Point(3., 3.)};\r
-Point const BezierUtilsTest::tHat1(unit_vector( BezierUtilsTest::src_b[1] - BezierUtilsTest::src_b[0] ));\r
-Point const BezierUtilsTest::tHat2(unit_vector( BezierUtilsTest::src_b[2] - BezierUtilsTest::src_b[3] ));\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+
+#include <glib.h>
+#include <libnr/nr-macros.h> /* NR_DF_TEST_CLOSE */
+#include <sstream>
+
+/* mental disclaims all responsibility for this evil idea for testing
+ static functions. The main disadvantages are that we retain the
+ #define's and `using' directives of the included file. */
+#include "bezier-utils.cpp"
+
+using NR::Point;
+
+/* (Returns false if NaN encountered.) */
+static bool range_approx_equal(double const a[], double const b[], unsigned const len) {
+ for (unsigned i = 0; i < len; ++i) {
+ if (!( fabs( a[i] - b[i] ) < 1e-4 )) {
+ return false;
+ }
+ }
+ return true;
+}
+
+static inline bool point_approx_equal(NR::Point const &a, NR::Point const &b, double const eps)
+{
+ using NR::X; using NR::Y;
+ return ( NR_DF_TEST_CLOSE(a[X], b[X], eps) &&
+ NR_DF_TEST_CLOSE(a[Y], b[Y], eps) );
+}
+
+static inline double square(double const x) {
+ return x * x;
+}
+
+/** Determine whether the found control points are the same as previously found on some developer's
+ machine. Doesn't call utest__fail, just writes a message to stdout for diagnostic purposes:
+ the most important test is that the root-mean-square of errors in the estimation are low rather
+ than that the control points found are the same.
+**/
+static void compare_ctlpts(Point const est_b[], Point const exp_est_b[])
+{
+ unsigned diff_mask = 0;
+ for (unsigned i = 0; i < 4; ++i) {
+ for (unsigned d = 0; d < 2; ++d) {
+ if ( fabs( est_b[i][d] - exp_est_b[i][d] ) > 1.1e-5 ) {
+ diff_mask |= 1 << ( i * 2 + d );
+ }
+ }
+ }
+ if ( diff_mask != 0 ) {
+ std::stringstream msg;
+ msg << "Got different control points from previously-coded (diffs=0x" << std::hex << diff_mask << "\n";
+ msg << " Previous:";
+ for (unsigned i = 0; i < 4; ++i) {
+ msg << " (" << exp_est_b[i][0] << ", " << exp_est_b[i][1] << ")"; // localizing ok
+ }
+ msg << "\n";
+ msg << " Found: ";
+ for (unsigned i = 0; i < 4; ++i) {
+ msg << " (" << est_b[i][0] << ", " << est_b[i][1] << ")"; // localizing ok
+ }
+ msg << "\n";
+ TS_WARN(msg.str().c_str());
+ }
+}
+
+static void compare_rms(Point const est_b[], double const t[], Point const d[], unsigned const n,
+ double const exp_rms_error)
+{
+ double sum_errsq = 0.0;
+ for (unsigned i = 0; i < n; ++i) {
+ Point const fit_pt = bezier_pt(3, est_b, t[i]);
+ Point const diff = fit_pt - d[i];
+ sum_errsq += dot(diff, diff);
+ }
+ double const rms_error = sqrt( sum_errsq / n );
+ TS_ASSERT_LESS_THAN_EQUALS( rms_error , exp_rms_error + 1.1e-6 );
+ if ( rms_error < exp_rms_error - 1.1e-6 ) {
+ /* The fitter code appears to have improved [or the floating point calculations differ
+ on this machine from the machine where exp_rms_error was calculated]. */
+ char msg[200];
+ sprintf(msg, "N.B. rms_error regression requirement can be decreased: have rms_error=%g.", rms_error); // localizing ok
+ TS_TRACE(msg);
+ }
+}
+
+class BezierUtilsTest : public CxxTest::TestSuite {
+public:
+ static Point const c[4];
+ static double const t[24];
+ static unsigned const n;
+ Point d[24];
+ static Point const src_b[4];
+ static Point const tHat1;
+ static Point const tHat2;
+
+ BezierUtilsTest()
+ {
+ /* Feed it some points that can be fit exactly with a single bezier segment, and see how
+ well it manages. */
+ for (unsigned i = 0; i < n; ++i) {
+ d[i] = bezier_pt(3, src_b, t[i]);
+ }
+ }
+ virtual ~BezierUtilsTest() {}
+
+ void testCopyWithoutNansOrAdjacentDuplicates()
+ {
+ NR::Point const src[] = {
+ Point(2., 3.),
+ Point(2., 3.),
+ Point(0., 0.),
+ Point(2., 3.),
+ Point(2., 3.),
+ Point(1., 9.),
+ Point(1., 9.)
+ };
+ Point const exp_dest[] = {
+ Point(2., 3.),
+ Point(0., 0.),
+ Point(2., 3.),
+ Point(1., 9.)
+ };
+ g_assert( G_N_ELEMENTS(src) == 7 );
+ Point dest[7];
+ struct tst {
+ unsigned src_ix0;
+ unsigned src_len;
+ unsigned exp_dest_ix0;
+ unsigned exp_dest_len;
+ } const test_data[] = {
+ /* src start ix, src len, exp_dest start ix, exp dest len */
+ {0, 0, 0, 0},
+ {2, 1, 1, 1},
+ {0, 1, 0, 1},
+ {0, 2, 0, 1},
+ {0, 3, 0, 2},
+ {1, 3, 0, 3},
+ {0, 5, 0, 3},
+ {0, 6, 0, 4},
+ {0, 7, 0, 4}
+ };
+ for (unsigned i = 0 ; i < G_N_ELEMENTS(test_data) ; ++i) {
+ tst const &t = test_data[i];
+ TS_ASSERT_EQUALS( t.exp_dest_len,
+ copy_without_nans_or_adjacent_duplicates(src + t.src_ix0,
+ t.src_len,
+ dest) );
+ TS_ASSERT_SAME_DATA(dest,
+ exp_dest + t.exp_dest_ix0,
+ t.exp_dest_len);
+ }
+ }
+
+ void testBezierPt1()
+ {
+ Point const a[] = {Point(2.0, 4.0),
+ Point(1.0, 8.0)};
+ TS_ASSERT_EQUALS( bezier_pt(1, a, 0.0) , a[0] );
+ TS_ASSERT_EQUALS( bezier_pt(1, a, 1.0) , a[1] );
+ TS_ASSERT_EQUALS( bezier_pt(1, a, 0.5) , Point(1.5, 6.0) );
+ double const t[] = {0.5, 0.25, 0.3, 0.6};
+ for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {
+ double const ti = t[i], si = 1.0 - ti;
+ TS_ASSERT_EQUALS( bezier_pt(1, a, ti) , si * a[0] + ti * a[1] );
+ }
+ }
+
+ void testBezierPt2()
+ {
+ Point const b[] = {Point(1.0, 2.0),
+ Point(8.0, 4.0),
+ Point(3.0, 1.0)};
+ TS_ASSERT_EQUALS( bezier_pt(2, b, 0.0) , b[0] );
+ TS_ASSERT_EQUALS( bezier_pt(2, b, 1.0) , b[2] );
+ TS_ASSERT_EQUALS( bezier_pt(2, b, 0.5) , Point(5.0, 2.75) );
+ double const t[] = {0.5, 0.25, 0.3, 0.6};
+ for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {
+ double const ti = t[i], si = 1.0 - ti;
+ Point const exp_pt( si*si * b[0] + 2*si*ti * b[1] + ti*ti * b[2] );
+ Point const pt(bezier_pt(2, b, ti));
+ TS_ASSERT(point_approx_equal(pt, exp_pt, 1e-11));
+ }
+ }
+
+ void testBezierPt3()
+ {
+ TS_ASSERT_EQUALS( bezier_pt(3, c, 0.0) , c[0] );
+ TS_ASSERT_EQUALS( bezier_pt(3, c, 1.0) , c[3] );
+ TS_ASSERT_EQUALS( bezier_pt(3, c, 0.5) , Point(4.0, 13.0/8.0) );
+ double const t[] = {0.5, 0.25, 0.3, 0.6};
+ for (unsigned i = 0; i < G_N_ELEMENTS(t); ++i) {
+ double const ti = t[i], si = 1.0 - ti;
+ TS_ASSERT( LInfty( bezier_pt(3, c, ti)
+ - ( si*si*si * c[0] +
+ 3*si*si*ti * c[1] +
+ 3*si*ti*ti * c[2] +
+ ti*ti*ti * c[3] ) )
+ < 1e-4 );
+ }
+ }
+
+ void testComputeMaxErrorRatio()
+ {
+ struct Err_tst {
+ Point pt;
+ double u;
+ double err;
+ } const err_tst[] = {
+ {c[0], 0.0, 0.0},
+ {Point(4.0, 13.0/8.0), 0.5, 0.0},
+ {Point(4.0, 2.0), 0.5, 9.0/64.0},
+ {Point(3.0, 2.0), 0.5, 1.0 + 9.0/64.0},
+ {Point(6.0, 2.0), 0.5, 4.0 + 9.0/64.0},
+ {c[3], 1.0, 0.0},
+ };
+ Point d[G_N_ELEMENTS(err_tst)];
+ double u[G_N_ELEMENTS(err_tst)];
+ for (unsigned i = 0; i < G_N_ELEMENTS(err_tst); ++i) {
+ Err_tst const &t = err_tst[i];
+ d[i] = t.pt;
+ u[i] = t.u;
+ }
+ g_assert( G_N_ELEMENTS(u) == G_N_ELEMENTS(d) );
+ unsigned max_ix = ~0u;
+ double const err_ratio = compute_max_error_ratio(d, u, G_N_ELEMENTS(d), c, 1.0, &max_ix);
+ TS_ASSERT_LESS_THAN( fabs( sqrt(err_tst[4].err) - err_ratio ) , 1e-12 );
+ TS_ASSERT_EQUALS( max_ix , 4 );
+ }
+
+ void testChordLengthParameterize()
+ {
+ /* n == 2 */
+ {
+ Point const d[] = {Point(2.9415, -5.8149),
+ Point(23.021, 4.9814)};
+ double u[G_N_ELEMENTS(d)];
+ double const exp_u[] = {0.0, 1.0};
+ g_assert( G_N_ELEMENTS(u) == G_N_ELEMENTS(exp_u) );
+ chord_length_parameterize(d, u, G_N_ELEMENTS(d));
+ TS_ASSERT_SAME_DATA(u, exp_u, G_N_ELEMENTS(exp_u));
+ }
+
+ /* Straight line. */
+ {
+ double const exp_u[] = {0.0, 0.1829, 0.2105, 0.2105, 0.619, 0.815, 0.999, 1.0};
+ unsigned const n = G_N_ELEMENTS(exp_u);
+ Point d[n];
+ double u[n];
+ Point const a(-23.985, 4.915), b(4.9127, 5.203);
+ for (unsigned i = 0; i < n; ++i) {
+ double bi = exp_u[i], ai = 1.0 - bi;
+ d[i] = ai * a + bi * b;
+ }
+ chord_length_parameterize(d, u, n);
+ TS_ASSERT(range_approx_equal(u, exp_u, n));
+ }
+ }
+
+ void testGenerateBezier()
+ {
+ Point est_b[4];
+ generate_bezier(est_b, d, t, n, tHat1, tHat2, 1.0);
+
+ compare_ctlpts(est_b, src_b);
+
+ /* We're being unfair here in using our t[] rather than best t[] for est_b: we
+ may over-estimate RMS of errors. */
+ compare_rms(est_b, t, d, n, 1e-8);
+ }
+
+ void testSpBezierFitCubicFull()
+ {
+ Point est_b[4];
+ int splitpoints[2];
+ gint const succ = sp_bezier_fit_cubic_full(est_b, splitpoints, d, n, tHat1, tHat2, square(1.2), 1);
+ TS_ASSERT_EQUALS( succ , 1 );
+
+ Point const exp_est_b[4] = {
+ Point(5.000000, -3.000000),
+ Point(7.5753, -0.4247),
+ Point(4.77533, 1.22467),
+ Point(3, 3)
+ };
+ compare_ctlpts(est_b, exp_est_b);
+
+ /* We're being unfair here in using our t[] rather than best t[] for est_b: we
+ may over-estimate RMS of errors. */
+ compare_rms(est_b, t, d, n, .307911);
+ }
+
+ void testSpBezierFitCubic()
+ {
+ Point est_b[4];
+ gint const succ = sp_bezier_fit_cubic(est_b, d, n, square(1.2));
+ TS_ASSERT_EQUALS( succ , 1 );
+
+ Point const exp_est_b[4] = {
+ Point(5.000000, -3.000000),
+ Point(7.57134, -0.423509),
+ Point(4.77929, 1.22426),
+ Point(3, 3)
+ };
+ compare_ctlpts(est_b, exp_est_b);
+
+#if 1 /* A change has been made to right_tangent. I believe that usually this change
+ will result in better fitting, but it won't do as well for this example where
+ we happen to be feeding a t=0.999 point to the fitter. */
+ TS_WARN("TODO: Update this test case for revised right_tangent implementation.");
+ /* In particular, have a test case to show whether the new implementation
+ really is likely to be better on average. */
+#else
+ /* We're being unfair here in using our t[] rather than best t[] for est_b: we
+ may over-estimate RMS of errors. */
+ compare_rms(est_b, t, d, n, .307983);
+#endif
+ }
+};
+
+// This is not very neat, but since we know this header is only included by the generated CxxTest file it shouldn't give any problems
+Point const BezierUtilsTest::c[4] = {
+ Point(1.0, 2.0),
+ Point(8.0, 4.0),
+ Point(3.0, 1.0),
+ Point(-2.0, -4.0)};
+double const BezierUtilsTest::t[24] = {
+ 0.0, .001, .03, .05, .09, .13, .18, .25, .29, .33, .39, .44,
+ .51, .57, .62, .69, .75, .81, .91, .93, .97, .98, .999, 1.0};
+unsigned const BezierUtilsTest::n = G_N_ELEMENTS(BezierUtilsTest::t);
+Point const BezierUtilsTest::src_b[4] = {
+ Point(5., -3.),
+ Point(8., 0.),
+ Point(4., 2.),
+ Point(3., 3.)};
+Point const BezierUtilsTest::tHat1(unit_vector( BezierUtilsTest::src_b[1] - BezierUtilsTest::src_b[0] ));
+Point const BezierUtilsTest::tHat2(unit_vector( BezierUtilsTest::src_b[2] - BezierUtilsTest::src_b[3] ));
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/dom/domptr.h b/src/dom/domptr.h
index bf54deaa2925d6b31554527aa93ad174c625fb23..aaf1220f3ed19be38b2ea5d1a0bd2db57907c557 100644 (file)
--- a/src/dom/domptr.h
+++ b/src/dom/domptr.h
-#ifndef __DOMPTR_H__\r
-#define __DOMPTR_H__\r
-/**\r
- * Phoebe DOM Implementation.\r
- *\r
- * This is a C++ approximation of the W3C DOM model, which follows\r
- * fairly closely the specifications in the various .idl files, copies of\r
- * which are provided for reference. Most important is this one:\r
- *\r
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html\r
- * \r
- * More thorough explanations of the various classes and their algorithms\r
- * can be found there.\r
- * \r
- *\r
- * Authors:\r
- * Bob Jamison\r
- *\r
- * Copyright (C) 2006-2008 Bob Jamison\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * 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; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
- * \r
- * =======================================================================\r
- * NOTES:\r
- * \r
- * Notice that many of the classes defined here are pure virtual. In other\r
- * words, they are purely unimplemented interfaces. For the implementations\r
- * of them, look in domimpl.h and domimpl.cpp.\r
- * \r
- * Also, note that there is a domptr.cpp file that has a couple of necessary\r
- * functions which cannot be in a .h file\r
- * \r
- */\r
-\r
-#include <functional>\r
-\r
-namespace org\r
-{\r
-namespace w3c\r
-{\r
-namespace dom\r
-{\r
-\r
-\r
-\r
-/*#########################################################################\r
-## NodePtr\r
-#########################################################################*/\r
-\r
-/**\r
- * A simple Smart Pointer class that handles Nodes and all of its\r
- * descendants. This is very similar to shared_ptr, but it is customized\r
- * to handle our needs. \r
- */ \r
-template<class T> class Ptr\r
-{\r
-public:\r
-\r
- /**\r
- * Simple constructor\r
- */ \r
- Ptr()\r
- { _ref = 0; }\r
-\r
- /**\r
- * Constructor upon a reference\r
- */ \r
- template<class Y> Ptr(const Ptr<Y> &other)\r
- {\r
- _ref = other._ref;\r
- incrementRefCount(_ref);\r
- }\r
-\r
- /**\r
- * Constructor upon a reference\r
- */ \r
- Ptr(T * refArg, bool addRef = true)\r
- {\r
- _ref = refArg;\r
- if(addRef)\r
- incrementRefCount(_ref);\r
- }\r
-\r
-\r
- /**\r
- * Copy constructor\r
- */ \r
- Ptr(const Ptr &other)\r
- {\r
- _ref = other._ref;\r
- incrementRefCount(_ref);\r
- }\r
-\r
- /**\r
- * Destructor\r
- */ \r
- virtual ~Ptr()\r
- {\r
- decrementRefCount(_ref);\r
- }\r
-\r
-\r
- /**\r
- * Assignment operator\r
- */ \r
- template<class Y> Ptr &operator=(const Ptr<Y> &other)\r
- {\r
- decrementRefCount(_ref);\r
- _ref = other._ref;\r
- incrementRefCount(_ref);\r
- return *this;\r
- }\r
-\r
- /**\r
- * Assignment operator\r
- */ \r
- Ptr &operator=(const Ptr &other)\r
- {\r
- decrementRefCount(_ref);\r
- _ref = other._ref;\r
- incrementRefCount(_ref);\r
- return *this;\r
- }\r
-\r
- /**\r
- * Assignment operator\r
- */ \r
- template<class Y> Ptr &operator=(Y * ref)\r
- {\r
- decrementRefCount(_ref);\r
- _ref = ref;\r
- incrementRefCount(_ref);\r
- return *this;\r
- }\r
-\r
- /**\r
- * Assignment operator\r
- */ \r
- template<class Y> Ptr &operator=(const Y * ref)\r
- {\r
- decrementRefCount(_ref);\r
- _ref = (Y *) ref;\r
- incrementRefCount(_ref);\r
- return *this;\r
- }\r
-\r
- /**\r
- * Return the reference\r
- */ \r
- T * get() const\r
- {\r
- return _ref;\r
- }\r
-\r
- /**\r
- * Dereference operator\r
- */ \r
- T &operator*() const\r
- {\r
- return *_ref;\r
- }\r
-\r
- /**\r
- * Point-to operator\r
- */ \r
- T *operator->() const\r
- {\r
- return _ref;\r
- }\r
-\r
- /**\r
- * NOT bool operator. How to check if we are null without a comparison\r
- */ \r
- bool operator! () const\r
- {\r
- return (_ref == 0);\r
- }\r
-\r
- /**\r
- * Swap what I reference with the other guy\r
- */ \r
- void swap(Ptr &other)\r
- {\r
- T *tmp = _ref;\r
- _ref = other._ref;\r
- other._ref = tmp;\r
- }\r
-\r
- //The referenced item\r
- T *_ref;\r
-};\r
-\r
-\r
-/**\r
- * Global definitions. Many of these are used to mimic behaviour of\r
- * a real pointer \r
- */\r
-\r
-/**\r
- * Equality\r
- */ \r
-template<class T, class U> inline bool\r
- operator==(const Ptr<T> &a, const Ptr<U> &b)\r
-{\r
- return a.get() == b.get();\r
-}\r
-\r
-/**\r
- * Inequality\r
- */ \r
-template<class T, class U> inline bool\r
- operator!=(const Ptr<T> &a, const Ptr<U> &b)\r
-{\r
- return a.get() != b.get();\r
-}\r
-\r
-/**\r
- * Equality\r
- */ \r
-template<class T> inline bool\r
- operator==(const Ptr<T> &a, T * b)\r
-{\r
- return a.get() == b;\r
-}\r
-\r
-/**\r
- * Inequality\r
- */ \r
-template<class T> inline bool\r
- operator!=(const Ptr<T> &a, T * b)\r
-{\r
- return a.get() != b;\r
-}\r
-\r
-/**\r
- * Equality\r
- */ \r
-template<class T> inline bool\r
- operator==(T * a, const Ptr<T> &b)\r
-{\r
- return a == b.get();\r
-}\r
-\r
-/**\r
- * Inequality\r
- */ \r
-template<class T> inline bool\r
- operator!=(T * a, const Ptr<T> &b)\r
-{\r
- return a != b.get();\r
-}\r
-\r
-\r
-/**\r
- * Less than\r
- */ \r
-template<class T> inline bool\r
- operator<(const Ptr<T> &a, const Ptr<T> &b)\r
-{\r
- return std::less<T *>()(a.get(), b.get());\r
-}\r
-\r
-/**\r
- * Swap\r
- */ \r
-template<class T> void\r
- swap(Ptr<T> &a, Ptr<T> &b)\r
-{\r
- a.swap(b);\r
-}\r
-\r
-\r
-/**\r
- * Get the pointer globally, for <algo>\r
- */ \r
-template<class T> T * \r
- get_pointer(const Ptr<T> &p)\r
-{\r
- return p.get();\r
-}\r
-\r
-/**\r
- * Static cast\r
- */ \r
-template<class T, class U> Ptr<T>\r
- static_pointer_cast(const Ptr<U> &p)\r
-{\r
- return static_cast<T *>(p.get());\r
-}\r
-\r
-/**\r
- * Const cast\r
- */ \r
-template<class T, class U> Ptr<T>\r
- const_pointer_cast(const Ptr<U> &p)\r
-{\r
- return const_cast<T *>(p.get());\r
-}\r
-\r
-/**\r
- * Dynamic cast\r
- */ \r
-template<class T, class U> Ptr<T>\r
- dynamic_pointer_cast(const Ptr<U> &p)\r
-{\r
- return dynamic_cast<T *>(p.get());\r
-}\r
-\r
-\r
-\r
-} //namespace dom\r
-} //namespace w3c\r
-} //namespace org\r
-\r
-\r
-#endif // __DOMPTR_H__\r
-\r
-\r
-/*#########################################################################\r
-## E N D O F F I L E\r
-#########################################################################*/\r
-\r
-\r
-\r
-\r
+#ifndef __DOMPTR_H__
+#define __DOMPTR_H__
+/**
+ * Phoebe DOM Implementation.
+ *
+ * This is a C++ approximation of the W3C DOM model, which follows
+ * fairly closely the specifications in the various .idl files, copies of
+ * which are provided for reference. Most important is this one:
+ *
+ * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
+ *
+ * More thorough explanations of the various classes and their algorithms
+ * can be found there.
+ *
+ *
+ * Authors:
+ * Bob Jamison
+ *
+ * Copyright (C) 2006-2008 Bob Jamison
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * =======================================================================
+ * NOTES:
+ *
+ * Notice that many of the classes defined here are pure virtual. In other
+ * words, they are purely unimplemented interfaces. For the implementations
+ * of them, look in domimpl.h and domimpl.cpp.
+ *
+ * Also, note that there is a domptr.cpp file that has a couple of necessary
+ * functions which cannot be in a .h file
+ *
+ */
+
+#include <functional>
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+
+
+
+/*#########################################################################
+## NodePtr
+#########################################################################*/
+
+/**
+ * A simple Smart Pointer class that handles Nodes and all of its
+ * descendants. This is very similar to shared_ptr, but it is customized
+ * to handle our needs.
+ */
+template<class T> class Ptr
+{
+public:
+
+ /**
+ * Simple constructor
+ */
+ Ptr()
+ { _ref = 0; }
+
+ /**
+ * Constructor upon a reference
+ */
+ template<class Y> Ptr(const Ptr<Y> &other)
+ {
+ _ref = other._ref;
+ incrementRefCount(_ref);
+ }
+
+ /**
+ * Constructor upon a reference
+ */
+ Ptr(T * refArg, bool addRef = true)
+ {
+ _ref = refArg;
+ if(addRef)
+ incrementRefCount(_ref);
+ }
+
+
+ /**
+ * Copy constructor
+ */
+ Ptr(const Ptr &other)
+ {
+ _ref = other._ref;
+ incrementRefCount(_ref);
+ }
+
+ /**
+ * Destructor
+ */
+ virtual ~Ptr()
+ {
+ decrementRefCount(_ref);
+ }
+
+
+ /**
+ * Assignment operator
+ */
+ template<class Y> Ptr &operator=(const Ptr<Y> &other)
+ {
+ decrementRefCount(_ref);
+ _ref = other._ref;
+ incrementRefCount(_ref);
+ return *this;
+ }
+
+ /**
+ * Assignment operator
+ */
+ Ptr &operator=(const Ptr &other)
+ {
+ decrementRefCount(_ref);
+ _ref = other._ref;
+ incrementRefCount(_ref);
+ return *this;
+ }
+
+ /**
+ * Assignment operator
+ */
+ template<class Y> Ptr &operator=(Y * ref)
+ {
+ decrementRefCount(_ref);
+ _ref = ref;
+ incrementRefCount(_ref);
+ return *this;
+ }
+
+ /**
+ * Assignment operator
+ */
+ template<class Y> Ptr &operator=(const Y * ref)
+ {
+ decrementRefCount(_ref);
+ _ref = (Y *) ref;
+ incrementRefCount(_ref);
+ return *this;
+ }
+
+ /**
+ * Return the reference
+ */
+ T * get() const
+ {
+ return _ref;
+ }
+
+ /**
+ * Dereference operator
+ */
+ T &operator*() const
+ {
+ return *_ref;
+ }
+
+ /**
+ * Point-to operator
+ */
+ T *operator->() const
+ {
+ return _ref;
+ }
+
+ /**
+ * NOT bool operator. How to check if we are null without a comparison
+ */
+ bool operator! () const
+ {
+ return (_ref == 0);
+ }
+
+ /**
+ * Swap what I reference with the other guy
+ */
+ void swap(Ptr &other)
+ {
+ T *tmp = _ref;
+ _ref = other._ref;
+ other._ref = tmp;
+ }
+
+ //The referenced item
+ T *_ref;
+};
+
+
+/**
+ * Global definitions. Many of these are used to mimic behaviour of
+ * a real pointer
+ */
+
+/**
+ * Equality
+ */
+template<class T, class U> inline bool
+ operator==(const Ptr<T> &a, const Ptr<U> &b)
+{
+ return a.get() == b.get();
+}
+
+/**
+ * Inequality
+ */
+template<class T, class U> inline bool
+ operator!=(const Ptr<T> &a, const Ptr<U> &b)
+{
+ return a.get() != b.get();
+}
+
+/**
+ * Equality
+ */
+template<class T> inline bool
+ operator==(const Ptr<T> &a, T * b)
+{
+ return a.get() == b;
+}
+
+/**
+ * Inequality
+ */
+template<class T> inline bool
+ operator!=(const Ptr<T> &a, T * b)
+{
+ return a.get() != b;
+}
+
+/**
+ * Equality
+ */
+template<class T> inline bool
+ operator==(T * a, const Ptr<T> &b)
+{
+ return a == b.get();
+}
+
+/**
+ * Inequality
+ */
+template<class T> inline bool
+ operator!=(T * a, const Ptr<T> &b)
+{
+ return a != b.get();
+}
+
+
+/**
+ * Less than
+ */
+template<class T> inline bool
+ operator<(const Ptr<T> &a, const Ptr<T> &b)
+{
+ return std::less<T *>()(a.get(), b.get());
+}
+
+/**
+ * Swap
+ */
+template<class T> void
+ swap(Ptr<T> &a, Ptr<T> &b)
+{
+ a.swap(b);
+}
+
+
+/**
+ * Get the pointer globally, for <algo>
+ */
+template<class T> T *
+ get_pointer(const Ptr<T> &p)
+{
+ return p.get();
+}
+
+/**
+ * Static cast
+ */
+template<class T, class U> Ptr<T>
+ static_pointer_cast(const Ptr<U> &p)
+{
+ return static_cast<T *>(p.get());
+}
+
+/**
+ * Const cast
+ */
+template<class T, class U> Ptr<T>
+ const_pointer_cast(const Ptr<U> &p)
+{
+ return const_cast<T *>(p.get());
+}
+
+/**
+ * Dynamic cast
+ */
+template<class T, class U> Ptr<T>
+ dynamic_pointer_cast(const Ptr<U> &p)
+{
+ return dynamic_cast<T *>(p.get());
+}
+
+
+
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+
+#endif // __DOMPTR_H__
+
+
+/*#########################################################################
+## E N D O F F I L E
+#########################################################################*/
+
+
+
+
diff --git a/src/dom/svg2.h b/src/dom/svg2.h
index 15032510685d5403b181748d3ac896e0410930e5..b1a42e8aaf5a0d03d5e6c91cbd3c092e0adc8d47 100644 (file)
--- a/src/dom/svg2.h
+++ b/src/dom/svg2.h
-#ifndef __SVG_H__\r
-#define __SVG_H__\r
-\r
-/**\r
- * Phoebe DOM Implementation.\r
- *\r
- * This is a C++ approximation of the W3C DOM model, which follows\r
- * fairly closely the specifications in the various .idl files, copies of\r
- * which are provided for reference. Most important is this one:\r
- *\r
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html\r
- *\r
- * Authors:\r
- * Bob Jamison\r
- *\r
- * Copyright(C) 2005-2008 Bob Jamison\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or(at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * 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; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
- *\r
- * =======================================================================\r
- * NOTES\r
- *\r
- * This API follows:\r
- * http://www.w3.org/TR/SVG11/svgdom.html\r
- *\r
- * This file defines the main SVG-DOM Node types. Other non-Node types are\r
- * defined in svgtypes.h.\r
- * \r
- */\r
-\r
-\r
-// For access to DOM2 core\r
-#include "dom/dom.h"\r
-\r
-// For access to DOM2 events\r
-#include "dom/events.h"\r
-\r
-// For access to those parts from DOM2 CSS OM used by SVG DOM.\r
-#include "dom/css.h"\r
-\r
-// For access to those parts from DOM2 Views OM used by SVG DOM.\r
-#include "dom/views.h"\r
-\r
-// For access to the SMIL OM used by SVG DOM.\r
-#include "dom/smil.h"\r
-\r
-\r
-#include <math.h>\r
-\r
-#define SVG_NAMESPACE "http://www.w3.org/2000/svg"\r
-\r
-\r
-namespace org\r
-{\r
-namespace w3c\r
-{\r
-namespace dom\r
-{\r
-namespace svg\r
-{\r
-\r
-\r
-//local definitions\r
-typedef dom::DOMString DOMString;\r
-typedef dom::DOMException DOMException;\r
-typedef dom::Element Element;\r
-typedef dom::ElementPtr ElementPtr;\r
-typedef dom::Document Document;\r
-typedef dom::DocumentPtr DocumentPtr;\r
-typedef dom::NodeList NodeList;\r
-\r
-\r
-\r
-\r
-class SVGElement;\r
-typedef Ptr<SVGElement> SVGElementPtr;\r
-class SVGUseElement;\r
-typedef Ptr<SVGUseElement> SVGUseElementPtr;\r
-class SVGDocument;\r
-typedef Ptr<SVGDocument> SVGDocumentPtr;\r
-\r
-/*#########################################################################\r
-## SVGException\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGException\r
-{\r
-public:\r
-\r
- /**\r
- * SVGExceptionCode\r
- */\r
- typedef enum\r
- {\r
- SVG_WRONG_TYPE_ERR = 0,\r
- SVG_INVALID_VALUE_ERR = 1,\r
- SVG_MATRIX_NOT_INVERTABLE = 2\r
- } SVGExceptionCode;\r
-\r
- unsigned short code;\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-//########################################################################\r
-//########################################################################\r
-//# V A L U E S\r
-//########################################################################\r
-//########################################################################\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGAngle\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGAngle\r
-{\r
-public:\r
-\r
- /**\r
- * Angle Unit Types\r
- */\r
- typedef enum\r
- {\r
- SVG_ANGLETYPE_UNKNOWN = 0,\r
- SVG_ANGLETYPE_UNSPECIFIED = 1,\r
- SVG_ANGLETYPE_DEG = 2,\r
- SVG_ANGLETYPE_RAD = 3,\r
- SVG_ANGLETYPE_GRAD = 4\r
- } AngleUnitType;\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getUnitType();\r
-\r
- /**\r
- *\r
- */\r
- double getValue();\r
-\r
- /**\r
- *\r
- */\r
- void setValue(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getValueInSpecifiedUnits();\r
-\r
- /**\r
- *\r
- */\r
- void setValueInSpecifiedUnits(double /*val*/)\r
- throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- DOMString getValueAsString();\r
-\r
- /**\r
- *\r
- */\r
- void setValueAsString(const DOMString &/*val*/)\r
- throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- void newValueSpecifiedUnits(unsigned short /*unitType*/,\r
- double /*valueInSpecifiedUnits*/);\r
-\r
- /**\r
- *\r
- */\r
- void convertToSpecifiedUnits(unsigned short /*unitType*/);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGAngle();\r
-\r
- /**\r
- *\r
- */\r
- SVGAngle(const SVGAngle &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGAngle();\r
-\r
-protected:\r
-\r
- int unitType;\r
-\r
- double value;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGLength\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGLength\r
-{\r
-public:\r
-\r
- /**\r
- * Length Unit Types\r
- */\r
- typedef enum\r
- {\r
- SVG_LENGTHTYPE_UNKNOWN = 0,\r
- SVG_LENGTHTYPE_NUMBER = 1,\r
- SVG_LENGTHTYPE_PERCENTAGE = 2,\r
- SVG_LENGTHTYPE_EMS = 3,\r
- SVG_LENGTHTYPE_EXS = 4,\r
- SVG_LENGTHTYPE_PX = 5,\r
- SVG_LENGTHTYPE_CM = 6,\r
- SVG_LENGTHTYPE_MM = 7,\r
- SVG_LENGTHTYPE_IN = 8,\r
- SVG_LENGTHTYPE_PT = 9,\r
- SVG_LENGTHTYPE_PC = 10\r
- } LengthUnitType;\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getUnitType();\r
-\r
- /**\r
- *\r
- */\r
- double getValue();\r
-\r
- /**\r
- *\r
- */\r
- void setValue(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getValueInSpecifiedUnits();\r
-\r
- /**\r
- *\r
- */\r
- void setValueInSpecifiedUnits(double /*val*/) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- DOMString getValueAsString();\r
-\r
- /**\r
- *\r
- */\r
- void setValueAsString(const DOMString& /*val*/) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- void newValueSpecifiedUnits(unsigned short /*unitType*/, double /*val*/);\r
-\r
- /**\r
- *\r
- */\r
- void convertToSpecifiedUnits(unsigned short /*unitType*/);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGLength();\r
-\r
- /**\r
- *\r
- */\r
- SVGLength(const SVGLength &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGLength();\r
-\r
-protected:\r
-\r
- int unitType;\r
-\r
- double value;\r
-\r
-};\r
-\r
-/*#########################################################################\r
-## SVGMatrix\r
-#########################################################################*/\r
-\r
-/**\r
- * In SVG, a Matrix is defined like this:\r
- *\r
- * | a c e |\r
- * | b d f |\r
- * | 0 0 1 |\r
- *\r
- */\r
-class SVGMatrix\r
-{\r
-public:\r
-\r
-\r
- /**\r
- *\r
- */\r
- double getA();\r
-\r
- /**\r
- *\r
- */\r
- void setA(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getB();\r
-\r
- /**\r
- *\r
- */\r
- void setB(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getC();\r
-\r
- /**\r
- *\r
- */\r
- void setC(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getD();\r
-\r
- /**\r
- *\r
- */\r
- void setD(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getE();\r
-\r
- /**\r
- *\r
- */\r
- void setE(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getF();\r
-\r
- /**\r
- *\r
- */\r
- void setF(double val) throw(DOMException);\r
-\r
-\r
- /**\r
- * Return the result of postmultiplying this matrix with another.\r
- */\r
- SVGMatrix multiply(const SVGMatrix &other);\r
-\r
- /**\r
- * Calculate the inverse of this matrix\r
- *\r
- *\r
- * The determinant of a 3x3 matrix E\r
- * (let's use our own notation for a bit)\r
- *\r
- * A B C\r
- * D E F\r
- * G H I\r
- * is\r
- * AEI - AFH - BDI + BFG + CDH - CEG\r
- *\r
- * Since in our affine transforms, G and H==0 and I==1,\r
- * this reduces to:\r
- * AE - BD\r
- * In SVG's naming scheme, that is: a * d - c * b . SIMPLE!\r
- *\r
- * In a similar method of attack, SVG's adjunct matrix is:\r
- *\r
- * d -c cf-ed\r
- * -b a eb-af\r
- * 0 0 ad-cb\r
- *\r
- * To get the inverse matrix, we divide the adjunct matrix by\r
- * the determinant. Notice that(ad-cb)/(ad-cb)==1. Very cool.\r
- * So what we end up with is this:\r
- *\r
- * a = d/(ad-cb) c = -c/(ad-cb) e =(cf-ed)/(ad-cb)\r
- * b = -b/(ad-cb) d = a/(ad-cb) f =(eb-af)/(ad-cb)\r
- *\r
- * (Since this would be in all SVG-DOM implementations,\r
- * somebody needed to document this! ^^)\r
- *\r
- */\r
- SVGMatrix inverse() throw(SVGException);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | 1 0 x |\r
- * | 0 1 y |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix translate(double x, double y);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | scale 0 0 |\r
- * | 0 scale 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix scale(double scale);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | scaleX 0 0 |\r
- * | 0 scaleY 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix scaleNonUniform(double scaleX, double scaleY);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | cos(a) -sin(a) 0 |\r
- * | sin(a) cos(a) 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix rotate(double angle);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | cos(a) -sin(a) 0 |\r
- * | sin(a) cos(a) 0 |\r
- * | 0 0 1 |\r
- * In this case, angle 'a' is computed as the artangent\r
- * of the slope y/x . It is negative if the slope is negative.\r
- */\r
- SVGMatrix rotateFromVector(double x, double y) throw(SVGException);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | -1 0 0 |\r
- * | 0 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix flipX();\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | 1 0 0 |\r
- * | 0 -1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix flipY();\r
-\r
- /**\r
- * | 1 tan(a) 0 |\r
- * | 0 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix skewX(double angle);\r
-\r
- /**\r
- * Equivalent to multiplying by:\r
- * | 1 0 0 |\r
- * | tan(a) 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
- SVGMatrix skewY(double angle);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix();\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix(double aArg, double bArg, double cArg,\r
- double dArg, double eArg, double fArg);\r
-\r
- /**\r
- * Copy constructor\r
- */\r
- SVGMatrix(const SVGMatrix &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGMatrix() {}\r
-\r
-protected:\r
-\r
-friend class SVGTransform;\r
-\r
- /*\r
- * Set to the identify matrix\r
- */\r
- void identity();\r
-\r
- double a, b, c, d, e, f;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGNumber\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGNumber\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- double getValue();\r
-\r
- /**\r
- *\r
- */\r
- void setValue(double val) throw(DOMException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGNumber();\r
-\r
- /**\r
- *\r
- */\r
- SVGNumber(const SVGNumber &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGNumber();\r
-\r
-protected:\r
-\r
- double value;\r
-\r
-};\r
-\r
-/*#########################################################################\r
-## SVGPoint\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGPoint\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- double getX();\r
-\r
- /**\r
- *\r
- */\r
- void setX(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getY();\r
-\r
- /**\r
- *\r
- */\r
- void setY(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGPoint matrixTransform(const SVGMatrix &/*matrix*/);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGPoint();\r
-\r
- /**\r
- *\r
- */\r
- SVGPoint(const SVGPoint &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGPoint();\r
-\r
-protected:\r
-\r
- double x, y;\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGPathSeg\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGPathSeg\r
-{\r
-public:\r
-\r
- /**\r
- * Path Segment Types\r
- */\r
- typedef enum\r
- {\r
- PATHSEG_UNKNOWN = 0,\r
- PATHSEG_CLOSEPATH = 1,\r
- PATHSEG_MOVETO_ABS = 2,\r
- PATHSEG_MOVETO_REL = 3,\r
- PATHSEG_LINETO_ABS = 4,\r
- PATHSEG_LINETO_REL = 5,\r
- PATHSEG_CURVETO_CUBIC_ABS = 6,\r
- PATHSEG_CURVETO_CUBIC_REL = 7,\r
- PATHSEG_CURVETO_QUADRATIC_ABS = 8,\r
- PATHSEG_CURVETO_QUADRATIC_REL = 9,\r
- PATHSEG_ARC_ABS = 10,\r
- PATHSEG_ARC_REL = 11,\r
- PATHSEG_LINETO_HORIZONTAL_ABS = 12,\r
- PATHSEG_LINETO_HORIZONTAL_REL = 13,\r
- PATHSEG_LINETO_VERTICAL_ABS = 14,\r
- PATHSEG_LINETO_VERTICAL_REL = 15,\r
- PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16,\r
- PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17,\r
- PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,\r
- PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19\r
- } PathSegmentType;\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getPathSegType();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getPathSegTypeAsLetter();\r
-\r
- /**\r
- * From the various subclasses\r
- */\r
-\r
- /**\r
- *\r
- */\r
- double getX();\r
-\r
- /**\r
- *\r
- */\r
- void setX(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getX1();\r
-\r
- /**\r
- *\r
- */\r
- void setX1(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getX2();\r
-\r
- /**\r
- *\r
- */\r
- void setX2(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getY();\r
-\r
- /**\r
- *\r
- */\r
- void setY(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getY1();\r
-\r
- /**\r
- *\r
- */\r
- void setY1(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getY2();\r
-\r
- /**\r
- *\r
- */\r
- void setY2(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getR1();\r
-\r
- /**\r
- *\r
- */\r
- void setR1(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getR2();\r
-\r
- /**\r
- *\r
- */\r
- void setR2(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getAngle();\r
-\r
- /**\r
- *\r
- */\r
- void setAngle(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- bool getLargeArcFlag();\r
-\r
- /**\r
- *\r
- */\r
- void setLargeArcFlag(bool val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- bool getSweepFlag();\r
-\r
- /**\r
- *\r
- */\r
- void setSweepFlag(bool val) throw(DOMException);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGPathSeg();\r
-\r
- /**\r
- *\r
- */\r
- SVGPathSeg(int typeArg);\r
-\r
- /**\r
- *\r
- */\r
- SVGPathSeg(const SVGPathSeg &other);\r
-\r
- /**\r
- *\r
- */\r
- SVGPathSeg &operator=(const SVGPathSeg &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGPathSeg();\r
-\r
-protected:\r
-\r
- void init();\r
- \r
- void assign(const SVGPathSeg &other);\r
-\r
- int type;\r
- double x, y, x1, y1, x2, y2;\r
- double r1, r2;\r
- double angle;\r
- bool largeArcFlag;\r
- bool sweepFlag;\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGPreserveAspectRatio\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGPreserveAspectRatio\r
-{\r
-public:\r
-\r
-\r
- /**\r
- * Alignment Types\r
- */\r
- typedef enum\r
- {\r
- SVG_PRESERVEASPECTRATIO_UNKNOWN = 0,\r
- SVG_PRESERVEASPECTRATIO_NONE = 1,\r
- SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,\r
- SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,\r
- SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,\r
- SVG_PRESERVEASPECTRATIO_XMINYMID = 5,\r
- SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,\r
- SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,\r
- SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,\r
- SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,\r
- SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10\r
- } AlignmentType;\r
-\r
-\r
- /**\r
- * Meet-or-slice Types\r
- */\r
- typedef enum\r
- {\r
- SVG_MEETORSLICE_UNKNOWN = 0,\r
- SVG_MEETORSLICE_MEET = 1,\r
- SVG_MEETORSLICE_SLICE = 2\r
- } MeetOrSliceType;\r
-\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getAlign();\r
-\r
- /**\r
- *\r
- */\r
- void setAlign(unsigned short val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getMeetOrSlice();\r
-\r
- /**\r
- *\r
- */\r
- void setMeetOrSlice(unsigned short val) throw(DOMException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGPreserveAspectRatio();\r
-\r
- /**\r
- *\r
- */\r
- SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGPreserveAspectRatio();\r
-\r
-protected:\r
-\r
- unsigned short align;\r
- unsigned short meetOrSlice;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGRect\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGRect\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- double getX();\r
-\r
- /**\r
- *\r
- */\r
- void setX(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getY();\r
-\r
- /**\r
- *\r
- */\r
- void setY(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getWidth();\r
-\r
- /**\r
- *\r
- */\r
- void setWidth(double val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- double getHeight();\r
-\r
- /**\r
- *\r
- */\r
- void setHeight(double val) throw(DOMException);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGRect();\r
-\r
- /**\r
- *\r
- */\r
- SVGRect(const SVGRect &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGRect();\r
-\r
-protected:\r
-\r
- double x, y, width, height;\r
-\r
-};\r
-\r
-/*#########################################################################\r
-## SVGTransform\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGTransform\r
-{\r
-public:\r
-\r
- /**\r
- * Transform Types\r
- */\r
- typedef enum\r
- {\r
- SVG_TRANSFORM_UNKNOWN = 0,\r
- SVG_TRANSFORM_MATRIX = 1,\r
- SVG_TRANSFORM_TRANSLATE = 2,\r
- SVG_TRANSFORM_SCALE = 3,\r
- SVG_TRANSFORM_ROTATE = 4,\r
- SVG_TRANSFORM_SKEWX = 5,\r
- SVG_TRANSFORM_SKEWY = 6,\r
- } TransformType;\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getType();\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix getMatrix();\r
-\r
- /**\r
- *\r
- */\r
- double getAngle();\r
-\r
- /**\r
- *\r
- */\r
- void setMatrix(const SVGMatrix &matrixArg);\r
-\r
- /**\r
- *\r
- */\r
- void setTranslate(double tx, double ty);\r
-\r
- /**\r
- *\r
- */\r
- void setScale(double sx, double sy);\r
-\r
- /**\r
- *\r
- */\r
- void setRotate(double angleArg, double cx, double cy);\r
-\r
- /**\r
- *\r
- */\r
- void setSkewX(double angleArg);\r
-\r
- /**\r
- *\r
- */\r
- void setSkewY(double angleArg);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGTransform();\r
-\r
- /**\r
- *\r
- */\r
- SVGTransform(const SVGTransform &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGTransform();\r
-\r
-protected:\r
-\r
- int type;\r
- double angle;\r
-\r
- SVGMatrix matrix;\r
-};\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGUnitTypes\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGUnitTypes\r
-{\r
-public:\r
-\r
- /**\r
- * Unit Types\r
- */\r
- typedef enum\r
- {\r
- SVG_UNIT_TYPE_UNKNOWN = 0,\r
- SVG_UNIT_TYPE_USERSPACEONUSE = 1,\r
- SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2\r
- } UnitType;\r
-\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGUnitTypes();\r
-\r
- /**\r
- *\r
- */\r
- ~SVGUnitTypes();\r
-\r
-};\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGValue\r
-#########################################################################*/\r
-\r
-/**\r
- * This is a helper class that will hold several types of data. It will\r
- * be used in those situations where methods are common to different \r
- * interfaces, except for the data type. This class holds the following:\r
- * SVGAngle\r
- * SVGBoolean\r
- * SVGEnumeration\r
- * SVGInteger\r
- * SVGLength\r
- * SVGNumber\r
- * SVGPreserveAspectRatio\r
- * SVGRect\r
- * SVGString\r
- */ \r
-class SVGValue\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- typedef enum\r
- {\r
- SVG_ANGLE,\r
- SVG_BOOLEAN,\r
- SVG_ENUMERATION,\r
- SVG_INTEGER,\r
- SVG_LENGTH,\r
- SVG_NUMBER,\r
- SVG_PRESERVE_ASPECT_RATIO,\r
- SVG_RECT,\r
- SVG_STRING,\r
- } SVGValueType;\r
-\r
- /**\r
- * Constructor\r
- */\r
- SVGValue();\r
- \r
- /**\r
- * Copy constructor\r
- */\r
- SVGValue(const SVGValue &other);\r
- \r
- /**\r
- * Assignment\r
- */\r
- SVGValue &operator=(const SVGValue &other);\r
- \r
- /**\r
- *\r
- */\r
- ~SVGValue();\r
- \r
- //###########################\r
- // TYPES\r
- //###########################\r
-\r
- /**\r
- * Angle\r
- */\r
- SVGValue(const SVGAngle &v);\r
- \r
- SVGAngle angleValue();\r
- \r
- /**\r
- * Boolean\r
- */\r
- SVGValue(bool v);\r
- \r
- bool booleanValue();\r
- \r
- \r
- /**\r
- * Enumeration\r
- */\r
- SVGValue(short v);\r
- \r
- short enumerationValue();\r
-\r
- /**\r
- * Integer\r
- */\r
- SVGValue(long v);\r
- \r
- long integerValue();\r
- \r
- /**\r
- * Length\r
- */\r
- SVGValue(const SVGLength &v);\r
- \r
- SVGLength lengthValue();\r
- \r
- /**\r
- * Number\r
- */\r
- SVGValue(double v);\r
- \r
- double numberValue();\r
-\r
- /**\r
- * PathSegment\r
- */\r
- SVGValue(const SVGPathSeg &v);\r
- \r
- SVGPathSeg pathDataValue();\r
- \r
- \r
- /**\r
- * Points\r
- */\r
- SVGValue(const SVGPoint &v);\r
- \r
- SVGPoint pointValue();\r
- \r
- \r
- /**\r
- * PreserveAspectRatio\r
- */\r
- SVGValue(const SVGPreserveAspectRatio &v);\r
- \r
- SVGPreserveAspectRatio preserveAspectRatioValue();\r
- \r
- /**\r
- * Rect\r
- */\r
- SVGValue(const SVGRect &v);\r
- \r
- SVGRect rectValue();\r
- \r
- /**\r
- * String\r
- */\r
- SVGValue(const DOMString &v);\r
- \r
- DOMString stringValue();\r
- \r
- /**\r
- * TransformList\r
- */\r
- SVGValue(const SVGTransform &v);\r
- \r
- SVGTransform transformValue();\r
- \r
- \r
-private:\r
-\r
- void init();\r
- \r
- void assign(const SVGValue &other);\r
- \r
- short type;\r
- SVGAngle angleval; // SVGAngle\r
- bool bval; // SVGBoolean\r
- short eval; // SVGEnumeration\r
- long ival; // SVGInteger\r
- SVGLength lengthval; // SVGLength\r
- double dval; // SVGNumber\r
- SVGPathSeg segval; // SVGPathSeg\r
- SVGPoint pointval; // SVGPoint\r
- SVGPreserveAspectRatio parval; // SVGPreserveAspectRatio\r
- SVGRect rval; // SVGRect\r
- DOMString sval; // SVGString\r
- SVGTransform transformval; // SVGTransform\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGValueList\r
-#########################################################################*/\r
-\r
-/**\r
- * THis is used to generify a bit the several different types of lists:\r
- *\r
- * SVGLengthList -> SVGValueList<SVGLength>\r
- * SVGValueList -> SVGValueList<SVGNumber>\r
- * SVGPathData -> SVGValueList<SVGPathSeg>\r
- * SVGPoints -> SVGValueList<SVGPoint>\r
- * SVGTransformList -> SVGValueList<SVGTransform>\r
- */\r
-class SVGValueList\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- typedef enum\r
- {\r
- SVG_LIST_LENGTH,\r
- SVG_LIST_NUMBER,\r
- SVG_LIST_PATHSEG,\r
- SVG_LIST_POINT,\r
- SVG_LIST_TRANSFORM\r
- } SVGValueListTypes;\r
-\r
- /**\r
- *\r
- */\r
- unsigned long getNumberOfItems();\r
-\r
-\r
- /**\r
- *\r
- */\r
- void clear() throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue getItem(unsigned long index) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue insertItemBefore(const SVGValue &newItem,\r
- unsigned long index)\r
- throw(DOMException, SVGException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue replaceItem(const SVGValue &newItem,\r
- unsigned long index)\r
- throw(DOMException, SVGException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue removeItem(unsigned long index) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue appendItem(const SVGValue &newItem)\r
- throw(DOMException, SVGException);\r
-\r
- /**\r
- * Matrix\r
- */\r
- SVGValue initialize(const SVGValue &newItem)\r
- throw(DOMException, SVGException);\r
-\r
- /**\r
- * Matrix\r
- */\r
- SVGValue createSVGTransformFromMatrix(const SVGValue &matrix);\r
-\r
- /**\r
- * Matrix\r
- */\r
- SVGValue consolidate();\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList();\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList(const SVGValueList &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGValueList();\r
-\r
-protected:\r
-\r
- std::vector<SVGValue> items;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGAnimatedValue\r
-#########################################################################*/\r
-\r
-/**\r
- * This class is used to merge all of the "Animated" values, with only\r
- * a different type, into a single API. This class subsumes the following:\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- * SVGAnimatedPathData\r
- * SVGAnimatedPoints\r
- * SVGAnimatedPreserveAspectRatio\r
- * SVGAnimatedValue\r
- * SVGAnimatedValue\r
- */\r
-class SVGAnimatedValue\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGValue &getBaseVal();\r
-\r
- /**\r
- *\r
- */\r
- void setBaseVal(const SVGValue &val) throw (DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValue &getAnimVal();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue();\r
- \r
- /**\r
- *\r
- */\r
- SVGAnimatedValue(const SVGValue &baseValue);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue(const SVGValue &baseValue, const SVGValue &animValue);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue(const SVGAnimatedValue &other);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue &operator=(const SVGAnimatedValue &other);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue &operator=(const SVGValue &baseVal);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGAnimatedValue();\r
- \r
-private:\r
-\r
- void init();\r
- \r
- void assign(const SVGAnimatedValue &other);\r
- \r
- SVGValue baseVal;\r
- \r
- SVGValue animVal;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGAnimatedValueList\r
-#########################################################################*/\r
-\r
-/**\r
- * This class is used to merge all of the "Animated" values, with only\r
- * a different type, into a single API. This class subsumes the following:\r
- * SVGAnimatedValueList\r
- * SVGAnimatedValueList\r
- * SVGAnimatedTransformList\r
- */\r
-class SVGAnimatedValueList\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getBaseVal();\r
-\r
- /**\r
- *\r
- */\r
- void setBaseVal(const SVGValueList &val) throw (DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getAnimVal();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList();\r
- \r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList(const SVGValueList &baseValue);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList(const SVGValueList &baseValue, const SVGValueList &animValue);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList(const SVGAnimatedValueList &other);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList &operator=(const SVGAnimatedValueList &other);\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList &operator=(const SVGValueList &baseVal);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGAnimatedValueList();\r
- \r
-private:\r
-\r
- void init();\r
- \r
- void assign(const SVGAnimatedValueList &other);\r
- \r
- SVGValueList baseVal;\r
- \r
- SVGValueList animVal;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGICCColor\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGICCColor\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- DOMString getColorProfile();\r
-\r
- /**\r
- *\r
- */\r
- void setColorProfile(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getColors();\r
-\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGICCColor();\r
-\r
- /**\r
- *\r
- */\r
- SVGICCColor(const SVGICCColor &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGICCColor();\r
-\r
-protected:\r
-\r
- DOMString colorProfile;\r
-\r
- SVGValueList colors;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGColor\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGColor : public css::CSSValue\r
-{\r
-public:\r
-\r
-\r
- /**\r
- * Color Types\r
- */\r
- typedef enum\r
- {\r
- SVG_COLORTYPE_UNKNOWN = 0,\r
- SVG_COLORTYPE_RGBCOLOR = 1,\r
- SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2,\r
- SVG_COLORTYPE_CURRENTCOLOR = 3\r
- } ColorType;\r
-\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getColorType();\r
-\r
- /**\r
- *\r
- */\r
- css::RGBColor getRgbColor();\r
-\r
- /**\r
- *\r
- */\r
- SVGICCColor getIccColor();\r
-\r
-\r
- /**\r
- *\r
- */\r
- void setRGBColor(const DOMString& /*rgbColor*/)\r
- throw(SVGException);\r
-\r
- /**\r
- *\r
- */\r
- void setRGBColorICCColor(const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw(SVGException);\r
-\r
- /**\r
- *\r
- */\r
- void setColor(unsigned short /*colorType*/,\r
- const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw(SVGException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGColor();\r
-\r
- /**\r
- *\r
- */\r
- SVGColor(const SVGColor &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGColor();\r
-\r
-protected:\r
-\r
- int colorType;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGPaint\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGPaint : public SVGColor\r
-{\r
-public:\r
-\r
- /**\r
- * Paint Types\r
- */\r
- typedef enum\r
- {\r
- SVG_PAINTTYPE_UNKNOWN = 0,\r
- SVG_PAINTTYPE_RGBCOLOR = 1,\r
- SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2,\r
- SVG_PAINTTYPE_NONE = 101,\r
- SVG_PAINTTYPE_CURRENTCOLOR = 102,\r
- SVG_PAINTTYPE_URI_NONE = 103,\r
- SVG_PAINTTYPE_URI_CURRENTCOLOR = 104,\r
- SVG_PAINTTYPE_URI_RGBCOLOR = 105,\r
- SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106,\r
- SVG_PAINTTYPE_URI = 107\r
- } PaintType;\r
-\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getPaintType();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getUri();\r
-\r
- /**\r
- *\r
- */\r
- void setUri(const DOMString& uriArg);\r
-\r
- /**\r
- *\r
- */\r
- void setPaint(unsigned short paintTypeArg,\r
- const DOMString& uriArg,\r
- const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw(SVGException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGPaint();\r
-\r
- /**\r
- *\r
- */\r
- SVGPaint(const SVGPaint &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGPaint();\r
-\r
-protected:\r
-\r
- unsigned int paintType;\r
- DOMString uri;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-//########################################################################\r
-//########################################################################\r
-//# I N T E R F A C E S\r
-//########################################################################\r
-//########################################################################\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGStylable\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGStylable\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getClassName();\r
-\r
- /**\r
- *\r
- */\r
- css::CSSStyleDeclaration getStyle();\r
-\r
-\r
- /**\r
- *\r
- */\r
- css::CSSValue getPresentationAttribute(const DOMString& /*name*/);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGStylable();\r
-\r
- /**\r
- *\r
- */\r
- SVGStylable(const SVGStylable &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGStylable();\r
-\r
-protected:\r
-\r
- SVGAnimatedValue className;\r
- css::CSSStyleDeclaration style;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGLocatable\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGLocatable\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGElementPtr getNearestViewportElement();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementPtr getFarthestViewportElement();\r
-\r
- /**\r
- *\r
- */\r
- SVGRect getBBox();\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix getCTM();\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix getScreenCTM();\r
-\r
- /**\r
- *\r
- */\r
- SVGMatrix getTransformToElement(const SVGElement &/*element*/)\r
- throw(SVGException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGLocatable();\r
-\r
- /**\r
- *\r
- */\r
- SVGLocatable(const SVGLocatable &/*other*/);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGLocatable();\r
-\r
-protected:\r
-\r
- SVGRect bbox;\r
- SVGMatrix ctm;\r
- SVGMatrix screenCtm;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGTransformable\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGTransformable : public SVGLocatable\r
-{\r
-public:\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValueList &getTransform();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGTransformable();\r
-\r
- /**\r
- *\r
- */\r
- SVGTransformable(const SVGTransformable &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGTransformable();\r
-\r
-protected:\r
-\r
- SVGAnimatedValueList transforms;\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGTests\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGTests\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getRequiredFeatures();\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getRequiredExtensions();\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList &getSystemLanguage();\r
-\r
- /**\r
- *\r
- */\r
- bool hasExtension(const DOMString& /*extension*/);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGTests();\r
-\r
- /**\r
- *\r
- */\r
- SVGTests(const SVGTests &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGTests();\r
-\r
-protected:\r
-\r
- SVGValueList requiredFeatures;\r
- SVGValueList requiredExtensions;\r
- SVGValueList systemLanguage;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGLangSpace\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGLangSpace\r
-{\r
-public:\r
-\r
-\r
- /**\r
- *\r
- */\r
- DOMString getXmlLang();\r
-\r
- /**\r
- *\r
- */\r
- void setXmlLang(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- DOMString getXmlSpace();\r
-\r
- /**\r
- *\r
- */\r
- void setXmlSpace(const DOMString &val) throw(DOMException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGLangSpace();\r
-\r
- /**\r
- *\r
- */\r
- SVGLangSpace(const SVGLangSpace &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGLangSpace();\r
-\r
-protected:\r
-\r
- DOMString xmlLang;\r
- DOMString xmlSpace;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGExternalResourcesRequired\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGExternalResourcesRequired\r
-{\r
-public:\r
-\r
- /**\r
- * boolean\r
- */\r
- SVGAnimatedValue getExternalResourcesRequired();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGExternalResourcesRequired();\r
-\r
- /**\r
- *\r
- */\r
- SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGExternalResourcesRequired();\r
-\r
-protected:\r
-\r
- SVGAnimatedValue required; //boolean\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGFitToViewBox\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGFitToViewBox\r
-{\r
-public:\r
-\r
- /**\r
- * rect\r
- */\r
- SVGAnimatedValue getViewBox();\r
-\r
- /**\r
- * preserveAspectRatio\r
- */\r
- SVGAnimatedValue getPreserveAspectRatio();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGFitToViewBox();\r
-\r
- /**\r
- *\r
- */\r
- SVGFitToViewBox(const SVGFitToViewBox &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGFitToViewBox();\r
-\r
-protected:\r
-\r
- SVGAnimatedValue viewBox; //rect\r
- SVGAnimatedValue preserveAspectRatio;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGZoomAndPan\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGZoomAndPan\r
-{\r
-public:\r
-\r
- /**\r
- * Zoom and Pan Types\r
- */\r
- typedef enum\r
- {\r
- SVG_ZOOMANDPAN_UNKNOWN = 0,\r
- SVG_ZOOMANDPAN_DISABLE = 1,\r
- SVG_ZOOMANDPAN_MAGNIFY = 2\r
- } ZoomAndPanType;\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getZoomAndPan();\r
-\r
- /**\r
- *\r
- */\r
- void setZoomAndPan(unsigned short val) throw(DOMException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGZoomAndPan();\r
-\r
- /**\r
- *\r
- */\r
- SVGZoomAndPan(const SVGZoomAndPan &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGZoomAndPan();\r
-\r
-protected:\r
-\r
- unsigned short zoomAndPan;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGViewSpec\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGViewSpec : public SVGZoomAndPan,\r
- public SVGFitToViewBox\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList getTransform();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementPtr getViewTarget();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getViewBoxString();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getPreserveAspectRatioString();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getTransformString();\r
-\r
- /**\r
- *\r
- */\r
- DOMString getViewTargetString();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGViewSpec();\r
-\r
- /**\r
- *\r
- */\r
- SVGViewSpec(const SVGViewSpec &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGViewSpec();\r
-\r
-protected:\r
-\r
- SVGElementPtr viewTarget;\r
- SVGValueList transform;\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGURIReference\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGURIReference\r
-{\r
-public:\r
-\r
- /**\r
- * string\r
- */\r
- SVGAnimatedValue getHref();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGURIReference();\r
-\r
- /**\r
- *\r
- */\r
- SVGURIReference(const SVGURIReference &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGURIReference();\r
-\r
-protected:\r
-\r
- SVGAnimatedValue href;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGCSSRule\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGCSSRule : public css::CSSRule\r
-{\r
-public:\r
-\r
-\r
- /**\r
- * Additional CSS RuleType to support ICC color specifications\r
- */\r
- typedef enum\r
- {\r
- COLOR_PROFILE_RULE = 7\r
- } ColorProfileRuleType;\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGCSSRule();\r
-\r
- /**\r
- *\r
- */\r
- SVGCSSRule(const SVGCSSRule &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGCSSRule();\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGRenderingIntent\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGRenderingIntent\r
-{\r
-public:\r
-\r
- /**\r
- * Rendering Intent Types\r
- */\r
- typedef enum\r
- {\r
- RENDERING_INTENT_UNKNOWN = 0,\r
- RENDERING_INTENT_AUTO = 1,\r
- RENDERING_INTENT_PERCEPTUAL = 2,\r
- RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,\r
- RENDERING_INTENT_SATURATION = 4,\r
- RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5\r
- } RenderingIntentType;\r
-\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGRenderingIntent();\r
-\r
- /**\r
- *\r
- */\r
- SVGRenderingIntent(const SVGRenderingIntent &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGRenderingIntent();\r
-\r
-protected:\r
-\r
- unsigned short renderingIntentType;\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGColorProfileRule\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGColorProfileRule : public SVGCSSRule,\r
- public SVGRenderingIntent\r
-{\r
-\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- DOMString getSrc();\r
-\r
- /**\r
- *\r
- */\r
- void setSrc(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- DOMString getName();\r
-\r
- /**\r
- *\r
- */\r
- void setName(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- *\r
- */\r
- unsigned short getRenderingIntent();\r
-\r
- /**\r
- *\r
- */\r
- void setRenderingIntent(unsigned short val) throw(DOMException);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGColorProfileRule();\r
-\r
- /**\r
- *\r
- */\r
- SVGColorProfileRule(const SVGColorProfileRule &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGColorProfileRule();\r
-\r
-protected:\r
-\r
- unsigned short renderingIntent;\r
- DOMString src;\r
- DOMString name;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGFilterPrimitiveStandardAttributes\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGFilterPrimitiveStandardAttributes : public SVGStylable\r
-{\r
-public:\r
-\r
- /**\r
- * length\r
- */\r
- SVGAnimatedValue getX();\r
-\r
- /**\r
- * length\r
- */\r
- SVGAnimatedValue getY();\r
-\r
- /**\r
- * length\r
- */\r
- SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * length\r
- */\r
- SVGAnimatedValue getHeight();\r
-\r
- /**\r
- * string\r
- */\r
- SVGAnimatedValue getResult();\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGFilterPrimitiveStandardAttributes();\r
-\r
- /**\r
- *\r
- */\r
- SVGFilterPrimitiveStandardAttributes(\r
- const SVGFilterPrimitiveStandardAttributes &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGFilterPrimitiveStandardAttributes();\r
-\r
-protected:\r
-\r
- SVGAnimatedValue x;\r
- SVGAnimatedValue y;\r
- SVGAnimatedValue width;\r
- SVGAnimatedValue height;\r
- SVGAnimatedValue result;\r
-\r
-};\r
-\r
-\r
-/*#########################################################################\r
-## SVGEvent\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGEvent : events::Event\r
-{\r
-public:\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGEvent();\r
-\r
- /**\r
- *\r
- */\r
- SVGEvent(const SVGEvent &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGEvent();\r
-\r
-};\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGZoomEvent\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGZoomEvent : events::UIEvent\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGRect getZoomRectScreen();\r
-\r
- /**\r
- *\r
- */\r
- double getPreviousScale();\r
-\r
- /**\r
- *\r
- */\r
- SVGPoint getPreviousTranslate();\r
-\r
- /**\r
- *\r
- */\r
- double getNewScale();\r
-\r
- /**\r
- *\r
- */\r
- SVGPoint getNewTranslate();\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGZoomEvent();\r
-\r
- /**\r
- *\r
- */\r
- SVGZoomEvent(const SVGZoomEvent &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGZoomEvent();\r
-\r
-protected:\r
-\r
- SVGRect zoomRectScreen;\r
- double previousScale;\r
- SVGPoint previousTranslate;\r
- double newScale;\r
- SVGPoint newTranslate;\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGElementInstance\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGElementInstance : public events::EventTarget\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- SVGElementPtr getCorrespondingElement();\r
-\r
- /**\r
- *\r
- */\r
- SVGUseElementPtr getCorrespondingUseElement();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance getParentNode();\r
-\r
- /**\r
- * Since we are using stack types and this is a circular definition,\r
- * we will instead implement this as a global function below:\r
- * SVGElementInstanceList getChildNodes(const SVGElementInstance instance);\r
- */\r
- //SVGElementInstanceList getChildNodes();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance getFirstChild();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance getLastChild();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance getPreviousSibling();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance getNextSibling();\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance(const SVGElementInstance &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGElementInstance();\r
-\r
-protected:\r
-\r
- SVGElementPtr correspondingElement;\r
- SVGUseElementPtr correspondingUseElement;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGElementInstanceList\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-class SVGElementInstanceList\r
-{\r
-public:\r
-\r
- /**\r
- *\r
- */\r
- unsigned long getLength();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstance item(unsigned long index);\r
-\r
- /**\r
- * This static method replaces the circular definition of:\r
- * SVGElementInstanceList SVGElementInstance::getChildNodes()\r
- *\r
- */\r
- static SVGElementInstanceList getChildNodes(const SVGElementInstance &/*instance*/);\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstanceList();\r
-\r
- /**\r
- *\r
- */\r
- SVGElementInstanceList(const SVGElementInstanceList &other);\r
-\r
- /**\r
- *\r
- */\r
- ~SVGElementInstanceList();\r
-\r
-protected:\r
-\r
- std::vector<SVGElementInstance> items;\r
-\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-//# D O M\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## Types\r
-#########################################################################*/\r
-\r
-/**\r
- * Bitmasks for has_an interface for SVGElement\r
- */ \r
-#define SVG_ANGLE 0x00000001\r
-#define SVG_ANIMATED_ANGLE 0x00000002\r
-#define SVG_ANIMATED_BOOLEAN 0x00000004\r
-#define SVG_ANIMATED_ENUMERATION 0x00000008\r
-#define SVG_ANIMATED_INTEGER 0x00000010\r
-#define SVG_ANIMATED_LENGTH 0x00000020\r
-#define SVG_ANIMATED_LENGTH_LIST 0x00000040\r
-#define SVG_ANIMATED_NUMBER 0x00000080\r
-#define SVG_ANIMATED_NUMBER_LIST 0x00000100\r
-#define SVG_ANIMATED_RECT 0x00000200\r
-#define SVG_ANIMATED_STRING 0x00000400\r
-#define SVG_COLOR 0x00000800\r
-#define SVG_CSS_RULE 0x00001000\r
-#define SVG_EXTERNAL_RESOURCES_REQUIRED 0x00002000\r
-#define SVG_FIT_TO_VIEWBOX 0x00004000\r
-#define SVG_ICCCOLOR 0x00008000\r
-#define SVG_LANG_SPACE 0x00010000\r
-#define SVG_LENGTH 0x00020000\r
-#define SVG_LENGTH_LIST 0x00040000\r
-#define SVG_LOCATABLE 0x00080000\r
-#define SVG_NUMBER 0x00100000\r
-#define SVG_NUMBER_LIST 0x00200000\r
-#define SVG_RECT 0x00400000\r
-#define SVG_RENDERING_INTENT 0x00800000\r
-#define SVG_STRING_LIST 0x01000000\r
-#define SVG_STYLABLE 0x02000000\r
-#define SVG_TESTS 0x04000000\r
-#define SVG_TRANSFORMABLE 0x08000000\r
-#define SVG_UNIT_TYPES 0x10000000\r
-#define SVG_URI_REFERENCE 0x20000000\r
-#define SVG_VIEW_SPEC 0x40000000\r
-#define SVG_ZOOM_AND_PAN 0x80000000\r
-\r
-/**\r
- * How many above? Quite handy\r
- */ \r
-#define SVG_NR_INTERFACES 32\r
-\r
-\r
-/**\r
- * Enumerations for SVGElement types\r
- */ \r
-typedef enum\r
-{\r
- SVG_A_ELEMENT = 0,\r
- SVG_ALTGLYPH_ELEMENT,\r
- SVG_ALTGLYPHDEF_ELEMENT,\r
- SVG_ALTGLYPHITEM_ELEMENT,\r
- SVG_ANIMATE_ELEMENT,\r
- SVG_ANIMATECOLOR_ELEMENT,\r
- SVG_ANIMATEMOTION_ELEMENT,\r
- SVG_ANIMATETRANSFORM_ELEMENT,\r
- SVG_CIRCLE_ELEMENT,\r
- SVG_CLIPPATH_ELEMENT,\r
- SVG_COLOR_PROFILE_ELEMENT,\r
- SVG_CURSOR_ELEMENT,\r
- SVG_DEFINITION_SRC_ELEMENT,\r
- SVG_DEFS_ELEMENT,\r
- SVG_DESC_ELEMENT,\r
- SVG_ELLIPSE_ELEMENT,\r
- SVG_FEBLEND_ELEMENT,\r
- SVG_FECOLORMATRIX_ELEMENT,\r
- SVG_FECOMPONENTTRANSFER_ELEMENT,\r
- SVG_FECOMPOSITE_ELEMENT,\r
- SVG_FECONVOLVEMATRIX_ELEMENT,\r
- SVG_FEDIFFUSELIGHTING_ELEMENT,\r
- SVG_FEDISPLACEMENTMAP_ELEMENT,\r
- SVG_FEDISTANTLIGHT_ELEMENT,\r
- SVG_FEFLOOD_ELEMENT,\r
- SVG_FEFUNCA_ELEMENT,\r
- SVG_FEFUNCB_ELEMENT,\r
- SVG_FEFUNCG_ELEMENT,\r
- SVG_FEFUNCR_ELEMENT,\r
- SVG_FEGAUSSIANBLUR_ELEMENT,\r
- SVG_FEIMAGE_ELEMENT,\r
- SVG_FEMERGE_ELEMENT,\r
- SVG_FEMERGENODE_ELEMENT,\r
- SVG_FEMORPHOLOGY_ELEMENT,\r
- SVG_FEOFFSET_ELEMENT,\r
- SVG_FEPOINTLIGHT_ELEMENT,\r
- SVG_FESPECULARLIGHTING_ELEMENT,\r
- SVG_FESPOTLIGHT_ELEMENT,\r
- SVG_FETILE_ELEMENT,\r
- SVG_FETURBULENCE_ELEMENT,\r
- SVG_FILTER_ELEMENT,\r
- SVG_FONT_ELEMENT,\r
- SVG_FONT_FACE_ELEMENT,\r
- SVG_FONT_FACE_FORMAT_ELEMENT,\r
- SVG_FONT_FACE_NAME_ELEMENT,\r
- SVG_FONT_FACE_SRC_ELEMENT,\r
- SVG_FONT_FACE_URI_ELEMENT,\r
- SVG_FOREIGNOBJECT_ELEMENT,\r
- SVG_G_ELEMENT,\r
- SVG_GLYPH_ELEMENT,\r
- SVG_GLYPHREF_ELEMENT,\r
- SVG_HKERN_ELEMENT,\r
- SVG_IMAGE_ELEMENT,\r
- SVG_LINE_ELEMENT,\r
- SVG_LINEARGRADIENT_ELEMENT,\r
- SVG_MARKER_ELEMENT,\r
- SVG_MASK_ELEMENT,\r
- SVG_METADATA_ELEMENT,\r
- SVG_MISSING_GLYPH_ELEMENT,\r
- SVG_MPATH_ELEMENT,\r
- SVG_PATH_ELEMENT,\r
- SVG_PATTERN_ELEMENT,\r
- SVG_POLYGON_ELEMENT,\r
- SVG_POLYLINE_ELEMENT,\r
- SVG_RADIALGRADIENT_ELEMENT,\r
- SVG_RECT_ELEMENT,\r
- SVG_SCRIPT_ELEMENT,\r
- SVG_SET_ELEMENT,\r
- SVG_STOP_ELEMENT,\r
- SVG_STYLE_ELEMENT,\r
- SVG_SVG_ELEMENT,\r
- SVG_SWITCH_ELEMENT,\r
- SVG_SYMBOL_ELEMENT,\r
- SVG_TEXT_ELEMENT,\r
- SVG_TEXTPATH_ELEMENT,\r
- SVG_TITLE_ELEMENT,\r
- SVG_TREF_ELEMENT,\r
- SVG_TSPAN_ELEMENT,\r
- SVG_USE_ELEMENT,\r
- SVG_VIEW_ELEMENT,\r
- SVG_VKERN_ELEMENT,\r
- SVG_MAX_ELEMENT\r
-} SVGElementType;\r
-\r
-\r
-\r
-\r
-/**\r
- * Look up the SVG Element type enum for a given string\r
- * Return -1 if not found\r
- */\r
-int svgElementStrToEnum(const char *str);\r
-\r
-\r
-/**\r
- * Return the string corresponding to a given SVG element type enum\r
- * Return "unknown" if not found\r
- */\r
-const char *svgElementEnumToStr(int type);\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGElement\r
-#########################################################################*/\r
-\r
-/**\r
- * All of the SVG DOM interfaces that correspond directly to elements in the SVG\r
- * language(e.g., the SVGPathElement interface corresponds directly to the\r
- * 'path' element in the language) are derivative from base class SVGElement.\r
- */\r
-class SVGElement : public Element\r
-{\r
-public:\r
-\r
- //####################################################################\r
- //# BASE METHODS FOR SVGElement\r
- //####################################################################\r
-\r
- /**\r
- * Get the value of the id attribute on the given element.\r
- */\r
- DOMString getId();\r
-\r
- /**\r
- * Set the value of the id attribute on the given element.\r
- */\r
- void setId(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Corresponds to attribute xml:base on the given element.\r
- */\r
- DOMString getXmlBase();\r
-\r
- /**\r
- * Corresponds to attribute xml:base on the given element.\r
- */\r
- void setXmlBase(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * The nearest ancestor 'svg' element. Null if the given element is the\r
- * outermost 'svg' element.\r
- */\r
- SVGElementPtr getOwnerSVGElement();\r
-\r
- /**\r
- * The element which established the current viewport. Often, the nearest\r
- * ancestor 'svg' element. Null if the given element is the outermost 'svg'\r
- * element.\r
- */\r
- SVGElementPtr getViewportElement();\r
-\r
-\r
-\r
- //####################################################################\r
- //####################################################################\r
- //# E L E M E N T S\r
- //####################################################################\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGAElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getTarget();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGAltGlyphElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Get the attribute glyphRef on the given element.\r
- */\r
- DOMString getGlyphRef();\r
-\r
- /**\r
- * Set the attribute glyphRef on the given element.\r
- */\r
- void setGlyphRef(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute format on the given element.\r
- */\r
- DOMString getFormat();\r
-\r
- /**\r
- * Set the attribute format on the given element.\r
- */\r
- void setFormat(const DOMString &val) throw(DOMException);\r
-\r
-\r
- //####################################################################\r
- //# SVGAltGlyphDefElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGAltGlyphItemElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGAnimateElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGAnimateColorElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGAnimateMotionElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGAnimateTransformElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGAnimationElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGElementPtr getTargetElement();\r
-\r
- /**\r
- *\r
- */\r
- double getStartTime();\r
-\r
- /**\r
- *\r
- */\r
- double getCurrentTime();\r
-\r
- /**\r
- *\r
- */\r
- double getSimpleDuration() throw(DOMException);\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGCircleElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute cx on the given 'circle' element.\r
- */\r
- SVGAnimatedValue getCx();\r
-\r
- /**\r
- * Corresponds to attribute cy on the given 'circle' element.\r
- */\r
- SVGAnimatedValue getCy();\r
-\r
- /**\r
- * Corresponds to attribute r on the given 'circle' element.\r
- */\r
- SVGAnimatedValue getR();\r
-\r
- //####################################################################\r
- //# SVGClipPathElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute clipPathUnits on the given 'clipPath' element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getClipPathUnits();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGColorProfileElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Get the attribute local on the given element.\r
- */\r
- DOMString getLocal();\r
-\r
- /**\r
- * Set the attribute local on the given element.\r
- */\r
- void setLocal(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute name on the given element.\r
- */\r
- DOMString getName();\r
-\r
- /**\r
- * Set the attribute name on the given element.\r
- */\r
- void setName(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Set the attribute rendering-intent on the given element.\r
- * The type of rendering intent, identified by one of the\r
- * SVGRenderingIntent constants.\r
- */\r
- unsigned short getRenderingIntent();\r
-\r
- /**\r
- * Get the attribute rendering-intent on the given element.\r
- */\r
- void setRenderingIntent(unsigned short val) throw(DOMException);\r
-\r
-\r
- //####################################################################\r
- //# SVGComponentTransferFunctionElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Component Transfer Types\r
- */\r
- typedef enum\r
- {\r
- SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,\r
- SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,\r
- SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2,\r
- SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,\r
- SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4,\r
- SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5\r
- } ComponentTransferType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute type on the given element. Takes one\\r
- * of the Component Transfer Types.\r
- * -- also in SVGCSSRule\r
- */\r
- // SVGAnimatedValue getType();\r
-\r
- /**\r
- * Corresponds to attribute tableValues on the given element.\r
- */\r
- SVGAnimatedValueList getTableValues();\r
-\r
- /**\r
- * Corresponds to attribute slope on the given element.\r
- */\r
- SVGAnimatedValue getSlope();\r
-\r
- /**\r
- * Corresponds to attribute intercept on the given element.\r
- */\r
- SVGAnimatedValue getIntercept();\r
-\r
- /**\r
- * Corresponds to attribute amplitude on the given element.\r
- */\r
- SVGAnimatedValue getAmplitude();\r
-\r
- /**\r
- * Corresponds to attribute exponent on the given element.\r
- */\r
- SVGAnimatedValue getExponent();\r
-\r
- /**\r
- * Corresponds to attribute offset on the given element.\r
- */\r
- SVGAnimatedValue getOffset();\r
-\r
- //####################################################################\r
- //# SVGCursorElement\r
- //####################################################################\r
-\r
- /**\r
- * -- also in SVGRect\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * -- also in SVGRect\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
-\r
- //####################################################################\r
- //# SVGDefinitionSrcElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGDefsElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGDescElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGEllipseElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute cx on the given 'ellipse' element.\r
- * -- also in Circle\r
- */\r
- // SVGAnimatedValue getCx();\r
-\r
- /**\r
- * Corresponds to attribute cy on the given 'ellipse' element.\r
- * -- also in Circle\r
- */\r
- // SVGAnimatedValue getCy();\r
-\r
- /**\r
- * Corresponds to attribute rx on the given 'ellipse' element.\r
- */\r
- SVGAnimatedValue getRx();\r
-\r
- /**\r
- * Corresponds to attribute ry on the given 'ellipse' element.\r
- */\r
- SVGAnimatedValue getRy();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEBlendElement\r
- //####################################################################\r
-\r
- /**\r
- * Blend Mode Types\r
- */\r
- typedef enum\r
- {\r
- SVG_FEBLEND_MODE_UNKNOWN = 0,\r
- SVG_FEBLEND_MODE_NORMAL = 1,\r
- SVG_FEBLEND_MODE_MULTIPLY = 2,\r
- SVG_FEBLEND_MODE_SCREEN = 3,\r
- SVG_FEBLEND_MODE_DARKEN = 4,\r
- SVG_FEBLEND_MODE_LIGHTEN = 5\r
- } BlendModeType;\r
-\r
- /**\r
- * Corresponds to attribute in on the given 'feBlend' element.\r
- */\r
- SVGAnimatedValue getIn1();\r
-\r
- /**\r
- * Corresponds to attribute in2 on the given 'feBlend' element.\r
- */\r
- SVGAnimatedValue getIn2();\r
-\r
- /**\r
- * Corresponds to attribute mode on the given 'feBlend' element.\r
- * Takes one of the Blend Mode Types.\r
- */\r
- SVGAnimatedValue getMode();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEColorMatrixElement\r
- //####################################################################\r
-\r
- /**\r
- * Color Matrix Types\r
- */\r
- typedef enum\r
- {\r
- SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0,\r
- SVG_FECOLORMATRIX_TYPE_MATRIX = 1,\r
- SVG_FECOLORMATRIX_TYPE_SATURATE = 2,\r
- SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3,\r
- SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4\r
- } ColorMatrixType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute in on the given 'feColorMatrix' element.\r
- * - also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- * Corresponds to attribute type on the given 'feColorMatrix' element.\r
- * Takes one of the Color Matrix Types.\r
- * -- also in CSSRule\r
- */\r
- // SVGAnimatedValue getType();\r
-\r
- /**\r
- * Corresponds to attribute values on the given 'feColorMatrix' element.\r
- * Provides access to the contents of the values attribute.\r
- */\r
- SVGAnimatedValueList getValues();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEComponentTransferElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute in on the given 'feComponentTransfer' element.\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- //####################################################################\r
- //# SVGFECompositeElement\r
- //####################################################################\r
-\r
- /**\r
- * Composite Operators\r
- */\r
- typedef enum\r
- {\r
- SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0,\r
- SVG_FECOMPOSITE_OPERATOR_OVER = 1,\r
- SVG_FECOMPOSITE_OPERATOR_IN = 2,\r
- SVG_FECOMPOSITE_OPERATOR_OUT = 3,\r
- SVG_FECOMPOSITE_OPERATOR_ATOP = 4,\r
- SVG_FECOMPOSITE_OPERATOR_XOR = 5,\r
- SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6\r
- } CompositeOperatorType;\r
-\r
- /**\r
- * Corresponds to attribute in on the given 'feComposite' element.\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- * Corresponds to attribute in2 on the given 'feComposite' element.\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn2();\r
-\r
- /**\r
- * Corresponds to attribute operator on the given 'feComposite' element.\r
- * Takes one of the Composite Operators.\r
- */\r
- SVGAnimatedValue getOperator();\r
-\r
- /**\r
- * Corresponds to attribute k1 on the given 'feComposite' element.\r
- */\r
- SVGAnimatedValue getK1();\r
-\r
- /**\r
- * Corresponds to attribute k2 on the given 'feComposite' element.\r
- */\r
- SVGAnimatedValue getK2();\r
-\r
- /**\r
- * Corresponds to attribute k3 on the given 'feComposite' element.\r
- */\r
- SVGAnimatedValue getK3();\r
-\r
- /**\r
- * Corresponds to attribute k4 on the given 'feComposite' element.\r
- */\r
- SVGAnimatedValue getK4();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEConvolveMatrixElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Edge Mode Values\r
- */\r
- typedef enum\r
- {\r
- SVG_EDGEMODE_UNKNOWN = 0,\r
- SVG_EDGEMODE_DUPLICATE = 1,\r
- SVG_EDGEMODE_WRAP = 2,\r
- SVG_EDGEMODE_NONE = 3\r
- } EdgeModeType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute order on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getOrderX();\r
-\r
- /**\r
- * Corresponds to attribute order on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getOrderY();\r
-\r
- /**\r
- * Corresponds to attribute kernelMatrix on the given element.\r
- */\r
- SVGAnimatedValueList getKernelMatrix();\r
-\r
- /**\r
- * Corresponds to attribute divisor on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getDivisor();\r
-\r
- /**\r
- * Corresponds to attribute bias on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getBias();\r
-\r
- /**\r
- * Corresponds to attribute targetX on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getTargetX();\r
-\r
- /**\r
- * Corresponds to attribute targetY on the given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getTargetY();\r
-\r
- /**\r
- * Corresponds to attribute edgeMode on the given 'feConvolveMatrix'\r
- * element. Takes one of the Edge Mode Types.\r
- */\r
- SVGAnimatedValue getEdgeMode();\r
-\r
- /**\r
- * Corresponds to attribute kernelUnitLength on the\r
- * given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getKernelUnitLengthX();\r
-\r
- /**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getKernelUnitLengthY();\r
-\r
- /**\r
- * Corresponds to attribute preserveAlpha on the\r
- * given 'feConvolveMatrix' element.\r
- */\r
- SVGAnimatedValue getPreserveAlpha();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGFEDiffuseLightingElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute in on the given 'feDiffuseLighting' element.\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- * Corresponds to attribute surfaceScale on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
- SVGAnimatedValue getSurfaceScale();\r
-\r
- /**\r
- * Corresponds to attribute diffuseConstant on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
- SVGAnimatedValue getDiffuseConstant();\r
-\r
- /**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
- // SVGAnimatedValue getKernelUnitLengthX();\r
-\r
- /**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
- // SVGAnimatedValue getKernelUnitLengthY();\r
-\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGFEDisplacementMapElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Channel Selectors\r
- */\r
- typedef enum\r
- {\r
- SVG_CHANNEL_UNKNOWN = 0,\r
- SVG_CHANNEL_R = 1,\r
- SVG_CHANNEL_G = 2,\r
- SVG_CHANNEL_B = 3,\r
- SVG_CHANNEL_A = 4\r
- } ChannelSelector;\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn2();\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getScale();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getXChannelSelector();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getYChannelSelector();\r
-\r
- //####################################################################\r
- //# SVGFEDistantLightElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute azimuth on the given 'feDistantLight' element.\r
- */\r
- SVGAnimatedValue getAzimuth();\r
-\r
-\r
- /**\r
- * Corresponds to attribute elevation on the given 'feDistantLight'\r
- * element\r
- */\r
- SVGAnimatedValue getElevation();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEFloodElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEFuncAElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFEFuncBElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFEFuncGElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFEFuncRElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGFEGaussianBlurElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getStdDeviationX();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getStdDeviationY();\r
-\r
-\r
- /**\r
- *\r
- */\r
- void setStdDeviation(double stdDeviationX, double stdDeviationY);\r
-\r
-\r
- //####################################################################\r
- //# SVGFEImageElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGFEMergeElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFEMergeNodeElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFEMorphologyElement\r
- //####################################################################\r
-\r
-\r
-\r
- /**\r
- * Morphology Operators\r
- */\r
- typedef enum\r
- {\r
- SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0,\r
- SVG_MORPHOLOGY_OPERATOR_ERODE = 1,\r
- SVG_MORPHOLOGY_OPERATOR_DILATE = 2\r
- } MorphologyOperatorType;\r
-\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getOperator();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getRadiusX();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getRadiusY();\r
-\r
- //####################################################################\r
- //# SVGFEOffsetElement\r
- //####################################################################\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getDx();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getDy();\r
-\r
-\r
- //####################################################################\r
- //# SVGFEPointLightElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'fePointLight' element.\r
- */\r
- SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'fePointLight' element.\r
- */\r
- SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute z on the given 'fePointLight' element.\r
- */\r
- SVGAnimatedValue getZ();\r
-\r
- //####################################################################\r
- //# SVGFESpecularLightingElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getSurfaceScale();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getSpecularConstant();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getSpecularExponent();\r
-\r
-\r
- //####################################################################\r
- //# SVGFESpotLightElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'feSpotLight' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'feSpotLight' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute z on the given 'feSpotLight' element.\r
- */\r
- // SVGAnimatedValue getZ();\r
-\r
- /**\r
- * Corresponds to attribute pointsAtX on the given 'feSpotLight' element.\r
- */\r
- SVGAnimatedValue getPointsAtX();\r
-\r
- /**\r
- * Corresponds to attribute pointsAtY on the given 'feSpotLight' element.\r
- */\r
- SVGAnimatedValue getPointsAtY();\r
-\r
- /**\r
- * Corresponds to attribute pointsAtZ on the given 'feSpotLight' element.\r
- */\r
- SVGAnimatedValue getPointsAtZ();\r
-\r
- /**\r
- * Corresponds to attribute specularExponent on the\r
- * given 'feSpotLight' element.\r
- */\r
- // SVGAnimatedValue getSpecularExponent();\r
-\r
- /**\r
- * Corresponds to attribute limitingConeAngle on the\r
- * given 'feSpotLight' element.\r
- */\r
- SVGAnimatedValue getLimitingConeAngle();\r
-\r
-\r
- //####################################################################\r
- //# SVGFETileElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- * -- also in feBlend\r
- */\r
- // SVGAnimatedValue getIn1();\r
-\r
-\r
- //####################################################################\r
- //# SVGFETurbulenceElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Turbulence Types\r
- */\r
- typedef enum\r
- {\r
- SVG_TURBULENCE_TYPE_UNKNOWN = 0,\r
- SVG_TURBULENCE_TYPE_FRACTALNOISE = 1,\r
- SVG_TURBULENCE_TYPE_TURBULENCE = 2\r
- } TurbulenceType;\r
-\r
- /**\r
- * Stitch Options\r
- */\r
- typedef enum\r
- {\r
- SVG_STITCHTYPE_UNKNOWN = 0,\r
- SVG_STITCHTYPE_STITCH = 1,\r
- SVG_STITCHTYPE_NOSTITCH = 2\r
- } StitchOption;\r
-\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getBaseFrequencyX();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getBaseFrequencyY();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getNumOctaves();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getSeed();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getStitchTiles();\r
-\r
- /**\r
- *\r
- */\r
- SVGAnimatedValue getType();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGFilterElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute filterUnits on the given 'filter' element. Takes one\r
- * of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getFilterUnits();\r
-\r
- /**\r
- * Corresponds to attribute primitiveUnits on the given 'filter' element. Takes\r
- * one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getPrimitiveUnits();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'filter' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'filter' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'filter' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
-\r
- /**\r
- * Corresponds to attribute filterRes on the given 'filter' element.\r
- * Contains the X component of attribute filterRes.\r
- */\r
- SVGAnimatedValue getFilterResX();\r
-\r
- /**\r
- * Corresponds to attribute filterRes on the given 'filter' element.\r
- * Contains the Y component(possibly computed automatically)\r
- * of attribute filterRes.\r
- */\r
- SVGAnimatedValue getFilterResY();\r
-\r
- /**\r
- * Sets the values for attribute filterRes.\r
- */\r
- void setFilterRes(unsigned long filterResX, unsigned long filterResY);\r
-\r
-\r
- //####################################################################\r
- //# SVGFontElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFontFaceElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFontFaceFormatElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFontFaceNameElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFontFaceSrcElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGFontFaceUriElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGForeignObjectElement\r
- //####################################################################\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGGlyphRefElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Get the attribute glyphRef on the given element.\r
- */\r
- // DOMString getGlyphRef();\r
-\r
- /**\r
- * Set the attribute glyphRef on the given element.\r
- */\r
- // void setGlyphRef(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute format on the given element.\r
- */\r
- // DOMString getFormat();\r
-\r
- /**\r
- * Set the attribute format on the given element.\r
- */\r
- // void setFormat(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute x on the given element.\r
- */\r
- // double getX();\r
-\r
- /**\r
- * Set the attribute x on the given element.\r
- */\r
- // void setX(double val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute y on the given element.\r
- */\r
- // double getY();\r
-\r
- /**\r
- * Set the attribute y on the given element.\r
- */\r
- // void setY(double val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute dx on the given element.\r
- */\r
- // double getDx();\r
-\r
- /**\r
- * Set the attribute dx on the given element.\r
- */\r
- // void setDx(double val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute dy on the given element.\r
- */\r
- // double getDy();\r
-\r
- /**\r
- * Set the attribute dy on the given element.\r
- */\r
- // void setDy(double val) throw(DOMException);\r
-\r
-\r
- //####################################################################\r
- //# SVGGradientElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Spread Method Types\r
- */\r
- typedef enum\r
- {\r
- SVG_SPREADMETHOD_UNKNOWN = 0,\r
- SVG_SPREADMETHOD_PAD = 1,\r
- SVG_SPREADMETHOD_REFLECT = 2,\r
- SVG_SPREADMETHOD_REPEAT = 3\r
- } SpreadMethodType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute gradientUnits on the given element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue &getGradientUnits();\r
-\r
- /**\r
- * Corresponds to attribute gradientTransform on the given element.\r
- */\r
- SVGAnimatedValueList &getGradientTransform();\r
-\r
- /**\r
- * Corresponds to attribute spreadMethod on the given element.\r
- * One of the Spread Method Types.\r
- */\r
- SVGAnimatedValue &getSpreadMethod();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGHKernElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGImageElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'image' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'image' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'image' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'image' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
-\r
- /**\r
- * Corresponds to attribute preserveAspectRatio on the given element.\r
- */\r
- // SVGAnimatedPreserveAspectRatio getPreserveAspectRatio();\r
-\r
- //####################################################################\r
- //# SVGLinearGradientElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x1 on the given 'linearGradient' element.\r
- */\r
- // SVGAnimatedValue getX1();\r
-\r
- /**\r
- * Corresponds to attribute y1 on the given 'linearGradient' element.\r
- */\r
- // SVGAnimatedValue getY1();\r
-\r
- /**\r
- * Corresponds to attribute x2 on the given 'linearGradient' element.\r
- */\r
- // SVGAnimatedValue getX2();\r
-\r
- /**\r
- * Corresponds to attribute y2 on the given 'linearGradient' element.\r
- */\r
- // SVGAnimatedValue getY2();\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGLineElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x1 on the given 'line' element.\r
- */\r
- // SVGAnimatedValue getX1();\r
-\r
- /**\r
- * Corresponds to attribute y1 on the given 'line' element.\r
- */\r
- // SVGAnimatedValue getY1();\r
-\r
- /**\r
- * Corresponds to attribute x2 on the given 'line' element.\r
- */\r
- // SVGAnimatedValue getX2();\r
-\r
- /**\r
- * Corresponds to attribute y2 on the given 'line' element.\r
- */\r
- // SVGAnimatedValue getY2();\r
-\r
-\r
- //####################################################################\r
- //# SVGMarkerElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Marker Unit Types\r
- */\r
- typedef enum\r
- {\r
- SVG_MARKERUNITS_UNKNOWN = 0,\r
- SVG_MARKERUNITS_USERSPACEONUSE = 1,\r
- SVG_MARKERUNITS_STROKEWIDTH = 2\r
- } MarkerUnitType;\r
-\r
- /**\r
- * Marker Orientation Types\r
- */\r
- typedef enum\r
- {\r
- SVG_MARKER_ORIENT_UNKNOWN = 0,\r
- SVG_MARKER_ORIENT_AUTO = 1,\r
- SVG_MARKER_ORIENT_ANGLE = 2\r
- } MarkerOrientationType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute refX on the given 'marker' element.\r
- */\r
- SVGAnimatedValue getRefX();\r
-\r
- /**\r
- * Corresponds to attribute refY on the given 'marker' element.\r
- */\r
- SVGAnimatedValue getRefY();\r
-\r
- /**\r
- * Corresponds to attribute markerUnits on the given 'marker' element.\r
- * One of the Marker Units Types defined above.\r
- */\r
- SVGAnimatedValue getMarkerUnits();\r
-\r
- /**\r
- * Corresponds to attribute markerWidth on the given 'marker' element.\r
- */\r
- SVGAnimatedValue getMarkerWidth();\r
-\r
- /**\r
- * Corresponds to attribute markerHeight on the given 'marker' element.\r
- */\r
- SVGAnimatedValue getMarkerHeight();\r
-\r
- /**\r
- * Corresponds to attribute orient on the given 'marker' element.\r
- * One of the Marker Orientation Types defined above.\r
- */\r
- SVGAnimatedValue getOrientType();\r
-\r
- /**\r
- * Corresponds to attribute orient on the given 'marker' element.\r
- * If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for\r
- * attribute orient; otherwise, it will be set to zero.\r
- */\r
- SVGAnimatedValue getOrientAngle();\r
-\r
-\r
- /**\r
- * Sets the value of attribute orient to 'auto'.\r
- */\r
- void setOrientToAuto();\r
-\r
- /**\r
- * Sets the value of attribute orient to the given angle.\r
- */\r
- void setOrientToAngle(const SVGAngle &angle);\r
-\r
-\r
- //####################################################################\r
- //# SVGMaskElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute maskUnits on the given 'mask' element. Takes one of\r
- * the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getMaskUnits();\r
-\r
- /**\r
- * Corresponds to attribute maskContentUnits on the given 'mask' element. Takes\r
- * one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getMaskContentUnits();\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'mask' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'mask' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'mask' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'mask' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
- //####################################################################\r
- //# SVGMetadataElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGMissingGlyphElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGMPathElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute pathLength on the given 'path' element.\r
- */\r
- SVGAnimatedValue getPathLength();\r
-\r
- /**\r
- * Returns the user agent's computed value for the total length of the path using\r
- * the user agent's distance-along-a-path algorithm, as a distance in the current\r
- * user coordinate system.\r
- */\r
- double getTotalLength();\r
-\r
- /**\r
- * Returns the(x,y) coordinate in user space which is distance units along the\r
- * path, utilizing the user agent's distance-along-a-path algorithm.\r
- */\r
- SVGPoint getPointAtLength(double distance);\r
-\r
- /**\r
- * Returns the index into pathSegList which is distance units along the path,\r
- * utilizing the user agent's distance-along-a-path algorithm.\r
- */\r
- unsigned long getPathSegAtLength(double distance);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegClosePath object.\r
- */\r
- SVGPathSeg createSVGPathSegClosePath();\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegMovetoAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegMovetoAbs(double x, double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegMovetoRel object.\r
- */\r
- SVGPathSeg createSVGPathSegMovetoRel(double x, double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoAbs(double x, double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoRel object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoRel(double x, double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoCubicAbs(double x, double y,\r
- double x1, double y1, double x2, double y2);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoCubicRel(double x, double y,\r
- double x1, double y1, double x2, double y2);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoQuadraticAbs(double x, double y,\r
- double x1, double y1);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoQuadraticRel(double x, double y,\r
- double x1, double y1);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegArcAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegArcAbs(double x, double y,\r
- double r1, double r2, double angle,\r
- bool largeArcFlag, bool sweepFlag);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegArcRel object.\r
- */\r
- SVGPathSeg createSVGPathSegArcRel(double x, double y, double r1,\r
- double r2, double angle, bool largeArcFlag,\r
- bool sweepFlag);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoHorizontalAbs(double x);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoHorizontalRel(double x);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoVerticalAbs(double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.\r
- */\r
- SVGPathSeg createSVGPathSegLinetoVerticalRel(double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoCubicSmoothAbs(double x, double y,\r
- double x2, double y2);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoCubicSmoothRel(double x, double y,\r
- double x2, double y2);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs\r
- * object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y);\r
-\r
- /**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel\r
- * object.\r
- */\r
- SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y);\r
-\r
- //####################################################################\r
- //# SVGPathElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGPatternElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute patternUnits on the given 'pattern' element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getPatternUnits();\r
-\r
- /**\r
- * Corresponds to attribute patternContentUnits on the given 'pattern'\r
- * element. Takes one of the constants defined in SVGUnitTypes.\r
- */\r
- SVGAnimatedValue getPatternContentUnits();\r
-\r
- /**\r
- * Corresponds to attribute patternTransform on the given 'pattern' element.\r
- */\r
- SVGAnimatedValueList &getPatternTransform();\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'pattern' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- *\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'pattern' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'pattern' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
-\r
- //####################################################################\r
- //# SVGPolyLineElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGPolygonElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGRadialGradientElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute cx on the given 'radialGradient' element.\r
- */\r
- // SVGAnimatedValue getCx();\r
-\r
-\r
- /**\r
- * Corresponds to attribute cy on the given 'radialGradient' element.\r
- */\r
- // SVGAnimatedValue getCy();\r
-\r
-\r
- /**\r
- * Corresponds to attribute r on the given 'radialGradient' element.\r
- */\r
- // SVGAnimatedValue getR();\r
-\r
-\r
- /**\r
- * Corresponds to attribute fx on the given 'radialGradient' element.\r
- */\r
- SVGAnimatedValue getFx();\r
-\r
-\r
- /**\r
- * Corresponds to attribute fy on the given 'radialGradient' element.\r
- */\r
- SVGAnimatedValue getFy();\r
-\r
-\r
- //####################################################################\r
- //# SVGRectElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
-\r
- /**\r
- * Corresponds to attribute rx on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getRx();\r
-\r
- /**\r
- * Corresponds to attribute ry on the given 'rect' element.\r
- */\r
- // SVGAnimatedValue getRy();\r
-\r
-\r
- //####################################################################\r
- //# SVGScriptElement\r
- //####################################################################\r
-\r
- /**\r
- *\r
- */\r
- // DOMString getType();\r
-\r
- /**\r
- *\r
- */\r
- // void setType(const DOMString &val) throw(DOMException);\r
-\r
- //####################################################################\r
- //# SVGSetElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGStopElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute offset on the given 'stop' element.\r
- */\r
- // SVGAnimatedValue getOffset();\r
-\r
-\r
- //####################################################################\r
- //# SVGStyleElement\r
- //####################################################################\r
-\r
- /**\r
- * Get the attribute xml:space on the given element.\r
- */\r
- DOMString getXmlspace();\r
-\r
- /**\r
- * Set the attribute xml:space on the given element.\r
- */\r
- void setXmlspace(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute type on the given 'style' element.\r
- */\r
- // DOMString getType();\r
-\r
- /**\r
- * Set the attribute type on the given 'style' element.\r
- */\r
- // void setType(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute media on the given 'style' element.\r
- */\r
- DOMString getMedia();\r
-\r
- /**\r
- * Set the attribute media on the given 'style' element.\r
- */\r
- void setMedia(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * Get the attribute title on the given 'style' element.\r
- */\r
- DOMString getTitle();\r
-\r
- /**\r
- * Set the attribute title on the given 'style' element.\r
- */\r
- void setTitle(const DOMString &val) throw(DOMException);\r
-\r
- //####################################################################\r
- //# SVGSymbolElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGSVGElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'svg' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'svg' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'svg' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'svg' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
- /**\r
- * Get the attribute contentScriptType on the given 'svg' element.\r
- */\r
- DOMString getContentScriptType();\r
-\r
- /**\r
- * Set the attribute contentScriptType on the given 'svg' element.\r
- */\r
- void setContentScriptType(const DOMString &val) throw(DOMException);\r
-\r
-\r
- /**\r
- * Get the attribute contentStyleType on the given 'svg' element.\r
- */\r
- DOMString getContentStyleType();\r
-\r
- /**\r
- * Set the attribute contentStyleType on the given 'svg' element.\r
- */\r
- void setContentStyleType(const DOMString &val) throw(DOMException);\r
-\r
- /**\r
- * The position and size of the viewport(implicit or explicit) that corresponds\r
- * to this 'svg' element. When the user agent is actually rendering the content,\r
- * then the position and size values represent the actual values when rendering.\r
- * The position and size values are unitless values in the coordinate system of\r
- * the parent element. If no parent element exists(i.e., 'svg' element\r
- * represents the root of the document tree), if this SVG document is embedded as\r
- * part of another document(e.g., via the HTML 'object' element), then the\r
- * position and size are unitless values in the coordinate system of the parent\r
- * document.(If the parent uses CSS or XSL layout, then unitless values\r
- * represent pixel units for the current CSS or XSL viewport, as described in the\r
- * CSS2 specification.) If the parent element does not have a coordinate system,\r
- * then the user agent should provide reasonable default values for this attribute.\r
- * */\r
- SVGRect getViewport();\r
-\r
- /**\r
- * Size of a pixel units(as defined by CSS2) along the x-axis of the viewport,\r
- * which represents a unit somewhere in the range of 70dpi to 120dpi, and, on\r
- * systems that support this, might actually match the characteristics of the\r
- * target medium. On systems where it is impossible to know the size of a pixel,\r
- * a suitable default pixel size is provided.\r
- */\r
- double getPixelUnitToMillimeterX();\r
-\r
- /**\r
- * Corresponding size of a pixel unit along the y-axis of the viewport.\r
- */\r
- double getPixelUnitToMillimeterY();\r
-\r
- /**\r
- * User interface(UI) events in DOM Level 2 indicate the screen positions at\r
- * which the given UI event occurred. When the user agent actually knows the\r
- * physical size of a "screen unit", this attribute will express that information;\r
- * otherwise, user agents will provide a suitable default value such as .28mm.\r
- */\r
- double getScreenPixelToMillimeterX();\r
-\r
- /**\r
- * Corresponding size of a screen pixel along the y-axis of the viewport.\r
- */\r
- double getScreenPixelToMillimeterY();\r
-\r
-\r
- /**\r
- * The initial view(i.e., before magnification and panning) of the current\r
- * innermost SVG document fragment can be either the "standard" view(i.e., based\r
- * on attributes on the 'svg' element such as fitBoxToViewport) or to a "custom"\r
- * view(i.e., a hyperlink into a particular 'view' or other element - see\r
- * Linking into SVG content: URI fragments and SVG views). If the initial view is\r
- * the "standard" view, then this attribute is false. If the initial view is a\r
- * "custom" view, then this attribute is true.\r
- */\r
- bool getUseCurrentView();\r
-\r
- /**\r
- * Set the value above\r
- */\r
- void setUseCurrentView(bool val) throw(DOMException);\r
-\r
- /**\r
- * The definition of the initial view(i.e., before magnification and panning) of\r
- * the current innermost SVG document fragment. The meaning depends on the\r
- * situation:\r
- * \r
- * * If the initial view was a "standard" view, then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will match the values for the corresponding DOM attributes that\r
- * are on SVGSVGElement directly\r
- * o the values for transform and viewTarget within currentView will be null\r
- * * If the initial view was a link into a 'view' element, then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will correspond to the corresponding attributes for the given\r
- * 'view' element\r
- * o the values for transform and viewTarget within currentView will be null\r
- * * If the initial view was a link into another element(i.e., other than a\r
- * 'view'), then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will match the values for the corresponding DOM attributes that\r
- * are on SVGSVGElement directly for the closest ancestor 'svg' element\r
- * o the values for transform within currentView will be null\r
- * o the viewTarget within currentView will represent the target of the link\r
- * * If the initial view was a link into the SVG document fragment using an SVG\r
- * view specification fragment identifier(i.e., #svgView(...)), then:\r
- * o the values for viewBox, preserveAspectRatio, zoomAndPan, transform and\r
- * viewTarget within currentView will correspond to the values from the SVG view\r
- * specification fragment identifier\r
- * \r
- */\r
- SVGViewSpec getCurrentView();\r
-\r
-\r
- /**\r
- * This attribute indicates the current scale factor relative to the initial view\r
- * to take into account user magnification and panning operations, as described\r
- * under Magnification and panning. DOM attributes currentScale and\r
- * currentTranslate are equivalent to the 2x3 matrix [a b c d e f] =\r
- * [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If\r
- * "magnification" is enabled(i.e., zoomAndPan="magnify"), then the effect is as\r
- * if an extra transformation were placed at the outermost level on the SVG\r
- * document fragment(i.e., outside the outermost 'svg' element).\r
- */\r
- double getCurrentScale();\r
-\r
- /**\r
- * Set the value above.\r
- */\r
- void setCurrentScale(double val) throw(DOMException);\r
-\r
- /**\r
- * The corresponding translation factor that takes into account\r
- * user "magnification".\r
- */\r
- SVGPoint getCurrentTranslate();\r
-\r
- /**\r
- * Takes a time-out value which indicates that redraw shall not occur until:(a)\r
- * the corresponding unsuspendRedraw(suspend_handle_id) call has been made,(b)\r
- * an unsuspendRedrawAll() call has been made, or(c) its timer has timed out. In\r
- * environments that do not support interactivity(e.g., print media), then\r
- * redraw shall not be suspended. suspend_handle_id =\r
- * suspendRedraw(max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id)\r
- * must be packaged as balanced pairs. When you want to suspend redraw actions as\r
- * a collection of SVG DOM changes occur, then precede the changes to the SVG DOM\r
- * with a method call similar to suspend_handle_id =\r
- * suspendRedraw(max_wait_milliseconds) and follow the changes with a method call\r
- * similar to unsuspendRedraw(suspend_handle_id). Note that multiple\r
- * suspendRedraw calls can be used at once and that each such method call is\r
- * treated independently of the other suspendRedraw method calls.\r
- */\r
- unsigned long suspendRedraw(unsigned long max_wait_milliseconds);\r
-\r
- /**\r
- * Cancels a specified suspendRedraw() by providing a unique suspend_handle_id.\r
- */\r
- void unsuspendRedraw(unsigned long suspend_handle_id) throw(DOMException);\r
-\r
- /**\r
- * Cancels all currently active suspendRedraw() method calls. This method is most\r
- * useful at the very end of a set of SVG DOM calls to ensure that all pending\r
- * suspendRedraw() method calls have been cancelled.\r
- */\r
- void unsuspendRedrawAll();\r
-\r
- /**\r
- * In rendering environments supporting interactivity, forces the user agent to\r
- * immediately redraw all regions of the viewport that require updating.\r
- */\r
- void forceRedraw();\r
-\r
- /**\r
- * Suspends(i.e., pauses) all currently running animations that are defined\r
- * within the SVG document fragment corresponding to this 'svg' element, causing\r
- * the animation clock corresponding to this document fragment to stand still\r
- * until it is unpaused.\r
- */\r
- void pauseAnimations();\r
-\r
- /**\r
- * Unsuspends(i.e., unpauses) currently running animations that are defined\r
- * within the SVG document fragment, causing the animation clock to continue from\r
- * the time at which it was suspended.\r
- */\r
- void unpauseAnimations();\r
-\r
- /**\r
- * Returns true if this SVG document fragment is in a paused state.\r
- */\r
- bool animationsPaused();\r
-\r
- /**\r
- * Returns the current time in seconds relative to the start time for\r
- * the current SVG document fragment.\r
- */\r
- // double getCurrentTime();\r
-\r
- /**\r
- * Adjusts the clock for this SVG document fragment, establishing\r
- * a new current time.\r
- */\r
- void setCurrentTime(double seconds);\r
-\r
- /**\r
- * Returns the list of graphics elements whose rendered content intersects the\r
- * supplied rectangle, honoring the 'pointer-events' property value on each\r
- * candidate graphics element.\r
- */\r
- NodeList getIntersectionList(const SVGRect &rect,\r
- const SVGElementPtr referenceElement);\r
-\r
- /**\r
- * Returns the list of graphics elements whose rendered content is entirely\r
- * contained within the supplied rectangle, honoring the 'pointer-events'\r
- * property value on each candidate graphics element.\r
- */\r
- NodeList getEnclosureList(const SVGRect &rect,\r
- const SVGElementPtr referenceElement);\r
-\r
- /**\r
- * Returns true if the rendered content of the given element intersects the\r
- * supplied rectangle, honoring the 'pointer-events' property value on each\r
- * candidate graphics element.\r
- */\r
- bool checkIntersection(const SVGElementPtr element, const SVGRect &rect);\r
-\r
- /**\r
- * Returns true if the rendered content of the given element is entirely\r
- * contained within the supplied rectangle, honoring the 'pointer-events'\r
- * property value on each candidate graphics element.\r
- */\r
- bool checkEnclosure(const SVGElementPtr element, const SVGRect &rect);\r
-\r
- /**\r
- * Unselects any selected objects, including any selections of text\r
- * strings and type-in bars.\r
- */\r
- void deselectAll();\r
-\r
- /**\r
- * Creates an SVGNumber object outside of any document trees. The object\r
- * is initialized to a value of zero.\r
- */\r
- SVGNumber createSVGNumber();\r
-\r
- /**\r
- * Creates an SVGLength object outside of any document trees. The object\r
- * is initialized to the value of 0 user units.\r
- */\r
- SVGLength createSVGLength();\r
-\r
- /**\r
- * Creates an SVGAngle object outside of any document trees. The object\r
- * is initialized to the value 0 degrees(unitless).\r
- */\r
- SVGAngle createSVGAngle();\r
-\r
- /**\r
- * Creates an SVGPoint object outside of any document trees. The object\r
- * is initialized to the point(0,0) in the user coordinate system.\r
- */\r
- SVGPoint createSVGPoint();\r
-\r
- /**\r
- * Creates an SVGMatrix object outside of any document trees. The object\r
- * is initialized to the identity matrix.\r
- */\r
- SVGMatrix createSVGMatrix();\r
-\r
- /**\r
- * Creates an SVGRect object outside of any document trees. The object\r
- * is initialized such that all values are set to 0 user units.\r
- */\r
- SVGRect createSVGRect();\r
-\r
- /**\r
- * Creates an SVGTransform object outside of any document trees.\r
- * The object is initialized to an identity matrix transform\r
- * (SVG_TRANSFORM_MATRIX).\r
- */\r
- SVGTransform createSVGTransform();\r
-\r
- /**\r
- * Creates an SVGTransform object outside of any document trees.\r
- * The object is initialized to the given matrix transform\r
- * (i.e., SVG_TRANSFORM_MATRIX).\r
- */\r
- SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix);\r
-\r
- /**\r
- * Searches this SVG document fragment(i.e., the search is restricted to a\r
- * subset of the document tree) for an Element whose id is given by elementId. If\r
- * an Element is found, that Element is returned. If no such element exists,\r
- * returns null. Behavior is not defined if more than one element has this id.\r
- */\r
- ElementPtr getElementById(const DOMString& elementId);\r
-\r
-\r
- //####################################################################\r
- //# SVGTextElement\r
- //####################################################################\r
-\r
-\r
- //####################################################################\r
- //# SVGTextContentElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * lengthAdjust Types\r
- */\r
- typedef enum\r
- {\r
- LENGTHADJUST_UNKNOWN = 0,\r
- LENGTHADJUST_SPACING = 1,\r
- LENGTHADJUST_SPACINGANDGLYPHS = 2\r
- } LengthAdjustType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute textLength on the given element.\r
- */\r
- SVGAnimatedValue getTextLength();\r
-\r
-\r
- /**\r
- * Corresponds to attribute lengthAdjust on the given element. The value must be\r
- * one of the length adjust constants specified above.\r
- */\r
- SVGAnimatedValue getLengthAdjust();\r
-\r
-\r
- /**\r
- * Returns the total number of characters to be rendered within the current\r
- * element. Includes characters which are included via a 'tref' reference.\r
- */\r
- long getNumberOfChars();\r
-\r
- /**\r
- * The total sum of all of the advance values from rendering all of the\r
- * characters within this element, including the advance value on the glyphs\r
- *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'\r
- * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'\r
- * elements. For non-rendering environments, the user agent shall make reasonable\r
- * assumptions about glyph metrics.\r
- */\r
- double getComputedTextLength();\r
-\r
- /**\r
- * The total sum of all of the advance values from rendering the specified\r
- * substring of the characters, including the advance value on the glyphs\r
- *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'\r
- * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'\r
- * elements. For non-rendering environments, the user agent shall make reasonable\r
- * assumptions about glyph metrics.\r
- */\r
- double getSubStringLength(unsigned long charnum, unsigned long nchars)\r
- throw(DOMException);\r
-\r
- /**\r
- * Returns the current text position before rendering the character in the user\r
- * coordinate system for rendering the glyph(s) that correspond to the specified\r
- * character. The current text position has already taken into account the\r
- * effects of any inter-character adjustments due to properties 'kerning',\r
- * 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx\r
- * and dy. If multiple consecutive characters are rendered inseparably(e.g., as\r
- * a single glyph or a sequence of glyphs), then each of the inseparable\r
- * characters will return the start position for the first glyph.\r
- */\r
- SVGPoint getStartPositionOfChar(unsigned long charnum) throw(DOMException);\r
-\r
- /**\r
- * Returns the current text position after rendering the character in the user\r
- * coordinate system for rendering the glyph(s) that correspond to the specified\r
- * character. This current text position does not take into account the effects\r
- * of any inter-character adjustments to prepare for the next character, such as\r
- * properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due\r
- * to attributes x, y, dx and dy. If multiple consecutive characters are rendered\r
- * inseparably(e.g., as a single glyph or a sequence of glyphs), then each of\r
- * the inseparable characters will return the end position for the last glyph.\r
- */\r
- SVGPoint getEndPositionOfChar(unsigned long charnum) throw(DOMException);\r
-\r
- /**\r
- * Returns a tightest rectangle which defines the minimum and maximum X and Y\r
- * values in the user coordinate system for rendering the glyph(s) that\r
- * correspond to the specified character. The calculations assume that all glyphs\r
- * occupy the full standard glyph cell for the font. If multiple consecutive\r
- * characters are rendered inseparably(e.g., as a single glyph or a sequence of\r
- * glyphs), then each of the inseparable characters will return the same extent.\r
- */\r
- SVGRect getExtentOfChar(unsigned long charnum) throw(DOMException);\r
-\r
- /**\r
- * Returns the rotation value relative to the current user coordinate system used\r
- * to render the glyph(s) corresponding to the specified character. If multiple\r
- * glyph(s) are used to render the given character and the glyphs each have\r
- * different rotations(e.g., due to text-on-a-path), the user agent shall return\r
- * an average value(e.g., the rotation angle at the midpoint along the path for\r
- * all glyphs used to render this character). The rotation value represents the\r
- * rotation that is supplemental to any rotation due to properties\r
- * 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any\r
- * glyph rotations due to these properties are not included into the returned\r
- * rotation value. If multiple consecutive characters are rendered inseparably\r
- *(e.g., as a single glyph or a sequence of glyphs), then each of the\r
- * inseparable characters will return the same rotation value.\r
- */\r
- double getRotationOfChar(unsigned long charnum) throw(DOMException);\r
-\r
- /**\r
- * Returns the index of the character whose corresponding glyph cell bounding box\r
- * contains the specified point. The calculations assume that all glyphs occupy\r
- * the full standard glyph cell for the font. If no such character exists, a\r
- * value of -1 is returned. If multiple such characters exist, the character\r
- * within the element whose glyphs were rendered last(i.e., take into account\r
- * any reordering such as for bidirectional text) is used. If multiple\r
- * consecutive characters are rendered inseparably(e.g., as a single glyph or a\r
- * sequence of glyphs), then the user agent shall allocate an equal percentage of\r
- * the text advance amount to each of the contributing characters in determining\r
- * which of the characters is chosen.\r
- */\r
- long getCharNumAtPosition(const SVGPoint &point);\r
-\r
- /**\r
- * Causes the specified substring to be selected just as if the user\r
- * selected the substring interactively.\r
- */\r
- void selectSubString(unsigned long charnum, unsigned long nchars)\r
- throw(DOMException);\r
-\r
-\r
-\r
-\r
-\r
- //####################################################################\r
- //# SVGTextPathElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * textPath Method Types\r
- */\r
- typedef enum\r
- {\r
- TEXTPATH_METHODTYPE_UNKNOWN = 0,\r
- TEXTPATH_METHODTYPE_ALIGN = 1,\r
- TEXTPATH_METHODTYPE_STRETCH = 2\r
- } TextPathMethodType;\r
-\r
- /**\r
- * textPath Spacing Types\r
- */\r
- typedef enum\r
- {\r
- TEXTPATH_SPACINGTYPE_UNKNOWN = 0,\r
- TEXTPATH_SPACINGTYPE_AUTO = 1,\r
- TEXTPATH_SPACINGTYPE_EXACT = 2\r
- } TextPathSpacingType;\r
-\r
-\r
- /**\r
- * Corresponds to attribute startOffset on the given 'textPath' element.\r
- */\r
- SVGAnimatedValue getStartOffset();\r
-\r
- /**\r
- * Corresponds to attribute method on the given 'textPath' element. The value\r
- * must be one of the method type constants specified above.\r
- */\r
- SVGAnimatedValue getMethod();\r
-\r
- /**\r
- * Corresponds to attribute spacing on the given 'textPath' element.\r
- * The value must be one of the spacing type constants specified above.\r
- */\r
- SVGAnimatedValue getSpacing();\r
-\r
-\r
- //####################################################################\r
- //# SVGTextPositioningElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- * Corresponds to attribute x on the given element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute dx on the given element.\r
- */\r
- // SVGAnimatedValue getDx();\r
-\r
- /**\r
- * Corresponds to attribute dy on the given element.\r
- */\r
- // SVGAnimatedValue getDy();\r
-\r
-\r
- /**\r
- * Corresponds to attribute rotate on the given element.\r
- */\r
- SVGAnimatedValueList getRotate();\r
-\r
-\r
- //####################################################################\r
- //# SVGTitleElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGTRefElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGTSpanElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGSwitchElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGUseElement\r
- //####################################################################\r
-\r
- /**\r
- * Corresponds to attribute x on the given 'use' element.\r
- */\r
- // SVGAnimatedValue getX();\r
-\r
- /**\r
- * Corresponds to attribute y on the given 'use' element.\r
- */\r
- // SVGAnimatedValue getY();\r
-\r
- /**\r
- * Corresponds to attribute width on the given 'use' element.\r
- */\r
- // SVGAnimatedValue getWidth();\r
-\r
- /**\r
- * Corresponds to attribute height on the given 'use' element.\r
- */\r
- // SVGAnimatedValue getHeight();\r
-\r
- /**\r
- * The root of the "instance tree". See description of SVGElementInstance for\r
- * a discussion on the instance tree.\r
- * */\r
- SVGElementInstance getInstanceRoot();\r
-\r
- /**\r
- * If the 'href' attribute is being animated, contains the current animated root\r
- * of the "instance tree". If the 'href' attribute is not currently being\r
- * animated, contains the same value as 'instanceRoot'. The root of the "instance\r
- * tree". See description of SVGElementInstance for a discussion on the instance\r
- * tree.\r
- */\r
- SVGElementInstance getAnimatedInstanceRoot();\r
-\r
- //####################################################################\r
- //# SVGVKernElement\r
- //####################################################################\r
-\r
- //####################################################################\r
- //# SVGViewElement\r
- //####################################################################\r
-\r
-\r
- /**\r
- *\r
- */\r
- SVGValueList getViewTarget();\r
-\r
-\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
-\r
- /**\r
- *\r
- */\r
- ~SVGElement() {}\r
-\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGDocument\r
-#########################################################################*/\r
-\r
-/**\r
- * When an 'svg' element is embedded inline as a component of a document from\r
- * another namespace, such as when an 'svg' element is embedded inline within an\r
- * XHTML document [XHTML], then an SVGDocument object will not exist; instead,\r
- * the root object in the document object hierarchy will be a Document object of\r
- * a different type, such as an HTMLDocument object.\r
- *\r
- * However, an SVGDocument object will indeed exist when the root element of the\r
- * XML document hierarchy is an 'svg' element, such as when viewing a stand-alone\r
- * SVG file(i.e., a file with MIME type "image/svg+xml"). In this case, the\r
- * SVGDocument object will be the root object of the document object model\r
- * hierarchy.\r
- *\r
- * In the case where an SVG document is embedded by reference, such as when an\r
- * XHTML document has an 'object' element whose href attribute references an SVG\r
- * document(i.e., a document whose MIME type is "image/svg+xml" and whose root\r
- * element is thus an 'svg' element), there will exist two distinct DOM\r
- * hierarchies. The first DOM hierarchy will be for the referencing document\r
- *(e.g., an XHTML document). The second DOM hierarchy will be for the referenced\r
- * SVG document. In this second DOM hierarchy, the root object of the document\r
- * object model hierarchy is an SVGDocument object.\r
- */\r
-class SVGDocument : public Document,\r
- public events::DocumentEvent\r
-{\r
-public:\r
-\r
-\r
- /**\r
- * The title of a document as specified by the title sub-element of the 'svg'\r
- * root element(i.e., <svg><title>Here is the title</title>...</svg>)\r
- */\r
- DOMString getTitle();\r
-\r
- /**\r
- * Returns the URI of the page that linked to this page. The value is an empty\r
- * string if the user navigated to the page directly(not through a link, but,\r
- * for example, via a bookmark).\r
- */\r
- DOMString getReferrer();\r
-\r
- /**\r
- * The domain name of the server that served the document, or a null string if\r
- * the server cannot be identified by a domain name.\r
- */\r
- DOMString getDomain();\r
-\r
- /**\r
- * The complete URI of the document.\r
- */\r
- DOMString getURL();\r
-\r
- /**\r
- * The root 'svg' element in the document hierarchy.\r
- */\r
- SVGElementPtr getRootElement();\r
-\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- ~SVGDocument() {}\r
-\r
-};\r
-\r
-\r
-\r
-/*#########################################################################\r
-## GetSVGDocument\r
-#########################################################################*/\r
-\r
-/**\r
- * In the case where an SVG document is embedded by reference, such as when an\r
- * XHTML document has an 'object' element whose href(or equivalent) attribute\r
- * references an SVG document(i.e., a document whose MIME type is\r
- * "image/svg+xml" and whose root element is thus an 'svg' element), the SVG user\r
- * agent is required to implement the GetSVGDocument interface for the element\r
- * which references the SVG document(e.g., the HTML 'object' or comparable\r
- * referencing elements).\r
- */\r
-class GetSVGDocument\r
-{\r
-public:\r
-\r
- /**\r
- * Returns the SVGDocument object for the referenced SVG document.\r
- */\r
- SVGDocumentPtr getSVGDocument()\r
- throw(DOMException);\r
-\r
- //##################\r
- //# Non-API methods\r
- //##################\r
-\r
- /**\r
- *\r
- */\r
- ~GetSVGDocument() {}\r
-\r
-};\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-} //namespace svg\r
-} //namespace dom\r
-} //namespace w3c\r
-} //namespace org\r
-\r
-#endif // __SVG_H__\r
-/*#########################################################################\r
-## E N D O F F I L E\r
-#########################################################################*/\r
-\r
+#ifndef __SVG_H__
+#define __SVG_H__
+
+/**
+ * Phoebe DOM Implementation.
+ *
+ * This is a C++ approximation of the W3C DOM model, which follows
+ * fairly closely the specifications in the various .idl files, copies of
+ * which are provided for reference. Most important is this one:
+ *
+ * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
+ *
+ * Authors:
+ * Bob Jamison
+ *
+ * Copyright(C) 2005-2008 Bob Jamison
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or(at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * =======================================================================
+ * NOTES
+ *
+ * This API follows:
+ * http://www.w3.org/TR/SVG11/svgdom.html
+ *
+ * This file defines the main SVG-DOM Node types. Other non-Node types are
+ * defined in svgtypes.h.
+ *
+ */
+
+
+// For access to DOM2 core
+#include "dom/dom.h"
+
+// For access to DOM2 events
+#include "dom/events.h"
+
+// For access to those parts from DOM2 CSS OM used by SVG DOM.
+#include "dom/css.h"
+
+// For access to those parts from DOM2 Views OM used by SVG DOM.
+#include "dom/views.h"
+
+// For access to the SMIL OM used by SVG DOM.
+#include "dom/smil.h"
+
+
+#include <math.h>
+
+#define SVG_NAMESPACE "http://www.w3.org/2000/svg"
+
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace svg
+{
+
+
+//local definitions
+typedef dom::DOMString DOMString;
+typedef dom::DOMException DOMException;
+typedef dom::Element Element;
+typedef dom::ElementPtr ElementPtr;
+typedef dom::Document Document;
+typedef dom::DocumentPtr DocumentPtr;
+typedef dom::NodeList NodeList;
+
+
+
+
+class SVGElement;
+typedef Ptr<SVGElement> SVGElementPtr;
+class SVGUseElement;
+typedef Ptr<SVGUseElement> SVGUseElementPtr;
+class SVGDocument;
+typedef Ptr<SVGDocument> SVGDocumentPtr;
+
+/*#########################################################################
+## SVGException
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGException
+{
+public:
+
+ /**
+ * SVGExceptionCode
+ */
+ typedef enum
+ {
+ SVG_WRONG_TYPE_ERR = 0,
+ SVG_INVALID_VALUE_ERR = 1,
+ SVG_MATRIX_NOT_INVERTABLE = 2
+ } SVGExceptionCode;
+
+ unsigned short code;
+};
+
+
+
+
+
+
+
+//########################################################################
+//########################################################################
+//# V A L U E S
+//########################################################################
+//########################################################################
+
+
+
+
+
+/*#########################################################################
+## SVGAngle
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGAngle
+{
+public:
+
+ /**
+ * Angle Unit Types
+ */
+ typedef enum
+ {
+ SVG_ANGLETYPE_UNKNOWN = 0,
+ SVG_ANGLETYPE_UNSPECIFIED = 1,
+ SVG_ANGLETYPE_DEG = 2,
+ SVG_ANGLETYPE_RAD = 3,
+ SVG_ANGLETYPE_GRAD = 4
+ } AngleUnitType;
+
+ /**
+ *
+ */
+ unsigned short getUnitType();
+
+ /**
+ *
+ */
+ double getValue();
+
+ /**
+ *
+ */
+ void setValue(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getValueInSpecifiedUnits();
+
+ /**
+ *
+ */
+ void setValueInSpecifiedUnits(double /*val*/)
+ throw(DOMException);
+
+ /**
+ *
+ */
+ DOMString getValueAsString();
+
+ /**
+ *
+ */
+ void setValueAsString(const DOMString &/*val*/)
+ throw(DOMException);
+
+ /**
+ *
+ */
+ void newValueSpecifiedUnits(unsigned short /*unitType*/,
+ double /*valueInSpecifiedUnits*/);
+
+ /**
+ *
+ */
+ void convertToSpecifiedUnits(unsigned short /*unitType*/);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGAngle();
+
+ /**
+ *
+ */
+ SVGAngle(const SVGAngle &other);
+
+ /**
+ *
+ */
+ ~SVGAngle();
+
+protected:
+
+ int unitType;
+
+ double value;
+
+};
+
+
+/*#########################################################################
+## SVGLength
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGLength
+{
+public:
+
+ /**
+ * Length Unit Types
+ */
+ typedef enum
+ {
+ SVG_LENGTHTYPE_UNKNOWN = 0,
+ SVG_LENGTHTYPE_NUMBER = 1,
+ SVG_LENGTHTYPE_PERCENTAGE = 2,
+ SVG_LENGTHTYPE_EMS = 3,
+ SVG_LENGTHTYPE_EXS = 4,
+ SVG_LENGTHTYPE_PX = 5,
+ SVG_LENGTHTYPE_CM = 6,
+ SVG_LENGTHTYPE_MM = 7,
+ SVG_LENGTHTYPE_IN = 8,
+ SVG_LENGTHTYPE_PT = 9,
+ SVG_LENGTHTYPE_PC = 10
+ } LengthUnitType;
+
+ /**
+ *
+ */
+ unsigned short getUnitType();
+
+ /**
+ *
+ */
+ double getValue();
+
+ /**
+ *
+ */
+ void setValue(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getValueInSpecifiedUnits();
+
+ /**
+ *
+ */
+ void setValueInSpecifiedUnits(double /*val*/) throw(DOMException);
+
+ /**
+ *
+ */
+ DOMString getValueAsString();
+
+ /**
+ *
+ */
+ void setValueAsString(const DOMString& /*val*/) throw(DOMException);
+
+ /**
+ *
+ */
+ void newValueSpecifiedUnits(unsigned short /*unitType*/, double /*val*/);
+
+ /**
+ *
+ */
+ void convertToSpecifiedUnits(unsigned short /*unitType*/);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGLength();
+
+ /**
+ *
+ */
+ SVGLength(const SVGLength &other);
+
+ /**
+ *
+ */
+ ~SVGLength();
+
+protected:
+
+ int unitType;
+
+ double value;
+
+};
+
+/*#########################################################################
+## SVGMatrix
+#########################################################################*/
+
+/**
+ * In SVG, a Matrix is defined like this:
+ *
+ * | a c e |
+ * | b d f |
+ * | 0 0 1 |
+ *
+ */
+class SVGMatrix
+{
+public:
+
+
+ /**
+ *
+ */
+ double getA();
+
+ /**
+ *
+ */
+ void setA(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getB();
+
+ /**
+ *
+ */
+ void setB(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getC();
+
+ /**
+ *
+ */
+ void setC(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getD();
+
+ /**
+ *
+ */
+ void setD(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getE();
+
+ /**
+ *
+ */
+ void setE(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getF();
+
+ /**
+ *
+ */
+ void setF(double val) throw(DOMException);
+
+
+ /**
+ * Return the result of postmultiplying this matrix with another.
+ */
+ SVGMatrix multiply(const SVGMatrix &other);
+
+ /**
+ * Calculate the inverse of this matrix
+ *
+ *
+ * The determinant of a 3x3 matrix E
+ * (let's use our own notation for a bit)
+ *
+ * A B C
+ * D E F
+ * G H I
+ * is
+ * AEI - AFH - BDI + BFG + CDH - CEG
+ *
+ * Since in our affine transforms, G and H==0 and I==1,
+ * this reduces to:
+ * AE - BD
+ * In SVG's naming scheme, that is: a * d - c * b . SIMPLE!
+ *
+ * In a similar method of attack, SVG's adjunct matrix is:
+ *
+ * d -c cf-ed
+ * -b a eb-af
+ * 0 0 ad-cb
+ *
+ * To get the inverse matrix, we divide the adjunct matrix by
+ * the determinant. Notice that(ad-cb)/(ad-cb)==1. Very cool.
+ * So what we end up with is this:
+ *
+ * a = d/(ad-cb) c = -c/(ad-cb) e =(cf-ed)/(ad-cb)
+ * b = -b/(ad-cb) d = a/(ad-cb) f =(eb-af)/(ad-cb)
+ *
+ * (Since this would be in all SVG-DOM implementations,
+ * somebody needed to document this! ^^)
+ *
+ */
+ SVGMatrix inverse() throw(SVGException);
+
+ /**
+ * Equivalent to multiplying by:
+ * | 1 0 x |
+ * | 0 1 y |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix translate(double x, double y);
+
+ /**
+ * Equivalent to multiplying by:
+ * | scale 0 0 |
+ * | 0 scale 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix scale(double scale);
+
+ /**
+ * Equivalent to multiplying by:
+ * | scaleX 0 0 |
+ * | 0 scaleY 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix scaleNonUniform(double scaleX, double scaleY);
+
+ /**
+ * Equivalent to multiplying by:
+ * | cos(a) -sin(a) 0 |
+ * | sin(a) cos(a) 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix rotate(double angle);
+
+ /**
+ * Equivalent to multiplying by:
+ * | cos(a) -sin(a) 0 |
+ * | sin(a) cos(a) 0 |
+ * | 0 0 1 |
+ * In this case, angle 'a' is computed as the artangent
+ * of the slope y/x . It is negative if the slope is negative.
+ */
+ SVGMatrix rotateFromVector(double x, double y) throw(SVGException);
+
+ /**
+ * Equivalent to multiplying by:
+ * | -1 0 0 |
+ * | 0 1 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix flipX();
+
+ /**
+ * Equivalent to multiplying by:
+ * | 1 0 0 |
+ * | 0 -1 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix flipY();
+
+ /**
+ * | 1 tan(a) 0 |
+ * | 0 1 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix skewX(double angle);
+
+ /**
+ * Equivalent to multiplying by:
+ * | 1 0 0 |
+ * | tan(a) 1 0 |
+ * | 0 0 1 |
+ *
+ */
+ SVGMatrix skewY(double angle);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGMatrix();
+
+ /**
+ *
+ */
+ SVGMatrix(double aArg, double bArg, double cArg,
+ double dArg, double eArg, double fArg);
+
+ /**
+ * Copy constructor
+ */
+ SVGMatrix(const SVGMatrix &other);
+
+ /**
+ *
+ */
+ ~SVGMatrix() {}
+
+protected:
+
+friend class SVGTransform;
+
+ /*
+ * Set to the identify matrix
+ */
+ void identity();
+
+ double a, b, c, d, e, f;
+
+};
+
+
+/*#########################################################################
+## SVGNumber
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGNumber
+{
+public:
+
+ /**
+ *
+ */
+ double getValue();
+
+ /**
+ *
+ */
+ void setValue(double val) throw(DOMException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGNumber();
+
+ /**
+ *
+ */
+ SVGNumber(const SVGNumber &other);
+
+ /**
+ *
+ */
+ ~SVGNumber();
+
+protected:
+
+ double value;
+
+};
+
+/*#########################################################################
+## SVGPoint
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGPoint
+{
+public:
+
+ /**
+ *
+ */
+ double getX();
+
+ /**
+ *
+ */
+ void setX(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getY();
+
+ /**
+ *
+ */
+ void setY(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ SVGPoint matrixTransform(const SVGMatrix &/*matrix*/);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGPoint();
+
+ /**
+ *
+ */
+ SVGPoint(const SVGPoint &other);
+
+ /**
+ *
+ */
+ ~SVGPoint();
+
+protected:
+
+ double x, y;
+};
+
+
+/*#########################################################################
+## SVGPathSeg
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGPathSeg
+{
+public:
+
+ /**
+ * Path Segment Types
+ */
+ typedef enum
+ {
+ PATHSEG_UNKNOWN = 0,
+ PATHSEG_CLOSEPATH = 1,
+ PATHSEG_MOVETO_ABS = 2,
+ PATHSEG_MOVETO_REL = 3,
+ PATHSEG_LINETO_ABS = 4,
+ PATHSEG_LINETO_REL = 5,
+ PATHSEG_CURVETO_CUBIC_ABS = 6,
+ PATHSEG_CURVETO_CUBIC_REL = 7,
+ PATHSEG_CURVETO_QUADRATIC_ABS = 8,
+ PATHSEG_CURVETO_QUADRATIC_REL = 9,
+ PATHSEG_ARC_ABS = 10,
+ PATHSEG_ARC_REL = 11,
+ PATHSEG_LINETO_HORIZONTAL_ABS = 12,
+ PATHSEG_LINETO_HORIZONTAL_REL = 13,
+ PATHSEG_LINETO_VERTICAL_ABS = 14,
+ PATHSEG_LINETO_VERTICAL_REL = 15,
+ PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16,
+ PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17,
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19
+ } PathSegmentType;
+
+ /**
+ *
+ */
+ unsigned short getPathSegType();
+
+ /**
+ *
+ */
+ DOMString getPathSegTypeAsLetter();
+
+ /**
+ * From the various subclasses
+ */
+
+ /**
+ *
+ */
+ double getX();
+
+ /**
+ *
+ */
+ void setX(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getX1();
+
+ /**
+ *
+ */
+ void setX1(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getX2();
+
+ /**
+ *
+ */
+ void setX2(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getY();
+
+ /**
+ *
+ */
+ void setY(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getY1();
+
+ /**
+ *
+ */
+ void setY1(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getY2();
+
+ /**
+ *
+ */
+ void setY2(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getR1();
+
+ /**
+ *
+ */
+ void setR1(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getR2();
+
+ /**
+ *
+ */
+ void setR2(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getAngle();
+
+ /**
+ *
+ */
+ void setAngle(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ bool getLargeArcFlag();
+
+ /**
+ *
+ */
+ void setLargeArcFlag(bool val) throw(DOMException);
+
+ /**
+ *
+ */
+ bool getSweepFlag();
+
+ /**
+ *
+ */
+ void setSweepFlag(bool val) throw(DOMException);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGPathSeg();
+
+ /**
+ *
+ */
+ SVGPathSeg(int typeArg);
+
+ /**
+ *
+ */
+ SVGPathSeg(const SVGPathSeg &other);
+
+ /**
+ *
+ */
+ SVGPathSeg &operator=(const SVGPathSeg &other);
+
+ /**
+ *
+ */
+ ~SVGPathSeg();
+
+protected:
+
+ void init();
+
+ void assign(const SVGPathSeg &other);
+
+ int type;
+ double x, y, x1, y1, x2, y2;
+ double r1, r2;
+ double angle;
+ bool largeArcFlag;
+ bool sweepFlag;
+};
+
+
+/*#########################################################################
+## SVGPreserveAspectRatio
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGPreserveAspectRatio
+{
+public:
+
+
+ /**
+ * Alignment Types
+ */
+ typedef enum
+ {
+ SVG_PRESERVEASPECTRATIO_UNKNOWN = 0,
+ SVG_PRESERVEASPECTRATIO_NONE = 1,
+ SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,
+ SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,
+ SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,
+ SVG_PRESERVEASPECTRATIO_XMINYMID = 5,
+ SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,
+ SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,
+ SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,
+ SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,
+ SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
+ } AlignmentType;
+
+
+ /**
+ * Meet-or-slice Types
+ */
+ typedef enum
+ {
+ SVG_MEETORSLICE_UNKNOWN = 0,
+ SVG_MEETORSLICE_MEET = 1,
+ SVG_MEETORSLICE_SLICE = 2
+ } MeetOrSliceType;
+
+
+ /**
+ *
+ */
+ unsigned short getAlign();
+
+ /**
+ *
+ */
+ void setAlign(unsigned short val) throw(DOMException);
+
+ /**
+ *
+ */
+ unsigned short getMeetOrSlice();
+
+ /**
+ *
+ */
+ void setMeetOrSlice(unsigned short val) throw(DOMException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGPreserveAspectRatio();
+
+ /**
+ *
+ */
+ SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other);
+
+ /**
+ *
+ */
+ ~SVGPreserveAspectRatio();
+
+protected:
+
+ unsigned short align;
+ unsigned short meetOrSlice;
+
+};
+
+
+
+/*#########################################################################
+## SVGRect
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGRect
+{
+public:
+
+ /**
+ *
+ */
+ double getX();
+
+ /**
+ *
+ */
+ void setX(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getY();
+
+ /**
+ *
+ */
+ void setY(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getWidth();
+
+ /**
+ *
+ */
+ void setWidth(double val) throw(DOMException);
+
+ /**
+ *
+ */
+ double getHeight();
+
+ /**
+ *
+ */
+ void setHeight(double val) throw(DOMException);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGRect();
+
+ /**
+ *
+ */
+ SVGRect(const SVGRect &other);
+
+ /**
+ *
+ */
+ ~SVGRect();
+
+protected:
+
+ double x, y, width, height;
+
+};
+
+/*#########################################################################
+## SVGTransform
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGTransform
+{
+public:
+
+ /**
+ * Transform Types
+ */
+ typedef enum
+ {
+ SVG_TRANSFORM_UNKNOWN = 0,
+ SVG_TRANSFORM_MATRIX = 1,
+ SVG_TRANSFORM_TRANSLATE = 2,
+ SVG_TRANSFORM_SCALE = 3,
+ SVG_TRANSFORM_ROTATE = 4,
+ SVG_TRANSFORM_SKEWX = 5,
+ SVG_TRANSFORM_SKEWY = 6,
+ } TransformType;
+
+ /**
+ *
+ */
+ unsigned short getType();
+
+
+ /**
+ *
+ */
+ SVGMatrix getMatrix();
+
+ /**
+ *
+ */
+ double getAngle();
+
+ /**
+ *
+ */
+ void setMatrix(const SVGMatrix &matrixArg);
+
+ /**
+ *
+ */
+ void setTranslate(double tx, double ty);
+
+ /**
+ *
+ */
+ void setScale(double sx, double sy);
+
+ /**
+ *
+ */
+ void setRotate(double angleArg, double cx, double cy);
+
+ /**
+ *
+ */
+ void setSkewX(double angleArg);
+
+ /**
+ *
+ */
+ void setSkewY(double angleArg);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGTransform();
+
+ /**
+ *
+ */
+ SVGTransform(const SVGTransform &other);
+
+ /**
+ *
+ */
+ ~SVGTransform();
+
+protected:
+
+ int type;
+ double angle;
+
+ SVGMatrix matrix;
+};
+
+
+
+
+/*#########################################################################
+## SVGUnitTypes
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGUnitTypes
+{
+public:
+
+ /**
+ * Unit Types
+ */
+ typedef enum
+ {
+ SVG_UNIT_TYPE_UNKNOWN = 0,
+ SVG_UNIT_TYPE_USERSPACEONUSE = 1,
+ SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2
+ } UnitType;
+
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGUnitTypes();
+
+ /**
+ *
+ */
+ ~SVGUnitTypes();
+
+};
+
+
+
+
+/*#########################################################################
+## SVGValue
+#########################################################################*/
+
+/**
+ * This is a helper class that will hold several types of data. It will
+ * be used in those situations where methods are common to different
+ * interfaces, except for the data type. This class holds the following:
+ * SVGAngle
+ * SVGBoolean
+ * SVGEnumeration
+ * SVGInteger
+ * SVGLength
+ * SVGNumber
+ * SVGPreserveAspectRatio
+ * SVGRect
+ * SVGString
+ */
+class SVGValue
+{
+public:
+
+ /**
+ *
+ */
+ typedef enum
+ {
+ SVG_ANGLE,
+ SVG_BOOLEAN,
+ SVG_ENUMERATION,
+ SVG_INTEGER,
+ SVG_LENGTH,
+ SVG_NUMBER,
+ SVG_PRESERVE_ASPECT_RATIO,
+ SVG_RECT,
+ SVG_STRING,
+ } SVGValueType;
+
+ /**
+ * Constructor
+ */
+ SVGValue();
+
+ /**
+ * Copy constructor
+ */
+ SVGValue(const SVGValue &other);
+
+ /**
+ * Assignment
+ */
+ SVGValue &operator=(const SVGValue &other);
+
+ /**
+ *
+ */
+ ~SVGValue();
+
+ //###########################
+ // TYPES
+ //###########################
+
+ /**
+ * Angle
+ */
+ SVGValue(const SVGAngle &v);
+
+ SVGAngle angleValue();
+
+ /**
+ * Boolean
+ */
+ SVGValue(bool v);
+
+ bool booleanValue();
+
+
+ /**
+ * Enumeration
+ */
+ SVGValue(short v);
+
+ short enumerationValue();
+
+ /**
+ * Integer
+ */
+ SVGValue(long v);
+
+ long integerValue();
+
+ /**
+ * Length
+ */
+ SVGValue(const SVGLength &v);
+
+ SVGLength lengthValue();
+
+ /**
+ * Number
+ */
+ SVGValue(double v);
+
+ double numberValue();
+
+ /**
+ * PathSegment
+ */
+ SVGValue(const SVGPathSeg &v);
+
+ SVGPathSeg pathDataValue();
+
+
+ /**
+ * Points
+ */
+ SVGValue(const SVGPoint &v);
+
+ SVGPoint pointValue();
+
+
+ /**
+ * PreserveAspectRatio
+ */
+ SVGValue(const SVGPreserveAspectRatio &v);
+
+ SVGPreserveAspectRatio preserveAspectRatioValue();
+
+ /**
+ * Rect
+ */
+ SVGValue(const SVGRect &v);
+
+ SVGRect rectValue();
+
+ /**
+ * String
+ */
+ SVGValue(const DOMString &v);
+
+ DOMString stringValue();
+
+ /**
+ * TransformList
+ */
+ SVGValue(const SVGTransform &v);
+
+ SVGTransform transformValue();
+
+
+private:
+
+ void init();
+
+ void assign(const SVGValue &other);
+
+ short type;
+ SVGAngle angleval; // SVGAngle
+ bool bval; // SVGBoolean
+ short eval; // SVGEnumeration
+ long ival; // SVGInteger
+ SVGLength lengthval; // SVGLength
+ double dval; // SVGNumber
+ SVGPathSeg segval; // SVGPathSeg
+ SVGPoint pointval; // SVGPoint
+ SVGPreserveAspectRatio parval; // SVGPreserveAspectRatio
+ SVGRect rval; // SVGRect
+ DOMString sval; // SVGString
+ SVGTransform transformval; // SVGTransform
+
+};
+
+
+/*#########################################################################
+## SVGValueList
+#########################################################################*/
+
+/**
+ * THis is used to generify a bit the several different types of lists:
+ *
+ * SVGLengthList -> SVGValueList<SVGLength>
+ * SVGValueList -> SVGValueList<SVGNumber>
+ * SVGPathData -> SVGValueList<SVGPathSeg>
+ * SVGPoints -> SVGValueList<SVGPoint>
+ * SVGTransformList -> SVGValueList<SVGTransform>
+ */
+class SVGValueList
+{
+public:
+
+ /**
+ *
+ */
+ typedef enum
+ {
+ SVG_LIST_LENGTH,
+ SVG_LIST_NUMBER,
+ SVG_LIST_PATHSEG,
+ SVG_LIST_POINT,
+ SVG_LIST_TRANSFORM
+ } SVGValueListTypes;
+
+ /**
+ *
+ */
+ unsigned long getNumberOfItems();
+
+
+ /**
+ *
+ */
+ void clear() throw(DOMException);
+
+ /**
+ *
+ */
+ SVGValue getItem(unsigned long index) throw(DOMException);
+
+ /**
+ *
+ */
+ SVGValue insertItemBefore(const SVGValue &newItem,
+ unsigned long index)
+ throw(DOMException, SVGException);
+
+ /**
+ *
+ */
+ SVGValue replaceItem(const SVGValue &newItem,
+ unsigned long index)
+ throw(DOMException, SVGException);
+
+ /**
+ *
+ */
+ SVGValue removeItem(unsigned long index) throw(DOMException);
+
+ /**
+ *
+ */
+ SVGValue appendItem(const SVGValue &newItem)
+ throw(DOMException, SVGException);
+
+ /**
+ * Matrix
+ */
+ SVGValue initialize(const SVGValue &newItem)
+ throw(DOMException, SVGException);
+
+ /**
+ * Matrix
+ */
+ SVGValue createSVGTransformFromMatrix(const SVGValue &matrix);
+
+ /**
+ * Matrix
+ */
+ SVGValue consolidate();
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGValueList();
+
+ /**
+ *
+ */
+ SVGValueList(const SVGValueList &other);
+
+ /**
+ *
+ */
+ ~SVGValueList();
+
+protected:
+
+ std::vector<SVGValue> items;
+
+};
+
+
+
+
+
+/*#########################################################################
+## SVGAnimatedValue
+#########################################################################*/
+
+/**
+ * This class is used to merge all of the "Animated" values, with only
+ * a different type, into a single API. This class subsumes the following:
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ * SVGAnimatedPathData
+ * SVGAnimatedPoints
+ * SVGAnimatedPreserveAspectRatio
+ * SVGAnimatedValue
+ * SVGAnimatedValue
+ */
+class SVGAnimatedValue
+{
+public:
+
+ /**
+ *
+ */
+ SVGValue &getBaseVal();
+
+ /**
+ *
+ */
+ void setBaseVal(const SVGValue &val) throw (DOMException);
+
+ /**
+ *
+ */
+ SVGValue &getAnimVal();
+
+ /**
+ *
+ */
+ SVGAnimatedValue();
+
+ /**
+ *
+ */
+ SVGAnimatedValue(const SVGValue &baseValue);
+
+ /**
+ *
+ */
+ SVGAnimatedValue(const SVGValue &baseValue, const SVGValue &animValue);
+
+ /**
+ *
+ */
+ SVGAnimatedValue(const SVGAnimatedValue &other);
+
+ /**
+ *
+ */
+ SVGAnimatedValue &operator=(const SVGAnimatedValue &other);
+
+ /**
+ *
+ */
+ SVGAnimatedValue &operator=(const SVGValue &baseVal);
+
+ /**
+ *
+ */
+ ~SVGAnimatedValue();
+
+private:
+
+ void init();
+
+ void assign(const SVGAnimatedValue &other);
+
+ SVGValue baseVal;
+
+ SVGValue animVal;
+
+};
+
+
+/*#########################################################################
+## SVGAnimatedValueList
+#########################################################################*/
+
+/**
+ * This class is used to merge all of the "Animated" values, with only
+ * a different type, into a single API. This class subsumes the following:
+ * SVGAnimatedValueList
+ * SVGAnimatedValueList
+ * SVGAnimatedTransformList
+ */
+class SVGAnimatedValueList
+{
+public:
+
+ /**
+ *
+ */
+ SVGValueList &getBaseVal();
+
+ /**
+ *
+ */
+ void setBaseVal(const SVGValueList &val) throw (DOMException);
+
+ /**
+ *
+ */
+ SVGValueList &getAnimVal();
+
+ /**
+ *
+ */
+ SVGAnimatedValueList();
+
+ /**
+ *
+ */
+ SVGAnimatedValueList(const SVGValueList &baseValue);
+
+ /**
+ *
+ */
+ SVGAnimatedValueList(const SVGValueList &baseValue, const SVGValueList &animValue);
+
+ /**
+ *
+ */
+ SVGAnimatedValueList(const SVGAnimatedValueList &other);
+
+ /**
+ *
+ */
+ SVGAnimatedValueList &operator=(const SVGAnimatedValueList &other);
+
+ /**
+ *
+ */
+ SVGAnimatedValueList &operator=(const SVGValueList &baseVal);
+
+ /**
+ *
+ */
+ ~SVGAnimatedValueList();
+
+private:
+
+ void init();
+
+ void assign(const SVGAnimatedValueList &other);
+
+ SVGValueList baseVal;
+
+ SVGValueList animVal;
+
+};
+
+
+
+/*#########################################################################
+## SVGICCColor
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGICCColor
+{
+public:
+
+ /**
+ *
+ */
+ DOMString getColorProfile();
+
+ /**
+ *
+ */
+ void setColorProfile(const DOMString &val) throw(DOMException);
+
+ /**
+ *
+ */
+ SVGValueList &getColors();
+
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGICCColor();
+
+ /**
+ *
+ */
+ SVGICCColor(const SVGICCColor &other);
+
+ /**
+ *
+ */
+ ~SVGICCColor();
+
+protected:
+
+ DOMString colorProfile;
+
+ SVGValueList colors;
+
+};
+
+
+
+/*#########################################################################
+## SVGColor
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGColor : public css::CSSValue
+{
+public:
+
+
+ /**
+ * Color Types
+ */
+ typedef enum
+ {
+ SVG_COLORTYPE_UNKNOWN = 0,
+ SVG_COLORTYPE_RGBCOLOR = 1,
+ SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2,
+ SVG_COLORTYPE_CURRENTCOLOR = 3
+ } ColorType;
+
+
+ /**
+ *
+ */
+ unsigned short getColorType();
+
+ /**
+ *
+ */
+ css::RGBColor getRgbColor();
+
+ /**
+ *
+ */
+ SVGICCColor getIccColor();
+
+
+ /**
+ *
+ */
+ void setRGBColor(const DOMString& /*rgbColor*/)
+ throw(SVGException);
+
+ /**
+ *
+ */
+ void setRGBColorICCColor(const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw(SVGException);
+
+ /**
+ *
+ */
+ void setColor(unsigned short /*colorType*/,
+ const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw(SVGException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGColor();
+
+ /**
+ *
+ */
+ SVGColor(const SVGColor &other);
+
+ /**
+ *
+ */
+ ~SVGColor();
+
+protected:
+
+ int colorType;
+
+};
+
+
+
+/*#########################################################################
+## SVGPaint
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGPaint : public SVGColor
+{
+public:
+
+ /**
+ * Paint Types
+ */
+ typedef enum
+ {
+ SVG_PAINTTYPE_UNKNOWN = 0,
+ SVG_PAINTTYPE_RGBCOLOR = 1,
+ SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2,
+ SVG_PAINTTYPE_NONE = 101,
+ SVG_PAINTTYPE_CURRENTCOLOR = 102,
+ SVG_PAINTTYPE_URI_NONE = 103,
+ SVG_PAINTTYPE_URI_CURRENTCOLOR = 104,
+ SVG_PAINTTYPE_URI_RGBCOLOR = 105,
+ SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106,
+ SVG_PAINTTYPE_URI = 107
+ } PaintType;
+
+
+ /**
+ *
+ */
+ unsigned short getPaintType();
+
+ /**
+ *
+ */
+ DOMString getUri();
+
+ /**
+ *
+ */
+ void setUri(const DOMString& uriArg);
+
+ /**
+ *
+ */
+ void setPaint(unsigned short paintTypeArg,
+ const DOMString& uriArg,
+ const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw(SVGException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGPaint();
+
+ /**
+ *
+ */
+ SVGPaint(const SVGPaint &other);
+
+ /**
+ *
+ */
+ ~SVGPaint();
+
+protected:
+
+ unsigned int paintType;
+ DOMString uri;
+
+};
+
+
+
+
+//########################################################################
+//########################################################################
+//# I N T E R F A C E S
+//########################################################################
+//########################################################################
+
+
+
+
+
+
+
+/*#########################################################################
+## SVGStylable
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGStylable
+{
+public:
+
+ /**
+ *
+ */
+ SVGAnimatedValue getClassName();
+
+ /**
+ *
+ */
+ css::CSSStyleDeclaration getStyle();
+
+
+ /**
+ *
+ */
+ css::CSSValue getPresentationAttribute(const DOMString& /*name*/);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGStylable();
+
+ /**
+ *
+ */
+ SVGStylable(const SVGStylable &other);
+
+ /**
+ *
+ */
+ ~SVGStylable();
+
+protected:
+
+ SVGAnimatedValue className;
+ css::CSSStyleDeclaration style;
+
+};
+
+
+
+
+
+/*#########################################################################
+## SVGLocatable
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGLocatable
+{
+public:
+
+ /**
+ *
+ */
+ SVGElementPtr getNearestViewportElement();
+
+ /**
+ *
+ */
+ SVGElementPtr getFarthestViewportElement();
+
+ /**
+ *
+ */
+ SVGRect getBBox();
+
+ /**
+ *
+ */
+ SVGMatrix getCTM();
+
+ /**
+ *
+ */
+ SVGMatrix getScreenCTM();
+
+ /**
+ *
+ */
+ SVGMatrix getTransformToElement(const SVGElement &/*element*/)
+ throw(SVGException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGLocatable();
+
+ /**
+ *
+ */
+ SVGLocatable(const SVGLocatable &/*other*/);
+
+ /**
+ *
+ */
+ ~SVGLocatable();
+
+protected:
+
+ SVGRect bbox;
+ SVGMatrix ctm;
+ SVGMatrix screenCtm;
+
+};
+
+
+/*#########################################################################
+## SVGTransformable
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGTransformable : public SVGLocatable
+{
+public:
+
+
+ /**
+ *
+ */
+ SVGAnimatedValueList &getTransform();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGTransformable();
+
+ /**
+ *
+ */
+ SVGTransformable(const SVGTransformable &other);
+
+ /**
+ *
+ */
+ ~SVGTransformable();
+
+protected:
+
+ SVGAnimatedValueList transforms;
+};
+
+
+
+/*#########################################################################
+## SVGTests
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGTests
+{
+public:
+
+ /**
+ *
+ */
+ SVGValueList &getRequiredFeatures();
+
+ /**
+ *
+ */
+ SVGValueList &getRequiredExtensions();
+
+ /**
+ *
+ */
+ SVGValueList &getSystemLanguage();
+
+ /**
+ *
+ */
+ bool hasExtension(const DOMString& /*extension*/);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGTests();
+
+ /**
+ *
+ */
+ SVGTests(const SVGTests &other);
+
+ /**
+ *
+ */
+ ~SVGTests();
+
+protected:
+
+ SVGValueList requiredFeatures;
+ SVGValueList requiredExtensions;
+ SVGValueList systemLanguage;
+
+};
+
+
+
+
+
+
+/*#########################################################################
+## SVGLangSpace
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGLangSpace
+{
+public:
+
+
+ /**
+ *
+ */
+ DOMString getXmlLang();
+
+ /**
+ *
+ */
+ void setXmlLang(const DOMString &val) throw(DOMException);
+
+ /**
+ *
+ */
+ DOMString getXmlSpace();
+
+ /**
+ *
+ */
+ void setXmlSpace(const DOMString &val) throw(DOMException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGLangSpace();
+
+ /**
+ *
+ */
+ SVGLangSpace(const SVGLangSpace &other);
+
+ /**
+ *
+ */
+ ~SVGLangSpace();
+
+protected:
+
+ DOMString xmlLang;
+ DOMString xmlSpace;
+
+};
+
+
+
+/*#########################################################################
+## SVGExternalResourcesRequired
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGExternalResourcesRequired
+{
+public:
+
+ /**
+ * boolean
+ */
+ SVGAnimatedValue getExternalResourcesRequired();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGExternalResourcesRequired();
+
+ /**
+ *
+ */
+ SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other);
+
+ /**
+ *
+ */
+ ~SVGExternalResourcesRequired();
+
+protected:
+
+ SVGAnimatedValue required; //boolean
+
+};
+
+
+
+
+
+
+
+
+
+/*#########################################################################
+## SVGFitToViewBox
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGFitToViewBox
+{
+public:
+
+ /**
+ * rect
+ */
+ SVGAnimatedValue getViewBox();
+
+ /**
+ * preserveAspectRatio
+ */
+ SVGAnimatedValue getPreserveAspectRatio();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGFitToViewBox();
+
+ /**
+ *
+ */
+ SVGFitToViewBox(const SVGFitToViewBox &other);
+
+ /**
+ *
+ */
+ ~SVGFitToViewBox();
+
+protected:
+
+ SVGAnimatedValue viewBox; //rect
+ SVGAnimatedValue preserveAspectRatio;
+
+};
+
+
+/*#########################################################################
+## SVGZoomAndPan
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGZoomAndPan
+{
+public:
+
+ /**
+ * Zoom and Pan Types
+ */
+ typedef enum
+ {
+ SVG_ZOOMANDPAN_UNKNOWN = 0,
+ SVG_ZOOMANDPAN_DISABLE = 1,
+ SVG_ZOOMANDPAN_MAGNIFY = 2
+ } ZoomAndPanType;
+
+ /**
+ *
+ */
+ unsigned short getZoomAndPan();
+
+ /**
+ *
+ */
+ void setZoomAndPan(unsigned short val) throw(DOMException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGZoomAndPan();
+
+ /**
+ *
+ */
+ SVGZoomAndPan(const SVGZoomAndPan &other);
+
+ /**
+ *
+ */
+ ~SVGZoomAndPan();
+
+protected:
+
+ unsigned short zoomAndPan;
+
+};
+
+
+
+
+
+
+/*#########################################################################
+## SVGViewSpec
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGViewSpec : public SVGZoomAndPan,
+ public SVGFitToViewBox
+{
+public:
+
+ /**
+ *
+ */
+ SVGValueList getTransform();
+
+ /**
+ *
+ */
+ SVGElementPtr getViewTarget();
+
+ /**
+ *
+ */
+ DOMString getViewBoxString();
+
+ /**
+ *
+ */
+ DOMString getPreserveAspectRatioString();
+
+ /**
+ *
+ */
+ DOMString getTransformString();
+
+ /**
+ *
+ */
+ DOMString getViewTargetString();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGViewSpec();
+
+ /**
+ *
+ */
+ SVGViewSpec(const SVGViewSpec &other);
+
+ /**
+ *
+ */
+ ~SVGViewSpec();
+
+protected:
+
+ SVGElementPtr viewTarget;
+ SVGValueList transform;
+};
+
+
+/*#########################################################################
+## SVGURIReference
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGURIReference
+{
+public:
+
+ /**
+ * string
+ */
+ SVGAnimatedValue getHref();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGURIReference();
+
+ /**
+ *
+ */
+ SVGURIReference(const SVGURIReference &other);
+
+ /**
+ *
+ */
+ ~SVGURIReference();
+
+protected:
+
+ SVGAnimatedValue href;
+
+};
+
+
+
+
+
+
+/*#########################################################################
+## SVGCSSRule
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGCSSRule : public css::CSSRule
+{
+public:
+
+
+ /**
+ * Additional CSS RuleType to support ICC color specifications
+ */
+ typedef enum
+ {
+ COLOR_PROFILE_RULE = 7
+ } ColorProfileRuleType;
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGCSSRule();
+
+ /**
+ *
+ */
+ SVGCSSRule(const SVGCSSRule &other);
+
+ /**
+ *
+ */
+ ~SVGCSSRule();
+
+};
+
+
+
+/*#########################################################################
+## SVGRenderingIntent
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGRenderingIntent
+{
+public:
+
+ /**
+ * Rendering Intent Types
+ */
+ typedef enum
+ {
+ RENDERING_INTENT_UNKNOWN = 0,
+ RENDERING_INTENT_AUTO = 1,
+ RENDERING_INTENT_PERCEPTUAL = 2,
+ RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
+ RENDERING_INTENT_SATURATION = 4,
+ RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
+ } RenderingIntentType;
+
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGRenderingIntent();
+
+ /**
+ *
+ */
+ SVGRenderingIntent(const SVGRenderingIntent &other);
+
+ /**
+ *
+ */
+ ~SVGRenderingIntent();
+
+protected:
+
+ unsigned short renderingIntentType;
+};
+
+
+
+
+
+
+
+
+
+/*#########################################################################
+## SVGColorProfileRule
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGColorProfileRule : public SVGCSSRule,
+ public SVGRenderingIntent
+{
+
+public:
+
+ /**
+ *
+ */
+ DOMString getSrc();
+
+ /**
+ *
+ */
+ void setSrc(const DOMString &val) throw(DOMException);
+
+ /**
+ *
+ */
+ DOMString getName();
+
+ /**
+ *
+ */
+ void setName(const DOMString &val) throw(DOMException);
+
+ /**
+ *
+ */
+ unsigned short getRenderingIntent();
+
+ /**
+ *
+ */
+ void setRenderingIntent(unsigned short val) throw(DOMException);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGColorProfileRule();
+
+ /**
+ *
+ */
+ SVGColorProfileRule(const SVGColorProfileRule &other);
+
+ /**
+ *
+ */
+ ~SVGColorProfileRule();
+
+protected:
+
+ unsigned short renderingIntent;
+ DOMString src;
+ DOMString name;
+
+};
+
+
+
+/*#########################################################################
+## SVGFilterPrimitiveStandardAttributes
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGFilterPrimitiveStandardAttributes : public SVGStylable
+{
+public:
+
+ /**
+ * length
+ */
+ SVGAnimatedValue getX();
+
+ /**
+ * length
+ */
+ SVGAnimatedValue getY();
+
+ /**
+ * length
+ */
+ SVGAnimatedValue getWidth();
+
+ /**
+ * length
+ */
+ SVGAnimatedValue getHeight();
+
+ /**
+ * string
+ */
+ SVGAnimatedValue getResult();
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGFilterPrimitiveStandardAttributes();
+
+ /**
+ *
+ */
+ SVGFilterPrimitiveStandardAttributes(
+ const SVGFilterPrimitiveStandardAttributes &other);
+
+ /**
+ *
+ */
+ ~SVGFilterPrimitiveStandardAttributes();
+
+protected:
+
+ SVGAnimatedValue x;
+ SVGAnimatedValue y;
+ SVGAnimatedValue width;
+ SVGAnimatedValue height;
+ SVGAnimatedValue result;
+
+};
+
+
+/*#########################################################################
+## SVGEvent
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGEvent : events::Event
+{
+public:
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGEvent();
+
+ /**
+ *
+ */
+ SVGEvent(const SVGEvent &other);
+
+ /**
+ *
+ */
+ ~SVGEvent();
+
+};
+
+
+
+
+/*#########################################################################
+## SVGZoomEvent
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGZoomEvent : events::UIEvent
+{
+public:
+
+ /**
+ *
+ */
+ SVGRect getZoomRectScreen();
+
+ /**
+ *
+ */
+ double getPreviousScale();
+
+ /**
+ *
+ */
+ SVGPoint getPreviousTranslate();
+
+ /**
+ *
+ */
+ double getNewScale();
+
+ /**
+ *
+ */
+ SVGPoint getNewTranslate();
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGZoomEvent();
+
+ /**
+ *
+ */
+ SVGZoomEvent(const SVGZoomEvent &other);
+
+ /**
+ *
+ */
+ ~SVGZoomEvent();
+
+protected:
+
+ SVGRect zoomRectScreen;
+ double previousScale;
+ SVGPoint previousTranslate;
+ double newScale;
+ SVGPoint newTranslate;
+
+};
+
+
+
+/*#########################################################################
+## SVGElementInstance
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGElementInstance : public events::EventTarget
+{
+public:
+
+ /**
+ *
+ */
+ SVGElementPtr getCorrespondingElement();
+
+ /**
+ *
+ */
+ SVGUseElementPtr getCorrespondingUseElement();
+
+ /**
+ *
+ */
+ SVGElementInstance getParentNode();
+
+ /**
+ * Since we are using stack types and this is a circular definition,
+ * we will instead implement this as a global function below:
+ * SVGElementInstanceList getChildNodes(const SVGElementInstance instance);
+ */
+ //SVGElementInstanceList getChildNodes();
+
+ /**
+ *
+ */
+ SVGElementInstance getFirstChild();
+
+ /**
+ *
+ */
+ SVGElementInstance getLastChild();
+
+ /**
+ *
+ */
+ SVGElementInstance getPreviousSibling();
+
+ /**
+ *
+ */
+ SVGElementInstance getNextSibling();
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGElementInstance();
+
+ /**
+ *
+ */
+ SVGElementInstance(const SVGElementInstance &other);
+
+ /**
+ *
+ */
+ ~SVGElementInstance();
+
+protected:
+
+ SVGElementPtr correspondingElement;
+ SVGUseElementPtr correspondingUseElement;
+
+};
+
+
+
+
+
+
+/*#########################################################################
+## SVGElementInstanceList
+#########################################################################*/
+
+/**
+ *
+ */
+class SVGElementInstanceList
+{
+public:
+
+ /**
+ *
+ */
+ unsigned long getLength();
+
+ /**
+ *
+ */
+ SVGElementInstance item(unsigned long index);
+
+ /**
+ * This static method replaces the circular definition of:
+ * SVGElementInstanceList SVGElementInstance::getChildNodes()
+ *
+ */
+ static SVGElementInstanceList getChildNodes(const SVGElementInstance &/*instance*/);
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ SVGElementInstanceList();
+
+ /**
+ *
+ */
+ SVGElementInstanceList(const SVGElementInstanceList &other);
+
+ /**
+ *
+ */
+ ~SVGElementInstanceList();
+
+protected:
+
+ std::vector<SVGElementInstance> items;
+
+
+};
+
+
+
+
+
+
+
+
+//########################################################################
+//########################################################################
+//########################################################################
+//# D O M
+//########################################################################
+//########################################################################
+//########################################################################
+
+
+
+
+
+/*#########################################################################
+## Types
+#########################################################################*/
+
+/**
+ * Bitmasks for has_an interface for SVGElement
+ */
+#define SVG_ANGLE 0x00000001
+#define SVG_ANIMATED_ANGLE 0x00000002
+#define SVG_ANIMATED_BOOLEAN 0x00000004
+#define SVG_ANIMATED_ENUMERATION 0x00000008
+#define SVG_ANIMATED_INTEGER 0x00000010
+#define SVG_ANIMATED_LENGTH 0x00000020
+#define SVG_ANIMATED_LENGTH_LIST 0x00000040
+#define SVG_ANIMATED_NUMBER 0x00000080
+#define SVG_ANIMATED_NUMBER_LIST 0x00000100
+#define SVG_ANIMATED_RECT 0x00000200
+#define SVG_ANIMATED_STRING 0x00000400
+#define SVG_COLOR 0x00000800
+#define SVG_CSS_RULE 0x00001000
+#define SVG_EXTERNAL_RESOURCES_REQUIRED 0x00002000
+#define SVG_FIT_TO_VIEWBOX 0x00004000
+#define SVG_ICCCOLOR 0x00008000
+#define SVG_LANG_SPACE 0x00010000
+#define SVG_LENGTH 0x00020000
+#define SVG_LENGTH_LIST 0x00040000
+#define SVG_LOCATABLE 0x00080000
+#define SVG_NUMBER 0x00100000
+#define SVG_NUMBER_LIST 0x00200000
+#define SVG_RECT 0x00400000
+#define SVG_RENDERING_INTENT 0x00800000
+#define SVG_STRING_LIST 0x01000000
+#define SVG_STYLABLE 0x02000000
+#define SVG_TESTS 0x04000000
+#define SVG_TRANSFORMABLE 0x08000000
+#define SVG_UNIT_TYPES 0x10000000
+#define SVG_URI_REFERENCE 0x20000000
+#define SVG_VIEW_SPEC 0x40000000
+#define SVG_ZOOM_AND_PAN 0x80000000
+
+/**
+ * How many above? Quite handy
+ */
+#define SVG_NR_INTERFACES 32
+
+
+/**
+ * Enumerations for SVGElement types
+ */
+typedef enum
+{
+ SVG_A_ELEMENT = 0,
+ SVG_ALTGLYPH_ELEMENT,
+ SVG_ALTGLYPHDEF_ELEMENT,
+ SVG_ALTGLYPHITEM_ELEMENT,
+ SVG_ANIMATE_ELEMENT,
+ SVG_ANIMATECOLOR_ELEMENT,
+ SVG_ANIMATEMOTION_ELEMENT,
+ SVG_ANIMATETRANSFORM_ELEMENT,
+ SVG_CIRCLE_ELEMENT,
+ SVG_CLIPPATH_ELEMENT,
+ SVG_COLOR_PROFILE_ELEMENT,
+ SVG_CURSOR_ELEMENT,
+ SVG_DEFINITION_SRC_ELEMENT,
+ SVG_DEFS_ELEMENT,
+ SVG_DESC_ELEMENT,
+ SVG_ELLIPSE_ELEMENT,
+ SVG_FEBLEND_ELEMENT,
+ SVG_FECOLORMATRIX_ELEMENT,
+ SVG_FECOMPONENTTRANSFER_ELEMENT,
+ SVG_FECOMPOSITE_ELEMENT,
+ SVG_FECONVOLVEMATRIX_ELEMENT,
+ SVG_FEDIFFUSELIGHTING_ELEMENT,
+ SVG_FEDISPLACEMENTMAP_ELEMENT,
+ SVG_FEDISTANTLIGHT_ELEMENT,
+ SVG_FEFLOOD_ELEMENT,
+ SVG_FEFUNCA_ELEMENT,
+ SVG_FEFUNCB_ELEMENT,
+ SVG_FEFUNCG_ELEMENT,
+ SVG_FEFUNCR_ELEMENT,
+ SVG_FEGAUSSIANBLUR_ELEMENT,
+ SVG_FEIMAGE_ELEMENT,
+ SVG_FEMERGE_ELEMENT,
+ SVG_FEMERGENODE_ELEMENT,
+ SVG_FEMORPHOLOGY_ELEMENT,
+ SVG_FEOFFSET_ELEMENT,
+ SVG_FEPOINTLIGHT_ELEMENT,
+ SVG_FESPECULARLIGHTING_ELEMENT,
+ SVG_FESPOTLIGHT_ELEMENT,
+ SVG_FETILE_ELEMENT,
+ SVG_FETURBULENCE_ELEMENT,
+ SVG_FILTER_ELEMENT,
+ SVG_FONT_ELEMENT,
+ SVG_FONT_FACE_ELEMENT,
+ SVG_FONT_FACE_FORMAT_ELEMENT,
+ SVG_FONT_FACE_NAME_ELEMENT,
+ SVG_FONT_FACE_SRC_ELEMENT,
+ SVG_FONT_FACE_URI_ELEMENT,
+ SVG_FOREIGNOBJECT_ELEMENT,
+ SVG_G_ELEMENT,
+ SVG_GLYPH_ELEMENT,
+ SVG_GLYPHREF_ELEMENT,
+ SVG_HKERN_ELEMENT,
+ SVG_IMAGE_ELEMENT,
+ SVG_LINE_ELEMENT,
+ SVG_LINEARGRADIENT_ELEMENT,
+ SVG_MARKER_ELEMENT,
+ SVG_MASK_ELEMENT,
+ SVG_METADATA_ELEMENT,
+ SVG_MISSING_GLYPH_ELEMENT,
+ SVG_MPATH_ELEMENT,
+ SVG_PATH_ELEMENT,
+ SVG_PATTERN_ELEMENT,
+ SVG_POLYGON_ELEMENT,
+ SVG_POLYLINE_ELEMENT,
+ SVG_RADIALGRADIENT_ELEMENT,
+ SVG_RECT_ELEMENT,
+ SVG_SCRIPT_ELEMENT,
+ SVG_SET_ELEMENT,
+ SVG_STOP_ELEMENT,
+ SVG_STYLE_ELEMENT,
+ SVG_SVG_ELEMENT,
+ SVG_SWITCH_ELEMENT,
+ SVG_SYMBOL_ELEMENT,
+ SVG_TEXT_ELEMENT,
+ SVG_TEXTPATH_ELEMENT,
+ SVG_TITLE_ELEMENT,
+ SVG_TREF_ELEMENT,
+ SVG_TSPAN_ELEMENT,
+ SVG_USE_ELEMENT,
+ SVG_VIEW_ELEMENT,
+ SVG_VKERN_ELEMENT,
+ SVG_MAX_ELEMENT
+} SVGElementType;
+
+
+
+
+/**
+ * Look up the SVG Element type enum for a given string
+ * Return -1 if not found
+ */
+int svgElementStrToEnum(const char *str);
+
+
+/**
+ * Return the string corresponding to a given SVG element type enum
+ * Return "unknown" if not found
+ */
+const char *svgElementEnumToStr(int type);
+
+
+
+
+/*#########################################################################
+## SVGElement
+#########################################################################*/
+
+/**
+ * All of the SVG DOM interfaces that correspond directly to elements in the SVG
+ * language(e.g., the SVGPathElement interface corresponds directly to the
+ * 'path' element in the language) are derivative from base class SVGElement.
+ */
+class SVGElement : public Element
+{
+public:
+
+ //####################################################################
+ //# BASE METHODS FOR SVGElement
+ //####################################################################
+
+ /**
+ * Get the value of the id attribute on the given element.
+ */
+ DOMString getId();
+
+ /**
+ * Set the value of the id attribute on the given element.
+ */
+ void setId(const DOMString &val) throw(DOMException);
+
+ /**
+ * Corresponds to attribute xml:base on the given element.
+ */
+ DOMString getXmlBase();
+
+ /**
+ * Corresponds to attribute xml:base on the given element.
+ */
+ void setXmlBase(const DOMString &val) throw(DOMException);
+
+ /**
+ * The nearest ancestor 'svg' element. Null if the given element is the
+ * outermost 'svg' element.
+ */
+ SVGElementPtr getOwnerSVGElement();
+
+ /**
+ * The element which established the current viewport. Often, the nearest
+ * ancestor 'svg' element. Null if the given element is the outermost 'svg'
+ * element.
+ */
+ SVGElementPtr getViewportElement();
+
+
+
+ //####################################################################
+ //####################################################################
+ //# E L E M E N T S
+ //####################################################################
+ //####################################################################
+
+ //####################################################################
+ //# SVGAElement
+ //####################################################################
+
+
+ /**
+ *
+ */
+ SVGAnimatedValue getTarget();
+
+
+
+ //####################################################################
+ //# SVGAltGlyphElement
+ //####################################################################
+
+
+ /**
+ * Get the attribute glyphRef on the given element.
+ */
+ DOMString getGlyphRef();
+
+ /**
+ * Set the attribute glyphRef on the given element.
+ */
+ void setGlyphRef(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute format on the given element.
+ */
+ DOMString getFormat();
+
+ /**
+ * Set the attribute format on the given element.
+ */
+ void setFormat(const DOMString &val) throw(DOMException);
+
+
+ //####################################################################
+ //# SVGAltGlyphDefElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGAltGlyphItemElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGAnimateElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGAnimateColorElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGAnimateMotionElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGAnimateTransformElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGAnimationElement
+ //####################################################################
+
+
+ /**
+ *
+ */
+ SVGElementPtr getTargetElement();
+
+ /**
+ *
+ */
+ double getStartTime();
+
+ /**
+ *
+ */
+ double getCurrentTime();
+
+ /**
+ *
+ */
+ double getSimpleDuration() throw(DOMException);
+
+
+
+ //####################################################################
+ //# SVGCircleElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute cx on the given 'circle' element.
+ */
+ SVGAnimatedValue getCx();
+
+ /**
+ * Corresponds to attribute cy on the given 'circle' element.
+ */
+ SVGAnimatedValue getCy();
+
+ /**
+ * Corresponds to attribute r on the given 'circle' element.
+ */
+ SVGAnimatedValue getR();
+
+ //####################################################################
+ //# SVGClipPathElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute clipPathUnits on the given 'clipPath' element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getClipPathUnits();
+
+
+
+ //####################################################################
+ //# SVGColorProfileElement
+ //####################################################################
+
+
+ /**
+ * Get the attribute local on the given element.
+ */
+ DOMString getLocal();
+
+ /**
+ * Set the attribute local on the given element.
+ */
+ void setLocal(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute name on the given element.
+ */
+ DOMString getName();
+
+ /**
+ * Set the attribute name on the given element.
+ */
+ void setName(const DOMString &val) throw(DOMException);
+
+ /**
+ * Set the attribute rendering-intent on the given element.
+ * The type of rendering intent, identified by one of the
+ * SVGRenderingIntent constants.
+ */
+ unsigned short getRenderingIntent();
+
+ /**
+ * Get the attribute rendering-intent on the given element.
+ */
+ void setRenderingIntent(unsigned short val) throw(DOMException);
+
+
+ //####################################################################
+ //# SVGComponentTransferFunctionElement
+ //####################################################################
+
+
+ /**
+ * Component Transfer Types
+ */
+ typedef enum
+ {
+ SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,
+ SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
+ SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2,
+ SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
+ SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4,
+ SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5
+ } ComponentTransferType;
+
+
+ /**
+ * Corresponds to attribute type on the given element. Takes one\
+ * of the Component Transfer Types.
+ * -- also in SVGCSSRule
+ */
+ // SVGAnimatedValue getType();
+
+ /**
+ * Corresponds to attribute tableValues on the given element.
+ */
+ SVGAnimatedValueList getTableValues();
+
+ /**
+ * Corresponds to attribute slope on the given element.
+ */
+ SVGAnimatedValue getSlope();
+
+ /**
+ * Corresponds to attribute intercept on the given element.
+ */
+ SVGAnimatedValue getIntercept();
+
+ /**
+ * Corresponds to attribute amplitude on the given element.
+ */
+ SVGAnimatedValue getAmplitude();
+
+ /**
+ * Corresponds to attribute exponent on the given element.
+ */
+ SVGAnimatedValue getExponent();
+
+ /**
+ * Corresponds to attribute offset on the given element.
+ */
+ SVGAnimatedValue getOffset();
+
+ //####################################################################
+ //# SVGCursorElement
+ //####################################################################
+
+ /**
+ * -- also in SVGRect
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * -- also in SVGRect
+ */
+ // SVGAnimatedValue getY();
+
+
+ //####################################################################
+ //# SVGDefinitionSrcElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGDefsElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGDescElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGEllipseElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute cx on the given 'ellipse' element.
+ * -- also in Circle
+ */
+ // SVGAnimatedValue getCx();
+
+ /**
+ * Corresponds to attribute cy on the given 'ellipse' element.
+ * -- also in Circle
+ */
+ // SVGAnimatedValue getCy();
+
+ /**
+ * Corresponds to attribute rx on the given 'ellipse' element.
+ */
+ SVGAnimatedValue getRx();
+
+ /**
+ * Corresponds to attribute ry on the given 'ellipse' element.
+ */
+ SVGAnimatedValue getRy();
+
+
+ //####################################################################
+ //# SVGFEBlendElement
+ //####################################################################
+
+ /**
+ * Blend Mode Types
+ */
+ typedef enum
+ {
+ SVG_FEBLEND_MODE_UNKNOWN = 0,
+ SVG_FEBLEND_MODE_NORMAL = 1,
+ SVG_FEBLEND_MODE_MULTIPLY = 2,
+ SVG_FEBLEND_MODE_SCREEN = 3,
+ SVG_FEBLEND_MODE_DARKEN = 4,
+ SVG_FEBLEND_MODE_LIGHTEN = 5
+ } BlendModeType;
+
+ /**
+ * Corresponds to attribute in on the given 'feBlend' element.
+ */
+ SVGAnimatedValue getIn1();
+
+ /**
+ * Corresponds to attribute in2 on the given 'feBlend' element.
+ */
+ SVGAnimatedValue getIn2();
+
+ /**
+ * Corresponds to attribute mode on the given 'feBlend' element.
+ * Takes one of the Blend Mode Types.
+ */
+ SVGAnimatedValue getMode();
+
+
+ //####################################################################
+ //# SVGFEColorMatrixElement
+ //####################################################################
+
+ /**
+ * Color Matrix Types
+ */
+ typedef enum
+ {
+ SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0,
+ SVG_FECOLORMATRIX_TYPE_MATRIX = 1,
+ SVG_FECOLORMATRIX_TYPE_SATURATE = 2,
+ SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3,
+ SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
+ } ColorMatrixType;
+
+
+ /**
+ * Corresponds to attribute in on the given 'feColorMatrix' element.
+ * - also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ * Corresponds to attribute type on the given 'feColorMatrix' element.
+ * Takes one of the Color Matrix Types.
+ * -- also in CSSRule
+ */
+ // SVGAnimatedValue getType();
+
+ /**
+ * Corresponds to attribute values on the given 'feColorMatrix' element.
+ * Provides access to the contents of the values attribute.
+ */
+ SVGAnimatedValueList getValues();
+
+
+ //####################################################################
+ //# SVGFEComponentTransferElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute in on the given 'feComponentTransfer' element.
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ //####################################################################
+ //# SVGFECompositeElement
+ //####################################################################
+
+ /**
+ * Composite Operators
+ */
+ typedef enum
+ {
+ SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0,
+ SVG_FECOMPOSITE_OPERATOR_OVER = 1,
+ SVG_FECOMPOSITE_OPERATOR_IN = 2,
+ SVG_FECOMPOSITE_OPERATOR_OUT = 3,
+ SVG_FECOMPOSITE_OPERATOR_ATOP = 4,
+ SVG_FECOMPOSITE_OPERATOR_XOR = 5,
+ SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6
+ } CompositeOperatorType;
+
+ /**
+ * Corresponds to attribute in on the given 'feComposite' element.
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ * Corresponds to attribute in2 on the given 'feComposite' element.
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn2();
+
+ /**
+ * Corresponds to attribute operator on the given 'feComposite' element.
+ * Takes one of the Composite Operators.
+ */
+ SVGAnimatedValue getOperator();
+
+ /**
+ * Corresponds to attribute k1 on the given 'feComposite' element.
+ */
+ SVGAnimatedValue getK1();
+
+ /**
+ * Corresponds to attribute k2 on the given 'feComposite' element.
+ */
+ SVGAnimatedValue getK2();
+
+ /**
+ * Corresponds to attribute k3 on the given 'feComposite' element.
+ */
+ SVGAnimatedValue getK3();
+
+ /**
+ * Corresponds to attribute k4 on the given 'feComposite' element.
+ */
+ SVGAnimatedValue getK4();
+
+
+ //####################################################################
+ //# SVGFEConvolveMatrixElement
+ //####################################################################
+
+
+ /**
+ * Edge Mode Values
+ */
+ typedef enum
+ {
+ SVG_EDGEMODE_UNKNOWN = 0,
+ SVG_EDGEMODE_DUPLICATE = 1,
+ SVG_EDGEMODE_WRAP = 2,
+ SVG_EDGEMODE_NONE = 3
+ } EdgeModeType;
+
+
+ /**
+ * Corresponds to attribute order on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getOrderX();
+
+ /**
+ * Corresponds to attribute order on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getOrderY();
+
+ /**
+ * Corresponds to attribute kernelMatrix on the given element.
+ */
+ SVGAnimatedValueList getKernelMatrix();
+
+ /**
+ * Corresponds to attribute divisor on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getDivisor();
+
+ /**
+ * Corresponds to attribute bias on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getBias();
+
+ /**
+ * Corresponds to attribute targetX on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getTargetX();
+
+ /**
+ * Corresponds to attribute targetY on the given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getTargetY();
+
+ /**
+ * Corresponds to attribute edgeMode on the given 'feConvolveMatrix'
+ * element. Takes one of the Edge Mode Types.
+ */
+ SVGAnimatedValue getEdgeMode();
+
+ /**
+ * Corresponds to attribute kernelUnitLength on the
+ * given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getKernelUnitLengthX();
+
+ /**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getKernelUnitLengthY();
+
+ /**
+ * Corresponds to attribute preserveAlpha on the
+ * given 'feConvolveMatrix' element.
+ */
+ SVGAnimatedValue getPreserveAlpha();
+
+
+
+ //####################################################################
+ //# SVGFEDiffuseLightingElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute in on the given 'feDiffuseLighting' element.
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ * Corresponds to attribute surfaceScale on the given
+ * 'feDiffuseLighting' element.
+ */
+ SVGAnimatedValue getSurfaceScale();
+
+ /**
+ * Corresponds to attribute diffuseConstant on the given
+ * 'feDiffuseLighting' element.
+ */
+ SVGAnimatedValue getDiffuseConstant();
+
+ /**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feDiffuseLighting' element.
+ */
+ // SVGAnimatedValue getKernelUnitLengthX();
+
+ /**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feDiffuseLighting' element.
+ */
+ // SVGAnimatedValue getKernelUnitLengthY();
+
+
+
+
+ //####################################################################
+ //# SVGFEDisplacementMapElement
+ //####################################################################
+
+
+ /**
+ * Channel Selectors
+ */
+ typedef enum
+ {
+ SVG_CHANNEL_UNKNOWN = 0,
+ SVG_CHANNEL_R = 1,
+ SVG_CHANNEL_G = 2,
+ SVG_CHANNEL_B = 3,
+ SVG_CHANNEL_A = 4
+ } ChannelSelector;
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn2();
+
+
+ /**
+ *
+ */
+ SVGAnimatedValue getScale();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getXChannelSelector();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getYChannelSelector();
+
+ //####################################################################
+ //# SVGFEDistantLightElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute azimuth on the given 'feDistantLight' element.
+ */
+ SVGAnimatedValue getAzimuth();
+
+
+ /**
+ * Corresponds to attribute elevation on the given 'feDistantLight'
+ * element
+ */
+ SVGAnimatedValue getElevation();
+
+
+ //####################################################################
+ //# SVGFEFloodElement
+ //####################################################################
+
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+
+ //####################################################################
+ //# SVGFEFuncAElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFEFuncBElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFEFuncGElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFEFuncRElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGFEGaussianBlurElement
+ //####################################################################
+
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+
+ /**
+ *
+ */
+ SVGAnimatedValue getStdDeviationX();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getStdDeviationY();
+
+
+ /**
+ *
+ */
+ void setStdDeviation(double stdDeviationX, double stdDeviationY);
+
+
+ //####################################################################
+ //# SVGFEImageElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGFEMergeElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFEMergeNodeElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFEMorphologyElement
+ //####################################################################
+
+
+
+ /**
+ * Morphology Operators
+ */
+ typedef enum
+ {
+ SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0,
+ SVG_MORPHOLOGY_OPERATOR_ERODE = 1,
+ SVG_MORPHOLOGY_OPERATOR_DILATE = 2
+ } MorphologyOperatorType;
+
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getOperator();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getRadiusX();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getRadiusY();
+
+ //####################################################################
+ //# SVGFEOffsetElement
+ //####################################################################
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getDx();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getDy();
+
+
+ //####################################################################
+ //# SVGFEPointLightElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'fePointLight' element.
+ */
+ SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'fePointLight' element.
+ */
+ SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute z on the given 'fePointLight' element.
+ */
+ SVGAnimatedValue getZ();
+
+ //####################################################################
+ //# SVGFESpecularLightingElement
+ //####################################################################
+
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getSurfaceScale();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getSpecularConstant();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getSpecularExponent();
+
+
+ //####################################################################
+ //# SVGFESpotLightElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'feSpotLight' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'feSpotLight' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute z on the given 'feSpotLight' element.
+ */
+ // SVGAnimatedValue getZ();
+
+ /**
+ * Corresponds to attribute pointsAtX on the given 'feSpotLight' element.
+ */
+ SVGAnimatedValue getPointsAtX();
+
+ /**
+ * Corresponds to attribute pointsAtY on the given 'feSpotLight' element.
+ */
+ SVGAnimatedValue getPointsAtY();
+
+ /**
+ * Corresponds to attribute pointsAtZ on the given 'feSpotLight' element.
+ */
+ SVGAnimatedValue getPointsAtZ();
+
+ /**
+ * Corresponds to attribute specularExponent on the
+ * given 'feSpotLight' element.
+ */
+ // SVGAnimatedValue getSpecularExponent();
+
+ /**
+ * Corresponds to attribute limitingConeAngle on the
+ * given 'feSpotLight' element.
+ */
+ SVGAnimatedValue getLimitingConeAngle();
+
+
+ //####################################################################
+ //# SVGFETileElement
+ //####################################################################
+
+
+ /**
+ *
+ * -- also in feBlend
+ */
+ // SVGAnimatedValue getIn1();
+
+
+ //####################################################################
+ //# SVGFETurbulenceElement
+ //####################################################################
+
+
+ /**
+ * Turbulence Types
+ */
+ typedef enum
+ {
+ SVG_TURBULENCE_TYPE_UNKNOWN = 0,
+ SVG_TURBULENCE_TYPE_FRACTALNOISE = 1,
+ SVG_TURBULENCE_TYPE_TURBULENCE = 2
+ } TurbulenceType;
+
+ /**
+ * Stitch Options
+ */
+ typedef enum
+ {
+ SVG_STITCHTYPE_UNKNOWN = 0,
+ SVG_STITCHTYPE_STITCH = 1,
+ SVG_STITCHTYPE_NOSTITCH = 2
+ } StitchOption;
+
+
+
+ /**
+ *
+ */
+ SVGAnimatedValue getBaseFrequencyX();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getBaseFrequencyY();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getNumOctaves();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getSeed();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getStitchTiles();
+
+ /**
+ *
+ */
+ SVGAnimatedValue getType();
+
+
+
+ //####################################################################
+ //# SVGFilterElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute filterUnits on the given 'filter' element. Takes one
+ * of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getFilterUnits();
+
+ /**
+ * Corresponds to attribute primitiveUnits on the given 'filter' element. Takes
+ * one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getPrimitiveUnits();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute x on the given 'filter' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute y on the given 'filter' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'filter' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+
+ /**
+ * Corresponds to attribute filterRes on the given 'filter' element.
+ * Contains the X component of attribute filterRes.
+ */
+ SVGAnimatedValue getFilterResX();
+
+ /**
+ * Corresponds to attribute filterRes on the given 'filter' element.
+ * Contains the Y component(possibly computed automatically)
+ * of attribute filterRes.
+ */
+ SVGAnimatedValue getFilterResY();
+
+ /**
+ * Sets the values for attribute filterRes.
+ */
+ void setFilterRes(unsigned long filterResX, unsigned long filterResY);
+
+
+ //####################################################################
+ //# SVGFontElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFontFaceElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFontFaceFormatElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFontFaceNameElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFontFaceSrcElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGFontFaceUriElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGForeignObjectElement
+ //####################################################################
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getHeight();
+
+
+
+ //####################################################################
+ //# SVGGlyphRefElement
+ //####################################################################
+
+
+ /**
+ * Get the attribute glyphRef on the given element.
+ */
+ // DOMString getGlyphRef();
+
+ /**
+ * Set the attribute glyphRef on the given element.
+ */
+ // void setGlyphRef(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute format on the given element.
+ */
+ // DOMString getFormat();
+
+ /**
+ * Set the attribute format on the given element.
+ */
+ // void setFormat(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute x on the given element.
+ */
+ // double getX();
+
+ /**
+ * Set the attribute x on the given element.
+ */
+ // void setX(double val) throw(DOMException);
+
+ /**
+ * Get the attribute y on the given element.
+ */
+ // double getY();
+
+ /**
+ * Set the attribute y on the given element.
+ */
+ // void setY(double val) throw(DOMException);
+
+ /**
+ * Get the attribute dx on the given element.
+ */
+ // double getDx();
+
+ /**
+ * Set the attribute dx on the given element.
+ */
+ // void setDx(double val) throw(DOMException);
+
+ /**
+ * Get the attribute dy on the given element.
+ */
+ // double getDy();
+
+ /**
+ * Set the attribute dy on the given element.
+ */
+ // void setDy(double val) throw(DOMException);
+
+
+ //####################################################################
+ //# SVGGradientElement
+ //####################################################################
+
+
+ /**
+ * Spread Method Types
+ */
+ typedef enum
+ {
+ SVG_SPREADMETHOD_UNKNOWN = 0,
+ SVG_SPREADMETHOD_PAD = 1,
+ SVG_SPREADMETHOD_REFLECT = 2,
+ SVG_SPREADMETHOD_REPEAT = 3
+ } SpreadMethodType;
+
+
+ /**
+ * Corresponds to attribute gradientUnits on the given element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue &getGradientUnits();
+
+ /**
+ * Corresponds to attribute gradientTransform on the given element.
+ */
+ SVGAnimatedValueList &getGradientTransform();
+
+ /**
+ * Corresponds to attribute spreadMethod on the given element.
+ * One of the Spread Method Types.
+ */
+ SVGAnimatedValue &getSpreadMethod();
+
+
+
+ //####################################################################
+ //# SVGHKernElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGImageElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'image' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'image' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'image' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'image' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+
+ /**
+ * Corresponds to attribute preserveAspectRatio on the given element.
+ */
+ // SVGAnimatedPreserveAspectRatio getPreserveAspectRatio();
+
+ //####################################################################
+ //# SVGLinearGradientElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x1 on the given 'linearGradient' element.
+ */
+ // SVGAnimatedValue getX1();
+
+ /**
+ * Corresponds to attribute y1 on the given 'linearGradient' element.
+ */
+ // SVGAnimatedValue getY1();
+
+ /**
+ * Corresponds to attribute x2 on the given 'linearGradient' element.
+ */
+ // SVGAnimatedValue getX2();
+
+ /**
+ * Corresponds to attribute y2 on the given 'linearGradient' element.
+ */
+ // SVGAnimatedValue getY2();
+
+
+
+ //####################################################################
+ //# SVGLineElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x1 on the given 'line' element.
+ */
+ // SVGAnimatedValue getX1();
+
+ /**
+ * Corresponds to attribute y1 on the given 'line' element.
+ */
+ // SVGAnimatedValue getY1();
+
+ /**
+ * Corresponds to attribute x2 on the given 'line' element.
+ */
+ // SVGAnimatedValue getX2();
+
+ /**
+ * Corresponds to attribute y2 on the given 'line' element.
+ */
+ // SVGAnimatedValue getY2();
+
+
+ //####################################################################
+ //# SVGMarkerElement
+ //####################################################################
+
+
+ /**
+ * Marker Unit Types
+ */
+ typedef enum
+ {
+ SVG_MARKERUNITS_UNKNOWN = 0,
+ SVG_MARKERUNITS_USERSPACEONUSE = 1,
+ SVG_MARKERUNITS_STROKEWIDTH = 2
+ } MarkerUnitType;
+
+ /**
+ * Marker Orientation Types
+ */
+ typedef enum
+ {
+ SVG_MARKER_ORIENT_UNKNOWN = 0,
+ SVG_MARKER_ORIENT_AUTO = 1,
+ SVG_MARKER_ORIENT_ANGLE = 2
+ } MarkerOrientationType;
+
+
+ /**
+ * Corresponds to attribute refX on the given 'marker' element.
+ */
+ SVGAnimatedValue getRefX();
+
+ /**
+ * Corresponds to attribute refY on the given 'marker' element.
+ */
+ SVGAnimatedValue getRefY();
+
+ /**
+ * Corresponds to attribute markerUnits on the given 'marker' element.
+ * One of the Marker Units Types defined above.
+ */
+ SVGAnimatedValue getMarkerUnits();
+
+ /**
+ * Corresponds to attribute markerWidth on the given 'marker' element.
+ */
+ SVGAnimatedValue getMarkerWidth();
+
+ /**
+ * Corresponds to attribute markerHeight on the given 'marker' element.
+ */
+ SVGAnimatedValue getMarkerHeight();
+
+ /**
+ * Corresponds to attribute orient on the given 'marker' element.
+ * One of the Marker Orientation Types defined above.
+ */
+ SVGAnimatedValue getOrientType();
+
+ /**
+ * Corresponds to attribute orient on the given 'marker' element.
+ * If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for
+ * attribute orient; otherwise, it will be set to zero.
+ */
+ SVGAnimatedValue getOrientAngle();
+
+
+ /**
+ * Sets the value of attribute orient to 'auto'.
+ */
+ void setOrientToAuto();
+
+ /**
+ * Sets the value of attribute orient to the given angle.
+ */
+ void setOrientToAngle(const SVGAngle &angle);
+
+
+ //####################################################################
+ //# SVGMaskElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute maskUnits on the given 'mask' element. Takes one of
+ * the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getMaskUnits();
+
+ /**
+ * Corresponds to attribute maskContentUnits on the given 'mask' element. Takes
+ * one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getMaskContentUnits();
+
+ /**
+ * Corresponds to attribute x on the given 'mask' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'mask' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'mask' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'mask' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+ //####################################################################
+ //# SVGMetadataElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGMissingGlyphElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGMPathElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute pathLength on the given 'path' element.
+ */
+ SVGAnimatedValue getPathLength();
+
+ /**
+ * Returns the user agent's computed value for the total length of the path using
+ * the user agent's distance-along-a-path algorithm, as a distance in the current
+ * user coordinate system.
+ */
+ double getTotalLength();
+
+ /**
+ * Returns the(x,y) coordinate in user space which is distance units along the
+ * path, utilizing the user agent's distance-along-a-path algorithm.
+ */
+ SVGPoint getPointAtLength(double distance);
+
+ /**
+ * Returns the index into pathSegList which is distance units along the path,
+ * utilizing the user agent's distance-along-a-path algorithm.
+ */
+ unsigned long getPathSegAtLength(double distance);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegClosePath object.
+ */
+ SVGPathSeg createSVGPathSegClosePath();
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegMovetoAbs object.
+ */
+ SVGPathSeg createSVGPathSegMovetoAbs(double x, double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegMovetoRel object.
+ */
+ SVGPathSeg createSVGPathSegMovetoRel(double x, double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoAbs object.
+ */
+ SVGPathSeg createSVGPathSegLinetoAbs(double x, double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoRel object.
+ */
+ SVGPathSeg createSVGPathSegLinetoRel(double x, double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoCubicAbs(double x, double y,
+ double x1, double y1, double x2, double y2);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoCubicRel(double x, double y,
+ double x1, double y1, double x2, double y2);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoQuadraticAbs(double x, double y,
+ double x1, double y1);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoQuadraticRel(double x, double y,
+ double x1, double y1);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegArcAbs object.
+ */
+ SVGPathSeg createSVGPathSegArcAbs(double x, double y,
+ double r1, double r2, double angle,
+ bool largeArcFlag, bool sweepFlag);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegArcRel object.
+ */
+ SVGPathSeg createSVGPathSegArcRel(double x, double y, double r1,
+ double r2, double angle, bool largeArcFlag,
+ bool sweepFlag);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.
+ */
+ SVGPathSeg createSVGPathSegLinetoHorizontalAbs(double x);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.
+ */
+ SVGPathSeg createSVGPathSegLinetoHorizontalRel(double x);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.
+ */
+ SVGPathSeg createSVGPathSegLinetoVerticalAbs(double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.
+ */
+ SVGPathSeg createSVGPathSegLinetoVerticalRel(double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoCubicSmoothAbs(double x, double y,
+ double x2, double y2);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoCubicSmoothRel(double x, double y,
+ double x2, double y2);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs
+ * object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y);
+
+ /**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel
+ * object.
+ */
+ SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y);
+
+ //####################################################################
+ //# SVGPathElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGPatternElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute patternUnits on the given 'pattern' element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getPatternUnits();
+
+ /**
+ * Corresponds to attribute patternContentUnits on the given 'pattern'
+ * element. Takes one of the constants defined in SVGUnitTypes.
+ */
+ SVGAnimatedValue getPatternContentUnits();
+
+ /**
+ * Corresponds to attribute patternTransform on the given 'pattern' element.
+ */
+ SVGAnimatedValueList &getPatternTransform();
+
+ /**
+ * Corresponds to attribute x on the given 'pattern' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ *
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'pattern' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'pattern' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+
+ //####################################################################
+ //# SVGPolyLineElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGPolygonElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGRadialGradientElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute cx on the given 'radialGradient' element.
+ */
+ // SVGAnimatedValue getCx();
+
+
+ /**
+ * Corresponds to attribute cy on the given 'radialGradient' element.
+ */
+ // SVGAnimatedValue getCy();
+
+
+ /**
+ * Corresponds to attribute r on the given 'radialGradient' element.
+ */
+ // SVGAnimatedValue getR();
+
+
+ /**
+ * Corresponds to attribute fx on the given 'radialGradient' element.
+ */
+ SVGAnimatedValue getFx();
+
+
+ /**
+ * Corresponds to attribute fy on the given 'radialGradient' element.
+ */
+ SVGAnimatedValue getFy();
+
+
+ //####################################################################
+ //# SVGRectElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'rect' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'rect' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'rect' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'rect' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+
+ /**
+ * Corresponds to attribute rx on the given 'rect' element.
+ */
+ // SVGAnimatedValue getRx();
+
+ /**
+ * Corresponds to attribute ry on the given 'rect' element.
+ */
+ // SVGAnimatedValue getRy();
+
+
+ //####################################################################
+ //# SVGScriptElement
+ //####################################################################
+
+ /**
+ *
+ */
+ // DOMString getType();
+
+ /**
+ *
+ */
+ // void setType(const DOMString &val) throw(DOMException);
+
+ //####################################################################
+ //# SVGSetElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGStopElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute offset on the given 'stop' element.
+ */
+ // SVGAnimatedValue getOffset();
+
+
+ //####################################################################
+ //# SVGStyleElement
+ //####################################################################
+
+ /**
+ * Get the attribute xml:space on the given element.
+ */
+ DOMString getXmlspace();
+
+ /**
+ * Set the attribute xml:space on the given element.
+ */
+ void setXmlspace(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute type on the given 'style' element.
+ */
+ // DOMString getType();
+
+ /**
+ * Set the attribute type on the given 'style' element.
+ */
+ // void setType(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute media on the given 'style' element.
+ */
+ DOMString getMedia();
+
+ /**
+ * Set the attribute media on the given 'style' element.
+ */
+ void setMedia(const DOMString &val) throw(DOMException);
+
+ /**
+ * Get the attribute title on the given 'style' element.
+ */
+ DOMString getTitle();
+
+ /**
+ * Set the attribute title on the given 'style' element.
+ */
+ void setTitle(const DOMString &val) throw(DOMException);
+
+ //####################################################################
+ //# SVGSymbolElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGSVGElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'svg' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'svg' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'svg' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'svg' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+ /**
+ * Get the attribute contentScriptType on the given 'svg' element.
+ */
+ DOMString getContentScriptType();
+
+ /**
+ * Set the attribute contentScriptType on the given 'svg' element.
+ */
+ void setContentScriptType(const DOMString &val) throw(DOMException);
+
+
+ /**
+ * Get the attribute contentStyleType on the given 'svg' element.
+ */
+ DOMString getContentStyleType();
+
+ /**
+ * Set the attribute contentStyleType on the given 'svg' element.
+ */
+ void setContentStyleType(const DOMString &val) throw(DOMException);
+
+ /**
+ * The position and size of the viewport(implicit or explicit) that corresponds
+ * to this 'svg' element. When the user agent is actually rendering the content,
+ * then the position and size values represent the actual values when rendering.
+ * The position and size values are unitless values in the coordinate system of
+ * the parent element. If no parent element exists(i.e., 'svg' element
+ * represents the root of the document tree), if this SVG document is embedded as
+ * part of another document(e.g., via the HTML 'object' element), then the
+ * position and size are unitless values in the coordinate system of the parent
+ * document.(If the parent uses CSS or XSL layout, then unitless values
+ * represent pixel units for the current CSS or XSL viewport, as described in the
+ * CSS2 specification.) If the parent element does not have a coordinate system,
+ * then the user agent should provide reasonable default values for this attribute.
+ * */
+ SVGRect getViewport();
+
+ /**
+ * Size of a pixel units(as defined by CSS2) along the x-axis of the viewport,
+ * which represents a unit somewhere in the range of 70dpi to 120dpi, and, on
+ * systems that support this, might actually match the characteristics of the
+ * target medium. On systems where it is impossible to know the size of a pixel,
+ * a suitable default pixel size is provided.
+ */
+ double getPixelUnitToMillimeterX();
+
+ /**
+ * Corresponding size of a pixel unit along the y-axis of the viewport.
+ */
+ double getPixelUnitToMillimeterY();
+
+ /**
+ * User interface(UI) events in DOM Level 2 indicate the screen positions at
+ * which the given UI event occurred. When the user agent actually knows the
+ * physical size of a "screen unit", this attribute will express that information;
+ * otherwise, user agents will provide a suitable default value such as .28mm.
+ */
+ double getScreenPixelToMillimeterX();
+
+ /**
+ * Corresponding size of a screen pixel along the y-axis of the viewport.
+ */
+ double getScreenPixelToMillimeterY();
+
+
+ /**
+ * The initial view(i.e., before magnification and panning) of the current
+ * innermost SVG document fragment can be either the "standard" view(i.e., based
+ * on attributes on the 'svg' element such as fitBoxToViewport) or to a "custom"
+ * view(i.e., a hyperlink into a particular 'view' or other element - see
+ * Linking into SVG content: URI fragments and SVG views). If the initial view is
+ * the "standard" view, then this attribute is false. If the initial view is a
+ * "custom" view, then this attribute is true.
+ */
+ bool getUseCurrentView();
+
+ /**
+ * Set the value above
+ */
+ void setUseCurrentView(bool val) throw(DOMException);
+
+ /**
+ * The definition of the initial view(i.e., before magnification and panning) of
+ * the current innermost SVG document fragment. The meaning depends on the
+ * situation:
+ *
+ * * If the initial view was a "standard" view, then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will match the values for the corresponding DOM attributes that
+ * are on SVGSVGElement directly
+ * o the values for transform and viewTarget within currentView will be null
+ * * If the initial view was a link into a 'view' element, then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will correspond to the corresponding attributes for the given
+ * 'view' element
+ * o the values for transform and viewTarget within currentView will be null
+ * * If the initial view was a link into another element(i.e., other than a
+ * 'view'), then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will match the values for the corresponding DOM attributes that
+ * are on SVGSVGElement directly for the closest ancestor 'svg' element
+ * o the values for transform within currentView will be null
+ * o the viewTarget within currentView will represent the target of the link
+ * * If the initial view was a link into the SVG document fragment using an SVG
+ * view specification fragment identifier(i.e., #svgView(...)), then:
+ * o the values for viewBox, preserveAspectRatio, zoomAndPan, transform and
+ * viewTarget within currentView will correspond to the values from the SVG view
+ * specification fragment identifier
+ *
+ */
+ SVGViewSpec getCurrentView();
+
+
+ /**
+ * This attribute indicates the current scale factor relative to the initial view
+ * to take into account user magnification and panning operations, as described
+ * under Magnification and panning. DOM attributes currentScale and
+ * currentTranslate are equivalent to the 2x3 matrix [a b c d e f] =
+ * [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If
+ * "magnification" is enabled(i.e., zoomAndPan="magnify"), then the effect is as
+ * if an extra transformation were placed at the outermost level on the SVG
+ * document fragment(i.e., outside the outermost 'svg' element).
+ */
+ double getCurrentScale();
+
+ /**
+ * Set the value above.
+ */
+ void setCurrentScale(double val) throw(DOMException);
+
+ /**
+ * The corresponding translation factor that takes into account
+ * user "magnification".
+ */
+ SVGPoint getCurrentTranslate();
+
+ /**
+ * Takes a time-out value which indicates that redraw shall not occur until:(a)
+ * the corresponding unsuspendRedraw(suspend_handle_id) call has been made,(b)
+ * an unsuspendRedrawAll() call has been made, or(c) its timer has timed out. In
+ * environments that do not support interactivity(e.g., print media), then
+ * redraw shall not be suspended. suspend_handle_id =
+ * suspendRedraw(max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id)
+ * must be packaged as balanced pairs. When you want to suspend redraw actions as
+ * a collection of SVG DOM changes occur, then precede the changes to the SVG DOM
+ * with a method call similar to suspend_handle_id =
+ * suspendRedraw(max_wait_milliseconds) and follow the changes with a method call
+ * similar to unsuspendRedraw(suspend_handle_id). Note that multiple
+ * suspendRedraw calls can be used at once and that each such method call is
+ * treated independently of the other suspendRedraw method calls.
+ */
+ unsigned long suspendRedraw(unsigned long max_wait_milliseconds);
+
+ /**
+ * Cancels a specified suspendRedraw() by providing a unique suspend_handle_id.
+ */
+ void unsuspendRedraw(unsigned long suspend_handle_id) throw(DOMException);
+
+ /**
+ * Cancels all currently active suspendRedraw() method calls. This method is most
+ * useful at the very end of a set of SVG DOM calls to ensure that all pending
+ * suspendRedraw() method calls have been cancelled.
+ */
+ void unsuspendRedrawAll();
+
+ /**
+ * In rendering environments supporting interactivity, forces the user agent to
+ * immediately redraw all regions of the viewport that require updating.
+ */
+ void forceRedraw();
+
+ /**
+ * Suspends(i.e., pauses) all currently running animations that are defined
+ * within the SVG document fragment corresponding to this 'svg' element, causing
+ * the animation clock corresponding to this document fragment to stand still
+ * until it is unpaused.
+ */
+ void pauseAnimations();
+
+ /**
+ * Unsuspends(i.e., unpauses) currently running animations that are defined
+ * within the SVG document fragment, causing the animation clock to continue from
+ * the time at which it was suspended.
+ */
+ void unpauseAnimations();
+
+ /**
+ * Returns true if this SVG document fragment is in a paused state.
+ */
+ bool animationsPaused();
+
+ /**
+ * Returns the current time in seconds relative to the start time for
+ * the current SVG document fragment.
+ */
+ // double getCurrentTime();
+
+ /**
+ * Adjusts the clock for this SVG document fragment, establishing
+ * a new current time.
+ */
+ void setCurrentTime(double seconds);
+
+ /**
+ * Returns the list of graphics elements whose rendered content intersects the
+ * supplied rectangle, honoring the 'pointer-events' property value on each
+ * candidate graphics element.
+ */
+ NodeList getIntersectionList(const SVGRect &rect,
+ const SVGElementPtr referenceElement);
+
+ /**
+ * Returns the list of graphics elements whose rendered content is entirely
+ * contained within the supplied rectangle, honoring the 'pointer-events'
+ * property value on each candidate graphics element.
+ */
+ NodeList getEnclosureList(const SVGRect &rect,
+ const SVGElementPtr referenceElement);
+
+ /**
+ * Returns true if the rendered content of the given element intersects the
+ * supplied rectangle, honoring the 'pointer-events' property value on each
+ * candidate graphics element.
+ */
+ bool checkIntersection(const SVGElementPtr element, const SVGRect &rect);
+
+ /**
+ * Returns true if the rendered content of the given element is entirely
+ * contained within the supplied rectangle, honoring the 'pointer-events'
+ * property value on each candidate graphics element.
+ */
+ bool checkEnclosure(const SVGElementPtr element, const SVGRect &rect);
+
+ /**
+ * Unselects any selected objects, including any selections of text
+ * strings and type-in bars.
+ */
+ void deselectAll();
+
+ /**
+ * Creates an SVGNumber object outside of any document trees. The object
+ * is initialized to a value of zero.
+ */
+ SVGNumber createSVGNumber();
+
+ /**
+ * Creates an SVGLength object outside of any document trees. The object
+ * is initialized to the value of 0 user units.
+ */
+ SVGLength createSVGLength();
+
+ /**
+ * Creates an SVGAngle object outside of any document trees. The object
+ * is initialized to the value 0 degrees(unitless).
+ */
+ SVGAngle createSVGAngle();
+
+ /**
+ * Creates an SVGPoint object outside of any document trees. The object
+ * is initialized to the point(0,0) in the user coordinate system.
+ */
+ SVGPoint createSVGPoint();
+
+ /**
+ * Creates an SVGMatrix object outside of any document trees. The object
+ * is initialized to the identity matrix.
+ */
+ SVGMatrix createSVGMatrix();
+
+ /**
+ * Creates an SVGRect object outside of any document trees. The object
+ * is initialized such that all values are set to 0 user units.
+ */
+ SVGRect createSVGRect();
+
+ /**
+ * Creates an SVGTransform object outside of any document trees.
+ * The object is initialized to an identity matrix transform
+ * (SVG_TRANSFORM_MATRIX).
+ */
+ SVGTransform createSVGTransform();
+
+ /**
+ * Creates an SVGTransform object outside of any document trees.
+ * The object is initialized to the given matrix transform
+ * (i.e., SVG_TRANSFORM_MATRIX).
+ */
+ SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix);
+
+ /**
+ * Searches this SVG document fragment(i.e., the search is restricted to a
+ * subset of the document tree) for an Element whose id is given by elementId. If
+ * an Element is found, that Element is returned. If no such element exists,
+ * returns null. Behavior is not defined if more than one element has this id.
+ */
+ ElementPtr getElementById(const DOMString& elementId);
+
+
+ //####################################################################
+ //# SVGTextElement
+ //####################################################################
+
+
+ //####################################################################
+ //# SVGTextContentElement
+ //####################################################################
+
+
+ /**
+ * lengthAdjust Types
+ */
+ typedef enum
+ {
+ LENGTHADJUST_UNKNOWN = 0,
+ LENGTHADJUST_SPACING = 1,
+ LENGTHADJUST_SPACINGANDGLYPHS = 2
+ } LengthAdjustType;
+
+
+ /**
+ * Corresponds to attribute textLength on the given element.
+ */
+ SVGAnimatedValue getTextLength();
+
+
+ /**
+ * Corresponds to attribute lengthAdjust on the given element. The value must be
+ * one of the length adjust constants specified above.
+ */
+ SVGAnimatedValue getLengthAdjust();
+
+
+ /**
+ * Returns the total number of characters to be rendered within the current
+ * element. Includes characters which are included via a 'tref' reference.
+ */
+ long getNumberOfChars();
+
+ /**
+ * The total sum of all of the advance values from rendering all of the
+ * characters within this element, including the advance value on the glyphs
+ *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'
+ * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'
+ * elements. For non-rendering environments, the user agent shall make reasonable
+ * assumptions about glyph metrics.
+ */
+ double getComputedTextLength();
+
+ /**
+ * The total sum of all of the advance values from rendering the specified
+ * substring of the characters, including the advance value on the glyphs
+ *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'
+ * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'
+ * elements. For non-rendering environments, the user agent shall make reasonable
+ * assumptions about glyph metrics.
+ */
+ double getSubStringLength(unsigned long charnum, unsigned long nchars)
+ throw(DOMException);
+
+ /**
+ * Returns the current text position before rendering the character in the user
+ * coordinate system for rendering the glyph(s) that correspond to the specified
+ * character. The current text position has already taken into account the
+ * effects of any inter-character adjustments due to properties 'kerning',
+ * 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx
+ * and dy. If multiple consecutive characters are rendered inseparably(e.g., as
+ * a single glyph or a sequence of glyphs), then each of the inseparable
+ * characters will return the start position for the first glyph.
+ */
+ SVGPoint getStartPositionOfChar(unsigned long charnum) throw(DOMException);
+
+ /**
+ * Returns the current text position after rendering the character in the user
+ * coordinate system for rendering the glyph(s) that correspond to the specified
+ * character. This current text position does not take into account the effects
+ * of any inter-character adjustments to prepare for the next character, such as
+ * properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due
+ * to attributes x, y, dx and dy. If multiple consecutive characters are rendered
+ * inseparably(e.g., as a single glyph or a sequence of glyphs), then each of
+ * the inseparable characters will return the end position for the last glyph.
+ */
+ SVGPoint getEndPositionOfChar(unsigned long charnum) throw(DOMException);
+
+ /**
+ * Returns a tightest rectangle which defines the minimum and maximum X and Y
+ * values in the user coordinate system for rendering the glyph(s) that
+ * correspond to the specified character. The calculations assume that all glyphs
+ * occupy the full standard glyph cell for the font. If multiple consecutive
+ * characters are rendered inseparably(e.g., as a single glyph or a sequence of
+ * glyphs), then each of the inseparable characters will return the same extent.
+ */
+ SVGRect getExtentOfChar(unsigned long charnum) throw(DOMException);
+
+ /**
+ * Returns the rotation value relative to the current user coordinate system used
+ * to render the glyph(s) corresponding to the specified character. If multiple
+ * glyph(s) are used to render the given character and the glyphs each have
+ * different rotations(e.g., due to text-on-a-path), the user agent shall return
+ * an average value(e.g., the rotation angle at the midpoint along the path for
+ * all glyphs used to render this character). The rotation value represents the
+ * rotation that is supplemental to any rotation due to properties
+ * 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any
+ * glyph rotations due to these properties are not included into the returned
+ * rotation value. If multiple consecutive characters are rendered inseparably
+ *(e.g., as a single glyph or a sequence of glyphs), then each of the
+ * inseparable characters will return the same rotation value.
+ */
+ double getRotationOfChar(unsigned long charnum) throw(DOMException);
+
+ /**
+ * Returns the index of the character whose corresponding glyph cell bounding box
+ * contains the specified point. The calculations assume that all glyphs occupy
+ * the full standard glyph cell for the font. If no such character exists, a
+ * value of -1 is returned. If multiple such characters exist, the character
+ * within the element whose glyphs were rendered last(i.e., take into account
+ * any reordering such as for bidirectional text) is used. If multiple
+ * consecutive characters are rendered inseparably(e.g., as a single glyph or a
+ * sequence of glyphs), then the user agent shall allocate an equal percentage of
+ * the text advance amount to each of the contributing characters in determining
+ * which of the characters is chosen.
+ */
+ long getCharNumAtPosition(const SVGPoint &point);
+
+ /**
+ * Causes the specified substring to be selected just as if the user
+ * selected the substring interactively.
+ */
+ void selectSubString(unsigned long charnum, unsigned long nchars)
+ throw(DOMException);
+
+
+
+
+
+ //####################################################################
+ //# SVGTextPathElement
+ //####################################################################
+
+
+ /**
+ * textPath Method Types
+ */
+ typedef enum
+ {
+ TEXTPATH_METHODTYPE_UNKNOWN = 0,
+ TEXTPATH_METHODTYPE_ALIGN = 1,
+ TEXTPATH_METHODTYPE_STRETCH = 2
+ } TextPathMethodType;
+
+ /**
+ * textPath Spacing Types
+ */
+ typedef enum
+ {
+ TEXTPATH_SPACINGTYPE_UNKNOWN = 0,
+ TEXTPATH_SPACINGTYPE_AUTO = 1,
+ TEXTPATH_SPACINGTYPE_EXACT = 2
+ } TextPathSpacingType;
+
+
+ /**
+ * Corresponds to attribute startOffset on the given 'textPath' element.
+ */
+ SVGAnimatedValue getStartOffset();
+
+ /**
+ * Corresponds to attribute method on the given 'textPath' element. The value
+ * must be one of the method type constants specified above.
+ */
+ SVGAnimatedValue getMethod();
+
+ /**
+ * Corresponds to attribute spacing on the given 'textPath' element.
+ * The value must be one of the spacing type constants specified above.
+ */
+ SVGAnimatedValue getSpacing();
+
+
+ //####################################################################
+ //# SVGTextPositioningElement
+ //####################################################################
+
+
+ /**
+ * Corresponds to attribute x on the given element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute dx on the given element.
+ */
+ // SVGAnimatedValue getDx();
+
+ /**
+ * Corresponds to attribute dy on the given element.
+ */
+ // SVGAnimatedValue getDy();
+
+
+ /**
+ * Corresponds to attribute rotate on the given element.
+ */
+ SVGAnimatedValueList getRotate();
+
+
+ //####################################################################
+ //# SVGTitleElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGTRefElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGTSpanElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGSwitchElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGUseElement
+ //####################################################################
+
+ /**
+ * Corresponds to attribute x on the given 'use' element.
+ */
+ // SVGAnimatedValue getX();
+
+ /**
+ * Corresponds to attribute y on the given 'use' element.
+ */
+ // SVGAnimatedValue getY();
+
+ /**
+ * Corresponds to attribute width on the given 'use' element.
+ */
+ // SVGAnimatedValue getWidth();
+
+ /**
+ * Corresponds to attribute height on the given 'use' element.
+ */
+ // SVGAnimatedValue getHeight();
+
+ /**
+ * The root of the "instance tree". See description of SVGElementInstance for
+ * a discussion on the instance tree.
+ * */
+ SVGElementInstance getInstanceRoot();
+
+ /**
+ * If the 'href' attribute is being animated, contains the current animated root
+ * of the "instance tree". If the 'href' attribute is not currently being
+ * animated, contains the same value as 'instanceRoot'. The root of the "instance
+ * tree". See description of SVGElementInstance for a discussion on the instance
+ * tree.
+ */
+ SVGElementInstance getAnimatedInstanceRoot();
+
+ //####################################################################
+ //# SVGVKernElement
+ //####################################################################
+
+ //####################################################################
+ //# SVGViewElement
+ //####################################################################
+
+
+ /**
+ *
+ */
+ SVGValueList getViewTarget();
+
+
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+
+ /**
+ *
+ */
+ ~SVGElement() {}
+
+
+};
+
+
+
+/*#########################################################################
+## SVGDocument
+#########################################################################*/
+
+/**
+ * When an 'svg' element is embedded inline as a component of a document from
+ * another namespace, such as when an 'svg' element is embedded inline within an
+ * XHTML document [XHTML], then an SVGDocument object will not exist; instead,
+ * the root object in the document object hierarchy will be a Document object of
+ * a different type, such as an HTMLDocument object.
+ *
+ * However, an SVGDocument object will indeed exist when the root element of the
+ * XML document hierarchy is an 'svg' element, such as when viewing a stand-alone
+ * SVG file(i.e., a file with MIME type "image/svg+xml"). In this case, the
+ * SVGDocument object will be the root object of the document object model
+ * hierarchy.
+ *
+ * In the case where an SVG document is embedded by reference, such as when an
+ * XHTML document has an 'object' element whose href attribute references an SVG
+ * document(i.e., a document whose MIME type is "image/svg+xml" and whose root
+ * element is thus an 'svg' element), there will exist two distinct DOM
+ * hierarchies. The first DOM hierarchy will be for the referencing document
+ *(e.g., an XHTML document). The second DOM hierarchy will be for the referenced
+ * SVG document. In this second DOM hierarchy, the root object of the document
+ * object model hierarchy is an SVGDocument object.
+ */
+class SVGDocument : public Document,
+ public events::DocumentEvent
+{
+public:
+
+
+ /**
+ * The title of a document as specified by the title sub-element of the 'svg'
+ * root element(i.e., <svg><title>Here is the title</title>...</svg>)
+ */
+ DOMString getTitle();
+
+ /**
+ * Returns the URI of the page that linked to this page. The value is an empty
+ * string if the user navigated to the page directly(not through a link, but,
+ * for example, via a bookmark).
+ */
+ DOMString getReferrer();
+
+ /**
+ * The domain name of the server that served the document, or a null string if
+ * the server cannot be identified by a domain name.
+ */
+ DOMString getDomain();
+
+ /**
+ * The complete URI of the document.
+ */
+ DOMString getURL();
+
+ /**
+ * The root 'svg' element in the document hierarchy.
+ */
+ SVGElementPtr getRootElement();
+
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ ~SVGDocument() {}
+
+};
+
+
+
+/*#########################################################################
+## GetSVGDocument
+#########################################################################*/
+
+/**
+ * In the case where an SVG document is embedded by reference, such as when an
+ * XHTML document has an 'object' element whose href(or equivalent) attribute
+ * references an SVG document(i.e., a document whose MIME type is
+ * "image/svg+xml" and whose root element is thus an 'svg' element), the SVG user
+ * agent is required to implement the GetSVGDocument interface for the element
+ * which references the SVG document(e.g., the HTML 'object' or comparable
+ * referencing elements).
+ */
+class GetSVGDocument
+{
+public:
+
+ /**
+ * Returns the SVGDocument object for the referenced SVG document.
+ */
+ SVGDocumentPtr getSVGDocument()
+ throw(DOMException);
+
+ //##################
+ //# Non-API methods
+ //##################
+
+ /**
+ *
+ */
+ ~GetSVGDocument() {}
+
+};
+
+
+
+
+
+
+
+} //namespace svg
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+#endif // __SVG_H__
+/*#########################################################################
+## E N D O F F I L E
+#########################################################################*/
+
diff --git a/src/dom/work/svg2.cpp b/src/dom/work/svg2.cpp
index acbdf2a000288f5e97921702b2982dc418146967..f0da61e093ff51adc37948eefbd6c118a7541aac 100644 (file)
--- a/src/dom/work/svg2.cpp
+++ b/src/dom/work/svg2.cpp
-/**\r
- * Phoebe DOM Implementation.\r
- *\r
- * This is a C++ approximation of the W3C DOM model, which follows\r
- * fairly closely the specifications in the various .idl files, copies of\r
- * which are provided for reference. Most important is this one:\r
- *\r
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html\r
- *\r
- * Authors:\r
- * Bob Jamison\r
- *\r
- * Copyright(C) 2005-2008 Bob Jamison\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or(at your option) any later version.\r
- *\r
- * This library 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 GNU\r
- * 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; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
- *\r
- * =======================================================================\r
- * NOTES\r
- *\r
- * This API follows:\r
- * http://www.w3.org/TR/SVG11/svgdom.html\r
- *\r
- * This file defines the main SVG-DOM Node types. Other non-Node types are\r
- * defined in svgtypes.h.\r
- * \r
- */\r
-\r
-#include "svg.h"\r
-\r
-#include <math.h>\r
-\r
-\r
-namespace org\r
-{\r
-namespace w3c\r
-{\r
-namespace dom\r
-{\r
-namespace svg\r
-{\r
-\r
-\r
-\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-//# I N T E R F A C E S\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGMatrix\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getA()\r
-{ \r
- return a;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setA(double val) throw (DOMException)\r
-{ \r
- a = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getB()\r
-{\r
- return b;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setB(double val) throw (DOMException)\r
-{\r
- b = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getC()\r
-{\r
- return c;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setC(double val) throw (DOMException)\r
-{\r
- c = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getD()\r
-{\r
- return d;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setD(double val) throw (DOMException)\r
-{\r
- d = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getE()\r
-{\r
- return e;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setE(double val) throw (DOMException)\r
-{\r
- e = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGMatrix::getF()\r
-{\r
- return f;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGMatrix::setF(double val) throw (DOMException)\r
-{\r
- f = val;\r
-}\r
-\r
-\r
-/**\r
- * Return the result of postmultiplying this matrix with another.\r
- */\r
-SVGMatrix SVGMatrix::multiply(const SVGMatrix &other)\r
-{\r
- SVGMatrix result;\r
- result.a = a * other.a + c * other.b;\r
- result.b = b * other.a + d * other.b;\r
- result.c = a * other.c + c * other.d;\r
- result.d = b * other.c + d * other.d;\r
- result.e = a * other.e + c * other.f + e;\r
- result.f = b * other.e + d * other.f + f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Calculate the inverse of this matrix\r
- *\r
- */\r
-SVGMatrix SVGMatrix::inverse() throw (SVGException)\r
-{\r
- /*###########################################\r
- The determinant of a 3x3 matrix E\r
- (let's use our own notation for a bit)\r
-\r
- A B C\r
- D E F\r
- G H I\r
- is\r
- AEI - AFH - BDI + BFG + CDH - CEG\r
-\r
- Since in our affine transforms, G and H==0 and I==1,\r
- this reduces to:\r
- AE - BD\r
- In SVG's naming scheme, that is: a * d - c * b . SIMPLE!\r
-\r
- In a similar method of attack, SVG's adjunct matrix is:\r
-\r
- d -c cf-ed\r
- -b a eb-af\r
- 0 0 ad-cb\r
-\r
- To get the inverse matrix, we divide the adjunct matrix by\r
- the determinant. Notice that (ad-cb)/(ad-cb)==1. Very cool.\r
- So what we end up with is this:\r
-\r
- a = d/(ad-cb) c = -c/(ad-cb) e = (cf-ed)/(ad-cb)\r
- b = -b/(ad-cb) d = a/(ad-cb) f = (eb-af)/(ad-cb)\r
-\r
- (Since this would be in all SVG-DOM implementations,\r
- somebody needed to document this! ^^)\r
- #############################################*/\r
-\r
- SVGMatrix result;\r
- double determinant = a * d - c * b;\r
- if (determinant < 1.0e-18)//invertible?\r
- {\r
- result.identity();//cop out\r
- return result;\r
- }\r
-\r
- double idet = 1.0 / determinant;\r
- result.a = d * idet;\r
- result.b = -b * idet;\r
- result.c = -c * idet;\r
- result.d = a * idet;\r
- result.e = (c*f - e*d) * idet;\r
- result.f = (e*b - a*f) * idet;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | 1 0 x |\r
- * | 0 1 y |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::translate(double x, double y)\r
-{\r
- SVGMatrix result;\r
- result.a = a;\r
- result.b = b;\r
- result.c = c;\r
- result.d = d;\r
- result.e = a * x + c * y + e;\r
- result.f = b * x + d * y + f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | scale 0 0 |\r
- * | 0 scale 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-:SVGMatrix SVGMatrix:scale(double scale)\r
-{\r
- SVGMatrix result;\r
- result.a = a * scale;\r
- result.b = b * scale;\r
- result.c = c * scale;\r
- result.d = d * scale;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | scaleX 0 0 |\r
- * | 0 scaleY 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::scaleNonUniform(double scaleX,\r
- double scaleY)\r
-{\r
- SVGMatrix result;\r
- result.a = a * scaleX;\r
- result.b = b * scaleX;\r
- result.c = c * scaleY;\r
- result.d = d * scaleY;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | cos(a) -sin(a) 0 |\r
- * | sin(a) cos(a) 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::rotate (double angle)\r
-{\r
- double sina = sin(angle);\r
- double msina = -sina;\r
- double cosa = cos(angle);\r
- SVGMatrix result;\r
- result.a = a * cosa + c * sina;\r
- result.b = b * cosa + d + sina;\r
- result.c = a * msina + c * cosa;\r
- result.d = b * msina + d * cosa;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | cos(a) -sin(a) 0 |\r
- * | sin(a) cos(a) 0 |\r
- * | 0 0 1 |\r
- * In this case, angle 'a' is computed as the artangent\r
- * of the slope y/x . It is negative if the slope is negative.\r
- */\r
-SVGMatrix SVGMatrix::rotateFromVector(double x, double y)\r
- throw (SVGException)\r
-{\r
- double angle = atan(y / x);\r
- if (y < 0.0)\r
- angle = -angle;\r
- SVGMatrix result;\r
- double sina = sin(angle);\r
- double msina = -sina;\r
- double cosa = cos(angle);\r
- result.a = a * cosa + c * sina;\r
- result.b = b * cosa + d + sina;\r
- result.c = a * msina + c * cosa;\r
- result.d = b * msina + d * cosa;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | -1 0 0 |\r
- * | 0 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::flipX()\r
-{\r
- SVGMatrix result;\r
- result.a = -a;\r
- result.b = -b;\r
- result.c = c;\r
- result.d = d;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | 1 0 0 |\r
- * | 0 -1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::flipY()\r
-{\r
- SVGMatrix result;\r
- result.a = a;\r
- result.b = b;\r
- result.c = -c;\r
- result.d = -d;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * | 1 tan(a) 0 |\r
- * | 0 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix SVGMatrix::skewX(double angle)\r
-{\r
- double tana = tan(angle);\r
- SVGMatrix result;\r
- result.a = a;\r
- result.b = b;\r
- result.c = a * tana + c;\r
- result.d = b * tana + d;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-/**\r
- * Equivalent to multiplying by:\r
- * | 1 0 0 |\r
- * | tan(a) 1 0 |\r
- * | 0 0 1 |\r
- *\r
- */\r
-SVGMatrix::SVGMatrix SVGMatrix::skewY(double angle)\r
-{\r
- double tana = tan(angle);\r
- SVGMatrix result;\r
- result.a = a + c * tana;\r
- result.b = b + d * tana;\r
- result.c = c;\r
- result.d = d;\r
- result.e = e;\r
- result.f = f;\r
- return result;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix::SVGMatrix()\r
-{\r
- identity();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix::SVGMatrix(double aArg, double bArg, double cArg,\r
- double dArg, double eArg, double fArg)\r
-{\r
- a = aArg; b = bArg; c = cArg;\r
- d = dArg; e = eArg; f = fArg;\r
-}\r
-\r
-/**\r
- * Copy constructor\r
- */\r
-SVGMatrix::SVGMatrix(const SVGMatrix &other)\r
-{\r
- a = other.a;\r
- b = other.b;\r
- c = other.c;\r
- d = other.d;\r
- e = other.e;\r
- f = other.f;\r
-}\r
-\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix::~SVGMatrix()\r
-{\r
-}\r
-\r
-/*\r
- * Set to the identity matrix\r
- */\r
-void SVGMatrix::identity()\r
-{\r
- a = 1.0;\r
- b = 0.0;\r
- c = 0.0;\r
- d = 1.0;\r
- e = 0.0;\r
- f = 0.0;\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGTransform\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGTransform::getType()\r
-{\r
- return type;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix SVGTransform::getMatrix()\r
-{\r
- return matrix;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGTransform::getAngle()\r
-{\r
- return angle;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setMatrix(const SVGMatrix &matrixArg)\r
-{\r
- type = SVG_TRANSFORM_MATRIX;\r
- matrix = matrixArg;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setTranslate(double tx, double ty)\r
-{\r
- type = SVG_TRANSFORM_TRANSLATE;\r
- matrix.setA(1.0);\r
- matrix.setB(0.0);\r
- matrix.setC(0.0);\r
- matrix.setD(1.0);\r
- matrix.setE(tx);\r
- matrix.setF(ty);\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setScale(double sx, double sy)\r
-{\r
- type = SVG_TRANSFORM_SCALE;\r
- matrix.setA(sx);\r
- matrix.setB(0.0);\r
- matrix.setC(0.0);\r
- matrix.setD(sy);\r
- matrix.setE(0.0);\r
- matrix.setF(0.0);\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setRotate(double angleArg, double cx, double cy)\r
-{\r
- angle = angleArg;\r
- setTranslate(cx, cy);\r
- type = SVG_TRANSFORM_ROTATE;\r
- matrix.rotate(angle);\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setSkewX(double angleArg)\r
-{\r
- angle = angleArg;\r
- type = SVG_TRANSFORM_SKEWX;\r
- matrix.identity();\r
- matrix.skewX(angle);\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGTransform::setSkewY(double angleArg)\r
-{\r
- angle = angleArg;\r
- type = SVG_TRANSFORM_SKEWY;\r
- matrix.identity();\r
- matrix.skewY(angle);\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGTransform::SVGTransform()\r
-{\r
- type = SVG_TRANSFORM_UNKNOWN;\r
- angle = 0.0;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGTransform::SVGTransform(const SVGTransform &other)\r
-{\r
- type = other.type;\r
- angle = other.angle;\r
- matrix = other.matrix;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-~SVGTransform::SVGTransform()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGNumber\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-double SVGNumber::getValue()\r
-{\r
- return value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGNumber::setValue(double val) throw (DOMException)\r
-{\r
- value = val;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGNumber::SVGNumber()\r
-{\r
- value = 0.0;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGNumber::SVGNumber(const SVGNumber &other)\r
-{\r
- value = other.value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGNumber::~SVGNumber()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGLength\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGLength::getUnitType()\r
-{\r
- return unitType;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGLength::getValue()\r
-{\r
- return value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLength::setValue(double val) throw (DOMException)\r
-{\r
- value = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGLength::getValueInSpecifiedUnits()\r
-{\r
- double result = 0.0;\r
- //fill this in\r
- return result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLength::setValueInSpecifiedUnits(double /*val*/)\r
- throw (DOMException)\r
-{\r
- //fill this in\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGLength::getValueAsString()\r
-{\r
- DOMString ret;\r
- char buf[32];\r
- snprintf(buf, 31, "%f", value);\r
- ret.append(buf);\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLength::setValueAsString(const DOMString& /*val*/)\r
- throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void SVGLength::newValueSpecifiedUnits (unsigned short /*unitType*/, double /*val*/)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLength::convertToSpecifiedUnits (unsigned short /*unitType*/)\r
-{\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGLength::SVGLength()\r
-{\r
- unitType = SVG_LENGTHTYPE_UNKNOWN;\r
- value = 0.0;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGLength::SVGLength(const SVGLength &other)\r
-{\r
- unitType = other.unitType;\r
- value = other.value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGLength::~SVGLength()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGAngle\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGAngle::getUnitType()\r
-{\r
- return unitType;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGAngle::getValue()\r
-{\r
- return value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGAngle::setValue(double val) throw (DOMException)\r
-{\r
- value = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGAngle::getValueInSpecifiedUnits()\r
-{\r
- double result = 0.0;\r
- //convert here\r
- return result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGAngle::setValueInSpecifiedUnits(double /*val*/)\r
- throw (DOMException)\r
-{\r
- //do conversion\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGAngle::getValueAsString()\r
-{\r
- DOMString result;\r
- char buf[32];\r
- snprintf(buf, 31, "%f", value);\r
- result.append(buf);\r
- return result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGAngle::setValueAsString(const DOMString &/*val*/)\r
- throw (DOMException)\r
-{\r
- //convert here\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void SVGAngle::newValueSpecifiedUnits (unsigned short /*unitType*/,\r
- double /*valueInSpecifiedUnits*/)\r
-{\r
- //convert here\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGAngle::convertToSpecifiedUnits (unsigned short /*unitType*/)\r
-{\r
- //convert here\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGAngle::SVGAngle()\r
-{\r
- unitType = SVG_ANGLETYPE_UNKNOWN;\r
- value = 0.0;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAngle::SVGAngle(const SVGAngle &other)\r
-{\r
- unitType = other.unitType;\r
- value = other.value;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAngle::~SVGAngle()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGICCColor\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGICCColor::getColorProfile()\r
-{\r
- return colorProfile;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGICCColor::setColorProfile(const DOMString &val) throw (DOMException)\r
-{\r
- colorProfile = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGNumberList &SVGICCColor::getColors()\r
-{\r
- return colors;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGICCColor::SVGICCColor()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGICCColor::SVGICCColor(const SVGICCColor &other)\r
-{\r
- colorProfile = other.colorProfile;\r
- colors = other.colors;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGICCColor::~SVGICCColor()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGColor\r
-#########################################################################*/\r
-\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGColor::getColorType()\r
-{\r
- return colorType;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-css::RGBColor SVGColor::getRgbColor()\r
-{\r
- css::RGBColor col;\r
- return col;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGICCColor SVGColor::getIccColor()\r
-{\r
- SVGICCColor col;\r
- return col;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void SVGColor::setRGBColor(const DOMString& /*rgbColor*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGColor::setRGBColorICCColor(const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGColor::setColor (unsigned short /*colorType*/,\r
- const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGColor::SVGColor()\r
-{\r
- colorType = SVG_COLORTYPE_UNKNOWN;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGColor::SVGColor(const SVGColor &other) : css::CSSValue(other)\r
-{\r
- colorType = other.colorType;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGColor::~SVGColor()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGRect\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-double SVGRect::getX()\r
-{\r
- return x;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGRect::setX(double val) throw (DOMException)\r
-{\r
- x = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGRect::getY()\r
-{\r
- return y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGRect::setY(double val) throw (DOMException)\r
-{\r
- y = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGRect::getWidth()\r
-{\r
- return width;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGRect::setWidth(double val) throw (DOMException)\r
-{\r
- width = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGRect::getHeight()\r
-{\r
- return height;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGRect::setHeight(double val) throw (DOMException)\r
-{\r
- height = val;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGRect::SVGRect()\r
-{\r
- x = y = width = height = 0.0;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGRect::SVGRect(const SVGRect &other)\r
-{\r
- x = other.x;\r
- y = other.y;\r
- width = other.width;\r
- height = other.height;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGRect::~SVGRect()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGPoint\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-double SVGPoint::getX()\r
-{\r
- return x;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPoint::setX(double val) throw (DOMException)\r
-{\r
- x = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPoint::getY()\r
-{\r
- return y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPoint::setY(double val) throw (DOMException)\r
-{\r
- y = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint SVGPoint::matrixTransform(const SVGMatrix &/*matrix*/)\r
-{\r
- SVGPoint point;\r
- return point;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint::SVGPoint()\r
-{\r
- x = y = 0;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint::SVGPoint(const SVGPoint &other)\r
-{\r
- x = other.x;\r
- y = other.y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint::~SVGPoint()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGUnitTypes\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGUnitTypes::SVGUnitTypes()\r
-{\r
-}\r
-\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGUnitTypes::~SVGUnitTypes()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGStylable\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString SVGStylable::getClassName()\r
-{\r
- return className;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-css::CSSStyleDeclaration SVGStylable::getStyle()\r
-{\r
- return style;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-css::CSSValue SVGStylable::getPresentationAttribute(const DOMString& /*name*/)\r
-{\r
- css::CSSValue val;\r
- //perform a lookup\r
- return val;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGStylable::SVGStylable()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGStylable::SVGStylable(const SVGStylable &other)\r
-{\r
- className = other.className;\r
- style = other.style;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGStylable::~SVGStylable()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGLocatable\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr SVGLocatable::getNearestViewportElement()\r
-{\r
- SVGElementPtr result;\r
- return result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr SVGLocatable::getFarthestViewportElement()\r
-{\r
- SVGElementPtr result;\r
- return result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGRect SVGLocatable::getBBox ()\r
-{\r
- return bbox;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix SVGLocatable::getCTM ()\r
-{\r
- return ctm;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix SVGLocatable::getScreenCTM ()\r
-{\r
- return screenCtm;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix SVGLocatable::getTransformToElement (const SVGElement &/*element*/)\r
- throw (SVGException)\r
-{\r
- SVGMatrix result;\r
- //do calculations\r
- return result;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGLocatable::SVGLocatable()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGLocatable::SVGLocatable(const SVGLocatable &/*other*/)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGLocatable::~SVGLocatable()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGTransformable\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedTransformList &SVGTransformable::getTransform()\r
-{\r
- return transforms;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGTransformable::SVGTransformable() {}\r
-\r
-/**\r
- *\r
- */\r
-SVGTransformable::SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)\r
-{\r
- transforms = other.transforms;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGTransformable::~SVGTransformable()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGTests\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGStringList &SVGTests::getRequiredFeatures()\r
-{\r
- return requiredFeatures;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGStringList &SVGTests::getRequiredExtensions()\r
-{\r
- return requiredExtensions;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGStringList &SVGTests::getSystemLanguage()\r
-{\r
- return systemLanguage;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-bool SVGTests::hasExtension (const DOMString& /*extension*/)\r
-{\r
- return false;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGTests::SVGTests()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGTests::SVGTests(const SVGTests &other)\r
-{\r
- requiredFeatures = other.requiredFeatures;\r
- requiredExtensions = other.requiredExtensions;\r
- systemLanguage = other.systemLanguage;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGTests::~SVGTests()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGLangSpace\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGLangSpace::getXmllang()\r
-{\r
- return xmlLang;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLangSpace::setXmllang(const DOMString &val) throw (DOMException)\r
-{\r
- xmlLang = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGLangSpace::getXmlspace()\r
-{\r
- return xmlSpace;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGLangSpace::setXmlspace(const DOMString &val)\r
- throw (DOMException)\r
-{\r
- xmlSpace = val;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGLangSpace::SVGLangSpace()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGLangSpace::SVGLangSpace(const SVGLangSpace &other)\r
-{\r
- xmlLang = other.xmlLang;\r
- xmlSpace = other.xmlSpace;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGLangSpace::~SVGLangSpace()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGExternalResourcesRequired\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedBoolean SVGExternalResourcesRequired::getExternalResourcesRequired()\r
-{\r
- return required;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGExternalResourcesRequired::SVGExternalResourcesRequired()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGExternalResourcesRequired::SVGExternalResourcesRequired(\r
- const SVGExternalResourcesRequired &other)\r
-{\r
- required = other.required;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGExternalResourcesRequired::~SVGExternalResourcesRequired() {}\r
-\r
-\r
-/*#########################################################################\r
-## SVGPreserveAspectRatio\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGPreserveAspectRatio::getAlign()\r
-{\r
- return align;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPreserveAspectRatio::setAlign(unsigned short val) throw (DOMException)\r
-{\r
- align = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGPreserveAspectRatio::getMeetOrSlice()\r
-{\r
- return meetOrSlice;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short val) throw (DOMException)\r
-{\r
- meetOrSlice = val;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGPreserveAspectRatio::SVGPreserveAspectRatio()\r
-{\r
- align = SVG_PRESERVEASPECTRATIO_UNKNOWN;\r
- meetOrSlice = SVG_MEETORSLICE_UNKNOWN;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)\r
-{\r
- align = other.align;\r
- meetOrSlice = other.meetOrSlice;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPreserveAspectRatio::~SVGPreserveAspectRatio()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGFitToViewBox\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedRect SVGFitToViewBox::getViewBox()\r
-{\r
- return viewBox;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedPreserveAspectRatio SVGFitToViewBox::getPreserveAspectRatio()\r
-{\r
- return preserveAspectRatio;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGFitToViewBox::SVGFitToViewBox()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-\r
-SVGFitToViewBox::SVGFitToViewBox(const SVGFitToViewBox &other)\r
-{\r
- viewBox = other.viewBox;\r
- preserveAspectRatio = other.preserveAspectRatio;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGFitToViewBox::~SVGFitToViewBox()\r
-{\r
-}\r
-\r
-/*#########################################################################\r
-## SVGZoomAndPan\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGZoomAndPan::getZoomAndPan()\r
-{\r
- return zoomAndPan;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGZoomAndPan::setZoomAndPan(unsigned short val) throw (DOMException)\r
-{\r
- zoomAndPan = val;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomAndPan::SVGZoomAndPan()\r
-{\r
- zoomAndPan = SVG_ZOOMANDPAN_UNKNOWN;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomAndPan::SVGZoomAndPan(const SVGZoomAndPan &other)\r
-{\r
- zoomAndPan = other.zoomAndPan;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomAndPan::~SVGZoomAndPan()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGViewSpec\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGTransformList SVGViewSpec::getTransform()\r
-{\r
- return transform;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr SVGViewSpec::getViewTarget()\r
-{\r
- return viewTarget;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGViewSpec::getViewBoxString()\r
-{\r
- DOMString ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGViewSpec::getPreserveAspectRatioString()\r
-{\r
- DOMString ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGViewSpec::getTransformString()\r
-{\r
- DOMString ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGViewSpec::getViewTargetString()\r
-{\r
- DOMString ret;\r
- return ret;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGViewSpec::SVGViewSpec()\r
-{\r
- viewTarget = NULL;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGViewSpec::SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other)\r
-{\r
- viewTarget = other.viewTarget;\r
- transform = other.transform;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGViewSpec::~SVGViewSpec()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGURIReference\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString SVGURIReference::getHref()\r
-{\r
- return href;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGURIReference::SVGURIReference()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGURIReference::SVGURIReference(const SVGURIReference &other)\r
-{\r
- href = other.href;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGURIReference::~SVGURIReference()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGCSSRule\r
-#########################################################################*/\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGRenderingIntent\r
-#########################################################################*/\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGPathSeg\r
-#########################################################################*/\r
-\r
-static const char *pathSegLetters[] =\r
-{\r
- '@', // PATHSEG_UNKNOWN,\r
- 'z', // PATHSEG_CLOSEPATH\r
- 'M', // PATHSEG_MOVETO_ABS\r
- 'm', // PATHSEG_MOVETO_REL,\r
- 'L', // PATHSEG_LINETO_ABS\r
- 'l', // PATHSEG_LINETO_REL\r
- 'C', // PATHSEG_CURVETO_CUBIC_ABS\r
- 'c', // PATHSEG_CURVETO_CUBIC_REL\r
- 'Q', // PATHSEG_CURVETO_QUADRATIC_ABS,\r
- 'q', // PATHSEG_CURVETO_QUADRATIC_REL\r
- 'A', // PATHSEG_ARC_ABS\r
- 'a', // PATHSEG_ARC_REL,\r
- 'H', // PATHSEG_LINETO_HORIZONTAL_ABS,\r
- 'h', // PATHSEG_LINETO_HORIZONTAL_REL\r
- 'V', // PATHSEG_LINETO_VERTICAL_ABS\r
- 'v', // PATHSEG_LINETO_VERTICAL_REL\r
- 'S', // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS\r
- 's', // PATHSEG_CURVETO_CUBIC_SMOOTH_REL\r
- 'T', // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS\r
- 't' // PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL\r
-};\r
-\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getPathSegType()\r
-{\r
- return type;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getPathSegTypeAsLetter()\r
-{\r
- int typ = type;\r
- if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)\r
- typ = PATHSEG_UNKNOWN;\r
- char const ch = pathSegLetters[typ];\r
- DOMString letter = ch;\r
- return letter;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getPathSegType()\r
-{\r
- return type;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getPathSegTypeAsLetter()\r
-{\r
- int typ = type;\r
- if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)\r
- typ = PATHSEG_UNKNOWN;\r
- char const *ch = pathSegLetters[typ];\r
- DOMString letter = ch;\r
- return letter;\r
-}\r
-\r
-/**\r
- * From the various subclasses\r
- */\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getX()\r
-{\r
- return x;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setX(double val) throw (DOMException)\r
-{\r
- x = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getX1()\r
-{\r
- return x;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setX1(double val) throw (DOMException)\r
-{\r
- x = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getX2()\r
-{\r
- return x;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setX2(double val) throw (DOMException)\r
-{\r
- x = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getY()\r
-{\r
- return y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setY(double val) throw (DOMException)\r
-{\r
- y = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getY1()\r
-{\r
- return y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setY1(double val) throw (DOMException)\r
-{\r
- y = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getY2()\r
-{\r
- return y;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setY2(double val) throw (DOMException)\r
-{\r
- y = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getR1()\r
-{\r
- return r1;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setR1(double val) throw (DOMException)\r
-{\r
- r1 = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getR2()\r
-{\r
- return r2;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setR2(double val) throw (DOMException)\r
-{\r
- r2 = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGPathSeg::getAngle()\r
-{\r
- return angle;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setAngle(double val) throw (DOMException)\r
-{\r
- angle = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-bool SVGPathSeg::getLargeArcFlag()\r
-{\r
- return largeArcFlag;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setLargeArcFlag(bool val) throw (DOMException)\r
-{\r
- largeArcFlag = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-bool SVGPathSeg::getSweepFlag()\r
-{\r
- return sweepFlag;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::setSweepFlag(bool val) throw (DOMException)\r
-{\r
- sweepFlag = val;\r
-}\r
-\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGPathSeg::SVGPathSeg()\r
-{\r
- init();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPathSeg::SVGPathSeg(const SVGPathSeg &other)\r
-{\r
- assign(other);\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPathSeg &operator=(const SVGPathSeg &other)\r
-{\r
- assign(other);\r
- return *this;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPathSeg::init()\r
-{\r
- type = PATHSEG_UNKNOWN;\r
- x = y = x1 = y1 = x2 = y2 = 0.0;\r
- r1 = r2 = 0.0;\r
- angle = 0.0;\r
- largeArcFlag = false;\r
- sweepFlag = false;\r
-}\r
- \r
-/**\r
- *\r
- */\r
-void SVGPathSeg::assign(const SVGPathSeg &other)\r
-{\r
- type = other.type;\r
- x = other.x;\r
- y = other.y;\r
- x1 = other.x1;\r
- y1 = other.y1;\r
- x2 = other.x2;\r
- y2 = other.y2;\r
- r1 = other.r1;\r
- r2 = other.r2;\r
- angle = other.angle;\r
- largeArcFlag = other.largeArcFlag;\r
- sweepFlag = other.sweepFlag;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGPathSeg::~SVGPathSeg()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGPaint\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGPaint::getPaintType()\r
-{ return paintType; }\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGPaint::getUri()\r
-{ return uri; }\r
-\r
-/**\r
- *\r
- */\r
-void SVGPaint::setUri(const DOMString& uriArg)\r
-{\r
- uri = uriArg;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGPaint::setPaint (unsigned short paintTypeArg,\r
- const DOMString& uriArg,\r
- const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw (SVGException)\r
-{\r
- paintType = paintTypeArg;\r
- uri = uriArg;\r
- //do something with rgbColor\r
- //do something with iccColor;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGPaint::SVGPaint()\r
-{\r
- uri = "";\r
- paintType = SVG_PAINTTYPE_UNKNOWN;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPaint::SVGPaint(const SVGPaint &other) : css::CSSValue(other), SVGColor(other)\r
-{\r
- uri = "";\r
- paintType = SVG_PAINTTYPE_UNKNOWN;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPaint::~SVGPaint() {}\r
-\r
-\r
-/*#########################################################################\r
-## SVGColorProfileRule\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGColorProfileRule::getSrc()\r
-{ return src; }\r
-\r
-/**\r
- *\r
- */\r
-void SVGColorProfileRule::setSrc(const DOMString &val) throw (DOMException)\r
-{ src = val; }\r
-\r
-/**\r
- *\r
- */\r
-DOMString SVGColorProfileRule::getName()\r
-{ return name; }\r
-\r
-/**\r
- *\r
- */\r
-void SVGColorProfileRule::setName(const DOMString &val) throw (DOMException)\r
-{ name = val; }\r
-\r
-/**\r
- *\r
- */\r
-unsigned short SVGColorProfileRule::getRenderingIntent()\r
-{ return renderingIntent; }\r
-\r
-/**\r
- *\r
- */\r
-void SVGColorProfileRule::setRenderingIntent(unsigned short val) throw (DOMException)\r
-{ renderingIntent = val; }\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGColorProfileRule::SVGColorProfileRule()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGColorProfileRule::SVGColorProfileRule(const SVGColorProfileRule &other)\r
- : SVGCSSRule(other), SVGRenderingIntent(other)\r
-{\r
- renderingIntent = other.renderingIntent;\r
- src = other.src;\r
- name = other.name;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGColorProfileRule::~SVGColorProfileRule()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGFilterPrimitiveStandardAttributes\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getX()\r
-{ return x; }\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getY()\r
-{ return y; }\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getWidth()\r
-{ return width; }\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getHeight()\r
-{ return height; }\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString SVGFilterPrimitiveStandardAttributes::getResult()\r
-{ return result; }\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(\r
- const SVGFilterPrimitiveStandardAttributes &other)\r
- : SVGStylable(other)\r
-{\r
- x = other.x;\r
- y = other.y;\r
- width = other.width;\r
- height = other.height;\r
- result = other.result;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGFilterPrimitiveStandardAttributes::~SVGFilterPrimitiveStandardAttributes()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGEvent\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGEvent:SVGEvent()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGEvent:SVGEvent(const SVGEvent &other) : events::Event(other)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGEvent::~SVGEvent()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGZoomEvent\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-SVGRect SVGZoomEvent::getZoomRectScreen()\r
-{\r
- return zoomRectScreen;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGZoomEvent::getPreviousScale()\r
-{\r
- return previousScale;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint SVGZoomEvent::getPreviousTranslate()\r
-{\r
- return previousTranslate;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double SVGZoomEvent::getNewScale()\r
-{\r
- return newScale;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGPoint SVGZoomEvent::getNewTranslate()\r
-{\r
- return newTranslate;\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomEvent::SVGZoomEvent()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomEvent::SVGZoomEvent(const SVGZoomEvent &other) :\r
- events::Event(other), events::UIEvent(other)\r
-{\r
- zoomRectScreen = other.zoomRectScreen;\r
- previousScale = other.previousScale;\r
- previousTranslate = other.previousTranslate;\r
- newScale = other.newScale;\r
- newTranslate = other.newTranslate;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGZoomEvent::~SVGZoomEvent()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGElementInstance\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr SVGElementInstance::getCorrespondingElement()\r
-{\r
- return correspondingElement;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGUseElementPtr SVGElementInstance::getCorrespondingUseElement()\r
-{\r
- return correspondingUseElement;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstance::getParentNode()\r
-{\r
- SVGElementInstance ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- * Since we are using stack types and this is a circular definition,\r
- * we will instead implement this as a global function below:\r
- * SVGElementInstanceList getChildNodes(const SVGElementInstance instance);\r
- */\r
-//SVGElementInstanceList getChildNodes();\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstance::getFirstChild()\r
-{\r
- SVGElementInstance ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstance::getLastChild()\r
-{\r
- SVGElementInstance ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstance::getPreviousSibling()\r
-{\r
- SVGElementInstance ret;\r
- return ret;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstance::getNextSibling()\r
-{\r
- SVGElementInstance ret;\r
- return ret;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance::SVGElementInstance()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance::SVGElementInstance(const SVGElementInstance &other)\r
- : events::EventTarget(other)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance::~SVGElementInstance()\r
-{\r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGElementInstanceList\r
-#########################################################################*/\r
-\r
-/**\r
- *\r
- */\r
-unsigned long SVGElementInstanceList::getLength()\r
-{ return items.size(); }\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstance SVGElementInstanceList::item(unsigned long index)\r
-{\r
- if (index >= items.size())\r
- {\r
- SVGElementInstance ret;\r
- return ret;\r
- }\r
- return items[index];\r
-}\r
-\r
-/**\r
- * This static method replaces the circular definition of:\r
- * SVGElementInstanceList SVGElementInstance::getChildNodes()\r
- *\r
- */\r
-static SVGElementInstanceList SVGElementInstanceList::getChildNodes(const SVGElementInstance &/*instance*/)\r
-{\r
- SVGElementInstanceList list;\r
- return list;\r
-}\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstanceList::SVGElementInstanceList()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstanceList::SVGElementInstanceList(const SVGElementInstanceList &other)\r
-{\r
- items = other.items;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementInstanceList::~SVGElementInstanceList()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGValue\r
-#########################################################################*/\r
-\r
-/**\r
- * Constructor\r
- */\r
-SVGValue()\r
-{\r
- init();\r
-}\r
-\r
-/**\r
- * Copy constructor\r
- */\r
-SVGValue(const SVGValue &other)\r
-{\r
- assign(other);\r
-}\r
-\r
-/**\r
- * Assignment\r
- */\r
-SVGValue &operator=(const SVGValue &other)\r
-{\r
- assign(other);\r
- return *this;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-~SVGValue()\r
-{\r
-}\r
-\r
-//###########################\r
-// TYPES\r
-//###########################\r
-\r
-/**\r
- * Angle\r
- */\r
-SVGValue::SVGValue(const SVGAngle &v)\r
-{\r
- type = SVG_ANGLE;\r
- angleval = v;\r
-}\r
-\r
-SVGAngle SVGValue::angleValue()\r
-{\r
- return algleval;\r
-}\r
-\r
-/**\r
- * Boolean\r
- */\r
-SVGValue::SVGValue(bool v)\r
-{\r
- type = SVG_BOOLEAN;\r
- bval = v;\r
-}\r
-\r
-bool SVGValue::booleanValue()\r
-{\r
- return bval;\r
-}\r
-\r
-\r
-/**\r
- * Enumeration\r
- */\r
-SVGValue::SVGValue(short v)\r
-{\r
- type = SVG_ENUMERATION;\r
- eval = v;\r
-}\r
-\r
-short SVGValue::enumerationValue()\r
-{\r
- return eval;\r
-}\r
-\r
-/**\r
- * Integer\r
- */\r
-SVGValue::SVGValue(long v)\r
-{\r
- type = SVG_INTEGER;\r
- ival = v;\r
-}\r
-\r
-long SVGValue::integerValue()\r
-{\r
- return ival;\r
-}\r
-\r
-/**\r
- * Length\r
- */\r
-SVGValue::SVGValue(const SVGLength &v)\r
-{\r
- type = SVG_LENGTH;\r
- lengthval = v;\r
-}\r
-\r
-SVGLength SVGValue::lengthValue()\r
-{\r
- return lengthval;\r
-}\r
-\r
-/**\r
- * Number\r
- */\r
-SVGValue::SVGValue(double v)\r
-{\r
- type = SVG_NUMBER;\r
- dval = v;\r
-}\r
-\r
-double SVGValue::numberValue()\r
-{\r
- return dval;\r
-}\r
-\r
-/**\r
- * Points\r
- */\r
-SVGValue::SVGValue(const SVGPointList &v)\r
-{\r
- type = SVG_POINTS;\r
- plistval = v;\r
-}\r
-\r
-SVGPointList SVGValue::pointListValue()\r
-{\r
- return plistval;\r
-}\r
-\r
-\r
-/**\r
- * PreserveAspectRatio\r
- */\r
-SVGValue::SVGValue(const SVGPreserveAspectRatio &v)\r
-{\r
- type = SVG_PRESERVE_ASPECT_RATIO;\r
- parval = v;\r
-}\r
-\r
-SVGPreserveAspectRatio SVGValue::preserveAspectRatioValue()\r
-{\r
- return parval;\r
-}\r
-\r
-/**\r
- * Rect\r
- */\r
-SVGValue::SVGValue(const SVGRect &v)\r
-{\r
- type = SVG_RECT;\r
- rectval = v;\r
-}\r
-\r
-SVGRect SVGValue::rectValue()\r
-{\r
- return rectval;\r
-}\r
-\r
-/**\r
- * String\r
- */\r
-SVGValue::SVGValue(const DOMString &v)\r
-{\r
- type = SVG_STRING;\r
- sval = v;\r
-}\r
-\r
-DOMString SVGValue::stringValue()\r
-{\r
- return sval;\r
-}\r
-\r
-\r
-void SVGValue::init()\r
-{\r
- type = SVG_NUMBER;\r
- bval = false; \r
- eval = 0; \r
- ival = 0; \r
- dval = 0.0; \r
-}\r
-\r
-void SVGValue::assign(const SVGValue &other)\r
-{\r
- type = other.type; \r
- angleval = other.angleval; \r
- bval = other.bval; \r
- eval = other.eval; \r
- ival = other.ival; \r
- lengthval = other.lengthval; \r
- dval = other.dval; \r
- parval = other.parval; \r
- rval = other.rval; \r
- sval = other.sval; \r
-}\r
-\r
-\r
-/*#########################################################################\r
-## SVGTransformList\r
-#########################################################################*/\r
-\r
-\r
-/*#########################################################################\r
-## SVGStringList\r
-#########################################################################*/\r
-\r
-\r
-/*#########################################################################\r
-## SVGNumberList\r
-#########################################################################*/\r
-\r
-\r
-/*#########################################################################\r
-## SVGLengthList\r
-#########################################################################*/\r
-\r
-\r
-/*#########################################################################\r
-## SVGPointList\r
-#########################################################################*/\r
-\r
-/*#########################################################################\r
-## SVGPathSegList\r
-#########################################################################*/\r
-\r
-/*#########################################################################\r
-## SVGValueList\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned long SVGValueList::getNumberOfItems()\r
-{\r
- return items.size();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGValueList::clear() throw (DOMException)\r
-{\r
- items.clear();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::initialize(const SVGValue& newItem)\r
- throw (DOMException, SVGException)\r
-{\r
- items.clear();\r
- items.push_back(newItem);\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::getItem(unsigned long index) throw (DOMException)\r
-{\r
- if (index >= items.size())\r
- return "";\r
- return items[index];\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::insertItemBefore(const SVGValue& newItem,\r
- unsigned long index)\r
- throw (DOMException, SVGException)\r
-{\r
- if (index>=items.size())\r
- {\r
- items.push_back(newItem);\r
- }\r
- else\r
- {\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- items.insert(iter, newItem);\r
- }\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::replaceItem (const SVGValue& newItem,\r
- unsigned long index)\r
- throw (DOMException, SVGException)\r
-{\r
- if (index>=items.size())\r
- return "";\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- *iter = newItem;\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::removeItem (unsigned long index)\r
- throw (DOMException)\r
-{\r
- if (index>=items.size())\r
- return "";\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- SVGValue oldval = *iter;\r
- items.erase(iter);\r
- return oldval;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGValueList::appendItem (const SVGValue& newItem)\r
- throw (DOMException, SVGException)\r
-{\r
- items.push_back(newItem);\r
- return newItem;\r
-}\r
-\r
-\r
-/**\r
- * Matrix\r
- */\r
-SVGValue SVGValueList::createSVGTransformFromMatrix(const SVGValue &matrix)\r
-{\r
-}\r
-\r
-/**\r
- * Matrix\r
- */\r
-SVGValue SVGValueList::consolidate()\r
-{\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList::SVGValueList()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList::SVGValueList(const SVGValueList &other)\r
-{\r
- items = other.items;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList::~SVGValueList()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGAnimatedValue\r
-#########################################################################*/\r
-\r
-\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGValue &SVGAnimatedValue::getBaseVal()\r
-{\r
- return baseVal;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGAnimatedValue::setBaseVal(const SVGValue &val) throw (DOMException)\r
-{\r
- baseVal = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue &SVGAnimatedValue::getAnimVal()\r
-{\r
- return animVal;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue::SVGAnimatedValue()\r
-{\r
- init();\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue::SVGAnimatedValue(const SVGValue &v)\r
-{\r
- init();\r
- baseVal = v;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue::SVGAnimatedValue(const SVGValue &bv, const SVGValue &av)\r
-{\r
- init();\r
- baseVal = bv;\r
- animVal = av;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue::SVGAnimatedValue(const SVGAnimatedValue &other)\r
-{\r
- assign(other);\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue &SVGAnimatedValue::operator=(const SVGAnimatedValue &other)\r
-{\r
- assign(other);\r
- return *this;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue &SVGAnimatedValue::operator=(const SVGValue &bv)\r
-{\r
- init();\r
- baseVal = bv;\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue::~SVGAnimatedValue()\r
-{\r
-}\r
-\r
-\r
-\r
-void SVGAnimatedValue::init()\r
-{\r
-}\r
-\r
-\r
-void SVGAnimatedValue::assign(const SVGAnimatedValue &other)\r
-{\r
- baseVal = other.baseVal;\r
- animVal = other.animVal;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-//# D O M\r
-//########################################################################\r
-//########################################################################\r
-//########################################################################\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGElement\r
-#########################################################################*/\r
-\r
-\r
-//####################################################################\r
-//# BASE METHODS FOR SVGElement\r
-//####################################################################\r
-\r
-/**\r
- * Get the value of the id attribute on the given element.\r
- */\r
-DOMString getId()\r
-{\r
-}\r
-\r
-/**\r
- * Set the value of the id attribute on the given element.\r
- */\r
-void setId(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute xml:base on the given element.\r
- */\r
-DOMString getXmlBase()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute xml:base on the given element.\r
- */\r
-void setXmlBase(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * The nearest ancestor 'svg' element. Null if the given element is the\r
- * outermost 'svg' element.\r
- */\r
-SVGElementPtr getOwnerSVGElement()\r
-{\r
-}\r
-\r
-/**\r
- * The element which established the current viewport. Often, the nearest\r
- * ancestor 'svg' element. Null if the given element is the outermost 'svg'\r
- * element.\r
- */\r
-SVGElementPtr getViewportElement()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//####################################################################\r
-//# I N T E R F A C E S\r
-//####################################################################\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGAngle \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getUnitType()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getValue()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValue(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getValueInSpecifiedUnits()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValueInSpecifiedUnits(double /*val*/) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getValueAsString()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValueAsString(const DOMString &/*val*/) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void newValueSpecifiedUnits(unsigned short /*unitType*/,\r
- double /*valueInSpecifiedUnits*/)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void convertToSpecifiedUnits(unsigned short /*unitType*/)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//## The following animated types are rolled up into a single\r
-//## SVGAnimatedValue interface\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedAngle\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedBoolean\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedEnumeration\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedInteger\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedLength\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedLengthList\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedNumber\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedNumberList\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedPathData\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedPoints\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedPreserveAspectRatio\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedRect\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedString\r
-//####################################################################\r
-\r
-//####################################################################\r
-//## SVGAnimatedTransformList\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGAnimatedValue \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGValue &getBaseVal()\r
-{\r
- return baseVal();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setBaseVal(const SVGValue &val) throw (DOMException)\r
-{\r
- baseVal = val;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue &getAnimVal()\r
-{\r
- return animVal;\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGColor \r
-//####################################################################\r
-\r
-/**\r
- * From CSSValue \r
- * A code defining the type of the value as defined above.\r
- */\r
-unsigned short getCssValueType()\r
-{\r
-}\r
-\r
-/**\r
- * From CSSValue \r
- * A string representation of the current value.\r
- */\r
-DOMString getCssText()\r
-{\r
-}\r
-\r
-/**\r
- * From CSSValue \r
- * A string representation of the current value.\r
- * Note that setting implies parsing. \r
- */\r
-void setCssText(const DOMString &val) throw (dom::DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getColorType()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-css::RGBColor getRgbColor()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGICCColor getIccColor()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void setRGBColor(const DOMString& /*rgbColor*/) throw (SVGException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setRGBColorICCColor(const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setColor(unsigned short /*colorType*/,\r
- const DOMString& /*rgbColor*/,\r
- const DOMString& /*iccColor*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGCSSRule \r
-//####################################################################\r
-\r
-/**\r
- * From CSSRule \r
- * The type of the rule, as defined above. The expectation is that \r
- * binding-specific casting methods can be used to cast down from an instance of \r
- * the CSSRule interface to the specific derived interface implied by the type.\r
- */\r
-unsigned short getType()\r
-{\r
-}\r
-\r
-/**\r
- * From CSSRule \r
- * The parsable textual representation of the rule. This reflects the current \r
- * state of the rule and not its initial value.\r
- */\r
-DOMString getCssText()\r
-{\r
-}\r
-\r
-/**\r
- * From CSSRule \r
- * The parsable textual representation of the rule. This reflects the current \r
- * state of the rule and not its initial value.\r
- * Note that setting involves reparsing. \r
- */\r
-void setCssText(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * From CSSRule \r
- * The style sheet that contains this rule.\r
- */\r
-css::CSSStyleSheet *getParentStyleSheet()\r
-{\r
-}\r
-\r
-/**\r
- * From CSSRule \r
- * If this rule is contained inside another rule(e.g. a style rule inside an \r
- * @media block), this is the containing rule. If this rule is not nested inside \r
- * any other rules, this returns null.\r
- */\r
-css::CSSRule *getParentRule()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGExternalResourcesRequired\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedBoolean getExternalResourcesRequired()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGFitToViewBox \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedRect getViewBox()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGICCColor \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-DOMString getColorProfile()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setColorProfile(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGNumberList &getColors()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGLangSpace \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-DOMString getXmllang()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setXmllang(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getXmlspace()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setXmlspace(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGLength \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getUnitType()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getValue()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValue(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getValueInSpecifiedUnits()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValueInSpecifiedUnits(double /*val*/) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getValueAsString()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValueAsString(const DOMString& /*val*/) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void newValueSpecifiedUnits(unsigned short /*unitType*/, double /*val*/)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void convertToSpecifiedUnits(unsigned short /*unitType*/)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//## SVGLengthList - see SVGValueList\r
-//####################################################################\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGLocatable \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr getNearestViewportElement()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGElement *getFarthestViewportElement()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGRect getBBox()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix getCTM()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix getScreenCTM()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGMatrix getTransformToElement(const SVGElement &/*element*/)\r
- throw (SVGException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGNumber \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-double getValue()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setValue(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGNumberList - see SVGValueList \r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGRect \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-double getX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setX(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getY()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setY(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getWidth()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setWidth(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getHeight()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setHeight(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGRenderingIntent \r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGStringList - see SVGValueList\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGStylable \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getClassName()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-css::CSSStyleDeclaration getStyle()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-css::CSSValue getPresentationAttribute(const DOMString& /*name*/)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGTests \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList &getRequiredFeatures()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList &getRequiredExtensions()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValueList &getSystemLanguage()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-bool hasExtension(const DOMString& /*extension*/)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGTransformable \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedList &getTransform()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGUnitTypes \r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGURIReference \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedValue getHref()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//## SVGValueList - consolidation of other lists\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-unsigned long SVGElement::getNumberOfItems()\r
-{\r
- return items.size();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void SVGElement::clear() throw (DOMException)\r
-{\r
- items.clear();\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::initialize(const SVGValue& newItem)\r
- throw (DOMException, SVGException)\r
-{\r
- items.clear();\r
- items.push_back(newItem);\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::getItem(unsigned long index) throw (DOMException)\r
-{\r
- if (index >= items.size())\r
- return "";\r
- return items[index];\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::insertItemBefore(const SVGValue& newItem,\r
- unsigned long index)\r
- throw (DOMException, SVGException)\r
-{\r
- if (index>=items.size())\r
- {\r
- items.push_back(newItem);\r
- }\r
- else\r
- {\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- items.insert(iter, newItem);\r
- }\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::replaceItem (const SVGValue& newItem,\r
- unsigned long index)\r
- throw (DOMException, SVGException)\r
-{\r
- if (index>=items.size())\r
- return "";\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- *iter = newItem;\r
- return newItem;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::removeItem (unsigned long index)\r
- throw (DOMException)\r
-{\r
- if (index>=items.size())\r
- return "";\r
- std::vector<SVGValue>::iterator iter = items.begin() + index;\r
- SVGValue oldval = *iter;\r
- items.erase(iter);\r
- return oldval;\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGValue SVGElement::appendItem (const SVGValue& newItem)\r
- throw (DOMException, SVGException)\r
-{\r
- items.push_back(newItem);\r
- return newItem;\r
-}\r
-\r
-\r
-/**\r
- * Matrix\r
- */\r
-SVGValue SVGElement::createSVGTransformFromMatrix(const SVGValue &matrix)\r
-{\r
-}\r
-\r
-/**\r
- * Matrix\r
- */\r
-SVGValue SVGElement::consolidate()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGViewSpec \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-//SVGTransformList getTransform()\r
-//{\r
-//}\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr getViewTarget()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getViewBoxString()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getPreserveAspectRatioString()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getTransformString()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-DOMString getViewTargetString()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGZoomAndPan \r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-unsigned short getZoomAndPan()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setZoomAndPan(unsigned short val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//####################################################################\r
-//# E L E M E N T S\r
-//####################################################################\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGAElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getTarget()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGAltGlyphElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Get the attribute glyphRef on the given element.\r
- */\r
-DOMString getGlyphRef()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute glyphRef on the given element.\r
- */\r
-void setGlyphRef(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute format on the given element.\r
- */\r
-DOMString getFormat()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute format on the given element.\r
- */\r
-void setFormat(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGAltGlyphDefElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGAltGlyphItemElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGAnimateElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGAnimateColorElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGAnimateMotionElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGAnimateTransformElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGAnimationElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGElementPtr getTargetElement()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getStartTime()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getCurrentTime()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-double getSimpleDuration() throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGCircleElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute cx on the given 'circle' element.\r
- */\r
-SVGAnimatedLength getCx()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute cy on the given 'circle' element.\r
- */\r
-SVGAnimatedLength getCy()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute r on the given 'circle' element.\r
- */\r
-SVGAnimatedLength getR()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGClipPathElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute clipPathUnits on the given 'clipPath' element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getClipPathUnits()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGColorProfileElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Get the attribute local on the given element.\r
- */\r
-DOMString getLocal()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute local on the given element.\r
- */\r
-void setLocal(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute name on the given element.\r
- */\r
-DOMString getName()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute name on the given element.\r
- */\r
-void setName(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute rendering-intent on the given element.\r
- * The type of rendering intent, identified by one of the\r
- * SVGRenderingIntent constants.\r
- */\r
-unsigned short getRenderingIntent()\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute rendering-intent on the given element.\r
- */\r
-void setRenderingIntent(unsigned short val) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGComponentTransferFunctionElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute type on the given element. Takes one\r
- * of the Component Transfer Types.\r
- */\r
-SVGAnimatedEnumeration getType()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute tableValues on the given element.\r
- */\r
-SVGAnimatedNumberList getTableValues()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute slope on the given element.\r
- */\r
-SVGAnimatedNumber getSlope()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute intercept on the given element.\r
- */\r
-SVGAnimatedNumber getIntercept()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute amplitude on the given element.\r
- */\r
-SVGAnimatedNumber getAmplitude()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute exponent on the given element.\r
- */\r
-SVGAnimatedNumber getExponent()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute offset on the given element.\r
- */\r
-SVGAnimatedNumber getOffset()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGCursorElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGDefinitionSrcElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGDefsElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGDescElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGEllipseElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute cx on the given 'ellipse' element.\r
- */\r
-SVGAnimatedLength getCx()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute cy on the given 'ellipse' element.\r
- */\r
-SVGAnimatedLength getCy()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute rx on the given 'ellipse' element.\r
- */\r
-SVGAnimatedLength getRx()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute ry on the given 'ellipse' element.\r
- */\r
-SVGAnimatedLength getRy()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEBlendElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute in on the given 'feBlend' element.\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute in2 on the given 'feBlend' element.\r
- */\r
-SVGAnimatedString getIn2()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute mode on the given 'feBlend' element.\r
- * Takes one of the Blend Mode Types.\r
- */\r
-SVGAnimatedEnumeration getMode()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEColorMatrixElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute in on the given 'feColorMatrix' element.\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute type on the given 'feColorMatrix' element.\r
- * Takes one of the Color Matrix Types.\r
- */\r
-SVGAnimatedEnumeration getType()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute values on the given 'feColorMatrix' element.\r
- * Provides access to the contents of the values attribute.\r
- */\r
-SVGAnimatedNumberList getValues()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEComponentTransferElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute in on the given 'feComponentTransfer' element.\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGFECompositeElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute in on the given 'feComposite' element.\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute in2 on the given 'feComposite' element.\r
- */\r
-SVGAnimatedString getIn2()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute operator on the given 'feComposite' element.\r
- * Takes one of the Composite Operators.\r
- */\r
-SVGAnimatedEnumeration getOperator()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute k1 on the given 'feComposite' element.\r
- */\r
-SVGAnimatedNumber getK1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute k2 on the given 'feComposite' element.\r
- */\r
-SVGAnimatedNumber getK2()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute k3 on the given 'feComposite' element.\r
- */\r
-SVGAnimatedNumber getK3()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute k4 on the given 'feComposite' element.\r
- */\r
-SVGAnimatedNumber getK4()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEConvolveMatrixElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute order on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedInteger getOrderX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute order on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedInteger getOrderY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute kernelMatrix on the given element.\r
- */\r
-SVGAnimatedNumberList getKernelMatrix()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute divisor on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedNumber getDivisor()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute bias on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedNumber getBias()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute targetX on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedInteger getTargetX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute targetY on the given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedInteger getTargetY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute edgeMode on the given 'feConvolveMatrix'\r
- * element. Takes one of the Edge Mode Types.\r
- */\r
-SVGAnimatedEnumeration getEdgeMode()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute kernelUnitLength on the\r
- * given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedLength getKernelUnitLengthX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedLength getKernelUnitLengthY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute preserveAlpha on the\r
- * given 'feConvolveMatrix' element.\r
- */\r
-SVGAnimatedBoolean getPreserveAlpha()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGFEDiffuseLightingElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute in on the given 'feDiffuseLighting' element.\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute surfaceScale on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
-SVGAnimatedNumber getSurfaceScale()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute diffuseConstant on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
-SVGAnimatedNumber getDiffuseConstant()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
-SVGAnimatedNumber getKernelUnitLengthX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute kernelUnitLength on the given\r
- * 'feDiffuseLighting' element.\r
- */\r
-SVGAnimatedNumber getKernelUnitLengthY()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGFEDisplacementMapElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn2()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getScale()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedEnumeration getXChannelSelector()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedEnumeration getYChannelSelector()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGFEDistantLightElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute azimuth on the given 'feDistantLight' element.\r
- */\r
-SVGAnimatedNumber getAzimuth()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute elevation on the given 'feDistantLight'\r
- * element\r
- */\r
-SVGAnimatedNumber getElevation()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEFloodElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEFuncAElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFEFuncBElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFEFuncGElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFEFuncRElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGFEGaussianBlurElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getStdDeviationX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getStdDeviationY()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-void setStdDeviation(double stdDeviationX, double stdDeviationY)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEImageElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGFEMergeElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFEMergeNodeElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFEMorphologyElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedEnumeration getOperator()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getRadiusX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getRadiusY()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGFEOffsetElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getDx()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getDy()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFEPointLightElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'fePointLight' element.\r
- */\r
-SVGAnimatedNumber getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'fePointLight' element.\r
- */\r
-SVGAnimatedNumber getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute z on the given 'fePointLight' element.\r
- */\r
-SVGAnimatedNumber getZ()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGFESpecularLightingElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getSurfaceScale()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getSpecularConstant()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getSpecularExponent()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFESpotLightElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute z on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getZ()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute pointsAtX on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getPointsAtX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute pointsAtY on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getPointsAtY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute pointsAtZ on the given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getPointsAtZ()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute specularExponent on the\r
- * given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getSpecularExponent()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute limitingConeAngle on the\r
- * given 'feSpotLight' element.\r
- */\r
-SVGAnimatedNumber getLimitingConeAngle()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFETileElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedString getIn1()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFETurbulenceElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getBaseFrequencyX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getBaseFrequencyY()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedInteger getNumOctaves()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedNumber getSeed()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedEnumeration getStitchTiles()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedEnumeration getType()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGFilterElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute filterUnits on the given 'filter' element. Takes one\r
- * of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getFilterUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute primitiveUnits on the given 'filter' element. Takes\r
- * one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getPrimitiveUnits()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'filter' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'filter' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'filter' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute filterRes on the given 'filter' element.\r
- * Contains the X component of attribute filterRes.\r
- */\r
-SVGAnimatedInteger getFilterResX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute filterRes on the given 'filter' element.\r
- * Contains the Y component(possibly computed automatically)\r
- * of attribute filterRes.\r
- */\r
-SVGAnimatedInteger getFilterResY()\r
-{\r
-}\r
-\r
-/**\r
- * Sets the values for attribute filterRes.\r
- */\r
-void setFilterRes(unsigned long filterResX, unsigned long filterResY)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGFontElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFontFaceElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFontFaceFormatElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFontFaceNameElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFontFaceSrcElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGFontFaceUriElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGForeignObjectElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGGlyphRefElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Get the attribute glyphRef on the given element.\r
- */\r
-DOMString getGlyphRef()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute glyphRef on the given element.\r
- */\r
-void setGlyphRef(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute format on the given element.\r
- */\r
-DOMString getFormat()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute format on the given element.\r
- */\r
-void setFormat(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute x on the given element.\r
- */\r
-double getX()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute x on the given element.\r
- */\r
-void setX(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute y on the given element.\r
- */\r
-double getY()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute y on the given element.\r
- */\r
-void setY(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute dx on the given element.\r
- */\r
-double getDx()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute dx on the given element.\r
- */\r
-void setDx(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute dy on the given element.\r
- */\r
-double getDy()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute dy on the given element.\r
- */\r
-void setDy(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGGradientElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute gradientUnits on the given element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getGradientUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute gradientTransform on the given element.\r
- */\r
-SVGAnimatedTransformList getGradientTransform()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute spreadMethod on the given element.\r
- * One of the Spread Method Types.\r
- */\r
-SVGAnimatedEnumeration getSpreadMethod()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGHKernElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGImageElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'image' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'image' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'image' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'image' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute preserveAspectRatio on the given element.\r
- */\r
-SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGLinearGradientElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x1 on the given 'linearGradient' element.\r
- */\r
-SVGAnimatedLength getX1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y1 on the given 'linearGradient' element.\r
- */\r
-SVGAnimatedLength getY1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute x2 on the given 'linearGradient' element.\r
- */\r
-SVGAnimatedLength getX2()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y2 on the given 'linearGradient' element.\r
- */\r
-SVGAnimatedLength getY2()\r
-{\r
-}\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGLineElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x1 on the given 'line' element.\r
- */\r
-SVGAnimatedLength getX1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y1 on the given 'line' element.\r
- */\r
-SVGAnimatedLength getY1()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute x2 on the given 'line' element.\r
- */\r
-SVGAnimatedLength getX2()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y2 on the given 'line' element.\r
- */\r
-SVGAnimatedLength getY2()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGMarkerElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute refX on the given 'marker' element.\r
- */\r
-SVGAnimatedLength getRefX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute refY on the given 'marker' element.\r
- */\r
-SVGAnimatedLength getRefY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute markerUnits on the given 'marker' element.\r
- * One of the Marker Units Types defined above.\r
- */\r
-SVGAnimatedEnumeration getMarkerUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute markerWidth on the given 'marker' element.\r
- */\r
-SVGAnimatedLength getMarkerWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute markerHeight on the given 'marker' element.\r
- */\r
-SVGAnimatedLength getMarkerHeight()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute orient on the given 'marker' element.\r
- * One of the Marker Orientation Types defined above.\r
- */\r
-SVGAnimatedEnumeration getOrientType()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute orient on the given 'marker' element.\r
- * If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for\r
- * attribute orient ; otherwise, it will be set to zero.\r
- */\r
-SVGAnimatedAngle getOrientAngle()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Sets the value of attribute orient to 'auto'.\r
- */\r
-void setOrientToAuto()\r
-{\r
-}\r
-\r
-/**\r
- * Sets the value of attribute orient to the given angle.\r
- */\r
-void setOrientToAngle(const SVGAngle &angle)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGMaskElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute maskUnits on the given 'mask' element. Takes one of\r
- * the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getMaskUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute maskContentUnits on the given 'mask' element. Takes\r
- * one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getMaskContentUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'mask' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'mask' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'mask' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'mask' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGMetadataElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGMissingGlyphElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGMPathElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGPathElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute pathLength on the given 'path' element.\r
- */\r
-SVGAnimatedNumber getPathLength()\r
-{\r
-}\r
-\r
-/**\r
- * Returns the user agent's computed value for the total length of the path using\r
- * the user agent's distance-along-a-path algorithm, as a distance in the current\r
- * user coordinate system.\r
- */\r
-double getTotalLength()\r
-{\r
-}\r
-\r
-/**\r
- * Returns the(x,y) coordinate in user space which is distance units along the\r
- * path, utilizing the user agent's distance-along-a-path algorithm.\r
- */\r
-SVGPoint getPointAtLength(double distance)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the index into pathSegList which is distance units along the path,\r
- * utilizing the user agent's distance-along-a-path algorithm.\r
- */\r
-unsigned long getPathSegAtLength(double distance)\r
-{\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegClosePath object.\r
- */\r
-SVGPathSeg createSVGPathSegClosePath()\r
-{\r
- SVGPathSeg seg(PATHSEG_CLOSEPATH);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegMovetoAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegMovetoAbs(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_MOVETO_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegMovetoRel object.\r
- */\r
-SVGPathSeg createSVGPathSegMovetoRel(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_MOVETO_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoAbs(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoRel object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoRel(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoCubicAbs(double x, double y,\r
- double x1, double y1, double x2, double y2)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX1(x1);\r
- seg.setY1(y1);\r
- seg.setX2(x2);\r
- seg.setY2(y2);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoCubicRel(double x, double y,\r
- double x1, double y1, double x2, double y2)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX1(x1);\r
- seg.setY1(y1);\r
- seg.setX2(x2);\r
- seg.setY2(y2);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoQuadraticAbs(double x, double y,\r
- double x1, double y1)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX1(x1);\r
- seg.setY1(y1);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoQuadraticRel(double x, double y,\r
- double x1, double y1)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX1(x1);\r
- seg.setY1(y1);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegArcAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegArcAbs(double x, double y,\r
- double r1, double r2, double angle,\r
- bool largeArcFlag, bool sweepFlag)\r
-{\r
- SVGPathSeg seg(PATHSEG_ARC_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setR1(r1);\r
- seg.setR2(r2);\r
- seg.setAngle(angle);\r
- seg.setLargeArcFlag(largeArcFlag);\r
- seg.setSweepFlag(sweepFlag);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegArcRel object.\r
- */\r
-SVGPathSeg createSVGPathSegArcRel(double x, double y, double r1,\r
- double r2, double angle, bool largeArcFlag,\r
- bool sweepFlag)\r
-{\r
- SVGPathSeg seg(PATHSEG_ARC_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setR1(r1);\r
- seg.setR2(r2);\r
- seg.setAngle(angle);\r
- seg.setLargeArcFlag(largeArcFlag);\r
- seg.setSweepFlag(sweepFlag);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoHorizontalAbs(double x)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_HORIZONTAL_ABS);\r
- seg.setX(x);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoHorizontalRel(double x)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_HORIZONTAL_REL);\r
- seg.setX(x);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoVerticalAbs(double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_VERTICAL_ABS);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.\r
- */\r
-SVGPathSeg createSVGPathSegLinetoVerticalRel(double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_LINETO_VERTICAL_REL);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoCubicSmoothAbs(double x, double y,\r
- double x2, double y2)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_SMOOTH_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX2(x2);\r
- seg.setY2(y2);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoCubicSmoothRel(double x, double y,\r
- double x2, double y2)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_SMOOTH_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- seg.setX2(x2);\r
- seg.setY2(y2);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs\r
- * object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-/**\r
- * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel\r
- * object.\r
- */\r
-SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y)\r
-{\r
- SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);\r
- seg.setX(x);\r
- seg.setY(y);\r
- return seg;\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGPatternElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute patternUnits on the given 'pattern' element.\r
- * Takes one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getPatternUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute patternContentUnits on the given 'pattern'\r
- * element. Takes one of the constants defined in SVGUnitTypes.\r
- */\r
-SVGAnimatedEnumeration getPatternContentUnits()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute patternTransform on the given 'pattern' element.\r
- */\r
-SVGAnimatedTransformList getPatternTransform()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'pattern' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'pattern' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'pattern' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGPolyLineElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGPolygonElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGRadialGradientElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute cx on the given 'radialGradient' element.\r
- */\r
-SVGAnimatedLength getCx()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute cy on the given 'radialGradient' element.\r
- */\r
-SVGAnimatedLength getCy()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute r on the given 'radialGradient' element.\r
- */\r
-SVGAnimatedLength getR()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute fx on the given 'radialGradient' element.\r
- */\r
-SVGAnimatedLength getFx()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute fy on the given 'radialGradient' element.\r
- */\r
-SVGAnimatedLength getFy()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGRectElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute rx on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getRx()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute ry on the given 'rect' element.\r
- */\r
-SVGAnimatedLength getRy()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGScriptElement\r
-//####################################################################\r
-\r
-/**\r
- *\r
- */\r
-DOMString getType()\r
-{\r
-}\r
-\r
-/**\r
- *\r
- */\r
-void setType(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGSetElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGStopElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute offset on the given 'stop' element.\r
- */\r
-SVGAnimatedNumber getOffset()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGStyleElement\r
-//####################################################################\r
-\r
-/**\r
- * Get the attribute xml:space on the given element.\r
- */\r
-DOMString getXmlspace()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute xml:space on the given element.\r
- */\r
-void setXmlspace(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute type on the given 'style' element.\r
- */\r
-DOMString getType()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute type on the given 'style' element.\r
- */\r
-void setType(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute media on the given 'style' element.\r
- */\r
-DOMString getMedia()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute media on the given 'style' element.\r
- */\r
-void setMedia(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute title on the given 'style' element.\r
- */\r
-DOMString getTitle()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute title on the given 'style' element.\r
- */\r
-void setTitle(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-//####################################################################\r
-//# SVGSymbolElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGSVGElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'svg' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'svg' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'svg' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'svg' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-/**\r
- * Get the attribute contentScriptType on the given 'svg' element.\r
- */\r
-DOMString getContentScriptType()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute contentScriptType on the given 'svg' element.\r
- */\r
-void setContentScriptType(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Get the attribute contentStyleType on the given 'svg' element.\r
- */\r
-DOMString getContentStyleType()\r
-{\r
-}\r
-\r
-/**\r
- * Set the attribute contentStyleType on the given 'svg' element.\r
- */\r
-void setContentStyleType(const DOMString &val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * The position and size of the viewport(implicit or explicit) that corresponds\r
- * to this 'svg' element. When the user agent is actually rendering the content,\r
- * then the position and size values represent the actual values when rendering.\r
- * The position and size values are unitless values in the coordinate system of\r
- * the parent element. If no parent element exists(i.e., 'svg' element\r
- * represents the root of the document tree), if this SVG document is embedded as\r
- * part of another document(e.g., via the HTML 'object' element), then the\r
- * position and size are unitless values in the coordinate system of the parent\r
- * document.(If the parent uses CSS or XSL layout, then unitless values\r
- * represent pixel units for the current CSS or XSL viewport, as described in the\r
- * CSS2 specification.) If the parent element does not have a coordinate system,\r
- * then the user agent should provide reasonable default values for this attribute.\r
- */\r
-SVGRect getViewport()\r
-{\r
-}\r
-\r
-/**\r
- * Size of a pixel units(as defined by CSS2) along the x-axis of the viewport,\r
- * which represents a unit somewhere in the range of 70dpi to 120dpi, and, on\r
- * systems that support this, might actually match the characteristics of the\r
- * target medium. On systems where it is impossible to know the size of a pixel,\r
- * a suitable default pixel size is provided.\r
- */\r
-double getPixelUnitToMillimeterX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponding size of a pixel unit along the y-axis of the viewport.\r
- */\r
-double getPixelUnitToMillimeterY()\r
-{\r
-}\r
-\r
-/**\r
- * User interface(UI) events in DOM Level 2 indicate the screen positions at\r
- * which the given UI event occurred. When the user agent actually knows the\r
- * physical size of a "screen unit", this attribute will express that information\r
-{\r
-}\r
- * otherwise, user agents will provide a suitable default value such as .28mm.\r
- */\r
-double getScreenPixelToMillimeterX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponding size of a screen pixel along the y-axis of the viewport.\r
- */\r
-double getScreenPixelToMillimeterY()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * The initial view(i.e., before magnification and panning) of the current\r
- * innermost SVG document fragment can be either the "standard" view(i.e., based\r
- * on attributes on the 'svg' element such as fitBoxToViewport) or to a "custom"\r
- * view(i.e., a hyperlink into a particular 'view' or other element - see\r
- * Linking into SVG content: URI fragments and SVG views). If the initial view is\r
- * the "standard" view, then this attribute is false. If the initial view is a\r
- * "custom" view, then this attribute is true.\r
- */\r
-bool getUseCurrentView()\r
-{\r
-}\r
-\r
-/**\r
- * Set the value above\r
- */\r
-void setUseCurrentView(bool val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * The definition of the initial view(i.e., before magnification and panning) of\r
- * the current innermost SVG document fragment. The meaning depends on the\r
- * situation:\r
- * \r
- * * If the initial view was a "standard" view, then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will match the values for the corresponding DOM attributes that\r
- * are on SVGSVGElement directly\r
- * o the values for transform and viewTarget within currentView will be null\r
- * * If the initial view was a link into a 'view' element, then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will correspond to the corresponding attributes for the given\r
- * 'view' element\r
- * o the values for transform and viewTarget within currentView will be null\r
- * * If the initial view was a link into another element(i.e., other than a\r
- * 'view'), then:\r
- * o the values for viewBox, preserveAspectRatio and zoomAndPan within\r
- * currentView will match the values for the corresponding DOM attributes that\r
- * are on SVGSVGElement directly for the closest ancestor 'svg' element\r
- * o the values for transform within currentView will be null\r
- * o the viewTarget within currentView will represent the target of the link\r
- * * If the initial view was a link into the SVG document fragment using an SVG\r
- * view specification fragment identifier(i.e., #svgView(...)), then:\r
- * o the values for viewBox, preserveAspectRatio, zoomAndPan, transform and\r
- * viewTarget within currentView will correspond to the values from the SVG view\r
- * specification fragment identifier\r
- * \r
- */\r
-SVGViewSpec getCurrentView()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * This attribute indicates the current scale factor relative to the initial view\r
- * to take into account user magnification and panning operations, as described\r
- * under Magnification and panning. DOM attributes currentScale and\r
- * currentTranslate are equivalent to the 2x3 matrix [a b c d e f] =\r
- * [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If\r
- * "magnification" is enabled(i.e., zoomAndPan="magnify"), then the effect is as\r
- * if an extra transformation were placed at the outermost level on the SVG\r
- * document fragment(i.e., outside the outermost 'svg' element).\r
- */\r
-double getCurrentScale()\r
-{\r
-}\r
-\r
-/**\r
- * Set the value above.\r
- */\r
-void setCurrentScale(double val) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * The corresponding translation factor that takes into account\r
- * user "magnification".\r
- */\r
-SVGPoint getCurrentTranslate()\r
-{\r
-}\r
-\r
-/**\r
- * Takes a time-out value which indicates that redraw shall not occur until:(a)\r
- * the corresponding unsuspendRedraw(suspend_handle_id) call has been made,(b)\r
- * an unsuspendRedrawAll() call has been made, or(c) its timer has timed out. In\r
- * environments that do not support interactivity(e.g., print media), then\r
- * redraw shall not be suspended. suspend_handle_id =\r
- * suspendRedraw(max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id)\r
- * must be packaged as balanced pairs. When you want to suspend redraw actions as\r
- * a collection of SVG DOM changes occur, then precede the changes to the SVG DOM\r
- * with a method call similar to suspend_handle_id =\r
- * suspendRedraw(max_wait_milliseconds) and follow the changes with a method call\r
- * similar to unsuspendRedraw(suspend_handle_id). Note that multiple\r
- * suspendRedraw calls can be used at once and that each such method call is\r
- * treated independently of the other suspendRedraw method calls.\r
- */\r
-unsigned long suspendRedraw(unsigned long max_wait_milliseconds)\r
-{\r
-}\r
-\r
-/**\r
- * Cancels a specified suspendRedraw() by providing a unique suspend_handle_id.\r
- */\r
-void unsuspendRedraw(unsigned long suspend_handle_id) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Cancels all currently active suspendRedraw() method calls. This method is most\r
- * useful at the very end of a set of SVG DOM calls to ensure that all pending\r
- * suspendRedraw() method calls have been cancelled.\r
- */\r
-void unsuspendRedrawAll()\r
-{\r
-}\r
-\r
-/**\r
- * In rendering environments supporting interactivity, forces the user agent to\r
- * immediately redraw all regions of the viewport that require updating.\r
- */\r
-void forceRedraw()\r
-{\r
-}\r
-\r
-/**\r
- * Suspends(i.e., pauses) all currently running animations that are defined\r
- * within the SVG document fragment corresponding to this 'svg' element, causing\r
- * the animation clock corresponding to this document fragment to stand still\r
- * until it is unpaused.\r
- */\r
-void pauseAnimations()\r
-{\r
-}\r
-\r
-/**\r
- * Unsuspends(i.e., unpauses) currently running animations that are defined\r
- * within the SVG document fragment, causing the animation clock to continue from\r
- * the time at which it was suspended.\r
- */\r
-void unpauseAnimations()\r
-{\r
-}\r
-\r
-/**\r
- * Returns true if this SVG document fragment is in a paused state.\r
- */\r
-bool animationsPaused()\r
-{\r
-}\r
-\r
-/**\r
- * Returns the current time in seconds relative to the start time for\r
- * the current SVG document fragment.\r
- */\r
-double getCurrentTime()\r
-{\r
-}\r
-\r
-/**\r
- * Adjusts the clock for this SVG document fragment, establishing\r
- * a new current time.\r
- */\r
-void setCurrentTime(double seconds)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the list of graphics elements whose rendered content intersects the\r
- * supplied rectangle, honoring the 'pointer-events' property value on each\r
- * candidate graphics element.\r
- */\r
-NodeList getIntersectionList(const SVGRect &rect,\r
- const SVGElementPtr referenceElement)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the list of graphics elements whose rendered content is entirely\r
- * contained within the supplied rectangle, honoring the 'pointer-events'\r
- * property value on each candidate graphics element.\r
- */\r
-NodeList getEnclosureList(const SVGRect &rect,\r
- const SVGElementPtr referenceElement)\r
-{\r
-}\r
-\r
-/**\r
- * Returns true if the rendered content of the given element intersects the\r
- * supplied rectangle, honoring the 'pointer-events' property value on each\r
- * candidate graphics element.\r
- */\r
-bool checkIntersection(const SVGElementPtr element, const SVGRect &rect)\r
-{\r
-}\r
-\r
-/**\r
- * Returns true if the rendered content of the given element is entirely\r
- * contained within the supplied rectangle, honoring the 'pointer-events'\r
- * property value on each candidate graphics element.\r
- */\r
-bool checkEnclosure(const SVGElementPtr element, const SVGRect &rect)\r
-{\r
-}\r
-\r
-/**\r
- * Unselects any selected objects, including any selections of text\r
- * strings and type-in bars.\r
- */\r
-void deselectAll()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGNumber object outside of any document trees. The object\r
- * is initialized to a value of zero.\r
- */\r
-SVGNumber createSVGNumber()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGLength object outside of any document trees. The object\r
- * is initialized to the value of 0 user units.\r
- */\r
-SVGLength createSVGLength()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGAngle object outside of any document trees. The object\r
- * is initialized to the value 0 degrees(unitless).\r
- */\r
-SVGAngle createSVGAngle()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGPoint object outside of any document trees. The object\r
- * is initialized to the point(0,0) in the user coordinate system.\r
- */\r
-SVGPoint createSVGPoint()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGMatrix object outside of any document trees. The object\r
- * is initialized to the identity matrix.\r
- */\r
-SVGMatrix createSVGMatrix()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGRect object outside of any document trees. The object\r
- * is initialized such that all values are set to 0 user units.\r
- */\r
-SVGRect createSVGRect()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGTransform object outside of any document trees.\r
- * The object is initialized to an identity matrix transform\r
- * (SVG_TRANSFORM_MATRIX).\r
- */\r
-SVGTransform createSVGTransform()\r
-{\r
-}\r
-\r
-/**\r
- * Creates an SVGTransform object outside of any document trees.\r
- * The object is initialized to the given matrix transform\r
- * (i.e., SVG_TRANSFORM_MATRIX).\r
- */\r
-SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix)\r
-{\r
-}\r
-\r
-/**\r
- * Searches this SVG document fragment(i.e., the search is restricted to a\r
- * subset of the document tree) for an Element whose id is given by elementId. If\r
- * an Element is found, that Element is returned. If no such element exists,\r
- * returns null. Behavior is not defined if more than one element has this id.\r
- */\r
-ElementPtr getElementById(const DOMString& elementId)\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGTextElement\r
-//####################################################################\r
-\r
-\r
-//####################################################################\r
-//# SVGTextContentElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute textLength on the given element.\r
- */\r
-SVGAnimatedLength getTextLength()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute lengthAdjust on the given element. The value must be\r
- * one of the length adjust constants specified above.\r
- */\r
-SVGAnimatedEnumeration getLengthAdjust()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Returns the total number of characters to be rendered within the current\r
- * element. Includes characters which are included via a 'tref' reference.\r
- */\r
-long getNumberOfChars()\r
-{\r
-}\r
-\r
-/**\r
- * The total sum of all of the advance values from rendering all of the\r
- * characters within this element, including the advance value on the glyphs\r
- *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'\r
- * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'\r
- * elements. For non-rendering environments, the user agent shall make reasonable\r
- * assumptions about glyph metrics.\r
- */\r
-double getComputedTextLength()\r
-{\r
-}\r
-\r
-/**\r
- * The total sum of all of the advance values from rendering the specified\r
- * substring of the characters, including the advance value on the glyphs\r
- *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'\r
- * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'\r
- * elements. For non-rendering environments, the user agent shall make reasonable\r
- * assumptions about glyph metrics.\r
- */\r
-double getSubStringLength(unsigned long charnum, unsigned long nchars)\r
- throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the current text position before rendering the character in the user\r
- * coordinate system for rendering the glyph(s) that correspond to the specified\r
- * character. The current text position has already taken into account the\r
- * effects of any inter-character adjustments due to properties 'kerning',\r
- * 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx\r
- * and dy. If multiple consecutive characters are rendered inseparably(e.g., as\r
- * a single glyph or a sequence of glyphs), then each of the inseparable\r
- * characters will return the start position for the first glyph.\r
- */\r
-SVGPoint getStartPositionOfChar(unsigned long charnum) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the current text position after rendering the character in the user\r
- * coordinate system for rendering the glyph(s) that correspond to the specified\r
- * character. This current text position does not take into account the effects\r
- * of any inter-character adjustments to prepare for the next character, such as\r
- * properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due\r
- * to attributes x, y, dx and dy. If multiple consecutive characters are rendered\r
- * inseparably(e.g., as a single glyph or a sequence of glyphs), then each of\r
- * the inseparable characters will return the end position for the last glyph.\r
- */\r
-SVGPoint getEndPositionOfChar(unsigned long charnum) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Returns a tightest rectangle which defines the minimum and maximum X and Y\r
- * values in the user coordinate system for rendering the glyph(s) that\r
- * correspond to the specified character. The calculations assume that all glyphs\r
- * occupy the full standard glyph cell for the font. If multiple consecutive\r
- * characters are rendered inseparably(e.g., as a single glyph or a sequence of\r
- * glyphs), then each of the inseparable characters will return the same extent.\r
- */\r
-SVGRect getExtentOfChar(unsigned long charnum) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the rotation value relative to the current user coordinate system used\r
- * to render the glyph(s) corresponding to the specified character. If multiple\r
- * glyph(s) are used to render the given character and the glyphs each have\r
- * different rotations(e.g., due to text-on-a-path), the user agent shall return\r
- * an average value(e.g., the rotation angle at the midpoint along the path for\r
- * all glyphs used to render this character). The rotation value represents the\r
- * rotation that is supplemental to any rotation due to properties\r
- * 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any\r
- * glyph rotations due to these properties are not included into the returned\r
- * rotation value. If multiple consecutive characters are rendered inseparably\r
- *(e.g., as a single glyph or a sequence of glyphs), then each of the\r
- * inseparable characters will return the same rotation value.\r
- */\r
-double getRotationOfChar(unsigned long charnum) throw (DOMException)\r
-{\r
-}\r
-\r
-/**\r
- * Returns the index of the character whose corresponding glyph cell bounding box\r
- * contains the specified point. The calculations assume that all glyphs occupy\r
- * the full standard glyph cell for the font. If no such character exists, a\r
- * value of -1 is returned. If multiple such characters exist, the character\r
- * within the element whose glyphs were rendered last(i.e., take into account\r
- * any reordering such as for bidirectional text) is used. If multiple\r
- * consecutive characters are rendered inseparably(e.g., as a single glyph or a\r
- * sequence of glyphs), then the user agent shall allocate an equal percentage of\r
- * the text advance amount to each of the contributing characters in determining\r
- * which of the characters is chosen.\r
- */\r
-long getCharNumAtPosition(const SVGPoint &point)\r
-{\r
-}\r
-\r
-/**\r
- * Causes the specified substring to be selected just as if the user\r
- * selected the substring interactively.\r
- */\r
-void selectSubString(unsigned long charnum, unsigned long nchars)\r
- throw (DOMException)\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-\r
-//####################################################################\r
-//# SVGTextPathElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute startOffset on the given 'textPath' element.\r
- */\r
-SVGAnimatedLength getStartOffset()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute method on the given 'textPath' element. The value\r
- * must be one of the method type constants specified above.\r
- */\r
-SVGAnimatedEnumeration getMethod()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute spacing on the given 'textPath' element.\r
- * The value must be one of the spacing type constants specified above.\r
- */\r
-SVGAnimatedEnumeration getSpacing()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGTextPositioningElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- * Corresponds to attribute x on the given element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute dx on the given element.\r
- */\r
-SVGAnimatedLength getDx()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute dy on the given element.\r
- */\r
-SVGAnimatedLength getDy()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Corresponds to attribute rotate on the given element.\r
- */\r
-SVGAnimatedNumberList getRotate()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGTitleElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGTRefElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGTSpanElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGSwitchElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGUseElement\r
-//####################################################################\r
-\r
-/**\r
- * Corresponds to attribute x on the given 'use' element.\r
- */\r
-SVGAnimatedLength getX()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute y on the given 'use' element.\r
- */\r
-SVGAnimatedLength getY()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute width on the given 'use' element.\r
- */\r
-SVGAnimatedLength getWidth()\r
-{\r
-}\r
-\r
-/**\r
- * Corresponds to attribute height on the given 'use' element.\r
- */\r
-SVGAnimatedLength getHeight()\r
-{\r
-}\r
-\r
-/**\r
- * The root of the "instance tree". See description of SVGElementInstance for\r
- * a discussion on the instance tree.\r
- * */\r
-SVGElementInstance getInstanceRoot()\r
-{\r
-}\r
-\r
-/**\r
- * If the 'href' attribute is being animated, contains the current animated root\r
- * of the "instance tree". If the 'href' attribute is not currently being\r
- * animated, contains the same value as 'instanceRoot'. The root of the "instance\r
- * tree". See description of SVGElementInstance for a discussion on the instance\r
- * tree.\r
- */\r
-SVGElementInstance getAnimatedInstanceRoot()\r
-{\r
-}\r
-\r
-\r
-//####################################################################\r
-//# SVGVKernElement\r
-//####################################################################\r
-\r
-//####################################################################\r
-//# SVGViewElement\r
-//####################################################################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGStringList getViewTarget();\r
-\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-\r
-/**\r
- *\r
- */\r
-SVGElement::~SVGElement()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-/*#########################################################################\r
-## SVGDocument\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- * The title of a document as specified by the title sub-element of the 'svg'\r
- * root element(i.e., <svg><title>Here is the title</title>...</svg>)\r
- */\r
-DOMString SVGDocument::getTitle()\r
-{\r
-}\r
-\r
-/**\r
- * Returns the URI of the page that linked to this page. The value is an empty\r
- * string if the user navigated to the page directly(not through a link, but,\r
- * for example, via a bookmark).\r
- */\r
-DOMString SVGDocument::getReferrer()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * The domain name of the server that served the document, or a null string if\r
- * the server cannot be identified by a domain name.\r
- */\r
-DOMString SVGDocument::getDomain()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * The complete URI of the document.\r
- */\r
-DOMString SVGDocument::getURL()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * The root 'svg' element in the document hierarchy.\r
- */\r
-SVGElementPtr SVGDocument::getRootElement()\r
-{\r
-}\r
-\r
-\r
-/**\r
- * Overloaded from Document\r
- * \r
- */\r
-ElementPtr SVGDocument::createElement(const DOMString &tagName)\r
-{\r
- ElementPtr ptr;\r
- return ptr;\r
-}\r
-\r
-\r
-/**\r
- * Overloaded from Document\r
- * \r
- */\r
-ElementPtr SVGDocument::createElementNS(const DOMString &tagName,\r
- const DOMString &namespaceURI)\r
-{\r
- ElementPtr ptr;\r
- return ptr;\r
-}\r
-\r
-\r
-/**\r
- * The root 'svg' element in the document hierarchy.\r
- */\r
-SVGElementPtr SVGDocument::getRootElement()\r
-{\r
-}\r
-\r
-\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-SVGDocument::~SVGDocument()\r
-{\r
-}\r
-\r
-\r
-\r
-/*#########################################################################\r
-## GetSVGDocument\r
-#########################################################################*/\r
-\r
-\r
-/**\r
- * Returns the SVGDocument object for the referenced SVG document.\r
- */\r
-SVGDocumentPtr GetSVGDocument::getSVGDocument()\r
- throw (DOMException)\r
-{\r
- SVGDocumentPtr ptr;\r
- return ptr;\r
-}\r
-\r
-//##################\r
-//# Non-API methods\r
-//##################\r
-\r
-/**\r
- *\r
- */\r
-GetSVGDocument::~GetSVGDocument()\r
-{\r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-} //namespace svg\r
-} //namespace dom\r
-} //namespace w3c\r
-} //namespace org\r
-\r
-#endif // __SVG_H__\r
-/*#########################################################################\r
-## E N D O F F I L E\r
-#########################################################################*/\r
-\r
+/**
+ * Phoebe DOM Implementation.
+ *
+ * This is a C++ approximation of the W3C DOM model, which follows
+ * fairly closely the specifications in the various .idl files, copies of
+ * which are provided for reference. Most important is this one:
+ *
+ * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
+ *
+ * Authors:
+ * Bob Jamison
+ *
+ * Copyright(C) 2005-2008 Bob Jamison
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or(at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * =======================================================================
+ * NOTES
+ *
+ * This API follows:
+ * http://www.w3.org/TR/SVG11/svgdom.html
+ *
+ * This file defines the main SVG-DOM Node types. Other non-Node types are
+ * defined in svgtypes.h.
+ *
+ */
+
+#include "svg.h"
+
+#include <math.h>
+
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace svg
+{
+
+
+
+//########################################################################
+//########################################################################
+//########################################################################
+//# I N T E R F A C E S
+//########################################################################
+//########################################################################
+//########################################################################
+
+
+
+/*#########################################################################
+## SVGMatrix
+#########################################################################*/
+
+/**
+ *
+ */
+double SVGMatrix::getA()
+{
+ return a;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setA(double val) throw (DOMException)
+{
+ a = val;
+}
+
+/**
+ *
+ */
+double SVGMatrix::getB()
+{
+ return b;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setB(double val) throw (DOMException)
+{
+ b = val;
+}
+
+/**
+ *
+ */
+double SVGMatrix::getC()
+{
+ return c;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setC(double val) throw (DOMException)
+{
+ c = val;
+}
+
+/**
+ *
+ */
+double SVGMatrix::getD()
+{
+ return d;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setD(double val) throw (DOMException)
+{
+ d = val;
+}
+
+/**
+ *
+ */
+double SVGMatrix::getE()
+{
+ return e;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setE(double val) throw (DOMException)
+{
+ e = val;
+}
+
+/**
+ *
+ */
+double SVGMatrix::getF()
+{
+ return f;
+}
+
+/**
+ *
+ */
+void SVGMatrix::setF(double val) throw (DOMException)
+{
+ f = val;
+}
+
+
+/**
+ * Return the result of postmultiplying this matrix with another.
+ */
+SVGMatrix SVGMatrix::multiply(const SVGMatrix &other)
+{
+ SVGMatrix result;
+ result.a = a * other.a + c * other.b;
+ result.b = b * other.a + d * other.b;
+ result.c = a * other.c + c * other.d;
+ result.d = b * other.c + d * other.d;
+ result.e = a * other.e + c * other.f + e;
+ result.f = b * other.e + d * other.f + f;
+ return result;
+}
+
+/**
+ * Calculate the inverse of this matrix
+ *
+ */
+SVGMatrix SVGMatrix::inverse() throw (SVGException)
+{
+ /*###########################################
+ The determinant of a 3x3 matrix E
+ (let's use our own notation for a bit)
+
+ A B C
+ D E F
+ G H I
+ is
+ AEI - AFH - BDI + BFG + CDH - CEG
+
+ Since in our affine transforms, G and H==0 and I==1,
+ this reduces to:
+ AE - BD
+ In SVG's naming scheme, that is: a * d - c * b . SIMPLE!
+
+ In a similar method of attack, SVG's adjunct matrix is:
+
+ d -c cf-ed
+ -b a eb-af
+ 0 0 ad-cb
+
+ To get the inverse matrix, we divide the adjunct matrix by
+ the determinant. Notice that (ad-cb)/(ad-cb)==1. Very cool.
+ So what we end up with is this:
+
+ a = d/(ad-cb) c = -c/(ad-cb) e = (cf-ed)/(ad-cb)
+ b = -b/(ad-cb) d = a/(ad-cb) f = (eb-af)/(ad-cb)
+
+ (Since this would be in all SVG-DOM implementations,
+ somebody needed to document this! ^^)
+ #############################################*/
+
+ SVGMatrix result;
+ double determinant = a * d - c * b;
+ if (determinant < 1.0e-18)//invertible?
+ {
+ result.identity();//cop out
+ return result;
+ }
+
+ double idet = 1.0 / determinant;
+ result.a = d * idet;
+ result.b = -b * idet;
+ result.c = -c * idet;
+ result.d = a * idet;
+ result.e = (c*f - e*d) * idet;
+ result.f = (e*b - a*f) * idet;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | 1 0 x |
+ * | 0 1 y |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::translate(double x, double y)
+{
+ SVGMatrix result;
+ result.a = a;
+ result.b = b;
+ result.c = c;
+ result.d = d;
+ result.e = a * x + c * y + e;
+ result.f = b * x + d * y + f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | scale 0 0 |
+ * | 0 scale 0 |
+ * | 0 0 1 |
+ *
+ */
+:SVGMatrix SVGMatrix:scale(double scale)
+{
+ SVGMatrix result;
+ result.a = a * scale;
+ result.b = b * scale;
+ result.c = c * scale;
+ result.d = d * scale;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | scaleX 0 0 |
+ * | 0 scaleY 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::scaleNonUniform(double scaleX,
+ double scaleY)
+{
+ SVGMatrix result;
+ result.a = a * scaleX;
+ result.b = b * scaleX;
+ result.c = c * scaleY;
+ result.d = d * scaleY;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | cos(a) -sin(a) 0 |
+ * | sin(a) cos(a) 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::rotate (double angle)
+{
+ double sina = sin(angle);
+ double msina = -sina;
+ double cosa = cos(angle);
+ SVGMatrix result;
+ result.a = a * cosa + c * sina;
+ result.b = b * cosa + d + sina;
+ result.c = a * msina + c * cosa;
+ result.d = b * msina + d * cosa;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | cos(a) -sin(a) 0 |
+ * | sin(a) cos(a) 0 |
+ * | 0 0 1 |
+ * In this case, angle 'a' is computed as the artangent
+ * of the slope y/x . It is negative if the slope is negative.
+ */
+SVGMatrix SVGMatrix::rotateFromVector(double x, double y)
+ throw (SVGException)
+{
+ double angle = atan(y / x);
+ if (y < 0.0)
+ angle = -angle;
+ SVGMatrix result;
+ double sina = sin(angle);
+ double msina = -sina;
+ double cosa = cos(angle);
+ result.a = a * cosa + c * sina;
+ result.b = b * cosa + d + sina;
+ result.c = a * msina + c * cosa;
+ result.d = b * msina + d * cosa;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | -1 0 0 |
+ * | 0 1 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::flipX()
+{
+ SVGMatrix result;
+ result.a = -a;
+ result.b = -b;
+ result.c = c;
+ result.d = d;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | 1 0 0 |
+ * | 0 -1 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::flipY()
+{
+ SVGMatrix result;
+ result.a = a;
+ result.b = b;
+ result.c = -c;
+ result.d = -d;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * | 1 tan(a) 0 |
+ * | 0 1 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix SVGMatrix::skewX(double angle)
+{
+ double tana = tan(angle);
+ SVGMatrix result;
+ result.a = a;
+ result.b = b;
+ result.c = a * tana + c;
+ result.d = b * tana + d;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+/**
+ * Equivalent to multiplying by:
+ * | 1 0 0 |
+ * | tan(a) 1 0 |
+ * | 0 0 1 |
+ *
+ */
+SVGMatrix::SVGMatrix SVGMatrix::skewY(double angle)
+{
+ double tana = tan(angle);
+ SVGMatrix result;
+ result.a = a + c * tana;
+ result.b = b + d * tana;
+ result.c = c;
+ result.d = d;
+ result.e = e;
+ result.f = f;
+ return result;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGMatrix::SVGMatrix()
+{
+ identity();
+}
+
+/**
+ *
+ */
+SVGMatrix::SVGMatrix(double aArg, double bArg, double cArg,
+ double dArg, double eArg, double fArg)
+{
+ a = aArg; b = bArg; c = cArg;
+ d = dArg; e = eArg; f = fArg;
+}
+
+/**
+ * Copy constructor
+ */
+SVGMatrix::SVGMatrix(const SVGMatrix &other)
+{
+ a = other.a;
+ b = other.b;
+ c = other.c;
+ d = other.d;
+ e = other.e;
+ f = other.f;
+}
+
+
+
+/**
+ *
+ */
+SVGMatrix::~SVGMatrix()
+{
+}
+
+/*
+ * Set to the identity matrix
+ */
+void SVGMatrix::identity()
+{
+ a = 1.0;
+ b = 0.0;
+ c = 0.0;
+ d = 1.0;
+ e = 0.0;
+ f = 0.0;
+}
+
+
+/*#########################################################################
+## SVGTransform
+#########################################################################*/
+
+/**
+ *
+ */
+unsigned short SVGTransform::getType()
+{
+ return type;
+}
+
+
+/**
+ *
+ */
+SVGMatrix SVGTransform::getMatrix()
+{
+ return matrix;
+}
+
+/**
+ *
+ */
+double SVGTransform::getAngle()
+{
+ return angle;
+}
+
+
+/**
+ *
+ */
+void SVGTransform::setMatrix(const SVGMatrix &matrixArg)
+{
+ type = SVG_TRANSFORM_MATRIX;
+ matrix = matrixArg;
+}
+
+/**
+ *
+ */
+void SVGTransform::setTranslate(double tx, double ty)
+{
+ type = SVG_TRANSFORM_TRANSLATE;
+ matrix.setA(1.0);
+ matrix.setB(0.0);
+ matrix.setC(0.0);
+ matrix.setD(1.0);
+ matrix.setE(tx);
+ matrix.setF(ty);
+}
+
+/**
+ *
+ */
+void SVGTransform::setScale(double sx, double sy)
+{
+ type = SVG_TRANSFORM_SCALE;
+ matrix.setA(sx);
+ matrix.setB(0.0);
+ matrix.setC(0.0);
+ matrix.setD(sy);
+ matrix.setE(0.0);
+ matrix.setF(0.0);
+}
+
+/**
+ *
+ */
+void SVGTransform::setRotate(double angleArg, double cx, double cy)
+{
+ angle = angleArg;
+ setTranslate(cx, cy);
+ type = SVG_TRANSFORM_ROTATE;
+ matrix.rotate(angle);
+}
+
+/**
+ *
+ */
+void SVGTransform::setSkewX(double angleArg)
+{
+ angle = angleArg;
+ type = SVG_TRANSFORM_SKEWX;
+ matrix.identity();
+ matrix.skewX(angle);
+}
+
+/**
+ *
+ */
+void SVGTransform::setSkewY(double angleArg)
+{
+ angle = angleArg;
+ type = SVG_TRANSFORM_SKEWY;
+ matrix.identity();
+ matrix.skewY(angle);
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGTransform::SVGTransform()
+{
+ type = SVG_TRANSFORM_UNKNOWN;
+ angle = 0.0;
+}
+
+/**
+ *
+ */
+SVGTransform::SVGTransform(const SVGTransform &other)
+{
+ type = other.type;
+ angle = other.angle;
+ matrix = other.matrix;
+}
+
+/**
+ *
+ */
+~SVGTransform::SVGTransform()
+{
+}
+
+
+
+/*#########################################################################
+## SVGNumber
+#########################################################################*/
+
+/**
+ *
+ */
+double SVGNumber::getValue()
+{
+ return value;
+}
+
+/**
+ *
+ */
+void SVGNumber::setValue(double val) throw (DOMException)
+{
+ value = val;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGNumber::SVGNumber()
+{
+ value = 0.0;
+}
+
+/**
+ *
+ */
+SVGNumber::SVGNumber(const SVGNumber &other)
+{
+ value = other.value;
+}
+
+/**
+ *
+ */
+SVGNumber::~SVGNumber()
+{
+}
+
+
+
+/*#########################################################################
+## SVGLength
+#########################################################################*/
+
+
+/**
+ *
+ */
+unsigned short SVGLength::getUnitType()
+{
+ return unitType;
+}
+
+/**
+ *
+ */
+double SVGLength::getValue()
+{
+ return value;
+}
+
+/**
+ *
+ */
+void SVGLength::setValue(double val) throw (DOMException)
+{
+ value = val;
+}
+
+/**
+ *
+ */
+double SVGLength::getValueInSpecifiedUnits()
+{
+ double result = 0.0;
+ //fill this in
+ return result;
+}
+
+/**
+ *
+ */
+void SVGLength::setValueInSpecifiedUnits(double /*val*/)
+ throw (DOMException)
+{
+ //fill this in
+}
+
+/**
+ *
+ */
+DOMString SVGLength::getValueAsString()
+{
+ DOMString ret;
+ char buf[32];
+ snprintf(buf, 31, "%f", value);
+ ret.append(buf);
+ return ret;
+}
+
+/**
+ *
+ */
+void SVGLength::setValueAsString(const DOMString& /*val*/)
+ throw (DOMException)
+{
+}
+
+
+/**
+ *
+ */
+void SVGLength::newValueSpecifiedUnits (unsigned short /*unitType*/, double /*val*/)
+{
+}
+
+/**
+ *
+ */
+void SVGLength::convertToSpecifiedUnits (unsigned short /*unitType*/)
+{
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGLength::SVGLength()
+{
+ unitType = SVG_LENGTHTYPE_UNKNOWN;
+ value = 0.0;
+}
+
+
+/**
+ *
+ */
+SVGLength::SVGLength(const SVGLength &other)
+{
+ unitType = other.unitType;
+ value = other.value;
+}
+
+/**
+ *
+ */
+SVGLength::~SVGLength()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGAngle
+#########################################################################*/
+
+/**
+ *
+ */
+unsigned short SVGAngle::getUnitType()
+{
+ return unitType;
+}
+
+/**
+ *
+ */
+double SVGAngle::getValue()
+{
+ return value;
+}
+
+/**
+ *
+ */
+void SVGAngle::setValue(double val) throw (DOMException)
+{
+ value = val;
+}
+
+/**
+ *
+ */
+double SVGAngle::getValueInSpecifiedUnits()
+{
+ double result = 0.0;
+ //convert here
+ return result;
+}
+
+/**
+ *
+ */
+void SVGAngle::setValueInSpecifiedUnits(double /*val*/)
+ throw (DOMException)
+{
+ //do conversion
+}
+
+/**
+ *
+ */
+DOMString SVGAngle::getValueAsString()
+{
+ DOMString result;
+ char buf[32];
+ snprintf(buf, 31, "%f", value);
+ result.append(buf);
+ return result;
+}
+
+/**
+ *
+ */
+void SVGAngle::setValueAsString(const DOMString &/*val*/)
+ throw (DOMException)
+{
+ //convert here
+}
+
+
+/**
+ *
+ */
+void SVGAngle::newValueSpecifiedUnits (unsigned short /*unitType*/,
+ double /*valueInSpecifiedUnits*/)
+{
+ //convert here
+}
+
+/**
+ *
+ */
+void SVGAngle::convertToSpecifiedUnits (unsigned short /*unitType*/)
+{
+ //convert here
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGAngle::SVGAngle()
+{
+ unitType = SVG_ANGLETYPE_UNKNOWN;
+ value = 0.0;
+}
+
+/**
+ *
+ */
+SVGAngle::SVGAngle(const SVGAngle &other)
+{
+ unitType = other.unitType;
+ value = other.value;
+}
+
+/**
+ *
+ */
+SVGAngle::~SVGAngle()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGICCColor
+#########################################################################*/
+
+
+/**
+ *
+ */
+DOMString SVGICCColor::getColorProfile()
+{
+ return colorProfile;
+}
+
+/**
+ *
+ */
+void SVGICCColor::setColorProfile(const DOMString &val) throw (DOMException)
+{
+ colorProfile = val;
+}
+
+/**
+ *
+ */
+SVGNumberList &SVGICCColor::getColors()
+{
+ return colors;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGICCColor::SVGICCColor()
+{
+}
+
+/**
+ *
+ */
+SVGICCColor::SVGICCColor(const SVGICCColor &other)
+{
+ colorProfile = other.colorProfile;
+ colors = other.colors;
+}
+
+/**
+ *
+ */
+SVGICCColor::~SVGICCColor()
+{
+}
+
+
+
+/*#########################################################################
+## SVGColor
+#########################################################################*/
+
+
+
+/**
+ *
+ */
+unsigned short SVGColor::getColorType()
+{
+ return colorType;
+}
+
+/**
+ *
+ */
+css::RGBColor SVGColor::getRgbColor()
+{
+ css::RGBColor col;
+ return col;
+}
+
+/**
+ *
+ */
+SVGICCColor SVGColor::getIccColor()
+{
+ SVGICCColor col;
+ return col;
+}
+
+
+/**
+ *
+ */
+void SVGColor::setRGBColor(const DOMString& /*rgbColor*/)
+ throw (SVGException)
+{
+}
+
+/**
+ *
+ */
+void SVGColor::setRGBColorICCColor(const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw (SVGException)
+{
+}
+
+/**
+ *
+ */
+void SVGColor::setColor (unsigned short /*colorType*/,
+ const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw (SVGException)
+{
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGColor::SVGColor()
+{
+ colorType = SVG_COLORTYPE_UNKNOWN;
+}
+
+/**
+ *
+ */
+SVGColor::SVGColor(const SVGColor &other) : css::CSSValue(other)
+{
+ colorType = other.colorType;
+}
+
+/**
+ *
+ */
+SVGColor::~SVGColor()
+{
+}
+
+
+
+/*#########################################################################
+## SVGRect
+#########################################################################*/
+
+
+/**
+ *
+ */
+double SVGRect::getX()
+{
+ return x;
+}
+
+/**
+ *
+ */
+void SVGRect::setX(double val) throw (DOMException)
+{
+ x = val;
+}
+
+/**
+ *
+ */
+double SVGRect::getY()
+{
+ return y;
+}
+
+/**
+ *
+ */
+void SVGRect::setY(double val) throw (DOMException)
+{
+ y = val;
+}
+
+/**
+ *
+ */
+double SVGRect::getWidth()
+{
+ return width;
+}
+
+/**
+ *
+ */
+void SVGRect::setWidth(double val) throw (DOMException)
+{
+ width = val;
+}
+
+/**
+ *
+ */
+double SVGRect::getHeight()
+{
+ return height;
+}
+
+/**
+ *
+ */
+void SVGRect::setHeight(double val) throw (DOMException)
+{
+ height = val;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGRect::SVGRect()
+{
+ x = y = width = height = 0.0;
+}
+
+/**
+ *
+ */
+SVGRect::SVGRect(const SVGRect &other)
+{
+ x = other.x;
+ y = other.y;
+ width = other.width;
+ height = other.height;
+}
+
+/**
+ *
+ */
+SVGRect::~SVGRect()
+{
+}
+
+
+
+/*#########################################################################
+## SVGPoint
+#########################################################################*/
+
+
+/**
+ *
+ */
+double SVGPoint::getX()
+{
+ return x;
+}
+
+/**
+ *
+ */
+void SVGPoint::setX(double val) throw (DOMException)
+{
+ x = val;
+}
+
+/**
+ *
+ */
+double SVGPoint::getY()
+{
+ return y;
+}
+
+/**
+ *
+ */
+void SVGPoint::setY(double val) throw (DOMException)
+{
+ y = val;
+}
+
+/**
+ *
+ */
+SVGPoint SVGPoint::matrixTransform(const SVGMatrix &/*matrix*/)
+{
+ SVGPoint point;
+ return point;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGPoint::SVGPoint()
+{
+ x = y = 0;
+}
+
+/**
+ *
+ */
+SVGPoint::SVGPoint(const SVGPoint &other)
+{
+ x = other.x;
+ y = other.y;
+}
+
+/**
+ *
+ */
+SVGPoint::~SVGPoint()
+{
+}
+
+
+/*#########################################################################
+## SVGUnitTypes
+#########################################################################*/
+
+/**
+ *
+ */
+SVGUnitTypes::SVGUnitTypes()
+{
+}
+
+
+
+/**
+ *
+ */
+SVGUnitTypes::~SVGUnitTypes()
+{
+}
+
+
+/*#########################################################################
+## SVGStylable
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGAnimatedString SVGStylable::getClassName()
+{
+ return className;
+}
+
+/**
+ *
+ */
+css::CSSStyleDeclaration SVGStylable::getStyle()
+{
+ return style;
+}
+
+
+/**
+ *
+ */
+css::CSSValue SVGStylable::getPresentationAttribute(const DOMString& /*name*/)
+{
+ css::CSSValue val;
+ //perform a lookup
+ return val;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGStylable::SVGStylable()
+{
+}
+
+/**
+ *
+ */
+SVGStylable::SVGStylable(const SVGStylable &other)
+{
+ className = other.className;
+ style = other.style;
+}
+
+/**
+ *
+ */
+SVGStylable::~SVGStylable()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGLocatable
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGElementPtr SVGLocatable::getNearestViewportElement()
+{
+ SVGElementPtr result;
+ return result;
+}
+
+/**
+ *
+ */
+SVGElementPtr SVGLocatable::getFarthestViewportElement()
+{
+ SVGElementPtr result;
+ return result;
+}
+
+/**
+ *
+ */
+SVGRect SVGLocatable::getBBox ()
+{
+ return bbox;
+}
+
+/**
+ *
+ */
+SVGMatrix SVGLocatable::getCTM ()
+{
+ return ctm;
+}
+
+/**
+ *
+ */
+SVGMatrix SVGLocatable::getScreenCTM ()
+{
+ return screenCtm;
+}
+
+/**
+ *
+ */
+SVGMatrix SVGLocatable::getTransformToElement (const SVGElement &/*element*/)
+ throw (SVGException)
+{
+ SVGMatrix result;
+ //do calculations
+ return result;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGLocatable::SVGLocatable()
+{
+}
+
+/**
+ *
+ */
+SVGLocatable::SVGLocatable(const SVGLocatable &/*other*/)
+{
+}
+
+/**
+ *
+ */
+SVGLocatable::~SVGLocatable()
+{
+}
+
+
+/*#########################################################################
+## SVGTransformable
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGAnimatedTransformList &SVGTransformable::getTransform()
+{
+ return transforms;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGTransformable::SVGTransformable() {}
+
+/**
+ *
+ */
+SVGTransformable::SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
+{
+ transforms = other.transforms;
+}
+
+/**
+ *
+ */
+SVGTransformable::~SVGTransformable()
+{
+}
+
+
+
+
+
+
+
+/*#########################################################################
+## SVGTests
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGStringList &SVGTests::getRequiredFeatures()
+{
+ return requiredFeatures;
+}
+
+/**
+ *
+ */
+SVGStringList &SVGTests::getRequiredExtensions()
+{
+ return requiredExtensions;
+}
+
+/**
+ *
+ */
+SVGStringList &SVGTests::getSystemLanguage()
+{
+ return systemLanguage;
+}
+
+
+/**
+ *
+ */
+bool SVGTests::hasExtension (const DOMString& /*extension*/)
+{
+ return false;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGTests::SVGTests()
+{
+}
+
+/**
+ *
+ */
+SVGTests::SVGTests(const SVGTests &other)
+{
+ requiredFeatures = other.requiredFeatures;
+ requiredExtensions = other.requiredExtensions;
+ systemLanguage = other.systemLanguage;
+}
+
+/**
+ *
+ */
+SVGTests::~SVGTests()
+{
+}
+
+
+
+/*#########################################################################
+## SVGLangSpace
+#########################################################################*/
+
+
+/**
+ *
+ */
+DOMString SVGLangSpace::getXmllang()
+{
+ return xmlLang;
+}
+
+/**
+ *
+ */
+void SVGLangSpace::setXmllang(const DOMString &val) throw (DOMException)
+{
+ xmlLang = val;
+}
+
+/**
+ *
+ */
+DOMString SVGLangSpace::getXmlspace()
+{
+ return xmlSpace;
+}
+
+/**
+ *
+ */
+void SVGLangSpace::setXmlspace(const DOMString &val)
+ throw (DOMException)
+{
+ xmlSpace = val;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGLangSpace::SVGLangSpace()
+{
+}
+
+/**
+ *
+ */
+SVGLangSpace::SVGLangSpace(const SVGLangSpace &other)
+{
+ xmlLang = other.xmlLang;
+ xmlSpace = other.xmlSpace;
+}
+
+/**
+ *
+ */
+SVGLangSpace::~SVGLangSpace()
+{
+}
+
+
+
+/*#########################################################################
+## SVGExternalResourcesRequired
+#########################################################################*/
+
+/**
+ *
+ */
+SVGAnimatedBoolean SVGExternalResourcesRequired::getExternalResourcesRequired()
+{
+ return required;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGExternalResourcesRequired::SVGExternalResourcesRequired()
+{
+}
+
+
+/**
+ *
+ */
+SVGExternalResourcesRequired::SVGExternalResourcesRequired(
+ const SVGExternalResourcesRequired &other)
+{
+ required = other.required;
+}
+
+/**
+ *
+ */
+SVGExternalResourcesRequired::~SVGExternalResourcesRequired() {}
+
+
+/*#########################################################################
+## SVGPreserveAspectRatio
+#########################################################################*/
+
+/**
+ *
+ */
+unsigned short SVGPreserveAspectRatio::getAlign()
+{
+ return align;
+}
+
+/**
+ *
+ */
+void SVGPreserveAspectRatio::setAlign(unsigned short val) throw (DOMException)
+{
+ align = val;
+}
+
+/**
+ *
+ */
+unsigned short SVGPreserveAspectRatio::getMeetOrSlice()
+{
+ return meetOrSlice;
+}
+
+/**
+ *
+ */
+void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short val) throw (DOMException)
+{
+ meetOrSlice = val;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGPreserveAspectRatio::SVGPreserveAspectRatio()
+{
+ align = SVG_PRESERVEASPECTRATIO_UNKNOWN;
+ meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
+}
+
+/**
+ *
+ */
+SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
+{
+ align = other.align;
+ meetOrSlice = other.meetOrSlice;
+}
+
+/**
+ *
+ */
+SVGPreserveAspectRatio::~SVGPreserveAspectRatio()
+{
+}
+
+
+
+/*#########################################################################
+## SVGFitToViewBox
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGAnimatedRect SVGFitToViewBox::getViewBox()
+{
+ return viewBox;
+}
+
+/**
+ *
+ */
+SVGAnimatedPreserveAspectRatio SVGFitToViewBox::getPreserveAspectRatio()
+{
+ return preserveAspectRatio;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGFitToViewBox::SVGFitToViewBox()
+{
+}
+
+/**
+ *
+ */
+
+SVGFitToViewBox::SVGFitToViewBox(const SVGFitToViewBox &other)
+{
+ viewBox = other.viewBox;
+ preserveAspectRatio = other.preserveAspectRatio;
+}
+
+/**
+ *
+ */
+SVGFitToViewBox::~SVGFitToViewBox()
+{
+}
+
+/*#########################################################################
+## SVGZoomAndPan
+#########################################################################*/
+
+/**
+ *
+ */
+unsigned short SVGZoomAndPan::getZoomAndPan()
+{
+ return zoomAndPan;
+}
+
+/**
+ *
+ */
+void SVGZoomAndPan::setZoomAndPan(unsigned short val) throw (DOMException)
+{
+ zoomAndPan = val;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGZoomAndPan::SVGZoomAndPan()
+{
+ zoomAndPan = SVG_ZOOMANDPAN_UNKNOWN;
+}
+
+/**
+ *
+ */
+SVGZoomAndPan::SVGZoomAndPan(const SVGZoomAndPan &other)
+{
+ zoomAndPan = other.zoomAndPan;
+}
+
+/**
+ *
+ */
+SVGZoomAndPan::~SVGZoomAndPan()
+{
+}
+
+
+/*#########################################################################
+## SVGViewSpec
+#########################################################################*/
+
+/**
+ *
+ */
+SVGTransformList SVGViewSpec::getTransform()
+{
+ return transform;
+}
+
+/**
+ *
+ */
+SVGElementPtr SVGViewSpec::getViewTarget()
+{
+ return viewTarget;
+}
+
+/**
+ *
+ */
+DOMString SVGViewSpec::getViewBoxString()
+{
+ DOMString ret;
+ return ret;
+}
+
+/**
+ *
+ */
+DOMString SVGViewSpec::getPreserveAspectRatioString()
+{
+ DOMString ret;
+ return ret;
+}
+
+/**
+ *
+ */
+DOMString SVGViewSpec::getTransformString()
+{
+ DOMString ret;
+ return ret;
+}
+
+/**
+ *
+ */
+DOMString SVGViewSpec::getViewTargetString()
+{
+ DOMString ret;
+ return ret;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGViewSpec::SVGViewSpec()
+{
+ viewTarget = NULL;
+}
+
+/**
+ *
+ */
+SVGViewSpec::SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
+{
+ viewTarget = other.viewTarget;
+ transform = other.transform;
+}
+
+/**
+ *
+ */
+SVGViewSpec::~SVGViewSpec()
+{
+}
+
+
+
+/*#########################################################################
+## SVGURIReference
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGAnimatedString SVGURIReference::getHref()
+{
+ return href;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGURIReference::SVGURIReference()
+{
+}
+
+/**
+ *
+ */
+SVGURIReference::SVGURIReference(const SVGURIReference &other)
+{
+ href = other.href;
+}
+
+/**
+ *
+ */
+SVGURIReference::~SVGURIReference()
+{
+}
+
+
+
+/*#########################################################################
+## SVGCSSRule
+#########################################################################*/
+
+
+
+
+/*#########################################################################
+## SVGRenderingIntent
+#########################################################################*/
+
+
+
+
+
+/*#########################################################################
+## SVGPathSeg
+#########################################################################*/
+
+static const char *pathSegLetters[] =
+{
+ '@', // PATHSEG_UNKNOWN,
+ 'z', // PATHSEG_CLOSEPATH
+ 'M', // PATHSEG_MOVETO_ABS
+ 'm', // PATHSEG_MOVETO_REL,
+ 'L', // PATHSEG_LINETO_ABS
+ 'l', // PATHSEG_LINETO_REL
+ 'C', // PATHSEG_CURVETO_CUBIC_ABS
+ 'c', // PATHSEG_CURVETO_CUBIC_REL
+ 'Q', // PATHSEG_CURVETO_QUADRATIC_ABS,
+ 'q', // PATHSEG_CURVETO_QUADRATIC_REL
+ 'A', // PATHSEG_ARC_ABS
+ 'a', // PATHSEG_ARC_REL,
+ 'H', // PATHSEG_LINETO_HORIZONTAL_ABS,
+ 'h', // PATHSEG_LINETO_HORIZONTAL_REL
+ 'V', // PATHSEG_LINETO_VERTICAL_ABS
+ 'v', // PATHSEG_LINETO_VERTICAL_REL
+ 'S', // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
+ 's', // PATHSEG_CURVETO_CUBIC_SMOOTH_REL
+ 'T', // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
+ 't' // PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
+};
+
+
+
+/**
+ *
+ */
+unsigned short getPathSegType()
+{
+ return type;
+}
+
+/**
+ *
+ */
+DOMString getPathSegTypeAsLetter()
+{
+ int typ = type;
+ if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
+ typ = PATHSEG_UNKNOWN;
+ char const ch = pathSegLetters[typ];
+ DOMString letter = ch;
+ return letter;
+}
+
+
+/**
+ *
+ */
+unsigned short getPathSegType()
+{
+ return type;
+}
+
+/**
+ *
+ */
+DOMString getPathSegTypeAsLetter()
+{
+ int typ = type;
+ if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
+ typ = PATHSEG_UNKNOWN;
+ char const *ch = pathSegLetters[typ];
+ DOMString letter = ch;
+ return letter;
+}
+
+/**
+ * From the various subclasses
+ */
+
+/**
+ *
+ */
+double SVGPathSeg::getX()
+{
+ return x;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setX(double val) throw (DOMException)
+{
+ x = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getX1()
+{
+ return x;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setX1(double val) throw (DOMException)
+{
+ x = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getX2()
+{
+ return x;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setX2(double val) throw (DOMException)
+{
+ x = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getY()
+{
+ return y;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setY(double val) throw (DOMException)
+{
+ y = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getY1()
+{
+ return y;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setY1(double val) throw (DOMException)
+{
+ y = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getY2()
+{
+ return y;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setY2(double val) throw (DOMException)
+{
+ y = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getR1()
+{
+ return r1;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setR1(double val) throw (DOMException)
+{
+ r1 = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getR2()
+{
+ return r2;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setR2(double val) throw (DOMException)
+{
+ r2 = val;
+}
+
+/**
+ *
+ */
+double SVGPathSeg::getAngle()
+{
+ return angle;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setAngle(double val) throw (DOMException)
+{
+ angle = val;
+}
+
+/**
+ *
+ */
+bool SVGPathSeg::getLargeArcFlag()
+{
+ return largeArcFlag;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setLargeArcFlag(bool val) throw (DOMException)
+{
+ largeArcFlag = val;
+}
+
+/**
+ *
+ */
+bool SVGPathSeg::getSweepFlag()
+{
+ return sweepFlag;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::setSweepFlag(bool val) throw (DOMException)
+{
+ sweepFlag = val;
+}
+
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGPathSeg::SVGPathSeg()
+{
+ init();
+}
+
+/**
+ *
+ */
+SVGPathSeg::SVGPathSeg(const SVGPathSeg &other)
+{
+ assign(other);
+}
+
+/**
+ *
+ */
+SVGPathSeg &operator=(const SVGPathSeg &other)
+{
+ assign(other);
+ return *this;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::init()
+{
+ type = PATHSEG_UNKNOWN;
+ x = y = x1 = y1 = x2 = y2 = 0.0;
+ r1 = r2 = 0.0;
+ angle = 0.0;
+ largeArcFlag = false;
+ sweepFlag = false;
+}
+
+/**
+ *
+ */
+void SVGPathSeg::assign(const SVGPathSeg &other)
+{
+ type = other.type;
+ x = other.x;
+ y = other.y;
+ x1 = other.x1;
+ y1 = other.y1;
+ x2 = other.x2;
+ y2 = other.y2;
+ r1 = other.r1;
+ r2 = other.r2;
+ angle = other.angle;
+ largeArcFlag = other.largeArcFlag;
+ sweepFlag = other.sweepFlag;
+}
+
+
+/**
+ *
+ */
+SVGPathSeg::~SVGPathSeg()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGPaint
+#########################################################################*/
+
+
+/**
+ *
+ */
+unsigned short SVGPaint::getPaintType()
+{ return paintType; }
+
+/**
+ *
+ */
+DOMString SVGPaint::getUri()
+{ return uri; }
+
+/**
+ *
+ */
+void SVGPaint::setUri(const DOMString& uriArg)
+{
+ uri = uriArg;
+}
+
+/**
+ *
+ */
+void SVGPaint::setPaint (unsigned short paintTypeArg,
+ const DOMString& uriArg,
+ const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw (SVGException)
+{
+ paintType = paintTypeArg;
+ uri = uriArg;
+ //do something with rgbColor
+ //do something with iccColor;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGPaint::SVGPaint()
+{
+ uri = "";
+ paintType = SVG_PAINTTYPE_UNKNOWN;
+}
+
+/**
+ *
+ */
+SVGPaint::SVGPaint(const SVGPaint &other) : css::CSSValue(other), SVGColor(other)
+{
+ uri = "";
+ paintType = SVG_PAINTTYPE_UNKNOWN;
+}
+
+/**
+ *
+ */
+SVGPaint::~SVGPaint() {}
+
+
+/*#########################################################################
+## SVGColorProfileRule
+#########################################################################*/
+
+
+/**
+ *
+ */
+DOMString SVGColorProfileRule::getSrc()
+{ return src; }
+
+/**
+ *
+ */
+void SVGColorProfileRule::setSrc(const DOMString &val) throw (DOMException)
+{ src = val; }
+
+/**
+ *
+ */
+DOMString SVGColorProfileRule::getName()
+{ return name; }
+
+/**
+ *
+ */
+void SVGColorProfileRule::setName(const DOMString &val) throw (DOMException)
+{ name = val; }
+
+/**
+ *
+ */
+unsigned short SVGColorProfileRule::getRenderingIntent()
+{ return renderingIntent; }
+
+/**
+ *
+ */
+void SVGColorProfileRule::setRenderingIntent(unsigned short val) throw (DOMException)
+{ renderingIntent = val; }
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGColorProfileRule::SVGColorProfileRule()
+{
+}
+
+/**
+ *
+ */
+SVGColorProfileRule::SVGColorProfileRule(const SVGColorProfileRule &other)
+ : SVGCSSRule(other), SVGRenderingIntent(other)
+{
+ renderingIntent = other.renderingIntent;
+ src = other.src;
+ name = other.name;
+}
+
+/**
+ *
+ */
+SVGColorProfileRule::~SVGColorProfileRule()
+{
+}
+
+
+/*#########################################################################
+## SVGFilterPrimitiveStandardAttributes
+#########################################################################*/
+
+/**
+ *
+ */
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getX()
+{ return x; }
+
+/**
+ *
+ */
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getY()
+{ return y; }
+
+/**
+ *
+ */
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getWidth()
+{ return width; }
+
+/**
+ *
+ */
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::getHeight()
+{ return height; }
+
+/**
+ *
+ */
+SVGAnimatedString SVGFilterPrimitiveStandardAttributes::getResult()
+{ return result; }
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+
+/**
+ *
+ */
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes()
+{
+}
+
+/**
+ *
+ */
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(
+ const SVGFilterPrimitiveStandardAttributes &other)
+ : SVGStylable(other)
+{
+ x = other.x;
+ y = other.y;
+ width = other.width;
+ height = other.height;
+ result = other.result;
+}
+
+/**
+ *
+ */
+SVGFilterPrimitiveStandardAttributes::~SVGFilterPrimitiveStandardAttributes()
+{
+}
+
+
+/*#########################################################################
+## SVGEvent
+#########################################################################*/
+
+/**
+ *
+ */
+SVGEvent:SVGEvent()
+{
+}
+
+/**
+ *
+ */
+SVGEvent:SVGEvent(const SVGEvent &other) : events::Event(other)
+{
+}
+
+/**
+ *
+ */
+SVGEvent::~SVGEvent()
+{
+}
+
+
+/*#########################################################################
+## SVGZoomEvent
+#########################################################################*/
+
+/**
+ *
+ */
+SVGRect SVGZoomEvent::getZoomRectScreen()
+{
+ return zoomRectScreen;
+}
+
+/**
+ *
+ */
+double SVGZoomEvent::getPreviousScale()
+{
+ return previousScale;
+}
+
+/**
+ *
+ */
+SVGPoint SVGZoomEvent::getPreviousTranslate()
+{
+ return previousTranslate;
+}
+
+/**
+ *
+ */
+double SVGZoomEvent::getNewScale()
+{
+ return newScale;
+}
+
+/**
+ *
+ */
+SVGPoint SVGZoomEvent::getNewTranslate()
+{
+ return newTranslate;
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGZoomEvent::SVGZoomEvent()
+{
+}
+
+/**
+ *
+ */
+SVGZoomEvent::SVGZoomEvent(const SVGZoomEvent &other) :
+ events::Event(other), events::UIEvent(other)
+{
+ zoomRectScreen = other.zoomRectScreen;
+ previousScale = other.previousScale;
+ previousTranslate = other.previousTranslate;
+ newScale = other.newScale;
+ newTranslate = other.newTranslate;
+}
+
+/**
+ *
+ */
+SVGZoomEvent::~SVGZoomEvent()
+{
+}
+
+
+/*#########################################################################
+## SVGElementInstance
+#########################################################################*/
+
+
+/**
+ *
+ */
+SVGElementPtr SVGElementInstance::getCorrespondingElement()
+{
+ return correspondingElement;
+}
+
+/**
+ *
+ */
+SVGUseElementPtr SVGElementInstance::getCorrespondingUseElement()
+{
+ return correspondingUseElement;
+}
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstance::getParentNode()
+{
+ SVGElementInstance ret;
+ return ret;
+}
+
+/**
+ * Since we are using stack types and this is a circular definition,
+ * we will instead implement this as a global function below:
+ * SVGElementInstanceList getChildNodes(const SVGElementInstance instance);
+ */
+//SVGElementInstanceList getChildNodes();
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstance::getFirstChild()
+{
+ SVGElementInstance ret;
+ return ret;
+}
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstance::getLastChild()
+{
+ SVGElementInstance ret;
+ return ret;
+}
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstance::getPreviousSibling()
+{
+ SVGElementInstance ret;
+ return ret;
+}
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstance::getNextSibling()
+{
+ SVGElementInstance ret;
+ return ret;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGElementInstance::SVGElementInstance()
+{
+}
+
+/**
+ *
+ */
+SVGElementInstance::SVGElementInstance(const SVGElementInstance &other)
+ : events::EventTarget(other)
+{
+}
+
+/**
+ *
+ */
+SVGElementInstance::~SVGElementInstance()
+{
+}
+
+
+/*#########################################################################
+## SVGElementInstanceList
+#########################################################################*/
+
+/**
+ *
+ */
+unsigned long SVGElementInstanceList::getLength()
+{ return items.size(); }
+
+/**
+ *
+ */
+SVGElementInstance SVGElementInstanceList::item(unsigned long index)
+{
+ if (index >= items.size())
+ {
+ SVGElementInstance ret;
+ return ret;
+ }
+ return items[index];
+}
+
+/**
+ * This static method replaces the circular definition of:
+ * SVGElementInstanceList SVGElementInstance::getChildNodes()
+ *
+ */
+static SVGElementInstanceList SVGElementInstanceList::getChildNodes(const SVGElementInstance &/*instance*/)
+{
+ SVGElementInstanceList list;
+ return list;
+}
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGElementInstanceList::SVGElementInstanceList()
+{
+}
+
+/**
+ *
+ */
+SVGElementInstanceList::SVGElementInstanceList(const SVGElementInstanceList &other)
+{
+ items = other.items;
+}
+
+/**
+ *
+ */
+SVGElementInstanceList::~SVGElementInstanceList()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGValue
+#########################################################################*/
+
+/**
+ * Constructor
+ */
+SVGValue()
+{
+ init();
+}
+
+/**
+ * Copy constructor
+ */
+SVGValue(const SVGValue &other)
+{
+ assign(other);
+}
+
+/**
+ * Assignment
+ */
+SVGValue &operator=(const SVGValue &other)
+{
+ assign(other);
+ return *this;
+}
+
+/**
+ *
+ */
+~SVGValue()
+{
+}
+
+//###########################
+// TYPES
+//###########################
+
+/**
+ * Angle
+ */
+SVGValue::SVGValue(const SVGAngle &v)
+{
+ type = SVG_ANGLE;
+ angleval = v;
+}
+
+SVGAngle SVGValue::angleValue()
+{
+ return algleval;
+}
+
+/**
+ * Boolean
+ */
+SVGValue::SVGValue(bool v)
+{
+ type = SVG_BOOLEAN;
+ bval = v;
+}
+
+bool SVGValue::booleanValue()
+{
+ return bval;
+}
+
+
+/**
+ * Enumeration
+ */
+SVGValue::SVGValue(short v)
+{
+ type = SVG_ENUMERATION;
+ eval = v;
+}
+
+short SVGValue::enumerationValue()
+{
+ return eval;
+}
+
+/**
+ * Integer
+ */
+SVGValue::SVGValue(long v)
+{
+ type = SVG_INTEGER;
+ ival = v;
+}
+
+long SVGValue::integerValue()
+{
+ return ival;
+}
+
+/**
+ * Length
+ */
+SVGValue::SVGValue(const SVGLength &v)
+{
+ type = SVG_LENGTH;
+ lengthval = v;
+}
+
+SVGLength SVGValue::lengthValue()
+{
+ return lengthval;
+}
+
+/**
+ * Number
+ */
+SVGValue::SVGValue(double v)
+{
+ type = SVG_NUMBER;
+ dval = v;
+}
+
+double SVGValue::numberValue()
+{
+ return dval;
+}
+
+/**
+ * Points
+ */
+SVGValue::SVGValue(const SVGPointList &v)
+{
+ type = SVG_POINTS;
+ plistval = v;
+}
+
+SVGPointList SVGValue::pointListValue()
+{
+ return plistval;
+}
+
+
+/**
+ * PreserveAspectRatio
+ */
+SVGValue::SVGValue(const SVGPreserveAspectRatio &v)
+{
+ type = SVG_PRESERVE_ASPECT_RATIO;
+ parval = v;
+}
+
+SVGPreserveAspectRatio SVGValue::preserveAspectRatioValue()
+{
+ return parval;
+}
+
+/**
+ * Rect
+ */
+SVGValue::SVGValue(const SVGRect &v)
+{
+ type = SVG_RECT;
+ rectval = v;
+}
+
+SVGRect SVGValue::rectValue()
+{
+ return rectval;
+}
+
+/**
+ * String
+ */
+SVGValue::SVGValue(const DOMString &v)
+{
+ type = SVG_STRING;
+ sval = v;
+}
+
+DOMString SVGValue::stringValue()
+{
+ return sval;
+}
+
+
+void SVGValue::init()
+{
+ type = SVG_NUMBER;
+ bval = false;
+ eval = 0;
+ ival = 0;
+ dval = 0.0;
+}
+
+void SVGValue::assign(const SVGValue &other)
+{
+ type = other.type;
+ angleval = other.angleval;
+ bval = other.bval;
+ eval = other.eval;
+ ival = other.ival;
+ lengthval = other.lengthval;
+ dval = other.dval;
+ parval = other.parval;
+ rval = other.rval;
+ sval = other.sval;
+}
+
+
+/*#########################################################################
+## SVGTransformList
+#########################################################################*/
+
+
+/*#########################################################################
+## SVGStringList
+#########################################################################*/
+
+
+/*#########################################################################
+## SVGNumberList
+#########################################################################*/
+
+
+/*#########################################################################
+## SVGLengthList
+#########################################################################*/
+
+
+/*#########################################################################
+## SVGPointList
+#########################################################################*/
+
+/*#########################################################################
+## SVGPathSegList
+#########################################################################*/
+
+/*#########################################################################
+## SVGValueList
+#########################################################################*/
+
+
+/**
+ *
+ */
+unsigned long SVGValueList::getNumberOfItems()
+{
+ return items.size();
+}
+
+/**
+ *
+ */
+void SVGValueList::clear() throw (DOMException)
+{
+ items.clear();
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::initialize(const SVGValue& newItem)
+ throw (DOMException, SVGException)
+{
+ items.clear();
+ items.push_back(newItem);
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::getItem(unsigned long index) throw (DOMException)
+{
+ if (index >= items.size())
+ return "";
+ return items[index];
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::insertItemBefore(const SVGValue& newItem,
+ unsigned long index)
+ throw (DOMException, SVGException)
+{
+ if (index>=items.size())
+ {
+ items.push_back(newItem);
+ }
+ else
+ {
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ items.insert(iter, newItem);
+ }
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::replaceItem (const SVGValue& newItem,
+ unsigned long index)
+ throw (DOMException, SVGException)
+{
+ if (index>=items.size())
+ return "";
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ *iter = newItem;
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::removeItem (unsigned long index)
+ throw (DOMException)
+{
+ if (index>=items.size())
+ return "";
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ SVGValue oldval = *iter;
+ items.erase(iter);
+ return oldval;
+}
+
+/**
+ *
+ */
+SVGValue SVGValueList::appendItem (const SVGValue& newItem)
+ throw (DOMException, SVGException)
+{
+ items.push_back(newItem);
+ return newItem;
+}
+
+
+/**
+ * Matrix
+ */
+SVGValue SVGValueList::createSVGTransformFromMatrix(const SVGValue &matrix)
+{
+}
+
+/**
+ * Matrix
+ */
+SVGValue SVGValueList::consolidate()
+{
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGValueList::SVGValueList()
+{
+}
+
+/**
+ *
+ */
+SVGValueList::SVGValueList(const SVGValueList &other)
+{
+ items = other.items;
+}
+
+/**
+ *
+ */
+SVGValueList::~SVGValueList()
+{
+}
+
+
+
+
+
+/*#########################################################################
+## SVGAnimatedValue
+#########################################################################*/
+
+
+
+
+/**
+ *
+ */
+SVGValue &SVGAnimatedValue::getBaseVal()
+{
+ return baseVal;
+}
+
+/**
+ *
+ */
+void SVGAnimatedValue::setBaseVal(const SVGValue &val) throw (DOMException)
+{
+ baseVal = val;
+}
+
+/**
+ *
+ */
+SVGValue &SVGAnimatedValue::getAnimVal()
+{
+ return animVal;
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue::SVGAnimatedValue()
+{
+ init();
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue::SVGAnimatedValue(const SVGValue &v)
+{
+ init();
+ baseVal = v;
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue::SVGAnimatedValue(const SVGValue &bv, const SVGValue &av)
+{
+ init();
+ baseVal = bv;
+ animVal = av;
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue::SVGAnimatedValue(const SVGAnimatedValue &other)
+{
+ assign(other);
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue &SVGAnimatedValue::operator=(const SVGAnimatedValue &other)
+{
+ assign(other);
+ return *this;
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue &SVGAnimatedValue::operator=(const SVGValue &bv)
+{
+ init();
+ baseVal = bv;
+}
+
+
+/**
+ *
+ */
+SVGAnimatedValue::~SVGAnimatedValue()
+{
+}
+
+
+
+void SVGAnimatedValue::init()
+{
+}
+
+
+void SVGAnimatedValue::assign(const SVGAnimatedValue &other)
+{
+ baseVal = other.baseVal;
+ animVal = other.animVal;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//########################################################################
+//########################################################################
+//########################################################################
+//# D O M
+//########################################################################
+//########################################################################
+//########################################################################
+
+
+
+
+
+
+
+/*#########################################################################
+## SVGElement
+#########################################################################*/
+
+
+//####################################################################
+//# BASE METHODS FOR SVGElement
+//####################################################################
+
+/**
+ * Get the value of the id attribute on the given element.
+ */
+DOMString getId()
+{
+}
+
+/**
+ * Set the value of the id attribute on the given element.
+ */
+void setId(const DOMString &val) throw (DOMException)
+{
+}
+
+
+/**
+ * Corresponds to attribute xml:base on the given element.
+ */
+DOMString getXmlBase()
+{
+}
+
+
+/**
+ * Corresponds to attribute xml:base on the given element.
+ */
+void setXmlBase(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * The nearest ancestor 'svg' element. Null if the given element is the
+ * outermost 'svg' element.
+ */
+SVGElementPtr getOwnerSVGElement()
+{
+}
+
+/**
+ * The element which established the current viewport. Often, the nearest
+ * ancestor 'svg' element. Null if the given element is the outermost 'svg'
+ * element.
+ */
+SVGElementPtr getViewportElement()
+{
+}
+
+
+//####################################################################
+//####################################################################
+//# I N T E R F A C E S
+//####################################################################
+//####################################################################
+
+//####################################################################
+//# SVGAngle
+//####################################################################
+
+/**
+ *
+ */
+unsigned short getUnitType()
+{
+}
+
+/**
+ *
+ */
+double getValue()
+{
+}
+
+/**
+ *
+ */
+void setValue(double val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+double getValueInSpecifiedUnits()
+{
+}
+
+/**
+ *
+ */
+void setValueInSpecifiedUnits(double /*val*/) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+DOMString getValueAsString()
+{
+}
+
+/**
+ *
+ */
+void setValueAsString(const DOMString &/*val*/) throw (DOMException)
+{
+}
+
+
+/**
+ *
+ */
+void newValueSpecifiedUnits(unsigned short /*unitType*/,
+ double /*valueInSpecifiedUnits*/)
+{
+}
+
+/**
+ *
+ */
+void convertToSpecifiedUnits(unsigned short /*unitType*/)
+{
+}
+
+//####################################################################
+//## The following animated types are rolled up into a single
+//## SVGAnimatedValue interface
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedAngle
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedBoolean
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedEnumeration
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedInteger
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedLength
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedLengthList
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedNumber
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedNumberList
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedPathData
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedPoints
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedPreserveAspectRatio
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedRect
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedString
+//####################################################################
+
+//####################################################################
+//## SVGAnimatedTransformList
+//####################################################################
+
+//####################################################################
+//# SVGAnimatedValue
+//####################################################################
+
+/**
+ *
+ */
+SVGValue &getBaseVal()
+{
+ return baseVal();
+}
+
+/**
+ *
+ */
+void setBaseVal(const SVGValue &val) throw (DOMException)
+{
+ baseVal = val;
+}
+
+/**
+ *
+ */
+SVGValue &getAnimVal()
+{
+ return animVal;
+}
+
+
+
+//####################################################################
+//# SVGColor
+//####################################################################
+
+/**
+ * From CSSValue
+ * A code defining the type of the value as defined above.
+ */
+unsigned short getCssValueType()
+{
+}
+
+/**
+ * From CSSValue
+ * A string representation of the current value.
+ */
+DOMString getCssText()
+{
+}
+
+/**
+ * From CSSValue
+ * A string representation of the current value.
+ * Note that setting implies parsing.
+ */
+void setCssText(const DOMString &val) throw (dom::DOMException)
+{
+}
+
+
+/**
+ *
+ */
+unsigned short getColorType()
+{
+}
+
+/**
+ *
+ */
+css::RGBColor getRgbColor()
+{
+}
+
+/**
+ *
+ */
+SVGICCColor getIccColor()
+{
+}
+
+
+/**
+ *
+ */
+void setRGBColor(const DOMString& /*rgbColor*/) throw (SVGException)
+{
+}
+
+/**
+ *
+ */
+void setRGBColorICCColor(const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw (SVGException)
+{
+}
+
+/**
+ *
+ */
+void setColor(unsigned short /*colorType*/,
+ const DOMString& /*rgbColor*/,
+ const DOMString& /*iccColor*/)
+ throw (SVGException)
+{
+}
+
+//####################################################################
+//# SVGCSSRule
+//####################################################################
+
+/**
+ * From CSSRule
+ * The type of the rule, as defined above. The expectation is that
+ * binding-specific casting methods can be used to cast down from an instance of
+ * the CSSRule interface to the specific derived interface implied by the type.
+ */
+unsigned short getType()
+{
+}
+
+/**
+ * From CSSRule
+ * The parsable textual representation of the rule. This reflects the current
+ * state of the rule and not its initial value.
+ */
+DOMString getCssText()
+{
+}
+
+/**
+ * From CSSRule
+ * The parsable textual representation of the rule. This reflects the current
+ * state of the rule and not its initial value.
+ * Note that setting involves reparsing.
+ */
+void setCssText(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * From CSSRule
+ * The style sheet that contains this rule.
+ */
+css::CSSStyleSheet *getParentStyleSheet()
+{
+}
+
+/**
+ * From CSSRule
+ * If this rule is contained inside another rule(e.g. a style rule inside an
+ * @media block), this is the containing rule. If this rule is not nested inside
+ * any other rules, this returns null.
+ */
+css::CSSRule *getParentRule()
+{
+}
+
+//####################################################################
+//# SVGExternalResourcesRequired
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedBoolean getExternalResourcesRequired()
+{
+}
+
+//####################################################################
+//# SVGFitToViewBox
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedRect getViewBox()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
+{
+}
+
+//####################################################################
+//# SVGICCColor
+//####################################################################
+
+/**
+ *
+ */
+DOMString getColorProfile()
+{
+}
+
+/**
+ *
+ */
+void setColorProfile(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+SVGNumberList &getColors()
+{
+}
+
+//####################################################################
+//# SVGLangSpace
+//####################################################################
+
+/**
+ *
+ */
+DOMString getXmllang()
+{
+}
+
+/**
+ *
+ */
+void setXmllang(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+DOMString getXmlspace()
+{
+}
+
+/**
+ *
+ */
+void setXmlspace(const DOMString &val) throw (DOMException)
+{
+}
+
+//####################################################################
+//# SVGLength
+//####################################################################
+
+/**
+ *
+ */
+unsigned short getUnitType()
+{
+}
+
+/**
+ *
+ */
+double getValue()
+{
+}
+
+/**
+ *
+ */
+void setValue(double val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+double getValueInSpecifiedUnits()
+{
+}
+
+/**
+ *
+ */
+void setValueInSpecifiedUnits(double /*val*/) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+DOMString getValueAsString()
+{
+}
+
+/**
+ *
+ */
+void setValueAsString(const DOMString& /*val*/) throw (DOMException)
+{
+}
+
+
+/**
+ *
+ */
+void newValueSpecifiedUnits(unsigned short /*unitType*/, double /*val*/)
+{
+}
+
+/**
+ *
+ */
+void convertToSpecifiedUnits(unsigned short /*unitType*/)
+{
+}
+
+
+//####################################################################
+//## SVGLengthList - see SVGValueList
+//####################################################################
+
+
+
+//####################################################################
+//# SVGLocatable
+//####################################################################
+
+/**
+ *
+ */
+SVGElementPtr getNearestViewportElement()
+{
+}
+
+/**
+ *
+ */
+SVGElement *getFarthestViewportElement()
+{
+}
+
+/**
+ *
+ */
+SVGRect getBBox()
+{
+}
+
+/**
+ *
+ */
+SVGMatrix getCTM()
+{
+}
+
+/**
+ *
+ */
+SVGMatrix getScreenCTM()
+{
+}
+
+/**
+ *
+ */
+SVGMatrix getTransformToElement(const SVGElement &/*element*/)
+ throw (SVGException)
+{
+}
+
+//####################################################################
+//# SVGNumber
+//####################################################################
+
+/**
+ *
+ */
+double getValue()
+{
+}
+
+/**
+ *
+ */
+void setValue(double val) throw (DOMException)
+{
+}
+
+//####################################################################
+//# SVGNumberList - see SVGValueList
+//####################################################################
+
+
+//####################################################################
+//# SVGRect
+//####################################################################
+
+/**
+ *
+ */
+double getX()
+{
+}
+
+/**
+ *
+ */
+void setX(double val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+double getY()
+{
+}
+
+/**
+ *
+ */
+void setY(double val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+double getWidth()
+{
+}
+
+/**
+ *
+ */
+void setWidth(double val) throw (DOMException)
+{
+}
+
+/**
+ *
+ */
+double getHeight()
+{
+}
+
+/**
+ *
+ */
+void setHeight(double val) throw (DOMException)
+{
+}
+
+//####################################################################
+//# SVGRenderingIntent
+//####################################################################
+
+//####################################################################
+//# SVGStringList - see SVGValueList
+//####################################################################
+
+//####################################################################
+//# SVGStylable
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedString getClassName()
+{
+}
+
+/**
+ *
+ */
+css::CSSStyleDeclaration getStyle()
+{
+}
+
+/**
+ *
+ */
+css::CSSValue getPresentationAttribute(const DOMString& /*name*/)
+{
+}
+
+//####################################################################
+//# SVGTests
+//####################################################################
+
+/**
+ *
+ */
+SVGValueList &getRequiredFeatures()
+{
+}
+
+/**
+ *
+ */
+SVGValueList &getRequiredExtensions()
+{
+}
+
+/**
+ *
+ */
+SVGValueList &getSystemLanguage()
+{
+}
+
+/**
+ *
+ */
+bool hasExtension(const DOMString& /*extension*/)
+{
+}
+
+//####################################################################
+//# SVGTransformable
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedList &getTransform()
+{
+}
+
+//####################################################################
+//# SVGUnitTypes
+//####################################################################
+
+//####################################################################
+//# SVGURIReference
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedValue getHref()
+{
+}
+
+//####################################################################
+//## SVGValueList - consolidation of other lists
+//####################################################################
+
+/**
+ *
+ */
+unsigned long SVGElement::getNumberOfItems()
+{
+ return items.size();
+}
+
+/**
+ *
+ */
+void SVGElement::clear() throw (DOMException)
+{
+ items.clear();
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::initialize(const SVGValue& newItem)
+ throw (DOMException, SVGException)
+{
+ items.clear();
+ items.push_back(newItem);
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::getItem(unsigned long index) throw (DOMException)
+{
+ if (index >= items.size())
+ return "";
+ return items[index];
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::insertItemBefore(const SVGValue& newItem,
+ unsigned long index)
+ throw (DOMException, SVGException)
+{
+ if (index>=items.size())
+ {
+ items.push_back(newItem);
+ }
+ else
+ {
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ items.insert(iter, newItem);
+ }
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::replaceItem (const SVGValue& newItem,
+ unsigned long index)
+ throw (DOMException, SVGException)
+{
+ if (index>=items.size())
+ return "";
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ *iter = newItem;
+ return newItem;
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::removeItem (unsigned long index)
+ throw (DOMException)
+{
+ if (index>=items.size())
+ return "";
+ std::vector<SVGValue>::iterator iter = items.begin() + index;
+ SVGValue oldval = *iter;
+ items.erase(iter);
+ return oldval;
+}
+
+/**
+ *
+ */
+SVGValue SVGElement::appendItem (const SVGValue& newItem)
+ throw (DOMException, SVGException)
+{
+ items.push_back(newItem);
+ return newItem;
+}
+
+
+/**
+ * Matrix
+ */
+SVGValue SVGElement::createSVGTransformFromMatrix(const SVGValue &matrix)
+{
+}
+
+/**
+ * Matrix
+ */
+SVGValue SVGElement::consolidate()
+{
+}
+
+
+//####################################################################
+//# SVGViewSpec
+//####################################################################
+
+/**
+ *
+ */
+//SVGTransformList getTransform()
+//{
+//}
+
+/**
+ *
+ */
+SVGElementPtr getViewTarget()
+{
+}
+
+/**
+ *
+ */
+DOMString getViewBoxString()
+{
+}
+
+/**
+ *
+ */
+DOMString getPreserveAspectRatioString()
+{
+}
+
+/**
+ *
+ */
+DOMString getTransformString()
+{
+}
+
+/**
+ *
+ */
+DOMString getViewTargetString()
+{
+}
+
+//####################################################################
+//# SVGZoomAndPan
+//####################################################################
+
+/**
+ *
+ */
+unsigned short getZoomAndPan()
+{
+}
+
+/**
+ *
+ */
+void setZoomAndPan(unsigned short val) throw (DOMException)
+{
+}
+
+//####################################################################
+//####################################################################
+//# E L E M E N T S
+//####################################################################
+//####################################################################
+
+//####################################################################
+//# SVGAElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedString getTarget()
+{
+}
+
+
+
+//####################################################################
+//# SVGAltGlyphElement
+//####################################################################
+
+
+/**
+ * Get the attribute glyphRef on the given element.
+ */
+DOMString getGlyphRef()
+{
+}
+
+/**
+ * Set the attribute glyphRef on the given element.
+ */
+void setGlyphRef(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute format on the given element.
+ */
+DOMString getFormat()
+{
+}
+
+/**
+ * Set the attribute format on the given element.
+ */
+void setFormat(const DOMString &val) throw (DOMException)
+{
+}
+
+
+//####################################################################
+//# SVGAltGlyphDefElement
+//####################################################################
+
+//####################################################################
+//# SVGAltGlyphItemElement
+//####################################################################
+
+
+//####################################################################
+//# SVGAnimateElement
+//####################################################################
+
+
+//####################################################################
+//# SVGAnimateColorElement
+//####################################################################
+
+//####################################################################
+//# SVGAnimateMotionElement
+//####################################################################
+
+
+//####################################################################
+//# SVGAnimateTransformElement
+//####################################################################
+
+
+//####################################################################
+//# SVGAnimationElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGElementPtr getTargetElement()
+{
+}
+
+/**
+ *
+ */
+double getStartTime()
+{
+}
+
+/**
+ *
+ */
+double getCurrentTime()
+{
+}
+
+/**
+ *
+ */
+double getSimpleDuration() throw (DOMException)
+{
+}
+
+
+
+//####################################################################
+//# SVGCircleElement
+//####################################################################
+
+/**
+ * Corresponds to attribute cx on the given 'circle' element.
+ */
+SVGAnimatedLength getCx()
+{
+}
+
+/**
+ * Corresponds to attribute cy on the given 'circle' element.
+ */
+SVGAnimatedLength getCy()
+{
+}
+
+/**
+ * Corresponds to attribute r on the given 'circle' element.
+ */
+SVGAnimatedLength getR()
+{
+}
+
+//####################################################################
+//# SVGClipPathElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute clipPathUnits on the given 'clipPath' element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getClipPathUnits()
+{
+}
+
+
+
+//####################################################################
+//# SVGColorProfileElement
+//####################################################################
+
+
+/**
+ * Get the attribute local on the given element.
+ */
+DOMString getLocal()
+{
+}
+
+/**
+ * Set the attribute local on the given element.
+ */
+void setLocal(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute name on the given element.
+ */
+DOMString getName()
+{
+}
+
+/**
+ * Set the attribute name on the given element.
+ */
+void setName(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Set the attribute rendering-intent on the given element.
+ * The type of rendering intent, identified by one of the
+ * SVGRenderingIntent constants.
+ */
+unsigned short getRenderingIntent()
+{
+}
+
+/**
+ * Get the attribute rendering-intent on the given element.
+ */
+void setRenderingIntent(unsigned short val) throw (DOMException)
+{
+}
+
+
+//####################################################################
+//# SVGComponentTransferFunctionElement
+//####################################################################
+
+/**
+ * Corresponds to attribute type on the given element. Takes one
+ * of the Component Transfer Types.
+ */
+SVGAnimatedEnumeration getType()
+{
+}
+
+/**
+ * Corresponds to attribute tableValues on the given element.
+ */
+SVGAnimatedNumberList getTableValues()
+{
+}
+
+/**
+ * Corresponds to attribute slope on the given element.
+ */
+SVGAnimatedNumber getSlope()
+{
+}
+
+/**
+ * Corresponds to attribute intercept on the given element.
+ */
+SVGAnimatedNumber getIntercept()
+{
+}
+
+/**
+ * Corresponds to attribute amplitude on the given element.
+ */
+SVGAnimatedNumber getAmplitude()
+{
+}
+
+/**
+ * Corresponds to attribute exponent on the given element.
+ */
+SVGAnimatedNumber getExponent()
+{
+}
+
+/**
+ * Corresponds to attribute offset on the given element.
+ */
+SVGAnimatedNumber getOffset()
+{
+}
+
+//####################################################################
+//# SVGCursorElement
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getY()
+{
+}
+
+
+//####################################################################
+//# SVGDefinitionSrcElement
+//####################################################################
+
+//####################################################################
+//# SVGDefsElement
+//####################################################################
+
+//####################################################################
+//# SVGDescElement
+//####################################################################
+
+//####################################################################
+//# SVGEllipseElement
+//####################################################################
+
+/**
+ * Corresponds to attribute cx on the given 'ellipse' element.
+ */
+SVGAnimatedLength getCx()
+{
+}
+
+/**
+ * Corresponds to attribute cy on the given 'ellipse' element.
+ */
+SVGAnimatedLength getCy()
+{
+}
+
+/**
+ * Corresponds to attribute rx on the given 'ellipse' element.
+ */
+SVGAnimatedLength getRx()
+{
+}
+
+/**
+ * Corresponds to attribute ry on the given 'ellipse' element.
+ */
+SVGAnimatedLength getRy()
+{
+}
+
+
+//####################################################################
+//# SVGFEBlendElement
+//####################################################################
+
+/**
+ * Corresponds to attribute in on the given 'feBlend' element.
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ * Corresponds to attribute in2 on the given 'feBlend' element.
+ */
+SVGAnimatedString getIn2()
+{
+}
+
+/**
+ * Corresponds to attribute mode on the given 'feBlend' element.
+ * Takes one of the Blend Mode Types.
+ */
+SVGAnimatedEnumeration getMode()
+{
+}
+
+
+//####################################################################
+//# SVGFEColorMatrixElement
+//####################################################################
+
+/**
+ * Corresponds to attribute in on the given 'feColorMatrix' element.
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ * Corresponds to attribute type on the given 'feColorMatrix' element.
+ * Takes one of the Color Matrix Types.
+ */
+SVGAnimatedEnumeration getType()
+{
+}
+
+/**
+ * Corresponds to attribute values on the given 'feColorMatrix' element.
+ * Provides access to the contents of the values attribute.
+ */
+SVGAnimatedNumberList getValues()
+{
+}
+
+
+//####################################################################
+//# SVGFEComponentTransferElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute in on the given 'feComponentTransfer' element.
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+//####################################################################
+//# SVGFECompositeElement
+//####################################################################
+
+/**
+ * Corresponds to attribute in on the given 'feComposite' element.
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ * Corresponds to attribute in2 on the given 'feComposite' element.
+ */
+SVGAnimatedString getIn2()
+{
+}
+
+/**
+ * Corresponds to attribute operator on the given 'feComposite' element.
+ * Takes one of the Composite Operators.
+ */
+SVGAnimatedEnumeration getOperator()
+{
+}
+
+/**
+ * Corresponds to attribute k1 on the given 'feComposite' element.
+ */
+SVGAnimatedNumber getK1()
+{
+}
+
+/**
+ * Corresponds to attribute k2 on the given 'feComposite' element.
+ */
+SVGAnimatedNumber getK2()
+{
+}
+
+/**
+ * Corresponds to attribute k3 on the given 'feComposite' element.
+ */
+SVGAnimatedNumber getK3()
+{
+}
+
+/**
+ * Corresponds to attribute k4 on the given 'feComposite' element.
+ */
+SVGAnimatedNumber getK4()
+{
+}
+
+
+//####################################################################
+//# SVGFEConvolveMatrixElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute order on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedInteger getOrderX()
+{
+}
+
+/**
+ * Corresponds to attribute order on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedInteger getOrderY()
+{
+}
+
+/**
+ * Corresponds to attribute kernelMatrix on the given element.
+ */
+SVGAnimatedNumberList getKernelMatrix()
+{
+}
+
+/**
+ * Corresponds to attribute divisor on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedNumber getDivisor()
+{
+}
+
+/**
+ * Corresponds to attribute bias on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedNumber getBias()
+{
+}
+
+/**
+ * Corresponds to attribute targetX on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedInteger getTargetX()
+{
+}
+
+/**
+ * Corresponds to attribute targetY on the given 'feConvolveMatrix' element.
+ */
+SVGAnimatedInteger getTargetY()
+{
+}
+
+/**
+ * Corresponds to attribute edgeMode on the given 'feConvolveMatrix'
+ * element. Takes one of the Edge Mode Types.
+ */
+SVGAnimatedEnumeration getEdgeMode()
+{
+}
+
+/**
+ * Corresponds to attribute kernelUnitLength on the
+ * given 'feConvolveMatrix' element.
+ */
+SVGAnimatedLength getKernelUnitLengthX()
+{
+}
+
+/**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feConvolveMatrix' element.
+ */
+SVGAnimatedLength getKernelUnitLengthY()
+{
+}
+
+/**
+ * Corresponds to attribute preserveAlpha on the
+ * given 'feConvolveMatrix' element.
+ */
+SVGAnimatedBoolean getPreserveAlpha()
+{
+}
+
+
+
+//####################################################################
+//# SVGFEDiffuseLightingElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute in on the given 'feDiffuseLighting' element.
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ * Corresponds to attribute surfaceScale on the given
+ * 'feDiffuseLighting' element.
+ */
+SVGAnimatedNumber getSurfaceScale()
+{
+}
+
+/**
+ * Corresponds to attribute diffuseConstant on the given
+ * 'feDiffuseLighting' element.
+ */
+SVGAnimatedNumber getDiffuseConstant()
+{
+}
+
+/**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feDiffuseLighting' element.
+ */
+SVGAnimatedNumber getKernelUnitLengthX()
+{
+}
+
+/**
+ * Corresponds to attribute kernelUnitLength on the given
+ * 'feDiffuseLighting' element.
+ */
+SVGAnimatedNumber getKernelUnitLengthY()
+{
+}
+
+
+
+
+//####################################################################
+//# SVGFEDisplacementMapElement
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedString getIn2()
+{
+}
+
+
+/**
+ *
+ */
+SVGAnimatedNumber getScale()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedEnumeration getXChannelSelector()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedEnumeration getYChannelSelector()
+{
+}
+
+//####################################################################
+//# SVGFEDistantLightElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute azimuth on the given 'feDistantLight' element.
+ */
+SVGAnimatedNumber getAzimuth()
+{
+}
+
+
+/**
+ * Corresponds to attribute elevation on the given 'feDistantLight'
+ * element
+ */
+SVGAnimatedNumber getElevation()
+{
+}
+
+
+//####################################################################
+//# SVGFEFloodElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+
+//####################################################################
+//# SVGFEFuncAElement
+//####################################################################
+
+//####################################################################
+//# SVGFEFuncBElement
+//####################################################################
+
+//####################################################################
+//# SVGFEFuncGElement
+//####################################################################
+
+//####################################################################
+//# SVGFEFuncRElement
+//####################################################################
+
+
+//####################################################################
+//# SVGFEGaussianBlurElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+
+/**
+ *
+ */
+SVGAnimatedNumber getStdDeviationX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getStdDeviationY()
+{
+}
+
+
+/**
+ *
+ */
+void setStdDeviation(double stdDeviationX, double stdDeviationY)
+{
+}
+
+
+//####################################################################
+//# SVGFEImageElement
+//####################################################################
+
+
+//####################################################################
+//# SVGFEMergeElement
+//####################################################################
+
+//####################################################################
+//# SVGFEMergeNodeElement
+//####################################################################
+
+//####################################################################
+//# SVGFEMorphologyElement
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+
+/**
+ *
+ */
+SVGAnimatedEnumeration getOperator()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getRadiusX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getRadiusY()
+{
+}
+
+//####################################################################
+//# SVGFEOffsetElement
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getDx()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getDy()
+{
+}
+
+
+//####################################################################
+//# SVGFEPointLightElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'fePointLight' element.
+ */
+SVGAnimatedNumber getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'fePointLight' element.
+ */
+SVGAnimatedNumber getY()
+{
+}
+
+/**
+ * Corresponds to attribute z on the given 'fePointLight' element.
+ */
+SVGAnimatedNumber getZ()
+{
+}
+
+//####################################################################
+//# SVGFESpecularLightingElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getSurfaceScale()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getSpecularConstant()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getSpecularExponent()
+{
+}
+
+
+//####################################################################
+//# SVGFESpotLightElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getY()
+{
+}
+
+/**
+ * Corresponds to attribute z on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getZ()
+{
+}
+
+/**
+ * Corresponds to attribute pointsAtX on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getPointsAtX()
+{
+}
+
+/**
+ * Corresponds to attribute pointsAtY on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getPointsAtY()
+{
+}
+
+/**
+ * Corresponds to attribute pointsAtZ on the given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getPointsAtZ()
+{
+}
+
+/**
+ * Corresponds to attribute specularExponent on the
+ * given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getSpecularExponent()
+{
+}
+
+/**
+ * Corresponds to attribute limitingConeAngle on the
+ * given 'feSpotLight' element.
+ */
+SVGAnimatedNumber getLimitingConeAngle()
+{
+}
+
+
+//####################################################################
+//# SVGFETileElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedString getIn1()
+{
+}
+
+
+//####################################################################
+//# SVGFETurbulenceElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGAnimatedNumber getBaseFrequencyX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getBaseFrequencyY()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedInteger getNumOctaves()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedNumber getSeed()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedEnumeration getStitchTiles()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedEnumeration getType()
+{
+}
+
+
+
+//####################################################################
+//# SVGFilterElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute filterUnits on the given 'filter' element. Takes one
+ * of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getFilterUnits()
+{
+}
+
+/**
+ * Corresponds to attribute primitiveUnits on the given 'filter' element. Takes
+ * one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getPrimitiveUnits()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute x on the given 'filter' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'filter' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'filter' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+
+/**
+ * Corresponds to attribute filterRes on the given 'filter' element.
+ * Contains the X component of attribute filterRes.
+ */
+SVGAnimatedInteger getFilterResX()
+{
+}
+
+/**
+ * Corresponds to attribute filterRes on the given 'filter' element.
+ * Contains the Y component(possibly computed automatically)
+ * of attribute filterRes.
+ */
+SVGAnimatedInteger getFilterResY()
+{
+}
+
+/**
+ * Sets the values for attribute filterRes.
+ */
+void setFilterRes(unsigned long filterResX, unsigned long filterResY)
+{
+}
+
+
+//####################################################################
+//# SVGFontElement
+//####################################################################
+
+//####################################################################
+//# SVGFontFaceElement
+//####################################################################
+
+//####################################################################
+//# SVGFontFaceFormatElement
+//####################################################################
+
+//####################################################################
+//# SVGFontFaceNameElement
+//####################################################################
+
+//####################################################################
+//# SVGFontFaceSrcElement
+//####################################################################
+
+//####################################################################
+//# SVGFontFaceUriElement
+//####################################################################
+
+//####################################################################
+//# SVGForeignObjectElement
+//####################################################################
+
+/**
+ *
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+
+
+//####################################################################
+//# SVGGlyphRefElement
+//####################################################################
+
+
+/**
+ * Get the attribute glyphRef on the given element.
+ */
+DOMString getGlyphRef()
+{
+}
+
+/**
+ * Set the attribute glyphRef on the given element.
+ */
+void setGlyphRef(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute format on the given element.
+ */
+DOMString getFormat()
+{
+}
+
+/**
+ * Set the attribute format on the given element.
+ */
+void setFormat(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute x on the given element.
+ */
+double getX()
+{
+}
+
+/**
+ * Set the attribute x on the given element.
+ */
+void setX(double val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute y on the given element.
+ */
+double getY()
+{
+}
+
+/**
+ * Set the attribute y on the given element.
+ */
+void setY(double val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute dx on the given element.
+ */
+double getDx()
+{
+}
+
+/**
+ * Set the attribute dx on the given element.
+ */
+void setDx(double val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute dy on the given element.
+ */
+double getDy()
+{
+}
+
+/**
+ * Set the attribute dy on the given element.
+ */
+void setDy(double val) throw (DOMException)
+{
+}
+
+
+//####################################################################
+//# SVGGradientElement
+//####################################################################
+
+/**
+ * Corresponds to attribute gradientUnits on the given element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getGradientUnits()
+{
+}
+
+/**
+ * Corresponds to attribute gradientTransform on the given element.
+ */
+SVGAnimatedTransformList getGradientTransform()
+{
+}
+
+/**
+ * Corresponds to attribute spreadMethod on the given element.
+ * One of the Spread Method Types.
+ */
+SVGAnimatedEnumeration getSpreadMethod()
+{
+}
+
+
+
+//####################################################################
+//# SVGHKernElement
+//####################################################################
+
+//####################################################################
+//# SVGImageElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'image' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'image' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'image' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'image' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+
+/**
+ * Corresponds to attribute preserveAspectRatio on the given element.
+ */
+SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
+{
+}
+
+//####################################################################
+//# SVGLinearGradientElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x1 on the given 'linearGradient' element.
+ */
+SVGAnimatedLength getX1()
+{
+}
+
+/**
+ * Corresponds to attribute y1 on the given 'linearGradient' element.
+ */
+SVGAnimatedLength getY1()
+{
+}
+
+/**
+ * Corresponds to attribute x2 on the given 'linearGradient' element.
+ */
+SVGAnimatedLength getX2()
+{
+}
+
+/**
+ * Corresponds to attribute y2 on the given 'linearGradient' element.
+ */
+SVGAnimatedLength getY2()
+{
+}
+
+
+
+//####################################################################
+//# SVGLineElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x1 on the given 'line' element.
+ */
+SVGAnimatedLength getX1()
+{
+}
+
+/**
+ * Corresponds to attribute y1 on the given 'line' element.
+ */
+SVGAnimatedLength getY1()
+{
+}
+
+/**
+ * Corresponds to attribute x2 on the given 'line' element.
+ */
+SVGAnimatedLength getX2()
+{
+}
+
+/**
+ * Corresponds to attribute y2 on the given 'line' element.
+ */
+SVGAnimatedLength getY2()
+{
+}
+
+
+//####################################################################
+//# SVGMarkerElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute refX on the given 'marker' element.
+ */
+SVGAnimatedLength getRefX()
+{
+}
+
+/**
+ * Corresponds to attribute refY on the given 'marker' element.
+ */
+SVGAnimatedLength getRefY()
+{
+}
+
+/**
+ * Corresponds to attribute markerUnits on the given 'marker' element.
+ * One of the Marker Units Types defined above.
+ */
+SVGAnimatedEnumeration getMarkerUnits()
+{
+}
+
+/**
+ * Corresponds to attribute markerWidth on the given 'marker' element.
+ */
+SVGAnimatedLength getMarkerWidth()
+{
+}
+
+/**
+ * Corresponds to attribute markerHeight on the given 'marker' element.
+ */
+SVGAnimatedLength getMarkerHeight()
+{
+}
+
+/**
+ * Corresponds to attribute orient on the given 'marker' element.
+ * One of the Marker Orientation Types defined above.
+ */
+SVGAnimatedEnumeration getOrientType()
+{
+}
+
+/**
+ * Corresponds to attribute orient on the given 'marker' element.
+ * If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for
+ * attribute orient ; otherwise, it will be set to zero.
+ */
+SVGAnimatedAngle getOrientAngle()
+{
+}
+
+
+/**
+ * Sets the value of attribute orient to 'auto'.
+ */
+void setOrientToAuto()
+{
+}
+
+/**
+ * Sets the value of attribute orient to the given angle.
+ */
+void setOrientToAngle(const SVGAngle &angle)
+{
+}
+
+
+//####################################################################
+//# SVGMaskElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute maskUnits on the given 'mask' element. Takes one of
+ * the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getMaskUnits()
+{
+}
+
+/**
+ * Corresponds to attribute maskContentUnits on the given 'mask' element. Takes
+ * one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getMaskContentUnits()
+{
+}
+
+/**
+ * Corresponds to attribute x on the given 'mask' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'mask' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'mask' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'mask' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+//####################################################################
+//# SVGMetadataElement
+//####################################################################
+
+//####################################################################
+//# SVGMissingGlyphElement
+//####################################################################
+
+//####################################################################
+//# SVGMPathElement
+//####################################################################
+
+//####################################################################
+//# SVGPathElement
+//####################################################################
+
+/**
+ * Corresponds to attribute pathLength on the given 'path' element.
+ */
+SVGAnimatedNumber getPathLength()
+{
+}
+
+/**
+ * Returns the user agent's computed value for the total length of the path using
+ * the user agent's distance-along-a-path algorithm, as a distance in the current
+ * user coordinate system.
+ */
+double getTotalLength()
+{
+}
+
+/**
+ * Returns the(x,y) coordinate in user space which is distance units along the
+ * path, utilizing the user agent's distance-along-a-path algorithm.
+ */
+SVGPoint getPointAtLength(double distance)
+{
+}
+
+/**
+ * Returns the index into pathSegList which is distance units along the path,
+ * utilizing the user agent's distance-along-a-path algorithm.
+ */
+unsigned long getPathSegAtLength(double distance)
+{
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegClosePath object.
+ */
+SVGPathSeg createSVGPathSegClosePath()
+{
+ SVGPathSeg seg(PATHSEG_CLOSEPATH);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegMovetoAbs object.
+ */
+SVGPathSeg createSVGPathSegMovetoAbs(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_MOVETO_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegMovetoRel object.
+ */
+SVGPathSeg createSVGPathSegMovetoRel(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_MOVETO_REL);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoAbs object.
+ */
+SVGPathSeg createSVGPathSegLinetoAbs(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoRel object.
+ */
+SVGPathSeg createSVGPathSegLinetoRel(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_REL);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.
+ */
+SVGPathSeg createSVGPathSegCurvetoCubicAbs(double x, double y,
+ double x1, double y1, double x2, double y2)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX1(x1);
+ seg.setY1(y1);
+ seg.setX2(x2);
+ seg.setY2(y2);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.
+ */
+SVGPathSeg createSVGPathSegCurvetoCubicRel(double x, double y,
+ double x1, double y1, double x2, double y2)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_REL);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX1(x1);
+ seg.setY1(y1);
+ seg.setX2(x2);
+ seg.setY2(y2);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.
+ */
+SVGPathSeg createSVGPathSegCurvetoQuadraticAbs(double x, double y,
+ double x1, double y1)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX1(x1);
+ seg.setY1(y1);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.
+ */
+SVGPathSeg createSVGPathSegCurvetoQuadraticRel(double x, double y,
+ double x1, double y1)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_REL);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX1(x1);
+ seg.setY1(y1);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegArcAbs object.
+ */
+SVGPathSeg createSVGPathSegArcAbs(double x, double y,
+ double r1, double r2, double angle,
+ bool largeArcFlag, bool sweepFlag)
+{
+ SVGPathSeg seg(PATHSEG_ARC_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setR1(r1);
+ seg.setR2(r2);
+ seg.setAngle(angle);
+ seg.setLargeArcFlag(largeArcFlag);
+ seg.setSweepFlag(sweepFlag);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegArcRel object.
+ */
+SVGPathSeg createSVGPathSegArcRel(double x, double y, double r1,
+ double r2, double angle, bool largeArcFlag,
+ bool sweepFlag)
+{
+ SVGPathSeg seg(PATHSEG_ARC_REL);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setR1(r1);
+ seg.setR2(r2);
+ seg.setAngle(angle);
+ seg.setLargeArcFlag(largeArcFlag);
+ seg.setSweepFlag(sweepFlag);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.
+ */
+SVGPathSeg createSVGPathSegLinetoHorizontalAbs(double x)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_HORIZONTAL_ABS);
+ seg.setX(x);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.
+ */
+SVGPathSeg createSVGPathSegLinetoHorizontalRel(double x)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_HORIZONTAL_REL);
+ seg.setX(x);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.
+ */
+SVGPathSeg createSVGPathSegLinetoVerticalAbs(double y)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_VERTICAL_ABS);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.
+ */
+SVGPathSeg createSVGPathSegLinetoVerticalRel(double y)
+{
+ SVGPathSeg seg(PATHSEG_LINETO_VERTICAL_REL);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.
+ */
+SVGPathSeg createSVGPathSegCurvetoCubicSmoothAbs(double x, double y,
+ double x2, double y2)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_SMOOTH_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX2(x2);
+ seg.setY2(y2);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.
+ */
+SVGPathSeg createSVGPathSegCurvetoCubicSmoothRel(double x, double y,
+ double x2, double y2)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_CUBIC_SMOOTH_REL);
+ seg.setX(x);
+ seg.setY(y);
+ seg.setX2(x2);
+ seg.setY2(y2);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs
+ * object.
+ */
+SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+/**
+ * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel
+ * object.
+ */
+SVGPathSeg createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y)
+{
+ SVGPathSeg seg(PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
+ seg.setX(x);
+ seg.setY(y);
+ return seg;
+}
+
+
+//####################################################################
+//# SVGPatternElement
+//####################################################################
+
+/**
+ * Corresponds to attribute patternUnits on the given 'pattern' element.
+ * Takes one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getPatternUnits()
+{
+}
+
+/**
+ * Corresponds to attribute patternContentUnits on the given 'pattern'
+ * element. Takes one of the constants defined in SVGUnitTypes.
+ */
+SVGAnimatedEnumeration getPatternContentUnits()
+{
+}
+
+/**
+ * Corresponds to attribute patternTransform on the given 'pattern' element.
+ */
+SVGAnimatedTransformList getPatternTransform()
+{
+}
+
+/**
+ * Corresponds to attribute x on the given 'pattern' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ *
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'pattern' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'pattern' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+
+//####################################################################
+//# SVGPolyLineElement
+//####################################################################
+
+//####################################################################
+//# SVGPolygonElement
+//####################################################################
+
+
+//####################################################################
+//# SVGRadialGradientElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute cx on the given 'radialGradient' element.
+ */
+SVGAnimatedLength getCx()
+{
+}
+
+
+/**
+ * Corresponds to attribute cy on the given 'radialGradient' element.
+ */
+SVGAnimatedLength getCy()
+{
+}
+
+
+/**
+ * Corresponds to attribute r on the given 'radialGradient' element.
+ */
+SVGAnimatedLength getR()
+{
+}
+
+
+/**
+ * Corresponds to attribute fx on the given 'radialGradient' element.
+ */
+SVGAnimatedLength getFx()
+{
+}
+
+
+/**
+ * Corresponds to attribute fy on the given 'radialGradient' element.
+ */
+SVGAnimatedLength getFy()
+{
+}
+
+
+//####################################################################
+//# SVGRectElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'rect' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'rect' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'rect' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'rect' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+
+/**
+ * Corresponds to attribute rx on the given 'rect' element.
+ */
+SVGAnimatedLength getRx()
+{
+}
+
+/**
+ * Corresponds to attribute ry on the given 'rect' element.
+ */
+SVGAnimatedLength getRy()
+{
+}
+
+
+//####################################################################
+//# SVGScriptElement
+//####################################################################
+
+/**
+ *
+ */
+DOMString getType()
+{
+}
+
+/**
+ *
+ */
+void setType(const DOMString &val) throw (DOMException)
+{
+}
+
+//####################################################################
+//# SVGSetElement
+//####################################################################
+
+//####################################################################
+//# SVGStopElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute offset on the given 'stop' element.
+ */
+SVGAnimatedNumber getOffset()
+{
+}
+
+
+//####################################################################
+//# SVGStyleElement
+//####################################################################
+
+/**
+ * Get the attribute xml:space on the given element.
+ */
+DOMString getXmlspace()
+{
+}
+
+/**
+ * Set the attribute xml:space on the given element.
+ */
+void setXmlspace(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute type on the given 'style' element.
+ */
+DOMString getType()
+{
+}
+
+/**
+ * Set the attribute type on the given 'style' element.
+ */
+void setType(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute media on the given 'style' element.
+ */
+DOMString getMedia()
+{
+}
+
+/**
+ * Set the attribute media on the given 'style' element.
+ */
+void setMedia(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * Get the attribute title on the given 'style' element.
+ */
+DOMString getTitle()
+{
+}
+
+/**
+ * Set the attribute title on the given 'style' element.
+ */
+void setTitle(const DOMString &val) throw (DOMException)
+{
+}
+
+//####################################################################
+//# SVGSymbolElement
+//####################################################################
+
+//####################################################################
+//# SVGSVGElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'svg' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'svg' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'svg' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'svg' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+/**
+ * Get the attribute contentScriptType on the given 'svg' element.
+ */
+DOMString getContentScriptType()
+{
+}
+
+/**
+ * Set the attribute contentScriptType on the given 'svg' element.
+ */
+void setContentScriptType(const DOMString &val) throw (DOMException)
+{
+}
+
+
+/**
+ * Get the attribute contentStyleType on the given 'svg' element.
+ */
+DOMString getContentStyleType()
+{
+}
+
+/**
+ * Set the attribute contentStyleType on the given 'svg' element.
+ */
+void setContentStyleType(const DOMString &val) throw (DOMException)
+{
+}
+
+/**
+ * The position and size of the viewport(implicit or explicit) that corresponds
+ * to this 'svg' element. When the user agent is actually rendering the content,
+ * then the position and size values represent the actual values when rendering.
+ * The position and size values are unitless values in the coordinate system of
+ * the parent element. If no parent element exists(i.e., 'svg' element
+ * represents the root of the document tree), if this SVG document is embedded as
+ * part of another document(e.g., via the HTML 'object' element), then the
+ * position and size are unitless values in the coordinate system of the parent
+ * document.(If the parent uses CSS or XSL layout, then unitless values
+ * represent pixel units for the current CSS or XSL viewport, as described in the
+ * CSS2 specification.) If the parent element does not have a coordinate system,
+ * then the user agent should provide reasonable default values for this attribute.
+ */
+SVGRect getViewport()
+{
+}
+
+/**
+ * Size of a pixel units(as defined by CSS2) along the x-axis of the viewport,
+ * which represents a unit somewhere in the range of 70dpi to 120dpi, and, on
+ * systems that support this, might actually match the characteristics of the
+ * target medium. On systems where it is impossible to know the size of a pixel,
+ * a suitable default pixel size is provided.
+ */
+double getPixelUnitToMillimeterX()
+{
+}
+
+/**
+ * Corresponding size of a pixel unit along the y-axis of the viewport.
+ */
+double getPixelUnitToMillimeterY()
+{
+}
+
+/**
+ * User interface(UI) events in DOM Level 2 indicate the screen positions at
+ * which the given UI event occurred. When the user agent actually knows the
+ * physical size of a "screen unit", this attribute will express that information
+{
+}
+ * otherwise, user agents will provide a suitable default value such as .28mm.
+ */
+double getScreenPixelToMillimeterX()
+{
+}
+
+/**
+ * Corresponding size of a screen pixel along the y-axis of the viewport.
+ */
+double getScreenPixelToMillimeterY()
+{
+}
+
+
+/**
+ * The initial view(i.e., before magnification and panning) of the current
+ * innermost SVG document fragment can be either the "standard" view(i.e., based
+ * on attributes on the 'svg' element such as fitBoxToViewport) or to a "custom"
+ * view(i.e., a hyperlink into a particular 'view' or other element - see
+ * Linking into SVG content: URI fragments and SVG views). If the initial view is
+ * the "standard" view, then this attribute is false. If the initial view is a
+ * "custom" view, then this attribute is true.
+ */
+bool getUseCurrentView()
+{
+}
+
+/**
+ * Set the value above
+ */
+void setUseCurrentView(bool val) throw (DOMException)
+{
+}
+
+/**
+ * The definition of the initial view(i.e., before magnification and panning) of
+ * the current innermost SVG document fragment. The meaning depends on the
+ * situation:
+ *
+ * * If the initial view was a "standard" view, then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will match the values for the corresponding DOM attributes that
+ * are on SVGSVGElement directly
+ * o the values for transform and viewTarget within currentView will be null
+ * * If the initial view was a link into a 'view' element, then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will correspond to the corresponding attributes for the given
+ * 'view' element
+ * o the values for transform and viewTarget within currentView will be null
+ * * If the initial view was a link into another element(i.e., other than a
+ * 'view'), then:
+ * o the values for viewBox, preserveAspectRatio and zoomAndPan within
+ * currentView will match the values for the corresponding DOM attributes that
+ * are on SVGSVGElement directly for the closest ancestor 'svg' element
+ * o the values for transform within currentView will be null
+ * o the viewTarget within currentView will represent the target of the link
+ * * If the initial view was a link into the SVG document fragment using an SVG
+ * view specification fragment identifier(i.e., #svgView(...)), then:
+ * o the values for viewBox, preserveAspectRatio, zoomAndPan, transform and
+ * viewTarget within currentView will correspond to the values from the SVG view
+ * specification fragment identifier
+ *
+ */
+SVGViewSpec getCurrentView()
+{
+}
+
+
+/**
+ * This attribute indicates the current scale factor relative to the initial view
+ * to take into account user magnification and panning operations, as described
+ * under Magnification and panning. DOM attributes currentScale and
+ * currentTranslate are equivalent to the 2x3 matrix [a b c d e f] =
+ * [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If
+ * "magnification" is enabled(i.e., zoomAndPan="magnify"), then the effect is as
+ * if an extra transformation were placed at the outermost level on the SVG
+ * document fragment(i.e., outside the outermost 'svg' element).
+ */
+double getCurrentScale()
+{
+}
+
+/**
+ * Set the value above.
+ */
+void setCurrentScale(double val) throw (DOMException)
+{
+}
+
+/**
+ * The corresponding translation factor that takes into account
+ * user "magnification".
+ */
+SVGPoint getCurrentTranslate()
+{
+}
+
+/**
+ * Takes a time-out value which indicates that redraw shall not occur until:(a)
+ * the corresponding unsuspendRedraw(suspend_handle_id) call has been made,(b)
+ * an unsuspendRedrawAll() call has been made, or(c) its timer has timed out. In
+ * environments that do not support interactivity(e.g., print media), then
+ * redraw shall not be suspended. suspend_handle_id =
+ * suspendRedraw(max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id)
+ * must be packaged as balanced pairs. When you want to suspend redraw actions as
+ * a collection of SVG DOM changes occur, then precede the changes to the SVG DOM
+ * with a method call similar to suspend_handle_id =
+ * suspendRedraw(max_wait_milliseconds) and follow the changes with a method call
+ * similar to unsuspendRedraw(suspend_handle_id). Note that multiple
+ * suspendRedraw calls can be used at once and that each such method call is
+ * treated independently of the other suspendRedraw method calls.
+ */
+unsigned long suspendRedraw(unsigned long max_wait_milliseconds)
+{
+}
+
+/**
+ * Cancels a specified suspendRedraw() by providing a unique suspend_handle_id.
+ */
+void unsuspendRedraw(unsigned long suspend_handle_id) throw (DOMException)
+{
+}
+
+/**
+ * Cancels all currently active suspendRedraw() method calls. This method is most
+ * useful at the very end of a set of SVG DOM calls to ensure that all pending
+ * suspendRedraw() method calls have been cancelled.
+ */
+void unsuspendRedrawAll()
+{
+}
+
+/**
+ * In rendering environments supporting interactivity, forces the user agent to
+ * immediately redraw all regions of the viewport that require updating.
+ */
+void forceRedraw()
+{
+}
+
+/**
+ * Suspends(i.e., pauses) all currently running animations that are defined
+ * within the SVG document fragment corresponding to this 'svg' element, causing
+ * the animation clock corresponding to this document fragment to stand still
+ * until it is unpaused.
+ */
+void pauseAnimations()
+{
+}
+
+/**
+ * Unsuspends(i.e., unpauses) currently running animations that are defined
+ * within the SVG document fragment, causing the animation clock to continue from
+ * the time at which it was suspended.
+ */
+void unpauseAnimations()
+{
+}
+
+/**
+ * Returns true if this SVG document fragment is in a paused state.
+ */
+bool animationsPaused()
+{
+}
+
+/**
+ * Returns the current time in seconds relative to the start time for
+ * the current SVG document fragment.
+ */
+double getCurrentTime()
+{
+}
+
+/**
+ * Adjusts the clock for this SVG document fragment, establishing
+ * a new current time.
+ */
+void setCurrentTime(double seconds)
+{
+}
+
+/**
+ * Returns the list of graphics elements whose rendered content intersects the
+ * supplied rectangle, honoring the 'pointer-events' property value on each
+ * candidate graphics element.
+ */
+NodeList getIntersectionList(const SVGRect &rect,
+ const SVGElementPtr referenceElement)
+{
+}
+
+/**
+ * Returns the list of graphics elements whose rendered content is entirely
+ * contained within the supplied rectangle, honoring the 'pointer-events'
+ * property value on each candidate graphics element.
+ */
+NodeList getEnclosureList(const SVGRect &rect,
+ const SVGElementPtr referenceElement)
+{
+}
+
+/**
+ * Returns true if the rendered content of the given element intersects the
+ * supplied rectangle, honoring the 'pointer-events' property value on each
+ * candidate graphics element.
+ */
+bool checkIntersection(const SVGElementPtr element, const SVGRect &rect)
+{
+}
+
+/**
+ * Returns true if the rendered content of the given element is entirely
+ * contained within the supplied rectangle, honoring the 'pointer-events'
+ * property value on each candidate graphics element.
+ */
+bool checkEnclosure(const SVGElementPtr element, const SVGRect &rect)
+{
+}
+
+/**
+ * Unselects any selected objects, including any selections of text
+ * strings and type-in bars.
+ */
+void deselectAll()
+{
+}
+
+/**
+ * Creates an SVGNumber object outside of any document trees. The object
+ * is initialized to a value of zero.
+ */
+SVGNumber createSVGNumber()
+{
+}
+
+/**
+ * Creates an SVGLength object outside of any document trees. The object
+ * is initialized to the value of 0 user units.
+ */
+SVGLength createSVGLength()
+{
+}
+
+/**
+ * Creates an SVGAngle object outside of any document trees. The object
+ * is initialized to the value 0 degrees(unitless).
+ */
+SVGAngle createSVGAngle()
+{
+}
+
+/**
+ * Creates an SVGPoint object outside of any document trees. The object
+ * is initialized to the point(0,0) in the user coordinate system.
+ */
+SVGPoint createSVGPoint()
+{
+}
+
+/**
+ * Creates an SVGMatrix object outside of any document trees. The object
+ * is initialized to the identity matrix.
+ */
+SVGMatrix createSVGMatrix()
+{
+}
+
+/**
+ * Creates an SVGRect object outside of any document trees. The object
+ * is initialized such that all values are set to 0 user units.
+ */
+SVGRect createSVGRect()
+{
+}
+
+/**
+ * Creates an SVGTransform object outside of any document trees.
+ * The object is initialized to an identity matrix transform
+ * (SVG_TRANSFORM_MATRIX).
+ */
+SVGTransform createSVGTransform()
+{
+}
+
+/**
+ * Creates an SVGTransform object outside of any document trees.
+ * The object is initialized to the given matrix transform
+ * (i.e., SVG_TRANSFORM_MATRIX).
+ */
+SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix)
+{
+}
+
+/**
+ * Searches this SVG document fragment(i.e., the search is restricted to a
+ * subset of the document tree) for an Element whose id is given by elementId. If
+ * an Element is found, that Element is returned. If no such element exists,
+ * returns null. Behavior is not defined if more than one element has this id.
+ */
+ElementPtr getElementById(const DOMString& elementId)
+{
+}
+
+
+//####################################################################
+//# SVGTextElement
+//####################################################################
+
+
+//####################################################################
+//# SVGTextContentElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute textLength on the given element.
+ */
+SVGAnimatedLength getTextLength()
+{
+}
+
+
+/**
+ * Corresponds to attribute lengthAdjust on the given element. The value must be
+ * one of the length adjust constants specified above.
+ */
+SVGAnimatedEnumeration getLengthAdjust()
+{
+}
+
+
+/**
+ * Returns the total number of characters to be rendered within the current
+ * element. Includes characters which are included via a 'tref' reference.
+ */
+long getNumberOfChars()
+{
+}
+
+/**
+ * The total sum of all of the advance values from rendering all of the
+ * characters within this element, including the advance value on the glyphs
+ *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'
+ * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'
+ * elements. For non-rendering environments, the user agent shall make reasonable
+ * assumptions about glyph metrics.
+ */
+double getComputedTextLength()
+{
+}
+
+/**
+ * The total sum of all of the advance values from rendering the specified
+ * substring of the characters, including the advance value on the glyphs
+ *(horizontal or vertical), the effect of properties 'kerning', 'letter-spacing'
+ * and 'word-spacing' and adjustments due to attributes dx and dy on 'tspan'
+ * elements. For non-rendering environments, the user agent shall make reasonable
+ * assumptions about glyph metrics.
+ */
+double getSubStringLength(unsigned long charnum, unsigned long nchars)
+ throw (DOMException)
+{
+}
+
+/**
+ * Returns the current text position before rendering the character in the user
+ * coordinate system for rendering the glyph(s) that correspond to the specified
+ * character. The current text position has already taken into account the
+ * effects of any inter-character adjustments due to properties 'kerning',
+ * 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx
+ * and dy. If multiple consecutive characters are rendered inseparably(e.g., as
+ * a single glyph or a sequence of glyphs), then each of the inseparable
+ * characters will return the start position for the first glyph.
+ */
+SVGPoint getStartPositionOfChar(unsigned long charnum) throw (DOMException)
+{
+}
+
+/**
+ * Returns the current text position after rendering the character in the user
+ * coordinate system for rendering the glyph(s) that correspond to the specified
+ * character. This current text position does not take into account the effects
+ * of any inter-character adjustments to prepare for the next character, such as
+ * properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due
+ * to attributes x, y, dx and dy. If multiple consecutive characters are rendered
+ * inseparably(e.g., as a single glyph or a sequence of glyphs), then each of
+ * the inseparable characters will return the end position for the last glyph.
+ */
+SVGPoint getEndPositionOfChar(unsigned long charnum) throw (DOMException)
+{
+}
+
+/**
+ * Returns a tightest rectangle which defines the minimum and maximum X and Y
+ * values in the user coordinate system for rendering the glyph(s) that
+ * correspond to the specified character. The calculations assume that all glyphs
+ * occupy the full standard glyph cell for the font. If multiple consecutive
+ * characters are rendered inseparably(e.g., as a single glyph or a sequence of
+ * glyphs), then each of the inseparable characters will return the same extent.
+ */
+SVGRect getExtentOfChar(unsigned long charnum) throw (DOMException)
+{
+}
+
+/**
+ * Returns the rotation value relative to the current user coordinate system used
+ * to render the glyph(s) corresponding to the specified character. If multiple
+ * glyph(s) are used to render the given character and the glyphs each have
+ * different rotations(e.g., due to text-on-a-path), the user agent shall return
+ * an average value(e.g., the rotation angle at the midpoint along the path for
+ * all glyphs used to render this character). The rotation value represents the
+ * rotation that is supplemental to any rotation due to properties
+ * 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any
+ * glyph rotations due to these properties are not included into the returned
+ * rotation value. If multiple consecutive characters are rendered inseparably
+ *(e.g., as a single glyph or a sequence of glyphs), then each of the
+ * inseparable characters will return the same rotation value.
+ */
+double getRotationOfChar(unsigned long charnum) throw (DOMException)
+{
+}
+
+/**
+ * Returns the index of the character whose corresponding glyph cell bounding box
+ * contains the specified point. The calculations assume that all glyphs occupy
+ * the full standard glyph cell for the font. If no such character exists, a
+ * value of -1 is returned. If multiple such characters exist, the character
+ * within the element whose glyphs were rendered last(i.e., take into account
+ * any reordering such as for bidirectional text) is used. If multiple
+ * consecutive characters are rendered inseparably(e.g., as a single glyph or a
+ * sequence of glyphs), then the user agent shall allocate an equal percentage of
+ * the text advance amount to each of the contributing characters in determining
+ * which of the characters is chosen.
+ */
+long getCharNumAtPosition(const SVGPoint &point)
+{
+}
+
+/**
+ * Causes the specified substring to be selected just as if the user
+ * selected the substring interactively.
+ */
+void selectSubString(unsigned long charnum, unsigned long nchars)
+ throw (DOMException)
+{
+}
+
+
+
+
+
+//####################################################################
+//# SVGTextPathElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute startOffset on the given 'textPath' element.
+ */
+SVGAnimatedLength getStartOffset()
+{
+}
+
+/**
+ * Corresponds to attribute method on the given 'textPath' element. The value
+ * must be one of the method type constants specified above.
+ */
+SVGAnimatedEnumeration getMethod()
+{
+}
+
+/**
+ * Corresponds to attribute spacing on the given 'textPath' element.
+ * The value must be one of the spacing type constants specified above.
+ */
+SVGAnimatedEnumeration getSpacing()
+{
+}
+
+
+//####################################################################
+//# SVGTextPositioningElement
+//####################################################################
+
+
+/**
+ * Corresponds to attribute x on the given element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute dx on the given element.
+ */
+SVGAnimatedLength getDx()
+{
+}
+
+/**
+ * Corresponds to attribute dy on the given element.
+ */
+SVGAnimatedLength getDy()
+{
+}
+
+
+/**
+ * Corresponds to attribute rotate on the given element.
+ */
+SVGAnimatedNumberList getRotate()
+{
+}
+
+
+//####################################################################
+//# SVGTitleElement
+//####################################################################
+
+//####################################################################
+//# SVGTRefElement
+//####################################################################
+
+//####################################################################
+//# SVGTSpanElement
+//####################################################################
+
+//####################################################################
+//# SVGSwitchElement
+//####################################################################
+
+//####################################################################
+//# SVGUseElement
+//####################################################################
+
+/**
+ * Corresponds to attribute x on the given 'use' element.
+ */
+SVGAnimatedLength getX()
+{
+}
+
+/**
+ * Corresponds to attribute y on the given 'use' element.
+ */
+SVGAnimatedLength getY()
+{
+}
+
+/**
+ * Corresponds to attribute width on the given 'use' element.
+ */
+SVGAnimatedLength getWidth()
+{
+}
+
+/**
+ * Corresponds to attribute height on the given 'use' element.
+ */
+SVGAnimatedLength getHeight()
+{
+}
+
+/**
+ * The root of the "instance tree". See description of SVGElementInstance for
+ * a discussion on the instance tree.
+ * */
+SVGElementInstance getInstanceRoot()
+{
+}
+
+/**
+ * If the 'href' attribute is being animated, contains the current animated root
+ * of the "instance tree". If the 'href' attribute is not currently being
+ * animated, contains the same value as 'instanceRoot'. The root of the "instance
+ * tree". See description of SVGElementInstance for a discussion on the instance
+ * tree.
+ */
+SVGElementInstance getAnimatedInstanceRoot()
+{
+}
+
+
+//####################################################################
+//# SVGVKernElement
+//####################################################################
+
+//####################################################################
+//# SVGViewElement
+//####################################################################
+
+
+/**
+ *
+ */
+SVGStringList getViewTarget();
+
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+
+/**
+ *
+ */
+SVGElement::~SVGElement()
+{
+}
+
+
+
+
+/*#########################################################################
+## SVGDocument
+#########################################################################*/
+
+
+/**
+ * The title of a document as specified by the title sub-element of the 'svg'
+ * root element(i.e., <svg><title>Here is the title</title>...</svg>)
+ */
+DOMString SVGDocument::getTitle()
+{
+}
+
+/**
+ * Returns the URI of the page that linked to this page. The value is an empty
+ * string if the user navigated to the page directly(not through a link, but,
+ * for example, via a bookmark).
+ */
+DOMString SVGDocument::getReferrer()
+{
+}
+
+
+/**
+ * The domain name of the server that served the document, or a null string if
+ * the server cannot be identified by a domain name.
+ */
+DOMString SVGDocument::getDomain()
+{
+}
+
+
+/**
+ * The complete URI of the document.
+ */
+DOMString SVGDocument::getURL()
+{
+}
+
+
+/**
+ * The root 'svg' element in the document hierarchy.
+ */
+SVGElementPtr SVGDocument::getRootElement()
+{
+}
+
+
+/**
+ * Overloaded from Document
+ *
+ */
+ElementPtr SVGDocument::createElement(const DOMString &tagName)
+{
+ ElementPtr ptr;
+ return ptr;
+}
+
+
+/**
+ * Overloaded from Document
+ *
+ */
+ElementPtr SVGDocument::createElementNS(const DOMString &tagName,
+ const DOMString &namespaceURI)
+{
+ ElementPtr ptr;
+ return ptr;
+}
+
+
+/**
+ * The root 'svg' element in the document hierarchy.
+ */
+SVGElementPtr SVGDocument::getRootElement()
+{
+}
+
+
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+SVGDocument::~SVGDocument()
+{
+}
+
+
+
+/*#########################################################################
+## GetSVGDocument
+#########################################################################*/
+
+
+/**
+ * Returns the SVGDocument object for the referenced SVG document.
+ */
+SVGDocumentPtr GetSVGDocument::getSVGDocument()
+ throw (DOMException)
+{
+ SVGDocumentPtr ptr;
+ return ptr;
+}
+
+//##################
+//# Non-API methods
+//##################
+
+/**
+ *
+ */
+GetSVGDocument::~GetSVGDocument()
+{
+}
+
+
+
+
+
+
+
+} //namespace svg
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+#endif // __SVG_H__
+/*#########################################################################
+## E N D O F F I L E
+#########################################################################*/
+
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp
index 9b3b9889443118c5099c7fd636f44c2eda1e5709..34195be1584d06e416b4b0f2fd3116d64b0b658e 100644 (file)
--- a/src/helper/geom.cpp
+++ b/src/helper/geom.cpp
-#define INKSCAPE_HELPER_GEOM_CPP\r
-\r
-/**\r
- * Specific geometry functions for Inkscape, not provided my lib2geom.\r
- *\r
- * Author:\r
- * Johan Engelen <goejendaagh@zonnet.nl>\r
- *\r
- * Copyright (C) 2008 Johan Engelen\r
- *\r
- * Released under GNU GPL\r
- */\r
-\r
-#include "helper/geom.h"\r
-#include <typeinfo>\r
-#include <2geom/pathvector.h>\r
-#include <2geom/path.h>\r
-#include <2geom/transforms.h>\r
-#include <2geom/rect.h>\r
-#include <2geom/coord.h>\r
-#include <2geom/sbasis-to-bezier.h>\r
-#include <libnr/nr-convert2geom.h>\r
-#include <glibmm.h>\r
-\r
-using Geom::X;\r
-using Geom::Y;\r
-\r
-#define NR_HUGE 1e18\r
-\r
-//#################################################################################\r
-// BOUNDING BOX CALCULATIONS\r
-\r
-/* Fast bbox calculation */\r
-/* Thanks to Nathan Hurst for suggesting it */\r
-static void\r
-cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y001, Geom::Coord x011, Geom::Coord y011, Geom::Coord x111, Geom::Coord y111, Geom::Rect &bbox)\r
-{\r
- Geom::Coord a, b, c, D;\r
-\r
- bbox[0].extendTo(x111);\r
- bbox[1].extendTo(y111);\r
-\r
- /*\r
- * xttt = s * (s * (s * x000 + t * x001) + t * (s * x001 + t * x011)) + t * (s * (s * x001 + t * x011) + t * (s * x011 + t * x111))\r
- * xttt = s * (s2 * x000 + s * t * x001 + t * s * x001 + t2 * x011) + t * (s2 * x001 + s * t * x011 + t * s * x011 + t2 * x111)\r
- * xttt = s * (s2 * x000 + 2 * st * x001 + t2 * x011) + t * (s2 * x001 + 2 * st * x011 + t2 * x111)\r
- * xttt = s3 * x000 + 2 * s2t * x001 + st2 * x011 + s2t * x001 + 2st2 * x011 + t3 * x111\r
- * xttt = s3 * x000 + 3s2t * x001 + 3st2 * x011 + t3 * x111\r
- * xttt = s3 * x000 + (1 - s) 3s2 * x001 + (1 - s) * (1 - s) * 3s * x011 + (1 - s) * (1 - s) * (1 - s) * x111\r
- * xttt = s3 * x000 + (3s2 - 3s3) * x001 + (3s - 6s2 + 3s3) * x011 + (1 - 2s + s2 - s + 2s2 - s3) * x111\r
- * xttt = (x000 - 3 * x001 + 3 * x011 - x111) * s3 +\r
- * ( 3 * x001 - 6 * x011 + 3 * x111) * s2 +\r
- * ( 3 * x011 - 3 * x111) * s +\r
- * ( x111)\r
- * xttt' = (3 * x000 - 9 * x001 + 9 * x011 - 3 * x111) * s2 +\r
- * ( 6 * x001 - 12 * x011 + 6 * x111) * s +\r
- * ( 3 * x011 - 3 * x111)\r
- */\r
-\r
- a = 3 * x000 - 9 * x001 + 9 * x011 - 3 * x111;\r
- b = 6 * x001 - 12 * x011 + 6 * x111;\r
- c = 3 * x011 - 3 * x111;\r
-\r
- /*\r
- * s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a;\r
- */\r
- if (fabs (a) < Geom::EPSILON) {\r
- /* s = -c / b */\r
- if (fabs (b) > Geom::EPSILON) {\r
- double s, t, xttt;\r
- s = -c / b;\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;\r
- bbox[0].extendTo(xttt);\r
- }\r
- }\r
- } else {\r
- /* s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a; */\r
- D = b * b - 4 * a * c;\r
- if (D >= 0.0) {\r
- Geom::Coord d, s, t, xttt;\r
- /* Have solution */\r
- d = sqrt (D);\r
- s = (-b + d) / (2 * a);\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;\r
- bbox[0].extendTo(xttt);\r
- }\r
- s = (-b - d) / (2 * a);\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;\r
- bbox[0].extendTo(xttt);\r
- }\r
- }\r
- }\r
-\r
- a = 3 * y000 - 9 * y001 + 9 * y011 - 3 * y111;\r
- b = 6 * y001 - 12 * y011 + 6 * y111;\r
- c = 3 * y011 - 3 * y111;\r
-\r
- if (fabs (a) < Geom::EPSILON) {\r
- /* s = -c / b */\r
- if (fabs (b) > Geom::EPSILON) {\r
- double s, t, yttt;\r
- s = -c / b;\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;\r
- bbox[1].extendTo(yttt);\r
- }\r
- }\r
- } else {\r
- /* s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a; */\r
- D = b * b - 4 * a * c;\r
- if (D >= 0.0) {\r
- Geom::Coord d, s, t, yttt;\r
- /* Have solution */\r
- d = sqrt (D);\r
- s = (-b + d) / (2 * a);\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;\r
- bbox[1].extendTo(yttt);\r
- }\r
- s = (-b - d) / (2 * a);\r
- if ((s > 0.0) && (s < 1.0)) {\r
- t = 1.0 - s;\r
- yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;\r
- bbox[1].extendTo(yttt);\r
- }\r
- }\r
- }\r
-}\r
-\r
-Geom::Rect\r
-bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t)\r
-{\r
- return bounds_exact_transformed(pv, t); //use this as it is faster for now! :)\r
-// return Geom::bounds_fast(pv * t);\r
-}\r
-\r
-Geom::Rect\r
-bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t)\r
-{\r
- Geom::Rect bbox;\r
- \r
- if (pv.empty())\r
- return bbox;\r
-\r
- Geom::Point initial = pv.front().initialPoint() * t;\r
- bbox = Geom::Rect(initial, initial); // obtain well defined bbox as starting point to unionWith\r
-\r
- for (Geom::PathVector::const_iterator it = pv.begin(); it != pv.end(); ++it) {\r
- bbox.expandTo(it->initialPoint() * t);\r
-\r
- // don't loop including closing segment, since that segment can never increase the bbox\r
- for (Geom::Path::const_iterator cit = it->begin(); cit != it->end_open(); ++cit) {\r
- Geom::Curve const &c = *cit;\r
-\r
- if( dynamic_cast<Geom::LineSegment const*>(&c) ||\r
- dynamic_cast<Geom::HLineSegment const*>(&c) ||\r
- dynamic_cast<Geom::VLineSegment const*>(&c) )\r
- {\r
- bbox.expandTo( c.finalPoint() * t );\r
- }\r
- else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const *>(&c))\r
- {\r
- Geom::Point c0 = (*cubic_bezier)[0] * t;\r
- Geom::Point c1 = (*cubic_bezier)[1] * t;\r
- Geom::Point c2 = (*cubic_bezier)[2] * t;\r
- Geom::Point c3 = (*cubic_bezier)[3] * t;\r
- cubic_bbox( c0[0], c0[1],\r
- c1[0], c1[1],\r
- c2[0], c2[1],\r
- c3[0], c3[1],\r
- bbox );\r
- }\r
- else\r
- {\r
- // should handle all not-so-easy curves:\r
- Geom::Curve *ctemp = cit->transformed(t);\r
- bbox.unionWith( ctemp->boundsExact());\r
- delete ctemp;\r
- }\r
- }\r
- }\r
- //return Geom::bounds_exact(pv * t);\r
- return bbox;\r
-}\r
-\r
-\r
-\r
-static void\r
-geom_line_wind_distance (Geom::Coord x0, Geom::Coord y0, Geom::Coord x1, Geom::Coord y1, Geom::Point const &pt, int *wind, Geom::Coord *best)\r
-{\r
- Geom::Coord Ax, Ay, Bx, By, Dx, Dy, s;\r
- Geom::Coord dist2;\r
-\r
- /* Find distance */\r
- Ax = x0;\r
- Ay = y0;\r
- Bx = x1;\r
- By = y1;\r
- Dx = x1 - x0;\r
- Dy = y1 - y0;\r
- const Geom::Coord Px = pt[X];\r
- const Geom::Coord Py = pt[Y];\r
-\r
- if (best) {\r
- s = ((Px - Ax) * Dx + (Py - Ay) * Dy) / (Dx * Dx + Dy * Dy);\r
- if (s <= 0.0) {\r
- dist2 = (Px - Ax) * (Px - Ax) + (Py - Ay) * (Py - Ay);\r
- } else if (s >= 1.0) {\r
- dist2 = (Px - Bx) * (Px - Bx) + (Py - By) * (Py - By);\r
- } else {\r
- Geom::Coord Qx, Qy;\r
- Qx = Ax + s * Dx;\r
- Qy = Ay + s * Dy;\r
- dist2 = (Px - Qx) * (Px - Qx) + (Py - Qy) * (Py - Qy);\r
- }\r
-\r
- if (dist2 < (*best * *best)) *best = sqrt (dist2);\r
- }\r
-\r
- if (wind) {\r
- /* Find wind */\r
- if ((Ax >= Px) && (Bx >= Px)) return;\r
- if ((Ay >= Py) && (By >= Py)) return;\r
- if ((Ay < Py) && (By < Py)) return;\r
- if (Ay == By) return;\r
- /* Ctach upper y bound */\r
- if (Ay == Py) {\r
- if (Ax < Px) *wind -= 1;\r
- return;\r
- } else if (By == Py) {\r
- if (Bx < Px) *wind += 1;\r
- return;\r
- } else {\r
- Geom::Coord Qx;\r
- /* Have to calculate intersection */\r
- Qx = Ax + Dx * (Py - Ay) / Dy;\r
- if (Qx < Px) {\r
- *wind += (Dy > 0.0) ? 1 : -1;\r
- }\r
- }\r
- }\r
-}\r
-\r
-static void\r
-geom_cubic_bbox_wind_distance (Geom::Coord x000, Geom::Coord y000,\r
- Geom::Coord x001, Geom::Coord y001,\r
- Geom::Coord x011, Geom::Coord y011,\r
- Geom::Coord x111, Geom::Coord y111,\r
- Geom::Point const &pt,\r
- Geom::Rect *bbox, int *wind, Geom::Coord *best,\r
- Geom::Coord tolerance)\r
-{\r
- Geom::Coord x0, y0, x1, y1, len2;\r
- int needdist, needwind, needline;\r
-\r
- const Geom::Coord Px = pt[X];\r
- const Geom::Coord Py = pt[Y];\r
-\r
- needdist = 0;\r
- needwind = 0;\r
- needline = 0;\r
-\r
- if (bbox) cubic_bbox (x000, y000, x001, y001, x011, y011, x111, y111, *bbox);\r
-\r
- x0 = MIN (x000, x001);\r
- x0 = MIN (x0, x011);\r
- x0 = MIN (x0, x111);\r
- y0 = MIN (y000, y001);\r
- y0 = MIN (y0, y011);\r
- y0 = MIN (y0, y111);\r
- x1 = MAX (x000, x001);\r
- x1 = MAX (x1, x011);\r
- x1 = MAX (x1, x111);\r
- y1 = MAX (y000, y001);\r
- y1 = MAX (y1, y011);\r
- y1 = MAX (y1, y111);\r
-\r
- if (best) {\r
- /* Quickly adjust to endpoints */\r
- len2 = (x000 - Px) * (x000 - Px) + (y000 - Py) * (y000 - Py);\r
- if (len2 < (*best * *best)) *best = (Geom::Coord) sqrt (len2);\r
- len2 = (x111 - Px) * (x111 - Px) + (y111 - Py) * (y111 - Py);\r
- if (len2 < (*best * *best)) *best = (Geom::Coord) sqrt (len2);\r
-\r
- if (((x0 - Px) < *best) && ((y0 - Py) < *best) && ((Px - x1) < *best) && ((Py - y1) < *best)) {\r
- /* Point is inside sloppy bbox */\r
- /* Now we have to decide, whether subdivide */\r
- /* fixme: (Lauris) */\r
- if (((y1 - y0) > 5.0) || ((x1 - x0) > 5.0)) {\r
- needdist = 1;\r
- } else {\r
- needline = 1;\r
- }\r
- }\r
- }\r
- if (!needdist && wind) {\r
- if ((y1 >= Py) && (y0 < Py) && (x0 < Px)) {\r
- /* Possible intersection at the left */\r
- /* Now we have to decide, whether subdivide */\r
- /* fixme: (Lauris) */\r
- if (((y1 - y0) > 5.0) || ((x1 - x0) > 5.0)) {\r
- needwind = 1;\r
- } else {\r
- needline = 1;\r
- }\r
- }\r
- }\r
-\r
- if (needdist || needwind) {\r
- Geom::Coord x00t, x0tt, xttt, x1tt, x11t, x01t;\r
- Geom::Coord y00t, y0tt, yttt, y1tt, y11t, y01t;\r
- Geom::Coord s, t;\r
-\r
- t = 0.5;\r
- s = 1 - t;\r
-\r
- x00t = s * x000 + t * x001;\r
- x01t = s * x001 + t * x011;\r
- x11t = s * x011 + t * x111;\r
- x0tt = s * x00t + t * x01t;\r
- x1tt = s * x01t + t * x11t;\r
- xttt = s * x0tt + t * x1tt;\r
-\r
- y00t = s * y000 + t * y001;\r
- y01t = s * y001 + t * y011;\r
- y11t = s * y011 + t * y111;\r
- y0tt = s * y00t + t * y01t;\r
- y1tt = s * y01t + t * y11t;\r
- yttt = s * y0tt + t * y1tt;\r
-\r
- geom_cubic_bbox_wind_distance (x000, y000, x00t, y00t, x0tt, y0tt, xttt, yttt, pt, NULL, wind, best, tolerance);\r
- geom_cubic_bbox_wind_distance (xttt, yttt, x1tt, y1tt, x11t, y11t, x111, y111, pt, NULL, wind, best, tolerance);\r
- } else if (1 || needline) {\r
- geom_line_wind_distance (x000, y000, x111, y111, pt, wind, best);\r
- }\r
-}\r
-\r
-static void\r
-geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Matrix const &m,\r
- Geom::Point const &pt,\r
- Geom::Rect *bbox, int *wind, Geom::Coord *dist,\r
- Geom::Coord tolerance, Geom::Rect const *viewbox,\r
- Geom::Point &p0) // pass p0 through as it represents the last endpoint added (the finalPoint of last curve)\r
-{\r
- if( dynamic_cast<Geom::LineSegment const*>(&c) ||\r
- dynamic_cast<Geom::HLineSegment const*>(&c) ||\r
- dynamic_cast<Geom::VLineSegment const*>(&c) )\r
- {\r
- Geom::Point pe = c.finalPoint() * m;\r
- if (bbox) {\r
- bbox->expandTo(pe);\r
- }\r
- if (dist || wind) {\r
- if (wind) { // we need to pick fill, so do what we're told\r
- geom_line_wind_distance (p0[X], p0[Y], pe[X], pe[Y], pt, wind, dist);\r
- } else { // only stroke is being picked; skip this segment if it's totally outside the viewbox\r
- Geom::Rect swept(p0, pe);\r
- if (!viewbox || swept.intersects(*viewbox))\r
- geom_line_wind_distance (p0[X], p0[Y], pe[X], pe[Y], pt, wind, dist);\r
- }\r
- }\r
- p0 = pe;\r
- }\r
- else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const *>(&c)) {\r
- Geom::Point p1 = (*cubic_bezier)[1] * m;\r
- Geom::Point p2 = (*cubic_bezier)[2] * m;\r
- Geom::Point p3 = (*cubic_bezier)[3] * m;\r
-\r
- // get approximate bbox from handles (convex hull property of beziers):\r
- Geom::Rect swept(p0, p3);\r
- swept.expandTo(p1);\r
- swept.expandTo(p2);\r
-\r
- if (!viewbox || swept.intersects(*viewbox)) { // we see this segment, so do full processing\r
- geom_cubic_bbox_wind_distance ( p0[X], p0[Y],\r
- p1[X], p1[Y],\r
- p2[X], p2[Y],\r
- p3[X], p3[Y],\r
- pt,\r
- bbox, wind, dist, tolerance);\r
- } else {\r
- if (wind) { // if we need fill, we can just pretend it's a straight line\r
- geom_line_wind_distance (p0[X], p0[Y], p3[X], p3[Y], pt, wind, dist);\r
- } else { // otherwise, skip it completely\r
- }\r
- }\r
- p0 = p3;\r
- } else { \r
- //this case handles sbasis as well as all other curve types\r
- Geom::Path sbasis_path = Geom::path_from_sbasis(c.toSBasis(), 0.1);\r
-\r
- //recurse to convert the new path resulting from the sbasis to svgd\r
- for(Geom::Path::iterator iter = sbasis_path.begin(); iter != sbasis_path.end(); ++iter) {\r
- geom_curve_bbox_wind_distance(*iter, m, pt, bbox, wind, dist, tolerance, viewbox, p0);\r
- }\r
- }\r
-}\r
-\r
-/* Calculates...\r
- and returns ... in *wind and the distance to ... in *dist.\r
- Returns bounding box in *bbox if bbox!=NULL.\r
- */\r
-void\r
-pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt,\r
- Geom::Rect *bbox, int *wind, Geom::Coord *dist,\r
- Geom::Coord tolerance, Geom::Rect const *viewbox)\r
-{\r
- if (pathv.empty()) {\r
- if (wind) *wind = 0;\r
- if (dist) *dist = NR_HUGE;\r
- return;\r
- }\r
-\r
- // remember last point of last curve\r
- Geom::Point p0(0,0);\r
-\r
- // remembering the start of subpath\r
- Geom::Point p_start(0,0);\r
- bool start_set = false;\r
-\r
- for (Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) {\r
-\r
- if (start_set) { // this is a new subpath\r
- if (wind && (p0 != p_start)) // for correct fill picking, each subpath must be closed\r
- geom_line_wind_distance (p0[X], p0[Y], p_start[X], p_start[Y], pt, wind, dist);\r
- }\r
- p0 = it->initialPoint() * m;\r
- p_start = p0;\r
- start_set = true;\r
- if (bbox) {\r
- bbox->expandTo(p0);\r
- }\r
-\r
- // loop including closing segment if path is closed\r
- for (Geom::Path::const_iterator cit = it->begin(); cit != it->end_default(); ++cit) {\r
- geom_curve_bbox_wind_distance(*cit, m, pt, bbox, wind, dist, tolerance, viewbox, p0);\r
- }\r
- }\r
-\r
- if (start_set) { \r
- if (wind && (p0 != p_start)) // for correct picking, each subpath must be closed\r
- geom_line_wind_distance (p0[X], p0[Y], p_start[X], p_start[Y], pt, wind, dist);\r
- }\r
-}\r
-\r
-// temporary wrapper\r
-void\r
-pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,\r
- NR::Rect *bbox, int *wind, NR::Coord *dist,\r
- NR::Coord tolerance, NR::Rect const *viewbox)\r
-{\r
- Geom::Rect _bbox;\r
- if (bbox)\r
- _bbox = to_2geom(*bbox);\r
- Geom::Coord _dist;\r
- if (dist)\r
- _dist = *dist;\r
- Geom::Rect _viewbox;\r
- if (viewbox)\r
- _viewbox = to_2geom(*viewbox);\r
-\r
- pathv_matrix_point_bbox_wind_distance( pathv, to_2geom(m), to_2geom(pt),\r
- bbox ? &_bbox : NULL,\r
- wind,\r
- dist ? &_dist : NULL,\r
- tolerance,\r
- viewbox ? &_viewbox : NULL );\r
-\r
- if (bbox)\r
- *bbox = from_2geom(_bbox);\r
- if (dist)\r
- *dist = _dist;\r
-}\r
-//#################################################################################\r
-\r
-\r
-\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#define INKSCAPE_HELPER_GEOM_CPP
+
+/**
+ * Specific geometry functions for Inkscape, not provided my lib2geom.
+ *
+ * Author:
+ * Johan Engelen <goejendaagh@zonnet.nl>
+ *
+ * Copyright (C) 2008 Johan Engelen
+ *
+ * Released under GNU GPL
+ */
+
+#include "helper/geom.h"
+#include <typeinfo>
+#include <2geom/pathvector.h>
+#include <2geom/path.h>
+#include <2geom/transforms.h>
+#include <2geom/rect.h>
+#include <2geom/coord.h>
+#include <2geom/sbasis-to-bezier.h>
+#include <libnr/nr-convert2geom.h>
+#include <glibmm.h>
+
+using Geom::X;
+using Geom::Y;
+
+#define NR_HUGE 1e18
+
+//#################################################################################
+// BOUNDING BOX CALCULATIONS
+
+/* Fast bbox calculation */
+/* Thanks to Nathan Hurst for suggesting it */
+static void
+cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y001, Geom::Coord x011, Geom::Coord y011, Geom::Coord x111, Geom::Coord y111, Geom::Rect &bbox)
+{
+ Geom::Coord a, b, c, D;
+
+ bbox[0].extendTo(x111);
+ bbox[1].extendTo(y111);
+
+ /*
+ * xttt = s * (s * (s * x000 + t * x001) + t * (s * x001 + t * x011)) + t * (s * (s * x001 + t * x011) + t * (s * x011 + t * x111))
+ * xttt = s * (s2 * x000 + s * t * x001 + t * s * x001 + t2 * x011) + t * (s2 * x001 + s * t * x011 + t * s * x011 + t2 * x111)
+ * xttt = s * (s2 * x000 + 2 * st * x001 + t2 * x011) + t * (s2 * x001 + 2 * st * x011 + t2 * x111)
+ * xttt = s3 * x000 + 2 * s2t * x001 + st2 * x011 + s2t * x001 + 2st2 * x011 + t3 * x111
+ * xttt = s3 * x000 + 3s2t * x001 + 3st2 * x011 + t3 * x111
+ * xttt = s3 * x000 + (1 - s) 3s2 * x001 + (1 - s) * (1 - s) * 3s * x011 + (1 - s) * (1 - s) * (1 - s) * x111
+ * xttt = s3 * x000 + (3s2 - 3s3) * x001 + (3s - 6s2 + 3s3) * x011 + (1 - 2s + s2 - s + 2s2 - s3) * x111
+ * xttt = (x000 - 3 * x001 + 3 * x011 - x111) * s3 +
+ * ( 3 * x001 - 6 * x011 + 3 * x111) * s2 +
+ * ( 3 * x011 - 3 * x111) * s +
+ * ( x111)
+ * xttt' = (3 * x000 - 9 * x001 + 9 * x011 - 3 * x111) * s2 +
+ * ( 6 * x001 - 12 * x011 + 6 * x111) * s +
+ * ( 3 * x011 - 3 * x111)
+ */
+
+ a = 3 * x000 - 9 * x001 + 9 * x011 - 3 * x111;
+ b = 6 * x001 - 12 * x011 + 6 * x111;
+ c = 3 * x011 - 3 * x111;
+
+ /*
+ * s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a;
+ */
+ if (fabs (a) < Geom::EPSILON) {
+ /* s = -c / b */
+ if (fabs (b) > Geom::EPSILON) {
+ double s, t, xttt;
+ s = -c / b;
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;
+ bbox[0].extendTo(xttt);
+ }
+ }
+ } else {
+ /* s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a; */
+ D = b * b - 4 * a * c;
+ if (D >= 0.0) {
+ Geom::Coord d, s, t, xttt;
+ /* Have solution */
+ d = sqrt (D);
+ s = (-b + d) / (2 * a);
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;
+ bbox[0].extendTo(xttt);
+ }
+ s = (-b - d) / (2 * a);
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111;
+ bbox[0].extendTo(xttt);
+ }
+ }
+ }
+
+ a = 3 * y000 - 9 * y001 + 9 * y011 - 3 * y111;
+ b = 6 * y001 - 12 * y011 + 6 * y111;
+ c = 3 * y011 - 3 * y111;
+
+ if (fabs (a) < Geom::EPSILON) {
+ /* s = -c / b */
+ if (fabs (b) > Geom::EPSILON) {
+ double s, t, yttt;
+ s = -c / b;
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;
+ bbox[1].extendTo(yttt);
+ }
+ }
+ } else {
+ /* s = (-b +/- sqrt (b * b - 4 * a * c)) / 2 * a; */
+ D = b * b - 4 * a * c;
+ if (D >= 0.0) {
+ Geom::Coord d, s, t, yttt;
+ /* Have solution */
+ d = sqrt (D);
+ s = (-b + d) / (2 * a);
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;
+ bbox[1].extendTo(yttt);
+ }
+ s = (-b - d) / (2 * a);
+ if ((s > 0.0) && (s < 1.0)) {
+ t = 1.0 - s;
+ yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111;
+ bbox[1].extendTo(yttt);
+ }
+ }
+ }
+}
+
+Geom::Rect
+bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t)
+{
+ return bounds_exact_transformed(pv, t); //use this as it is faster for now! :)
+// return Geom::bounds_fast(pv * t);
+}
+
+Geom::Rect
+bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t)
+{
+ Geom::Rect bbox;
+
+ if (pv.empty())
+ return bbox;
+
+ Geom::Point initial = pv.front().initialPoint() * t;
+ bbox = Geom::Rect(initial, initial); // obtain well defined bbox as starting point to unionWith
+
+ for (Geom::PathVector::const_iterator it = pv.begin(); it != pv.end(); ++it) {
+ bbox.expandTo(it->initialPoint() * t);
+
+ // don't loop including closing segment, since that segment can never increase the bbox
+ for (Geom::Path::const_iterator cit = it->begin(); cit != it->end_open(); ++cit) {
+ Geom::Curve const &c = *cit;
+
+ if( dynamic_cast<Geom::LineSegment const*>(&c) ||
+ dynamic_cast<Geom::HLineSegment const*>(&c) ||
+ dynamic_cast<Geom::VLineSegment const*>(&c) )
+ {
+ bbox.expandTo( c.finalPoint() * t );
+ }
+ else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const *>(&c))
+ {
+ Geom::Point c0 = (*cubic_bezier)[0] * t;
+ Geom::Point c1 = (*cubic_bezier)[1] * t;
+ Geom::Point c2 = (*cubic_bezier)[2] * t;
+ Geom::Point c3 = (*cubic_bezier)[3] * t;
+ cubic_bbox( c0[0], c0[1],
+ c1[0], c1[1],
+ c2[0], c2[1],
+ c3[0], c3[1],
+ bbox );
+ }
+ else
+ {
+ // should handle all not-so-easy curves:
+ Geom::Curve *ctemp = cit->transformed(t);
+ bbox.unionWith( ctemp->boundsExact());
+ delete ctemp;
+ }
+ }
+ }
+ //return Geom::bounds_exact(pv * t);
+ return bbox;
+}
+
+
+
+static void
+geom_line_wind_distance (Geom::Coord x0, Geom::Coord y0, Geom::Coord x1, Geom::Coord y1, Geom::Point const &pt, int *wind, Geom::Coord *best)
+{
+ Geom::Coord Ax, Ay, Bx, By, Dx, Dy, s;
+ Geom::Coord dist2;
+
+ /* Find distance */
+ Ax = x0;
+ Ay = y0;
+ Bx = x1;
+ By = y1;
+ Dx = x1 - x0;
+ Dy = y1 - y0;
+ const Geom::Coord Px = pt[X];
+ const Geom::Coord Py = pt[Y];
+
+ if (best) {
+ s = ((Px - Ax) * Dx + (Py - Ay) * Dy) / (Dx * Dx + Dy * Dy);
+ if (s <= 0.0) {
+ dist2 = (Px - Ax) * (Px - Ax) + (Py - Ay) * (Py - Ay);
+ } else if (s >= 1.0) {
+ dist2 = (Px - Bx) * (Px - Bx) + (Py - By) * (Py - By);
+ } else {
+ Geom::Coord Qx, Qy;
+ Qx = Ax + s * Dx;
+ Qy = Ay + s * Dy;
+ dist2 = (Px - Qx) * (Px - Qx) + (Py - Qy) * (Py - Qy);
+ }
+
+ if (dist2 < (*best * *best)) *best = sqrt (dist2);
+ }
+
+ if (wind) {
+ /* Find wind */
+ if ((Ax >= Px) && (Bx >= Px)) return;
+ if ((Ay >= Py) && (By >= Py)) return;
+ if ((Ay < Py) && (By < Py)) return;
+ if (Ay == By) return;
+ /* Ctach upper y bound */
+ if (Ay == Py) {
+ if (Ax < Px) *wind -= 1;
+ return;
+ } else if (By == Py) {
+ if (Bx < Px) *wind += 1;
+ return;
+ } else {
+ Geom::Coord Qx;
+ /* Have to calculate intersection */
+ Qx = Ax + Dx * (Py - Ay) / Dy;
+ if (Qx < Px) {
+ *wind += (Dy > 0.0) ? 1 : -1;
+ }
+ }
+ }
+}
+
+static void
+geom_cubic_bbox_wind_distance (Geom::Coord x000, Geom::Coord y000,
+ Geom::Coord x001, Geom::Coord y001,
+ Geom::Coord x011, Geom::Coord y011,
+ Geom::Coord x111, Geom::Coord y111,
+ Geom::Point const &pt,
+ Geom::Rect *bbox, int *wind, Geom::Coord *best,
+ Geom::Coord tolerance)
+{
+ Geom::Coord x0, y0, x1, y1, len2;
+ int needdist, needwind, needline;
+
+ const Geom::Coord Px = pt[X];
+ const Geom::Coord Py = pt[Y];
+
+ needdist = 0;
+ needwind = 0;
+ needline = 0;
+
+ if (bbox) cubic_bbox (x000, y000, x001, y001, x011, y011, x111, y111, *bbox);
+
+ x0 = MIN (x000, x001);
+ x0 = MIN (x0, x011);
+ x0 = MIN (x0, x111);
+ y0 = MIN (y000, y001);
+ y0 = MIN (y0, y011);
+ y0 = MIN (y0, y111);
+ x1 = MAX (x000, x001);
+ x1 = MAX (x1, x011);
+ x1 = MAX (x1, x111);
+ y1 = MAX (y000, y001);
+ y1 = MAX (y1, y011);
+ y1 = MAX (y1, y111);
+
+ if (best) {
+ /* Quickly adjust to endpoints */
+ len2 = (x000 - Px) * (x000 - Px) + (y000 - Py) * (y000 - Py);
+ if (len2 < (*best * *best)) *best = (Geom::Coord) sqrt (len2);
+ len2 = (x111 - Px) * (x111 - Px) + (y111 - Py) * (y111 - Py);
+ if (len2 < (*best * *best)) *best = (Geom::Coord) sqrt (len2);
+
+ if (((x0 - Px) < *best) && ((y0 - Py) < *best) && ((Px - x1) < *best) && ((Py - y1) < *best)) {
+ /* Point is inside sloppy bbox */
+ /* Now we have to decide, whether subdivide */
+ /* fixme: (Lauris) */
+ if (((y1 - y0) > 5.0) || ((x1 - x0) > 5.0)) {
+ needdist = 1;
+ } else {
+ needline = 1;
+ }
+ }
+ }
+ if (!needdist && wind) {
+ if ((y1 >= Py) && (y0 < Py) && (x0 < Px)) {
+ /* Possible intersection at the left */
+ /* Now we have to decide, whether subdivide */
+ /* fixme: (Lauris) */
+ if (((y1 - y0) > 5.0) || ((x1 - x0) > 5.0)) {
+ needwind = 1;
+ } else {
+ needline = 1;
+ }
+ }
+ }
+
+ if (needdist || needwind) {
+ Geom::Coord x00t, x0tt, xttt, x1tt, x11t, x01t;
+ Geom::Coord y00t, y0tt, yttt, y1tt, y11t, y01t;
+ Geom::Coord s, t;
+
+ t = 0.5;
+ s = 1 - t;
+
+ x00t = s * x000 + t * x001;
+ x01t = s * x001 + t * x011;
+ x11t = s * x011 + t * x111;
+ x0tt = s * x00t + t * x01t;
+ x1tt = s * x01t + t * x11t;
+ xttt = s * x0tt + t * x1tt;
+
+ y00t = s * y000 + t * y001;
+ y01t = s * y001 + t * y011;
+ y11t = s * y011 + t * y111;
+ y0tt = s * y00t + t * y01t;
+ y1tt = s * y01t + t * y11t;
+ yttt = s * y0tt + t * y1tt;
+
+ geom_cubic_bbox_wind_distance (x000, y000, x00t, y00t, x0tt, y0tt, xttt, yttt, pt, NULL, wind, best, tolerance);
+ geom_cubic_bbox_wind_distance (xttt, yttt, x1tt, y1tt, x11t, y11t, x111, y111, pt, NULL, wind, best, tolerance);
+ } else if (1 || needline) {
+ geom_line_wind_distance (x000, y000, x111, y111, pt, wind, best);
+ }
+}
+
+static void
+geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Matrix const &m,
+ Geom::Point const &pt,
+ Geom::Rect *bbox, int *wind, Geom::Coord *dist,
+ Geom::Coord tolerance, Geom::Rect const *viewbox,
+ Geom::Point &p0) // pass p0 through as it represents the last endpoint added (the finalPoint of last curve)
+{
+ if( dynamic_cast<Geom::LineSegment const*>(&c) ||
+ dynamic_cast<Geom::HLineSegment const*>(&c) ||
+ dynamic_cast<Geom::VLineSegment const*>(&c) )
+ {
+ Geom::Point pe = c.finalPoint() * m;
+ if (bbox) {
+ bbox->expandTo(pe);
+ }
+ if (dist || wind) {
+ if (wind) { // we need to pick fill, so do what we're told
+ geom_line_wind_distance (p0[X], p0[Y], pe[X], pe[Y], pt, wind, dist);
+ } else { // only stroke is being picked; skip this segment if it's totally outside the viewbox
+ Geom::Rect swept(p0, pe);
+ if (!viewbox || swept.intersects(*viewbox))
+ geom_line_wind_distance (p0[X], p0[Y], pe[X], pe[Y], pt, wind, dist);
+ }
+ }
+ p0 = pe;
+ }
+ else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const *>(&c)) {
+ Geom::Point p1 = (*cubic_bezier)[1] * m;
+ Geom::Point p2 = (*cubic_bezier)[2] * m;
+ Geom::Point p3 = (*cubic_bezier)[3] * m;
+
+ // get approximate bbox from handles (convex hull property of beziers):
+ Geom::Rect swept(p0, p3);
+ swept.expandTo(p1);
+ swept.expandTo(p2);
+
+ if (!viewbox || swept.intersects(*viewbox)) { // we see this segment, so do full processing
+ geom_cubic_bbox_wind_distance ( p0[X], p0[Y],
+ p1[X], p1[Y],
+ p2[X], p2[Y],
+ p3[X], p3[Y],
+ pt,
+ bbox, wind, dist, tolerance);
+ } else {
+ if (wind) { // if we need fill, we can just pretend it's a straight line
+ geom_line_wind_distance (p0[X], p0[Y], p3[X], p3[Y], pt, wind, dist);
+ } else { // otherwise, skip it completely
+ }
+ }
+ p0 = p3;
+ } else {
+ //this case handles sbasis as well as all other curve types
+ Geom::Path sbasis_path = Geom::path_from_sbasis(c.toSBasis(), 0.1);
+
+ //recurse to convert the new path resulting from the sbasis to svgd
+ for(Geom::Path::iterator iter = sbasis_path.begin(); iter != sbasis_path.end(); ++iter) {
+ geom_curve_bbox_wind_distance(*iter, m, pt, bbox, wind, dist, tolerance, viewbox, p0);
+ }
+ }
+}
+
+/* Calculates...
+ and returns ... in *wind and the distance to ... in *dist.
+ Returns bounding box in *bbox if bbox!=NULL.
+ */
+void
+pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt,
+ Geom::Rect *bbox, int *wind, Geom::Coord *dist,
+ Geom::Coord tolerance, Geom::Rect const *viewbox)
+{
+ if (pathv.empty()) {
+ if (wind) *wind = 0;
+ if (dist) *dist = NR_HUGE;
+ return;
+ }
+
+ // remember last point of last curve
+ Geom::Point p0(0,0);
+
+ // remembering the start of subpath
+ Geom::Point p_start(0,0);
+ bool start_set = false;
+
+ for (Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) {
+
+ if (start_set) { // this is a new subpath
+ if (wind && (p0 != p_start)) // for correct fill picking, each subpath must be closed
+ geom_line_wind_distance (p0[X], p0[Y], p_start[X], p_start[Y], pt, wind, dist);
+ }
+ p0 = it->initialPoint() * m;
+ p_start = p0;
+ start_set = true;
+ if (bbox) {
+ bbox->expandTo(p0);
+ }
+
+ // loop including closing segment if path is closed
+ for (Geom::Path::const_iterator cit = it->begin(); cit != it->end_default(); ++cit) {
+ geom_curve_bbox_wind_distance(*cit, m, pt, bbox, wind, dist, tolerance, viewbox, p0);
+ }
+ }
+
+ if (start_set) {
+ if (wind && (p0 != p_start)) // for correct picking, each subpath must be closed
+ geom_line_wind_distance (p0[X], p0[Y], p_start[X], p_start[Y], pt, wind, dist);
+ }
+}
+
+// temporary wrapper
+void
+pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,
+ NR::Rect *bbox, int *wind, NR::Coord *dist,
+ NR::Coord tolerance, NR::Rect const *viewbox)
+{
+ Geom::Rect _bbox;
+ if (bbox)
+ _bbox = to_2geom(*bbox);
+ Geom::Coord _dist;
+ if (dist)
+ _dist = *dist;
+ Geom::Rect _viewbox;
+ if (viewbox)
+ _viewbox = to_2geom(*viewbox);
+
+ pathv_matrix_point_bbox_wind_distance( pathv, to_2geom(m), to_2geom(pt),
+ bbox ? &_bbox : NULL,
+ wind,
+ dist ? &_dist : NULL,
+ tolerance,
+ viewbox ? &_viewbox : NULL );
+
+ if (bbox)
+ *bbox = from_2geom(_bbox);
+ if (dist)
+ *dist = _dist;
+}
+//#################################################################################
+
+
+
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/helper/geom.h b/src/helper/geom.h
index a271ae3f064bdccb4f401e9c5b12109133976a60..e8eef075bbf9eb4108dd834b3b4f72c374ae17d4 100644 (file)
--- a/src/helper/geom.h
+++ b/src/helper/geom.h
-#ifndef INKSCAPE_HELPER_GEOM_H\r
-#define INKSCAPE_HELPER_GEOM_H\r
-\r
-/**\r
- * Specific geometry functions for Inkscape, not provided my lib2geom.\r
- *\r
- * Author:\r
- * Johan Engelen <goejendaagh@zonnet.nl>\r
- *\r
- * Copyright (C) 2008 Johan Engelen\r
- *\r
- * Released under GNU GPL\r
- */\r
-\r
-#include <2geom/forward.h>\r
-#include <libnr/nr-forward.h>\r
-#include <libnr/nr-coord.h>\r
-\r
-Geom::Rect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);\r
-Geom::Rect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);\r
-\r
-void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,\r
- NR::Rect *bbox, int *wind, NR::Coord *dist,\r
- NR::Coord tolerance, NR::Rect const *viewbox) __attribute__ ((deprecated));\r
-void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt,\r
- Geom::Rect *bbox, int *wind, Geom::Coord *dist,\r
- Geom::Coord tolerance, Geom::Rect const *viewbox);\r
-\r
-#endif // INKSCAPE_HELPER_GEOM_H\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#ifndef INKSCAPE_HELPER_GEOM_H
+#define INKSCAPE_HELPER_GEOM_H
+
+/**
+ * Specific geometry functions for Inkscape, not provided my lib2geom.
+ *
+ * Author:
+ * Johan Engelen <goejendaagh@zonnet.nl>
+ *
+ * Copyright (C) 2008 Johan Engelen
+ *
+ * Released under GNU GPL
+ */
+
+#include <2geom/forward.h>
+#include <libnr/nr-forward.h>
+#include <libnr/nr-coord.h>
+
+Geom::Rect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);
+Geom::Rect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);
+
+void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,
+ NR::Rect *bbox, int *wind, NR::Coord *dist,
+ NR::Coord tolerance, NR::Rect const *viewbox) __attribute__ ((deprecated));
+void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt,
+ Geom::Rect *bbox, int *wind, Geom::Coord *dist,
+ Geom::Coord tolerance, Geom::Rect const *viewbox);
+
+#endif // INKSCAPE_HELPER_GEOM_H
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
index f704b988a82ffca00d2b6b690dd5d43d28feae87..ff218ca94d14d7e282ea86c06681636aea92cdbb 100644 (file)
--- a/src/helper/units-test.h
+++ b/src/helper/units-test.h
-#include <cxxtest/TestSuite.h>\r
-\r
-#include <helper/units.h>\r
-#include <glibmm/i18n.h>\r
-#include <math.h>\r
-\r
-\r
-/* N.B. Wrongly returns false if both near 0. (Not a problem for current users.) */\r
-static bool\r
-approx_equal(double const x, double const y)\r
-{\r
- return fabs(x / y - 1) < 1e-15;\r
-}\r
-\r
-static double\r
-sp_units_get_points(double const x, SPUnit const &unit)\r
-{\r
- SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT);\r
- double const px = sp_units_get_pixels(x, unit);\r
- return sp_pixels_get_units(px, pt_unit);\r
-}\r
-\r
-static double\r
-sp_points_get_units(double const pts, SPUnit const &unit)\r
-{\r
- SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT);\r
- double const px = sp_units_get_pixels(pts, pt_unit);\r
- return sp_pixels_get_units(px, unit);\r
-}\r
-\r
-class UnitsTest : public CxxTest::TestSuite {\r
-public:\r
-\r
- UnitsTest()\r
- {\r
- }\r
- virtual ~UnitsTest() {}\r
-\r
- void testConversions()\r
- {\r
- struct Case { double x; char const *abbr; double pts; } const tests[] = {\r
- { 1.0, "pt", 1.0 },\r
- { 5.0, "pt", 5.0 },\r
- { 1.0, "in", 72.0 },\r
- { 2.0, "in", 144.0 },\r
- { 254., "mm", 720.0 },\r
- { 254., "cm", 7200. },\r
- { 254., "m", 720000. },\r
- { 1.5, "mm", (15 * 72. / 254) }\r
- };\r
- for (unsigned i = 0; i < G_N_ELEMENTS(tests); ++i) {\r
- Case const &c = tests[i];\r
- SPUnit const &unit = *sp_unit_get_by_abbreviation(N_(c.abbr));\r
-\r
- double const calc_pts = sp_units_get_points(c.x, unit);\r
- TS_ASSERT(approx_equal(calc_pts, c.pts));\r
-\r
- double const calc_x = sp_points_get_units(c.pts, unit);\r
- TS_ASSERT(approx_equal(calc_x, c.x));\r
-\r
- double tmp = c.x;\r
- bool const converted_to_pts = sp_convert_distance(&tmp, &unit, SP_PS_UNIT);\r
- TS_ASSERT(converted_to_pts);\r
- TS_ASSERT(approx_equal(tmp, c.pts));\r
-\r
- tmp = c.pts;\r
- bool const converted_from_pts = sp_convert_distance(&tmp, SP_PS_UNIT, &unit);\r
- TS_ASSERT(converted_from_pts);\r
- TS_ASSERT(approx_equal(tmp, c.x));\r
- }\r
- }\r
-\r
- void testUnitTable()\r
- {\r
- TS_ASSERT(sp_units_table_sane());\r
- }\r
-};\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+
+#include <helper/units.h>
+#include <glibmm/i18n.h>
+#include <math.h>
+
+
+/* N.B. Wrongly returns false if both near 0. (Not a problem for current users.) */
+static bool
+approx_equal(double const x, double const y)
+{
+ return fabs(x / y - 1) < 1e-15;
+}
+
+static double
+sp_units_get_points(double const x, SPUnit const &unit)
+{
+ SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT);
+ double const px = sp_units_get_pixels(x, unit);
+ return sp_pixels_get_units(px, pt_unit);
+}
+
+static double
+sp_points_get_units(double const pts, SPUnit const &unit)
+{
+ SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT);
+ double const px = sp_units_get_pixels(pts, pt_unit);
+ return sp_pixels_get_units(px, unit);
+}
+
+class UnitsTest : public CxxTest::TestSuite {
+public:
+
+ UnitsTest()
+ {
+ }
+ virtual ~UnitsTest() {}
+
+ void testConversions()
+ {
+ struct Case { double x; char const *abbr; double pts; } const tests[] = {
+ { 1.0, "pt", 1.0 },
+ { 5.0, "pt", 5.0 },
+ { 1.0, "in", 72.0 },
+ { 2.0, "in", 144.0 },
+ { 254., "mm", 720.0 },
+ { 254., "cm", 7200. },
+ { 254., "m", 720000. },
+ { 1.5, "mm", (15 * 72. / 254) }
+ };
+ for (unsigned i = 0; i < G_N_ELEMENTS(tests); ++i) {
+ Case const &c = tests[i];
+ SPUnit const &unit = *sp_unit_get_by_abbreviation(N_(c.abbr));
+
+ double const calc_pts = sp_units_get_points(c.x, unit);
+ TS_ASSERT(approx_equal(calc_pts, c.pts));
+
+ double const calc_x = sp_points_get_units(c.pts, unit);
+ TS_ASSERT(approx_equal(calc_x, c.x));
+
+ double tmp = c.x;
+ bool const converted_to_pts = sp_convert_distance(&tmp, &unit, SP_PS_UNIT);
+ TS_ASSERT(converted_to_pts);
+ TS_ASSERT(approx_equal(tmp, c.pts));
+
+ tmp = c.pts;
+ bool const converted_from_pts = sp_convert_distance(&tmp, SP_PS_UNIT, &unit);
+ TS_ASSERT(converted_from_pts);
+ TS_ASSERT(approx_equal(tmp, c.x));
+ }
+ }
+
+ void testUnitTable()
+ {
+ TS_ASSERT(sp_units_table_sane());
+ }
+};
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :encoding=utf-8:textwidth=99 :
index 4180fcf3dbb68e60b95f0b8fe1d7b77a10cf760a..658968bce88b916d17b8f68fb95a51a0c8a18a6f 100644 (file)
-#include <cxxtest/TestSuite.h>\r
-\r
-#include "svg/svg.h"\r
-#include <2geom/matrix.h>\r
-#include <algorithm>\r
-#include <glib.h>\r
-#include <iostream>\r
-#include <math.h>\r
-#include <utility>\r
-\r
-struct streq_free2 {\r
- bool operator()(char const *exp, char const *got) const\r
- {\r
- bool const ret = (strcmp(exp, got) == 0);\r
- g_free((void*)got);\r
- return ret;\r
- }\r
-};\r
-\r
-struct approx_equal {\r
- bool operator()(Geom::Matrix const &ref, Geom::Matrix const &cm) const\r
- {\r
- double maxabsdiff = 0;\r
- for(size_t i=0; i<6; i++) {\r
- maxabsdiff = std::max(std::abs(ref[i]-cm[i]), maxabsdiff);\r
- }\r
- return maxabsdiff < 1e-14;\r
- }\r
-};\r
-\r
-class SvgAffineTest : public CxxTest::TestSuite\r
-{\r
-private:\r
- struct test_t {\r
- char const * str;\r
- Geom::Matrix matrix;\r
- };\r
- static test_t const read_matrix_tests[3];\r
- static test_t const read_translate_tests[3];\r
- static test_t const read_scale_tests[3];\r
- static test_t const read_rotate_tests[4];\r
- static test_t const read_skew_tests[3];\r
- static test_t const write_matrix_tests[2];\r
- static test_t const write_translate_tests[3];\r
- static test_t const write_scale_tests[2];\r
- static test_t const write_rotate_tests[2];\r
- static test_t const write_skew_tests[3];\r
-public:\r
- SvgAffineTest() {\r
- }\r
-\r
- void testReadIdentity()\r
- {\r
- char const* strs[] = {\r
- //0,\r
- "",\r
- "matrix(1,0,0,1,0,0)",\r
- "translate(0,0)",\r
- "scale(1,1)",\r
- "rotate(0,0,0)",\r
- "skewX(0)",\r
- "skewY(0)"};\r
- size_t n = G_N_ELEMENTS(strs);\r
- for(size_t i=0; i<n; i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(strs[i] , sp_svg_transform_read(strs[i], &cm));\r
- TSM_ASSERT_EQUALS(strs[i] , Geom::identity() , cm);\r
- }\r
- }\r
-\r
- void testWriteIdentity()\r
- {\r
- TS_ASSERT_EQUALS(sp_svg_transform_write(Geom::identity()) , (void*)0)\r
- }\r
-\r
- void testReadMatrix()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(read_matrix_tests); i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(read_matrix_tests[i].str , sp_svg_transform_read(read_matrix_tests[i].str, &cm));\r
- TSM_ASSERT_RELATION(read_matrix_tests[i].str , approx_equal , read_matrix_tests[i].matrix , cm);\r
- }\r
- }\r
-\r
- void testReadTranslate()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(read_translate_tests); i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(read_translate_tests[i].str , sp_svg_transform_read(read_translate_tests[i].str, &cm));\r
- TSM_ASSERT_RELATION(read_translate_tests[i].str , approx_equal , read_translate_tests[i].matrix , cm);\r
- }\r
- }\r
-\r
- void testReadScale()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(read_scale_tests); i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(read_scale_tests[i].str , sp_svg_transform_read(read_scale_tests[i].str, &cm));\r
- TSM_ASSERT_RELATION(read_scale_tests[i].str , approx_equal , read_scale_tests[i].matrix , cm);\r
- }\r
- }\r
-\r
- void testReadRotate()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(read_rotate_tests); i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(read_rotate_tests[i].str , sp_svg_transform_read(read_rotate_tests[i].str, &cm));\r
- TSM_ASSERT_RELATION(read_rotate_tests[i].str , approx_equal , read_rotate_tests[i].matrix , cm);\r
- }\r
- }\r
-\r
- void testReadSkew()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(read_skew_tests); i++) {\r
- Geom::Matrix cm;\r
- TSM_ASSERT(read_skew_tests[i].str , sp_svg_transform_read(read_skew_tests[i].str, &cm));\r
- TSM_ASSERT_RELATION(read_skew_tests[i].str , approx_equal , read_skew_tests[i].matrix , cm);\r
- }\r
- }\r
-\r
- void testWriteMatrix()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(write_matrix_tests); i++) {\r
- TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_matrix_tests[i].matrix) , write_matrix_tests[i].str);\r
- }\r
- }\r
-\r
- void testWriteTranslate()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(write_translate_tests); i++) {\r
- TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_translate_tests[i].matrix) , write_translate_tests[i].str);\r
- }\r
- }\r
-\r
- void testWriteScale()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(write_scale_tests); i++) {\r
- TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_scale_tests[i].matrix) , write_scale_tests[i].str);\r
- }\r
- }\r
-\r
- void testWriteRotate()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(write_rotate_tests); i++) {\r
- TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_rotate_tests[i].matrix) , write_rotate_tests[i].str);\r
- }\r
- }\r
-\r
- void testWriteSkew()\r
- {\r
- for(size_t i=0; i<G_N_ELEMENTS(write_skew_tests); i++) {\r
- TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_skew_tests[i].matrix) , write_skew_tests[i].str);\r
- }\r
- }\r
-\r
- void testReadConcatenation()\r
- {\r
- char const * str = "skewY(17)skewX(9)translate(7,13)scale(2)rotate(13)translate(3,5)";\r
- Geom::Matrix ref(2.0199976232558053, 1.0674773585906016, -0.14125199392774669, 1.9055550612095459, 14.412730624347654, 28.499820929377454); // Precomputed using Mathematica\r
- Geom::Matrix cm;\r
- TS_ASSERT(sp_svg_transform_read(str, &cm));\r
- TS_ASSERT_RELATION(approx_equal , ref , cm);\r
- }\r
-\r
- // TODO: Perhaps check faulty transforms (like "translate(1,2,3)", or "matrix(1,2,3,4,5)", or ...)\r
-};\r
-\r
-static double const DEGREE = M_PI/180.;\r
-\r
-SvgAffineTest::test_t const SvgAffineTest::read_matrix_tests[3] = {\r
- {"matrix(0,0,0,0,0,0)",Geom::Matrix(0,0,0,0,0,0)},\r
- {"matrix(1,2,3,4,5,6)",Geom::Matrix(1,2,3,4,5,6)},\r
- {"matrix(1 2 -3,-4,5e6,-6e-7)",Geom::Matrix(1,2,-3,-4,5e6,-6e-7)}};\r
-SvgAffineTest::test_t const SvgAffineTest::read_translate_tests[3] = {\r
- {"translate(1)",Geom::Matrix(1,0,0,1,1,0)},\r
- {"translate(1,1)",Geom::Matrix(1,0,0,1,1,1)},\r
- {"translate(-1e3 .123e2)",Geom::Matrix(1,0,0,1,-1e3,.123e2)}};\r
-SvgAffineTest::test_t const SvgAffineTest::read_scale_tests[3] = {\r
- {"scale(2)",Geom::Matrix(2,0,0,2,0,0)},\r
- {"scale(2,3)",Geom::Matrix(2,0,0,3,0,0)},\r
- {"scale(0.1e-2 -.475e0)",Geom::Matrix(0.1e-2,0,0,-.475e0,0,0)}};\r
-SvgAffineTest::test_t const SvgAffineTest::read_rotate_tests[4] = {\r
- {"rotate(13 )",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},\r
- {"rotate(-13)",Geom::Matrix(cos(-13.*DEGREE),sin(-13.*DEGREE),-sin(-13.*DEGREE),cos(-13.*DEGREE),0,0)},\r
- {"rotate(373)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},\r
- {"rotate(13,7,11)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),(1-cos(13.*DEGREE))*7+sin(13.*DEGREE)*11,(1-cos(13.*DEGREE))*11-sin(13.*DEGREE)*7)}};\r
-SvgAffineTest::test_t const SvgAffineTest::read_skew_tests[3] = {\r
- {"skewX( 30)",Geom::Matrix(1,0,tan(30.*DEGREE),1,0,0)},\r
- {"skewX(-30)",Geom::Matrix(1,0,tan(-30.*DEGREE),1,0,0)},\r
- {"skewY(390)",Geom::Matrix(1,tan(30.*DEGREE),0,1,0,0)}};\r
-\r
-SvgAffineTest::test_t const SvgAffineTest::write_matrix_tests[2] = {\r
- {"matrix(1,2,3,4,5,6)",Geom::Matrix(1,2,3,4,5,6)},\r
- {"matrix(-1,2123,3,0.4,1e-8,1e20)",Geom::Matrix(-1,2.123e3,3+1e-14,0.4,1e-8,1e20)}};\r
-SvgAffineTest::test_t const SvgAffineTest::write_translate_tests[3] = {\r
- {"translate(1,1)",Geom::Matrix(1,0,0,1,1,1)},\r
- {"translate(1)",Geom::Matrix(1,0,0,1,1,0)},\r
- {"translate(-1345,0.123)",Geom::Matrix(1,0,0,1,-1.345e3,.123)}};\r
-SvgAffineTest::test_t const SvgAffineTest::write_scale_tests[2] = {\r
- {"scale(0)",Geom::Matrix(0,0,0,0,0,0)},\r
- {"scale(2,3)",Geom::Matrix(2,0,0,3,0,0)}};\r
-SvgAffineTest::test_t const SvgAffineTest::write_rotate_tests[2] = {\r
- {"rotate(13)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},\r
- {"rotate(-13,7,11)",Geom::Matrix(cos(-13.*DEGREE),sin(-13.*DEGREE),-sin(-13.*DEGREE),cos(-13.*DEGREE),(1-cos(-13.*DEGREE))*7+sin(-13.*DEGREE)*11,(1-cos(-13.*DEGREE))*11-sin(-13.*DEGREE)*7)}};\r
-SvgAffineTest::test_t const SvgAffineTest::write_skew_tests[3] = {\r
- {"skewX(30)",Geom::Matrix(1,0,tan(30.*DEGREE),1,0,0)},\r
- {"skewX(-30)",Geom::Matrix(1,0,tan(-30.*DEGREE),1,0,0)},\r
- {"skewY(390)",Geom::Matrix(1,tan(30.*DEGREE),0,1,0,0)}};\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+
+#include "svg/svg.h"
+#include <2geom/matrix.h>
+#include <algorithm>
+#include <glib.h>
+#include <iostream>
+#include <math.h>
+#include <utility>
+
+struct streq_free2 {
+ bool operator()(char const *exp, char const *got) const
+ {
+ bool const ret = (strcmp(exp, got) == 0);
+ g_free((void*)got);
+ return ret;
+ }
+};
+
+struct approx_equal {
+ bool operator()(Geom::Matrix const &ref, Geom::Matrix const &cm) const
+ {
+ double maxabsdiff = 0;
+ for(size_t i=0; i<6; i++) {
+ maxabsdiff = std::max(std::abs(ref[i]-cm[i]), maxabsdiff);
+ }
+ return maxabsdiff < 1e-14;
+ }
+};
+
+class SvgAffineTest : public CxxTest::TestSuite
+{
+private:
+ struct test_t {
+ char const * str;
+ Geom::Matrix matrix;
+ };
+ static test_t const read_matrix_tests[3];
+ static test_t const read_translate_tests[3];
+ static test_t const read_scale_tests[3];
+ static test_t const read_rotate_tests[4];
+ static test_t const read_skew_tests[3];
+ static test_t const write_matrix_tests[2];
+ static test_t const write_translate_tests[3];
+ static test_t const write_scale_tests[2];
+ static test_t const write_rotate_tests[2];
+ static test_t const write_skew_tests[3];
+public:
+ SvgAffineTest() {
+ }
+
+ void testReadIdentity()
+ {
+ char const* strs[] = {
+ //0,
+ "",
+ "matrix(1,0,0,1,0,0)",
+ "translate(0,0)",
+ "scale(1,1)",
+ "rotate(0,0,0)",
+ "skewX(0)",
+ "skewY(0)"};
+ size_t n = G_N_ELEMENTS(strs);
+ for(size_t i=0; i<n; i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(strs[i] , sp_svg_transform_read(strs[i], &cm));
+ TSM_ASSERT_EQUALS(strs[i] , Geom::identity() , cm);
+ }
+ }
+
+ void testWriteIdentity()
+ {
+ TS_ASSERT_EQUALS(sp_svg_transform_write(Geom::identity()) , (void*)0)
+ }
+
+ void testReadMatrix()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(read_matrix_tests); i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(read_matrix_tests[i].str , sp_svg_transform_read(read_matrix_tests[i].str, &cm));
+ TSM_ASSERT_RELATION(read_matrix_tests[i].str , approx_equal , read_matrix_tests[i].matrix , cm);
+ }
+ }
+
+ void testReadTranslate()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(read_translate_tests); i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(read_translate_tests[i].str , sp_svg_transform_read(read_translate_tests[i].str, &cm));
+ TSM_ASSERT_RELATION(read_translate_tests[i].str , approx_equal , read_translate_tests[i].matrix , cm);
+ }
+ }
+
+ void testReadScale()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(read_scale_tests); i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(read_scale_tests[i].str , sp_svg_transform_read(read_scale_tests[i].str, &cm));
+ TSM_ASSERT_RELATION(read_scale_tests[i].str , approx_equal , read_scale_tests[i].matrix , cm);
+ }
+ }
+
+ void testReadRotate()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(read_rotate_tests); i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(read_rotate_tests[i].str , sp_svg_transform_read(read_rotate_tests[i].str, &cm));
+ TSM_ASSERT_RELATION(read_rotate_tests[i].str , approx_equal , read_rotate_tests[i].matrix , cm);
+ }
+ }
+
+ void testReadSkew()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(read_skew_tests); i++) {
+ Geom::Matrix cm;
+ TSM_ASSERT(read_skew_tests[i].str , sp_svg_transform_read(read_skew_tests[i].str, &cm));
+ TSM_ASSERT_RELATION(read_skew_tests[i].str , approx_equal , read_skew_tests[i].matrix , cm);
+ }
+ }
+
+ void testWriteMatrix()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(write_matrix_tests); i++) {
+ TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_matrix_tests[i].matrix) , write_matrix_tests[i].str);
+ }
+ }
+
+ void testWriteTranslate()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(write_translate_tests); i++) {
+ TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_translate_tests[i].matrix) , write_translate_tests[i].str);
+ }
+ }
+
+ void testWriteScale()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(write_scale_tests); i++) {
+ TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_scale_tests[i].matrix) , write_scale_tests[i].str);
+ }
+ }
+
+ void testWriteRotate()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(write_rotate_tests); i++) {
+ TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_rotate_tests[i].matrix) , write_rotate_tests[i].str);
+ }
+ }
+
+ void testWriteSkew()
+ {
+ for(size_t i=0; i<G_N_ELEMENTS(write_skew_tests); i++) {
+ TS_ASSERT_RELATION(streq_free2 , sp_svg_transform_write(write_skew_tests[i].matrix) , write_skew_tests[i].str);
+ }
+ }
+
+ void testReadConcatenation()
+ {
+ char const * str = "skewY(17)skewX(9)translate(7,13)scale(2)rotate(13)translate(3,5)";
+ Geom::Matrix ref(2.0199976232558053, 1.0674773585906016, -0.14125199392774669, 1.9055550612095459, 14.412730624347654, 28.499820929377454); // Precomputed using Mathematica
+ Geom::Matrix cm;
+ TS_ASSERT(sp_svg_transform_read(str, &cm));
+ TS_ASSERT_RELATION(approx_equal , ref , cm);
+ }
+
+ // TODO: Perhaps check faulty transforms (like "translate(1,2,3)", or "matrix(1,2,3,4,5)", or ...)
+};
+
+static double const DEGREE = M_PI/180.;
+
+SvgAffineTest::test_t const SvgAffineTest::read_matrix_tests[3] = {
+ {"matrix(0,0,0,0,0,0)",Geom::Matrix(0,0,0,0,0,0)},
+ {"matrix(1,2,3,4,5,6)",Geom::Matrix(1,2,3,4,5,6)},
+ {"matrix(1 2 -3,-4,5e6,-6e-7)",Geom::Matrix(1,2,-3,-4,5e6,-6e-7)}};
+SvgAffineTest::test_t const SvgAffineTest::read_translate_tests[3] = {
+ {"translate(1)",Geom::Matrix(1,0,0,1,1,0)},
+ {"translate(1,1)",Geom::Matrix(1,0,0,1,1,1)},
+ {"translate(-1e3 .123e2)",Geom::Matrix(1,0,0,1,-1e3,.123e2)}};
+SvgAffineTest::test_t const SvgAffineTest::read_scale_tests[3] = {
+ {"scale(2)",Geom::Matrix(2,0,0,2,0,0)},
+ {"scale(2,3)",Geom::Matrix(2,0,0,3,0,0)},
+ {"scale(0.1e-2 -.475e0)",Geom::Matrix(0.1e-2,0,0,-.475e0,0,0)}};
+SvgAffineTest::test_t const SvgAffineTest::read_rotate_tests[4] = {
+ {"rotate(13 )",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},
+ {"rotate(-13)",Geom::Matrix(cos(-13.*DEGREE),sin(-13.*DEGREE),-sin(-13.*DEGREE),cos(-13.*DEGREE),0,0)},
+ {"rotate(373)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},
+ {"rotate(13,7,11)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),(1-cos(13.*DEGREE))*7+sin(13.*DEGREE)*11,(1-cos(13.*DEGREE))*11-sin(13.*DEGREE)*7)}};
+SvgAffineTest::test_t const SvgAffineTest::read_skew_tests[3] = {
+ {"skewX( 30)",Geom::Matrix(1,0,tan(30.*DEGREE),1,0,0)},
+ {"skewX(-30)",Geom::Matrix(1,0,tan(-30.*DEGREE),1,0,0)},
+ {"skewY(390)",Geom::Matrix(1,tan(30.*DEGREE),0,1,0,0)}};
+
+SvgAffineTest::test_t const SvgAffineTest::write_matrix_tests[2] = {
+ {"matrix(1,2,3,4,5,6)",Geom::Matrix(1,2,3,4,5,6)},
+ {"matrix(-1,2123,3,0.4,1e-8,1e20)",Geom::Matrix(-1,2.123e3,3+1e-14,0.4,1e-8,1e20)}};
+SvgAffineTest::test_t const SvgAffineTest::write_translate_tests[3] = {
+ {"translate(1,1)",Geom::Matrix(1,0,0,1,1,1)},
+ {"translate(1)",Geom::Matrix(1,0,0,1,1,0)},
+ {"translate(-1345,0.123)",Geom::Matrix(1,0,0,1,-1.345e3,.123)}};
+SvgAffineTest::test_t const SvgAffineTest::write_scale_tests[2] = {
+ {"scale(0)",Geom::Matrix(0,0,0,0,0,0)},
+ {"scale(2,3)",Geom::Matrix(2,0,0,3,0,0)}};
+SvgAffineTest::test_t const SvgAffineTest::write_rotate_tests[2] = {
+ {"rotate(13)",Geom::Matrix(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)},
+ {"rotate(-13,7,11)",Geom::Matrix(cos(-13.*DEGREE),sin(-13.*DEGREE),-sin(-13.*DEGREE),cos(-13.*DEGREE),(1-cos(-13.*DEGREE))*7+sin(-13.*DEGREE)*11,(1-cos(-13.*DEGREE))*11-sin(-13.*DEGREE)*7)}};
+SvgAffineTest::test_t const SvgAffineTest::write_skew_tests[3] = {
+ {"skewX(30)",Geom::Matrix(1,0,tan(30.*DEGREE),1,0,0)},
+ {"skewX(-30)",Geom::Matrix(1,0,tan(-30.*DEGREE),1,0,0)},
+ {"skewY(390)",Geom::Matrix(1,tan(30.*DEGREE),0,1,0,0)}};
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
index 0f628ae7cb5823dc73bcc2b69b66dd74be43b5d8..f6c6cb4f696b9ab4938bfc83fa0f7a13b9f54e87 100644 (file)
-#include <cxxtest/TestSuite.h>\r
-\r
-#include "svg/svg-length.h"\r
-#include <glib.h>\r
-#include <utility>\r
-\r
-class SvgLengthTest : public CxxTest::TestSuite\r
-{\r
-private:\r
-public:\r
- SvgLengthTest() {\r
- }\r
-\r
- void testRead()\r
- {\r
- struct test_t {\r
- char const* str; float computed;\r
- test_t(char const* str, float computed) : str(str), computed(computed) {}\r
- };\r
- test_t tests[] = {\r
- test_t("0",0),\r
- test_t("1",1),\r
- test_t("1.00001",1.00001),\r
- test_t("1px",1),\r
- test_t(".1px",0.1)};\r
- size_t n = G_N_ELEMENTS(tests);\r
- for(size_t i=0; i<n; i++) {\r
- SVGLength l;\r
- TSM_ASSERT(tests[i].str , l.read(tests[i].str));\r
- TSM_ASSERT_EQUALS(tests[i].str , l.computed , tests[i].computed);\r
- }\r
- }\r
-\r
- // TODO: More tests\r
-};\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+
+#include "svg/svg-length.h"
+#include <glib.h>
+#include <utility>
+
+class SvgLengthTest : public CxxTest::TestSuite
+{
+private:
+public:
+ SvgLengthTest() {
+ }
+
+ void testRead()
+ {
+ struct test_t {
+ char const* str; float computed;
+ test_t(char const* str, float computed) : str(str), computed(computed) {}
+ };
+ test_t tests[] = {
+ test_t("0",0),
+ test_t("1",1),
+ test_t("1.00001",1.00001),
+ test_t("1px",1),
+ test_t(".1px",0.1)};
+ size_t n = G_N_ELEMENTS(tests);
+ for(size_t i=0; i<n; i++) {
+ SVGLength l;
+ TSM_ASSERT(tests[i].str , l.read(tests[i].str));
+ TSM_ASSERT_EQUALS(tests[i].str , l.computed , tests[i].computed);
+ }
+ }
+
+ // TODO: More tests
+};
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
index 5247ace83741266d7c1ecd5939db7d39bff633d3..5e2038527ffa0f82ff2355d548f41ccaac5d5c63 100644 (file)
--- a/src/svg/svg-path-test.h
+++ b/src/svg/svg-path-test.h
-#include <cxxtest/TestSuite.h>\r
-#include "libnr/n-art-bpath.h"\r
-#include "svg/svg.h"\r
-#include "2geom/coord.h"\r
-#include <string>\r
-#include <vector>\r
-#include <glib/gmem.h>\r
-\r
-class SvgPathTest : public CxxTest::TestSuite\r
-{\r
-private:\r
- std::vector<std::string> rectanglesAbsoluteClosed;\r
- std::vector<std::string> rectanglesRelativeClosed;\r
- std::vector<std::string> rectanglesAbsoluteOpen;\r
- std::vector<std::string> rectanglesRelativeOpen;\r
- NArtBpath rectangleBpath[5+1];\r
-public:\r
- SvgPathTest() {\r
- // Lots of ways to define the same rectangle\r
- rectanglesAbsoluteClosed.push_back("M 1,2 L 4,2 L 4,8 L 1,8 L 1,2 Z");\r
- rectanglesAbsoluteClosed.push_back("M 1,2 L 4,2 L 4,8 L 1,8 z");\r
- rectanglesAbsoluteClosed.push_back("M 1,2 4,2 4,8 1,8 z");\r
- rectanglesAbsoluteClosed.push_back("M 1,2 H 4 V 8 H 1 z");\r
- rectanglesRelativeClosed.push_back("m 1,2 l 3,0 l 0,6 l -3,0 z");\r
- rectanglesRelativeClosed.push_back("m 1,2 3,0 0,6 -3,0 z");\r
- rectanglesRelativeClosed.push_back("m 1,2 h 3 v 6 h -3 z");\r
- rectanglesAbsoluteOpen.push_back("M 1,2 L 4,2 L 4,8 L 1,8 L 1,2");\r
- rectanglesAbsoluteOpen.push_back("M 1,2 4,2 4,8 1,8 1,2");\r
- rectanglesAbsoluteOpen.push_back("M 1,2 H 4 V 8 H 1 V 2");\r
- rectanglesRelativeOpen.push_back("m 1,2 l 3,0 l 0,6 l -3,0 l 0,-6");\r
- rectanglesRelativeOpen.push_back("m 1,2 3,0 0,6 -3,0 0,-6");\r
- rectanglesRelativeOpen.push_back("m 1,2 h 3 v 6 h -3 v -6");\r
- rectangleBpath[0].code = NR_MOVETO;\r
- rectangleBpath[0].x3 = 1;\r
- rectangleBpath[0].y3 = 2;\r
- rectangleBpath[1].code = NR_LINETO;\r
- rectangleBpath[1].x3 = 4;\r
- rectangleBpath[1].y3 = 2;\r
- rectangleBpath[2].code = NR_LINETO;\r
- rectangleBpath[2].x3 = 4;\r
- rectangleBpath[2].y3 = 8;\r
- rectangleBpath[3].code = NR_LINETO;\r
- rectangleBpath[3].x3 = 1;\r
- rectangleBpath[3].y3 = 8;\r
- rectangleBpath[4].code = NR_LINETO;\r
- rectangleBpath[4].x3 = 1;\r
- rectangleBpath[4].y3 = 2;\r
- rectangleBpath[5].code = NR_END;\r
- // TODO: Also test some (smooth) cubic/quadratic beziers and elliptical arcs\r
- }\r
-\r
- void testReadRectanglesAbsoluteClosed()\r
- {\r
- rectangleBpath[0].code = NR_MOVETO;\r
- for(size_t i=0; i<rectanglesAbsoluteClosed.size(); i++) {\r
- NArtBpath * bpath = sp_svg_read_path(rectanglesAbsoluteClosed[i].c_str());\r
- TS_ASSERT(bpathEqual(bpath,rectangleBpath));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadRectanglesRelativeClosed()\r
- {\r
- rectangleBpath[0].code = NR_MOVETO;\r
- for(size_t i=0; i<rectanglesRelativeClosed.size(); i++) {\r
- NArtBpath * bpath = sp_svg_read_path(rectanglesRelativeClosed[i].c_str());\r
- TS_ASSERT(bpathEqual(bpath,rectangleBpath));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadRectanglesAbsoluteOpen()\r
- {\r
- rectangleBpath[0].code = NR_MOVETO_OPEN;\r
- for(size_t i=0; i<rectanglesAbsoluteOpen.size(); i++) {\r
- NArtBpath * bpath = sp_svg_read_path(rectanglesAbsoluteOpen[i].c_str());\r
- TS_ASSERT(bpathEqual(bpath,rectangleBpath));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadRectanglesRelativeOpen()\r
- {\r
- rectangleBpath[0].code = NR_MOVETO_OPEN;\r
- for(size_t i=0; i<rectanglesRelativeOpen.size(); i++) {\r
- NArtBpath * bpath = sp_svg_read_path(rectanglesRelativeOpen[i].c_str());\r
- TS_ASSERT(bpathEqual(bpath,rectangleBpath));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadConcatenatedPaths()\r
- {\r
- NArtBpath bpath_good[4*5+1];\r
- for(size_t i=0; i<4; i++) {\r
- memcpy(bpath_good+i*5,rectangleBpath,sizeof(rectangleBpath[0])*5);\r
- }\r
- bpath_good[0*5].code = NR_MOVETO;\r
- bpath_good[1*5].code = NR_MOVETO_OPEN;\r
- bpath_good[2*5].code = NR_MOVETO;\r
- bpath_good[3*5].code = NR_MOVETO_OPEN;\r
- bpath_good[4*5].code = NR_END;\r
- for(size_t i=0; i<5; i++) {\r
- bpath_good[1*5+i].x3 += bpath_good[0*5+4].x3;\r
- bpath_good[1*5+i].y3 += bpath_good[0*5+4].y3;\r
- }\r
- for(size_t i=0; i<5; i++) {\r
- bpath_good[2*5+i].x3 += bpath_good[1*5+4].x3;\r
- bpath_good[2*5+i].y3 += bpath_good[1*5+4].y3;\r
- }\r
- std::string path_str = rectanglesAbsoluteClosed[0] + rectanglesRelativeOpen[0] + rectanglesRelativeClosed[0] + rectanglesAbsoluteOpen[0];\r
- NArtBpath * bpath = sp_svg_read_path(path_str.c_str());\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadZeroLengthSubpaths() {\r
- // Per the SVG 1.1 specification (section F5) zero-length subpaths are relevant\r
- NArtBpath bpath_good[8+1];\r
- bpath_good[0].code = NR_MOVETO_OPEN;\r
- bpath_good[0].x3 = bpath_good[0].y3 = 0;\r
- bpath_good[1].code = NR_MOVETO_OPEN;\r
- bpath_good[1].x3 = bpath_good[1].y3 = 1;\r
- bpath_good[2].code = NR_LINETO;\r
- bpath_good[2].x3 = bpath_good[2].y3 = 2;\r
- bpath_good[3].code = NR_MOVETO;\r
- bpath_good[3].x3 = bpath_good[3].y3 = 3;\r
- bpath_good[4].code = NR_MOVETO;\r
- bpath_good[4].x3 = bpath_good[4].y3 = 4;\r
- bpath_good[5].code = NR_LINETO;\r
- bpath_good[5].x3 = bpath_good[5].y3 = 5;\r
- bpath_good[6].code = NR_LINETO;\r
- bpath_good[6].x3 = bpath_good[6].y3 = 4;\r
- bpath_good[7].code = NR_MOVETO_OPEN;\r
- bpath_good[7].x3 = bpath_good[7].y3 = 6;\r
- bpath_good[8].code = NR_END;\r
- { // Test absolute version\r
- char const * path_str = "M 0,0 M 1,1 L 2,2 M 3,3 z M 4,4 L 5,5 z M 6,6";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- { // Test relative version\r
- char const * path_str = "m 0,0 m 1,1 l 1,1 m 1,1 z m 1,1 l 1,1 z m 2,2";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadImplicitMoveto() {\r
- NArtBpath bpath_good[6+1];\r
- bpath_good[0].code = NR_MOVETO;\r
- bpath_good[0].x3 = bpath_good[0].y3 = 1;\r
- bpath_good[1].code = NR_LINETO;\r
- bpath_good[1].x3 = bpath_good[1].y3 = 2;\r
- bpath_good[2].code = NR_LINETO;\r
- bpath_good[2].x3 = bpath_good[2].y3 = 1;\r
- bpath_good[3].code = NR_MOVETO;\r
- bpath_good[3].x3 = bpath_good[3].y3 = 1;\r
- bpath_good[4].code = NR_LINETO;\r
- bpath_good[4].x3 = bpath_good[4].y3 = 3;\r
- bpath_good[5].code = NR_LINETO;\r
- bpath_good[5].x3 = bpath_good[5].y3 = 1;\r
- bpath_good[6].code = NR_END;\r
- { // Test absolute version\r
- char const * path_str = "M 1,1 L 2,2 z L 3,3 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- { // Test relative version\r
- char const * path_str = "M 1,1 L 2,2 z L 3,3 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadFloatingPoint() {\r
- NArtBpath bpath_good[5+1];\r
- bpath_good[0].code = NR_MOVETO;\r
- bpath_good[0].x3 = .01;\r
- bpath_good[0].y3 = .02;\r
- bpath_good[1].code = NR_LINETO;\r
- bpath_good[1].x3 = .04;\r
- bpath_good[1].y3 = .02;\r
- bpath_good[2].code = NR_LINETO;\r
- bpath_good[2].x3 = 1.5;\r
- bpath_good[2].y3 = 1.6;\r
- bpath_good[3].code = NR_LINETO;\r
- bpath_good[3].x3 = .01;\r
- bpath_good[3].y3 = .08;\r
- bpath_good[4].code = NR_LINETO;\r
- bpath_good[4].x3 = .01;\r
- bpath_good[4].y3 = .02;\r
- bpath_good[5].code = NR_END;\r
- { // Test decimals\r
- char const * path_str = "M .01,.02 L.04.02 L1.5,1.6L0.01,0.08 .01.02 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- { // Test exponent\r
- char const * path_str = "M 1e-2,.2e-1 L 0.004e1,0.0002e+2 L0150E-2,1.6e0L1.0e-2,80e-3 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadImplicitSeparation() {\r
- // Coordinates need not be separated by whitespace if they can still be read unambiguously\r
- NArtBpath bpath_good[5+1];\r
- bpath_good[0].code = NR_MOVETO;\r
- bpath_good[0].x3 = .1;\r
- bpath_good[0].y3 = .2;\r
- bpath_good[1].code = NR_LINETO;\r
- bpath_good[1].x3 = .4;\r
- bpath_good[1].y3 = .2;\r
- bpath_good[2].code = NR_LINETO;\r
- bpath_good[2].x3 = .4;\r
- bpath_good[2].y3 = .8;\r
- bpath_good[3].code = NR_LINETO;\r
- bpath_good[3].x3 = .1;\r
- bpath_good[3].y3 = .8;\r
- bpath_good[4].code = NR_LINETO;\r
- bpath_good[4].x3 = .1;\r
- bpath_good[4].y3 = .2;\r
- bpath_good[5].code = NR_END;\r
- { // Test absolute\r
- char const * path_str = "M .1.2+0.4.2e0.4e0+8e-1.1.8 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- { // Test relative\r
- char const * path_str = "m .1.2+0.3.0e0.0e0+6e-1-.3.0 z";\r
- NArtBpath * bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
- }\r
-\r
- void testReadErrorMisplacedCharacter() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Comma in the wrong place (commas may only appear between parameters)\r
- path_str = "M 1,2 4,2 4,8 1,8 z , m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Comma in the wrong place (commas may only appear between parameters)\r
- path_str = "M 1,2 4,2 4,8 1,8 z m,13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Period in the wrong place (no numbers after a 'z')\r
- path_str = "M 1,2 4,2 4,8 1,8 z . m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Sign in the wrong place (no numbers after a 'z')\r
- path_str = "M 1,2 4,2 4,8 1,8 z + - m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Digit in the wrong place (no numbers after a 'z')\r
- path_str = "M 1,2 4,2 4,8 1,8 z 9809 m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Digit in the wrong place (no numbers after a 'z')\r
- path_str = "M 1,2 4,2 4,8 1,8 z 9809 876 m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadErrorUnrecognizedCharacter() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Unrecognized character\r
- path_str = "M 1,2 4,2 4,8 1,8 z&m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Unrecognized character\r
- path_str = "M 1,2 4,2 4,8 1,8 z m &13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadErrorTypo() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Typo\r
- path_str = "M 1,2 4,2 4,8 1,8 z j 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
-\r
- bpath_good[0].code = NR_MOVETO_OPEN;\r
- // Typo\r
- path_str = "M 1,2 4,2 4,8 1,8 L 1,2 x m 13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadErrorIllformedNumbers() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Double exponent\r
- path_str = "M 1,2 4,2 4,8 1,8 z m 13e4e5,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Double sign\r
- path_str = "M 1,2 4,2 4,8 1,8 z m +-13,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Double sign\r
- path_str = "M 1,2 4,2 4,8 1,8 z m 13e+-12,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // No digit\r
- path_str = "M 1,2 4,2 4,8 1,8 z m .e12,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // No digit\r
- path_str = "M 1,2 4,2 4,8 1,8 z m .,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // No digit\r
- path_str = "M 1,2 4,2 4,8 1,8 z m +,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // No digit\r
- path_str = "M 1,2 4,2 4,8 1,8 z m +.e+,15";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadErrorJunk() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Junk\r
- path_str = "M 1,2 4,2 4,8 1,8 z j 357 hkjh.,34e34 90ih6kj4 h5k6vlh4N.,6,45wikuyi3yere..3487 m 13,23";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testReadErrorStopReading() {\r
- char const * path_str;\r
- NArtBpath * bpath;\r
- NArtBpath * bpath_good = rectangleBpath;\r
- bpath_good[0].code = NR_MOVETO;\r
- // Unrecognized parameter\r
- path_str = "M 1,2 4,2 4,8 1,8 z m #$%,23,34";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Invalid parameter\r
- path_str = "M 1,2 4,2 4,8 1,8 z m #$%,23,34";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- // Illformed parameter\r
- path_str = "M 1,2 4,2 4,8 1,8 z m +-12,23,34";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
-\r
- bpath_good[0].code = NR_MOVETO_OPEN;\r
- // "Third" parameter\r
- path_str = "M 1,2 4,2 4,8 1,8 1,2,3 M 12,23";\r
- bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,bpath_good));\r
- g_free(bpath);\r
- }\r
-\r
- void testRoundTrip() {\r
- // This is the easiest way to (also) test writing path data, as a path can be written in more than one way.\r
- NArtBpath * bpath;\r
- NArtBpath * new_bpath;\r
- char * path_str;\r
- // Rectangle (closed)\r
- bpath = sp_svg_read_path(rectanglesAbsoluteClosed[0].c_str());\r
- path_str = sp_svg_write_path(bpath);\r
- new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,new_bpath));\r
- g_free(bpath); g_free(path_str); g_free(new_bpath);\r
- // Rectangle (open)\r
- bpath = sp_svg_read_path(rectanglesAbsoluteOpen[0].c_str());\r
- path_str = sp_svg_write_path(bpath);\r
- new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,new_bpath));\r
- g_free(bpath); g_free(path_str); g_free(new_bpath);\r
- // Concatenated rectangles\r
- bpath = sp_svg_read_path((rectanglesAbsoluteClosed[0] + rectanglesRelativeOpen[0] + rectanglesRelativeClosed[0] + rectanglesAbsoluteOpen[0]).c_str());\r
- path_str = sp_svg_write_path(bpath);\r
- new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,new_bpath));\r
- g_free(bpath); g_free(path_str); g_free(new_bpath);\r
- // Zero-length subpaths\r
- bpath = sp_svg_read_path("M 0,0 M 1,1 L 2,2 M 3,3 z M 4,4 L 5,5 z M 6,6");\r
- path_str = sp_svg_write_path(bpath);\r
- new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath,new_bpath));\r
- g_free(bpath); g_free(path_str); g_free(new_bpath);\r
- // Floating-point\r
- bpath = sp_svg_read_path("M .01,.02 L 0.04,0.02 L.04,.08L0.01,0.08 z""M 1e-2,.2e-1 L 0.004e1,0.0002e+2 L04E-2,.08e0L1.0e-2,80e-3 z");\r
- path_str = sp_svg_write_path(bpath);\r
- new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-17));\r
- g_free(bpath); g_free(path_str); g_free(new_bpath);\r
- }\r
-\r
-private:\r
- bool bpathEqual(NArtBpath const * a, NArtBpath const * b, double eps = 1e-16) {\r
- while(a->code != NR_END && b->code == a->code) {\r
- switch(a->code) {\r
- case NR_MOVETO:\r
- case NR_MOVETO_OPEN:\r
- case NR_LINETO:\r
- if (!Geom::are_near(a->x3,b->x3, eps) || !Geom::are_near(a->y3,b->y3, eps)) return false;\r
- break;\r
- case NR_CURVETO:\r
- if (!Geom::are_near(a->x1,b->x1, eps) || !Geom::are_near(a->y1,b->y1, eps)) return false;\r
- if (!Geom::are_near(a->x2,b->x2, eps) || !Geom::are_near(a->y2,b->y2, eps)) return false;\r
- if (!Geom::are_near(a->x3,b->x3, eps) || !Geom::are_near(a->y3,b->y3, eps)) return false;\r
- break;\r
- default:\r
- TS_FAIL("Unknown path code!");\r
- }\r
- a++;\r
- b++;\r
- }\r
- return a->code == b->code;\r
- }\r
-};\r
-\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+#include "libnr/n-art-bpath.h"
+#include "svg/svg.h"
+#include "2geom/coord.h"
+#include <string>
+#include <vector>
+#include <glib/gmem.h>
+
+class SvgPathTest : public CxxTest::TestSuite
+{
+private:
+ std::vector<std::string> rectanglesAbsoluteClosed;
+ std::vector<std::string> rectanglesRelativeClosed;
+ std::vector<std::string> rectanglesAbsoluteOpen;
+ std::vector<std::string> rectanglesRelativeOpen;
+ NArtBpath rectangleBpath[5+1];
+public:
+ SvgPathTest() {
+ // Lots of ways to define the same rectangle
+ rectanglesAbsoluteClosed.push_back("M 1,2 L 4,2 L 4,8 L 1,8 L 1,2 Z");
+ rectanglesAbsoluteClosed.push_back("M 1,2 L 4,2 L 4,8 L 1,8 z");
+ rectanglesAbsoluteClosed.push_back("M 1,2 4,2 4,8 1,8 z");
+ rectanglesAbsoluteClosed.push_back("M 1,2 H 4 V 8 H 1 z");
+ rectanglesRelativeClosed.push_back("m 1,2 l 3,0 l 0,6 l -3,0 z");
+ rectanglesRelativeClosed.push_back("m 1,2 3,0 0,6 -3,0 z");
+ rectanglesRelativeClosed.push_back("m 1,2 h 3 v 6 h -3 z");
+ rectanglesAbsoluteOpen.push_back("M 1,2 L 4,2 L 4,8 L 1,8 L 1,2");
+ rectanglesAbsoluteOpen.push_back("M 1,2 4,2 4,8 1,8 1,2");
+ rectanglesAbsoluteOpen.push_back("M 1,2 H 4 V 8 H 1 V 2");
+ rectanglesRelativeOpen.push_back("m 1,2 l 3,0 l 0,6 l -3,0 l 0,-6");
+ rectanglesRelativeOpen.push_back("m 1,2 3,0 0,6 -3,0 0,-6");
+ rectanglesRelativeOpen.push_back("m 1,2 h 3 v 6 h -3 v -6");
+ rectangleBpath[0].code = NR_MOVETO;
+ rectangleBpath[0].x3 = 1;
+ rectangleBpath[0].y3 = 2;
+ rectangleBpath[1].code = NR_LINETO;
+ rectangleBpath[1].x3 = 4;
+ rectangleBpath[1].y3 = 2;
+ rectangleBpath[2].code = NR_LINETO;
+ rectangleBpath[2].x3 = 4;
+ rectangleBpath[2].y3 = 8;
+ rectangleBpath[3].code = NR_LINETO;
+ rectangleBpath[3].x3 = 1;
+ rectangleBpath[3].y3 = 8;
+ rectangleBpath[4].code = NR_LINETO;
+ rectangleBpath[4].x3 = 1;
+ rectangleBpath[4].y3 = 2;
+ rectangleBpath[5].code = NR_END;
+ // TODO: Also test some (smooth) cubic/quadratic beziers and elliptical arcs
+ }
+
+ void testReadRectanglesAbsoluteClosed()
+ {
+ rectangleBpath[0].code = NR_MOVETO;
+ for(size_t i=0; i<rectanglesAbsoluteClosed.size(); i++) {
+ NArtBpath * bpath = sp_svg_read_path(rectanglesAbsoluteClosed[i].c_str());
+ TS_ASSERT(bpathEqual(bpath,rectangleBpath));
+ g_free(bpath);
+ }
+ }
+
+ void testReadRectanglesRelativeClosed()
+ {
+ rectangleBpath[0].code = NR_MOVETO;
+ for(size_t i=0; i<rectanglesRelativeClosed.size(); i++) {
+ NArtBpath * bpath = sp_svg_read_path(rectanglesRelativeClosed[i].c_str());
+ TS_ASSERT(bpathEqual(bpath,rectangleBpath));
+ g_free(bpath);
+ }
+ }
+
+ void testReadRectanglesAbsoluteOpen()
+ {
+ rectangleBpath[0].code = NR_MOVETO_OPEN;
+ for(size_t i=0; i<rectanglesAbsoluteOpen.size(); i++) {
+ NArtBpath * bpath = sp_svg_read_path(rectanglesAbsoluteOpen[i].c_str());
+ TS_ASSERT(bpathEqual(bpath,rectangleBpath));
+ g_free(bpath);
+ }
+ }
+
+ void testReadRectanglesRelativeOpen()
+ {
+ rectangleBpath[0].code = NR_MOVETO_OPEN;
+ for(size_t i=0; i<rectanglesRelativeOpen.size(); i++) {
+ NArtBpath * bpath = sp_svg_read_path(rectanglesRelativeOpen[i].c_str());
+ TS_ASSERT(bpathEqual(bpath,rectangleBpath));
+ g_free(bpath);
+ }
+ }
+
+ void testReadConcatenatedPaths()
+ {
+ NArtBpath bpath_good[4*5+1];
+ for(size_t i=0; i<4; i++) {
+ memcpy(bpath_good+i*5,rectangleBpath,sizeof(rectangleBpath[0])*5);
+ }
+ bpath_good[0*5].code = NR_MOVETO;
+ bpath_good[1*5].code = NR_MOVETO_OPEN;
+ bpath_good[2*5].code = NR_MOVETO;
+ bpath_good[3*5].code = NR_MOVETO_OPEN;
+ bpath_good[4*5].code = NR_END;
+ for(size_t i=0; i<5; i++) {
+ bpath_good[1*5+i].x3 += bpath_good[0*5+4].x3;
+ bpath_good[1*5+i].y3 += bpath_good[0*5+4].y3;
+ }
+ for(size_t i=0; i<5; i++) {
+ bpath_good[2*5+i].x3 += bpath_good[1*5+4].x3;
+ bpath_good[2*5+i].y3 += bpath_good[1*5+4].y3;
+ }
+ std::string path_str = rectanglesAbsoluteClosed[0] + rectanglesRelativeOpen[0] + rectanglesRelativeClosed[0] + rectanglesAbsoluteOpen[0];
+ NArtBpath * bpath = sp_svg_read_path(path_str.c_str());
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadZeroLengthSubpaths() {
+ // Per the SVG 1.1 specification (section F5) zero-length subpaths are relevant
+ NArtBpath bpath_good[8+1];
+ bpath_good[0].code = NR_MOVETO_OPEN;
+ bpath_good[0].x3 = bpath_good[0].y3 = 0;
+ bpath_good[1].code = NR_MOVETO_OPEN;
+ bpath_good[1].x3 = bpath_good[1].y3 = 1;
+ bpath_good[2].code = NR_LINETO;
+ bpath_good[2].x3 = bpath_good[2].y3 = 2;
+ bpath_good[3].code = NR_MOVETO;
+ bpath_good[3].x3 = bpath_good[3].y3 = 3;
+ bpath_good[4].code = NR_MOVETO;
+ bpath_good[4].x3 = bpath_good[4].y3 = 4;
+ bpath_good[5].code = NR_LINETO;
+ bpath_good[5].x3 = bpath_good[5].y3 = 5;
+ bpath_good[6].code = NR_LINETO;
+ bpath_good[6].x3 = bpath_good[6].y3 = 4;
+ bpath_good[7].code = NR_MOVETO_OPEN;
+ bpath_good[7].x3 = bpath_good[7].y3 = 6;
+ bpath_good[8].code = NR_END;
+ { // Test absolute version
+ char const * path_str = "M 0,0 M 1,1 L 2,2 M 3,3 z M 4,4 L 5,5 z M 6,6";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ { // Test relative version
+ char const * path_str = "m 0,0 m 1,1 l 1,1 m 1,1 z m 1,1 l 1,1 z m 2,2";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ }
+
+ void testReadImplicitMoveto() {
+ NArtBpath bpath_good[6+1];
+ bpath_good[0].code = NR_MOVETO;
+ bpath_good[0].x3 = bpath_good[0].y3 = 1;
+ bpath_good[1].code = NR_LINETO;
+ bpath_good[1].x3 = bpath_good[1].y3 = 2;
+ bpath_good[2].code = NR_LINETO;
+ bpath_good[2].x3 = bpath_good[2].y3 = 1;
+ bpath_good[3].code = NR_MOVETO;
+ bpath_good[3].x3 = bpath_good[3].y3 = 1;
+ bpath_good[4].code = NR_LINETO;
+ bpath_good[4].x3 = bpath_good[4].y3 = 3;
+ bpath_good[5].code = NR_LINETO;
+ bpath_good[5].x3 = bpath_good[5].y3 = 1;
+ bpath_good[6].code = NR_END;
+ { // Test absolute version
+ char const * path_str = "M 1,1 L 2,2 z L 3,3 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ { // Test relative version
+ char const * path_str = "M 1,1 L 2,2 z L 3,3 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ }
+
+ void testReadFloatingPoint() {
+ NArtBpath bpath_good[5+1];
+ bpath_good[0].code = NR_MOVETO;
+ bpath_good[0].x3 = .01;
+ bpath_good[0].y3 = .02;
+ bpath_good[1].code = NR_LINETO;
+ bpath_good[1].x3 = .04;
+ bpath_good[1].y3 = .02;
+ bpath_good[2].code = NR_LINETO;
+ bpath_good[2].x3 = 1.5;
+ bpath_good[2].y3 = 1.6;
+ bpath_good[3].code = NR_LINETO;
+ bpath_good[3].x3 = .01;
+ bpath_good[3].y3 = .08;
+ bpath_good[4].code = NR_LINETO;
+ bpath_good[4].x3 = .01;
+ bpath_good[4].y3 = .02;
+ bpath_good[5].code = NR_END;
+ { // Test decimals
+ char const * path_str = "M .01,.02 L.04.02 L1.5,1.6L0.01,0.08 .01.02 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ { // Test exponent
+ char const * path_str = "M 1e-2,.2e-1 L 0.004e1,0.0002e+2 L0150E-2,1.6e0L1.0e-2,80e-3 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ }
+
+ void testReadImplicitSeparation() {
+ // Coordinates need not be separated by whitespace if they can still be read unambiguously
+ NArtBpath bpath_good[5+1];
+ bpath_good[0].code = NR_MOVETO;
+ bpath_good[0].x3 = .1;
+ bpath_good[0].y3 = .2;
+ bpath_good[1].code = NR_LINETO;
+ bpath_good[1].x3 = .4;
+ bpath_good[1].y3 = .2;
+ bpath_good[2].code = NR_LINETO;
+ bpath_good[2].x3 = .4;
+ bpath_good[2].y3 = .8;
+ bpath_good[3].code = NR_LINETO;
+ bpath_good[3].x3 = .1;
+ bpath_good[3].y3 = .8;
+ bpath_good[4].code = NR_LINETO;
+ bpath_good[4].x3 = .1;
+ bpath_good[4].y3 = .2;
+ bpath_good[5].code = NR_END;
+ { // Test absolute
+ char const * path_str = "M .1.2+0.4.2e0.4e0+8e-1.1.8 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ { // Test relative
+ char const * path_str = "m .1.2+0.3.0e0.0e0+6e-1-.3.0 z";
+ NArtBpath * bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+ }
+
+ void testReadErrorMisplacedCharacter() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Comma in the wrong place (commas may only appear between parameters)
+ path_str = "M 1,2 4,2 4,8 1,8 z , m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Comma in the wrong place (commas may only appear between parameters)
+ path_str = "M 1,2 4,2 4,8 1,8 z m,13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Period in the wrong place (no numbers after a 'z')
+ path_str = "M 1,2 4,2 4,8 1,8 z . m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Sign in the wrong place (no numbers after a 'z')
+ path_str = "M 1,2 4,2 4,8 1,8 z + - m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Digit in the wrong place (no numbers after a 'z')
+ path_str = "M 1,2 4,2 4,8 1,8 z 9809 m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Digit in the wrong place (no numbers after a 'z')
+ path_str = "M 1,2 4,2 4,8 1,8 z 9809 876 m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadErrorUnrecognizedCharacter() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Unrecognized character
+ path_str = "M 1,2 4,2 4,8 1,8 z&m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Unrecognized character
+ path_str = "M 1,2 4,2 4,8 1,8 z m &13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadErrorTypo() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Typo
+ path_str = "M 1,2 4,2 4,8 1,8 z j 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+
+ bpath_good[0].code = NR_MOVETO_OPEN;
+ // Typo
+ path_str = "M 1,2 4,2 4,8 1,8 L 1,2 x m 13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadErrorIllformedNumbers() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Double exponent
+ path_str = "M 1,2 4,2 4,8 1,8 z m 13e4e5,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Double sign
+ path_str = "M 1,2 4,2 4,8 1,8 z m +-13,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Double sign
+ path_str = "M 1,2 4,2 4,8 1,8 z m 13e+-12,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // No digit
+ path_str = "M 1,2 4,2 4,8 1,8 z m .e12,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // No digit
+ path_str = "M 1,2 4,2 4,8 1,8 z m .,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // No digit
+ path_str = "M 1,2 4,2 4,8 1,8 z m +,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // No digit
+ path_str = "M 1,2 4,2 4,8 1,8 z m +.e+,15";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadErrorJunk() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Junk
+ path_str = "M 1,2 4,2 4,8 1,8 z j 357 hkjh.,34e34 90ih6kj4 h5k6vlh4N.,6,45wikuyi3yere..3487 m 13,23";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testReadErrorStopReading() {
+ char const * path_str;
+ NArtBpath * bpath;
+ NArtBpath * bpath_good = rectangleBpath;
+ bpath_good[0].code = NR_MOVETO;
+ // Unrecognized parameter
+ path_str = "M 1,2 4,2 4,8 1,8 z m #$%,23,34";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Invalid parameter
+ path_str = "M 1,2 4,2 4,8 1,8 z m #$%,23,34";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ // Illformed parameter
+ path_str = "M 1,2 4,2 4,8 1,8 z m +-12,23,34";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+
+ bpath_good[0].code = NR_MOVETO_OPEN;
+ // "Third" parameter
+ path_str = "M 1,2 4,2 4,8 1,8 1,2,3 M 12,23";
+ bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,bpath_good));
+ g_free(bpath);
+ }
+
+ void testRoundTrip() {
+ // This is the easiest way to (also) test writing path data, as a path can be written in more than one way.
+ NArtBpath * bpath;
+ NArtBpath * new_bpath;
+ char * path_str;
+ // Rectangle (closed)
+ bpath = sp_svg_read_path(rectanglesAbsoluteClosed[0].c_str());
+ path_str = sp_svg_write_path(bpath);
+ new_bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,new_bpath));
+ g_free(bpath); g_free(path_str); g_free(new_bpath);
+ // Rectangle (open)
+ bpath = sp_svg_read_path(rectanglesAbsoluteOpen[0].c_str());
+ path_str = sp_svg_write_path(bpath);
+ new_bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,new_bpath));
+ g_free(bpath); g_free(path_str); g_free(new_bpath);
+ // Concatenated rectangles
+ bpath = sp_svg_read_path((rectanglesAbsoluteClosed[0] + rectanglesRelativeOpen[0] + rectanglesRelativeClosed[0] + rectanglesAbsoluteOpen[0]).c_str());
+ path_str = sp_svg_write_path(bpath);
+ new_bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,new_bpath));
+ g_free(bpath); g_free(path_str); g_free(new_bpath);
+ // Zero-length subpaths
+ bpath = sp_svg_read_path("M 0,0 M 1,1 L 2,2 M 3,3 z M 4,4 L 5,5 z M 6,6");
+ path_str = sp_svg_write_path(bpath);
+ new_bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath,new_bpath));
+ g_free(bpath); g_free(path_str); g_free(new_bpath);
+ // Floating-point
+ bpath = sp_svg_read_path("M .01,.02 L 0.04,0.02 L.04,.08L0.01,0.08 z""M 1e-2,.2e-1 L 0.004e1,0.0002e+2 L04E-2,.08e0L1.0e-2,80e-3 z");
+ path_str = sp_svg_write_path(bpath);
+ new_bpath = sp_svg_read_path(path_str);
+ TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-17));
+ g_free(bpath); g_free(path_str); g_free(new_bpath);
+ }
+
+private:
+ bool bpathEqual(NArtBpath const * a, NArtBpath const * b, double eps = 1e-16) {
+ while(a->code != NR_END && b->code == a->code) {
+ switch(a->code) {
+ case NR_MOVETO:
+ case NR_MOVETO_OPEN:
+ case NR_LINETO:
+ if (!Geom::are_near(a->x3,b->x3, eps) || !Geom::are_near(a->y3,b->y3, eps)) return false;
+ break;
+ case NR_CURVETO:
+ if (!Geom::are_near(a->x1,b->x1, eps) || !Geom::are_near(a->y1,b->y1, eps)) return false;
+ if (!Geom::are_near(a->x2,b->x2, eps) || !Geom::are_near(a->y2,b->y2, eps)) return false;
+ if (!Geom::are_near(a->x3,b->x3, eps) || !Geom::are_near(a->y3,b->y3, eps)) return false;
+ break;
+ default:
+ TS_FAIL("Unknown path code!");
+ }
+ a++;
+ b++;
+ }
+ return a->code == b->code;
+ }
+};
+
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
index 9d8507f657cf58a32f46345fa2dbe62f8f496196..1c4fe511beac11f6dcb9be7e0434d80315c70d53 100644 (file)
-#include <cxxtest/TestSuite.h>\r
-\r
-#include <stdarg.h>\r
-#include "util/list-container.h"\r
-\r
-using Inkscape::Util::ListContainer;\r
-\r
-#define ARRAY_RANGE(array) (array), (array)+sizeof((array))/sizeof((array)[0])\r
-\r
-static bool check_values(ListContainer<int> const &c, unsigned n_values, ...) {\r
- bool ret = true;\r
- va_list args;\r
- va_start(args, n_values);\r
- ListContainer<int>::const_iterator iter(c.begin());\r
- while ( n_values && iter != c.end() ) {\r
- int const value = va_arg(args, int);\r
- if ( value != *iter ) {\r
- ret = false;\r
- }\r
- if ( n_values == 1 && &c.back() != &*iter ) {\r
- ret = false;\r
- }\r
- n_values--;\r
- ++iter;\r
- }\r
- va_end(args);\r
- return ret && n_values == 0 && iter == c.end();\r
-}\r
-\r
-class ListContainerTest : public CxxTest::TestSuite {\r
-public:\r
- ListContainerTest()\r
- {\r
- Inkscape::GC::init();\r
- }\r
- virtual ~ListContainerTest() {}\r
-\r
- void testRangeConstructor()\r
- {\r
- int const values[]={1,2,3,4};\r
- int const * const values_end=values+4;\r
- ListContainer<int> container(values, values_end);\r
-\r
- ListContainer<int>::iterator container_iter=container.begin();\r
- int const * values_iter=values;\r
-\r
- while ( values_iter != values_end && container_iter != container.end() ) {\r
- TS_ASSERT_EQUALS(*values_iter , *container_iter);\r
- ++values_iter;\r
- ++container_iter;\r
- }\r
-\r
- TS_ASSERT_EQUALS(values_iter , values_end);\r
- TS_ASSERT_EQUALS(container_iter , container.end());\r
- }\r
-\r
- void testEqualityTests()\r
- {\r
- int const a[] = { 1, 2, 3, 4 };\r
- int const b[] = { 1, 2, 3, 4 };\r
- int const c[] = { 1, 2, 3 };\r
- int const d[] = { 1, 2, 3, 5 };\r
- ListContainer<int> c_a(ARRAY_RANGE(a));\r
- ListContainer<int> c_b(ARRAY_RANGE(b));\r
- ListContainer<int> c_c(ARRAY_RANGE(c));\r
- ListContainer<int> c_d(ARRAY_RANGE(d));\r
-\r
- TS_ASSERT(c_a == c_b);\r
- TS_ASSERT(!( c_a != c_b ));\r
- TS_ASSERT(!( c_a == c_c ));\r
- TS_ASSERT(c_a != c_c);\r
- TS_ASSERT(!( c_a == c_d ));\r
- TS_ASSERT(c_a != c_d);\r
- }\r
-\r
- void testLessThan()\r
- {\r
- int const a[] = { 1, 2, 3, 4 };\r
- int const b[] = { 1, 2, 2, 4 };\r
- int const c[] = { 1, 2, 4, 4 };\r
- int const d[] = { 1, 2, 3 };\r
- ListContainer<int> c_a(ARRAY_RANGE(a));\r
- ListContainer<int> c_b(ARRAY_RANGE(b));\r
- ListContainer<int> c_c(ARRAY_RANGE(c));\r
- ListContainer<int> c_d(ARRAY_RANGE(d));\r
- TS_ASSERT(c_a >= c_b);\r
- TS_ASSERT(!( c_a < c_b ));\r
- TS_ASSERT(!( c_a >= c_c ));\r
- TS_ASSERT(c_a < c_c);\r
- TS_ASSERT(!( c_a < c_d ));\r
- TS_ASSERT(c_a >= c_d);\r
- TS_ASSERT(c_d < c_a);\r
- }\r
-\r
- void testAssignmentOperator()\r
- {\r
- int const a[] = { 1, 2, 3, 4 };\r
- ListContainer<int> c_a(ARRAY_RANGE(a));\r
- ListContainer<int> c_c;\r
- TS_ASSERT(c_a != c_c);\r
- c_c = c_a;\r
- TS_ASSERT(c_a == c_c);\r
- c_c = c_a;\r
- TS_ASSERT(c_a == c_c);\r
- } \r
-\r
- void testFillConstructor()\r
- {\r
- ListContainer<int> filled((std::size_t)3, 2);\r
- TS_ASSERT(check_values(filled, 3, 2, 2, 2));\r
- }\r
-\r
- void testContainerSize()\r
- {\r
- ListContainer<int> empty;\r
- TS_ASSERT(empty.empty());\r
- TS_ASSERT_EQUALS(empty.size() , 0);\r
- int const a[] = { 1, 2, 3 };\r
- ListContainer<int> c_a(ARRAY_RANGE(a));\r
- TS_ASSERT(!c_a.empty());\r
- TS_ASSERT_EQUALS(c_a.size() , 3);\r
-\r
- TS_ASSERT_LESS_THAN(0 , empty.max_size());\r
- }\r
-\r
- void testAppending()\r
- {\r
- ListContainer<int> c;\r
- c.push_back(1);\r
- TS_ASSERT(check_values(c, 1, 1));\r
- c.push_back(2);\r
- TS_ASSERT(check_values(c, 2, 1, 2));\r
- c.push_back(3);\r
- TS_ASSERT(check_values(c, 3, 1, 2, 3));\r
- }\r
-\r
- void testBulkAppending()\r
- {\r
- int const a[] = { 1, 2, 3, 4 };\r
- int const b[] = { 5, 6, 7 };\r
- ListContainer<int> c_a(ARRAY_RANGE(a));\r
- ListContainer<int> c_b(ARRAY_RANGE(b));\r
- c_a.insert(c_a.end(), c_b.begin(), c_b.end());\r
- TS_ASSERT(check_values(c_a, 7, 1, 2, 3, 4, 5, 6, 7));\r
- }\r
-\r
- void testPrepending()\r
- {\r
- ListContainer<int> c;\r
- c.push_front(1);\r
- TS_ASSERT(check_values(c, 1, 1));\r
- c.push_front(2);\r
- TS_ASSERT(check_values(c, 2, 2, 1));\r
- c.push_front(3);\r
- TS_ASSERT(check_values(c, 3, 3, 2, 1));\r
- }\r
-\r
- void testSingleValueInsertion()\r
- {\r
- ListContainer<int> c;\r
-\r
- c.insert(c.begin(), 1);\r
- TS_ASSERT(check_values(c, 1, 1));\r
-\r
- c.insert(c.end(), 2);\r
- TS_ASSERT(check_values(c, 2, 1, 2));\r
-\r
- c.insert(c.begin(), 3);\r
- TS_ASSERT(check_values(c, 3, 3, 1, 2));\r
-\r
- ListContainer<int>::iterator pos=c.begin();\r
- ++pos;\r
- c.insert(pos, 4);\r
- TS_ASSERT(check_values(c, 4, 3, 4, 1, 2));\r
- }\r
-\r
- void testSingleValueErasure()\r
- {\r
- int const values[] = { 1, 2, 3, 4 };\r
- ListContainer<int> c(ARRAY_RANGE(values));\r
-\r
- c.erase(c.begin());\r
- TS_ASSERT(check_values(c, 3, 2, 3, 4));\r
-\r
- ListContainer<int>::iterator pos=c.begin();\r
- ++pos;\r
- c.erase(pos);\r
- TS_ASSERT(check_values(c, 2, 2, 4));\r
-\r
- pos=c.begin();\r
- ++pos;\r
- c.erase(pos);\r
- TS_ASSERT(check_values(c, 1, 2));\r
-\r
- c.erase(c.begin());\r
- TS_ASSERT(check_values(c, 0));\r
- }\r
-\r
- void testPopFront()\r
- {\r
- int const full_ary[] = { 1, 2, 3 };\r
- ListContainer<int> t(ARRAY_RANGE(full_ary));\r
- TS_ASSERT(check_values(t, 3, 1, 2, 3));\r
- TS_ASSERT_EQUALS(t.back() , 3);\r
- t.pop_front();\r
- TS_ASSERT(check_values(t, 2, 2, 3));\r
- TS_ASSERT_EQUALS(t.back() , 3);\r
- t.push_back(23);\r
- TS_ASSERT(check_values(t, 3, 2, 3, 23));\r
- TS_ASSERT_EQUALS(t.back() , 23);\r
- t.pop_front();\r
- TS_ASSERT(check_values(t, 2, 3, 23));\r
- TS_ASSERT_EQUALS(t.back() , 23);\r
- t.pop_front();\r
- TS_ASSERT(check_values(t, 1, 23));\r
- TS_ASSERT_EQUALS(t.back() , 23);\r
- t.pop_front();\r
- TS_ASSERT(check_values(t, 0));\r
- t.push_back(42);\r
- TS_ASSERT(check_values(t, 1, 42));\r
- TS_ASSERT_EQUALS(t.back() , 42);\r
- }\r
-\r
- void testEraseAfter()\r
- {\r
- int const full_ary[] = { 1, 2, 3, 4 };\r
- int const exp_ary[] = { 1, 3, 4 };\r
- ListContainer<int> full_list(ARRAY_RANGE(full_ary));\r
- ListContainer<int> exp_list(ARRAY_RANGE(exp_ary));\r
- TS_ASSERT(full_list != exp_list);\r
- full_list.erase_after(full_list.begin());\r
- TS_ASSERT(full_list == exp_list);\r
- } \r
-};\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#include <cxxtest/TestSuite.h>
+
+#include <stdarg.h>
+#include "util/list-container.h"
+
+using Inkscape::Util::ListContainer;
+
+#define ARRAY_RANGE(array) (array), (array)+sizeof((array))/sizeof((array)[0])
+
+static bool check_values(ListContainer<int> const &c, unsigned n_values, ...) {
+ bool ret = true;
+ va_list args;
+ va_start(args, n_values);
+ ListContainer<int>::const_iterator iter(c.begin());
+ while ( n_values && iter != c.end() ) {
+ int const value = va_arg(args, int);
+ if ( value != *iter ) {
+ ret = false;
+ }
+ if ( n_values == 1 && &c.back() != &*iter ) {
+ ret = false;
+ }
+ n_values--;
+ ++iter;
+ }
+ va_end(args);
+ return ret && n_values == 0 && iter == c.end();
+}
+
+class ListContainerTest : public CxxTest::TestSuite {
+public:
+ ListContainerTest()
+ {
+ Inkscape::GC::init();
+ }
+ virtual ~ListContainerTest() {}
+
+ void testRangeConstructor()
+ {
+ int const values[]={1,2,3,4};
+ int const * const values_end=values+4;
+ ListContainer<int> container(values, values_end);
+
+ ListContainer<int>::iterator container_iter=container.begin();
+ int const * values_iter=values;
+
+ while ( values_iter != values_end && container_iter != container.end() ) {
+ TS_ASSERT_EQUALS(*values_iter , *container_iter);
+ ++values_iter;
+ ++container_iter;
+ }
+
+ TS_ASSERT_EQUALS(values_iter , values_end);
+ TS_ASSERT_EQUALS(container_iter , container.end());
+ }
+
+ void testEqualityTests()
+ {
+ int const a[] = { 1, 2, 3, 4 };
+ int const b[] = { 1, 2, 3, 4 };
+ int const c[] = { 1, 2, 3 };
+ int const d[] = { 1, 2, 3, 5 };
+ ListContainer<int> c_a(ARRAY_RANGE(a));
+ ListContainer<int> c_b(ARRAY_RANGE(b));
+ ListContainer<int> c_c(ARRAY_RANGE(c));
+ ListContainer<int> c_d(ARRAY_RANGE(d));
+
+ TS_ASSERT(c_a == c_b);
+ TS_ASSERT(!( c_a != c_b ));
+ TS_ASSERT(!( c_a == c_c ));
+ TS_ASSERT(c_a != c_c);
+ TS_ASSERT(!( c_a == c_d ));
+ TS_ASSERT(c_a != c_d);
+ }
+
+ void testLessThan()
+ {
+ int const a[] = { 1, 2, 3, 4 };
+ int const b[] = { 1, 2, 2, 4 };
+ int const c[] = { 1, 2, 4, 4 };
+ int const d[] = { 1, 2, 3 };
+ ListContainer<int> c_a(ARRAY_RANGE(a));
+ ListContainer<int> c_b(ARRAY_RANGE(b));
+ ListContainer<int> c_c(ARRAY_RANGE(c));
+ ListContainer<int> c_d(ARRAY_RANGE(d));
+ TS_ASSERT(c_a >= c_b);
+ TS_ASSERT(!( c_a < c_b ));
+ TS_ASSERT(!( c_a >= c_c ));
+ TS_ASSERT(c_a < c_c);
+ TS_ASSERT(!( c_a < c_d ));
+ TS_ASSERT(c_a >= c_d);
+ TS_ASSERT(c_d < c_a);
+ }
+
+ void testAssignmentOperator()
+ {
+ int const a[] = { 1, 2, 3, 4 };
+ ListContainer<int> c_a(ARRAY_RANGE(a));
+ ListContainer<int> c_c;
+ TS_ASSERT(c_a != c_c);
+ c_c = c_a;
+ TS_ASSERT(c_a == c_c);
+ c_c = c_a;
+ TS_ASSERT(c_a == c_c);
+ }
+
+ void testFillConstructor()
+ {
+ ListContainer<int> filled((std::size_t)3, 2);
+ TS_ASSERT(check_values(filled, 3, 2, 2, 2));
+ }
+
+ void testContainerSize()
+ {
+ ListContainer<int> empty;
+ TS_ASSERT(empty.empty());
+ TS_ASSERT_EQUALS(empty.size() , 0);
+ int const a[] = { 1, 2, 3 };
+ ListContainer<int> c_a(ARRAY_RANGE(a));
+ TS_ASSERT(!c_a.empty());
+ TS_ASSERT_EQUALS(c_a.size() , 3);
+
+ TS_ASSERT_LESS_THAN(0 , empty.max_size());
+ }
+
+ void testAppending()
+ {
+ ListContainer<int> c;
+ c.push_back(1);
+ TS_ASSERT(check_values(c, 1, 1));
+ c.push_back(2);
+ TS_ASSERT(check_values(c, 2, 1, 2));
+ c.push_back(3);
+ TS_ASSERT(check_values(c, 3, 1, 2, 3));
+ }
+
+ void testBulkAppending()
+ {
+ int const a[] = { 1, 2, 3, 4 };
+ int const b[] = { 5, 6, 7 };
+ ListContainer<int> c_a(ARRAY_RANGE(a));
+ ListContainer<int> c_b(ARRAY_RANGE(b));
+ c_a.insert(c_a.end(), c_b.begin(), c_b.end());
+ TS_ASSERT(check_values(c_a, 7, 1, 2, 3, 4, 5, 6, 7));
+ }
+
+ void testPrepending()
+ {
+ ListContainer<int> c;
+ c.push_front(1);
+ TS_ASSERT(check_values(c, 1, 1));
+ c.push_front(2);
+ TS_ASSERT(check_values(c, 2, 2, 1));
+ c.push_front(3);
+ TS_ASSERT(check_values(c, 3, 3, 2, 1));
+ }
+
+ void testSingleValueInsertion()
+ {
+ ListContainer<int> c;
+
+ c.insert(c.begin(), 1);
+ TS_ASSERT(check_values(c, 1, 1));
+
+ c.insert(c.end(), 2);
+ TS_ASSERT(check_values(c, 2, 1, 2));
+
+ c.insert(c.begin(), 3);
+ TS_ASSERT(check_values(c, 3, 3, 1, 2));
+
+ ListContainer<int>::iterator pos=c.begin();
+ ++pos;
+ c.insert(pos, 4);
+ TS_ASSERT(check_values(c, 4, 3, 4, 1, 2));
+ }
+
+ void testSingleValueErasure()
+ {
+ int const values[] = { 1, 2, 3, 4 };
+ ListContainer<int> c(ARRAY_RANGE(values));
+
+ c.erase(c.begin());
+ TS_ASSERT(check_values(c, 3, 2, 3, 4));
+
+ ListContainer<int>::iterator pos=c.begin();
+ ++pos;
+ c.erase(pos);
+ TS_ASSERT(check_values(c, 2, 2, 4));
+
+ pos=c.begin();
+ ++pos;
+ c.erase(pos);
+ TS_ASSERT(check_values(c, 1, 2));
+
+ c.erase(c.begin());
+ TS_ASSERT(check_values(c, 0));
+ }
+
+ void testPopFront()
+ {
+ int const full_ary[] = { 1, 2, 3 };
+ ListContainer<int> t(ARRAY_RANGE(full_ary));
+ TS_ASSERT(check_values(t, 3, 1, 2, 3));
+ TS_ASSERT_EQUALS(t.back() , 3);
+ t.pop_front();
+ TS_ASSERT(check_values(t, 2, 2, 3));
+ TS_ASSERT_EQUALS(t.back() , 3);
+ t.push_back(23);
+ TS_ASSERT(check_values(t, 3, 2, 3, 23));
+ TS_ASSERT_EQUALS(t.back() , 23);
+ t.pop_front();
+ TS_ASSERT(check_values(t, 2, 3, 23));
+ TS_ASSERT_EQUALS(t.back() , 23);
+ t.pop_front();
+ TS_ASSERT(check_values(t, 1, 23));
+ TS_ASSERT_EQUALS(t.back() , 23);
+ t.pop_front();
+ TS_ASSERT(check_values(t, 0));
+ t.push_back(42);
+ TS_ASSERT(check_values(t, 1, 42));
+ TS_ASSERT_EQUALS(t.back() , 42);
+ }
+
+ void testEraseAfter()
+ {
+ int const full_ary[] = { 1, 2, 3, 4 };
+ int const exp_ary[] = { 1, 3, 4 };
+ ListContainer<int> full_list(ARRAY_RANGE(full_ary));
+ ListContainer<int> exp_list(ARRAY_RANGE(exp_ary));
+ TS_ASSERT(full_list != exp_list);
+ full_list.erase_after(full_list.begin());
+ TS_ASSERT(full_list == exp_list);
+ }
+};
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :