kjsembed
Go to the documentation of this file.
24 #ifndef VALUE_BINDING_H
25 #define VALUE_BINDING_H
27 #include <kjs/object.h>
28 #include <kjs/interpreter.h>
39 #define START_VALUE_METHOD( METHODNAME, TYPE) \
40 KJS::JSValue *METHODNAME( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args ) \
45 KJS::JSValue *result = KJS::jsNull(); \
46 KJSEmbed::ValueBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::ValueBinding>(exec, self ); \
49 TYPE value = imp->value<TYPE>();
53 #define END_VALUE_METHOD \
54 imp->setValue(value); \
57 KJS::throwError(exec, KJS::GeneralError, "Problem in ValueBinding here");\
62 #define KJSO_VALUE_SIMPLE_BINDING_CTOR( NAME, JSNAME, TYPE, BASENAME ) \
63 NAME::NAME(KJS::ExecState *exec, const char* typeName ) \
64 : BASENAME( exec, typeName ) \
66 StaticBinding::publish( exec, this, NAME::methods() ); \
68 NAME::NAME(KJS::ExecState *exec, const TYPE & value) \
69 : BASENAME( exec, #JSNAME , value ) \
71 StaticBinding::publish( exec, this, NAME::methods() ); \
74 #define KJSO_VALUE_DERIVED_BINDING_CTOR( NAME, JSNAME, TYPE, BASENAME ) \
75 NAME::NAME(KJS::ExecState *exec, const char* typeName ) \
76 : BASENAME( exec, typeName ) \
78 StaticBinding::publish( exec, this, NAME::methods() ); \
80 NAME::NAME(KJS::ExecState *exec, const TYPE & value) \
81 : BASENAME( exec, #JSNAME ) \
84 StaticBinding::publish( exec, this, NAME::methods() ); \
106 template <
typename T>
114 ValueBinding( KJS::ExecState *exec,
const char *typeName);
117 KJS::UString
toString(KJS::ExecState *exec)
const;
123 template<
typename T>
126 const T *ptr =
reinterpret_cast<const T*
>(m_value->
voidStar());
136 template<
typename T>
143 template<
typename T>
146 const T *ptr =
reinterpret_cast<const T*
>( imp->m_value->
voidStar() );
152 static const KJS::ClassInfo
info;
155 virtual const KJS::ClassInfo* classInfo()
const {
return &
info; }
166 template<
typename T>
172 KJSEmbed::extractBindingImp<KJSEmbed::ValueBinding>(exec, arg );
174 return ValueBinding::castValue<T>( imp );
183 template<
typename T>
186 if( args.size() >
idx )
194 template<
typename T>
197 KJS::JSObject *
parent = exec->dynamicInterpreter()->globalObject();
203 extractBindingImp<KJSEmbed::ValueBinding>(exec, returnValue );
209 return KJS::jsNull();
215 return KJS::jsNull();
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Apr 16 2013 19:12:29 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.