2
* This file is part of the KDE project
4
* Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#include "kis_object_base.h"
22
#include "kis_function_base.h"
24
#include <kjsembed/kjsembedpart.h>
28
namespace KisKJSEmbed {
31
ObjectFactoryBase::ObjectFactoryBase(KJS::Object parent, QString name, KJSEmbed::KJSEmbedPart *part) : JSProxyImp(part->globalExec()), m_part(part)
33
parent.put( part->globalExec() , KJS::Identifier(name), KJS::Object(this) );
34
setName( KJS::Identifier( name ) );
37
void ObjectFactoryBase::bind( KJS::Object obj)
39
if( m_functionsList.empty() )
43
FunctionsList_it i = m_functionsList.begin();
44
while (i != m_functionsList.end())
46
FunctionBase* fb = *i;
47
obj.put( part()->globalExec() , KJS::Identifier(fb->name()), KJS::Object(fb) );