KateKJSWrapperConfigPage::KateKJSWrapperConfigPage(KJS::Object pageConstructor,PluginKateKJSWrapper* parent, QWidget *parentWidget) : Kate::PluginConfigPage( parentWidget ),m_plugin(parent) { QVBoxLayout *l=new QVBoxLayout(this); l->setAutoAdd(true); l->activate(); KJS::Interpreter *js = parent->m_part->interpreter(); KJS::ExecState *exec = js->globalExec(); exec->clearException(); KJS::List param; param.append(parent->m_part->factory()->createProxy(exec,this,0)); m_pageObject=pageConstructor.construct(exec,param); }
DOM::EventListener *KJSProxyImpl::createHTMLEventHandler(QString sourceUrl, QString code) { #ifdef KJS_DEBUGGER if (KJSDebugWin::instance()) KJSDebugWin::instance()->setNextSourceInfo(sourceUrl,m_handlerLineno); #else Q_UNUSED(sourceUrl); #endif initScript(); //KJS::Constructor constr(KJS::Global::current().get("Function").imp()); KJS::Object constr = m_script->builtinFunction(); KJS::List args; args.append(KJS::String("event")); args.append(KJS::String(code)); Object handlerFunc = constr.construct(m_script->globalExec(), args); // ### is globalExec ok ? return KJS::Window::retrieveWindow(m_part)->getJSEventListener(handlerFunc,true); }
Kate::JS::ToolView::ToolView(KJS::Object constr, KJS::ExecState *exec, KJSEmbed::JSFactory *factory, KJS::List parameters, const char *name):QVBox(0,name) { parameters.append(factory->createProxy(exec,this)); handler=constr.construct(exec,parameters); }