[Kst] kdeextragear-2/kst/kst/extensions/js
George Staikos
staikos at kde.org
Tue Apr 19 05:15:10 CEST 2005
CVS commit by staikos:
a couple more bindings and some notes
M +5 -0 TODO 1.20
M +27 -0 bind_plugin.cpp 1.3
M +3 -0 bind_plugin.h 1.3
--- kdeextragear-2/kst/kst/extensions/js/TODO #1.19:1.20
@@ -9,4 +9,9 @@
+General Completion:
+- need to finish plugin bindings - after freeze
+- input and output map for data objects
+
+
Would be nice:
- save and load state
--- kdeextragear-2/kst/kst/extensions/js/bind_plugin.cpp #1.2:1.3
@@ -78,4 +78,6 @@ static PluginProperties pluginProperties
{ "tagName", &KstBindPlugin::setTagName, &KstBindPlugin::tagName },
{ "module", 0L, &KstBindPlugin::module },
+ { "lastError", 0L, &KstBindPlugin::lastError },
+ { "valid", 0L, &KstBindPlugin::valid },
{ 0L, 0L, 0L }
};
@@ -196,3 +198,28 @@ KJS::Value KstBindPlugin::module(KJS::Ex
+void KstBindPlugin::setModule(KJS::ExecState *exec, const KJS::Value& value) {
+ if (value.type() != KJS::ObjectType) {
+ KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
+ exec->setException(eobj);
+ return;
+ }
+ KstWriteLocker wl(_d);
+ //_d->setPlugin(); FIXME - then enable above
+}
+
+
+KJS::Value KstBindPlugin::lastError(KJS::ExecState *exec) const {
+ Q_UNUSED(exec)
+ KstReadLocker rl(_d);
+ return KJS::String(_d->lastError());
+}
+
+
+KJS::Value KstBindPlugin::valid(KJS::ExecState *exec) const {
+ Q_UNUSED(exec)
+ KstReadLocker rl(_d);
+ return KJS::Boolean(_d->isValid());
+}
+
+
// vim: ts=2 sw=2 et
--- kdeextragear-2/kst/kst/extensions/js/bind_plugin.h #1.2:1.3
@@ -45,6 +45,9 @@ class KstBindPlugin : public KstBinding
// properties
void setTagName(KJS::ExecState *exec, const KJS::Value& value);
+ void setModule(KJS::ExecState *exec, const KJS::Value& value);
KJS::Value tagName(KJS::ExecState *exec) const;
KJS::Value module(KJS::ExecState *exec) const;
+ KJS::Value lastError(KJS::ExecState *exec) const;
+ KJS::Value valid(KJS::ExecState *exec) const;
protected:
More information about the Kst
mailing list