[Kst] extragear/graphics/kst/kst/extensions/js

George Staikos staikos at kde.org
Wed May 25 20:23:03 CEST 2005


SVN commit 418141 by staikos:

moved docs over to the header file


 M  +55 -2     bind_vector.h  
 D             bind_vector.xml  


--- trunk/extragear/graphics/kst/kst/extensions/js/bind_vector.h #418140:418141
@@ -27,8 +27,17 @@
 
 using namespace KJSEmbed;
 
+/* @class Vector
+   @collection VectorCollection Kst.vectors
+   @description Represents a vector of any type in Kst.  Some vectors are
+                editable, while others are not.  This class behaves just as a
+                JavaScript array, but has additional properties and methods.
+*/
 class KstBindVector : public KstBinding {
   public:
+    /* @constructor
+       @description Default constructor creates an empty, editable vector.
+    */
     KstBindVector(KJS::ExecState *exec, KstVectorPtr v);
     KstBindVector(KJS::ExecState *exec, KJS::Object *globalObject = 0L);
     ~KstBindVector();
@@ -42,20 +51,64 @@
     KJS::ReferenceList propList(KJS::ExecState *exec, bool recursive = true);
     bool hasProperty(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
 
-    // member functions
+    /* @method resize
+       @description Resizes the vector.
+       @arg Number size The new size of the vector.  Should be >= 2.
+       @exception GeneralError Throws this exception if the vector is not
+                               editable.
+    */
     KJS::Value resize(KJS::ExecState *exec, const KJS::List& args);
+    /* @method Number interpolate
+       @description Interpolates the vector to <i>n</i> samples and
+                    returns the interpolated value of sample <i>i</i>.
+       @arg Number i The sample number to obtain the interpolated value of.
+       @arg Number n The number of samples to interpolate to.
+    */
     KJS::Value interpolate(KJS::ExecState *exec, const KJS::List& args);
+    /* @method zero
+       @description Sets all values in the vector to zero.
+       @exception GeneralError Throws this exception if the vector is not editable.
+    */
     KJS::Value zero(KJS::ExecState *exec, const KJS::List& args);
 
-    // properties
+    /* @property String tagName
+       @description A unique identifier for this data object.
+     */
     void setTagName(KJS::ExecState *exec, const KJS::Value& value);
     KJS::Value tagName(KJS::ExecState *exec) const;
+    /* @property Number length
+       @readonly
+       @description The number of samples in the vector.
+    */
     KJS::Value length(KJS::ExecState *exec) const;
+    /* @property Number min
+       @readonly
+       @description The value of the smallest sample in the vector.
+    */
     KJS::Value min(KJS::ExecState *exec) const;
+    /* @property Number max
+       @readonly
+       @description The value of the largest sample in the vector.
+    */
     KJS::Value max(KJS::ExecState *exec) const;
+    /* @property Number mean
+       @readonly
+       @description The mean value of all samples in the vector.
+    */
     KJS::Value mean(KJS::ExecState *exec) const;
+    /* @property Number numNew
+       @readonly
+    */
     KJS::Value numNew(KJS::ExecState *exec) const;
+    /* @property Number numShifted
+       @readonly
+    */
     KJS::Value numShifted(KJS::ExecState *exec) const;
+    /* @property Number editable
+       @readonly
+       @description True if the vector is editable by the user.  This should be
+                    checked before attempting to modify a vector in any way.
+    */
     KJS::Value editable(KJS::ExecState *exec) const;
 
   protected:


More information about the Kst mailing list