Back to index

lightning-sunbird  0.9+nobinonly
nsSVGPathSeg.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is the Mozilla SVG project.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Crocodile Clips Ltd..
00019  * Portions created by the Initial Developer are Copyright (C) 2001
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsSVGPathSeg.h"
00040 #include "prdtoa.h"
00041 #include "nsSVGValue.h"
00042 #include "nsTextFormatter.h"
00043 #include "nsContentUtils.h"
00044 
00045 //----------------------------------------------------------------------
00046 // implementation helper macros
00047 
00048 #define NS_IMPL_NSIDOMSVGPATHSEG(cname, type, letter)                   \
00049 NS_IMETHODIMP                                                           \
00050 cname::GetPathSegType(PRUint16 *aPathSegType)                           \
00051 {                                                                       \
00052   *aPathSegType = type;                                                 \
00053   return NS_OK;                                                         \
00054 }                                                                       \
00055                                                                         \
00056 NS_IMETHODIMP                                                           \
00057 cname::GetPathSegTypeAsLetter(nsAString & aPathSegTypeAsLetter)         \
00058 {                                                                       \
00059   aPathSegTypeAsLetter.Truncate();                                      \
00060   aPathSegTypeAsLetter.AppendLiteral(letter);               \
00061   return NS_OK;                                                         \
00062 }
00063 
00064 #define NS_IMPL_NSISUPPORTS_SVGPATHSEG(basename)              \
00065 NS_IMPL_ADDREF(ns##basename)                                  \
00066 NS_IMPL_RELEASE(ns##basename)                                 \
00067                                                               \
00068 NS_INTERFACE_MAP_BEGIN(ns##basename)                          \
00069   NS_INTERFACE_MAP_ENTRY(nsISVGValue)                         \
00070   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPathSeg)                    \
00071   NS_INTERFACE_MAP_ENTRY(nsIDOM##basename)                    \
00072   NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(basename)          \
00073   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)  \
00074 NS_INTERFACE_MAP_END
00075 
00077 // nsSVGPathSegClosePath
00078 
00079 class nsSVGPathSegClosePath : public nsIDOMSVGPathSegClosePath,
00080                               public nsSVGValue
00081 {
00082 public:
00083   nsSVGPathSegClosePath();
00084 
00085   // nsISupports interface:
00086   NS_DECL_ISUPPORTS
00087 
00088   // nsIDOMSVGPathSeg interface:
00089   NS_DECL_NSIDOMSVGPATHSEG
00090 
00091   // nsIDOMSVGPathSegClosePath interface:
00092   NS_DECL_NSIDOMSVGPATHSEGCLOSEPATH
00093   
00094   // nsISVGValue interface:
00095   NS_IMETHOD SetValueString(const nsAString& aValue);
00096   NS_IMETHOD GetValueString(nsAString& aValue);
00097 };
00098 
00099 //----------------------------------------------------------------------
00100 // Implementation
00101 
00102 nsresult
00103 NS_NewSVGPathSegClosePath(nsIDOMSVGPathSegClosePath** result)
00104 {
00105   nsSVGPathSegClosePath *ps = new nsSVGPathSegClosePath();
00106   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00107   NS_ADDREF(ps);
00108   *result = ps;
00109   return NS_OK;
00110 }
00111 
00112 
00113 nsSVGPathSegClosePath::nsSVGPathSegClosePath()
00114 {
00115 }
00116 
00117 //----------------------------------------------------------------------
00118 // nsISupports methods:
00119 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegClosePath)
00120   
00121 //----------------------------------------------------------------------
00122 // nsISVGValue methods:
00123 NS_IMETHODIMP
00124 nsSVGPathSegClosePath::SetValueString(const nsAString& aValue)
00125 {
00126   NS_NOTYETIMPLEMENTED("nsSVGPathSegClosePath::SetValueString");
00127   return NS_ERROR_NOT_IMPLEMENTED;
00128 }
00129 
00130 NS_IMETHODIMP
00131 nsSVGPathSegClosePath::GetValueString(nsAString& aValue)
00132 {
00133   aValue.Truncate();
00134   aValue.AppendLiteral("z");
00135   
00136   return NS_OK;
00137 }
00138 
00139 //----------------------------------------------------------------------
00140 // nsIDOMSVGPathSeg methods:
00141 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegClosePath, PATHSEG_CLOSEPATH, "z")
00142 
00143 
00144 // nsSVGPathSegMovetoAbs
00145 
00146 class nsSVGPathSegMovetoAbs : public nsIDOMSVGPathSegMovetoAbs,
00147                               public nsSVGValue
00148 {
00149 public:
00150   nsSVGPathSegMovetoAbs(float x, float y);
00151 
00152   // nsISupports interface:
00153   NS_DECL_ISUPPORTS
00154 
00155   // nsIDOMSVGPathSegMovetoAbs interface:
00156   NS_DECL_NSIDOMSVGPATHSEGMOVETOABS
00157 
00158   // nsIDOMSVGPathSeg interface:
00159   NS_DECL_NSIDOMSVGPATHSEG
00160   
00161   // nsISVGValue interface:
00162   NS_IMETHOD SetValueString(const nsAString& aValue);
00163   NS_IMETHOD GetValueString(nsAString& aValue);
00164   
00165   
00166 protected:
00167   float mX, mY;
00168 };
00169 
00170 //----------------------------------------------------------------------
00171 // Implementation
00172 
00173 nsresult
00174 NS_NewSVGPathSegMovetoAbs(nsIDOMSVGPathSegMovetoAbs** result,
00175                           float x, float y)
00176 { 
00177   nsSVGPathSegMovetoAbs *ps = new nsSVGPathSegMovetoAbs(x, y);
00178   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00179   NS_ADDREF(ps);
00180   *result = ps;
00181   return NS_OK;
00182 }
00183 
00184 
00185 nsSVGPathSegMovetoAbs::nsSVGPathSegMovetoAbs(float x, float y)
00186     : mX(x), mY(y)
00187 {
00188 }
00189 
00190 //----------------------------------------------------------------------
00191 // nsISupports methods:
00192 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegMovetoAbs)
00193 
00194 //----------------------------------------------------------------------
00195 // nsISVGValue methods:
00196 NS_IMETHODIMP
00197 nsSVGPathSegMovetoAbs::SetValueString(const nsAString& aValue)
00198 {
00199   NS_NOTYETIMPLEMENTED("nsSVGPathSegMovetoAbs::SetValueString");
00200   return NS_ERROR_NOT_IMPLEMENTED;
00201 }
00202 
00203 NS_IMETHODIMP
00204 nsSVGPathSegMovetoAbs::GetValueString(nsAString& aValue)
00205 {
00206   aValue.Truncate();
00207 
00208   PRUnichar buf[48];
00209   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("M%g,%g").get(), mX, mY);
00210   aValue.Append(buf);
00211 
00212   return NS_OK;
00213 }
00214 
00215 //----------------------------------------------------------------------
00216 // nsIDOMSVGPathSeg methods:
00217 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegMovetoAbs, PATHSEG_MOVETO_ABS, "M")
00218 
00219 //----------------------------------------------------------------------
00220 // nsIDOMSVGPathSegMovetoAbs methods:
00221 
00222 /* attribute float x; */
00223 NS_IMETHODIMP nsSVGPathSegMovetoAbs::GetX(float *aX)
00224 {
00225   *aX = mX;
00226   return NS_OK;
00227 }
00228 NS_IMETHODIMP nsSVGPathSegMovetoAbs::SetX(float aX)
00229 {
00230   WillModify();
00231   mX = aX;
00232   DidModify();
00233   return NS_OK;
00234 }
00235 
00236 /* attribute float y; */
00237 NS_IMETHODIMP nsSVGPathSegMovetoAbs::GetY(float *aY)
00238 {
00239   *aY = mY;
00240   return NS_OK;
00241 }
00242 NS_IMETHODIMP nsSVGPathSegMovetoAbs::SetY(float aY)
00243 {
00244   WillModify();
00245   mY = aY;
00246   DidModify();
00247   return NS_OK;
00248 }
00249 
00250 
00252 // nsSVGPathSegMovetoRel
00253 
00254 class nsSVGPathSegMovetoRel : public nsIDOMSVGPathSegMovetoRel,
00255                               public nsSVGValue
00256 {
00257 public:
00258   nsSVGPathSegMovetoRel(float x, float y);
00259 
00260   // nsISupports interface:
00261   NS_DECL_ISUPPORTS
00262 
00263   // nsIDOMSVGPathSegMovetoRel interface:
00264   NS_DECL_NSIDOMSVGPATHSEGMOVETOREL
00265 
00266   // nsIDOMSVGPathSeg interface:
00267   NS_DECL_NSIDOMSVGPATHSEG
00268   
00269   // nsISVGValue interface:
00270   NS_IMETHOD SetValueString(const nsAString& aValue);
00271   NS_IMETHOD GetValueString(nsAString& aValue);
00272   
00273   
00274 protected:
00275   float mX, mY;
00276 };
00277 
00278 //----------------------------------------------------------------------
00279 // Implementation
00280 
00281 nsresult
00282 NS_NewSVGPathSegMovetoRel(nsIDOMSVGPathSegMovetoRel** result,
00283                           float x, float y)
00284 {
00285   nsSVGPathSegMovetoRel *ps = new nsSVGPathSegMovetoRel(x, y);
00286   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00287   NS_ADDREF(ps);
00288   *result = ps;
00289   return NS_OK;
00290 }
00291 
00292 
00293 nsSVGPathSegMovetoRel::nsSVGPathSegMovetoRel(float x, float y)
00294     : mX(x), mY(y)
00295 {
00296 }
00297 
00298 //----------------------------------------------------------------------
00299 // nsISupports methods:
00300 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegMovetoRel)
00301 
00302 //----------------------------------------------------------------------
00303 // nsISVGValue methods:
00304 NS_IMETHODIMP
00305 nsSVGPathSegMovetoRel::SetValueString(const nsAString& aValue)
00306 {
00307   NS_NOTYETIMPLEMENTED("nsSVGPathSegMovetoRel::SetValueString");
00308   return NS_ERROR_NOT_IMPLEMENTED;
00309 }
00310 
00311 NS_IMETHODIMP
00312 nsSVGPathSegMovetoRel::GetValueString(nsAString& aValue)
00313 {
00314   aValue.Truncate();
00315 
00316   PRUnichar buf[48];
00317   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("m%g,%g").get(), mX, mY);
00318   aValue.Append(buf);
00319 
00320   return NS_OK;
00321 }
00322 
00323 //----------------------------------------------------------------------
00324 // nsIDOMSVGPathSeg methods:
00325 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegMovetoRel, PATHSEG_MOVETO_REL, "m")
00326 
00327 //----------------------------------------------------------------------
00328 // nsIDOMSVGPathSegMovetoRel methods:
00329 
00330 /* attribute float x; */
00331 NS_IMETHODIMP nsSVGPathSegMovetoRel::GetX(float *aX)
00332 {
00333   *aX = mX;
00334   return NS_OK;
00335 }
00336 NS_IMETHODIMP nsSVGPathSegMovetoRel::SetX(float aX)
00337 {
00338   WillModify();
00339   mX = aX;
00340   DidModify();
00341   return NS_OK;
00342 }
00343 
00344 /* attribute float y; */
00345 NS_IMETHODIMP nsSVGPathSegMovetoRel::GetY(float *aY)
00346 {
00347   *aY = mY;
00348   return NS_OK;
00349 }
00350 NS_IMETHODIMP nsSVGPathSegMovetoRel::SetY(float aY)
00351 {
00352   WillModify();
00353   mY = aY;
00354   DidModify();
00355   return NS_OK;
00356 }  
00357 
00359 // nsSVGPathSegLinetoAbs
00360 
00361 class nsSVGPathSegLinetoAbs : public nsIDOMSVGPathSegLinetoAbs,
00362                               public nsSVGValue
00363 {
00364 public:
00365   nsSVGPathSegLinetoAbs(float x, float y);
00366 
00367   // nsISupports interface:
00368   NS_DECL_ISUPPORTS
00369 
00370   // nsIDOMSVGPathSegLinetoAbs interface:
00371   NS_DECL_NSIDOMSVGPATHSEGLINETOABS
00372 
00373   // nsIDOMSVGPathSeg interface:
00374   NS_DECL_NSIDOMSVGPATHSEG
00375   
00376   // nsISVGValue interface:
00377   NS_IMETHOD SetValueString(const nsAString& aValue);
00378   NS_IMETHOD GetValueString(nsAString& aValue);
00379   
00380   
00381 protected:
00382   float mX, mY;
00383 };
00384 
00385 //----------------------------------------------------------------------
00386 // Implementation
00387 
00388 nsresult
00389 NS_NewSVGPathSegLinetoAbs(nsIDOMSVGPathSegLinetoAbs** result,
00390                           float x, float y)
00391 {
00392   nsSVGPathSegLinetoAbs *ps = new nsSVGPathSegLinetoAbs(x, y);
00393   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00394   NS_ADDREF(ps);
00395   *result = ps;
00396   return NS_OK;
00397 }
00398 
00399 
00400 nsSVGPathSegLinetoAbs::nsSVGPathSegLinetoAbs(float x, float y)
00401     : mX(x), mY(y)
00402 {
00403 }
00404 
00405 //----------------------------------------------------------------------
00406 // nsISupports methods:
00407 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoAbs)
00408 
00409 //----------------------------------------------------------------------
00410 // nsISVGValue methods:
00411 NS_IMETHODIMP
00412 nsSVGPathSegLinetoAbs::SetValueString(const nsAString& aValue)
00413 {
00414   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoAbs::SetValueString");
00415   return NS_ERROR_NOT_IMPLEMENTED;
00416 }
00417 
00418 NS_IMETHODIMP
00419 nsSVGPathSegLinetoAbs::GetValueString(nsAString& aValue)
00420 {
00421   aValue.Truncate();
00422 
00423   PRUnichar buf[48];
00424   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("L%g,%g").get(), mX, mY);
00425   aValue.Append(buf);
00426 
00427   return NS_OK;
00428 }
00429 
00430 //----------------------------------------------------------------------
00431 // nsIDOMSVGPathSeg methods:
00432 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoAbs, PATHSEG_LINETO_ABS, "L")
00433 
00434 //----------------------------------------------------------------------
00435 // nsIDOMSVGPathSegLinetoAbs methods:
00436 
00437 /* attribute float x; */
00438 NS_IMETHODIMP nsSVGPathSegLinetoAbs::GetX(float *aX)
00439 {
00440   *aX = mX;
00441   return NS_OK;
00442 }
00443 NS_IMETHODIMP nsSVGPathSegLinetoAbs::SetX(float aX)
00444 {
00445   WillModify();
00446   mX = aX;
00447   DidModify();
00448   return NS_OK;
00449 }
00450 
00451 /* attribute float y; */
00452 NS_IMETHODIMP nsSVGPathSegLinetoAbs::GetY(float *aY)
00453 {
00454   *aY = mY;
00455   return NS_OK;
00456 }
00457 NS_IMETHODIMP nsSVGPathSegLinetoAbs::SetY(float aY)
00458 {
00459   WillModify();
00460   mY = aY;
00461   DidModify();
00462   return NS_OK;
00463 }
00464 
00465   
00467 // nsSVGPathSegLinetoRel
00468 
00469 class nsSVGPathSegLinetoRel : public nsIDOMSVGPathSegLinetoRel,
00470                               public nsSVGValue
00471 {
00472 public:
00473   nsSVGPathSegLinetoRel(float x, float y);
00474 
00475   // nsISupports interface:
00476   NS_DECL_ISUPPORTS
00477 
00478   // nsIDOMSVGPathSegLinetoRel interface:
00479   NS_DECL_NSIDOMSVGPATHSEGLINETOREL
00480 
00481   // nsIDOMSVGPathSeg interface:
00482   NS_DECL_NSIDOMSVGPATHSEG
00483   
00484   // nsISVGValue interface:
00485   NS_IMETHOD SetValueString(const nsAString& aValue);
00486   NS_IMETHOD GetValueString(nsAString& aValue);
00487   
00488   
00489 protected:
00490   float mX, mY;
00491 };
00492 
00493 //----------------------------------------------------------------------
00494 // Implementation
00495 
00496 nsresult
00497 NS_NewSVGPathSegLinetoRel(nsIDOMSVGPathSegLinetoRel** result,
00498                           float x, float y)
00499 {
00500   nsSVGPathSegLinetoRel *ps = new nsSVGPathSegLinetoRel(x, y);
00501   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00502   NS_ADDREF(ps);
00503   *result = ps;
00504   return NS_OK;
00505 }
00506 
00507 
00508 nsSVGPathSegLinetoRel::nsSVGPathSegLinetoRel(float x, float y)
00509     : mX(x), mY(y)
00510 {
00511 }
00512 
00513 //----------------------------------------------------------------------
00514 // nsISupports methods:
00515 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoRel)
00516 
00517 //----------------------------------------------------------------------
00518 // nsISVGValue methods:
00519 NS_IMETHODIMP
00520 nsSVGPathSegLinetoRel::SetValueString(const nsAString& aValue)
00521 {
00522   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoRel::SetValueString");
00523   return NS_ERROR_NOT_IMPLEMENTED;
00524 }
00525 
00526 NS_IMETHODIMP
00527 nsSVGPathSegLinetoRel::GetValueString(nsAString& aValue)
00528 {
00529   aValue.Truncate();
00530 
00531   PRUnichar buf[48];
00532   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("l%g,%g").get(), mX, mY);
00533   aValue.Append(buf);
00534 
00535   return NS_OK;
00536 }
00537 
00538 //----------------------------------------------------------------------
00539 // nsIDOMSVGPathSeg methods:
00540 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoRel, PATHSEG_LINETO_REL, "l")
00541 
00542 //----------------------------------------------------------------------
00543 // nsIDOMSVGPathSegLinetoRel methods:
00544 
00545 /* attribute float x; */
00546 NS_IMETHODIMP nsSVGPathSegLinetoRel::GetX(float *aX)
00547 {
00548   *aX = mX;
00549   return NS_OK;
00550 }
00551 NS_IMETHODIMP nsSVGPathSegLinetoRel::SetX(float aX)
00552 {
00553   WillModify();
00554   mX = aX;
00555   DidModify();
00556   return NS_OK;
00557 }
00558 
00559 /* attribute float y; */
00560 NS_IMETHODIMP nsSVGPathSegLinetoRel::GetY(float *aY)
00561 {
00562   *aY = mY;
00563   return NS_OK;
00564 }
00565 NS_IMETHODIMP nsSVGPathSegLinetoRel::SetY(float aY)
00566 {
00567   WillModify();
00568   mY = aY;
00569   DidModify();
00570   return NS_OK;
00571 }
00572 
00573   
00575 // nsSVGPathSegCurvetoCubicAbs
00576 
00577 class nsSVGPathSegCurvetoCubicAbs : public nsIDOMSVGPathSegCurvetoCubicAbs,
00578                                     public nsSVGValue
00579 {
00580 public:
00581   nsSVGPathSegCurvetoCubicAbs(float x, float y,
00582                               float x1, float y1,
00583                               float x2, float y2);
00584 
00585   // nsISupports interface:
00586   NS_DECL_ISUPPORTS
00587 
00588   // nsIDOMSVGPathSegCurvetoCubicAbs interface:
00589   NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICABS
00590 
00591   // nsIDOMSVGPathSeg interface:
00592   NS_DECL_NSIDOMSVGPATHSEG
00593   
00594   // nsISVGValue interface:
00595   NS_IMETHOD SetValueString(const nsAString& aValue);
00596   NS_IMETHOD GetValueString(nsAString& aValue);
00597   
00598   
00599 protected:
00600   float mX, mY, mX1, mY1, mX2, mY2;
00601 };
00602 
00603 //----------------------------------------------------------------------
00604 // Implementation
00605 
00606 nsresult
00607 NS_NewSVGPathSegCurvetoCubicAbs(nsIDOMSVGPathSegCurvetoCubicAbs** result,
00608                                 float x, float y,
00609                                 float x1, float y1,
00610                                 float x2, float y2)
00611 {
00612   nsSVGPathSegCurvetoCubicAbs *ps = new nsSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
00613   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00614   NS_ADDREF(ps);
00615   *result = ps;
00616   return NS_OK;
00617 }
00618 
00619 
00620 nsSVGPathSegCurvetoCubicAbs::nsSVGPathSegCurvetoCubicAbs(float x, float y,
00621                                                          float x1, float y1,
00622                                                          float x2, float y2)
00623     : mX(x), mY(y), mX1(x1), mY1(y1), mX2(x2), mY2(y2)
00624 {
00625 }
00626 
00627 //----------------------------------------------------------------------
00628 // nsISupports methods:
00629 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoCubicAbs)
00630 
00631 //----------------------------------------------------------------------
00632 // nsISVGValue methods:
00633 NS_IMETHODIMP
00634 nsSVGPathSegCurvetoCubicAbs::SetValueString(const nsAString& aValue)
00635 {
00636   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoCubicAbs::SetValueString");
00637   return NS_ERROR_NOT_IMPLEMENTED;
00638 }
00639 
00640 NS_IMETHODIMP
00641 nsSVGPathSegCurvetoCubicAbs::GetValueString(nsAString& aValue)
00642 {
00643   aValue.Truncate();
00644 
00645   PRUnichar buf[144];
00646   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("C%g,%g %g,%g %g,%g").get(), 
00647                             mX1, mY1, mX2, mY2, mX, mY);
00648   aValue.Append(buf);
00649 
00650   return NS_OK;
00651 }
00652 
00653 //----------------------------------------------------------------------
00654 // nsIDOMSVGPathSeg methods:
00655 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoCubicAbs, PATHSEG_CURVETO_CUBIC_ABS, "C")
00656 
00657 //----------------------------------------------------------------------
00658 // nsIDOMSVGPathSegCurvetoCubicAbs methods:
00659 
00660 /* attribute float x; */
00661 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetX(float *aX)
00662 {
00663   *aX = mX;
00664   return NS_OK;
00665 }
00666 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetX(float aX)
00667 {
00668   WillModify();
00669   mX = aX;
00670   DidModify();
00671   return NS_OK;
00672 }
00673 
00674 /* attribute float y; */
00675 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetY(float *aY)
00676 {
00677   *aY = mY;
00678   return NS_OK;
00679 }
00680 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetY(float aY)
00681 {
00682   WillModify();
00683   mY = aY;
00684   DidModify();
00685   return NS_OK;
00686 }
00687 
00688 /* attribute float x1; */
00689 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetX1(float *aX1)
00690 {
00691   *aX1 = mX1;
00692   return NS_OK;
00693 }
00694 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetX1(float aX1)
00695 {
00696   WillModify();
00697   mX1 = aX1;
00698   DidModify();
00699   return NS_OK;
00700 }
00701 
00702 /* attribute float y1; */
00703 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetY1(float *aY1)
00704 {
00705   *aY1 = mY1;
00706   return NS_OK;
00707 }
00708 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetY1(float aY1)
00709 {
00710   WillModify();
00711   mY1 = aY1;
00712   DidModify();
00713   return NS_OK;
00714 }
00715 
00716 /* attribute float x2; */
00717 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetX2(float *aX2)
00718 {
00719   *aX2 = mX2;
00720   return NS_OK;
00721 }
00722 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetX2(float aX2)
00723 {
00724   WillModify();
00725   mX2 = aX2;
00726   DidModify();
00727   return NS_OK;
00728 }
00729 
00730 /* attribute float y2; */
00731 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::GetY2(float *aY2)
00732 {
00733   *aY2 = mY2;
00734   return NS_OK;
00735 }
00736 NS_IMETHODIMP nsSVGPathSegCurvetoCubicAbs::SetY2(float aY2)
00737 {
00738   WillModify();
00739   mY2 = aY2;
00740   DidModify();
00741   return NS_OK;
00742 }
00743 
00744   
00746 // nsSVGPathSegCurvetoCubicRel
00747 
00748 class nsSVGPathSegCurvetoCubicRel : public nsIDOMSVGPathSegCurvetoCubicRel,
00749                                     public nsSVGValue
00750 {
00751 public:
00752   nsSVGPathSegCurvetoCubicRel(float x, float y,
00753                               float x1, float y1,
00754                               float x2, float y2);
00755 
00756   // nsISupports interface:
00757   NS_DECL_ISUPPORTS
00758 
00759   // nsIDOMSVGPathSegCurvetoCubicRel interface:
00760   NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICREL
00761 
00762   // nsIDOMSVGPathSeg interface:
00763   NS_DECL_NSIDOMSVGPATHSEG
00764   
00765   // nsISVGValue interface:
00766   NS_IMETHOD SetValueString(const nsAString& aValue);
00767   NS_IMETHOD GetValueString(nsAString& aValue);
00768   
00769   
00770 protected:
00771   float mX, mY, mX1, mY1, mX2, mY2;
00772 };
00773 
00774 //----------------------------------------------------------------------
00775 // Implementation
00776 
00777 nsresult
00778 NS_NewSVGPathSegCurvetoCubicRel(nsIDOMSVGPathSegCurvetoCubicRel** result,
00779                                 float x, float y,
00780                                 float x1, float y1,
00781                                 float x2, float y2)
00782 {
00783   nsSVGPathSegCurvetoCubicRel *ps = new nsSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
00784   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00785   NS_ADDREF(ps);
00786   *result = ps;
00787   return NS_OK;
00788 }
00789 
00790 
00791 nsSVGPathSegCurvetoCubicRel::nsSVGPathSegCurvetoCubicRel(float x, float y,
00792                                                          float x1, float y1,
00793                                                          float x2, float y2)
00794     : mX(x), mY(y), mX1(x1), mY1(y1), mX2(x2), mY2(y2)
00795 {
00796 }
00797 
00798 //----------------------------------------------------------------------
00799 // nsISupports methods:
00800 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoCubicRel)
00801 
00802 //----------------------------------------------------------------------
00803 // nsISVGValue methods:
00804 NS_IMETHODIMP
00805 nsSVGPathSegCurvetoCubicRel::SetValueString(const nsAString& aValue)
00806 {
00807   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoCubicRel::SetValueString");
00808   return NS_ERROR_NOT_IMPLEMENTED;
00809 }
00810 
00811 NS_IMETHODIMP
00812 nsSVGPathSegCurvetoCubicRel::GetValueString(nsAString& aValue)
00813 {
00814   aValue.Truncate();
00815 
00816   PRUnichar buf[144];
00817   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("c%g,%g %g,%g %g,%g").get(),
00818                             mX1, mY1, mX2, mY2, mX, mY);
00819   aValue.Append(buf);
00820 
00821   return NS_OK;
00822 }
00823 
00824 //----------------------------------------------------------------------
00825 // nsIDOMSVGPathSeg methods:
00826 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoCubicRel, PATHSEG_CURVETO_CUBIC_REL, "c")
00827 
00828 //----------------------------------------------------------------------
00829 // nsIDOMSVGPathSegCurvetoCubicRel methods:
00830 
00831 /* attribute float x; */
00832 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetX(float *aX)
00833 {
00834   *aX = mX;
00835   return NS_OK;
00836 }
00837 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetX(float aX)
00838 {
00839   WillModify();
00840   mX = aX;
00841   DidModify();
00842   return NS_OK;
00843 }
00844 
00845 /* attribute float y; */
00846 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetY(float *aY)
00847 {
00848   *aY = mY;
00849   return NS_OK;
00850 }
00851 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetY(float aY)
00852 {
00853   WillModify();
00854   mY = aY;
00855   DidModify();
00856   return NS_OK;
00857 }
00858 
00859 /* attribute float x1; */
00860 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetX1(float *aX1)
00861 {
00862   *aX1 = mX1;
00863   return NS_OK;
00864 }
00865 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetX1(float aX1)
00866 {
00867   WillModify();
00868   mX1 = aX1;
00869   DidModify();
00870   return NS_OK;
00871 }
00872 
00873 /* attribute float y1; */
00874 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetY1(float *aY1)
00875 {
00876   *aY1 = mY1;
00877   return NS_OK;
00878 }
00879 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetY1(float aY1)
00880 {
00881   WillModify();
00882   mY1 = aY1;
00883   DidModify();
00884   return NS_OK;
00885 }
00886 
00887 /* attribute float x2; */
00888 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetX2(float *aX2)
00889 {
00890   *aX2 = mX2;
00891   return NS_OK;
00892 }
00893 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetX2(float aX2)
00894 {
00895   WillModify();
00896   mX2 = aX2;
00897   DidModify();
00898   return NS_OK;
00899 }
00900 
00901 /* attribute float y2; */
00902 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::GetY2(float *aY2)
00903 {
00904   *aY2 = mY2;
00905   return NS_OK;
00906 }
00907 NS_IMETHODIMP nsSVGPathSegCurvetoCubicRel::SetY2(float aY2)
00908 {
00909   WillModify();
00910   mY2 = aY2;
00911   DidModify();
00912   return NS_OK;
00913 }
00914 
00916 // nsSVGPathSegCurvetoQuadraticAbs
00917 
00918 class nsSVGPathSegCurvetoQuadraticAbs : public nsIDOMSVGPathSegCurvetoQuadraticAbs,
00919                                         public nsSVGValue
00920 {
00921 public:
00922   nsSVGPathSegCurvetoQuadraticAbs(float x, float y,
00923                                   float x1, float y1);
00924 
00925   // nsISupports interface:
00926   NS_DECL_ISUPPORTS
00927 
00928   // nsIDOMSVGPathSegCurvetoQuadraticAbs interface:
00929   NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICABS
00930 
00931   // nsIDOMSVGPathSeg interface:
00932   NS_DECL_NSIDOMSVGPATHSEG
00933   
00934   // nsISVGValue interface:
00935   NS_IMETHOD SetValueString(const nsAString& aValue);
00936   NS_IMETHOD GetValueString(nsAString& aValue);
00937   
00938   
00939 protected:
00940   float mX, mY, mX1, mY1;
00941 };
00942 
00943 //----------------------------------------------------------------------
00944 // Implementation
00945 
00946 nsresult
00947 NS_NewSVGPathSegCurvetoQuadraticAbs(nsIDOMSVGPathSegCurvetoQuadraticAbs** result,
00948                                     float x, float y,
00949                                     float x1, float y1)
00950 {
00951   nsSVGPathSegCurvetoQuadraticAbs *ps = new nsSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
00952   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
00953   NS_ADDREF(ps);
00954   *result = ps;
00955   return NS_OK;
00956 }
00957 
00958 
00959 nsSVGPathSegCurvetoQuadraticAbs::nsSVGPathSegCurvetoQuadraticAbs(float x, float y,
00960                                                                  float x1, float y1)
00961     : mX(x), mY(y), mX1(x1), mY1(y1)
00962 {
00963 }
00964 
00965 //----------------------------------------------------------------------
00966 // nsISupports methods:
00967 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoQuadraticAbs)
00968 
00969 //----------------------------------------------------------------------
00970 // nsISVGValue methods:
00971 NS_IMETHODIMP
00972 nsSVGPathSegCurvetoQuadraticAbs::SetValueString(const nsAString& aValue)
00973 {
00974   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoQuadraticAbs::SetValueString");
00975   return NS_ERROR_NOT_IMPLEMENTED;
00976 }
00977 
00978 NS_IMETHODIMP
00979 nsSVGPathSegCurvetoQuadraticAbs::GetValueString(nsAString& aValue)
00980 {
00981   aValue.Truncate();
00982 
00983   PRUnichar buf[96];
00984   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("Q%g,%g %g,%g").get(),
00985                             mX1, mY1, mX, mY);
00986   aValue.Append(buf);
00987 
00988   return NS_OK;
00989 }
00990 
00991 //----------------------------------------------------------------------
00992 // nsIDOMSVGPathSeg methods:
00993 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoQuadraticAbs, PATHSEG_CURVETO_QUADRATIC_ABS, "Q")
00994 
00995 //----------------------------------------------------------------------
00996 // nsIDOMSVGPathSegCurvetoQuadraticAbs methods:
00997 
00998 /* attribute float x; */
00999 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::GetX(float *aX)
01000 {
01001   *aX = mX;
01002   return NS_OK;
01003 }
01004 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::SetX(float aX)
01005 {
01006   WillModify();
01007   mX = aX;
01008   DidModify();
01009   return NS_OK;
01010 }
01011 
01012 /* attribute float y; */
01013 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::GetY(float *aY)
01014 {
01015   *aY = mY;
01016   return NS_OK;
01017 }
01018 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::SetY(float aY)
01019 {
01020   WillModify();
01021   mY = aY;
01022   DidModify();
01023   return NS_OK;
01024 }
01025 
01026 /* attribute float x1; */
01027 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::GetX1(float *aX1)
01028 {
01029   *aX1 = mX1;
01030   return NS_OK;
01031 }
01032 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::SetX1(float aX1)
01033 {
01034   WillModify();
01035   mX1 = aX1;
01036   DidModify();
01037   return NS_OK;
01038 }
01039 
01040 /* attribute float y1; */
01041 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::GetY1(float *aY1)
01042 {
01043   *aY1 = mY1;
01044   return NS_OK;
01045 }
01046 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticAbs::SetY1(float aY1)
01047 {
01048   WillModify();
01049   mY1 = aY1;
01050   DidModify();
01051   return NS_OK;
01052 }
01053 
01054 
01056 // nsSVGPathSegCurvetoQuadraticRel
01057 
01058 class nsSVGPathSegCurvetoQuadraticRel : public nsIDOMSVGPathSegCurvetoQuadraticRel,
01059                                         public nsSVGValue
01060 {
01061 public:
01062   nsSVGPathSegCurvetoQuadraticRel(float x, float y,
01063                                   float x1, float y1);
01064 
01065   // nsISupports interface:
01066   NS_DECL_ISUPPORTS
01067 
01068   // nsIDOMSVGPathSegCurvetoQuadraticRel interface:
01069   NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICREL
01070 
01071   // nsIDOMSVGPathSeg interface:
01072   NS_DECL_NSIDOMSVGPATHSEG
01073   
01074   // nsISVGValue interface:
01075   NS_IMETHOD SetValueString(const nsAString& aValue);
01076   NS_IMETHOD GetValueString(nsAString& aValue);
01077   
01078   
01079 protected:
01080   float mX, mY, mX1, mY1;
01081 };
01082 
01083 //----------------------------------------------------------------------
01084 // Implementation
01085 
01086 nsresult
01087 NS_NewSVGPathSegCurvetoQuadraticRel(nsIDOMSVGPathSegCurvetoQuadraticRel** result,
01088                                     float x, float y,
01089                                     float x1, float y1)
01090 {
01091   nsSVGPathSegCurvetoQuadraticRel *ps = new nsSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
01092   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01093   NS_ADDREF(ps);
01094   *result = ps;
01095   return NS_OK;
01096 }
01097 
01098 
01099 nsSVGPathSegCurvetoQuadraticRel::nsSVGPathSegCurvetoQuadraticRel(float x, float y,
01100                                                                  float x1, float y1)
01101     : mX(x), mY(y), mX1(x1), mY1(y1)
01102 {
01103 }
01104 
01105 //----------------------------------------------------------------------
01106 // nsISupports methods:
01107 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoQuadraticRel)
01108 
01109 //----------------------------------------------------------------------
01110 // nsISVGValue methods:
01111 NS_IMETHODIMP
01112 nsSVGPathSegCurvetoQuadraticRel::SetValueString(const nsAString& aValue)
01113 {
01114   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoQuadraticRel::SetValueString");
01115   return NS_ERROR_NOT_IMPLEMENTED;
01116 }
01117 
01118 NS_IMETHODIMP
01119 nsSVGPathSegCurvetoQuadraticRel::GetValueString(nsAString& aValue)
01120 {
01121   aValue.Truncate();
01122 
01123   PRUnichar buf[96];
01124   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("q%g,%g %g,%g").get(), 
01125                             mX1, mY1, mX, mY);
01126   aValue.Append(buf);
01127 
01128   return NS_OK;
01129 }
01130 
01131 //----------------------------------------------------------------------
01132 // nsIDOMSVGPathSeg methods:
01133 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoQuadraticRel, PATHSEG_CURVETO_QUADRATIC_REL, "q")
01134 
01135 //----------------------------------------------------------------------
01136 // nsIDOMSVGPathSegCurvetoQuadraticRel methods:
01137 
01138 /* attribute float x; */
01139 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::GetX(float *aX)
01140 {
01141   *aX = mX;
01142   return NS_OK;
01143 }
01144 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::SetX(float aX)
01145 {
01146   WillModify();
01147   mX = aX;
01148   DidModify();
01149   return NS_OK;
01150 }
01151 
01152 /* attribute float y; */
01153 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::GetY(float *aY)
01154 {
01155   *aY = mY;
01156   return NS_OK;
01157 }
01158 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::SetY(float aY)
01159 {
01160   WillModify();
01161   mY = aY;
01162   DidModify();
01163   return NS_OK;
01164 }
01165 
01166 /* attribute float x1; */
01167 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::GetX1(float *aX1)
01168 {
01169   *aX1 = mX1;
01170   return NS_OK;
01171 }
01172 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::SetX1(float aX1)
01173 {
01174   WillModify();
01175   mX1 = aX1;
01176   DidModify();
01177   return NS_OK;
01178 }
01179 
01180 /* attribute float y1; */
01181 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::GetY1(float *aY1)
01182 {
01183   *aY1 = mY1;
01184   return NS_OK;
01185 }
01186 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticRel::SetY1(float aY1)
01187 {
01188   WillModify();
01189   mY1 = aY1;
01190   DidModify();
01191   return NS_OK;
01192 }
01193 
01194   
01196 // nsSVGPathSegArcAbs
01197 
01198 class nsSVGPathSegArcAbs : public nsIDOMSVGPathSegArcAbs,
01199                                         public nsSVGValue
01200 {
01201 public:
01202   nsSVGPathSegArcAbs(float x, float y,
01203                      float r1, float r2, float angle,
01204                      PRBool largeArcFlag, PRBool sweepFlag);
01205 
01206   // nsISupports interface:
01207   NS_DECL_ISUPPORTS
01208 
01209   // nsIDOMSVGPathSegArcAbs interface:
01210   NS_DECL_NSIDOMSVGPATHSEGARCABS
01211 
01212   // nsIDOMSVGPathSeg interface:
01213   NS_DECL_NSIDOMSVGPATHSEG
01214   
01215   // nsISVGValue interface:
01216   NS_IMETHOD SetValueString(const nsAString& aValue);
01217   NS_IMETHOD GetValueString(nsAString& aValue);
01218   
01219   
01220 protected:
01221   float  mX, mY, mR1, mR2, mAngle;
01222   PRBool mLargeArcFlag, mSweepFlag;
01223 };
01224 
01225 //----------------------------------------------------------------------
01226 // Implementation
01227 
01228 nsresult
01229 NS_NewSVGPathSegArcAbs(nsIDOMSVGPathSegArcAbs** result,
01230                        float x, float y,
01231                        float r1, float r2, float angle,
01232                        PRBool largeArcFlag, PRBool sweepFlag)
01233 {
01234   nsSVGPathSegArcAbs *ps = new nsSVGPathSegArcAbs(x, y, r1, r2, angle,
01235                                                   largeArcFlag, sweepFlag);
01236   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01237   NS_ADDREF(ps);
01238   *result = ps;
01239   return NS_OK;
01240 }
01241 
01242 
01243 nsSVGPathSegArcAbs::nsSVGPathSegArcAbs(float x, float y,
01244                                        float r1, float r2, float angle,
01245                                        PRBool largeArcFlag, PRBool sweepFlag)
01246     : mX(x), mY(y), mR1(r1), mR2(r2), mAngle(angle),
01247       mLargeArcFlag(largeArcFlag), mSweepFlag(sweepFlag)
01248 {
01249 }
01250 
01251 //----------------------------------------------------------------------
01252 // nsISupports methods:
01253 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegArcAbs)
01254 
01255 //----------------------------------------------------------------------
01256 // nsISVGValue methods:
01257 NS_IMETHODIMP
01258 nsSVGPathSegArcAbs::SetValueString(const nsAString& aValue)
01259 {
01260   NS_NOTYETIMPLEMENTED("nsSVGPathSegArcAbs::SetValueString");
01261   return NS_ERROR_NOT_IMPLEMENTED;
01262 }
01263 
01264 NS_IMETHODIMP
01265 nsSVGPathSegArcAbs::GetValueString(nsAString& aValue)
01266 {
01267   aValue.Truncate();
01268 
01269   PRUnichar buf[168];
01270   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("A%g,%g %g %d,%d %g,%g").get(), 
01271                             mR1, mR2, mAngle, mLargeArcFlag, mSweepFlag, mX, mY);
01272   aValue.Append(buf);
01273 
01274   return NS_OK;
01275 }
01276 
01277 //----------------------------------------------------------------------
01278 // nsIDOMSVGPathSeg methods:
01279 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegArcAbs, PATHSEG_ARC_ABS, "A")
01280 
01281 //----------------------------------------------------------------------
01282 // nsIDOMSVGPathSegArcAbs methods:
01283 
01284 /* attribute float x; */
01285 NS_IMETHODIMP nsSVGPathSegArcAbs::GetX(float *aX)
01286 {
01287   *aX = mX;
01288   return NS_OK;
01289 }
01290 NS_IMETHODIMP nsSVGPathSegArcAbs::SetX(float aX)
01291 {
01292   WillModify();
01293   mX = aX;
01294   DidModify();
01295   return NS_OK;
01296 }
01297 
01298 /* attribute float y; */
01299 NS_IMETHODIMP nsSVGPathSegArcAbs::GetY(float *aY)
01300 {
01301   *aY = mY;
01302   return NS_OK;
01303 }
01304 NS_IMETHODIMP nsSVGPathSegArcAbs::SetY(float aY)
01305 {
01306   WillModify();
01307   mY = aY;
01308   DidModify();
01309   return NS_OK;
01310 }
01311 
01312 /* attribute float r1; */
01313 NS_IMETHODIMP nsSVGPathSegArcAbs::GetR1(float *aR1)
01314 {
01315   *aR1 = mR1;
01316   return NS_OK;
01317 }
01318 NS_IMETHODIMP nsSVGPathSegArcAbs::SetR1(float aR1)
01319 {
01320   WillModify();
01321   mR1 = aR1;
01322   DidModify();
01323   return NS_OK;
01324 }
01325 
01326 /* attribute float r2; */
01327 NS_IMETHODIMP nsSVGPathSegArcAbs::GetR2(float *aR2)
01328 {
01329   *aR2 = mR2;
01330   return NS_OK;
01331 }
01332 NS_IMETHODIMP nsSVGPathSegArcAbs::SetR2(float aR2)
01333 {
01334   WillModify();
01335   mR2 = aR2;
01336   DidModify();
01337   return NS_OK;
01338 }
01339 
01340 
01341 /* attribute float angle; */
01342 NS_IMETHODIMP nsSVGPathSegArcAbs::GetAngle(float *aAngle)
01343 {
01344   *aAngle = mAngle;
01345   return NS_OK;
01346 }
01347 NS_IMETHODIMP nsSVGPathSegArcAbs::SetAngle(float aAngle)
01348 {
01349   WillModify();
01350   mAngle = aAngle;
01351   DidModify();
01352   return NS_OK;
01353 }
01354 
01355 /* attribute boolean largeArcFlag; */
01356 NS_IMETHODIMP nsSVGPathSegArcAbs::GetLargeArcFlag(PRBool *aLargeArcFlag)
01357 {
01358   *aLargeArcFlag = mLargeArcFlag;
01359   return NS_OK;
01360 }
01361 NS_IMETHODIMP nsSVGPathSegArcAbs::SetLargeArcFlag(PRBool aLargeArcFlag)
01362 {
01363   WillModify();
01364   mLargeArcFlag = aLargeArcFlag;
01365   DidModify();
01366   return NS_OK;
01367 }
01368 
01369 /* attribute boolean sweepFlag; */
01370 NS_IMETHODIMP nsSVGPathSegArcAbs::GetSweepFlag(PRBool *aSweepFlag)
01371 {
01372   *aSweepFlag = mSweepFlag;
01373   return NS_OK;
01374 }
01375 NS_IMETHODIMP nsSVGPathSegArcAbs::SetSweepFlag(PRBool aSweepFlag)
01376 {
01377   WillModify();
01378   mSweepFlag = aSweepFlag;
01379   DidModify();
01380   return NS_OK;  
01381 }
01382 
01383 
01385 // nsSVGPathSegArcRel
01386 
01387 class nsSVGPathSegArcRel : public nsIDOMSVGPathSegArcRel,
01388                                         public nsSVGValue
01389 {
01390 public:
01391   nsSVGPathSegArcRel(float x, float y,
01392                      float r1, float r2, float angle,
01393                      PRBool largeArcFlag, PRBool sweepFlag);
01394 
01395   // nsISupports interface:
01396   NS_DECL_ISUPPORTS
01397 
01398   // nsIDOMSVGPathSegArcRel interface:
01399   NS_DECL_NSIDOMSVGPATHSEGARCREL
01400 
01401   // nsIDOMSVGPathSeg interface:
01402   NS_DECL_NSIDOMSVGPATHSEG
01403   
01404   // nsISVGValue interface:
01405   NS_IMETHOD SetValueString(const nsAString& aValue);
01406   NS_IMETHOD GetValueString(nsAString& aValue);
01407   
01408   
01409 protected:
01410   float  mX, mY, mR1, mR2, mAngle;
01411   PRBool mLargeArcFlag, mSweepFlag;
01412 };
01413 
01414 //----------------------------------------------------------------------
01415 // Implementation
01416 
01417 nsresult
01418 NS_NewSVGPathSegArcRel(nsIDOMSVGPathSegArcRel** result,
01419                        float x, float y,
01420                        float r1, float r2, float angle,
01421                        PRBool largeArcFlag, PRBool sweepFlag)
01422 {
01423   nsSVGPathSegArcRel *ps = new nsSVGPathSegArcRel(x, y, r1, r2, angle,
01424                                                   largeArcFlag, sweepFlag);
01425   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01426   NS_ADDREF(ps);
01427   *result = ps;
01428   return NS_OK;
01429 }
01430 
01431 
01432 nsSVGPathSegArcRel::nsSVGPathSegArcRel(float x, float y,
01433                                        float r1, float r2, float angle,
01434                                        PRBool largeArcFlag, PRBool sweepFlag)
01435     : mX(x), mY(y), mR1(r1), mR2(r2), mAngle(angle),
01436       mLargeArcFlag(largeArcFlag), mSweepFlag(sweepFlag)
01437 {
01438 }
01439 
01440 //----------------------------------------------------------------------
01441 // nsISupports methods:
01442 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegArcRel)
01443 
01444 //----------------------------------------------------------------------
01445 // nsISVGValue methods:
01446 NS_IMETHODIMP
01447 nsSVGPathSegArcRel::SetValueString(const nsAString& aValue)
01448 {
01449   NS_NOTYETIMPLEMENTED("nsSVGPathSegArcRel::SetValueString");
01450   return NS_ERROR_NOT_IMPLEMENTED;
01451 }
01452 
01453 NS_IMETHODIMP
01454 nsSVGPathSegArcRel::GetValueString(nsAString& aValue)
01455 {
01456   aValue.Truncate();
01457 
01458   PRUnichar buf[168];
01459   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("a%g,%g %g %d,%d %g,%g").get(), 
01460                             mR1, mR2, mAngle, mLargeArcFlag, mSweepFlag, mX, mY);
01461   aValue.Append(buf);
01462 
01463   return NS_OK;
01464 }
01465 
01466 //----------------------------------------------------------------------
01467 // nsIDOMSVGPathSeg methods:
01468 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegArcRel, PATHSEG_ARC_REL, "a")
01469 
01470 //----------------------------------------------------------------------
01471 // nsIDOMSVGPathSegArcRel methods:
01472 
01473 /* attribute float x; */
01474 NS_IMETHODIMP nsSVGPathSegArcRel::GetX(float *aX)
01475 {
01476   *aX = mX;
01477   return NS_OK;
01478 }
01479 NS_IMETHODIMP nsSVGPathSegArcRel::SetX(float aX)
01480 {
01481   WillModify();
01482   mX = aX;
01483   DidModify();
01484   return NS_OK;
01485 }
01486 
01487 /* attribute float y; */
01488 NS_IMETHODIMP nsSVGPathSegArcRel::GetY(float *aY)
01489 {
01490   *aY = mY;
01491   return NS_OK;
01492 }
01493 NS_IMETHODIMP nsSVGPathSegArcRel::SetY(float aY)
01494 {
01495   WillModify();
01496   mY = aY;
01497   DidModify();
01498   return NS_OK;
01499 }
01500 
01501 /* attribute float r1; */
01502 NS_IMETHODIMP nsSVGPathSegArcRel::GetR1(float *aR1)
01503 {
01504   *aR1 = mR1;
01505   return NS_OK;
01506 }
01507 NS_IMETHODIMP nsSVGPathSegArcRel::SetR1(float aR1)
01508 {
01509   WillModify();
01510   mR1 = aR1;
01511   DidModify();
01512   return NS_OK;
01513 }
01514 
01515 /* attribute float r2; */
01516 NS_IMETHODIMP nsSVGPathSegArcRel::GetR2(float *aR2)
01517 {
01518   *aR2 = mR2;
01519   return NS_OK;
01520 }
01521 NS_IMETHODIMP nsSVGPathSegArcRel::SetR2(float aR2)
01522 {
01523   WillModify();
01524   mR2 = aR2;
01525   DidModify();
01526   return NS_OK;
01527 }
01528 
01529 
01530 /* attribute float angle; */
01531 NS_IMETHODIMP nsSVGPathSegArcRel::GetAngle(float *aAngle)
01532 {
01533   *aAngle = mAngle;
01534   return NS_OK;
01535 }
01536 NS_IMETHODIMP nsSVGPathSegArcRel::SetAngle(float aAngle)
01537 {
01538   WillModify();
01539   mAngle = aAngle;
01540   DidModify();
01541   return NS_OK;
01542 }
01543 
01544 /* attribute boolean largeArcFlag; */
01545 NS_IMETHODIMP nsSVGPathSegArcRel::GetLargeArcFlag(PRBool *aLargeArcFlag)
01546 {
01547   *aLargeArcFlag = mLargeArcFlag;
01548   return NS_OK;
01549 }
01550 NS_IMETHODIMP nsSVGPathSegArcRel::SetLargeArcFlag(PRBool aLargeArcFlag)
01551 {
01552   WillModify();
01553   mLargeArcFlag = aLargeArcFlag;
01554   DidModify();
01555   return NS_OK;
01556 }
01557 
01558 /* attribute boolean sweepFlag; */
01559 NS_IMETHODIMP nsSVGPathSegArcRel::GetSweepFlag(PRBool *aSweepFlag)
01560 {
01561   *aSweepFlag = mSweepFlag;
01562   return NS_OK;
01563 }
01564 NS_IMETHODIMP nsSVGPathSegArcRel::SetSweepFlag(PRBool aSweepFlag)
01565 {
01566   WillModify();
01567   mSweepFlag = aSweepFlag;
01568   DidModify();
01569   return NS_OK;  
01570 }
01571 
01573 // nsSVGPathSegLinetoHorizontalAbs
01574 
01575 class nsSVGPathSegLinetoHorizontalAbs : public nsIDOMSVGPathSegLinetoHorizontalAbs,
01576                               public nsSVGValue
01577 {
01578 public:
01579   nsSVGPathSegLinetoHorizontalAbs(float x);
01580 
01581   // nsISupports interface:
01582   NS_DECL_ISUPPORTS
01583 
01584   // nsIDOMSVGPathSegLinetoHorizontalAbs interface:
01585   NS_DECL_NSIDOMSVGPATHSEGLINETOHORIZONTALABS
01586 
01587   // nsIDOMSVGPathSeg interface:
01588   NS_DECL_NSIDOMSVGPATHSEG
01589   
01590   // nsISVGValue interface:
01591   NS_IMETHOD SetValueString(const nsAString& aValue);
01592   NS_IMETHOD GetValueString(nsAString& aValue);
01593   
01594   
01595 protected:
01596   float mX;
01597 };
01598 
01599 //----------------------------------------------------------------------
01600 // Implementation
01601 
01602 nsresult
01603 NS_NewSVGPathSegLinetoHorizontalAbs(nsIDOMSVGPathSegLinetoHorizontalAbs** result, float x)
01604 {
01605   nsSVGPathSegLinetoHorizontalAbs *ps = new nsSVGPathSegLinetoHorizontalAbs(x);
01606   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01607   NS_ADDREF(ps);
01608   *result = ps;
01609   return NS_OK;
01610 }
01611 
01612 
01613 nsSVGPathSegLinetoHorizontalAbs::nsSVGPathSegLinetoHorizontalAbs(float x)
01614     : mX(x)
01615 {
01616 }
01617 
01618 //----------------------------------------------------------------------
01619 // nsISupports methods:
01620 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoHorizontalAbs)
01621 
01622 //----------------------------------------------------------------------
01623 // nsISVGValue methods:
01624 NS_IMETHODIMP
01625 nsSVGPathSegLinetoHorizontalAbs::SetValueString(const nsAString& aValue)
01626 {
01627   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoHorizontalAbs::SetValueString");
01628   return NS_ERROR_NOT_IMPLEMENTED;
01629 }
01630 
01631 NS_IMETHODIMP
01632 nsSVGPathSegLinetoHorizontalAbs::GetValueString(nsAString& aValue)
01633 {
01634   aValue.Truncate();
01635 
01636   PRUnichar buf[24];
01637   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("H%g").get(), mX);
01638   aValue.Append(buf);
01639 
01640   return NS_OK;
01641 }
01642 
01643 //----------------------------------------------------------------------
01644 // nsIDOMSVGPathSeg methods:
01645 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoHorizontalAbs, PATHSEG_LINETO_HORIZONTAL_ABS, "H")
01646 
01647 //----------------------------------------------------------------------
01648 // nsIDOMSVGPathSegLinetoHorizontalAbs methods:
01649 
01650 /* attribute float x; */
01651 NS_IMETHODIMP nsSVGPathSegLinetoHorizontalAbs::GetX(float *aX)
01652 {
01653   *aX = mX;
01654   return NS_OK;
01655 }
01656 NS_IMETHODIMP nsSVGPathSegLinetoHorizontalAbs::SetX(float aX)
01657 {
01658   WillModify();
01659   mX = aX;
01660   DidModify();
01661   return NS_OK;
01662 }
01663 
01665 // nsSVGPathSegLinetoHorizontalRel
01666 
01667 class nsSVGPathSegLinetoHorizontalRel : public nsIDOMSVGPathSegLinetoHorizontalRel,
01668                               public nsSVGValue
01669 {
01670 public:
01671   nsSVGPathSegLinetoHorizontalRel(float x);
01672 
01673   // nsISupports interface:
01674   NS_DECL_ISUPPORTS
01675 
01676   // nsIDOMSVGPathSegLinetoHorizontalRel interface:
01677   NS_DECL_NSIDOMSVGPATHSEGLINETOHORIZONTALREL
01678 
01679   // nsIDOMSVGPathSeg interface:
01680   NS_DECL_NSIDOMSVGPATHSEG
01681   
01682   // nsISVGValue interface:
01683   NS_IMETHOD SetValueString(const nsAString& aValue);
01684   NS_IMETHOD GetValueString(nsAString& aValue);
01685   
01686   
01687 protected:
01688   float mX;
01689 };
01690 
01691 //----------------------------------------------------------------------
01692 // Implementation
01693 
01694 nsresult
01695 NS_NewSVGPathSegLinetoHorizontalRel(nsIDOMSVGPathSegLinetoHorizontalRel** result, float x)
01696 {
01697   nsSVGPathSegLinetoHorizontalRel *ps = new nsSVGPathSegLinetoHorizontalRel(x);
01698   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01699   NS_ADDREF(ps);
01700   *result = ps;
01701   return NS_OK;
01702 }
01703 
01704 
01705 nsSVGPathSegLinetoHorizontalRel::nsSVGPathSegLinetoHorizontalRel(float x)
01706     : mX(x)
01707 {
01708 }
01709 
01710 //----------------------------------------------------------------------
01711 // nsISupports methods:
01712 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoHorizontalRel)
01713 
01714 //----------------------------------------------------------------------
01715 // nsISVGValue methods:
01716 NS_IMETHODIMP
01717 nsSVGPathSegLinetoHorizontalRel::SetValueString(const nsAString& aValue)
01718 {
01719   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoHorizontalRel::SetValueString");
01720   return NS_ERROR_NOT_IMPLEMENTED;
01721 }
01722 
01723 NS_IMETHODIMP
01724 nsSVGPathSegLinetoHorizontalRel::GetValueString(nsAString& aValue)
01725 {
01726   aValue.Truncate();
01727 
01728   PRUnichar buf[24];
01729   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("h%g").get(), mX);
01730   aValue.Append(buf);
01731 
01732   return NS_OK;
01733 }
01734 
01735 //----------------------------------------------------------------------
01736 // nsIDOMSVGPathSeg methods:
01737 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoHorizontalRel, PATHSEG_LINETO_HORIZONTAL_REL, "h")
01738 
01739 //----------------------------------------------------------------------
01740 // nsIDOMSVGPathSegLinetoHorizontalRel methods:
01741 
01742 /* attribute float x; */
01743 NS_IMETHODIMP nsSVGPathSegLinetoHorizontalRel::GetX(float *aX)
01744 {
01745   *aX = mX;
01746   return NS_OK;
01747 }
01748 NS_IMETHODIMP nsSVGPathSegLinetoHorizontalRel::SetX(float aX)
01749 {
01750   WillModify();
01751   mX = aX;
01752   DidModify();
01753   return NS_OK;
01754 }
01755 
01757 // nsSVGPathSegLinetoVerticalAbs
01758 
01759 class nsSVGPathSegLinetoVerticalAbs : public nsIDOMSVGPathSegLinetoVerticalAbs,
01760                               public nsSVGValue
01761 {
01762 public:
01763   nsSVGPathSegLinetoVerticalAbs(float y);
01764 
01765   // nsISupports interface:
01766   NS_DECL_ISUPPORTS
01767 
01768   // nsIDOMSVGPathSegLinetoVerticalAbs interface:
01769   NS_DECL_NSIDOMSVGPATHSEGLINETOVERTICALABS
01770 
01771   // nsIDOMSVGPathSeg interface:
01772   NS_DECL_NSIDOMSVGPATHSEG
01773   
01774   // nsISVGValue interface:
01775   NS_IMETHOD SetValueString(const nsAString& aValue);
01776   NS_IMETHOD GetValueString(nsAString& aValue);
01777   
01778   
01779 protected:
01780   float mY;
01781 };
01782 
01783 //----------------------------------------------------------------------
01784 // Implementation
01785 
01786 nsresult
01787 NS_NewSVGPathSegLinetoVerticalAbs(nsIDOMSVGPathSegLinetoVerticalAbs** result, float y)
01788 {
01789   nsSVGPathSegLinetoVerticalAbs *ps = new nsSVGPathSegLinetoVerticalAbs(y);
01790   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01791   NS_ADDREF(ps);
01792   *result = ps;
01793   return NS_OK;
01794 }
01795 
01796 
01797 nsSVGPathSegLinetoVerticalAbs::nsSVGPathSegLinetoVerticalAbs(float y)
01798     : mY(y)
01799 {
01800 }
01801 
01802 //----------------------------------------------------------------------
01803 // nsISupports methods:
01804 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoVerticalAbs)
01805 
01806 //----------------------------------------------------------------------
01807 // nsISVGValue methods:
01808 NS_IMETHODIMP
01809 nsSVGPathSegLinetoVerticalAbs::SetValueString(const nsAString& aValue)
01810 {
01811   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoVerticalAbs::SetValueString");
01812   return NS_ERROR_NOT_IMPLEMENTED;
01813 }
01814 
01815 NS_IMETHODIMP
01816 nsSVGPathSegLinetoVerticalAbs::GetValueString(nsAString& aValue)
01817 {
01818   aValue.Truncate();
01819 
01820   PRUnichar buf[24];
01821   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("V%g").get(), mY);
01822   aValue.Append(buf);
01823 
01824   return NS_OK;
01825 }
01826 
01827 //----------------------------------------------------------------------
01828 // nsIDOMSVGPathSeg methods:
01829 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoVerticalAbs, PATHSEG_LINETO_VERTICAL_ABS, "V")
01830 
01831 //----------------------------------------------------------------------
01832 // nsIDOMSVGPathSegLinetoVerticalAbs methods:
01833 
01834 /* attribute float y; */
01835 NS_IMETHODIMP nsSVGPathSegLinetoVerticalAbs::GetY(float *aY)
01836 {
01837   *aY = mY;
01838   return NS_OK;
01839 }
01840 NS_IMETHODIMP nsSVGPathSegLinetoVerticalAbs::SetY(float aY)
01841 {
01842   WillModify();
01843   mY = aY;
01844   DidModify();
01845   return NS_OK;
01846 }
01847 
01849 // nsSVGPathSegLinetoVerticalRel
01850 
01851 class nsSVGPathSegLinetoVerticalRel : public nsIDOMSVGPathSegLinetoVerticalRel,
01852                               public nsSVGValue
01853 {
01854 public:
01855   nsSVGPathSegLinetoVerticalRel(float y);
01856 
01857   // nsISupports interface:
01858   NS_DECL_ISUPPORTS
01859 
01860   // nsIDOMSVGPathSegLinetoVerticalRel interface:
01861   NS_DECL_NSIDOMSVGPATHSEGLINETOVERTICALREL
01862 
01863   // nsIDOMSVGPathSeg interface:
01864   NS_DECL_NSIDOMSVGPATHSEG
01865   
01866   // nsISVGValue interface:
01867   NS_IMETHOD SetValueString(const nsAString& aValue);
01868   NS_IMETHOD GetValueString(nsAString& aValue);
01869   
01870   
01871 protected:
01872   float mY;
01873 };
01874 
01875 //----------------------------------------------------------------------
01876 // Implementation
01877 
01878 nsresult
01879 NS_NewSVGPathSegLinetoVerticalRel(nsIDOMSVGPathSegLinetoVerticalRel** result, float y)
01880 {
01881   nsSVGPathSegLinetoVerticalRel *ps = new nsSVGPathSegLinetoVerticalRel(y);
01882   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01883   NS_ADDREF(ps);
01884   *result = ps;
01885   return NS_OK;
01886 }
01887 
01888 
01889 nsSVGPathSegLinetoVerticalRel::nsSVGPathSegLinetoVerticalRel(float y)
01890     : mY(y)
01891 {
01892 }
01893 
01894 //----------------------------------------------------------------------
01895 // nsISupports methods:
01896 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegLinetoVerticalRel)
01897 
01898 //----------------------------------------------------------------------
01899 // nsISVGValue methods:
01900 NS_IMETHODIMP
01901 nsSVGPathSegLinetoVerticalRel::SetValueString(const nsAString& aValue)
01902 {
01903   NS_NOTYETIMPLEMENTED("nsSVGPathSegLinetoVerticalRel::SetValueString");
01904   return NS_ERROR_NOT_IMPLEMENTED;
01905 }
01906 
01907 NS_IMETHODIMP
01908 nsSVGPathSegLinetoVerticalRel::GetValueString(nsAString& aValue)
01909 {
01910   aValue.Truncate();
01911 
01912   PRUnichar buf[24];
01913   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("v%g").get(), mY);
01914   aValue.Append(buf);
01915 
01916   return NS_OK;
01917 }
01918 
01919 //----------------------------------------------------------------------
01920 // nsIDOMSVGPathSeg methods:
01921 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegLinetoVerticalRel, PATHSEG_LINETO_VERTICAL_REL, "v")
01922 
01923 //----------------------------------------------------------------------
01924 // nsIDOMSVGPathSegLinetoVerticalRel methods:
01925 
01926 /* attribute float y; */
01927 NS_IMETHODIMP nsSVGPathSegLinetoVerticalRel::GetY(float *aY)
01928 {
01929   *aY = mY;
01930   return NS_OK;
01931 }
01932 NS_IMETHODIMP nsSVGPathSegLinetoVerticalRel::SetY(float aY)
01933 {
01934   WillModify();
01935   mY = aY;
01936   DidModify();
01937   return NS_OK;
01938 }
01939 
01941 // nsSVGPathSegCurvetoCubicSmoothAbs
01942 
01943 class nsSVGPathSegCurvetoCubicSmoothAbs : public nsIDOMSVGPathSegCurvetoCubicSmoothAbs,
01944                                           public nsSVGValue
01945 {
01946 public:
01947   nsSVGPathSegCurvetoCubicSmoothAbs(float x, float y,
01948                                     float x2, float y2);
01949 
01950   // nsISupports interface:
01951   NS_DECL_ISUPPORTS
01952 
01953   // nsIDOMSVGPathSegCurvetoCubicSmoothAbs interface:
01954   NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICSMOOTHABS
01955 
01956   // nsIDOMSVGPathSeg interface:
01957   NS_DECL_NSIDOMSVGPATHSEG
01958   
01959   // nsISVGValue interface:
01960   NS_IMETHOD SetValueString(const nsAString& aValue);
01961   NS_IMETHOD GetValueString(nsAString& aValue);
01962   
01963   
01964 protected:
01965   float mX, mY, mX2, mY2;
01966 };
01967 
01968 //----------------------------------------------------------------------
01969 // Implementation
01970 
01971 nsresult
01972 NS_NewSVGPathSegCurvetoCubicSmoothAbs(nsIDOMSVGPathSegCurvetoCubicSmoothAbs** result,
01973                                       float x, float y,
01974                                       float x2, float y2)
01975 {
01976   nsSVGPathSegCurvetoCubicSmoothAbs *ps = new nsSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
01977   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
01978   NS_ADDREF(ps);
01979   *result = ps;
01980   return NS_OK;
01981 }
01982 
01983 
01984 nsSVGPathSegCurvetoCubicSmoothAbs::nsSVGPathSegCurvetoCubicSmoothAbs(float x, float y,
01985                                                                      float x2, float y2)
01986     : mX(x), mY(y), mX2(x2), mY2(y2)
01987 {
01988 }
01989 
01990 //----------------------------------------------------------------------
01991 // nsISupports methods:
01992 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoCubicSmoothAbs)
01993 
01994 //----------------------------------------------------------------------
01995 // nsISVGValue methods:
01996 NS_IMETHODIMP
01997 nsSVGPathSegCurvetoCubicSmoothAbs::SetValueString(const nsAString& aValue)
01998 {
01999   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoCubicSmoothAbs::SetValueString");
02000   return NS_ERROR_NOT_IMPLEMENTED;
02001 }
02002 
02003 NS_IMETHODIMP
02004 nsSVGPathSegCurvetoCubicSmoothAbs::GetValueString(nsAString& aValue)
02005 {
02006   aValue.Truncate();
02007 
02008   PRUnichar buf[96];
02009   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("S%g,%g %g,%g").get(),
02010                             mX2, mY2, mX, mY);
02011   aValue.Append(buf);
02012 
02013   return NS_OK;
02014 }
02015 
02016 //----------------------------------------------------------------------
02017 // nsIDOMSVGPathSeg methods:
02018 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoCubicSmoothAbs, PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S")
02019 
02020 //----------------------------------------------------------------------
02021 // nsIDOMSVGPathSegCurvetoCubicSmoothAbs methods:
02022 
02023 /* attribute float x; */
02024 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::GetX(float *aX)
02025 {
02026   *aX = mX;
02027   return NS_OK;
02028 }
02029 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::SetX(float aX)
02030 {
02031   WillModify();
02032   mX = aX;
02033   DidModify();
02034   return NS_OK;
02035 }
02036 
02037 /* attribute float y; */
02038 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::GetY(float *aY)
02039 {
02040   *aY = mY;
02041   return NS_OK;
02042 }
02043 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::SetY(float aY)
02044 {
02045   WillModify();
02046   mY = aY;
02047   DidModify();
02048   return NS_OK;
02049 }
02050 
02051 /* attribute float x2; */
02052 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::GetX2(float *aX2)
02053 {
02054   *aX2 = mX2;
02055   return NS_OK;
02056 }
02057 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::SetX2(float aX2)
02058 {
02059   WillModify();
02060   mX2 = aX2;
02061   DidModify();
02062   return NS_OK;
02063 }
02064 
02065 /* attribute float y2; */
02066 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::GetY2(float *aY2)
02067 {
02068   *aY2 = mY2;
02069   return NS_OK;
02070 }
02071 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothAbs::SetY2(float aY2)
02072 {
02073   WillModify();
02074   mY2 = aY2;
02075   DidModify();
02076   return NS_OK;
02077 }
02078 
02080 // nsSVGPathSegCurvetoCubicSmoothRel
02081 
02082 class nsSVGPathSegCurvetoCubicSmoothRel : public nsIDOMSVGPathSegCurvetoCubicSmoothRel,
02083                                           public nsSVGValue
02084 {
02085 public:
02086   nsSVGPathSegCurvetoCubicSmoothRel(float x, float y,
02087                                     float x2, float y2);
02088 
02089   // nsISupports interface:
02090   NS_DECL_ISUPPORTS
02091 
02092   // nsIDOMSVGPathSegCurvetoCubicSmoothRel interface:
02093   NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICSMOOTHREL
02094 
02095   // nsIDOMSVGPathSeg interface:
02096   NS_DECL_NSIDOMSVGPATHSEG
02097   
02098   // nsISVGValue interface:
02099   NS_IMETHOD SetValueString(const nsAString& aValue);
02100   NS_IMETHOD GetValueString(nsAString& aValue);
02101   
02102   
02103 protected:
02104   float mX, mY, mX2, mY2;
02105 };
02106 
02107 //----------------------------------------------------------------------
02108 // Implementation
02109 
02110 nsresult
02111 NS_NewSVGPathSegCurvetoCubicSmoothRel(nsIDOMSVGPathSegCurvetoCubicSmoothRel** result,
02112                                       float x, float y,
02113                                       float x2, float y2)
02114 {
02115   nsSVGPathSegCurvetoCubicSmoothRel *ps = new nsSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
02116   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
02117   NS_ADDREF(ps);
02118   *result = ps;
02119   return NS_OK;
02120 }
02121 
02122 
02123 nsSVGPathSegCurvetoCubicSmoothRel::nsSVGPathSegCurvetoCubicSmoothRel(float x, float y,
02124                                                                      float x2, float y2)
02125     : mX(x), mY(y), mX2(x2), mY2(y2)
02126 {
02127 }
02128 
02129 //----------------------------------------------------------------------
02130 // nsISupports methods:
02131 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoCubicSmoothRel)
02132 
02133 //----------------------------------------------------------------------
02134 // nsISVGValue methods:
02135 NS_IMETHODIMP
02136 nsSVGPathSegCurvetoCubicSmoothRel::SetValueString(const nsAString& aValue)
02137 {
02138   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoCubicSmoothRel::SetValueString");
02139   return NS_ERROR_NOT_IMPLEMENTED;
02140 }
02141 
02142 NS_IMETHODIMP
02143 nsSVGPathSegCurvetoCubicSmoothRel::GetValueString(nsAString& aValue)
02144 {
02145   aValue.Truncate();
02146 
02147   PRUnichar buf[96];
02148   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("s%g,%g %g,%g").get(),
02149                             mX2, mY2, mX, mY);
02150   aValue.Append(buf);
02151 
02152   return NS_OK;
02153 }
02154 
02155 //----------------------------------------------------------------------
02156 // nsIDOMSVGPathSeg methods:
02157 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoCubicSmoothRel, PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s")
02158 
02159 //----------------------------------------------------------------------
02160 // nsIDOMSVGPathSegCurvetoCubicSmoothRel methods:
02161 
02162 /* attribute float x; */
02163 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::GetX(float *aX)
02164 {
02165   *aX = mX;
02166   return NS_OK;
02167 }
02168 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::SetX(float aX)
02169 {
02170   WillModify();
02171   mX = aX;
02172   DidModify();
02173   return NS_OK;
02174 }
02175 
02176 /* attribute float y; */
02177 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::GetY(float *aY)
02178 {
02179   *aY = mY;
02180   return NS_OK;
02181 }
02182 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::SetY(float aY)
02183 {
02184   WillModify();
02185   mY = aY;
02186   DidModify();
02187   return NS_OK;
02188 }
02189 
02190 /* attribute float x2; */
02191 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::GetX2(float *aX2)
02192 {
02193   *aX2 = mX2;
02194   return NS_OK;
02195 }
02196 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::SetX2(float aX2)
02197 {
02198   WillModify();
02199   mX2 = aX2;
02200   DidModify();
02201   return NS_OK;
02202 }
02203 
02204 /* attribute float y2; */
02205 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::GetY2(float *aY2)
02206 {
02207   *aY2 = mY2;
02208   return NS_OK;
02209 }
02210 NS_IMETHODIMP nsSVGPathSegCurvetoCubicSmoothRel::SetY2(float aY2)
02211 {
02212   WillModify();
02213   mY2 = aY2;
02214   DidModify();
02215   return NS_OK;
02216 }
02217 
02219 // nsSVGPathSegCurvetoQuadraticSmoothAbs
02220 
02221 class nsSVGPathSegCurvetoQuadraticSmoothAbs : public nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs,
02222                                               public nsSVGValue
02223 {
02224 public:
02225   nsSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
02226 
02227   // nsISupports interface:
02228   NS_DECL_ISUPPORTS
02229 
02230   // nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs interface:
02231   NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICSMOOTHABS
02232 
02233   // nsIDOMSVGPathSeg interface:
02234   NS_DECL_NSIDOMSVGPATHSEG
02235   
02236   // nsISVGValue interface:
02237   NS_IMETHOD SetValueString(const nsAString& aValue);
02238   NS_IMETHOD GetValueString(nsAString& aValue);
02239   
02240   
02241 protected:
02242   float mX, mY;
02243 };
02244 
02245 //----------------------------------------------------------------------
02246 // Implementation
02247 
02248 nsresult
02249 NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs** result,
02250                           float x, float y)
02251 {
02252   nsSVGPathSegCurvetoQuadraticSmoothAbs *ps = new nsSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
02253   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
02254   NS_ADDREF(ps);
02255   *result = ps;
02256   return NS_OK;
02257 }
02258 
02259 
02260 nsSVGPathSegCurvetoQuadraticSmoothAbs::nsSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
02261     : mX(x), mY(y)
02262 {
02263 }
02264 
02265 //----------------------------------------------------------------------
02266 // nsISupports methods:
02267 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoQuadraticSmoothAbs)
02268 
02269 //----------------------------------------------------------------------
02270 // nsISVGValue methods:
02271 NS_IMETHODIMP
02272 nsSVGPathSegCurvetoQuadraticSmoothAbs::SetValueString(const nsAString& aValue)
02273 {
02274   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoQuadraticSmoothAbs::SetValueString");
02275   return NS_ERROR_NOT_IMPLEMENTED;
02276 }
02277 
02278 NS_IMETHODIMP
02279 nsSVGPathSegCurvetoQuadraticSmoothAbs::GetValueString(nsAString& aValue)
02280 {
02281   aValue.Truncate();
02282 
02283   PRUnichar buf[48];
02284   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("T%g,%g").get(), mX, mY);
02285   aValue.Append(buf);
02286 
02287   return NS_OK;
02288 }
02289 
02290 //----------------------------------------------------------------------
02291 // nsIDOMSVGPathSeg methods:
02292 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoQuadraticSmoothAbs, PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T")
02293 
02294 //----------------------------------------------------------------------
02295 // nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs methods:
02296 
02297 /* attribute float x; */
02298 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothAbs::GetX(float *aX)
02299 {
02300   *aX = mX;
02301   return NS_OK;
02302 }
02303 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothAbs::SetX(float aX)
02304 {
02305   WillModify();
02306   mX = aX;
02307   DidModify();
02308   return NS_OK;
02309 }
02310 
02311 /* attribute float y; */
02312 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothAbs::GetY(float *aY)
02313 {
02314   *aY = mY;
02315   return NS_OK;
02316 }
02317 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothAbs::SetY(float aY)
02318 {
02319   WillModify();
02320   mY = aY;
02321   DidModify();
02322   return NS_OK;
02323 }
02324 
02326 // nsSVGPathSegCurvetoQuadraticSmoothRel
02327 
02328 class nsSVGPathSegCurvetoQuadraticSmoothRel : public nsIDOMSVGPathSegCurvetoQuadraticSmoothRel,
02329                                               public nsSVGValue
02330 {
02331 public:
02332   nsSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
02333 
02334   // nsISupports interface:
02335   NS_DECL_ISUPPORTS
02336 
02337   // nsIDOMSVGPathSegCurvetoQuadraticSmoothRel interface:
02338   NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICSMOOTHREL
02339 
02340   // nsIDOMSVGPathSeg interface:
02341   NS_DECL_NSIDOMSVGPATHSEG
02342   
02343   // nsISVGValue interface:
02344   NS_IMETHOD SetValueString(const nsAString& aValue);
02345   NS_IMETHOD GetValueString(nsAString& aValue);
02346   
02347   
02348 protected:
02349   float mX, mY;
02350 };
02351 
02352 //----------------------------------------------------------------------
02353 // Implementation
02354 
02355 nsresult
02356 NS_NewSVGPathSegCurvetoQuadraticSmoothRel(nsIDOMSVGPathSegCurvetoQuadraticSmoothRel** result,
02357                                           float x, float y)
02358 {
02359   nsSVGPathSegCurvetoQuadraticSmoothRel *ps = new nsSVGPathSegCurvetoQuadraticSmoothRel(x, y);
02360   NS_ENSURE_TRUE(ps, NS_ERROR_OUT_OF_MEMORY);
02361   NS_ADDREF(ps);
02362   *result = ps;
02363   return NS_OK;
02364 }
02365 
02366 
02367 nsSVGPathSegCurvetoQuadraticSmoothRel::nsSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
02368     : mX(x), mY(y)
02369 {
02370 }
02371 
02372 //----------------------------------------------------------------------
02373 // nsISupports methods:
02374 NS_IMPL_NSISUPPORTS_SVGPATHSEG(SVGPathSegCurvetoQuadraticSmoothRel)
02375 
02376 //----------------------------------------------------------------------
02377 // nsISVGValue methods:
02378 NS_IMETHODIMP
02379 nsSVGPathSegCurvetoQuadraticSmoothRel::SetValueString(const nsAString& aValue)
02380 {
02381   NS_NOTYETIMPLEMENTED("nsSVGPathSegCurvetoQuadraticSmoothRel::SetValueString");
02382   return NS_ERROR_NOT_IMPLEMENTED;
02383 }
02384 
02385 NS_IMETHODIMP
02386 nsSVGPathSegCurvetoQuadraticSmoothRel::GetValueString(nsAString& aValue)
02387 {
02388   aValue.Truncate();
02389 
02390   PRUnichar buf[24];
02391   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("t%g,%g").get(), mX, mY);
02392   aValue.Append(buf);
02393 
02394   return NS_OK;
02395 }
02396 
02397 //----------------------------------------------------------------------
02398 // nsIDOMSVGPathSeg methods:
02399 NS_IMPL_NSIDOMSVGPATHSEG(nsSVGPathSegCurvetoQuadraticSmoothRel, PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t")
02400 
02401 //----------------------------------------------------------------------
02402 // nsIDOMSVGPathSegCurvetoQuadraticSmoothRel methods:
02403 
02404 /* attribute float x; */
02405 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothRel::GetX(float *aX)
02406 {
02407   *aX = mX;
02408   return NS_OK;
02409 }
02410 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothRel::SetX(float aX)
02411 {
02412   WillModify();
02413   mX = aX;
02414   DidModify();
02415   return NS_OK;
02416 }
02417 
02418 /* attribute float y; */
02419 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothRel::GetY(float *aY)
02420 {
02421   *aY = mY;
02422   return NS_OK;
02423 }
02424 NS_IMETHODIMP nsSVGPathSegCurvetoQuadraticSmoothRel::SetY(float aY)
02425 {
02426   WillModify();
02427   mY = aY;
02428   DidModify();
02429   return NS_OK;
02430 }
02431