[Kst] kdeextragear-2/kst/kst/extensions/js

George Staikos staikos at kde.org
Mon Apr 4 08:17:18 CEST 2005


CVS commit by staikos: 

add purge binding


  M +14 -0     bind_kst.cpp   1.9
  M +1 -0      bind_kst.h   1.7
  M +1 -1      bindings.txt   1.13


--- kdeextragear-2/kst/kst/extensions/js/bind_kst.cpp  #1.8:1.9
@@ -31,4 +31,5 @@
 #include <kst.h>
 #include <kstdatacollection.h>
+#include <kstdoc.h>
 #include <kstversion.h>
 #include <kstviewwindow.h>
@@ -72,4 +73,5 @@ struct KstProperties {
 static KstBindings kstBindings[] = {
   { "resetInterpreter", &KstBindKst::resetInterpreter },
+  { "purge", &KstBindKst::purge },
   { 0L, 0L }
 };
@@ -181,4 +183,16 @@ KJS::Value KstBindKst::resetInterpreter(
 
 
+KJS::Value KstBindKst::purge(KJS::ExecState *exec, const KJS::List& args) {
+  if (args.size() != 0) {
+    KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
+    exec->setException(eobj);
+    return KJS::Value();
+  }
+
+  KstApp::inst()->document()->purge();
+  return KJS::Value();
+}
+
+
 KJS::Value KstBindKst::vectors(KJS::ExecState *exec) const {
   return KJS::Object(new KstBindVectorCollection(exec));

--- kdeextragear-2/kst/kst/extensions/js/bind_kst.h  #1.6:1.7
@@ -39,4 +39,5 @@ class KstBindKst : public KstBinding {
 
     KJS::Value resetInterpreter(KJS::ExecState *exec, const KJS::List& args);
+    KJS::Value purge(KJS::ExecState *exec, const KJS::List& args);
 
     KJS::Value dataSources(KJS::ExecState *exec) const;

--- kdeextragear-2/kst/kst/extensions/js/bindings.txt  #1.12:1.13
@@ -2,5 +2,5 @@
 Classes to be bound or created in JS:
 
-Kst             General Kst object (static global)
+Kst             General Kst object (static global) - effectively "document"
 Debug           DONE (.log property unfinished)
 Vector          DONE




More information about the Kst mailing list