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

George Staikos staikos at kde.org
Tue May 31 17:21:14 CEST 2005


SVN commit 420209 by staikos:

a property that converts a plot to a viewobject


 M  +6 -0      bind_plot.cpp  
 M  +6 -0      bind_plot.h  


--- trunk/extragear/graphics/kst/kst/extensions/js/bind_plot.cpp #420208:420209
@@ -19,6 +19,7 @@
 #include "bind_curvecollection.h"
 #include "bind_legend.h"
 #include "bind_plotlabelcollection.h"
+#include "bind_viewobject.h"
 
 #include <kst2dplot.h>
 #include <ksttoplevelview.h>
@@ -237,4 +238,9 @@
   return KJS::Object(new KstBindLegend(exec, _d->Legend));
 }
 
+
+KJS::Value KstBindPlot::asViewObject(KJS::ExecState *exec) const {
+  return KJS::Object(new KstBindViewObject(exec, const_cast<Kst2DPlot*>(_d.data()))); // yuck
+}
+
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/extensions/js/bind_plot.h #420208:420209
@@ -72,6 +72,12 @@
        @description The Legend for this plot.
     */
     KJS::Value legend(KJS::ExecState *exec) const;
+    /* @property ViewObject asViewObject
+       @readonly
+       @description A reference to this plot as a ViewObject.  This is useful
+                    for manipulating generic properties of the plot object.
+    */
+    KJS::Value asViewObject(KJS::ExecState *exec) const;
 
   protected:
     KstBindPlot(int id);


More information about the Kst mailing list