diff options
Diffstat (limited to 'kjsembed/qtbindings')
48 files changed, 16298 insertions, 0 deletions
diff --git a/kjsembed/qtbindings/Makefile.am b/kjsembed/qtbindings/Makefile.am new file mode 100644 index 00000000..7fde7610 --- /dev/null +++ b/kjsembed/qtbindings/Makefile.am @@ -0,0 +1,35 @@ + +INCLUDES= -I$(srcdir)/.. -I$(srcdir)/../.. $(all_includes) +KDE_CXXFLAGS = -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -Wno-unused + +noinst_LTLIBRARIES = libkjsembedqtbindings.la + +libkjsembedqtbindings_la_SOURCES = qlistviewitem_imp.cpp \ + qcombobox_imp.cpp \ + qframe_imp.cpp \ + qt_imp.cpp \ + qchecklistitem_imp.cpp \ + qcanvasellipse_imp.cpp \ + qcanvas_imp.cpp \ + qcanvasitem_imp.cpp \ + qcanvasitemlist_imp.cpp \ + qcanvasline_imp.cpp \ + qcanvaspixmaparray_imp.cpp \ + qcanvaspixmap_imp.cpp \ + qcanvaspolygonalitem_imp.cpp \ + qcanvaspolygon_imp.cpp \ + qcanvasrectangle_imp.cpp \ + qcanvasspline_imp.cpp \ + qcanvassprite_imp.cpp \ + qcanvastext_imp.cpp \ + qcanvasview_imp.cpp \ + qpopupmenu_imp.cpp \ + qmenudata_imp.cpp \ + qmenuitem_imp.cpp + +libkjsembedqtbindings_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) +libkjsembedqtbindings_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) + +libkjsembedqtbindings_la_METASOURCES = AUTO + + diff --git a/kjsembed/qtbindings/qcanvas_imp.cpp b/kjsembed/qtbindings/qcanvas_imp.cpp new file mode 100644 index 00000000..65192798 --- /dev/null +++ b/kjsembed/qtbindings/qcanvas_imp.cpp @@ -0,0 +1,1117 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvas_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasImp::QCanvasImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasImp::~QCanvasImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasImp *meth = new QCanvasImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setTiles_5, "setTiles" }, + { Method_setBackgroundPixmap_6, "setBackgroundPixmap" }, + { Method_backgroundPixmap_7, "backgroundPixmap" }, + { Method_setBackgroundColor_8, "setBackgroundColor" }, + { Method_backgroundColor_9, "backgroundColor" }, + { Method_setTile_10, "setTile" }, + { Method_tile_11, "tile" }, + { Method_tilesHorizontally_12, "tilesHorizontally" }, + { Method_tilesVertically_13, "tilesVertically" }, + { Method_tileWidth_14, "tileWidth" }, + { Method_tileHeight_15, "tileHeight" }, + { Method_resize_16, "resize" }, + { Method_width_17, "width" }, + { Method_height_18, "height" }, + { Method_size_19, "size" }, + { Method_rect_20, "rect" }, + { Method_onCanvas_21, "onCanvas" }, + { Method_onCanvas_22, "onCanvas" }, + { Method_validChunk_23, "validChunk" }, + { Method_validChunk_24, "validChunk" }, + { Method_chunkSize_25, "chunkSize" }, + { Method_retune_26, "retune" }, + { Method_sameChunk_27, "sameChunk" }, + { Method_setChangedChunk_28, "setChangedChunk" }, + { Method_setChangedChunkContaining_29, "setChangedChunkContaining" }, + { Method_setAllChanged_30, "setAllChanged" }, + { Method_setChanged_31, "setChanged" }, + { Method_setUnchanged_32, "setUnchanged" }, + { Method_addItemToChunk_33, "addItemToChunk" }, + { Method_removeItemFromChunk_34, "removeItemFromChunk" }, + { Method_addItemToChunkContaining_35, "addItemToChunkContaining" }, + { Method_removeItemFromChunkContaining_36, "removeItemFromChunkContaining" }, + { Method_allItems_37, "allItems" }, + { Method_collisions_38, "collisions" }, + { Method_collisions_39, "collisions" }, + { Method_collisions_40, "collisions" }, + { Method_drawArea_41, "drawArea" }, + { Method_addView_42, "addView" }, + { Method_removeView_43, "removeView" }, + { Method_drawCanvasArea_44, "drawCanvasArea" }, + { Method_drawViewArea_45, "drawViewArea" }, + { Method_addItem_46, "addItem" }, + { Method_addAnimation_47, "addAnimation" }, + { Method_removeItem_48, "removeItem" }, + { Method_removeAnimation_49, "removeAnimation" }, + { Method_setAdvancePeriod_50, "setAdvancePeriod" }, + { Method_setUpdatePeriod_51, "setUpdatePeriod" }, + { Method_setDoubleBuffering_52, "setDoubleBuffering" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasImp *meth = new QCanvasImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvas pointer from an Object. + */ +QCanvas *QCanvasImp::toQCanvas( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvas *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvas" ) + return 0; + + return op->toNative<QCanvas>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvas_1: + return QCanvas_1( exec, args ); + break; + + case Constructor_QCanvas_2: + return QCanvas_2( exec, args ); + break; + + case Constructor_QCanvas_3: + return QCanvas_3( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasImp::QCanvas_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QObject * + + QObject * arg0 = extractQObject(exec,args,0); + + const char *arg1 = (args.size() >= 2) ? args[1].toString(exec).ascii() : 0; + + + // We should now create an instance of the QCanvas object + + QCanvas *ret = new QCanvas( + + arg0, + arg1 ); + + JSOpaqueProxy *prx = new JSOpaqueProxy( ret, "QCanvas"); + return KJS::Object( prx ); +} + +KJS::Object QCanvasImp::QCanvas_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + + // We should now create an instance of the QCanvas object + + QCanvas *ret = new QCanvas( + + arg0, + arg1 ); + JSOpaqueProxy *prx = new JSOpaqueProxy( ret, "QCanvas"); + return KJS::Object( prx ); + +} + +KJS::Object QCanvasImp::QCanvas_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QPixmap + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + + // We should now create an instance of the QCanvas object + + QCanvas *ret = new QCanvas( + + arg0, + arg1, + arg2, + arg3, + arg4 ); + + JSOpaqueProxy *prx = new JSOpaqueProxy( ret, "QCanvas"); + return KJS::Object( prx ); +} + +KJS::Value QCanvasImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasImp::toQCanvas( self ); + + switch( id ) { + + case Method_setTiles_5: + return setTiles_5( exec, self, args ); + break; + + case Method_setBackgroundPixmap_6: + return setBackgroundPixmap_6( exec, self, args ); + break; + + case Method_backgroundPixmap_7: + return backgroundPixmap_7( exec, self, args ); + break; + + case Method_setBackgroundColor_8: + return setBackgroundColor_8( exec, self, args ); + break; + + case Method_backgroundColor_9: + return backgroundColor_9( exec, self, args ); + break; + + case Method_setTile_10: + return setTile_10( exec, self, args ); + break; + + case Method_tile_11: + return tile_11( exec, self, args ); + break; + + case Method_tilesHorizontally_12: + return tilesHorizontally_12( exec, self, args ); + break; + + case Method_tilesVertically_13: + return tilesVertically_13( exec, self, args ); + break; + + case Method_tileWidth_14: + return tileWidth_14( exec, self, args ); + break; + + case Method_tileHeight_15: + return tileHeight_15( exec, self, args ); + break; + + case Method_resize_16: + return resize_16( exec, self, args ); + break; + + case Method_width_17: + return width_17( exec, self, args ); + break; + + case Method_height_18: + return height_18( exec, self, args ); + break; + + case Method_size_19: + return size_19( exec, self, args ); + break; + + case Method_rect_20: + return rect_20( exec, self, args ); + break; + + case Method_onCanvas_21: + return onCanvas_21( exec, self, args ); + break; + + case Method_onCanvas_22: + return onCanvas_22( exec, self, args ); + break; + + case Method_validChunk_23: + return validChunk_23( exec, self, args ); + break; + + case Method_validChunk_24: + return validChunk_24( exec, self, args ); + break; + + case Method_chunkSize_25: + return chunkSize_25( exec, self, args ); + break; + + case Method_retune_26: + return retune_26( exec, self, args ); + break; + + case Method_sameChunk_27: + return sameChunk_27( exec, self, args ); + break; + + case Method_setChangedChunk_28: + return setChangedChunk_28( exec, self, args ); + break; + + case Method_setChangedChunkContaining_29: + return setChangedChunkContaining_29( exec, self, args ); + break; + + case Method_setAllChanged_30: + return setAllChanged_30( exec, self, args ); + break; + + case Method_setChanged_31: + return setChanged_31( exec, self, args ); + break; + + case Method_setUnchanged_32: + return setUnchanged_32( exec, self, args ); + break; + + case Method_addItemToChunk_33: + return addItemToChunk_33( exec, self, args ); + break; + + case Method_removeItemFromChunk_34: + return removeItemFromChunk_34( exec, self, args ); + break; + + case Method_addItemToChunkContaining_35: + return addItemToChunkContaining_35( exec, self, args ); + break; + + case Method_removeItemFromChunkContaining_36: + return removeItemFromChunkContaining_36( exec, self, args ); + break; + + case Method_allItems_37: + return allItems_37( exec, self, args ); + break; + + case Method_collisions_38: + return collisions_38( exec, self, args ); + break; + + case Method_collisions_39: + return collisions_39( exec, self, args ); + break; + + case Method_collisions_40: + return collisions_40( exec, self, args ); + break; + + case Method_drawArea_41: + return drawArea_41( exec, self, args ); + break; + + case Method_addView_42: + return addView_42( exec, self, args ); + break; + + case Method_removeView_43: + return removeView_43( exec, self, args ); + break; + + case Method_drawCanvasArea_44: + return drawCanvasArea_44( exec, self, args ); + break; + + case Method_drawViewArea_45: + return drawViewArea_45( exec, self, args ); + break; + + case Method_addItem_46: + return addItem_46( exec, self, args ); + break; + + case Method_addAnimation_47: + return addAnimation_47( exec, self, args ); + break; + + case Method_removeItem_48: + return removeItem_48( exec, self, args ); + break; + + case Method_removeAnimation_49: + return removeAnimation_49( exec, self, args ); + break; + + case Method_setAdvancePeriod_50: + return setAdvancePeriod_50( exec, self, args ); + break; + + case Method_setUpdatePeriod_51: + return setUpdatePeriod_51( exec, self, args ); + break; + + case Method_setDoubleBuffering_52: + return setDoubleBuffering_52( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasImp::setTiles_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPixmap + return KJS::Value(); + + QPixmap arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + instance->setTiles( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setBackgroundPixmap_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + instance->setBackgroundPixmap( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::backgroundPixmap_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QPixmap ret; + ret = instance->backgroundPixmap( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasImp::setBackgroundColor_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QColor arg0 = extractQColor(exec, args, 0); + + instance->setBackgroundColor( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::backgroundColor_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->backgroundColor( ); + return KJS::Value(); // Returns 'QColor' + +} + +KJS::Value QCanvasImp::setTile_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->setTile( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::tile_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int ret; + ret = instance->tile( + arg0, + arg1 ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::tilesHorizontally_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->tilesHorizontally( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::tilesVertically_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->tilesVertically( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::tileWidth_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->tileWidth( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::tileHeight_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->tileHeight( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::resize_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->resize( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::width_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->width( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::height_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->height( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::size_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QSize ret; + ret = instance->size( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasImp::rect_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->rect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasImp::onCanvas_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + bool ret; + ret = instance->onCanvas( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasImp::onCanvas_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + bool ret; + ret = instance->onCanvas( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasImp::validChunk_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + bool ret; + ret = instance->validChunk( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasImp::validChunk_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + bool ret; + ret = instance->validChunk( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasImp::chunkSize_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->chunkSize( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasImp::retune_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->retune( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::sameChunk_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + bool ret; + ret = instance->sameChunk( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasImp::setChangedChunk_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setChangedChunk( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setChangedChunkContaining_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setChangedChunkContaining( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setAllChanged_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->setAllChanged( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setChanged_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + instance->setChanged( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setUnchanged_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + instance->setUnchanged( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::addItemToChunk_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->addItemToChunk( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::removeItemFromChunk_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->removeItemFromChunk( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::addItemToChunkContaining_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->addItemToChunkContaining( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::removeItemFromChunkContaining_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->removeItemFromChunkContaining( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::allItems_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->allItems( ); + return KJS::Value(); // Returns 'QCanvasItemList' + +} + +KJS::Value QCanvasImp::collisions_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + instance->collisions( + arg0 ); + return KJS::Value(); // Returns 'QCanvasItemList' + +} + +KJS::Value QCanvasImp::collisions_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + instance->collisions( + arg0 ); + return KJS::Value(); // Returns 'QCanvasItemList' + +} + +KJS::Value QCanvasImp::collisions_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPointArray arg0; // TODO (hack for qcanvas) + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg1; // Dummy + + bool arg2 = extractBool(exec, args, 2); + + instance->collisions( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns 'QCanvasItemList' + +} + +KJS::Value QCanvasImp::drawArea_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg1; // Dummy + + bool arg2 = extractBool(exec, args, 2); + + instance->drawArea( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::addView_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasView * + return KJS::Value(); + + QCanvasView * arg0; // Dummy + + instance->addView( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::removeView_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasView * + return KJS::Value(); + + QCanvasView * arg0; // Dummy + + instance->removeView( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::drawCanvasArea_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg1; // Dummy + + bool arg2 = extractBool(exec, args, 2); + + instance->drawCanvasArea( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::drawViewArea_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasView * + return KJS::Value(); + + QCanvasView * arg0; // Dummy + + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg1; // Dummy + + QRect arg2 = extractQRect(exec, args, 2); + + bool arg3 = extractBool(exec, args, 3); + + instance->drawViewArea( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::addItem_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + instance->addItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::addAnimation_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + instance->addAnimation( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::removeItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + instance->removeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::removeAnimation_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasItem * + return KJS::Value(); + + QCanvasItem * arg0; // Dummy + + instance->removeAnimation( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setAdvancePeriod_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setAdvancePeriod( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setUpdatePeriod_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setUpdatePeriod( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasImp::setDoubleBuffering_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setDoubleBuffering( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvas_imp.h b/kjsembed/qtbindings/qcanvas_imp.h new file mode 100644 index 00000000..9bd167bb --- /dev/null +++ b/kjsembed/qtbindings/qcanvas_imp.h @@ -0,0 +1,198 @@ + + + +#ifndef KJSEMBED_QCanvas_H +#define KJSEMBED_QCanvas_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvas; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvas methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvas_1, + Constructor_QCanvas_2, + Constructor_QCanvas_3, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setTiles_5, + Method_setBackgroundPixmap_6, + Method_backgroundPixmap_7, + Method_setBackgroundColor_8, + Method_backgroundColor_9, + Method_setTile_10, + Method_tile_11, + Method_tilesHorizontally_12, + Method_tilesVertically_13, + Method_tileWidth_14, + Method_tileHeight_15, + Method_resize_16, + Method_width_17, + Method_height_18, + Method_size_19, + Method_rect_20, + Method_onCanvas_21, + Method_onCanvas_22, + Method_validChunk_23, + Method_validChunk_24, + Method_chunkSize_25, + Method_retune_26, + Method_sameChunk_27, + Method_setChangedChunk_28, + Method_setChangedChunkContaining_29, + Method_setAllChanged_30, + Method_setChanged_31, + Method_setUnchanged_32, + Method_addItemToChunk_33, + Method_removeItemFromChunk_34, + Method_addItemToChunkContaining_35, + Method_removeItemFromChunkContaining_36, + Method_allItems_37, + Method_collisions_38, + Method_collisions_39, + Method_collisions_40, + Method_drawArea_41, + Method_addView_42, + Method_removeView_43, + Method_drawCanvasArea_44, + Method_drawViewArea_45, + Method_addItem_46, + Method_addAnimation_47, + Method_removeItem_48, + Method_removeAnimation_49, + Method_setAdvancePeriod_50, + Method_setUpdatePeriod_51, + Method_setDoubleBuffering_52, + Method_Last = -1 + }; + + QCanvasImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvas *toQCanvas( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvas_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvas_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvas_3( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setTiles_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setBackgroundPixmap_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value backgroundPixmap_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setBackgroundColor_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value backgroundColor_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setTile_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value tile_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value tilesHorizontally_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value tilesVertically_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value tileWidth_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value tileHeight_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value resize_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value width_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value height_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value size_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rect_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value onCanvas_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value onCanvas_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value validChunk_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value validChunk_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value chunkSize_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value retune_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sameChunk_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setChangedChunk_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setChangedChunkContaining_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAllChanged_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setChanged_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setUnchanged_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addItemToChunk_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItemFromChunk_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addItemToChunkContaining_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItemFromChunkContaining_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value allItems_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collisions_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collisions_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collisions_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value drawArea_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addView_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeView_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value drawCanvasArea_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value drawViewArea_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addItem_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addAnimation_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeAnimation_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAdvancePeriod_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setUpdatePeriod_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDoubleBuffering_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvas *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvas_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasellipse_imp.cpp b/kjsembed/qtbindings/qcanvasellipse_imp.cpp new file mode 100644 index 00000000..6c4fbff3 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasellipse_imp.cpp @@ -0,0 +1,368 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasellipse_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasEllipseImp::QCanvasEllipseImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasEllipseImp::~QCanvasEllipseImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasEllipseImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasEllipseImp *meth = new QCanvasEllipseImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasEllipseImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_width_5, "width" }, + { Method_height_6, "height" }, + { Method_setSize_7, "setSize" }, + { Method_setAngles_8, "setAngles" }, + { Method_angleStart_9, "angleStart" }, + { Method_angleLength_10, "angleLength" }, + { Method_areaPoints_11, "areaPoints" }, + { Method_collidesWith_12, "collidesWith" }, + { Method_rtti_13, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasEllipseImp *meth = new QCanvasEllipseImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasEllipse pointer from an Object. + */ +QCanvasEllipse *QCanvasEllipseImp::toQCanvasEllipse( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasEllipse *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasEllipse" ) + return 0; + + return op->toNative<QCanvasEllipse>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasEllipseImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasEllipse_1: + return QCanvasEllipse_1( exec, args ); + break; + + case Constructor_QCanvasEllipse_2: + return QCanvasEllipse_2( exec, args ); + break; + + case Constructor_QCanvasEllipse_3: + return QCanvasEllipse_3( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasEllipseCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasEllipseImp::QCanvasEllipse_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasEllipse object + + QCanvasEllipse *ret = new QCanvasEllipse( + + arg0 ); + + +} + +KJS::Object QCanvasEllipseImp::QCanvasEllipse_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg2; // Dummy + + + // We should now create an instance of the QCanvasEllipse object + + QCanvasEllipse *ret = new QCanvasEllipse( + + arg0, + arg1, + arg2 ); + + +} + +KJS::Object QCanvasEllipseImp::QCanvasEllipse_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg4; // Dummy + + + // We should now create an instance of the QCanvasEllipse object + + QCanvasEllipse *ret = new QCanvasEllipse( + + arg0, + arg1, + arg2, + arg3, + arg4 ); + + +} + +KJS::Value QCanvasEllipseImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasEllipseImp::toQCanvasEllipse( self ); + + switch( id ) { + + case Method_width_5: + return width_5( exec, self, args ); + break; + + case Method_height_6: + return height_6( exec, self, args ); + break; + + case Method_setSize_7: + return setSize_7( exec, self, args ); + break; + + case Method_setAngles_8: + return setAngles_8( exec, self, args ); + break; + + case Method_angleStart_9: + return angleStart_9( exec, self, args ); + break; + + case Method_angleLength_10: + return angleLength_10( exec, self, args ); + break; + + case Method_areaPoints_11: + return areaPoints_11( exec, self, args ); + break; + + case Method_collidesWith_12: + return collidesWith_12( exec, self, args ); + break; + + case Method_rtti_13: + return rtti_13( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasEllipseImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasEllipseImp::width_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->width( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasEllipseImp::height_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->height( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasEllipseImp::setSize_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setSize( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasEllipseImp::setAngles_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setAngles( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasEllipseImp::angleStart_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->angleStart( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasEllipseImp::angleLength_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->angleLength( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasEllipseImp::areaPoints_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->areaPoints( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasEllipseImp::collidesWith_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasEllipseImp::rtti_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasellipse_imp.h b/kjsembed/qtbindings/qcanvasellipse_imp.h new file mode 100644 index 00000000..052f41cf --- /dev/null +++ b/kjsembed/qtbindings/qcanvasellipse_imp.h @@ -0,0 +1,120 @@ + + + +#ifndef KJSEMBED_QCanvasEllipse_H +#define KJSEMBED_QCanvasEllipse_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasEllipse; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasEllipse methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasEllipseImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasEllipse_1, + Constructor_QCanvasEllipse_2, + Constructor_QCanvasEllipse_3, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_width_5, + Method_height_6, + Method_setSize_7, + Method_setAngles_8, + Method_angleStart_9, + Method_angleLength_10, + Method_areaPoints_11, + Method_collidesWith_12, + Method_rtti_13, + Method_Last = -1 + }; + + QCanvasEllipseImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasEllipseImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasEllipse *toQCanvasEllipse( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasEllipse_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasEllipse_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasEllipse_3( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value width_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value height_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSize_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAngles_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value angleStart_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value angleLength_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value areaPoints_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collidesWith_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasEllipse *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasEllipse_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasitem_imp.cpp b/kjsembed/qtbindings/qcanvasitem_imp.cpp new file mode 100644 index 00000000..f2e1c0e0 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasitem_imp.cpp @@ -0,0 +1,790 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasitem_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasItemImp::QCanvasItemImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasItemImp::~QCanvasItemImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasItemImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasItemImp *meth = new QCanvasItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum RttiValues + { "Rtti_Item", QCanvasItem::Rtti_Item }, + { "Rtti_Sprite", QCanvasItem::Rtti_Sprite }, + { "Rtti_PolygonalItem", QCanvasItem::Rtti_PolygonalItem }, + { "Rtti_Text", QCanvasItem::Rtti_Text }, + { "Rtti_Polygon", QCanvasItem::Rtti_Polygon }, + { "Rtti_Rectangle", QCanvasItem::Rtti_Rectangle }, + { "Rtti_Ellipse", QCanvasItem::Rtti_Ellipse }, + { "Rtti_Line", QCanvasItem::Rtti_Line }, + { "Rtti_Spline", QCanvasItem::Rtti_Spline }, + { 0, 0 } + }; + + int enumidx = 0; + while( enums[enumidx].id ) { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasItemImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_x_3, "x" }, + { Method_y_4, "y" }, + { Method_z_5, "z" }, + { Method_moveBy_6, "moveBy" }, + { Method_move_7, "move" }, + { Method_setX_8, "setX" }, + { Method_setY_9, "setY" }, + { Method_setZ_10, "setZ" }, + { Method_animated_11, "animated" }, + { Method_setAnimated_12, "setAnimated" }, + { Method_setVelocity_13, "setVelocity" }, + { Method_setXVelocity_14, "setXVelocity" }, + { Method_setYVelocity_15, "setYVelocity" }, + { Method_xVelocity_16, "xVelocity" }, + { Method_yVelocity_17, "yVelocity" }, + { Method_advance_18, "advance" }, + { Method_collidesWith_19, "collidesWith" }, + { Method_collisions_20, "collisions" }, + { Method_setCanvas_21, "setCanvas" }, + { Method_draw_22, "draw" }, + { Method_show_23, "show" }, + { Method_hide_24, "hide" }, + { Method_setVisible_25, "setVisible" }, + { Method_isVisible_26, "isVisible" }, + { Method_setSelected_27, "setSelected" }, + { Method_isSelected_28, "isSelected" }, + { Method_setEnabled_29, "setEnabled" }, + { Method_isEnabled_30, "isEnabled" }, + { Method_setActive_31, "setActive" }, + { Method_isActive_32, "isActive" }, + { Method_visible_33, "visible" }, + { Method_selected_34, "selected" }, + { Method_enabled_35, "enabled" }, + { Method_active_36, "active" }, + { Method_rtti_37, "rtti" }, + { Method_boundingRect_38, "boundingRect" }, + { Method_boundingRectAdvanced_39, "boundingRectAdvanced" }, + { Method_canvas_40, "canvas" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasItemImp *meth = new QCanvasItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasItem pointer from an Object. + */ +QCanvasItem *QCanvasItemImp::toQCanvasItem( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasItem *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; +/* + if ( !op->inherits("QCanvasItem") ) { + kdDebug() << "Typename of opaque canvas item is " << op->typeName() << endl; + // Check superclasses + return 0; + } +*/ + return op->toNative<QCanvasItem>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasItemImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasItem_1: + return QCanvasItem_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasItemCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasItemImp::QCanvasItem_1( KJS::ExecState *exec, const KJS::List &args ) +{ + +#if 0 // This constructor has been disabled by the XSL template + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasItem object + + QCanvasItem *ret = new QCanvasItem( + + arg0 ); + + +#endif // This constructor has been disabled by the XSL template + return KJS::Object(); + +} + +KJS::Value QCanvasItemImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasItemImp::toQCanvasItem( self ); + /* + if ( !instance ) + { + QString msg = i18n( "QCanvasItemImp was not valid" ); + return throwError(exec, msg,KJS::ReferenceError); + } + */ + + switch( id ) { + + case Method_x_3: + return x_3( exec, self, args ); + break; + + case Method_y_4: + return y_4( exec, self, args ); + break; + + case Method_z_5: + return z_5( exec, self, args ); + break; + + case Method_moveBy_6: + return moveBy_6( exec, self, args ); + break; + + case Method_move_7: + return move_7( exec, self, args ); + break; + + case Method_setX_8: + return setX_8( exec, self, args ); + break; + + case Method_setY_9: + return setY_9( exec, self, args ); + break; + + case Method_setZ_10: + return setZ_10( exec, self, args ); + break; + + case Method_animated_11: + return animated_11( exec, self, args ); + break; + + case Method_setAnimated_12: + return setAnimated_12( exec, self, args ); + break; + + case Method_setVelocity_13: + return setVelocity_13( exec, self, args ); + break; + + case Method_setXVelocity_14: + return setXVelocity_14( exec, self, args ); + break; + + case Method_setYVelocity_15: + return setYVelocity_15( exec, self, args ); + break; + + case Method_xVelocity_16: + return xVelocity_16( exec, self, args ); + break; + + case Method_yVelocity_17: + return yVelocity_17( exec, self, args ); + break; + + case Method_advance_18: + return advance_18( exec, self, args ); + break; + + case Method_collidesWith_19: + return collidesWith_19( exec, self, args ); + break; + + case Method_collisions_20: + return collisions_20( exec, self, args ); + break; + + case Method_setCanvas_21: + return setCanvas_21( exec, self, args ); + break; + + case Method_draw_22: + return draw_22( exec, self, args ); + break; + + case Method_show_23: + return show_23( exec, self, args ); + break; + + case Method_hide_24: + return hide_24( exec, self, args ); + break; + + case Method_setVisible_25: + return setVisible_25( exec, self, args ); + break; + + case Method_isVisible_26: + return isVisible_26( exec, self, args ); + break; + + case Method_setSelected_27: + return setSelected_27( exec, self, args ); + break; + + case Method_isSelected_28: + return isSelected_28( exec, self, args ); + break; + + case Method_setEnabled_29: + return setEnabled_29( exec, self, args ); + break; + + case Method_isEnabled_30: + return isEnabled_30( exec, self, args ); + break; + + case Method_setActive_31: + return setActive_31( exec, self, args ); + break; + + case Method_isActive_32: + return isActive_32( exec, self, args ); + break; + + case Method_visible_33: + return visible_33( exec, self, args ); + break; + + case Method_selected_34: + return selected_34( exec, self, args ); + break; + + case Method_enabled_35: + return enabled_35( exec, self, args ); + break; + + case Method_active_36: + return active_36( exec, self, args ); + break; + + case Method_rtti_37: + return rtti_37( exec, self, args ); + break; + + case Method_boundingRect_38: + return boundingRect_38( exec, self, args ); + break; + + case Method_boundingRectAdvanced_39: + return boundingRectAdvanced_39( exec, self, args ); + break; + + case Method_canvas_40: + return canvas_40( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasItemImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasItemImp::x_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double ret; + ret = instance->x( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::y_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double ret; + ret = instance->y( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::z_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double ret; + ret = instance->z( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::moveBy_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->moveBy( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::move_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->move( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setX_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + instance->setX( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setY_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + instance->setY( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setZ_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + instance->setZ( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::animated_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->animated( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::setAnimated_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setAnimated( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setVelocity_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->setVelocity( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setXVelocity_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + instance->setXVelocity( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setYVelocity_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + instance->setYVelocity( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::xVelocity_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double ret; + ret = instance->xVelocity( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::yVelocity_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double ret; + ret = instance->yVelocity( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::advance_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->advance( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::collidesWith_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::collisions_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->collisions( + arg0 ); + return KJS::Value(); // Returns 'QCanvasItemList' + +} + +KJS::Value QCanvasItemImp::setCanvas_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Value(); + + QCanvas * arg0; // Dummy + + instance->setCanvas( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::draw_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPainter arg0; // TODO (hack for qcanvas) + + instance->draw( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::show_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->show( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::hide_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->hide( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::setVisible_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setVisible( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::isVisible_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isVisible( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::setSelected_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setSelected( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::isSelected_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isSelected( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::setEnabled_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::isEnabled_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::setActive_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setActive( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemImp::isActive_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isActive( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::visible_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->visible( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::selected_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->selected( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::enabled_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->enabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::active_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->active( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasItemImp::rtti_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasItemImp::boundingRect_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->boundingRect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasItemImp::boundingRectAdvanced_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->boundingRectAdvanced( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasItemImp::canvas_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->canvas( ); + return KJS::Value(); // Returns 'QCanvas *' + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasitem_imp.h b/kjsembed/qtbindings/qcanvasitem_imp.h new file mode 100644 index 00000000..5af88785 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasitem_imp.h @@ -0,0 +1,174 @@ + + + +#ifndef KJSEMBED_QCanvasItem_H +#define KJSEMBED_QCanvasItem_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasItem; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasItem methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasItemImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasItem_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_x_3, + Method_y_4, + Method_z_5, + Method_moveBy_6, + Method_move_7, + Method_setX_8, + Method_setY_9, + Method_setZ_10, + Method_animated_11, + Method_setAnimated_12, + Method_setVelocity_13, + Method_setXVelocity_14, + Method_setYVelocity_15, + Method_xVelocity_16, + Method_yVelocity_17, + Method_advance_18, + Method_collidesWith_19, + Method_collisions_20, + Method_setCanvas_21, + Method_draw_22, + Method_show_23, + Method_hide_24, + Method_setVisible_25, + Method_isVisible_26, + Method_setSelected_27, + Method_isSelected_28, + Method_setEnabled_29, + Method_isEnabled_30, + Method_setActive_31, + Method_isActive_32, + Method_visible_33, + Method_selected_34, + Method_enabled_35, + Method_active_36, + Method_rtti_37, + Method_boundingRect_38, + Method_boundingRectAdvanced_39, + Method_canvas_40, + Method_Last = -1 + }; + + QCanvasItemImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasItemImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasItem *toQCanvasItem( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasItem_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value x_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value y_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value z_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value moveBy_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value move_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setX_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setY_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setZ_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value animated_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAnimated_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setVelocity_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setXVelocity_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setYVelocity_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value xVelocity_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value yVelocity_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value advance_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collidesWith_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collisions_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCanvas_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value draw_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value show_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value hide_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setVisible_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isVisible_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelected_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isSelected_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setEnabled_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isEnabled_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setActive_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isActive_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value visible_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value selected_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value enabled_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value active_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value boundingRect_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value boundingRectAdvanced_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value canvas_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasItem *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasItem_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasitemlist_imp.cpp b/kjsembed/qtbindings/qcanvasitemlist_imp.cpp new file mode 100644 index 00000000..293aa5f3 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasitemlist_imp.cpp @@ -0,0 +1,172 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasitemlist_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasItemListImp::QCanvasItemListImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasItemListImp::~QCanvasItemListImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasItemListImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasItemListImp *meth = new QCanvasItemListImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasItemListImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_sort_1, "sort" }, + { Method_drawUnique_2, "drawUnique" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasItemListImp *meth = new QCanvasItemListImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasItemList pointer from an Object. + */ +QCanvasItemList *QCanvasItemListImp::toQCanvasItemList( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasItemList *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasItemList" ) + return 0; + + return op->toNative<QCanvasItemList>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasItemListImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + default: + break; + } + + QString msg = i18n("QCanvasItemListCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasItemListImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasItemListImp::toQCanvasItemList( self ); + + switch( id ) { + + case Method_sort_1: + return sort_1( exec, self, args ); + break; + + case Method_drawUnique_2: + return drawUnique_2( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasItemListImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasItemListImp::sort_1( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->sort( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasItemListImp::drawUnique_2( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPainter arg0; // TODO (hack for qcanvas) + + instance->drawUnique( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasitemlist_imp.h b/kjsembed/qtbindings/qcanvasitemlist_imp.h new file mode 100644 index 00000000..dad12e1a --- /dev/null +++ b/kjsembed/qtbindings/qcanvasitemlist_imp.h @@ -0,0 +1,100 @@ + + + +#ifndef KJSEMBED_QCanvasItemList_H +#define KJSEMBED_QCanvasItemList_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasItemList; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasItemList methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasItemListImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_sort_1, + Method_drawUnique_2, + Method_Last = -1 + }; + + QCanvasItemListImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasItemListImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasItemList *toQCanvasItemList( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + + // + // Methods implemented by this class. + // + + KJS::Value sort_1( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value drawUnique_2( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasItemList *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasItemList_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasline_imp.cpp b/kjsembed/qtbindings/qcanvasline_imp.cpp new file mode 100644 index 00000000..6ddf7c5d --- /dev/null +++ b/kjsembed/qtbindings/qcanvasline_imp.cpp @@ -0,0 +1,270 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasline_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasLineImp::QCanvasLineImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasLineImp::~QCanvasLineImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasLineImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasLineImp *meth = new QCanvasLineImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasLineImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setPoints_3, "setPoints" }, + { Method_startPoint_4, "startPoint" }, + { Method_endPoint_5, "endPoint" }, + { Method_rtti_6, "rtti" }, + { Method_setPen_7, "setPen" }, + { Method_moveBy_8, "moveBy" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasLineImp *meth = new QCanvasLineImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasLine pointer from an Object. + */ +QCanvasLine *QCanvasLineImp::toQCanvasLine( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasLine *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasLine" ) + return 0; + + return op->toNative<QCanvasLine>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasLineImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasLine_1: + return QCanvasLine_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasLineCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasLineImp::QCanvasLine_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasLine object + + QCanvasLine *ret = new QCanvasLine( + + arg0 ); + + +} + +KJS::Value QCanvasLineImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasLineImp::toQCanvasLine( self ); + + switch( id ) { + + case Method_setPoints_3: + return setPoints_3( exec, self, args ); + break; + + case Method_startPoint_4: + return startPoint_4( exec, self, args ); + break; + + case Method_endPoint_5: + return endPoint_5( exec, self, args ); + break; + + case Method_rtti_6: + return rtti_6( exec, self, args ); + break; + + case Method_setPen_7: + return setPen_7( exec, self, args ); + break; + + case Method_moveBy_8: + return moveBy_8( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasLineImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasLineImp::setPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + instance->setPoints( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasLineImp::startPoint_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QPoint ret; + ret = instance->startPoint( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasLineImp::endPoint_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QPoint ret; + ret = instance->endPoint( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasLineImp::rtti_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasLineImp::setPen_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPen + return KJS::Value(); + + QPen arg0; // Dummy + + instance->setPen( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasLineImp::moveBy_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->moveBy( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasline_imp.h b/kjsembed/qtbindings/qcanvasline_imp.h new file mode 100644 index 00000000..5ce51a7e --- /dev/null +++ b/kjsembed/qtbindings/qcanvasline_imp.h @@ -0,0 +1,110 @@ + + + +#ifndef KJSEMBED_QCanvasLine_H +#define KJSEMBED_QCanvasLine_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasLine; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasLine methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasLineImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasLine_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setPoints_3, + Method_startPoint_4, + Method_endPoint_5, + Method_rtti_6, + Method_setPen_7, + Method_moveBy_8, + Method_Last = -1 + }; + + QCanvasLineImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasLineImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasLine *toQCanvasLine( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasLine_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value startPoint_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value endPoint_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setPen_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value moveBy_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasLine *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasLine_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspixmap_imp.cpp b/kjsembed/qtbindings/qcanvaspixmap_imp.cpp new file mode 100644 index 00000000..846f90fc --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspixmap_imp.cpp @@ -0,0 +1,252 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvaspixmap_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasPixmapImp::QCanvasPixmapImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasPixmapImp::~QCanvasPixmapImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasPixmapImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPixmapImp *meth = new QCanvasPixmapImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasPixmapImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_offsetX_5, "offsetX" }, + { Method_offsetY_6, "offsetY" }, + { Method_setOffset_7, "setOffset" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPixmapImp *meth = new QCanvasPixmapImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasPixmap pointer from an Object. + */ +QCanvasPixmap *QCanvasPixmapImp::toQCanvasPixmap( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasPixmap *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasPixmap" ) + return 0; + + return op->toNative<QCanvasPixmap>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasPixmapImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasPixmap_1: + return QCanvasPixmap_1( exec, args ); + break; + + case Constructor_QCanvasPixmap_2: + return QCanvasPixmap_2( exec, args ); + break; + + case Constructor_QCanvasPixmap_3: + return QCanvasPixmap_3( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasPixmapCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasPixmapImp::QCanvasPixmap_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + + // We should now create an instance of the QCanvasPixmap object + + QCanvasPixmap *ret = new QCanvasPixmap( + + arg0 ); + + return KJS::Object(); +} + +KJS::Object QCanvasPixmapImp::QCanvasPixmap_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + QImage arg0 = extractQImage(exec, args, 0); + + + // We should now create an instance of the QCanvasPixmap object + + QCanvasPixmap *ret = new QCanvasPixmap( + + arg0 ); + + return KJS::Object(); + +} + +KJS::Object QCanvasPixmapImp::QCanvasPixmap_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + QPoint arg1 = extractQPoint(exec, args, 1); + + + // We should now create an instance of the QCanvasPixmap object + + QCanvasPixmap *ret = new QCanvasPixmap( + + arg0, + arg1 ); + + return KJS::Object(); + +} + +KJS::Value QCanvasPixmapImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasPixmapImp::toQCanvasPixmap( self ); + + switch( id ) { + + case Method_offsetX_5: + return offsetX_5( exec, self, args ); + break; + + case Method_offsetY_6: + return offsetY_6( exec, self, args ); + break; + + case Method_setOffset_7: + return setOffset_7( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasPixmapImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasPixmapImp::offsetX_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->offsetX( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasPixmapImp::offsetY_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->offsetY( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasPixmapImp::setOffset_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setOffset( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspixmap_imp.h b/kjsembed/qtbindings/qcanvaspixmap_imp.h new file mode 100644 index 00000000..38f8be81 --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspixmap_imp.h @@ -0,0 +1,108 @@ + + + +#ifndef KJSEMBED_QCanvasPixmap_H +#define KJSEMBED_QCanvasPixmap_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasPixmap; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasPixmap methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasPixmapImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasPixmap_1, + Constructor_QCanvasPixmap_2, + Constructor_QCanvasPixmap_3, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_offsetX_5, + Method_offsetY_6, + Method_setOffset_7, + Method_Last = -1 + }; + + QCanvasPixmapImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasPixmapImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasPixmap *toQCanvasPixmap( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasPixmap_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasPixmap_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasPixmap_3( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value offsetX_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value offsetY_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setOffset_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasPixmap *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasPixmap_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspixmaparray_imp.cpp b/kjsembed/qtbindings/qcanvaspixmaparray_imp.cpp new file mode 100644 index 00000000..dbb41a18 --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspixmaparray_imp.cpp @@ -0,0 +1,340 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvaspixmaparray_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasPixmapArrayImp::QCanvasPixmapArrayImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasPixmapArrayImp::~QCanvasPixmapArrayImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasPixmapArrayImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPixmapArrayImp *meth = new QCanvasPixmapArrayImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasPixmapArrayImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_readPixmaps_6, "readPixmaps" }, + { Method_readCollisionMasks_7, "readCollisionMasks" }, + { Method_isValid_9, "isValid" }, + { Method_image_10, "image" }, + { Method_setImage_11, "setImage" }, + { Method_count_12, "count" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPixmapArrayImp *meth = new QCanvasPixmapArrayImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasPixmapArray pointer from an Object. + */ +QCanvasPixmapArray *QCanvasPixmapArrayImp::toQCanvasPixmapArray( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasPixmapArray *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasPixmapArray" ) + return 0; + + return op->toNative<QCanvasPixmapArray>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasPixmapArrayImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasPixmapArray_1: + return QCanvasPixmapArray_1( exec, args ); + break; + + case Constructor_QCanvasPixmapArray_2: + return QCanvasPixmapArray_2( exec, args ); + break; + + case Constructor_QCanvasPixmapArray_3: + return QCanvasPixmapArray_3( exec, args ); + break; + + case Constructor_QCanvasPixmapArray_4: + return QCanvasPixmapArray_4( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasPixmapArrayCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasPixmapArrayImp::QCanvasPixmapArray_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + + // We should now create an instance of the QCanvasPixmapArray object + + QCanvasPixmapArray *ret = new QCanvasPixmapArray( + ); + + return KJS::Object(); +} + +KJS::Object QCanvasPixmapArrayImp::QCanvasPixmapArray_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + + // We should now create an instance of the QCanvasPixmapArray object + + QCanvasPixmapArray *ret = new QCanvasPixmapArray( + + arg0, + arg1 ); + return KJS::Object(); + +} + +KJS::Object QCanvasPixmapArrayImp::QCanvasPixmapArray_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QPtrList< QPixmap > + return KJS::Object(); + + QPtrList< QPixmap > arg0; // Dummy + + // Unsupported parameter QPtrList< QPoint > + return KJS::Object(); + + QPtrList< QPoint > arg1; // Dummy + + + // We should now create an instance of the QCanvasPixmapArray object + + QCanvasPixmapArray *ret = new QCanvasPixmapArray( + + arg0, + arg1 ); + + +} + +KJS::Object QCanvasPixmapArrayImp::QCanvasPixmapArray_4( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QValueList< QPixmap > + return KJS::Object(); + + QValueList< QPixmap > arg0; // Dummy + + // Unsupported parameter QPointArray + return KJS::Object(); + + QPointArray arg1; // Dummy + + + // We should now create an instance of the QCanvasPixmapArray object + + QCanvasPixmapArray *ret = new QCanvasPixmapArray( + + arg0, + arg1 ); + + +} + +KJS::Value QCanvasPixmapArrayImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasPixmapArrayImp::toQCanvasPixmapArray( self ); + + switch( id ) { + + case Method_readPixmaps_6: + return readPixmaps_6( exec, self, args ); + break; + + case Method_readCollisionMasks_7: + return readCollisionMasks_7( exec, self, args ); + break; + + case Method_isValid_9: + return isValid_9( exec, self, args ); + break; + + case Method_image_10: + return image_10( exec, self, args ); + break; + + case Method_setImage_11: + return setImage_11( exec, self, args ); + break; + + case Method_count_12: + return count_12( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasPixmapArrayImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasPixmapArrayImp::readPixmaps_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + bool ret; + ret = instance->readPixmaps( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasPixmapArrayImp::readCollisionMasks_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + bool ret; + ret = instance->readCollisionMasks( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasPixmapArrayImp::isValid_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isValid( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasPixmapArrayImp::image_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->image( + arg0 ); + return KJS::Value(); // Returns 'QCanvasPixmap *' + +} + +KJS::Value QCanvasPixmapArrayImp::setImage_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter QCanvasPixmap * + return KJS::Value(); + + QCanvasPixmap * arg1; // Dummy + + instance->setImage( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasPixmapArrayImp::count_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + uint ret; + ret = instance->count( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspixmaparray_imp.h b/kjsembed/qtbindings/qcanvaspixmaparray_imp.h new file mode 100644 index 00000000..2b37d93a --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspixmaparray_imp.h @@ -0,0 +1,116 @@ + + + +#ifndef KJSEMBED_QCanvasPixmapArray_H +#define KJSEMBED_QCanvasPixmapArray_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasPixmapArray; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasPixmapArray methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasPixmapArrayImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasPixmapArray_1, + Constructor_QCanvasPixmapArray_2, + Constructor_QCanvasPixmapArray_3, + Constructor_QCanvasPixmapArray_4, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_readPixmaps_6, + Method_readCollisionMasks_7, + Method_isValid_9, + Method_image_10, + Method_setImage_11, + Method_count_12, + Method_Last = -1 + }; + + QCanvasPixmapArrayImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasPixmapArrayImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasPixmapArray *toQCanvasPixmapArray( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasPixmapArray_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasPixmapArray_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasPixmapArray_3( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasPixmapArray_4( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value readPixmaps_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value readCollisionMasks_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isValid_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value image_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setImage_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value count_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasPixmapArray *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasPixmapArray_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspolygon_imp.cpp b/kjsembed/qtbindings/qcanvaspolygon_imp.cpp new file mode 100644 index 00000000..d735fd7a --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspolygon_imp.cpp @@ -0,0 +1,243 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvaspolygon_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasPolygonImp::QCanvasPolygonImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasPolygonImp::~QCanvasPolygonImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasPolygonImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPolygonImp *meth = new QCanvasPolygonImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasPolygonImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setPoints_3, "setPoints" }, + { Method_points_4, "points" }, + { Method_moveBy_5, "moveBy" }, + { Method_areaPoints_6, "areaPoints" }, + { Method_rtti_7, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPolygonImp *meth = new QCanvasPolygonImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasPolygon pointer from an Object. + */ +QCanvasPolygon *QCanvasPolygonImp::toQCanvasPolygon( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasPolygon *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasPolygon" ) + return 0; + + return op->toNative<QCanvasPolygon>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasPolygonImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasPolygon_1: + return QCanvasPolygon_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasPolygonCons has no constructor with id '%1',").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasPolygonImp::QCanvasPolygon_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasPolygon object + + QCanvasPolygon *ret = new QCanvasPolygon( + + arg0 ); + + +} + +KJS::Value QCanvasPolygonImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasPolygonImp::toQCanvasPolygon( self ); + + switch( id ) { + + case Method_setPoints_3: + return setPoints_3( exec, self, args ); + break; + + case Method_points_4: + return points_4( exec, self, args ); + break; + + case Method_moveBy_5: + return moveBy_5( exec, self, args ); + break; + + case Method_areaPoints_6: + return areaPoints_6( exec, self, args ); + break; + + case Method_rtti_7: + return rtti_7( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasPolygonImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasPolygonImp::setPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPointArray + return KJS::Value(); + + QPointArray arg0; // Dummy + + instance->setPoints( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasPolygonImp::points_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->points( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasPolygonImp::moveBy_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->moveBy( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasPolygonImp::areaPoints_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->areaPoints( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasPolygonImp::rtti_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspolygon_imp.h b/kjsembed/qtbindings/qcanvaspolygon_imp.h new file mode 100644 index 00000000..0e1e3255 --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspolygon_imp.h @@ -0,0 +1,108 @@ + + + +#ifndef KJSEMBED_QCanvasPolygon_H +#define KJSEMBED_QCanvasPolygon_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasPolygon; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasPolygon methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasPolygonImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasPolygon_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setPoints_3, + Method_points_4, + Method_moveBy_5, + Method_areaPoints_6, + Method_rtti_7, + Method_Last = -1 + }; + + QCanvasPolygonImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasPolygonImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasPolygon *toQCanvasPolygon( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasPolygon_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value points_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value moveBy_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value areaPoints_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasPolygon *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasPolygon_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspolygonalitem_imp.cpp b/kjsembed/qtbindings/qcanvaspolygonalitem_imp.cpp new file mode 100644 index 00000000..325260ba --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspolygonalitem_imp.cpp @@ -0,0 +1,309 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvaspolygonalitem_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasPolygonalItemImp::QCanvasPolygonalItemImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasPolygonalItemImp::~QCanvasPolygonalItemImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasPolygonalItemImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPolygonalItemImp *meth = new QCanvasPolygonalItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasPolygonalItemImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_collidesWith_3, "collidesWith" }, + { Method_setPen_4, "setPen" }, + { Method_setBrush_5, "setBrush" }, + { Method_pen_6, "pen" }, + { Method_brush_7, "brush" }, + { Method_areaPoints_8, "areaPoints" }, + { Method_areaPointsAdvanced_9, "areaPointsAdvanced" }, + { Method_boundingRect_10, "boundingRect" }, + { Method_rtti_11, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasPolygonalItemImp *meth = new QCanvasPolygonalItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasPolygonalItem pointer from an Object. + */ +QCanvasPolygonalItem *QCanvasPolygonalItemImp::toQCanvasPolygonalItem( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasPolygonalItem *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasPolygonalItem" ) + return 0; + + return op->toNative<QCanvasPolygonalItem>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasPolygonalItemImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasPolygonalItem_1: + return QCanvasPolygonalItem_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasPolygonalItemCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasPolygonalItemImp::QCanvasPolygonalItem_1( KJS::ExecState *exec, const KJS::List &args ) +{ + +#if 0 // This constructor has been disabled by the XSL template + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasPolygonalItem object + + QCanvasPolygonalItem *ret = new QCanvasPolygonalItem( + + arg0 ); + + +#endif // This constructor has been disabled by the XSL template + return KJS::Object(); +} + +KJS::Value QCanvasPolygonalItemImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasPolygonalItemImp::toQCanvasPolygonalItem( self ); + + switch( id ) { + + case Method_collidesWith_3: + return collidesWith_3( exec, self, args ); + break; + + case Method_setPen_4: + return setPen_4( exec, self, args ); + break; + + case Method_setBrush_5: + return setBrush_5( exec, self, args ); + break; + + case Method_pen_6: + return pen_6( exec, self, args ); + break; + + case Method_brush_7: + return brush_7( exec, self, args ); + break; + + case Method_areaPoints_8: + return areaPoints_8( exec, self, args ); + break; + + case Method_areaPointsAdvanced_9: + return areaPointsAdvanced_9( exec, self, args ); + break; + + case Method_boundingRect_10: + return boundingRect_10( exec, self, args ); + break; + + case Method_rtti_11: + return rtti_11( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasPolygonalItemImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasPolygonalItemImp::collidesWith_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasPolygonalItemImp::setPen_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPen + return KJS::Value(); + + QPen arg0; // Dummy + + instance->setPen( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasPolygonalItemImp::setBrush_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QBrush + return KJS::Value(); + + QBrush arg0; // Dummy + + instance->setBrush( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasPolygonalItemImp::pen_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QPen ret; + ret = instance->pen( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasPolygonalItemImp::brush_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QBrush ret; + ret = instance->brush( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasPolygonalItemImp::areaPoints_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->areaPoints( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasPolygonalItemImp::areaPointsAdvanced_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->areaPointsAdvanced( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasPolygonalItemImp::boundingRect_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->boundingRect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasPolygonalItemImp::rtti_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvaspolygonalitem_imp.h b/kjsembed/qtbindings/qcanvaspolygonalitem_imp.h new file mode 100644 index 00000000..fabda144 --- /dev/null +++ b/kjsembed/qtbindings/qcanvaspolygonalitem_imp.h @@ -0,0 +1,116 @@ + + + +#ifndef KJSEMBED_QCanvasPolygonalItem_H +#define KJSEMBED_QCanvasPolygonalItem_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasPolygonalItem; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasPolygonalItem methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasPolygonalItemImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasPolygonalItem_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_collidesWith_3, + Method_setPen_4, + Method_setBrush_5, + Method_pen_6, + Method_brush_7, + Method_areaPoints_8, + Method_areaPointsAdvanced_9, + Method_boundingRect_10, + Method_rtti_11, + Method_Last = -1 + }; + + QCanvasPolygonalItemImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasPolygonalItemImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasPolygonalItem *toQCanvasPolygonalItem( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasPolygonalItem_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value collidesWith_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setPen_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setBrush_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value pen_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value brush_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value areaPoints_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value areaPointsAdvanced_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value boundingRect_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasPolygonalItem *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasPolygonalItem_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasrectangle_imp.cpp b/kjsembed/qtbindings/qcanvasrectangle_imp.cpp new file mode 100644 index 00000000..809d571b --- /dev/null +++ b/kjsembed/qtbindings/qcanvasrectangle_imp.cpp @@ -0,0 +1,346 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasrectangle_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasRectangleImp::QCanvasRectangleImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasRectangleImp::~QCanvasRectangleImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasRectangleImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasRectangleImp *meth = new QCanvasRectangleImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasRectangleImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_width_5, "width" }, + { Method_height_6, "height" }, + { Method_setSize_7, "setSize" }, + { Method_size_8, "size" }, + { Method_areaPoints_9, "areaPoints" }, + { Method_rect_10, "rect" }, + { Method_collidesWith_11, "collidesWith" }, + { Method_rtti_12, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasRectangleImp *meth = new QCanvasRectangleImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasRectangle pointer from an Object. + */ +QCanvasRectangle *QCanvasRectangleImp::toQCanvasRectangle( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasRectangle *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasRectangle" ) + return 0; + + return op->toNative<QCanvasRectangle>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasRectangleImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasRectangle_1: + return QCanvasRectangle_1( exec, args ); + break; + + case Constructor_QCanvasRectangle_2: + return QCanvasRectangle_2( exec, args ); + break; + + case Constructor_QCanvasRectangle_3: + return QCanvasRectangle_3( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasRectangleCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasRectangleImp::QCanvasRectangle_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasRectangle object + + QCanvasRectangle *ret = new QCanvasRectangle( + + arg0 ); + + +} + +KJS::Object QCanvasRectangleImp::QCanvasRectangle_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + QRect arg0 = extractQRect(exec, args, 0); + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg1; // Dummy + + + // We should now create an instance of the QCanvasRectangle object + + QCanvasRectangle *ret = new QCanvasRectangle( + + arg0, + arg1 ); + + +} + +KJS::Object QCanvasRectangleImp::QCanvasRectangle_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg4; // Dummy + + + // We should now create an instance of the QCanvasRectangle object + + QCanvasRectangle *ret = new QCanvasRectangle( + + arg0, + arg1, + arg2, + arg3, + arg4 ); + + +} + +KJS::Value QCanvasRectangleImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasRectangleImp::toQCanvasRectangle( self ); + + switch( id ) { + + case Method_width_5: + return width_5( exec, self, args ); + break; + + case Method_height_6: + return height_6( exec, self, args ); + break; + + case Method_setSize_7: + return setSize_7( exec, self, args ); + break; + + case Method_size_8: + return size_8( exec, self, args ); + break; + + case Method_areaPoints_9: + return areaPoints_9( exec, self, args ); + break; + + case Method_rect_10: + return rect_10( exec, self, args ); + break; + + case Method_collidesWith_11: + return collidesWith_11( exec, self, args ); + break; + + case Method_rtti_12: + return rtti_12( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasRectangleImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasRectangleImp::width_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->width( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasRectangleImp::height_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->height( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasRectangleImp::setSize_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setSize( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasRectangleImp::size_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QSize ret; + ret = instance->size( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasRectangleImp::areaPoints_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->areaPoints( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasRectangleImp::rect_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->rect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasRectangleImp::collidesWith_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasRectangleImp::rtti_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasrectangle_imp.h b/kjsembed/qtbindings/qcanvasrectangle_imp.h new file mode 100644 index 00000000..0ba72f37 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasrectangle_imp.h @@ -0,0 +1,118 @@ + + + +#ifndef KJSEMBED_QCanvasRectangle_H +#define KJSEMBED_QCanvasRectangle_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasRectangle; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasRectangle methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasRectangleImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasRectangle_1, + Constructor_QCanvasRectangle_2, + Constructor_QCanvasRectangle_3, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_width_5, + Method_height_6, + Method_setSize_7, + Method_size_8, + Method_areaPoints_9, + Method_rect_10, + Method_collidesWith_11, + Method_rtti_12, + Method_Last = -1 + }; + + QCanvasRectangleImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasRectangleImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasRectangle *toQCanvasRectangle( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasRectangle_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasRectangle_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasRectangle_3( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value width_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value height_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSize_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value size_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value areaPoints_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rect_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collidesWith_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasRectangle *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasRectangle_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasspline_imp.cpp b/kjsembed/qtbindings/qcanvasspline_imp.cpp new file mode 100644 index 00000000..57ea74b1 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasspline_imp.cpp @@ -0,0 +1,228 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasspline_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasSplineImp::QCanvasSplineImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasSplineImp::~QCanvasSplineImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasSplineImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasSplineImp *meth = new QCanvasSplineImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasSplineImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setControlPoints_3, "setControlPoints" }, + { Method_controlPoints_4, "controlPoints" }, + { Method_closed_5, "closed" }, + { Method_rtti_6, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasSplineImp *meth = new QCanvasSplineImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasSpline pointer from an Object. + */ +QCanvasSpline *QCanvasSplineImp::toQCanvasSpline( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasSpline *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasSpline" ) + return 0; + + return op->toNative<QCanvasSpline>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasSplineImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasSpline_1: + return QCanvasSpline_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasSplineCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasSplineImp::QCanvasSpline_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasSpline object + + QCanvasSpline *ret = new QCanvasSpline( + + arg0 ); + + +} + +KJS::Value QCanvasSplineImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasSplineImp::toQCanvasSpline( self ); + + switch( id ) { + + case Method_setControlPoints_3: + return setControlPoints_3( exec, self, args ); + break; + + case Method_controlPoints_4: + return controlPoints_4( exec, self, args ); + break; + + case Method_closed_5: + return closed_5( exec, self, args ); + break; + + case Method_rtti_6: + return rtti_6( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasSplineImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasSplineImp::setControlPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPointArray + return KJS::Value(); + + QPointArray arg0; // Dummy + + bool arg1 = extractBool(exec, args, 1); + + instance->setControlPoints( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSplineImp::controlPoints_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->controlPoints( ); + return KJS::Value(); // Returns 'QPointArray' + +} + +KJS::Value QCanvasSplineImp::closed_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->closed( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasSplineImp::rtti_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasspline_imp.h b/kjsembed/qtbindings/qcanvasspline_imp.h new file mode 100644 index 00000000..dc4d4ed8 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasspline_imp.h @@ -0,0 +1,106 @@ + + + +#ifndef KJSEMBED_QCanvasSpline_H +#define KJSEMBED_QCanvasSpline_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasSpline; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasSpline methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasSplineImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasSpline_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setControlPoints_3, + Method_controlPoints_4, + Method_closed_5, + Method_rtti_6, + Method_Last = -1 + }; + + QCanvasSplineImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasSplineImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasSpline *toQCanvasSpline( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasSpline_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setControlPoints_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value controlPoints_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value closed_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasSpline *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasSpline_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvassprite_imp.cpp b/kjsembed/qtbindings/qcanvassprite_imp.cpp new file mode 100644 index 00000000..6268e75c --- /dev/null +++ b/kjsembed/qtbindings/qcanvassprite_imp.cpp @@ -0,0 +1,593 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvassprite_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasSpriteImp::QCanvasSpriteImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasSpriteImp::~QCanvasSpriteImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasSpriteImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasSpriteImp *meth = new QCanvasSpriteImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum FrameAnimationType + { "Cycle", QCanvasSprite::Cycle }, + { "Oscillate", QCanvasSprite::Oscillate }, + { 0, 0 } + }; + + int enumidx = 0; + while( enums[enumidx].id ) { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasSpriteImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setSequence_2, "setSequence" }, + { Method_move_4, "move" }, + { Method_move_5, "move" }, + { Method_setFrame_6, "setFrame" }, + { Method_setFrameAnimation_7, "setFrameAnimation" }, + { Method_frame_8, "frame" }, + { Method_frameCount_9, "frameCount" }, + { Method_rtti_10, "rtti" }, + { Method_collidesWith_11, "collidesWith" }, + { Method_boundingRect_12, "boundingRect" }, + { Method_width_13, "width" }, + { Method_height_14, "height" }, + { Method_leftEdge_15, "leftEdge" }, + { Method_topEdge_16, "topEdge" }, + { Method_rightEdge_17, "rightEdge" }, + { Method_bottomEdge_18, "bottomEdge" }, + { Method_leftEdge_19, "leftEdge" }, + { Method_topEdge_20, "topEdge" }, + { Method_rightEdge_21, "rightEdge" }, + { Method_bottomEdge_22, "bottomEdge" }, + { Method_image_23, "image" }, + { Method_imageAdvanced_24, "imageAdvanced" }, + { Method_image_25, "image" }, + { Method_advance_26, "advance" }, + { Method_draw_27, "draw" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasSpriteImp *meth = new QCanvasSpriteImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasSprite pointer from an Object. + */ +QCanvasSprite *QCanvasSpriteImp::toQCanvasSprite( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasSprite *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasSprite" ) + return 0; + + return op->toNative<QCanvasSprite>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasSpriteImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasSprite_1: + return QCanvasSprite_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasSpriteCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasSpriteImp::QCanvasSprite_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasPixmapArray * + return KJS::Object(); + + QCanvasPixmapArray * arg0; // Dummy + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg1; // Dummy + + + // We should now create an instance of the QCanvasSprite object + + QCanvasSprite *ret = new QCanvasSprite( + + arg0, + arg1 ); + + +} + +KJS::Value QCanvasSpriteImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasSpriteImp::toQCanvasSprite( self ); + + switch( id ) { + + case Method_setSequence_2: + return setSequence_2( exec, self, args ); + break; + + case Method_move_4: + return move_4( exec, self, args ); + break; + + case Method_move_5: + return move_5( exec, self, args ); + break; + + case Method_setFrame_6: + return setFrame_6( exec, self, args ); + break; + + case Method_setFrameAnimation_7: + return setFrameAnimation_7( exec, self, args ); + break; + + case Method_frame_8: + return frame_8( exec, self, args ); + break; + + case Method_frameCount_9: + return frameCount_9( exec, self, args ); + break; + + case Method_rtti_10: + return rtti_10( exec, self, args ); + break; + + case Method_collidesWith_11: + return collidesWith_11( exec, self, args ); + break; + + case Method_boundingRect_12: + return boundingRect_12( exec, self, args ); + break; + + case Method_width_13: + return width_13( exec, self, args ); + break; + + case Method_height_14: + return height_14( exec, self, args ); + break; + + case Method_leftEdge_15: + return leftEdge_15( exec, self, args ); + break; + + case Method_topEdge_16: + return topEdge_16( exec, self, args ); + break; + + case Method_rightEdge_17: + return rightEdge_17( exec, self, args ); + break; + + case Method_bottomEdge_18: + return bottomEdge_18( exec, self, args ); + break; + + case Method_leftEdge_19: + return leftEdge_19( exec, self, args ); + break; + + case Method_topEdge_20: + return topEdge_20( exec, self, args ); + break; + + case Method_rightEdge_21: + return rightEdge_21( exec, self, args ); + break; + + case Method_bottomEdge_22: + return bottomEdge_22( exec, self, args ); + break; + + case Method_image_23: + return image_23( exec, self, args ); + break; + + case Method_imageAdvanced_24: + return imageAdvanced_24( exec, self, args ); + break; + + case Method_image_25: + return image_25( exec, self, args ); + break; + + case Method_advance_26: + return advance_26( exec, self, args ); + break; + + case Method_draw_27: + return draw_27( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasSpriteImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasSpriteImp::setSequence_2( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvasPixmapArray * + return KJS::Value(); + + QCanvasPixmapArray * arg0; // Dummy + + instance->setSequence( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::move_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->move( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::move_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->move( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::setFrame_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setFrame( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::setFrameAnimation_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QCanvasSprite::FrameAnimationType arg0 = QCanvasSprite::Cycle; // TODO (hack for QCanvasSprite) + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->setFrameAnimation( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::frame_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->frame( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::frameCount_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->frameCount( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::rtti_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::collidesWith_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasSpriteImp::boundingRect_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->boundingRect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasSpriteImp::width_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->width( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::height_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->height( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::leftEdge_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->leftEdge( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::topEdge_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->topEdge( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::rightEdge_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rightEdge( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::bottomEdge_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->bottomEdge( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::leftEdge_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->leftEdge( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::topEdge_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->topEdge( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::rightEdge_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->rightEdge( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::bottomEdge_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->bottomEdge( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasSpriteImp::image_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->image( ); + return KJS::Value(); // Returns 'QCanvasPixmap *' + +} + +KJS::Value QCanvasSpriteImp::imageAdvanced_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->imageAdvanced( ); + return KJS::Value(); // Returns 'QCanvasPixmap *' + +} + +KJS::Value QCanvasSpriteImp::image_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->image( + arg0 ); + return KJS::Value(); // Returns 'QCanvasPixmap *' + +} + +KJS::Value QCanvasSpriteImp::advance_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->advance( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasSpriteImp::draw_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPainter arg0; // TODO (hack for qcanvas) + + instance->draw( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvassprite_imp.h b/kjsembed/qtbindings/qcanvassprite_imp.h new file mode 100644 index 00000000..5f597077 --- /dev/null +++ b/kjsembed/qtbindings/qcanvassprite_imp.h @@ -0,0 +1,148 @@ + + + +#ifndef KJSEMBED_QCanvasSprite_H +#define KJSEMBED_QCanvasSprite_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasSprite; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasSprite methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasSpriteImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasSprite_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setSequence_2, + Method_move_4, + Method_move_5, + Method_setFrame_6, + Method_setFrameAnimation_7, + Method_frame_8, + Method_frameCount_9, + Method_rtti_10, + Method_collidesWith_11, + Method_boundingRect_12, + Method_width_13, + Method_height_14, + Method_leftEdge_15, + Method_topEdge_16, + Method_rightEdge_17, + Method_bottomEdge_18, + Method_leftEdge_19, + Method_topEdge_20, + Method_rightEdge_21, + Method_bottomEdge_22, + Method_image_23, + Method_imageAdvanced_24, + Method_image_25, + Method_advance_26, + Method_draw_27, + Method_Last = -1 + }; + + QCanvasSpriteImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasSpriteImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasSprite *toQCanvasSprite( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasSprite_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setSequence_2( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value move_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value move_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFrame_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFrameAnimation_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value frame_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value frameCount_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collidesWith_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value boundingRect_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value width_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value height_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value leftEdge_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value topEdge_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rightEdge_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value bottomEdge_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value leftEdge_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value topEdge_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rightEdge_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value bottomEdge_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value image_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value imageAdvanced_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value image_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value advance_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value draw_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasSprite *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasSprite_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvastext_imp.cpp b/kjsembed/qtbindings/qcanvastext_imp.cpp new file mode 100644 index 00000000..84548eea --- /dev/null +++ b/kjsembed/qtbindings/qcanvastext_imp.cpp @@ -0,0 +1,406 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvastext_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasTextImp::QCanvasTextImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasTextImp::~QCanvasTextImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasTextImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasTextImp *meth = new QCanvasTextImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasTextImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_setText_5, "setText" }, + { Method_setFont_6, "setFont" }, + { Method_setColor_7, "setColor" }, + { Method_text_8, "text" }, + { Method_font_9, "font" }, + { Method_color_10, "color" }, + { Method_moveBy_11, "moveBy" }, + { Method_textFlags_12, "textFlags" }, + { Method_setTextFlags_13, "setTextFlags" }, + { Method_boundingRect_14, "boundingRect" }, + { Method_collidesWith_15, "collidesWith" }, + { Method_rtti_16, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasTextImp *meth = new QCanvasTextImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasText pointer from an Object. + */ +QCanvasText *QCanvasTextImp::toQCanvasText( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasText *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasText" ) + return 0; + + return op->toNative<QCanvasText>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasTextImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasText_1: + return QCanvasText_1( exec, args ); + break; + + case Constructor_QCanvasText_2: + return QCanvasText_2( exec, args ); + break; + + case Constructor_QCanvasText_3: + return QCanvasText_3( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasTextCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasTextImp::QCanvasText_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg0; // Dummy + + + // We should now create an instance of the QCanvasText object + + QCanvasText *ret = new QCanvasText( + + arg0 ); + + +} + +KJS::Object QCanvasTextImp::QCanvasText_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg1; // Dummy + + + // We should now create an instance of the QCanvasText object + + QCanvasText *ret = new QCanvasText( + + arg0, + arg1 ); + + +} + +KJS::Object QCanvasTextImp::QCanvasText_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + // Unsupported parameter QFont + return KJS::Object(); + + QFont arg1; // Dummy + + // Unsupported parameter QCanvas * + return KJS::Object(); + + QCanvas * arg2; // Dummy + + + // We should now create an instance of the QCanvasText object + + QCanvasText *ret = new QCanvasText( + + arg0, + arg1, + arg2 ); + + +} + +KJS::Value QCanvasTextImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasTextImp::toQCanvasText( self ); + + switch( id ) { + + case Method_setText_5: + return setText_5( exec, self, args ); + break; + + case Method_setFont_6: + return setFont_6( exec, self, args ); + break; + + case Method_setColor_7: + return setColor_7( exec, self, args ); + break; + + case Method_text_8: + return text_8( exec, self, args ); + break; + + case Method_font_9: + return font_9( exec, self, args ); + break; + + case Method_color_10: + return color_10( exec, self, args ); + break; + + case Method_moveBy_11: + return moveBy_11( exec, self, args ); + break; + + case Method_textFlags_12: + return textFlags_12( exec, self, args ); + break; + + case Method_setTextFlags_13: + return setTextFlags_13( exec, self, args ); + break; + + case Method_boundingRect_14: + return boundingRect_14( exec, self, args ); + break; + + case Method_collidesWith_15: + return collidesWith_15( exec, self, args ); + break; + + case Method_rtti_16: + return rtti_16( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasTextImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasTextImp::setText_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + instance->setText( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasTextImp::setFont_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QFont arg0 = extractQFont(exec, args, 0); + + instance->setFont( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasTextImp::setColor_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QColor arg0 = extractQColor(exec, args, 0); + + instance->setColor( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasTextImp::text_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString ret; + ret = instance->text( ); + return KJS::String( ret ); + +} + +KJS::Value QCanvasTextImp::font_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->font( ); + return KJS::Value(); // Returns 'QFont' + +} + +KJS::Value QCanvasTextImp::color_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->color( ); + return KJS::Value(); // Returns 'QColor' + +} + +KJS::Value QCanvasTextImp::moveBy_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + double arg0 = extractDouble(exec, args, 0); + + double arg1 = extractDouble(exec, args, 1); + + instance->moveBy( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasTextImp::textFlags_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->textFlags( ); + return KJS::Number( ret ); + +} + +KJS::Value QCanvasTextImp::setTextFlags_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setTextFlags( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasTextImp::boundingRect_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QRect ret; + ret = instance->boundingRect( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QCanvasTextImp::collidesWith_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QCanvasItem * + return KJS::Value(); + + const QCanvasItem * arg0; // Dummy + + bool ret; + ret = instance->collidesWith( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCanvasTextImp::rtti_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvastext_imp.h b/kjsembed/qtbindings/qcanvastext_imp.h new file mode 100644 index 00000000..56fa2b6a --- /dev/null +++ b/kjsembed/qtbindings/qcanvastext_imp.h @@ -0,0 +1,126 @@ + + + +#ifndef KJSEMBED_QCanvasText_H +#define KJSEMBED_QCanvasText_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasText; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasText methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasTextImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasText_1, + Constructor_QCanvasText_2, + Constructor_QCanvasText_3, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_setText_5, + Method_setFont_6, + Method_setColor_7, + Method_text_8, + Method_font_9, + Method_color_10, + Method_moveBy_11, + Method_textFlags_12, + Method_setTextFlags_13, + Method_boundingRect_14, + Method_collidesWith_15, + Method_rtti_16, + Method_Last = -1 + }; + + QCanvasTextImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasTextImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasText *toQCanvasText( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasText_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasText_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasText_3( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value setText_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFont_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColor_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value font_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value color_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value moveBy_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value textFlags_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setTextFlags_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value boundingRect_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value collidesWith_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasText *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasText_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasview_imp.cpp b/kjsembed/qtbindings/qcanvasview_imp.cpp new file mode 100644 index 00000000..f51e7f0c --- /dev/null +++ b/kjsembed/qtbindings/qcanvasview_imp.cpp @@ -0,0 +1,276 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcanvas.h> +#include "qcanvasview_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QCanvasViewImp::QCanvasViewImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCanvasViewImp::~QCanvasViewImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QCanvasViewImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasViewImp *meth = new QCanvasViewImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QCanvasViewImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_canvas_4, "canvas" }, + { Method_setCanvas_5, "setCanvas" }, + { Method_worldMatrix_6, "worldMatrix" }, + { Method_inverseWorldMatrix_7, "inverseWorldMatrix" }, + { Method_setWorldMatrix_8, "setWorldMatrix" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QCanvasViewImp *meth = new QCanvasViewImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QCanvasView pointer from an Object. + */ +QCanvasView *QCanvasViewImp::toQCanvasView( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCanvasView *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QCanvasView" ) + return 0; + + return op->toNative<QCanvasView>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QCanvasViewImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCanvasView_1: + return QCanvasView_1( exec, args ); + break; + + case Constructor_QCanvasView_2: + return QCanvasView_2( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCanvasViewCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCanvasViewImp::QCanvasView_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + QWidget *arg0 = extractQWidget(exec, args, 0); + + + const char *arg1 = (args.size() >= 2) ? args[1].toString(exec).ascii() : 0; + + Qt::WFlags arg2 = 0; // TODO (hack for QCanvasView) + + + // We should now create an instance of the QCanvasView object + + QCanvasView *ret = new QCanvasView( + + arg0, + arg1, + arg2 ); + + JSOpaqueProxy *prx = new JSOpaqueProxy( ret, "QCanvasView"); + return KJS::Object( prx ); +} + +KJS::Object QCanvasViewImp::QCanvasView_2( KJS::ExecState *exec, const KJS::List &args ) +{ + QCanvas * arg0 = 0L;; + + KJS::Object obj = args[0].toObject(exec); + JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); + if ( proxy ) arg0 = dynamic_cast<QCanvas *>( proxy->widget() ); + + QWidget * arg1 = extractQWidget(exec, args, 1); + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + Qt::WFlags arg3 = 0; // TODO (hack for QCanvasView) + + + // We should now create an instance of the QCanvasView object + + QCanvasView *ret = new QCanvasView( + arg0, + arg1, + arg2, + arg3 ); + + JSOpaqueProxy *prx = new JSOpaqueProxy( ret, "QCanvasView"); + return KJS::Object( prx ); +} + +KJS::Value QCanvasViewImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCanvasViewImp::toQCanvasView( self ); + + switch( id ) { + + case Method_canvas_4: + return canvas_4( exec, self, args ); + break; + + case Method_setCanvas_5: + return setCanvas_5( exec, self, args ); + break; + + case Method_worldMatrix_6: + return worldMatrix_6( exec, self, args ); + break; + + case Method_inverseWorldMatrix_7: + return inverseWorldMatrix_7( exec, self, args ); + break; + + case Method_setWorldMatrix_8: + return setWorldMatrix_8( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCanvasViewImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCanvasViewImp::canvas_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->canvas( ); + return KJS::Value(); // Returns 'QCanvas *' + +} + +KJS::Value QCanvasViewImp::setCanvas_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCanvas * + return KJS::Value(); + + QCanvas * arg0; // Dummy + + instance->setCanvas( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCanvasViewImp::worldMatrix_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->worldMatrix( ); + return KJS::Value(); // Returns 'const QWMatrix &' + +} + +KJS::Value QCanvasViewImp::inverseWorldMatrix_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->inverseWorldMatrix( ); + return KJS::Value(); // Returns 'const QWMatrix &' + +} + +KJS::Value QCanvasViewImp::setWorldMatrix_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QWMatrix arg0; // TODO (hack for qcanvasview) + + bool ret; + ret = instance->setWorldMatrix( + arg0 ); + return KJS::Boolean( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcanvasview_imp.h b/kjsembed/qtbindings/qcanvasview_imp.h new file mode 100644 index 00000000..59024535 --- /dev/null +++ b/kjsembed/qtbindings/qcanvasview_imp.h @@ -0,0 +1,110 @@ + + + +#ifndef KJSEMBED_QCanvasView_H +#define KJSEMBED_QCanvasView_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QCanvasView; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QCanvasView methods. + * + * @author Richard Moore, [email protected] + */ +class QCanvasViewImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCanvasView_1, + Constructor_QCanvasView_2, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_canvas_4, + Method_setCanvas_5, + Method_worldMatrix_6, + Method_inverseWorldMatrix_7, + Method_setWorldMatrix_8, + Method_Last = -1 + }; + + QCanvasViewImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCanvasViewImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCanvasView *toQCanvasView( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCanvasView_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCanvasView_2( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value canvas_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCanvas_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value worldMatrix_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value inverseWorldMatrix_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setWorldMatrix_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCanvasView *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCanvasView_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qchecklistitem_imp.cpp b/kjsembed/qtbindings/qchecklistitem_imp.cpp new file mode 100644 index 00000000..afa32dab --- /dev/null +++ b/kjsembed/qtbindings/qchecklistitem_imp.cpp @@ -0,0 +1,587 @@ + + + +#include <qcstring.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qlistview.h> +#include "qchecklistitem_imp.h" +#include "qlistviewitem_imp.h" +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { +namespace Bindings { + + KJS::Object QCheckListItemLoader::createBinding(KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const + { + if ( args.size() == 0 ) { + // FALL THRU + } else { + JSOpaqueProxy * arg0 = JSProxy::toOpaqueProxy( args[ 0 ].imp() ); + QString arg1 = ( args.size() >= 2 ) ? args[ 1 ].toString( exec ).qstring() : QString::null; + JSOpaqueProxy *prx = 0; + + if ( arg0 ) { + if ( arg0->typeName() == "QListViewItem" ) { + QListViewItem * parent = arg0->toNative<QListViewItem>(); + prx = new JSOpaqueProxy( new QCheckListItem( parent, arg1 ), "QCheckListItem" ); + } else { + return KJS::Object(); + } + } else { + JSObjectProxy *arg0 = JSProxy::toObjectProxy( args[ 0 ].imp() ); + if ( arg0 ) { + QListView * parent = ( QListView * ) ( arg0->widget() ); + prx = new JSOpaqueProxy( new QCheckListItem( parent, arg1 ), "QCheckListItem" ); + } else { + return KJS::Object(); + } + } + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(jspart, exec, proxyObj ); + return proxyObj; + } + return KJS::Object(); + } + void QCheckListItemLoader::addBindings( KJSEmbedPart *jspart, KJS::ExecState *exec, KJS::Object &proxy ) const + { + QListViewItemImp::addBindings( exec, proxy ); + QCheckListItemImp::addBindings( exec, proxy ); + } + +} +QCheckListItemImp::QCheckListItemImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QCheckListItemImp::~QCheckListItemImp() +{ +} + +void QCheckListItemImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_paintCell_10, "paintCell" }, + { Method_paintFocus_11, "paintFocus" }, + { Method_width_12, "width" }, + { Method_setup_13, "setup" }, + { Method_setOn_14, "setOn" }, + { Method_isOn_15, "isOn" }, + { Method_type_16, "type" }, + { Method_text_17, "text" }, + { Method_text_18, "text" }, + { Method_setTristate_19, "setTristate" }, + { Method_isTristate_20, "isTristate" }, + { Method_state_21, "state" }, + { Method_setState_22, "setState" }, + { Method_rtti_23, "rtti" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].id ) { + if ( lastName != methods[idx].name ) { + QCheckListItemImp *meth = new QCheckListItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum Type + { "RadioButton", QCheckListItem::RadioButton }, + { "CheckBox", QCheckListItem::CheckBox }, + { "Controller", QCheckListItem::Controller }, + { "RadioButtonController", QCheckListItem::RadioButtonController }, + { "CheckBoxController", QCheckListItem::CheckBoxController }, + // enum ToggleState + { "Off", QCheckListItem::Off }, + { "NoChange", QCheckListItem::NoChange }, + { "On", QCheckListItem::On }, + { 0, 0 } + }; + + int enumidx = 0; + do { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } while( enums[enumidx].id ); + +} + +QCheckListItem *QCheckListItemImp::toQCheckListItem( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QCheckListItem *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + return op->toNative<QCheckListItem>(); +} + + +KJS::Object QCheckListItemImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QCheckListItem_1: + return QCheckListItem_1( exec, args ); + break; + + case Constructor_QCheckListItem_2: + return QCheckListItem_2( exec, args ); + break; + + case Constructor_QCheckListItem_3: + return QCheckListItem_3( exec, args ); + break; + + case Constructor_QCheckListItem_4: + return QCheckListItem_4( exec, args ); + break; + + case Constructor_QCheckListItem_5: + return QCheckListItem_5( exec, args ); + break; + + case Constructor_QCheckListItem_6: + return QCheckListItem_6( exec, args ); + break; + + case Constructor_QCheckListItem_7: + return QCheckListItem_7( exec, args ); + break; + + case Constructor_QCheckListItem_8: + return QCheckListItem_8( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QCheckListItemCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QCheckListItemImp::QCheckListItem_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + QWidget *arg0 = extractQWidget(exec,args,0); + + QWidget *arg1 = extractQWidget(exec,args,1); + + QWidget *arg2 = extractQWidget(exec,args,2); + + return KJS::Object( ); +} + +KJS::Object QCheckListItemImp::QCheckListItem_2( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg3 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_3( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_4( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg3 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_5( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_6( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg3 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_7( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Object QCheckListItemImp::QCheckListItem_8( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg1 = extractQWidget(exec,args,0); + + // TODO + QWidget *arg2 = extractQWidget(exec,args,0); + return KJS::Object(); + +} + +KJS::Value QCheckListItemImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QCheckListItemImp::toQCheckListItem( self ); + + switch( id ) { + + case Method_paintCell_10: + return paintCell_10( exec, self, args ); + break; + + case Method_paintFocus_11: + return paintFocus_11( exec, self, args ); + break; + + case Method_width_12: + return width_12( exec, self, args ); + break; + + case Method_setup_13: + return setup_13( exec, self, args ); + break; + + case Method_setOn_14: + return setOn_14( exec, self, args ); + break; + + case Method_isOn_15: + return isOn_15( exec, self, args ); + break; + + case Method_type_16: + return type_16( exec, self, args ); + break; + + case Method_text_17: + return text_17( exec, self, args ); + break; + + case Method_text_18: + return text_18( exec, self, args ); + break; + + case Method_setTristate_19: + return setTristate_19( exec, self, args ); + break; + + case Method_isTristate_20: + return isTristate_20( exec, self, args ); + break; + + case Method_state_21: + return state_21( exec, self, args ); + break; + + case Method_setState_22: + return setState_22( exec, self, args ); + break; + + case Method_rtti_23: + return rtti_23( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QCheckListItemImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QCheckListItemImp::paintCell_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg0; // Dummy + + // Unsupported parameter const QColorGroup & + return KJS::Value(); +#if 0 + const QColorGroup & arg1; // Dummy + + int arg2 = (args.size() >= 3) ? args[2].toInteger(exec) : -1; + + int arg3 = (args.size() >= 4) ? args[3].toInteger(exec) : -1; + + int arg4 = (args.size() >= 5) ? args[4].toInteger(exec) : -1; + + instance->paintCell( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Value(); // Returns void +#endif +} + +KJS::Value QCheckListItemImp::paintFocus_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPainter * + return KJS::Value(); +#if 0 + QPainter * arg0; // Dummy + + // Unsupported parameter const QColorGroup & + return KJS::Value(); + + const QColorGroup & arg1; // Dummy + + QRect arg2 = extractQRect(exec, args, 2); + + instance->paintFocus( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void +#endif +} + +KJS::Value QCheckListItemImp::width_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QFontMetrics & + return KJS::Value(); +#if 0 + const QFontMetrics & arg0; // Dummy + + // Unsupported parameter const QListView * + return KJS::Value(); + + const QListView * arg1; // Dummy + + int arg2 = (args.size() >= 3) ? args[2].toInteger(exec) : -1; + + int ret; + ret = instance->width( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); +#endif +} + +KJS::Value QCheckListItemImp::setup_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->setup( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCheckListItemImp::setOn_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setOn( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCheckListItemImp::isOn_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isOn( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCheckListItemImp::type_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->type( ); + return KJS::Value(); // Returns 'Type' + +} + +KJS::Value QCheckListItemImp::text_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString ret; + ret = instance->text( ); + return KJS::String( ret ); + +} + +KJS::Value QCheckListItemImp::text_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + QString ret; + ret = instance->text( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QCheckListItemImp::setTristate_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setTristate( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QCheckListItemImp::isTristate_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isTristate( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QCheckListItemImp::state_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->state( ); + return KJS::Value(); // Returns 'ToggleState' + +} + +KJS::Value QCheckListItemImp::setState_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter ToggleState + return KJS::Value(); +#if 0 + ToggleState arg0; // Dummy + + instance->setState( + arg0 ); + return KJS::Value(); // Returns void +#endif +} + +KJS::Value QCheckListItemImp::rtti_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qchecklistitem_imp.h b/kjsembed/qtbindings/qchecklistitem_imp.h new file mode 100644 index 00000000..a1030d2a --- /dev/null +++ b/kjsembed/qtbindings/qchecklistitem_imp.h @@ -0,0 +1,139 @@ + + + +#ifndef KJSEMBED_QCheckListItem_H +#define KJSEMBED_QCheckListItem_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> +#include <kjsembed/jsbindingbase.h> + +class QCheckListItem; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { +namespace Bindings { + + class QCheckListItemLoader : public JSBindingBase + { + public: + KJS::Object createBinding(KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const; + void addBindings( KJSEmbedPart *jspart, KJS::ExecState *exec, KJS::Object &proxy) const; + }; +} +/** + * Wrapper class for QCheckListItem methods. + * + * @author Richard Moore, [email protected] + */ +class QCheckListItemImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QCheckListItem_1, + Constructor_QCheckListItem_2, + Constructor_QCheckListItem_3, + Constructor_QCheckListItem_4, + Constructor_QCheckListItem_5, + Constructor_QCheckListItem_6, + Constructor_QCheckListItem_7, + Constructor_QCheckListItem_8, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_paintCell_10, + Method_paintFocus_11, + Method_width_12, + Method_setup_13, + Method_setOn_14, + Method_isOn_15, + Method_type_16, + Method_text_17, + Method_text_18, + Method_setTristate_19, + Method_isTristate_20, + Method_state_21, + Method_setState_22, + Method_rtti_23, + Method_Last = -1 + }; + + QCheckListItemImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QCheckListItemImp(); + + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QCheckListItem *toQCheckListItem( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QCheckListItem_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_3( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_4( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_5( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_6( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_7( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QCheckListItem_8( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value paintCell_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value paintFocus_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value width_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setup_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setOn_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isOn_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value type_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setTristate_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isTristate_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value state_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setState_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QCheckListItem *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QCheckListItem_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcombobox_imp.cpp b/kjsembed/qtbindings/qcombobox_imp.cpp new file mode 100644 index 00000000..56407cb7 --- /dev/null +++ b/kjsembed/qtbindings/qcombobox_imp.cpp @@ -0,0 +1,964 @@ + + + +#include <qcstring.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qcombobox.h> +#include "qcombobox_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QComboBoxImp::QComboBoxImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QComboBoxImp::~QComboBoxImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QComboBoxImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QComboBoxImp *meth = new QComboBoxImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum Policy + { "NoInsertion", QComboBox::NoInsertion }, + { "AtTop", QComboBox::AtTop }, + { "AtCurrent", QComboBox::AtCurrent }, + { "AtBottom", QComboBox::AtBottom }, + { "AfterCurrent", QComboBox::AfterCurrent }, + { "BeforeCurrent", QComboBox::BeforeCurrent }, + { 0, 0 } + }; + + int enumidx = 0; + while( enums[enumidx].id ) { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QComboBoxImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_count_4, "count" }, + { Method_insertStringList_5, "insertStringList" }, + { Method_insertStrList_6, "insertStrList" }, + { Method_insertStrList_7, "insertStrList" }, + { Method_insertStrList_8, "insertStrList" }, + { Method_insertItem_9, "insertItem" }, + { Method_insertItem_10, "insertItem" }, + { Method_insertItem_11, "insertItem" }, + { Method_removeItem_12, "removeItem" }, + { Method_currentItem_13, "currentItem" }, + { Method_setCurrentItem_14, "setCurrentItem" }, + { Method_currentText_15, "currentText" }, + { Method_setCurrentText_16, "setCurrentText" }, + { Method_text_17, "text" }, + { Method_pixmap_18, "pixmap" }, + { Method_changeItem_19, "changeItem" }, + { Method_changeItem_20, "changeItem" }, + { Method_changeItem_21, "changeItem" }, + { Method_autoResize_22, "autoResize" }, + { Method_setAutoResize_23, "setAutoResize" }, + { Method_sizeHint_24, "sizeHint" }, + { Method_setPalette_25, "setPalette" }, + { Method_setFont_26, "setFont" }, + { Method_setEnabled_27, "setEnabled" }, + { Method_setSizeLimit_28, "setSizeLimit" }, + { Method_sizeLimit_29, "sizeLimit" }, + { Method_setMaxCount_30, "setMaxCount" }, + { Method_maxCount_31, "maxCount" }, + { Method_setInsertionPolicy_32, "setInsertionPolicy" }, + { Method_insertionPolicy_33, "insertionPolicy" }, + { Method_setValidator_34, "setValidator" }, + { Method_validator_35, "validator" }, + { Method_setListBox_36, "setListBox" }, + { Method_listBox_37, "listBox" }, + { Method_setLineEdit_38, "setLineEdit" }, + { Method_lineEdit_39, "lineEdit" }, + { Method_setAutoCompletion_40, "setAutoCompletion" }, + { Method_autoCompletion_41, "autoCompletion" }, + { Method_eventFilter_42, "eventFilter" }, + { Method_setDuplicatesEnabled_43, "setDuplicatesEnabled" }, + { Method_duplicatesEnabled_44, "duplicatesEnabled" }, + { Method_editable_45, "editable" }, + { Method_setEditable_46, "setEditable" }, + { Method_popup_47, "popup" }, + { Method_hide_48, "hide" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QComboBoxImp *meth = new QComboBoxImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QComboBox pointer from an Object. + */ +QComboBox *QComboBoxImp::toQComboBox( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QComboBox *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QComboBox" ) + return 0; + + return op->toNative<QComboBox>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QComboBoxImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QComboBox_1: + return QComboBox_1( exec, args ); + break; + + case Constructor_QComboBox_2: + return QComboBox_2( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QComboBoxCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QComboBoxImp::QComboBox_1( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QWidget * + return KJS::Value(); + + QWidget * arg0; // Dummy + + const char *arg1 = (args.size() >= 2) ? args[1].toString(exec).ascii() : 0; + + + // We should now create an object of type QComboBoxQComboBox *ret = new QComboBox( + + arg0, + arg1 ); +#endif +return KJS::Object(); +} + +KJS::Object QComboBoxImp::QComboBox_2( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + bool arg0 = extractBool(exec, args, 0); + + // Unsupported parameter QWidget * + return KJS::Value(); + + QWidget * arg1; // Dummy + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + + // We should now create an object of type QComboBoxQComboBox *ret = new QComboBox( + + arg0, + arg1, + arg2 ); +#endif +return KJS::Object(); + +} + +KJS::Value QComboBoxImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QComboBoxImp::toQComboBox( self ); + + switch( id ) { + + case Method_count_4: + return count_4( exec, self, args ); + break; + + case Method_insertStringList_5: + return insertStringList_5( exec, self, args ); + break; + + case Method_insertStrList_6: + return insertStrList_6( exec, self, args ); + break; + + case Method_insertStrList_7: + return insertStrList_7( exec, self, args ); + break; + + case Method_insertStrList_8: + return insertStrList_8( exec, self, args ); + break; + + case Method_insertItem_9: + return insertItem_9( exec, self, args ); + break; + + case Method_insertItem_10: + return insertItem_10( exec, self, args ); + break; + + case Method_insertItem_11: + return insertItem_11( exec, self, args ); + break; + + case Method_removeItem_12: + return removeItem_12( exec, self, args ); + break; + + case Method_currentItem_13: + return currentItem_13( exec, self, args ); + break; + + case Method_setCurrentItem_14: + return setCurrentItem_14( exec, self, args ); + break; + + case Method_currentText_15: + return currentText_15( exec, self, args ); + break; + + case Method_setCurrentText_16: + return setCurrentText_16( exec, self, args ); + break; + + case Method_text_17: + return text_17( exec, self, args ); + break; + + case Method_pixmap_18: + return pixmap_18( exec, self, args ); + break; + + case Method_changeItem_19: + return changeItem_19( exec, self, args ); + break; + + case Method_changeItem_20: + return changeItem_20( exec, self, args ); + break; + + case Method_changeItem_21: + return changeItem_21( exec, self, args ); + break; + + case Method_autoResize_22: + return autoResize_22( exec, self, args ); + break; + + case Method_setAutoResize_23: + return setAutoResize_23( exec, self, args ); + break; + + case Method_sizeHint_24: + return sizeHint_24( exec, self, args ); + break; + + case Method_setPalette_25: + return setPalette_25( exec, self, args ); + break; + + case Method_setFont_26: + return setFont_26( exec, self, args ); + break; + + case Method_setEnabled_27: + return setEnabled_27( exec, self, args ); + break; + + case Method_setSizeLimit_28: + return setSizeLimit_28( exec, self, args ); + break; + + case Method_sizeLimit_29: + return sizeLimit_29( exec, self, args ); + break; + + case Method_setMaxCount_30: + return setMaxCount_30( exec, self, args ); + break; + + case Method_maxCount_31: + return maxCount_31( exec, self, args ); + break; + + case Method_setInsertionPolicy_32: + return setInsertionPolicy_32( exec, self, args ); + break; + + case Method_insertionPolicy_33: + return insertionPolicy_33( exec, self, args ); + break; + + case Method_setValidator_34: + return setValidator_34( exec, self, args ); + break; + + case Method_validator_35: + return validator_35( exec, self, args ); + break; + + case Method_setListBox_36: + return setListBox_36( exec, self, args ); + break; + + case Method_listBox_37: + return listBox_37( exec, self, args ); + break; + + case Method_setLineEdit_38: + return setLineEdit_38( exec, self, args ); + break; + + case Method_lineEdit_39: + return lineEdit_39( exec, self, args ); + break; + + case Method_setAutoCompletion_40: + return setAutoCompletion_40( exec, self, args ); + break; + + case Method_autoCompletion_41: + return autoCompletion_41( exec, self, args ); + break; + + case Method_eventFilter_42: + return eventFilter_42( exec, self, args ); + break; + + case Method_setDuplicatesEnabled_43: + return setDuplicatesEnabled_43( exec, self, args ); + break; + + case Method_duplicatesEnabled_44: + return duplicatesEnabled_44( exec, self, args ); + break; + + case Method_editable_45: + return editable_45( exec, self, args ); + break; + + case Method_setEditable_46: + return setEditable_46( exec, self, args ); + break; + + case Method_popup_47: + return popup_47( exec, self, args ); + break; + + case Method_hide_48: + return hide_48( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QComboBoxImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QComboBoxImp::count_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->count( ); + return KJS::Number( ret ); + +} + +KJS::Value QComboBoxImp::insertStringList_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QStringList arg0 = extractQStringList(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->insertStringList( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertStrList_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QStrList arg0 = extractQStrList(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->insertStrList( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertStrList_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QStrList * + return KJS::Value(); + + const QStrList * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + instance->insertStrList( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertStrList_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const char ** + return KJS::Value(); + + const char ** arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->insertStrList( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertItem_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->insertItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->insertItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + QString arg1 = extractQString(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->insertItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::removeItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->removeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::currentItem_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->currentItem( ); + return KJS::Number( ret ); + +} + +KJS::Value QComboBoxImp::setCurrentItem_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setCurrentItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::currentText_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString ret; + ret = instance->currentText( ); + return KJS::String( ret ); + +} + +KJS::Value QComboBoxImp::setCurrentText_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + instance->setCurrentText( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::text_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString ret; + ret = instance->text( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QComboBoxImp::pixmap_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->pixmap( + arg0 ); + return KJS::Value(); // Returns 'const QPixmap *' + +} + +KJS::Value QComboBoxImp::changeItem_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::changeItem_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::changeItem_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + QString arg1 = extractQString(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->changeItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::autoResize_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->autoResize( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QComboBoxImp::setAutoResize_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setAutoResize( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::sizeHint_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QSize ret; + ret = instance->sizeHint( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QComboBoxImp::setPalette_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPalette arg0 = extractQPalette(exec, args, 0); + + instance->setPalette( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::setFont_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QFont arg0 = extractQFont(exec, args, 0); + + instance->setFont( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::setEnabled_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::setSizeLimit_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setSizeLimit( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::sizeLimit_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->sizeLimit( ); + return KJS::Number( ret ); + +} + +KJS::Value QComboBoxImp::setMaxCount_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setMaxCount( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::maxCount_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->maxCount( ); + return KJS::Number( ret ); + +} + +KJS::Value QComboBoxImp::setInsertionPolicy_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QComboBox::Policy arg0 = QComboBox::AtBottom; // TODO (hack for combo box) + + instance->setInsertionPolicy( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::insertionPolicy_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->insertionPolicy( ); + return KJS::Value(); // Returns 'Policy' + +} + +KJS::Value QComboBoxImp::setValidator_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QValidator * + return KJS::Value(); + + const QValidator * arg0; // Dummy + + instance->setValidator( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::validator_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->validator( ); + return KJS::Value(); // Returns 'const QValidator *' + +} + +KJS::Value QComboBoxImp::setListBox_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListBox * + return KJS::Value(); + + QListBox * arg0; // Dummy + + instance->setListBox( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::listBox_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->listBox( ); + return KJS::Value(); // Returns 'QListBox *' + +} + +KJS::Value QComboBoxImp::setLineEdit_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QLineEdit * + return KJS::Value(); + + QLineEdit * arg0; // Dummy + + instance->setLineEdit( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::lineEdit_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->lineEdit( ); + return KJS::Value(); // Returns 'QLineEdit *' + +} + +KJS::Value QComboBoxImp::setAutoCompletion_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setAutoCompletion( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::autoCompletion_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->autoCompletion( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QComboBoxImp::eventFilter_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QObject * + return KJS::Value(); + + QObject * arg0; // Dummy + + // Unsupported parameter QEvent * + return KJS::Value(); + + QEvent * arg1; // Dummy + + bool ret; + ret = instance->eventFilter( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QComboBoxImp::setDuplicatesEnabled_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setDuplicatesEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::duplicatesEnabled_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->duplicatesEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QComboBoxImp::editable_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->editable( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QComboBoxImp::setEditable_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setEditable( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::popup_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->popup( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QComboBoxImp::hide_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->hide( ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qcombobox_imp.h b/kjsembed/qtbindings/qcombobox_imp.h new file mode 100644 index 00000000..56653345 --- /dev/null +++ b/kjsembed/qtbindings/qcombobox_imp.h @@ -0,0 +1,190 @@ + + + +#ifndef KJSEMBED_QComboBox_H +#define KJSEMBED_QComboBox_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QComboBox; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QComboBox methods. + * + * @author Richard Moore, [email protected] + */ +class QComboBoxImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QComboBox_1, + Constructor_QComboBox_2, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_count_4, + Method_insertStringList_5, + Method_insertStrList_6, + Method_insertStrList_7, + Method_insertStrList_8, + Method_insertItem_9, + Method_insertItem_10, + Method_insertItem_11, + Method_removeItem_12, + Method_currentItem_13, + Method_setCurrentItem_14, + Method_currentText_15, + Method_setCurrentText_16, + Method_text_17, + Method_pixmap_18, + Method_changeItem_19, + Method_changeItem_20, + Method_changeItem_21, + Method_autoResize_22, + Method_setAutoResize_23, + Method_sizeHint_24, + Method_setPalette_25, + Method_setFont_26, + Method_setEnabled_27, + Method_setSizeLimit_28, + Method_sizeLimit_29, + Method_setMaxCount_30, + Method_maxCount_31, + Method_setInsertionPolicy_32, + Method_insertionPolicy_33, + Method_setValidator_34, + Method_validator_35, + Method_setListBox_36, + Method_listBox_37, + Method_setLineEdit_38, + Method_lineEdit_39, + Method_setAutoCompletion_40, + Method_autoCompletion_41, + Method_eventFilter_42, + Method_setDuplicatesEnabled_43, + Method_duplicatesEnabled_44, + Method_editable_45, + Method_setEditable_46, + Method_popup_47, + Method_hide_48, + Method_Last = -1 + }; + + QComboBoxImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QComboBoxImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QComboBox *toQComboBox( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QComboBox_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QComboBox_2( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value count_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertStringList_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertStrList_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertStrList_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertStrList_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value currentItem_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCurrentItem_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value currentText_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCurrentText_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value pixmap_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value autoResize_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAutoResize_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sizeHint_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setPalette_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFont_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setEnabled_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSizeLimit_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sizeLimit_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setMaxCount_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value maxCount_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setInsertionPolicy_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertionPolicy_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setValidator_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value validator_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setListBox_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value listBox_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setLineEdit_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value lineEdit_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAutoCompletion_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value autoCompletion_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value eventFilter_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDuplicatesEnabled_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value duplicatesEnabled_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value editable_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setEditable_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value popup_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value hide_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QComboBox *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QComboBox_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qframe_imp.cpp b/kjsembed/qtbindings/qframe_imp.cpp new file mode 100644 index 00000000..92254a8b --- /dev/null +++ b/kjsembed/qtbindings/qframe_imp.cpp @@ -0,0 +1,64 @@ + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qframe.h> +#include "qframe_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { +void QFrameImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum Shape + { "NoFrame", QFrame::NoFrame }, + { "Box", QFrame::Box }, + { "Panel", QFrame::Panel }, + { "WinPanel", QFrame::WinPanel }, + { "HLine", QFrame::HLine }, + { "VLine", QFrame::VLine }, + { "StyledPanel", QFrame::StyledPanel }, + { "PopupPanel", QFrame::PopupPanel }, + { "MenuBarPanel", QFrame::MenuBarPanel }, + { "ToolBarPanel", QFrame::ToolBarPanel }, + { "LineEditPanel", QFrame::LineEditPanel }, + { "TabWidgetPanel", QFrame::TabWidgetPanel }, + { "GroupBoxPanel", QFrame::GroupBoxPanel }, + { "MShape", QFrame::MShape }, + // enum Shadow + { "Plain", QFrame::Plain }, + { "Raised", QFrame::Raised }, + { "Sunken", QFrame::Sunken }, + { "MShadow", QFrame::MShadow }, + { 0, 0 } + }; + + int enumidx = 0; + do { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } while( enums[enumidx].id ); + +} + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qframe_imp.h b/kjsembed/qtbindings/qframe_imp.h new file mode 100644 index 00000000..0f227605 --- /dev/null +++ b/kjsembed/qtbindings/qframe_imp.h @@ -0,0 +1,35 @@ + + + +#ifndef KJSEMBED_QFrame_H +#define KJSEMBED_QFrame_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QFrame enums. + * + * @author Ian Reinhart Geiser, [email protected] + */ +class QFrameImp +{ +public: + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QFrame_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qlistview_imp.cpp b/kjsembed/qtbindings/qlistview_imp.cpp new file mode 100644 index 00000000..a5f4c022 --- /dev/null +++ b/kjsembed/qtbindings/qlistview_imp.cpp @@ -0,0 +1,1329 @@ + + + +#include <qcstring.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> +#include <qiconset.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qlistview.h> +#include "qlistview_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QListViewImp::QListViewImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QListViewImp::~QListViewImp() +{ +} + +void QListViewImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_treeStepSize_3, "treeStepSize" }, + { Method_setTreeStepSize_4, "setTreeStepSize" }, + { Method_insertItem_5, "insertItem" }, + { Method_takeItem_6, "takeItem" }, + { Method_removeItem_7, "removeItem" }, + { Method_header_8, "header" }, + { Method_addColumn_9, "addColumn" }, + { Method_addColumn_10, "addColumn" }, + { Method_removeColumn_11, "removeColumn" }, + { Method_setColumnText_12, "setColumnText" }, + { Method_setColumnText_13, "setColumnText" }, + { Method_columnText_14, "columnText" }, + { Method_setColumnWidth_15, "setColumnWidth" }, + { Method_columnWidth_16, "columnWidth" }, + { Method_setColumnWidthMode_17, "setColumnWidthMode" }, + { Method_columnWidthMode_18, "columnWidthMode" }, + { Method_columns_19, "columns" }, + { Method_setColumnAlignment_20, "setColumnAlignment" }, + { Method_columnAlignment_21, "columnAlignment" }, + { Method_show_22, "show" }, + { Method_itemAt_23, "itemAt" }, + { Method_itemRect_24, "itemRect" }, + { Method_itemPos_25, "itemPos" }, + { Method_ensureItemVisible_26, "ensureItemVisible" }, + { Method_repaintItem_27, "repaintItem" }, + { Method_setMultiSelection_28, "setMultiSelection" }, + { Method_isMultiSelection_29, "isMultiSelection" }, + { Method_setSelectionMode_30, "setSelectionMode" }, + { Method_selectionMode_31, "selectionMode" }, + { Method_clearSelection_32, "clearSelection" }, + { Method_setSelected_33, "setSelected" }, + { Method_setSelectionAnchor_34, "setSelectionAnchor" }, + { Method_isSelected_35, "isSelected" }, + { Method_selectedItem_36, "selectedItem" }, + { Method_setOpen_37, "setOpen" }, + { Method_isOpen_38, "isOpen" }, + { Method_setCurrentItem_39, "setCurrentItem" }, + { Method_currentItem_40, "currentItem" }, + { Method_firstChild_41, "firstChild" }, + { Method_lastItem_42, "lastItem" }, + { Method_childCount_43, "childCount" }, + { Method_setAllColumnsShowFocus_44, "setAllColumnsShowFocus" }, + { Method_allColumnsShowFocus_45, "allColumnsShowFocus" }, + { Method_setItemMargin_46, "setItemMargin" }, + { Method_itemMargin_47, "itemMargin" }, + { Method_setRootIsDecorated_48, "setRootIsDecorated" }, + { Method_rootIsDecorated_49, "rootIsDecorated" }, + { Method_setSorting_50, "setSorting" }, + { Method_sortColumn_51, "sortColumn" }, + { Method_setSortColumn_52, "setSortColumn" }, + { Method_sortOrder_53, "sortOrder" }, + { Method_setSortOrder_54, "setSortOrder" }, + { Method_sort_55, "sort" }, + { Method_setFont_56, "setFont" }, + { Method_setPalette_57, "setPalette" }, + { Method_eventFilter_58, "eventFilter" }, + { Method_sizeHint_59, "sizeHint" }, + { Method_minimumSizeHint_60, "minimumSizeHint" }, + { Method_setShowSortIndicator_61, "setShowSortIndicator" }, + { Method_showSortIndicator_62, "showSortIndicator" }, + { Method_setShowToolTips_63, "setShowToolTips" }, + { Method_showToolTips_64, "showToolTips" }, + { Method_setResizeMode_65, "setResizeMode" }, + { Method_resizeMode_66, "resizeMode" }, + { Method_findItem_67, "findItem" }, + { Method_setDefaultRenameAction_68, "setDefaultRenameAction" }, + { Method_defaultRenameAction_69, "defaultRenameAction" }, + { Method_isRenaming_70, "isRenaming" }, + { Method_hideColumn_71, "hideColumn" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].id ) { + if ( lastName != methods[idx].name ) { + QListViewImp *meth = new QListViewImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum WidthMode + { "Manual", QListView::Manual }, + { "Maximum", QListView::Maximum }, + // enum SelectionMode + { "Single", QListView::Single }, + { "Multi", QListView::Multi }, + { "Extended", QListView::Extended }, + { "NoSelection", QListView::NoSelection }, + // enum ResizeMode + { "NoColumn", QListView::NoColumn }, + { "AllColumns", QListView::AllColumns }, + { "LastColumn", QListView::LastColumn }, + // enum RenameAction + { "Accept", QListView::Accept }, + { "Reject", QListView::Reject }, + { 0, 0 } + }; + + int enumidx = 0; + do { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } while( enums[enumidx].id ); + +} + +QListView *QListViewImp::toQListView( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QListView *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QListView" ) + return 0; + + return op->toNative<QListView>(); +} + + +KJS::Object QListViewImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QListView_1: + return QListView_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QListViewCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QListViewImp::QListView_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // TODO + QWidget *arg0 = 0L; + + // TODO + QWidget *arg1 = 0L; + + // TODO + QWidget *arg2 = 0L; + +} + +KJS::Value QListViewImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QListViewImp::toQListView( self ); + + switch( id ) { + + case Method_treeStepSize_3: + return treeStepSize_3( exec, self, args ); + break; + + case Method_setTreeStepSize_4: + return setTreeStepSize_4( exec, self, args ); + break; + + case Method_insertItem_5: + return insertItem_5( exec, self, args ); + break; + + case Method_takeItem_6: + return takeItem_6( exec, self, args ); + break; + + case Method_removeItem_7: + return removeItem_7( exec, self, args ); + break; + + case Method_header_8: + return header_8( exec, self, args ); + break; + + case Method_addColumn_9: + return addColumn_9( exec, self, args ); + break; + + case Method_addColumn_10: + return addColumn_10( exec, self, args ); + break; + + case Method_removeColumn_11: + return removeColumn_11( exec, self, args ); + break; + + case Method_setColumnText_12: + return setColumnText_12( exec, self, args ); + break; + + case Method_setColumnText_13: + return setColumnText_13( exec, self, args ); + break; + + case Method_columnText_14: + return columnText_14( exec, self, args ); + break; + + case Method_setColumnWidth_15: + return setColumnWidth_15( exec, self, args ); + break; + + case Method_columnWidth_16: + return columnWidth_16( exec, self, args ); + break; + + case Method_setColumnWidthMode_17: + return setColumnWidthMode_17( exec, self, args ); + break; + + case Method_columnWidthMode_18: + return columnWidthMode_18( exec, self, args ); + break; + + case Method_columns_19: + return columns_19( exec, self, args ); + break; + + case Method_setColumnAlignment_20: + return setColumnAlignment_20( exec, self, args ); + break; + + case Method_columnAlignment_21: + return columnAlignment_21( exec, self, args ); + break; + + case Method_show_22: + return show_22( exec, self, args ); + break; + + case Method_itemAt_23: + return itemAt_23( exec, self, args ); + break; + + case Method_itemRect_24: + return itemRect_24( exec, self, args ); + break; + + case Method_itemPos_25: + return itemPos_25( exec, self, args ); + break; + + case Method_ensureItemVisible_26: + return ensureItemVisible_26( exec, self, args ); + break; + + case Method_repaintItem_27: + return repaintItem_27( exec, self, args ); + break; + + case Method_setMultiSelection_28: + return setMultiSelection_28( exec, self, args ); + break; + + case Method_isMultiSelection_29: + return isMultiSelection_29( exec, self, args ); + break; + + case Method_setSelectionMode_30: + return setSelectionMode_30( exec, self, args ); + break; + + case Method_selectionMode_31: + return selectionMode_31( exec, self, args ); + break; + + case Method_clearSelection_32: + return clearSelection_32( exec, self, args ); + break; + + case Method_setSelected_33: + return setSelected_33( exec, self, args ); + break; + + case Method_setSelectionAnchor_34: + return setSelectionAnchor_34( exec, self, args ); + break; + + case Method_isSelected_35: + return isSelected_35( exec, self, args ); + break; + + case Method_selectedItem_36: + return selectedItem_36( exec, self, args ); + break; + + case Method_setOpen_37: + return setOpen_37( exec, self, args ); + break; + + case Method_isOpen_38: + return isOpen_38( exec, self, args ); + break; + + case Method_setCurrentItem_39: + return setCurrentItem_39( exec, self, args ); + break; + + case Method_currentItem_40: + return currentItem_40( exec, self, args ); + break; + + case Method_firstChild_41: + return firstChild_41( exec, self, args ); + break; + + case Method_lastItem_42: + return lastItem_42( exec, self, args ); + break; + + case Method_childCount_43: + return childCount_43( exec, self, args ); + break; + + case Method_setAllColumnsShowFocus_44: + return setAllColumnsShowFocus_44( exec, self, args ); + break; + + case Method_allColumnsShowFocus_45: + return allColumnsShowFocus_45( exec, self, args ); + break; + + case Method_setItemMargin_46: + return setItemMargin_46( exec, self, args ); + break; + + case Method_itemMargin_47: + return itemMargin_47( exec, self, args ); + break; + + case Method_setRootIsDecorated_48: + return setRootIsDecorated_48( exec, self, args ); + break; + + case Method_rootIsDecorated_49: + return rootIsDecorated_49( exec, self, args ); + break; + + case Method_setSorting_50: + return setSorting_50( exec, self, args ); + break; + + case Method_sortColumn_51: + return sortColumn_51( exec, self, args ); + break; + + case Method_setSortColumn_52: + return setSortColumn_52( exec, self, args ); + break; + + case Method_sortOrder_53: + return sortOrder_53( exec, self, args ); + break; + + case Method_setSortOrder_54: + return setSortOrder_54( exec, self, args ); + break; + + case Method_sort_55: + return sort_55( exec, self, args ); + break; + + case Method_setFont_56: + return setFont_56( exec, self, args ); + break; + + case Method_setPalette_57: + return setPalette_57( exec, self, args ); + break; + + case Method_eventFilter_58: + return eventFilter_58( exec, self, args ); + break; + + case Method_sizeHint_59: + return sizeHint_59( exec, self, args ); + break; + + case Method_minimumSizeHint_60: + return minimumSizeHint_60( exec, self, args ); + break; + + case Method_setShowSortIndicator_61: + return setShowSortIndicator_61( exec, self, args ); + break; + + case Method_showSortIndicator_62: + return showSortIndicator_62( exec, self, args ); + break; + + case Method_setShowToolTips_63: + return setShowToolTips_63( exec, self, args ); + break; + + case Method_showToolTips_64: + return showToolTips_64( exec, self, args ); + break; + + case Method_setResizeMode_65: + return setResizeMode_65( exec, self, args ); + break; + + case Method_resizeMode_66: + return resizeMode_66( exec, self, args ); + break; + + case Method_findItem_67: + return findItem_67( exec, self, args ); + break; + + case Method_setDefaultRenameAction_68: + return setDefaultRenameAction_68( exec, self, args ); + break; + + case Method_defaultRenameAction_69: + return defaultRenameAction_69( exec, self, args ); + break; + + case Method_isRenaming_70: + return isRenaming_70( exec, self, args ); + break; + + case Method_hideColumn_71: + return hideColumn_71( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QListViewImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QListViewImp::treeStepSize_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->treeStepSize( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setTreeStepSize_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->setTreeStepSize( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::insertItem_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->insertItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::takeItem_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->takeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::removeItem_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->removeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::header_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->header( ); + return KJS::Value(); // Returns 'QHeader *' + +} + +KJS::Value QListViewImp::addColumn_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = (args.size() >= 1) ? args[0].toString(exec).qstring() : QString::null; + + int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1; + + int ret; + ret = instance->addColumn( + arg0, + arg1 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::addColumn_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QString arg1 = (args.size() >= 2) ? args[1].toString(exec).qstring() : QString::null; + + int arg2 = (args.size() >= 3) ? args[2].toInteger(exec) : -1; + + int ret; + ret = instance->addColumn( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::removeColumn_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->removeColumn( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setColumnText_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + QString arg1 = (args.size() >= 2) ? args[1].toString(exec).qstring() : QString::null; + + instance->setColumnText( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setColumnText_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg1; // Dummy + + QString arg2 = (args.size() >= 3) ? args[2].toString(exec).qstring() : QString::null; + + instance->setColumnText( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::columnText_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + QString ret; + ret = instance->columnText( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QListViewImp::setColumnWidth_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1; + + instance->setColumnWidth( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::columnWidth_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + int ret; + ret = instance->columnWidth( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setColumnWidthMode_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + // Unsupported parameter WidthMode + return KJS::Value(); + + WidthMode arg1; // Dummy + + instance->setColumnWidthMode( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::columnWidthMode_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->columnWidthMode( + arg0 ); + return KJS::Value(); // Returns 'WidthMode' + +} + +KJS::Value QListViewImp::columns_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->columns( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setColumnAlignment_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1; + + instance->setColumnAlignment( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::columnAlignment_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + int ret; + ret = instance->columnAlignment( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::show_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->show( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::itemAt_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QPoint & + return KJS::Value(); + + const QPoint & arg0; // Dummy + + instance->itemAt( + arg0 ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::itemRect_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + instance->itemRect( + arg0 ); + return KJS::Value(); // Returns 'QRect' + +} + +KJS::Value QListViewImp::itemPos_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + int ret; + ret = instance->itemPos( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::ensureItemVisible_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + instance->ensureItemVisible( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::repaintItem_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + instance->repaintItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setMultiSelection_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setMultiSelection( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::isMultiSelection_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isMultiSelection( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setSelectionMode_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter SelectionMode + return KJS::Value(); + + SelectionMode arg0; // Dummy + + instance->setSelectionMode( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::selectionMode_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->selectionMode( ); + return KJS::Value(); // Returns 'SelectionMode' + +} + +KJS::Value QListViewImp::clearSelection_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->clearSelection( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setSelected_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + bool arg1 = (args.size() >= 2) ? args[1].toBoolean(exec) : false; + + instance->setSelected( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setSelectionAnchor_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->setSelectionAnchor( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::isSelected_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + bool ret; + ret = instance->isSelected( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::selectedItem_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->selectedItem( ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::setOpen_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + bool arg1 = (args.size() >= 2) ? args[1].toBoolean(exec) : false; + + instance->setOpen( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::isOpen_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QListViewItem * + return KJS::Value(); + + const QListViewItem * arg0; // Dummy + + bool ret; + ret = instance->isOpen( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setCurrentItem_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->setCurrentItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::currentItem_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->currentItem( ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::firstChild_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->firstChild( ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::lastItem_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->lastItem( ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::childCount_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->childCount( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setAllColumnsShowFocus_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setAllColumnsShowFocus( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::allColumnsShowFocus_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->allColumnsShowFocus( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setItemMargin_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->setItemMargin( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::itemMargin_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->itemMargin( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setRootIsDecorated_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setRootIsDecorated( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::rootIsDecorated_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->rootIsDecorated( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setSorting_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + bool arg1 = (args.size() >= 2) ? args[1].toBoolean(exec) : false; + + instance->setSorting( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::sortColumn_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->sortColumn( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewImp::setSortColumn_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->setSortColumn( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::sortOrder_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->sortOrder( ); + return KJS::Value(); // Returns 'SortOrder' + +} + +KJS::Value QListViewImp::setSortOrder_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter SortOrder + return KJS::Value(); + + SortOrder arg0; // Dummy + + instance->setSortOrder( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::sort_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->sort( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setFont_56( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QFont arg0; // TODO + + instance->setFont( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::setPalette_57( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPalette arg0; // TODO + + instance->setPalette( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::eventFilter_58( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QObject * + return KJS::Value(); + + QObject * arg0; // Dummy + + // Unsupported parameter QEvent * + return KJS::Value(); + + QEvent * arg1; // Dummy + + bool ret; + ret = instance->eventFilter( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::sizeHint_59( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->sizeHint( ); + return KJS::Value(); // Returns 'QSize' + +} + +KJS::Value QListViewImp::minimumSizeHint_60( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->minimumSizeHint( ); + return KJS::Value(); // Returns 'QSize' + +} + +KJS::Value QListViewImp::setShowSortIndicator_61( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setShowSortIndicator( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::showSortIndicator_62( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->showSortIndicator( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setShowToolTips_63( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = (args.size() >= 1) ? args[0].toBoolean(exec) : false; + + instance->setShowToolTips( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::showToolTips_64( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->showToolTips( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::setResizeMode_65( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter ResizeMode + return KJS::Value(); + + ResizeMode arg0; // Dummy + + instance->setResizeMode( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::resizeMode_66( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->resizeMode( ); + return KJS::Value(); // Returns 'ResizeMode' + +} + +KJS::Value QListViewImp::findItem_67( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = (args.size() >= 1) ? args[0].toString(exec).qstring() : QString::null; + + int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1; + + // Unsupported parameter ComparisonFlags + return KJS::Value(); + + ComparisonFlags arg2; // Dummy + + instance->findItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns 'QListViewItem *' + +} + +KJS::Value QListViewImp::setDefaultRenameAction_68( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter RenameAction + return KJS::Value(); + + RenameAction arg0; // Dummy + + instance->setDefaultRenameAction( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewImp::defaultRenameAction_69( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->defaultRenameAction( ); + return KJS::Value(); // Returns 'RenameAction' + +} + +KJS::Value QListViewImp::isRenaming_70( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isRenaming( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewImp::hideColumn_71( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1; + + instance->hideColumn( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qlistview_imp.h b/kjsembed/qtbindings/qlistview_imp.h new file mode 100644 index 00000000..0c1edf2d --- /dev/null +++ b/kjsembed/qtbindings/qlistview_imp.h @@ -0,0 +1,226 @@ + + + +#ifndef KJSEMBED_QListView_H +#define KJSEMBED_QListView_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QListView; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QListView methods. + * + * @author Richard Moore, [email protected] + */ +class QListViewImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QListView_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_treeStepSize_3, + Method_setTreeStepSize_4, + Method_insertItem_5, + Method_takeItem_6, + Method_removeItem_7, + Method_header_8, + Method_addColumn_9, + Method_addColumn_10, + Method_removeColumn_11, + Method_setColumnText_12, + Method_setColumnText_13, + Method_columnText_14, + Method_setColumnWidth_15, + Method_columnWidth_16, + Method_setColumnWidthMode_17, + Method_columnWidthMode_18, + Method_columns_19, + Method_setColumnAlignment_20, + Method_columnAlignment_21, + Method_show_22, + Method_itemAt_23, + Method_itemRect_24, + Method_itemPos_25, + Method_ensureItemVisible_26, + Method_repaintItem_27, + Method_setMultiSelection_28, + Method_isMultiSelection_29, + Method_setSelectionMode_30, + Method_selectionMode_31, + Method_clearSelection_32, + Method_setSelected_33, + Method_setSelectionAnchor_34, + Method_isSelected_35, + Method_selectedItem_36, + Method_setOpen_37, + Method_isOpen_38, + Method_setCurrentItem_39, + Method_currentItem_40, + Method_firstChild_41, + Method_lastItem_42, + Method_childCount_43, + Method_setAllColumnsShowFocus_44, + Method_allColumnsShowFocus_45, + Method_setItemMargin_46, + Method_itemMargin_47, + Method_setRootIsDecorated_48, + Method_rootIsDecorated_49, + Method_setSorting_50, + Method_sortColumn_51, + Method_setSortColumn_52, + Method_sortOrder_53, + Method_setSortOrder_54, + Method_sort_55, + Method_setFont_56, + Method_setPalette_57, + Method_eventFilter_58, + Method_sizeHint_59, + Method_minimumSizeHint_60, + Method_setShowSortIndicator_61, + Method_showSortIndicator_62, + Method_setShowToolTips_63, + Method_showToolTips_64, + Method_setResizeMode_65, + Method_resizeMode_66, + Method_findItem_67, + Method_setDefaultRenameAction_68, + Method_defaultRenameAction_69, + Method_isRenaming_70, + Method_hideColumn_71, + Method_Last = -1 + }; + + QListViewImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QListViewImp(); + + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QListView *toQListView( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QListView_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value treeStepSize_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setTreeStepSize_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value takeItem_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItem_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value header_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addColumn_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value addColumn_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeColumn_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColumnText_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColumnText_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value columnText_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColumnWidth_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value columnWidth_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColumnWidthMode_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value columnWidthMode_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value columns_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setColumnAlignment_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value columnAlignment_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value show_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemAt_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemRect_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemPos_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value ensureItemVisible_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value repaintItem_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setMultiSelection_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isMultiSelection_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelectionMode_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value selectionMode_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value clearSelection_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelected_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelectionAnchor_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isSelected_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value selectedItem_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setOpen_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isOpen_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCurrentItem_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value currentItem_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value firstChild_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value lastItem_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value childCount_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAllColumnsShowFocus_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value allColumnsShowFocus_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setItemMargin_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemMargin_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setRootIsDecorated_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rootIsDecorated_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSorting_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sortColumn_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSortColumn_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sortOrder_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSortOrder_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sort_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFont_56( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setPalette_57( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value eventFilter_58( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sizeHint_59( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value minimumSizeHint_60( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setShowSortIndicator_61( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value showSortIndicator_62( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setShowToolTips_63( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value showToolTips_64( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setResizeMode_65( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value resizeMode_66( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value findItem_67( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDefaultRenameAction_68( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value defaultRenameAction_69( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isRenaming_70( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value hideColumn_71( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QListView *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QListView_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qlistviewitem_imp.cpp b/kjsembed/qtbindings/qlistviewitem_imp.cpp new file mode 100644 index 00000000..b7e18820 --- /dev/null +++ b/kjsembed/qtbindings/qlistviewitem_imp.cpp @@ -0,0 +1,1429 @@ + + + +#include <qcstring.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qlistview.h> +#include "qlistviewitem_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { +namespace Bindings { + + KJS::Object QListViewItemLoader::createBinding(KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const + { + if ( args.size() == 0 ) { + // FALL THRU + } else { + JSOpaqueProxy * arg0 = JSProxy::toOpaqueProxy( args[ 0 ].imp() ); + JSOpaqueProxy *prx = 0; + + if ( arg0 ) { + if ( arg0->typeName() == "QListViewItem" ) { + QListViewItem * parent = arg0->toNative<QListViewItem>(); + prx = new JSOpaqueProxy( new QListViewItem( parent ), "QListViewItem" ); + } else { + return KJS::Object(); + } + } else { + JSObjectProxy *arg0 = JSProxy::toObjectProxy( args[ 0 ].imp() ); + if ( arg0 ) { + QListView * parent = ( QListView * ) ( arg0->widget() ); + prx = new JSOpaqueProxy( new QListViewItem( parent ), "QListViewItem" ); + } else { + return KJS::Object(); + } + } + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(jspart,exec,proxyObj); + return proxyObj; + } + return KJS::Object(); + } + + void QListViewItemLoader::addBindings( KJSEmbedPart *jspart, KJS::ExecState *exec, KJS::Object &proxy ) const + { + QListViewItemImp::addBindings( exec, proxy ); + } +} + +QListViewItemImp::QListViewItemImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QListViewItemImp::~QListViewItemImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QListViewItemImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QListViewItemImp *meth = new QListViewItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QListViewItemImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_insertItem_10, "insertItem" }, + { Method_takeItem_11, "takeItem" }, + { Method_removeItem_12, "removeItem" }, + { Method_height_13, "height" }, + { Method_invalidateHeight_14, "invalidateHeight" }, + { Method_totalHeight_15, "totalHeight" }, + { Method_width_16, "width" }, + { Method_widthChanged_17, "widthChanged" }, + { Method_depth_18, "depth" }, + { Method_setText_19, "setText" }, + { Method_text_20, "text" }, + { Method_setPixmap_21, "setPixmap" }, + { Method_pixmap_22, "pixmap" }, + { Method_key_23, "key" }, + { Method_compare_24, "compare" }, + { Method_sortChildItems_25, "sortChildItems" }, + { Method_childCount_26, "childCount" }, + { Method_isOpen_27, "isOpen" }, + { Method_setOpen_28, "setOpen" }, + { Method_setup_29, "setup" }, + { Method_setSelected_30, "setSelected" }, + { Method_isSelected_31, "isSelected" }, + { Method_paintCell_32, "paintCell" }, + { Method_paintBranches_33, "paintBranches" }, + { Method_paintFocus_34, "paintFocus" }, + { Method_firstChild_35, "firstChild" }, + { Method_nextSibling_36, "nextSibling" }, + { Method_parent_37, "parent" }, + { Method_itemAbove_38, "itemAbove" }, + { Method_itemBelow_39, "itemBelow" }, + { Method_itemPos_40, "itemPos" }, + { Method_listView_41, "listView" }, + { Method_setSelectable_42, "setSelectable" }, + { Method_isSelectable_43, "isSelectable" }, + { Method_setExpandable_44, "setExpandable" }, + { Method_isExpandable_45, "isExpandable" }, + { Method_repaint_46, "repaint" }, + { Method_sort_47, "sort" }, + { Method_moveItem_48, "moveItem" }, + { Method_setDragEnabled_49, "setDragEnabled" }, + { Method_setDropEnabled_50, "setDropEnabled" }, + { Method_dragEnabled_51, "dragEnabled" }, + { Method_dropEnabled_52, "dropEnabled" }, + { Method_acceptDrop_53, "acceptDrop" }, + { Method_setVisible_54, "setVisible" }, + { Method_isVisible_55, "isVisible" }, + { Method_setRenameEnabled_56, "setRenameEnabled" }, + { Method_renameEnabled_57, "renameEnabled" }, + { Method_startRename_58, "startRename" }, + { Method_setEnabled_59, "setEnabled" }, + { Method_isEnabled_60, "isEnabled" }, + { Method_rtti_61, "rtti" }, + { Method_setMultiLinesEnabled_62, "setMultiLinesEnabled" }, + { Method_multiLinesEnabled_63, "multiLinesEnabled" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QListViewItemImp *meth = new QListViewItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QListViewItem pointer from an Object. + */ +QListViewItem *QListViewItemImp::toQListViewItem( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QListViewItem *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + return op->toNative<QListViewItem>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QListViewItemImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QListViewItem_1: + return QListViewItem_1( exec, args ); + break; + + case Constructor_QListViewItem_2: + return QListViewItem_2( exec, args ); + break; + + case Constructor_QListViewItem_3: + return QListViewItem_3( exec, args ); + break; + + case Constructor_QListViewItem_4: + return QListViewItem_4( exec, args ); + break; + + case Constructor_QListViewItem_5: + return QListViewItem_5( exec, args ); + break; + + case Constructor_QListViewItem_6: + return QListViewItem_6( exec, args ); + break; + + case Constructor_QListViewItem_7: + return QListViewItem_7( exec, args ); + break; + + case Constructor_QListViewItem_8: + return QListViewItem_8( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QListViewItemCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QListViewItemImp::QListViewItem_1( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QListView * + return KJS::Value(); + + QListView * arg0; // Dummy + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0 ); +#endif +return KJS::Object(); + +} + +KJS::Object QListViewItemImp::QListViewItem_2( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0 ); +#endif +return KJS::Object(); +} + +KJS::Object QListViewItemImp::QListViewItem_3( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + + // Unsupported parameter QListView * + return KJS::Value(); + + QListView * arg0; // Dummy + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg1; // Dummy + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1 ); +#endif +return KJS::Object(); +} + +KJS::Object QListViewItemImp::QListViewItem_4( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg1; // Dummy + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1 ); +#endif +return KJS::Object(); + +} + +KJS::Object QListViewItemImp::QListViewItem_5( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + + // Unsupported parameter QListView * + return KJS::Value(); + + QListView * arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + QString arg2 = extractQString(exec, args, 2); + + QString arg3 = extractQString(exec, args, 3); + + QString arg4 = extractQString(exec, args, 4); + + QString arg5 = extractQString(exec, args, 5); + + QString arg6 = extractQString(exec, args, 6); + + QString arg7 = extractQString(exec, args, 7); + + QString arg8 = extractQString(exec, args, 8); + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8 ); +#endif +return KJS::Object(); + +} + +KJS::Object QListViewItemImp::QListViewItem_6( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + QString arg2 = extractQString(exec, args, 2); + + QString arg3 = extractQString(exec, args, 3); + + QString arg4 = extractQString(exec, args, 4); + + QString arg5 = extractQString(exec, args, 5); + + QString arg6 = extractQString(exec, args, 6); + + QString arg7 = extractQString(exec, args, 7); + + QString arg8 = extractQString(exec, args, 8); + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8 ); + +#endif +return KJS::Object(); + +} + +KJS::Object QListViewItemImp::QListViewItem_7( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QListView * + return KJS::Value(); + + QListView * arg0; // Dummy + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg1; // Dummy + + QString arg2 = extractQString(exec, args, 2); + + QString arg3 = extractQString(exec, args, 3); + + QString arg4 = extractQString(exec, args, 4); + + QString arg5 = extractQString(exec, args, 5); + + QString arg6 = extractQString(exec, args, 6); + + QString arg7 = extractQString(exec, args, 7); + + QString arg8 = extractQString(exec, args, 8); + + QString arg9 = extractQString(exec, args, 9); + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8, + arg9 ); +#endif +return KJS::Object(); + +} + +KJS::Object QListViewItemImp::QListViewItem_8( KJS::ExecState *exec, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg1; // Dummy + + QString arg2 = extractQString(exec, args, 2); + + QString arg3 = extractQString(exec, args, 3); + + QString arg4 = extractQString(exec, args, 4); + + QString arg5 = extractQString(exec, args, 5); + + QString arg6 = extractQString(exec, args, 6); + + QString arg7 = extractQString(exec, args, 7); + + QString arg8 = extractQString(exec, args, 8); + + QString arg9 = extractQString(exec, args, 9); + + + // We should now create an object of type QListViewItemQListViewItem *ret = new QListViewItem( + + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8, + arg9 ); +#endif +return KJS::Object(); + +} + +KJS::Value QListViewItemImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QListViewItemImp::toQListViewItem( self ); + + switch( id ) { + + case Method_insertItem_10: + return insertItem_10( exec, self, args ); + break; + + case Method_takeItem_11: + return takeItem_11( exec, self, args ); + break; + + case Method_removeItem_12: + return removeItem_12( exec, self, args ); + break; + + case Method_height_13: + return height_13( exec, self, args ); + break; + + case Method_invalidateHeight_14: + return invalidateHeight_14( exec, self, args ); + break; + + case Method_totalHeight_15: + return totalHeight_15( exec, self, args ); + break; + + case Method_width_16: + return width_16( exec, self, args ); + break; + + case Method_widthChanged_17: + return widthChanged_17( exec, self, args ); + break; + + case Method_depth_18: + return depth_18( exec, self, args ); + break; + + case Method_setText_19: + return setText_19( exec, self, args ); + break; + + case Method_text_20: + return text_20( exec, self, args ); + break; + + case Method_setPixmap_21: + return setPixmap_21( exec, self, args ); + break; + + case Method_pixmap_22: + return pixmap_22( exec, self, args ); + break; + + case Method_key_23: + return key_23( exec, self, args ); + break; + + case Method_compare_24: + return compare_24( exec, self, args ); + break; + + case Method_sortChildItems_25: + return sortChildItems_25( exec, self, args ); + break; + + case Method_childCount_26: + return childCount_26( exec, self, args ); + break; + + case Method_isOpen_27: + return isOpen_27( exec, self, args ); + break; + + case Method_setOpen_28: + return setOpen_28( exec, self, args ); + break; + + case Method_setup_29: + return setup_29( exec, self, args ); + break; + + case Method_setSelected_30: + return setSelected_30( exec, self, args ); + break; + + case Method_isSelected_31: + return isSelected_31( exec, self, args ); + break; + + case Method_paintCell_32: + return paintCell_32( exec, self, args ); + break; + + case Method_paintBranches_33: + return paintBranches_33( exec, self, args ); + break; + + case Method_paintFocus_34: + return paintFocus_34( exec, self, args ); + break; + + case Method_firstChild_35: + return firstChild_35( exec, self, args ); + break; + + case Method_nextSibling_36: + return nextSibling_36( exec, self, args ); + break; + + case Method_parent_37: + return parent_37( exec, self, args ); + break; + + case Method_itemAbove_38: + return itemAbove_38( exec, self, args ); + break; + + case Method_itemBelow_39: + return itemBelow_39( exec, self, args ); + break; + + case Method_itemPos_40: + return itemPos_40( exec, self, args ); + break; + + case Method_listView_41: + return listView_41( exec, self, args ); + break; + + case Method_setSelectable_42: + return setSelectable_42( exec, self, args ); + break; + + case Method_isSelectable_43: + return isSelectable_43( exec, self, args ); + break; + + case Method_setExpandable_44: + return setExpandable_44( exec, self, args ); + break; + + case Method_isExpandable_45: + return isExpandable_45( exec, self, args ); + break; + + case Method_repaint_46: + return repaint_46( exec, self, args ); + break; + + case Method_sort_47: + return sort_47( exec, self, args ); + break; + + case Method_moveItem_48: + return moveItem_48( exec, self, args ); + break; + + case Method_setDragEnabled_49: + return setDragEnabled_49( exec, self, args ); + break; + + case Method_setDropEnabled_50: + return setDropEnabled_50( exec, self, args ); + break; + + case Method_dragEnabled_51: + return dragEnabled_51( exec, self, args ); + break; + + case Method_dropEnabled_52: + return dropEnabled_52( exec, self, args ); + break; + + case Method_acceptDrop_53: + return acceptDrop_53( exec, self, args ); + break; + + case Method_setVisible_54: + return setVisible_54( exec, self, args ); + break; + + case Method_isVisible_55: + return isVisible_55( exec, self, args ); + break; + + case Method_setRenameEnabled_56: + return setRenameEnabled_56( exec, self, args ); + break; + + case Method_renameEnabled_57: + return renameEnabled_57( exec, self, args ); + break; + + case Method_startRename_58: + return startRename_58( exec, self, args ); + break; + + case Method_setEnabled_59: + return setEnabled_59( exec, self, args ); + break; + + case Method_isEnabled_60: + return isEnabled_60( exec, self, args ); + break; + + case Method_rtti_61: + return rtti_61( exec, self, args ); + break; + + case Method_setMultiLinesEnabled_62: + return setMultiLinesEnabled_62( exec, self, args ); + break; + + case Method_multiLinesEnabled_63: + return multiLinesEnabled_63( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QListViewItemImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QListViewItemImp::insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->insertItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::takeItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->takeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::removeItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->removeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::height_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->height( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::invalidateHeight_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->invalidateHeight( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::totalHeight_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->totalHeight( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::width_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter const QFontMetrics & + return KJS::Value(); + + const QFontMetrics & arg0; // Dummy + + // Unsupported parameter const QListView * + return KJS::Value(); + + const QListView * arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int ret; + ret = instance->width( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); +#endif +return KJS::Object(); + +} + +KJS::Value QListViewItemImp::widthChanged_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->widthChanged( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::depth_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->depth( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::setText_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString arg1 = extractQString(exec, args, 1); + + instance->setText( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::text_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString ret; + ret = instance->text( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QListViewItemImp::setPixmap_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QPixmap arg1 = extractQPixmap(exec, args, 1); + + instance->setPixmap( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::pixmap_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->pixmap( + arg0 ); + return KJS::Value(); // Returns 'const QPixmap *' + +} + +KJS::Value QListViewItemImp::key_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + QString ret; + ret = instance->key( + arg0, + arg1 ); + return KJS::String( ret ); + +} + +KJS::Value QListViewItemImp::compare_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + bool arg2 = extractBool(exec, args, 2); + + int ret; + ret = instance->compare( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::sortChildItems_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + instance->sortChildItems( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::childCount_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->childCount( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::isOpen_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isOpen( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::setOpen_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setOpen( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::setup_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->setup( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::setSelected_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setSelected( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::isSelected_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isSelected( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::paintCell_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg0; // Dummy + + // Unsupported parameter const QColorGroup & + return KJS::Value(); + + const QColorGroup & arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + instance->paintCell( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Value(); // Returns void +#endif + +return KJS::Object(); +} + +KJS::Value QListViewItemImp::paintBranches_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg0; // Dummy + + // Unsupported parameter const QColorGroup & + return KJS::Value(); + + const QColorGroup & arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + instance->paintBranches( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Value(); // Returns void +#endif +return KJS::Object(); + +} + +KJS::Value QListViewItemImp::paintFocus_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ +#if 0 + // Unsupported parameter QPainter * + return KJS::Value(); + + QPainter * arg0; // Dummy + + // Unsupported parameter const QColorGroup & + return KJS::Value(); + + const QColorGroup & arg1; // Dummy + + QRect arg2 = extractQRect(exec, args, 2); + + instance->paintFocus( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void +#endif +return KJS::Object(); + +} + +KJS::Value QListViewItemImp::firstChild_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QListViewItem *item = instance->firstChild( ); + if( item ) + { + JSOpaqueProxy *prx = new JSOpaqueProxy( item, "QListViewItem" ); + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(exec,proxyObj); + return proxyObj; + } + else + return KJS::Null(); + +} + +KJS::Value QListViewItemImp::nextSibling_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QListViewItem *item = instance->nextSibling( ); + if( item ) + { + JSOpaqueProxy *prx = new JSOpaqueProxy( item, "QListViewItem" ); + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(exec,proxyObj); + return proxyObj; + } + else + return KJS::Null(); + +} + +KJS::Value QListViewItemImp::parent_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QListViewItem *item = instance->parent( ); + if( item ) + { + JSOpaqueProxy *prx = new JSOpaqueProxy( item, "QListViewItem" ); + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(exec,proxyObj); + return proxyObj; + } + else + return KJS::Null(); + +} + +KJS::Value QListViewItemImp::itemAbove_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QListViewItem *item = instance->itemAbove( ); + if( item ) + { + JSOpaqueProxy *prx = new JSOpaqueProxy( item, "QListViewItem" ); + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(exec,proxyObj); + return proxyObj; + } + else + return KJS::Null(); + +} + +KJS::Value QListViewItemImp::itemBelow_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QListViewItem *item = instance->itemBelow( ); + if( item ) + { + JSOpaqueProxy *prx = new JSOpaqueProxy( item, "QListViewItem" ); + prx->setOwner( JSProxy::Native ); + KJS::Object proxyObj( prx ); + addBindings(exec,proxyObj); + return proxyObj; + } + else + return KJS::Null(); + +} + +KJS::Value QListViewItemImp::itemPos_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->itemPos( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::listView_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->listView( ); + return KJS::Value(); // Returns 'QListView *' + +} + +KJS::Value QListViewItemImp::setSelectable_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setSelectable( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::isSelectable_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isSelectable( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::setExpandable_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setExpandable( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::isExpandable_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isExpandable( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::repaint_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->repaint( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::sort_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->sort( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::moveItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QListViewItem * + return KJS::Value(); + + QListViewItem * arg0; // Dummy + + instance->moveItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::setDragEnabled_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setDragEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::setDropEnabled_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setDropEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::dragEnabled_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->dragEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::dropEnabled_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->dropEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::acceptDrop_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QMimeSource * + return KJS::Value(); + + const QMimeSource * arg0; // Dummy + + bool ret; + ret = instance->acceptDrop( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::setVisible_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setVisible( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::isVisible_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isVisible( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::setRenameEnabled_56( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + instance->setRenameEnabled( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::renameEnabled_57( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool ret; + ret = instance->renameEnabled( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::startRename_58( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->startRename( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::setEnabled_59( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::isEnabled_60( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QListViewItemImp::rtti_61( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->rtti( ); + return KJS::Number( ret ); + +} + +KJS::Value QListViewItemImp::setMultiLinesEnabled_62( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setMultiLinesEnabled( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QListViewItemImp::multiLinesEnabled_63( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->multiLinesEnabled( ); + return KJS::Boolean( ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qlistviewitem_imp.h b/kjsembed/qtbindings/qlistviewitem_imp.h new file mode 100644 index 00000000..590cde36 --- /dev/null +++ b/kjsembed/qtbindings/qlistviewitem_imp.h @@ -0,0 +1,229 @@ + + + +#ifndef KJSEMBED_QListViewItem_H +#define KJSEMBED_QListViewItem_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> +#include <kjsembed/jsbindingbase.h> + +class QListViewItem; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { +namespace Bindings { + + class QListViewItemLoader : public JSBindingBase + { + public: + KJS::Object createBinding(KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const; + void addBindings( KJSEmbedPart *jspart, KJS::ExecState *exec, KJS::Object &proxy) const; + }; +} +/** + * Wrapper class for QListViewItem methods. + * + * @author Richard Moore, [email protected] + */ +class QListViewItemImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QListViewItem_1, + Constructor_QListViewItem_2, + Constructor_QListViewItem_3, + Constructor_QListViewItem_4, + Constructor_QListViewItem_5, + Constructor_QListViewItem_6, + Constructor_QListViewItem_7, + Constructor_QListViewItem_8, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_insertItem_10, + Method_takeItem_11, + Method_removeItem_12, + Method_height_13, + Method_invalidateHeight_14, + Method_totalHeight_15, + Method_width_16, + Method_widthChanged_17, + Method_depth_18, + Method_setText_19, + Method_text_20, + Method_setPixmap_21, + Method_pixmap_22, + Method_key_23, + Method_compare_24, + Method_sortChildItems_25, + Method_childCount_26, + Method_isOpen_27, + Method_setOpen_28, + Method_setup_29, + Method_setSelected_30, + Method_isSelected_31, + Method_paintCell_32, + Method_paintBranches_33, + Method_paintFocus_34, + Method_firstChild_35, + Method_nextSibling_36, + Method_parent_37, + Method_itemAbove_38, + Method_itemBelow_39, + Method_itemPos_40, + Method_listView_41, + Method_setSelectable_42, + Method_isSelectable_43, + Method_setExpandable_44, + Method_isExpandable_45, + Method_repaint_46, + Method_sort_47, + Method_moveItem_48, + Method_setDragEnabled_49, + Method_setDropEnabled_50, + Method_dragEnabled_51, + Method_dropEnabled_52, + Method_acceptDrop_53, + Method_setVisible_54, + Method_isVisible_55, + Method_setRenameEnabled_56, + Method_renameEnabled_57, + Method_startRename_58, + Method_setEnabled_59, + Method_isEnabled_60, + Method_rtti_61, + Method_setMultiLinesEnabled_62, + Method_multiLinesEnabled_63, + Method_Last = -1 + }; + + QListViewItemImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QListViewItemImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QListViewItem *toQListViewItem( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QListViewItem_1( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_2( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_3( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_4( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_5( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_6( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_7( KJS::ExecState *exec, const KJS::List &args ); + KJS::Object QListViewItem_8( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value takeItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value height_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value invalidateHeight_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value totalHeight_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value width_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value widthChanged_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value depth_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setText_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setPixmap_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value pixmap_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value key_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value compare_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sortChildItems_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value childCount_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isOpen_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setOpen_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setup_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelected_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isSelected_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value paintCell_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value paintBranches_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value paintFocus_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value firstChild_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value nextSibling_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value parent_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemAbove_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemBelow_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemPos_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value listView_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setSelectable_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isSelectable_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setExpandable_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isExpandable_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value repaint_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sort_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value moveItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDragEnabled_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDropEnabled_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value dragEnabled_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value dropEnabled_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value acceptDrop_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setVisible_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isVisible_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setRenameEnabled_56( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value renameEnabled_57( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value startRename_58( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setEnabled_59( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isEnabled_60( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value rtti_61( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setMultiLinesEnabled_62( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value multiLinesEnabled_63( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QListViewItem *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QListViewItem_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qmenudata_imp.cpp b/kjsembed/qtbindings/qmenudata_imp.cpp new file mode 100644 index 00000000..aecd1808 --- /dev/null +++ b/kjsembed/qtbindings/qmenudata_imp.cpp @@ -0,0 +1,1351 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> +#include <qkeysequence.h> +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qmenudata.h> +#include "qmenudata_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QMenuDataImp::QMenuDataImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QMenuDataImp::~QMenuDataImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QMenuDataImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QMenuDataImp *meth = new QMenuDataImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QMenuDataImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_count_3, "count" }, + { Method_insertItem_4, "insertItem" }, + { Method_insertItem_5, "insertItem" }, + { Method_insertItem_6, "insertItem" }, + { Method_insertItem_7, "insertItem" }, + { Method_insertItem_8, "insertItem" }, + { Method_insertItem_9, "insertItem" }, + { Method_insertItem_10, "insertItem" }, + { Method_insertItem_11, "insertItem" }, + { Method_insertItem_12, "insertItem" }, + { Method_insertItem_13, "insertItem" }, + { Method_insertItem_14, "insertItem" }, + { Method_insertItem_15, "insertItem" }, + { Method_insertItem_16, "insertItem" }, + { Method_insertItem_17, "insertItem" }, + { Method_insertItem_18, "insertItem" }, + { Method_insertSeparator_19, "insertSeparator" }, + { Method_removeItem_20, "removeItem" }, + { Method_removeItemAt_21, "removeItemAt" }, + { Method_clear_22, "clear" }, + { Method_accel_23, "accel" }, + { Method_setAccel_24, "setAccel" }, + { Method_iconSet_25, "iconSet" }, + { Method_text_26, "text" }, + { Method_pixmap_27, "pixmap" }, + { Method_setWhatsThis_28, "setWhatsThis" }, + { Method_whatsThis_29, "whatsThis" }, + { Method_changeItem_30, "changeItem" }, + { Method_changeItem_31, "changeItem" }, + { Method_changeItem_32, "changeItem" }, + { Method_changeItem_33, "changeItem" }, + { Method_changeItem_34, "changeItem" }, + { Method_changeItem_35, "changeItem" }, + { Method_changeItem_36, "changeItem" }, + { Method_isItemActive_37, "isItemActive" }, + { Method_isItemEnabled_38, "isItemEnabled" }, + { Method_setItemEnabled_39, "setItemEnabled" }, + { Method_isItemChecked_40, "isItemChecked" }, + { Method_setItemChecked_41, "setItemChecked" }, + { Method_isItemVisible_42, "isItemVisible" }, + { Method_setItemVisible_43, "setItemVisible" }, + { Method_updateItem_44, "updateItem" }, + { Method_indexOf_45, "indexOf" }, + { Method_idAt_46, "idAt" }, + { Method_setId_47, "setId" }, + { Method_connectItem_48, "connectItem" }, + { Method_disconnectItem_49, "disconnectItem" }, + { Method_setItemParameter_50, "setItemParameter" }, + { Method_itemParameter_51, "itemParameter" }, + { Method_findItem_52, "findItem" }, + { Method_findItem_53, "findItem" }, + { Method_findPopup_54, "findPopup" }, + { Method_activateItemAt_55, "activateItemAt" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QMenuDataImp *meth = new QMenuDataImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QMenuData pointer from an Object. + */ +QMenuData *QMenuDataImp::toQMenuData( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QMenuData *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QMenuData" ) + return 0; + + return op->toNative<QMenuData>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QMenuDataImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QMenuData_1: + return QMenuData_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QMenuDataCons has no constructor with id '%1'").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QMenuDataImp::QMenuData_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + + // We should now create an instance of the QMenuData object + + QMenuData *ret = new QMenuData( + ); + + return KJS::Object(); +} + +KJS::Value QMenuDataImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QMenuDataImp::toQMenuData( self ); + + switch( id ) { + + case Method_count_3: + return count_3( exec, self, args ); + break; + + case Method_insertItem_4: + return insertItem_4( exec, self, args ); + break; + + case Method_insertItem_5: + return insertItem_5( exec, self, args ); + break; + + case Method_insertItem_6: + return insertItem_6( exec, self, args ); + break; + + case Method_insertItem_7: + return insertItem_7( exec, self, args ); + break; + + case Method_insertItem_8: + return insertItem_8( exec, self, args ); + break; + + case Method_insertItem_9: + return insertItem_9( exec, self, args ); + break; + + case Method_insertItem_10: + return insertItem_10( exec, self, args ); + break; + + case Method_insertItem_11: + return insertItem_11( exec, self, args ); + break; + + case Method_insertItem_12: + return insertItem_12( exec, self, args ); + break; + + case Method_insertItem_13: + return insertItem_13( exec, self, args ); + break; + + case Method_insertItem_14: + return insertItem_14( exec, self, args ); + break; + + case Method_insertItem_15: + return insertItem_15( exec, self, args ); + break; + + case Method_insertItem_16: + return insertItem_16( exec, self, args ); + break; + + case Method_insertItem_17: + return insertItem_17( exec, self, args ); + break; + + case Method_insertItem_18: + return insertItem_18( exec, self, args ); + break; + + case Method_insertSeparator_19: + return insertSeparator_19( exec, self, args ); + break; + + case Method_removeItem_20: + return removeItem_20( exec, self, args ); + break; + + case Method_removeItemAt_21: + return removeItemAt_21( exec, self, args ); + break; + + case Method_clear_22: + return clear_22( exec, self, args ); + break; + + case Method_accel_23: + return accel_23( exec, self, args ); + break; + + case Method_setAccel_24: + return setAccel_24( exec, self, args ); + break; + + case Method_iconSet_25: + return iconSet_25( exec, self, args ); + break; + + case Method_text_26: + return text_26( exec, self, args ); + break; + + case Method_pixmap_27: + return pixmap_27( exec, self, args ); + break; + + case Method_setWhatsThis_28: + return setWhatsThis_28( exec, self, args ); + break; + + case Method_whatsThis_29: + return whatsThis_29( exec, self, args ); + break; + + case Method_changeItem_30: + return changeItem_30( exec, self, args ); + break; + + case Method_changeItem_31: + return changeItem_31( exec, self, args ); + break; + + case Method_changeItem_32: + return changeItem_32( exec, self, args ); + break; + + case Method_changeItem_33: + return changeItem_33( exec, self, args ); + break; + + case Method_changeItem_34: + return changeItem_34( exec, self, args ); + break; + + case Method_changeItem_35: + return changeItem_35( exec, self, args ); + break; + + case Method_changeItem_36: + return changeItem_36( exec, self, args ); + break; + + case Method_isItemActive_37: + return isItemActive_37( exec, self, args ); + break; + + case Method_isItemEnabled_38: + return isItemEnabled_38( exec, self, args ); + break; + + case Method_setItemEnabled_39: + return setItemEnabled_39( exec, self, args ); + break; + + case Method_isItemChecked_40: + return isItemChecked_40( exec, self, args ); + break; + + case Method_setItemChecked_41: + return setItemChecked_41( exec, self, args ); + break; + + case Method_isItemVisible_42: + return isItemVisible_42( exec, self, args ); + break; + + case Method_setItemVisible_43: + return setItemVisible_43( exec, self, args ); + break; + + case Method_updateItem_44: + return updateItem_44( exec, self, args ); + break; + + case Method_indexOf_45: + return indexOf_45( exec, self, args ); + break; + + case Method_idAt_46: + return idAt_46( exec, self, args ); + break; + + case Method_setId_47: + return setId_47( exec, self, args ); + break; + + case Method_connectItem_48: + return connectItem_48( exec, self, args ); + break; + + case Method_disconnectItem_49: + return disconnectItem_49( exec, self, args ); + break; + + case Method_setItemParameter_50: + return setItemParameter_50( exec, self, args ); + break; + + case Method_itemParameter_51: + return itemParameter_51( exec, self, args ); + break; + + case Method_findItem_52: + return findItem_52( exec, self, args ); + break; + + case Method_findItem_53: + return findItem_53( exec, self, args ); + break; + + case Method_findPopup_54: + return findPopup_54( exec, self, args ); + break; + + case Method_activateItemAt_55: + return activateItemAt_55( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QMenuDataImp has no method with id '%1'" ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QMenuDataImp::count_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + uint ret; + ret = instance->count( ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg1; // Dummy + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + // Unsupported parameter const QKeySequence + return KJS::Value(); + + const QKeySequence arg3; // Dummy + + int arg4 = extractInt(exec, args, 4); + + int arg5 = extractInt(exec, args, 5); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg2; // Dummy + + const char *arg3 = (args.size() >= 4) ? args[3].toString(exec).ascii() : 0; + + // Unsupported parameter const QKeySequence + return KJS::Value(); + + const QKeySequence arg4; // Dummy + + int arg5 = extractInt(exec, args, 5); + + int arg6 = extractInt(exec, args, 6); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg1; // Dummy + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + // Unsupported parameter const QKeySequence + return KJS::Value(); + + const QKeySequence arg3; // Dummy + + int arg4 = extractInt(exec, args, 4); + + int arg5 = extractInt(exec, args, 5); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QPixmap arg1 = extractQPixmap(exec, args, 1); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg2; // Dummy + + const char *arg3 = (args.size() >= 4) ? args[3].toString(exec).ascii() : 0; + + // Unsupported parameter const QKeySequence + return KJS::Value(); + + const QKeySequence arg4; // Dummy + + int arg5 = extractInt(exec, args, 5); + + int arg6 = extractInt(exec, args, 6); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + // Unsupported parameter QPopupMenu * + return KJS::Value(); + + QPopupMenu * arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + // Unsupported parameter QPopupMenu * + return KJS::Value(); + + QPopupMenu * arg2; // Dummy + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QPixmap arg1 = extractQPixmap(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + // Unsupported parameter QPopupMenu * + return KJS::Value(); + + QPopupMenu * arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QPixmap arg1 = extractQPixmap(exec, args, 1); + + // Unsupported parameter QPopupMenu * + return KJS::Value(); + + QPopupMenu * arg2; // Dummy + + int arg3 = extractInt(exec, args, 3); + + int arg4 = extractInt(exec, args, 4); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3, + arg4 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QWidget * + return KJS::Value(); + + QWidget * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + // Unsupported parameter QCustomMenuItem * + return KJS::Value(); + + QCustomMenuItem * arg1; // Dummy + + int arg2 = extractInt(exec, args, 2); + + int arg3 = extractInt(exec, args, 3); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2, + arg3 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertItem_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QCustomMenuItem * + return KJS::Value(); + + QCustomMenuItem * arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + int ret; + ret = instance->insertItem( + arg0, + arg1, + arg2 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::insertSeparator_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->insertSeparator( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::removeItem_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->removeItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::removeItemAt_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->removeItemAt( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::clear_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->clear( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::accel_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->accel( + arg0 ); + return KJS::Value(); // Returns 'QKeySequence' + +} + +KJS::Value QMenuDataImp::setAccel_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QKeySequence + return KJS::Value(); + + const QKeySequence arg0; // Dummy + + int arg1 = extractInt(exec, args, 1); + + instance->setAccel( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::iconSet_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->iconSet( + arg0 ); + return KJS::Value(); // Returns 'QIconSet *' + +} + +KJS::Value QMenuDataImp::text_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString ret; + ret = instance->text( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QMenuDataImp::pixmap_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->pixmap( + arg0 ); + return KJS::Value(); // Returns 'QPixmap *' + +} + +KJS::Value QMenuDataImp::setWhatsThis_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString arg1 = extractQString(exec, args, 1); + + instance->setWhatsThis( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::whatsThis_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString ret; + ret = instance->whatsThis( + arg0 ); + return KJS::String( ret ); + +} + +KJS::Value QMenuDataImp::changeItem_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QString arg1 = extractQString(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + QPixmap arg1 = extractQPixmap(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg1; // Dummy + + QString arg2 = extractQString(exec, args, 2); + + instance->changeItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg1; // Dummy + + QPixmap arg2 = extractQPixmap(exec, args, 2); + + instance->changeItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPixmap arg0 = extractQPixmap(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->changeItem( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::changeItem_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter const QIconSet + return KJS::Value(); + + const QIconSet arg0; // Dummy + + QString arg1 = extractQString(exec, args, 1); + + int arg2 = extractInt(exec, args, 2); + + instance->changeItem( + arg0, + arg1, + arg2 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::isItemActive_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool ret; + ret = instance->isItemActive( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::isItemEnabled_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool ret; + ret = instance->isItemEnabled( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::setItemEnabled_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + instance->setItemEnabled( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::isItemChecked_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool ret; + ret = instance->isItemChecked( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::setItemChecked_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + instance->setItemChecked( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::isItemVisible_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool ret; + ret = instance->isItemVisible( + arg0 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::setItemVisible_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + bool arg1 = extractBool(exec, args, 1); + + instance->setItemVisible( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::updateItem_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->updateItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::indexOf_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->indexOf( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::idAt_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->idAt( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::setId_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->setId( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuDataImp::connectItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg1; // Dummy + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + bool ret; + ret = instance->connectItem( + arg0, + arg1, + arg2 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::disconnectItem_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter const QObject * + return KJS::Value(); + + const QObject * arg1; // Dummy + + const char *arg2 = (args.size() >= 3) ? args[2].toString(exec).ascii() : 0; + + bool ret; + ret = instance->disconnectItem( + arg0, + arg1, + arg2 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::setItemParameter_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + bool ret; + ret = instance->setItemParameter( + arg0, + arg1 ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuDataImp::itemParameter_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->itemParameter( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuDataImp::findItem_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->findItem( + arg0 ); + return KJS::Value(); // Returns 'QMenuItem *' + +} + +KJS::Value QMenuDataImp::findItem_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + // Unsupported parameter QMenuData ** + return KJS::Value(); + + QMenuData ** arg1; // Dummy + + instance->findItem( + arg0, + arg1 ); + return KJS::Value(); // Returns 'QMenuItem *' + +} + +KJS::Value QMenuDataImp::findPopup_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + // Unsupported parameter QPopupMenu * + return KJS::Value(); + + QPopupMenu * arg0; // Dummy + + // Unsupported parameter int * + return KJS::Value(); + + int * arg1; // Dummy + + instance->findPopup( + arg0, + arg1 ); + return KJS::Value(); // Returns 'QMenuItem *' + +} + +KJS::Value QMenuDataImp::activateItemAt_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->activateItemAt( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qmenudata_imp.h b/kjsembed/qtbindings/qmenudata_imp.h new file mode 100644 index 00000000..f5ed75b4 --- /dev/null +++ b/kjsembed/qtbindings/qmenudata_imp.h @@ -0,0 +1,204 @@ + + + +#ifndef KJSEMBED_QMenuData_H +#define KJSEMBED_QMenuData_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QMenuData; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QMenuData methods. + * + * @author Richard Moore, [email protected] + */ +class QMenuDataImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QMenuData_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_count_3, + Method_insertItem_4, + Method_insertItem_5, + Method_insertItem_6, + Method_insertItem_7, + Method_insertItem_8, + Method_insertItem_9, + Method_insertItem_10, + Method_insertItem_11, + Method_insertItem_12, + Method_insertItem_13, + Method_insertItem_14, + Method_insertItem_15, + Method_insertItem_16, + Method_insertItem_17, + Method_insertItem_18, + Method_insertSeparator_19, + Method_removeItem_20, + Method_removeItemAt_21, + Method_clear_22, + Method_accel_23, + Method_setAccel_24, + Method_iconSet_25, + Method_text_26, + Method_pixmap_27, + Method_setWhatsThis_28, + Method_whatsThis_29, + Method_changeItem_30, + Method_changeItem_31, + Method_changeItem_32, + Method_changeItem_33, + Method_changeItem_34, + Method_changeItem_35, + Method_changeItem_36, + Method_isItemActive_37, + Method_isItemEnabled_38, + Method_setItemEnabled_39, + Method_isItemChecked_40, + Method_setItemChecked_41, + Method_isItemVisible_42, + Method_setItemVisible_43, + Method_updateItem_44, + Method_indexOf_45, + Method_idAt_46, + Method_setId_47, + Method_connectItem_48, + Method_disconnectItem_49, + Method_setItemParameter_50, + Method_itemParameter_51, + Method_findItem_52, + Method_findItem_53, + Method_findPopup_54, + Method_activateItemAt_55, + Method_Last = -1 + }; + + QMenuDataImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QMenuDataImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QMenuData *toQMenuData( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QMenuData_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value count_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertItem_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertSeparator_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItem_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value removeItemAt_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value clear_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value accel_23( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setAccel_24( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value iconSet_25( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_26( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value pixmap_27( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setWhatsThis_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value whatsThis_29( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_31( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_32( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_33( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_34( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_35( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value changeItem_36( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isItemActive_37( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isItemEnabled_38( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setItemEnabled_39( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isItemChecked_40( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setItemChecked_41( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isItemVisible_42( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setItemVisible_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value updateItem_44( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value indexOf_45( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value idAt_46( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setId_47( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value connectItem_48( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value disconnectItem_49( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setItemParameter_50( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemParameter_51( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value findItem_52( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value findItem_53( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value findPopup_54( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value activateItemAt_55( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QMenuData *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QMenuData_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qmenuitem_imp.cpp b/kjsembed/qtbindings/qmenuitem_imp.cpp new file mode 100644 index 00000000..fa994b21 --- /dev/null +++ b/kjsembed/qtbindings/qmenuitem_imp.cpp @@ -0,0 +1,430 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qmenudata.h> +#include "qmenuitem_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QMenuItemImp::QMenuItemImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QMenuItemImp::~QMenuItemImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QMenuItemImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QMenuItemImp *meth = new QMenuItemImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QMenuItemImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + { Method_id_3, "id" }, + { Method_iconSet_4, "iconSet" }, + { Method_text_5, "text" }, + { Method_whatsThis_6, "whatsThis" }, + { Method_pixmap_7, "pixmap" }, + { Method_popup_8, "popup" }, + { Method_widget_9, "widget" }, + { Method_custom_10, "custom" }, + { Method_key_11, "key" }, + { Method_signal_12, "signal" }, + { Method_isSeparator_13, "isSeparator" }, + { Method_isEnabled_14, "isEnabled" }, + { Method_isChecked_15, "isChecked" }, + { Method_isDirty_16, "isDirty" }, + { Method_isVisible_17, "isVisible" }, + { Method_isEnabledAndVisible_18, "isEnabledAndVisible" }, + { Method_setText_19, "setText" }, + { Method_setDirty_20, "setDirty" }, + { Method_setVisible_21, "setVisible" }, + { Method_setWhatsThis_22, "setWhatsThis" }, + { 0, 0 } + }; + + JSProxy::addMethods<QMenuItemImp>(exec, methods, object ); + +} + +/** + * Extract a QMenuItem pointer from an Object. + */ +QMenuItem *QMenuItemImp::toQMenuItem( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QMenuItem *>( obj ); + } + + if( !JSProxy::checkType(self, JSProxy::ObjectProxy, "QMenuItem") ) { + QObject *obj = JSProxy::toObjectProxy( self.imp() )->object(); + return dynamic_cast<QMenuItem *>( obj ); + } + + if( !JSProxy::checkType(self, JSProxy::OpaqueProxy, "QMenuItem") ) { + return JSProxy::toOpaqueProxy( self.imp() )->toNative<QMenuItem>(); + } + return 0; + +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QMenuItemImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QMenuItem_1: + return QMenuItem_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QMenuItemCons has no constructor with id '%1'").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QMenuItemImp::QMenuItem_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + + // We should now create an instance of the QMenuItem object + + QMenuItem *ret = new QMenuItem( + ); + + return KJS::Object(); +} + +KJS::Value QMenuItemImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QMenuItemImp::toQMenuItem( self ); + + switch( id ) { + + case Method_id_3: + return id_3( exec, self, args ); + break; + + case Method_iconSet_4: + return iconSet_4( exec, self, args ); + break; + + case Method_text_5: + return text_5( exec, self, args ); + break; + + case Method_whatsThis_6: + return whatsThis_6( exec, self, args ); + break; + + case Method_pixmap_7: + return pixmap_7( exec, self, args ); + break; + + case Method_popup_8: + return popup_8( exec, self, args ); + break; + + case Method_widget_9: + return widget_9( exec, self, args ); + break; + + case Method_custom_10: + return custom_10( exec, self, args ); + break; + + case Method_key_11: + return key_11( exec, self, args ); + break; + + case Method_signal_12: + return signal_12( exec, self, args ); + break; + + case Method_isSeparator_13: + return isSeparator_13( exec, self, args ); + break; + + case Method_isEnabled_14: + return isEnabled_14( exec, self, args ); + break; + + case Method_isChecked_15: + return isChecked_15( exec, self, args ); + break; + + case Method_isDirty_16: + return isDirty_16( exec, self, args ); + break; + + case Method_isVisible_17: + return isVisible_17( exec, self, args ); + break; + + case Method_isEnabledAndVisible_18: + return isEnabledAndVisible_18( exec, self, args ); + break; + + case Method_setText_19: + return setText_19( exec, self, args ); + break; + + case Method_setDirty_20: + return setDirty_20( exec, self, args ); + break; + + case Method_setVisible_21: + return setVisible_21( exec, self, args ); + break; + + case Method_setWhatsThis_22: + return setWhatsThis_22( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QMenuItemImp has no method with id '%1'" ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QMenuItemImp::id_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->id( ); + return KJS::Number( ret ); + +} + +KJS::Value QMenuItemImp::iconSet_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->iconSet( ); + return KJS::Value(); // Returns 'QIconSet *' + +} + +KJS::Value QMenuItemImp::text_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString ret; + ret = instance->text( ); + return KJS::String( ret ); + +} + +KJS::Value QMenuItemImp::whatsThis_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString ret; + ret = instance->whatsThis( ); + return KJS::String( ret ); + +} + +KJS::Value QMenuItemImp::pixmap_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + return convertToValue(exec, *instance->pixmap( )); + +} + +KJS::Value QMenuItemImp::popup_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->popup( ); + return KJS::Value(); // Returns 'QPopupMenu *' + +} + +KJS::Value QMenuItemImp::widget_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->widget( ); + return KJS::Value(); // Returns 'QWidget *' + +} + +KJS::Value QMenuItemImp::custom_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->custom( ); + return KJS::Value(); // Returns 'QCustomMenuItem *' + +} + +KJS::Value QMenuItemImp::key_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + return convertToValue( exec, instance->key( )); + +} + +KJS::Value QMenuItemImp::signal_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->signal( ); + return KJS::Value(); // Returns 'QSignal *' + +} + +KJS::Value QMenuItemImp::isSeparator_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isSeparator( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::isEnabled_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isEnabled( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::isChecked_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isChecked( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::isDirty_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isDirty( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::isVisible_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isVisible( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::isEnabledAndVisible_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isEnabledAndVisible( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QMenuItemImp::setText_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + instance->setText( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuItemImp::setDirty_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setDirty( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuItemImp::setVisible_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setVisible( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QMenuItemImp::setWhatsThis_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QString arg0 = extractQString(exec, args, 0); + + instance->setWhatsThis( + arg0 ); + return KJS::Value(); // Returns void + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qmenuitem_imp.h b/kjsembed/qtbindings/qmenuitem_imp.h new file mode 100644 index 00000000..3b1935d2 --- /dev/null +++ b/kjsembed/qtbindings/qmenuitem_imp.h @@ -0,0 +1,138 @@ + + + +#ifndef KJSEMBED_QMenuItem_H +#define KJSEMBED_QMenuItem_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QMenuItem; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QMenuItem methods. + * + * @author Richard Moore, [email protected] + */ +class QMenuItemImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QMenuItem_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_id_3, + Method_iconSet_4, + Method_text_5, + Method_whatsThis_6, + Method_pixmap_7, + Method_popup_8, + Method_widget_9, + Method_custom_10, + Method_key_11, + Method_signal_12, + Method_isSeparator_13, + Method_isEnabled_14, + Method_isChecked_15, + Method_isDirty_16, + Method_isVisible_17, + Method_isEnabledAndVisible_18, + Method_setText_19, + Method_setDirty_20, + Method_setVisible_21, + Method_setWhatsThis_22, + Method_Last = -1 + }; + + QMenuItemImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QMenuItemImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QMenuItem *toQMenuItem( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QMenuItem_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value id_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value iconSet_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value text_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value whatsThis_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value pixmap_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value popup_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value widget_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value custom_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value key_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value signal_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isSeparator_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isEnabled_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isChecked_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isDirty_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isVisible_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isEnabledAndVisible_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setText_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setDirty_20( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setVisible_21( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setWhatsThis_22( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QMenuItem *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QMenuItem_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qpopupmenu_imp.cpp b/kjsembed/qtbindings/qpopupmenu_imp.cpp new file mode 100644 index 00000000..14430351 --- /dev/null +++ b/kjsembed/qtbindings/qpopupmenu_imp.cpp @@ -0,0 +1,440 @@ + + + +#include <qcstring.h> +#include <qimage.h> +#include <qpainter.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qpopupmenu.h> +#include "qpopupmenu_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QPopupMenuImp::QPopupMenuImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QPopupMenuImp::~QPopupMenuImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QPopupMenuImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QPopupMenuImp *meth = new QPopupMenuImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QPopupMenuImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { Method_popup_3, "popup" }, + { Method_updateItem_4, "updateItem" }, + { Method_setCheckable_5, "setCheckable" }, + { Method_isCheckable_6, "isCheckable" }, + { Method_setFont_7, "setFont" }, + { Method_show_8, "show" }, + { Method_hide_9, "hide" }, + { Method_exec_10, "exec" }, + { Method_exec_11, "exec" }, + { Method_setActiveItem_12, "setActiveItem" }, + { Method_sizeHint_13, "sizeHint" }, + { Method_idAt_14, "idAt" }, + { Method_idAt_15, "idAt" }, + { Method_customWhatsThis_16, "customWhatsThis" }, + { Method_insertTearOffHandle_17, "insertTearOffHandle" }, + { Method_activateItemAt_18, "activateItemAt" }, + { Method_itemGeometry_19, "itemGeometry" }, + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QPopupMenuImp *meth = new QPopupMenuImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a QPopupMenu pointer from an Object. + */ +QPopupMenu *QPopupMenuImp::toQPopupMenu( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<QPopupMenu *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "QPopupMenu" ) + return 0; + + return op->toNative<QPopupMenu>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QPopupMenuImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + case Constructor_QPopupMenu_1: + return QPopupMenu_1( exec, args ); + break; + + default: + break; + } + + QString msg = i18n("QPopupMenuCons has no constructor with id '%1'").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Object QPopupMenuImp::QPopupMenu_1( KJS::ExecState *exec, const KJS::List &args ) +{ + + // Unsupported parameter QWidget * + return KJS::Object(); + + QWidget * arg0; // Dummy + + const char *arg1 = (args.size() >= 2) ? args[1].toString(exec).ascii() : 0; + + + // We should now create an instance of the QPopupMenu object + + QPopupMenu *ret = new QPopupMenu( + + arg0, + arg1 ); + + +} + +KJS::Value QPopupMenuImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QPopupMenuImp::toQPopupMenu( self ); + + switch( id ) { + + case Method_popup_3: + return popup_3( exec, self, args ); + break; + + case Method_updateItem_4: + return updateItem_4( exec, self, args ); + break; + + case Method_setCheckable_5: + return setCheckable_5( exec, self, args ); + break; + + case Method_isCheckable_6: + return isCheckable_6( exec, self, args ); + break; + + case Method_setFont_7: + return setFont_7( exec, self, args ); + break; + + case Method_show_8: + return show_8( exec, self, args ); + break; + + case Method_hide_9: + return hide_9( exec, self, args ); + break; + + case Method_exec_10: + return exec_10( exec, self, args ); + break; + + case Method_exec_11: + return exec_11( exec, self, args ); + break; + + case Method_setActiveItem_12: + return setActiveItem_12( exec, self, args ); + break; + + case Method_sizeHint_13: + return sizeHint_13( exec, self, args ); + break; + + case Method_idAt_14: + return idAt_14( exec, self, args ); + break; + + case Method_idAt_15: + return idAt_15( exec, self, args ); + break; + + case Method_customWhatsThis_16: + return customWhatsThis_16( exec, self, args ); + break; + + case Method_insertTearOffHandle_17: + return insertTearOffHandle_17( exec, self, args ); + break; + + case Method_activateItemAt_18: + return activateItemAt_18( exec, self, args ); + break; + + case Method_itemGeometry_19: + return itemGeometry_19( exec, self, args ); + break; + + default: + break; + } + + QString msg = i18n( "QPopupMenuImp has no method with id '%1'" ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QPopupMenuImp::popup_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + instance->popup( + arg0, + arg1 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::updateItem_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->updateItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::setCheckable_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool arg0 = extractBool(exec, args, 0); + + instance->setCheckable( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::isCheckable_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->isCheckable( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QPopupMenuImp::setFont_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QFont arg0 = extractQFont(exec, args, 0); + + instance->setFont( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::show_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->show( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::hide_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + instance->hide( ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::exec_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int ret; + ret = instance->exec( ); + return KJS::Number( ret ); + +} + +KJS::Value QPopupMenuImp::exec_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int ret; + ret = instance->exec( + arg0, + arg1 ); + return KJS::Number( ret ); + +} + +KJS::Value QPopupMenuImp::setActiveItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->setActiveItem( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::sizeHint_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + QSize ret; + ret = instance->sizeHint( ); + + return convertToValue( exec, ret ); + +} + +KJS::Value QPopupMenuImp::idAt_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int ret; + ret = instance->idAt( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QPopupMenuImp::idAt_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + QPoint arg0 = extractQPoint(exec, args, 0); + + int ret; + ret = instance->idAt( + arg0 ); + return KJS::Number( ret ); + +} + +KJS::Value QPopupMenuImp::customWhatsThis_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + bool ret; + ret = instance->customWhatsThis( ); + return KJS::Boolean( ret ); + +} + +KJS::Value QPopupMenuImp::insertTearOffHandle_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + int arg1 = extractInt(exec, args, 1); + + int ret; + ret = instance->insertTearOffHandle( + arg0, + arg1 ); + return KJS::Number( ret ); + +} + +KJS::Value QPopupMenuImp::activateItemAt_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + + instance->activateItemAt( + arg0 ); + return KJS::Value(); // Returns void + +} + +KJS::Value QPopupMenuImp::itemGeometry_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ) +{ + + int arg0 = extractInt(exec, args, 0); + QRect ret; + ret = instance->itemGeometry( + arg0 ); + + return convertToValue( exec, ret ); + +} + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qpopupmenu_imp.h b/kjsembed/qtbindings/qpopupmenu_imp.h new file mode 100644 index 00000000..6695f486 --- /dev/null +++ b/kjsembed/qtbindings/qpopupmenu_imp.h @@ -0,0 +1,132 @@ + + + +#ifndef KJSEMBED_QPopupMenu_H +#define KJSEMBED_QPopupMenu_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class QPopupMenu; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for QPopupMenu methods. + * + * @author Richard Moore, [email protected] + */ +class QPopupMenuImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + Constructor_QPopupMenu_1, + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_popup_3, + Method_updateItem_4, + Method_setCheckable_5, + Method_isCheckable_6, + Method_setFont_7, + Method_show_8, + Method_hide_9, + Method_exec_10, + Method_exec_11, + Method_setActiveItem_12, + Method_sizeHint_13, + Method_idAt_14, + Method_idAt_15, + Method_customWhatsThis_16, + Method_insertTearOffHandle_17, + Method_activateItemAt_18, + Method_itemGeometry_19, + Method_Last = -1 + }; + + QPopupMenuImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QPopupMenuImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static QPopupMenu *toQPopupMenu( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + KJS::Object QPopupMenu_1( KJS::ExecState *exec, const KJS::List &args ); + + // + // Methods implemented by this class. + // + + KJS::Value popup_3( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value updateItem_4( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setCheckable_5( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value isCheckable_6( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setFont_7( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value show_8( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value hide_9( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value exec_10( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value exec_11( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value setActiveItem_12( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value sizeHint_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value idAt_14( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value idAt_15( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value customWhatsThis_16( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value insertTearOffHandle_17( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value activateItemAt_18( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + KJS::Value itemGeometry_19( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args ); + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + QPopupMenu *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_QPopupMenu_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qt_imp.cpp b/kjsembed/qtbindings/qt_imp.cpp new file mode 100644 index 00000000..ba72c824 --- /dev/null +++ b/kjsembed/qtbindings/qt_imp.cpp @@ -0,0 +1,780 @@ + + + +#include <qcstring.h> +#include <qpalette.h> +#include <qpixmap.h> +#include <qfont.h> + +#include <kjs/object.h> + +#include <kjsembed/global.h> +#include <kjsembed/jsobjectproxy.h> +#include <kjsembed/jsopaqueproxy.h> +#include <kjsembed/jsbinding.h> + +#include <qnamespace.h> +#include "qt_imp.h" + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +QtImp::QtImp( KJS::ExecState *exec, int mid, bool constructor ) + : JSProxyImp(exec), id(mid), cons(constructor) +{ +} + +QtImp::~QtImp() +{ +} + +/** + * Adds bindings for static methods and enum constants to the specified Object. + */ +void QtImp::addStaticBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QtImp *meth = new QtImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } + + + // + // Define the enum constants + // + struct EnumValue { + const char *id; + int val; + }; + + EnumValue enums[] = { + + // enum ButtonState + { "NoButton", Qt::NoButton }, + { "LeftButton", Qt::LeftButton }, + { "RightButton", Qt::RightButton }, + { "MidButton", Qt::MidButton }, + { "MouseButtonMask", Qt::MouseButtonMask }, + { "ShiftButton", Qt::ShiftButton }, + { "ControlButton", Qt::ControlButton }, + { "AltButton", Qt::AltButton }, + { "MetaButton", Qt::MetaButton }, + { "KeyButtonMask", Qt::KeyButtonMask }, + { "Keypad", Qt::Keypad }, + // enum Orientation + { "Horizontal", Qt::Horizontal }, + { "Vertical", Qt::Vertical }, + // enum SortOrder + { "Ascending", Qt::Ascending }, + { "Descending", Qt::Descending }, + // enum AlignmentFlags + { "AlignAuto", Qt::AlignAuto }, + { "AlignLeft", Qt::AlignLeft }, + { "AlignRight", Qt::AlignRight }, + { "AlignHCenter", Qt::AlignHCenter }, + { "AlignJustify", Qt::AlignJustify }, + { "AlignHorizontal_Mask", Qt::AlignHorizontal_Mask }, + { "AlignTop", Qt::AlignTop }, + { "AlignBottom", Qt::AlignBottom }, + { "AlignVCenter", Qt::AlignVCenter }, + { "AlignVertical_Mask", Qt::AlignVertical_Mask }, + { "AlignCenter", Qt::AlignCenter }, + // enum TextFlags + { "SingleLine", Qt::SingleLine }, + { "DontClip", Qt::DontClip }, + { "ExpandTabs", Qt::ExpandTabs }, + { "ShowPrefix", Qt::ShowPrefix }, + { "WordBreak", Qt::WordBreak }, + { "BreakAnywhere", Qt::BreakAnywhere }, + { "DontPrint", Qt::DontPrint }, + { "Underline", Qt::Underline }, + { "Overline", Qt::Overline }, + { "StrikeOut", Qt::StrikeOut }, + { "IncludeTrailingSpaces", Qt::IncludeTrailingSpaces }, + { "NoAccel", Qt::NoAccel }, + // enum WidgetState + { "WState_Created", Qt::WState_Created }, + { "WState_Disabled", Qt::WState_Disabled }, + { "WState_Visible", Qt::WState_Visible }, + { "WState_ForceHide", Qt::WState_ForceHide }, + { "WState_OwnCursor", Qt::WState_OwnCursor }, + { "WState_MouseTracking", Qt::WState_MouseTracking }, + { "WState_CompressKeys", Qt::WState_CompressKeys }, + { "WState_BlockUpdates", Qt::WState_BlockUpdates }, + { "WState_InPaintEvent", Qt::WState_InPaintEvent }, + { "WState_Reparented", Qt::WState_Reparented }, + { "WState_ConfigPending", Qt::WState_ConfigPending }, + { "WState_Resized", Qt::WState_Resized }, + { "WState_AutoMask", Qt::WState_AutoMask }, + { "WState_Polished", Qt::WState_Polished }, + { "WState_DND", Qt::WState_DND }, + { "WState_Reserved0", Qt::WState_Reserved0 }, + { "WState_FullScreen", Qt::WState_FullScreen }, + { "WState_OwnSizePolicy", Qt::WState_OwnSizePolicy }, + { "WState_CreatedHidden", Qt::WState_CreatedHidden }, + { "WState_Maximized", Qt::WState_Maximized }, + { "WState_Minimized", Qt::WState_Minimized }, + { "WState_ForceDisabled", Qt::WState_ForceDisabled }, + { "WState_Exposed", Qt::WState_Exposed }, + { "WState_HasMouse", Qt::WState_HasMouse }, + // enum WidgetFlags + { "WType_TopLevel", Qt::WType_TopLevel }, + { "WType_Dialog", Qt::WType_Dialog }, + { "WType_Popup", Qt::WType_Popup }, + { "WType_Desktop", Qt::WType_Desktop }, + { "WType_Mask", Qt::WType_Mask }, + { "WStyle_Customize", Qt::WStyle_Customize }, + { "WStyle_NormalBorder", Qt::WStyle_NormalBorder }, + { "WStyle_DialogBorder", Qt::WStyle_DialogBorder }, + { "WStyle_NoBorder", Qt::WStyle_NoBorder }, + { "WStyle_Title", Qt::WStyle_Title }, + { "WStyle_SysMenu", Qt::WStyle_SysMenu }, + { "WStyle_Minimize", Qt::WStyle_Minimize }, + { "WStyle_Maximize", Qt::WStyle_Maximize }, + { "WStyle_MinMax", Qt::WStyle_MinMax }, + { "WStyle_Tool", Qt::WStyle_Tool }, + { "WStyle_StaysOnTop", Qt::WStyle_StaysOnTop }, + { "WStyle_ContextHelp", Qt::WStyle_ContextHelp }, + { "WStyle_Reserved", Qt::WStyle_Reserved }, + { "WStyle_Mask", Qt::WStyle_Mask }, + { "WDestructiveClose", Qt::WDestructiveClose }, + { "WPaintDesktop", Qt::WPaintDesktop }, + { "WPaintUnclipped", Qt::WPaintUnclipped }, + { "WPaintClever", Qt::WPaintClever }, + { "WResizeNoErase", Qt::WResizeNoErase }, + { "WMouseNoMask", Qt::WMouseNoMask }, + { "WStaticContents", Qt::WStaticContents }, + { "WRepaintNoErase", Qt::WRepaintNoErase }, + { "WX11BypassWM", Qt::WX11BypassWM }, + { "WWinOwnDC", Qt::WWinOwnDC }, + { "WMacNoSheet", Qt::WMacNoSheet }, + { "WMacDrawer", Qt::WMacDrawer }, + { "WGroupLeader", Qt::WGroupLeader }, + { "WShowModal", Qt::WShowModal }, + { "WNoMousePropagation", Qt::WNoMousePropagation }, + { "WSubWindow", Qt::WSubWindow }, + { "WStyle_Splash", Qt::WStyle_Splash }, + { "WNoAutoErase", Qt::WNoAutoErase }, + { "WNorthWestGravity", Qt::WNorthWestGravity }, + { "WType_Modal", Qt::WType_Modal }, + { "WStyle_Dialog", Qt::WStyle_Dialog }, + { "WStyle_NoBorderEx", Qt::WStyle_NoBorderEx }, + // enum WindowState + { "WindowNoState", Qt::WindowNoState }, + { "WindowMinimized", Qt::WindowMinimized }, + { "WindowMaximized", Qt::WindowMaximized }, + { "WindowFullScreen", Qt::WindowFullScreen }, + { "WindowActive", Qt::WindowActive }, + // enum ImageConversionFlags + { "ColorMode_Mask", Qt::ColorMode_Mask }, + { "AutoColor", Qt::AutoColor }, + { "ColorOnly", Qt::ColorOnly }, + { "MonoOnly", Qt::MonoOnly }, + { "AlphaDither_Mask", Qt::AlphaDither_Mask }, + { "ThresholdAlphaDither", Qt::ThresholdAlphaDither }, + { "OrderedAlphaDither", Qt::OrderedAlphaDither }, + { "DiffuseAlphaDither", Qt::DiffuseAlphaDither }, + { "NoAlpha", Qt::NoAlpha }, + { "Dither_Mask", Qt::Dither_Mask }, + { "DiffuseDither", Qt::DiffuseDither }, + { "OrderedDither", Qt::OrderedDither }, + { "ThresholdDither", Qt::ThresholdDither }, + { "DitherMode_Mask", Qt::DitherMode_Mask }, + { "AutoDither", Qt::AutoDither }, + { "PreferDither", Qt::PreferDither }, + { "AvoidDither", Qt::AvoidDither }, + // enum BGMode + { "TransparentMode", Qt::TransparentMode }, + { "OpaqueMode", Qt::OpaqueMode }, + // enum PaintUnit + { "PixelUnit", Qt::PixelUnit }, + { "LoMetricUnit", Qt::LoMetricUnit }, + { "HiMetricUnit", Qt::HiMetricUnit }, + { "LoEnglishUnit", Qt::LoEnglishUnit }, + { "HiEnglishUnit", Qt::HiEnglishUnit }, + { "TwipsUnit", Qt::TwipsUnit }, + // enum GUIStyle + { "MacStyle", Qt::MacStyle }, + { "WindowsStyle", Qt::WindowsStyle }, + { "Win3Style", Qt::Win3Style }, + { "PMStyle", Qt::PMStyle }, + { "MotifStyle", Qt::MotifStyle }, + // enum SequenceMatch + { "NoMatch", Qt::NoMatch }, + { "PartialMatch", Qt::PartialMatch }, + { "Identical", Qt::Identical }, + // enum Modifier + { "META", Qt::META }, + { "SHIFT", Qt::SHIFT }, + { "CTRL", Qt::CTRL }, + { "ALT", Qt::ALT }, + { "MODIFIER_MASK", Qt::MODIFIER_MASK }, + { "UNICODE_ACCEL", Qt::UNICODE_ACCEL }, + { "ASCII_ACCEL", Qt::ASCII_ACCEL }, + // enum Key + { "Key_Escape", Qt::Key_Escape }, + { "Key_Tab", Qt::Key_Tab }, + { "Key_Backtab", Qt::Key_Backtab }, + { "Key_BackTab", Qt::Key_BackTab }, + { "Key_Backspace", Qt::Key_Backspace }, + { "Key_BackSpace", Qt::Key_BackSpace }, + { "Key_Return", Qt::Key_Return }, + { "Key_Enter", Qt::Key_Enter }, + { "Key_Insert", Qt::Key_Insert }, + { "Key_Delete", Qt::Key_Delete }, + { "Key_Pause", Qt::Key_Pause }, + { "Key_Print", Qt::Key_Print }, + { "Key_SysReq", Qt::Key_SysReq }, + { "Key_Clear", Qt::Key_Clear }, + { "Key_Home", Qt::Key_Home }, + { "Key_End", Qt::Key_End }, + { "Key_Left", Qt::Key_Left }, + { "Key_Up", Qt::Key_Up }, + { "Key_Right", Qt::Key_Right }, + { "Key_Down", Qt::Key_Down }, + { "Key_Prior", Qt::Key_Prior }, + { "Key_PageUp", Qt::Key_PageUp }, + { "Key_Next", Qt::Key_Next }, + { "Key_PageDown", Qt::Key_PageDown }, + { "Key_Shift", Qt::Key_Shift }, + { "Key_Control", Qt::Key_Control }, + { "Key_Meta", Qt::Key_Meta }, + { "Key_Alt", Qt::Key_Alt }, + { "Key_CapsLock", Qt::Key_CapsLock }, + { "Key_NumLock", Qt::Key_NumLock }, + { "Key_ScrollLock", Qt::Key_ScrollLock }, + { "Key_F1", Qt::Key_F1 }, + { "Key_F2", Qt::Key_F2 }, + { "Key_F3", Qt::Key_F3 }, + { "Key_F4", Qt::Key_F4 }, + { "Key_F5", Qt::Key_F5 }, + { "Key_F6", Qt::Key_F6 }, + { "Key_F7", Qt::Key_F7 }, + { "Key_F8", Qt::Key_F8 }, + { "Key_F9", Qt::Key_F9 }, + { "Key_F10", Qt::Key_F10 }, + { "Key_F11", Qt::Key_F11 }, + { "Key_F12", Qt::Key_F12 }, + { "Key_F13", Qt::Key_F13 }, + { "Key_F14", Qt::Key_F14 }, + { "Key_F15", Qt::Key_F15 }, + { "Key_F16", Qt::Key_F16 }, + { "Key_F17", Qt::Key_F17 }, + { "Key_F18", Qt::Key_F18 }, + { "Key_F19", Qt::Key_F19 }, + { "Key_F20", Qt::Key_F20 }, + { "Key_F21", Qt::Key_F21 }, + { "Key_F22", Qt::Key_F22 }, + { "Key_F23", Qt::Key_F23 }, + { "Key_F24", Qt::Key_F24 }, + { "Key_F25", Qt::Key_F25 }, + { "Key_F26", Qt::Key_F26 }, + { "Key_F27", Qt::Key_F27 }, + { "Key_F28", Qt::Key_F28 }, + { "Key_F29", Qt::Key_F29 }, + { "Key_F30", Qt::Key_F30 }, + { "Key_F31", Qt::Key_F31 }, + { "Key_F32", Qt::Key_F32 }, + { "Key_F33", Qt::Key_F33 }, + { "Key_F34", Qt::Key_F34 }, + { "Key_F35", Qt::Key_F35 }, + { "Key_Super_L", Qt::Key_Super_L }, + { "Key_Super_R", Qt::Key_Super_R }, + { "Key_Menu", Qt::Key_Menu }, + { "Key_Hyper_L", Qt::Key_Hyper_L }, + { "Key_Hyper_R", Qt::Key_Hyper_R }, + { "Key_Help", Qt::Key_Help }, + { "Key_Direction_L", Qt::Key_Direction_L }, + { "Key_Direction_R", Qt::Key_Direction_R }, + { "Key_Space", Qt::Key_Space }, + { "Key_Any", Qt::Key_Any }, + { "Key_Exclam", Qt::Key_Exclam }, + { "Key_QuoteDbl", Qt::Key_QuoteDbl }, + { "Key_NumberSign", Qt::Key_NumberSign }, + { "Key_Dollar", Qt::Key_Dollar }, + { "Key_Percent", Qt::Key_Percent }, + { "Key_Ampersand", Qt::Key_Ampersand }, + { "Key_Apostrophe", Qt::Key_Apostrophe }, + { "Key_ParenLeft", Qt::Key_ParenLeft }, + { "Key_ParenRight", Qt::Key_ParenRight }, + { "Key_Asterisk", Qt::Key_Asterisk }, + { "Key_Plus", Qt::Key_Plus }, + { "Key_Comma", Qt::Key_Comma }, + { "Key_Minus", Qt::Key_Minus }, + { "Key_Period", Qt::Key_Period }, + { "Key_Slash", Qt::Key_Slash }, + { "Key_0", Qt::Key_0 }, + { "Key_1", Qt::Key_1 }, + { "Key_2", Qt::Key_2 }, + { "Key_3", Qt::Key_3 }, + { "Key_4", Qt::Key_4 }, + { "Key_5", Qt::Key_5 }, + { "Key_6", Qt::Key_6 }, + { "Key_7", Qt::Key_7 }, + { "Key_8", Qt::Key_8 }, + { "Key_9", Qt::Key_9 }, + { "Key_Colon", Qt::Key_Colon }, + { "Key_Semicolon", Qt::Key_Semicolon }, + { "Key_Less", Qt::Key_Less }, + { "Key_Equal", Qt::Key_Equal }, + { "Key_Greater", Qt::Key_Greater }, + { "Key_Question", Qt::Key_Question }, + { "Key_At", Qt::Key_At }, + { "Key_A", Qt::Key_A }, + { "Key_B", Qt::Key_B }, + { "Key_C", Qt::Key_C }, + { "Key_D", Qt::Key_D }, + { "Key_E", Qt::Key_E }, + { "Key_F", Qt::Key_F }, + { "Key_G", Qt::Key_G }, + { "Key_H", Qt::Key_H }, + { "Key_I", Qt::Key_I }, + { "Key_J", Qt::Key_J }, + { "Key_K", Qt::Key_K }, + { "Key_L", Qt::Key_L }, + { "Key_M", Qt::Key_M }, + { "Key_N", Qt::Key_N }, + { "Key_O", Qt::Key_O }, + { "Key_P", Qt::Key_P }, + { "Key_Q", Qt::Key_Q }, + { "Key_R", Qt::Key_R }, + { "Key_S", Qt::Key_S }, + { "Key_T", Qt::Key_T }, + { "Key_U", Qt::Key_U }, + { "Key_V", Qt::Key_V }, + { "Key_W", Qt::Key_W }, + { "Key_X", Qt::Key_X }, + { "Key_Y", Qt::Key_Y }, + { "Key_Z", Qt::Key_Z }, + { "Key_BracketLeft", Qt::Key_BracketLeft }, + { "Key_Backslash", Qt::Key_Backslash }, + { "Key_BracketRight", Qt::Key_BracketRight }, + { "Key_AsciiCircum", Qt::Key_AsciiCircum }, + { "Key_Underscore", Qt::Key_Underscore }, + { "Key_QuoteLeft", Qt::Key_QuoteLeft }, + { "Key_BraceLeft", Qt::Key_BraceLeft }, + { "Key_Bar", Qt::Key_Bar }, + { "Key_BraceRight", Qt::Key_BraceRight }, + { "Key_AsciiTilde", Qt::Key_AsciiTilde }, + { "Key_nobreakspace", Qt::Key_nobreakspace }, + { "Key_exclamdown", Qt::Key_exclamdown }, + { "Key_cent", Qt::Key_cent }, + { "Key_sterling", Qt::Key_sterling }, + { "Key_currency", Qt::Key_currency }, + { "Key_yen", Qt::Key_yen }, + { "Key_brokenbar", Qt::Key_brokenbar }, + { "Key_section", Qt::Key_section }, + { "Key_diaeresis", Qt::Key_diaeresis }, + { "Key_copyright", Qt::Key_copyright }, + { "Key_ordfeminine", Qt::Key_ordfeminine }, + { "Key_guillemotleft", Qt::Key_guillemotleft }, + { "Key_notsign", Qt::Key_notsign }, + { "Key_hyphen", Qt::Key_hyphen }, + { "Key_registered", Qt::Key_registered }, + { "Key_macron", Qt::Key_macron }, + { "Key_degree", Qt::Key_degree }, + { "Key_plusminus", Qt::Key_plusminus }, + { "Key_twosuperior", Qt::Key_twosuperior }, + { "Key_threesuperior", Qt::Key_threesuperior }, + { "Key_acute", Qt::Key_acute }, + { "Key_mu", Qt::Key_mu }, + { "Key_paragraph", Qt::Key_paragraph }, + { "Key_periodcentered", Qt::Key_periodcentered }, + { "Key_cedilla", Qt::Key_cedilla }, + { "Key_onesuperior", Qt::Key_onesuperior }, + { "Key_masculine", Qt::Key_masculine }, + { "Key_guillemotright", Qt::Key_guillemotright }, + { "Key_onequarter", Qt::Key_onequarter }, + { "Key_onehalf", Qt::Key_onehalf }, + { "Key_threequarters", Qt::Key_threequarters }, + { "Key_questiondown", Qt::Key_questiondown }, + { "Key_Agrave", Qt::Key_Agrave }, + { "Key_Aacute", Qt::Key_Aacute }, + { "Key_Acircumflex", Qt::Key_Acircumflex }, + { "Key_Atilde", Qt::Key_Atilde }, + { "Key_Adiaeresis", Qt::Key_Adiaeresis }, + { "Key_Aring", Qt::Key_Aring }, + { "Key_AE", Qt::Key_AE }, + { "Key_Ccedilla", Qt::Key_Ccedilla }, + { "Key_Egrave", Qt::Key_Egrave }, + { "Key_Eacute", Qt::Key_Eacute }, + { "Key_Ecircumflex", Qt::Key_Ecircumflex }, + { "Key_Ediaeresis", Qt::Key_Ediaeresis }, + { "Key_Igrave", Qt::Key_Igrave }, + { "Key_Iacute", Qt::Key_Iacute }, + { "Key_Icircumflex", Qt::Key_Icircumflex }, + { "Key_Idiaeresis", Qt::Key_Idiaeresis }, + { "Key_ETH", Qt::Key_ETH }, + { "Key_Ntilde", Qt::Key_Ntilde }, + { "Key_Ograve", Qt::Key_Ograve }, + { "Key_Oacute", Qt::Key_Oacute }, + { "Key_Ocircumflex", Qt::Key_Ocircumflex }, + { "Key_Otilde", Qt::Key_Otilde }, + { "Key_Odiaeresis", Qt::Key_Odiaeresis }, + { "Key_multiply", Qt::Key_multiply }, + { "Key_Ooblique", Qt::Key_Ooblique }, + { "Key_Ugrave", Qt::Key_Ugrave }, + { "Key_Uacute", Qt::Key_Uacute }, + { "Key_Ucircumflex", Qt::Key_Ucircumflex }, + { "Key_Udiaeresis", Qt::Key_Udiaeresis }, + { "Key_Yacute", Qt::Key_Yacute }, + { "Key_THORN", Qt::Key_THORN }, + { "Key_ssharp", Qt::Key_ssharp }, + { "Key_agrave", Qt::Key_agrave }, + { "Key_aacute", Qt::Key_aacute }, + { "Key_acircumflex", Qt::Key_acircumflex }, + { "Key_atilde", Qt::Key_atilde }, + { "Key_adiaeresis", Qt::Key_adiaeresis }, + { "Key_aring", Qt::Key_aring }, + { "Key_ae", Qt::Key_ae }, + { "Key_ccedilla", Qt::Key_ccedilla }, + { "Key_egrave", Qt::Key_egrave }, + { "Key_eacute", Qt::Key_eacute }, + { "Key_ecircumflex", Qt::Key_ecircumflex }, + { "Key_ediaeresis", Qt::Key_ediaeresis }, + { "Key_igrave", Qt::Key_igrave }, + { "Key_iacute", Qt::Key_iacute }, + { "Key_icircumflex", Qt::Key_icircumflex }, + { "Key_idiaeresis", Qt::Key_idiaeresis }, + { "Key_eth", Qt::Key_eth }, + { "Key_ntilde", Qt::Key_ntilde }, + { "Key_ograve", Qt::Key_ograve }, + { "Key_oacute", Qt::Key_oacute }, + { "Key_ocircumflex", Qt::Key_ocircumflex }, + { "Key_otilde", Qt::Key_otilde }, + { "Key_odiaeresis", Qt::Key_odiaeresis }, + { "Key_division", Qt::Key_division }, + { "Key_oslash", Qt::Key_oslash }, + { "Key_ugrave", Qt::Key_ugrave }, + { "Key_uacute", Qt::Key_uacute }, + { "Key_ucircumflex", Qt::Key_ucircumflex }, + { "Key_udiaeresis", Qt::Key_udiaeresis }, + { "Key_yacute", Qt::Key_yacute }, + { "Key_thorn", Qt::Key_thorn }, + { "Key_ydiaeresis", Qt::Key_ydiaeresis }, + { "Key_Back", Qt::Key_Back }, + { "Key_Forward", Qt::Key_Forward }, + { "Key_Stop", Qt::Key_Stop }, + { "Key_Refresh", Qt::Key_Refresh }, + { "Key_VolumeDown", Qt::Key_VolumeDown }, + { "Key_VolumeMute", Qt::Key_VolumeMute }, + { "Key_VolumeUp", Qt::Key_VolumeUp }, + { "Key_BassBoost", Qt::Key_BassBoost }, + { "Key_BassUp", Qt::Key_BassUp }, + { "Key_BassDown", Qt::Key_BassDown }, + { "Key_TrebleUp", Qt::Key_TrebleUp }, + { "Key_TrebleDown", Qt::Key_TrebleDown }, + { "Key_MediaPlay", Qt::Key_MediaPlay }, + { "Key_MediaStop", Qt::Key_MediaStop }, + { "Key_MediaPrev", Qt::Key_MediaPrev }, + { "Key_MediaNext", Qt::Key_MediaNext }, + { "Key_MediaRecord", Qt::Key_MediaRecord }, + { "Key_HomePage", Qt::Key_HomePage }, + { "Key_Favorites", Qt::Key_Favorites }, + { "Key_Search", Qt::Key_Search }, + { "Key_Standby", Qt::Key_Standby }, + { "Key_OpenUrl", Qt::Key_OpenUrl }, + { "Key_LaunchMail", Qt::Key_LaunchMail }, + { "Key_LaunchMedia", Qt::Key_LaunchMedia }, + { "Key_Launch0", Qt::Key_Launch0 }, + { "Key_Launch1", Qt::Key_Launch1 }, + { "Key_Launch2", Qt::Key_Launch2 }, + { "Key_Launch3", Qt::Key_Launch3 }, + { "Key_Launch4", Qt::Key_Launch4 }, + { "Key_Launch5", Qt::Key_Launch5 }, + { "Key_Launch6", Qt::Key_Launch6 }, + { "Key_Launch7", Qt::Key_Launch7 }, + { "Key_Launch8", Qt::Key_Launch8 }, + { "Key_Launch9", Qt::Key_Launch9 }, + { "Key_LaunchA", Qt::Key_LaunchA }, + { "Key_LaunchB", Qt::Key_LaunchB }, + { "Key_LaunchC", Qt::Key_LaunchC }, + { "Key_LaunchD", Qt::Key_LaunchD }, + { "Key_LaunchE", Qt::Key_LaunchE }, + { "Key_LaunchF", Qt::Key_LaunchF }, + { "Key_MediaLast", Qt::Key_MediaLast }, + { "Key_unknown", Qt::Key_unknown }, + // enum ArrowType + { "UpArrow", Qt::UpArrow }, + { "DownArrow", Qt::DownArrow }, + { "LeftArrow", Qt::LeftArrow }, + { "RightArrow", Qt::RightArrow }, + // enum RasterOp + { "CopyROP", Qt::CopyROP }, + { "OrROP", Qt::OrROP }, + { "XorROP", Qt::XorROP }, + { "NotAndROP", Qt::NotAndROP }, + { "EraseROP", Qt::EraseROP }, + { "NotCopyROP", Qt::NotCopyROP }, + { "NotOrROP", Qt::NotOrROP }, + { "NotXorROP", Qt::NotXorROP }, + { "AndROP", Qt::AndROP }, + { "NotEraseROP", Qt::NotEraseROP }, + { "NotROP", Qt::NotROP }, + { "ClearROP", Qt::ClearROP }, + { "SetROP", Qt::SetROP }, + { "NopROP", Qt::NopROP }, + { "AndNotROP", Qt::AndNotROP }, + { "OrNotROP", Qt::OrNotROP }, + { "NandROP", Qt::NandROP }, + { "NorROP", Qt::NorROP }, + { "LastROP", Qt::LastROP }, + // enum PenStyle + { "NoPen", Qt::NoPen }, + { "SolidLine", Qt::SolidLine }, + { "DashLine", Qt::DashLine }, + { "DotLine", Qt::DotLine }, + { "DashDotLine", Qt::DashDotLine }, + { "DashDotDotLine", Qt::DashDotDotLine }, + { "MPenStyle", Qt::MPenStyle }, + // enum PenCapStyle + { "FlatCap", Qt::FlatCap }, + { "SquareCap", Qt::SquareCap }, + { "RoundCap", Qt::RoundCap }, + { "MPenCapStyle", Qt::MPenCapStyle }, + // enum PenJoinStyle + { "MiterJoin", Qt::MiterJoin }, + { "BevelJoin", Qt::BevelJoin }, + { "RoundJoin", Qt::RoundJoin }, + { "MPenJoinStyle", Qt::MPenJoinStyle }, + // enum BrushStyle + { "NoBrush", Qt::NoBrush }, + { "SolidPattern", Qt::SolidPattern }, + { "Dense1Pattern", Qt::Dense1Pattern }, + { "Dense2Pattern", Qt::Dense2Pattern }, + { "Dense3Pattern", Qt::Dense3Pattern }, + { "Dense4Pattern", Qt::Dense4Pattern }, + { "Dense5Pattern", Qt::Dense5Pattern }, + { "Dense6Pattern", Qt::Dense6Pattern }, + { "Dense7Pattern", Qt::Dense7Pattern }, + { "HorPattern", Qt::HorPattern }, + { "VerPattern", Qt::VerPattern }, + { "CrossPattern", Qt::CrossPattern }, + { "BDiagPattern", Qt::BDiagPattern }, + { "FDiagPattern", Qt::FDiagPattern }, + { "DiagCrossPattern", Qt::DiagCrossPattern }, + { "CustomPattern", Qt::CustomPattern }, + // enum MacintoshVersion + { "MV_Unknown", Qt::MV_Unknown }, + { "MV_9", Qt::MV_9 }, + { "MV_10_DOT_0", Qt::MV_10_DOT_0 }, + { "MV_10_DOT_1", Qt::MV_10_DOT_1 }, + { "MV_10_DOT_2", Qt::MV_10_DOT_2 }, + { "MV_10_DOT_3", Qt::MV_10_DOT_3 }, + { "MV_CHEETAH", Qt::MV_CHEETAH }, + { "MV_PUMA", Qt::MV_PUMA }, + { "MV_JAGUAR", Qt::MV_JAGUAR }, + { "MV_PANTHER", Qt::MV_PANTHER }, + // enum WindowsVersion + { "WV_32s", Qt::WV_32s }, + { "WV_95", Qt::WV_95 }, + { "WV_98", Qt::WV_98 }, + { "WV_Me", Qt::WV_Me }, + { "WV_DOS_based", Qt::WV_DOS_based }, + { "WV_NT", Qt::WV_NT }, + { "WV_2000", Qt::WV_2000 }, + { "WV_XP", Qt::WV_XP }, + { "WV_2003", Qt::WV_2003 }, + { "WV_NT_based", Qt::WV_NT_based }, + { "WV_CE", Qt::WV_CE }, + { "WV_CENET", Qt::WV_CENET }, + { "WV_CE_based", Qt::WV_CE_based }, + // enum UIEffect + { "UI_General", Qt::UI_General }, + { "UI_AnimateMenu", Qt::UI_AnimateMenu }, + { "UI_FadeMenu", Qt::UI_FadeMenu }, + { "UI_AnimateCombo", Qt::UI_AnimateCombo }, + { "UI_AnimateTooltip", Qt::UI_AnimateTooltip }, + { "UI_FadeTooltip", Qt::UI_FadeTooltip }, + { "UI_AnimateToolBox", Qt::UI_AnimateToolBox }, + // enum CursorShape + { "ArrowCursor", Qt::ArrowCursor }, + { "UpArrowCursor", Qt::UpArrowCursor }, + { "CrossCursor", Qt::CrossCursor }, + { "WaitCursor", Qt::WaitCursor }, + { "IbeamCursor", Qt::IbeamCursor }, + { "SizeVerCursor", Qt::SizeVerCursor }, + { "SizeHorCursor", Qt::SizeHorCursor }, + { "SizeBDiagCursor", Qt::SizeBDiagCursor }, + { "SizeFDiagCursor", Qt::SizeFDiagCursor }, + { "SizeAllCursor", Qt::SizeAllCursor }, + { "BlankCursor", Qt::BlankCursor }, + { "SplitVCursor", Qt::SplitVCursor }, + { "SplitHCursor", Qt::SplitHCursor }, + { "PointingHandCursor", Qt::PointingHandCursor }, + { "ForbiddenCursor", Qt::ForbiddenCursor }, + { "WhatsThisCursor", Qt::WhatsThisCursor }, + { "BusyCursor", Qt::BusyCursor }, + { "LastCursor", Qt::LastCursor }, + { "BitmapCursor", Qt::BitmapCursor }, + // enum TextFormat + { "PlainText", Qt::PlainText }, + { "RichText", Qt::RichText }, + { "AutoText", Qt::AutoText }, + { "LogText", Qt::LogText }, + // enum AnchorAttribute + { "AnchorName", Qt::AnchorName }, + { "AnchorHref", Qt::AnchorHref }, + // enum Dock + { "DockUnmanaged", Qt::DockUnmanaged }, + { "DockTornOff", Qt::DockTornOff }, + { "DockTop", Qt::DockTop }, + { "DockBottom", Qt::DockBottom }, + { "DockRight", Qt::DockRight }, + { "DockLeft", Qt::DockLeft }, + { "DockMinimized", Qt::DockMinimized }, + { "Unmanaged", Qt::Unmanaged }, + { "TornOff", Qt::TornOff }, + { "Top", Qt::Top }, + { "Bottom", Qt::Bottom }, + { "Right", Qt::Right }, + { "Left", Qt::Left }, + { "Minimized", Qt::Minimized }, + // enum DateFormat + { "TextDate", Qt::TextDate }, + { "ISODate", Qt::ISODate }, + { "LocalDate", Qt::LocalDate }, + // enum TimeSpec + { "LocalTime", Qt::LocalTime }, + { "UTC", Qt::UTC }, + // enum BackgroundMode + { "FixedColor", Qt::FixedColor }, + { "FixedPixmap", Qt::FixedPixmap }, + { "NoBackground", Qt::NoBackground }, + { "PaletteForeground", Qt::PaletteForeground }, + { "PaletteButton", Qt::PaletteButton }, + { "PaletteLight", Qt::PaletteLight }, + { "PaletteMidlight", Qt::PaletteMidlight }, + { "PaletteDark", Qt::PaletteDark }, + { "PaletteMid", Qt::PaletteMid }, + { "PaletteText", Qt::PaletteText }, + { "PaletteBrightText", Qt::PaletteBrightText }, + { "PaletteBase", Qt::PaletteBase }, + { "PaletteBackground", Qt::PaletteBackground }, + { "PaletteShadow", Qt::PaletteShadow }, + { "PaletteHighlight", Qt::PaletteHighlight }, + { "PaletteHighlightedText", Qt::PaletteHighlightedText }, + { "PaletteButtonText", Qt::PaletteButtonText }, + { "PaletteLink", Qt::PaletteLink }, + { "PaletteLinkVisited", Qt::PaletteLinkVisited }, + { "X11ParentRelative", Qt::X11ParentRelative }, + // enum StringComparisonMode + { "CaseSensitive", Qt::CaseSensitive }, + { "BeginsWith", Qt::BeginsWith }, + { "EndsWith", Qt::EndsWith }, + { "Contains", Qt::Contains }, + { "ExactMatch", Qt::ExactMatch }, + // enum Corner + { "TopLeft", Qt::TopLeft }, + { "TopRight", Qt::TopRight }, + { "BottomLeft", Qt::BottomLeft }, + { "BottomRight", Qt::BottomRight }, + { 0, 0 } + }; + + int enumidx = 0; + while( enums[enumidx].id ) { + object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly ); + ++enumidx; + } + +} + +/** + * Adds bindings for instance methods to the specified Object. + */ +void QtImp::addBindings( KJS::ExecState *exec, KJS::Object &object ) +{ + JSProxy::MethodTable methods[] = { + + { 0, 0 } + }; + + int idx = 0; + QCString lastName; + + while( methods[idx].name ) { + if ( lastName != methods[idx].name ) { + QtImp *meth = new QtImp( exec, methods[idx].id ); + object.put( exec , methods[idx].name, KJS::Object(meth) ); + lastName = methods[idx].name; + } + ++idx; + } +} + +/** + * Extract a Qt pointer from an Object. + */ +Qt *QtImp::toQt( KJS::Object &self ) +{ + JSObjectProxy *ob = JSProxy::toObjectProxy( self.imp() ); + if ( ob ) { + QObject *obj = ob->object(); + if ( obj ) + return dynamic_cast<Qt *>( obj ); + } + + JSOpaqueProxy *op = JSProxy::toOpaqueProxy( self.imp() ); + if ( !op ) + return 0; + + if ( op->typeName() != "Qt" ) + return 0; + + return op->toNative<Qt>(); +} + +/** + * Select and invoke the correct constructor. + */ +KJS::Object QtImp::construct( KJS::ExecState *exec, const KJS::List &args ) +{ + switch( id ) { + + default: + break; + } + + QString msg = i18n("QtCons has no constructor with id '%1'.").arg(id); + return throwError(exec, msg,KJS::ReferenceError); +} + + +KJS::Value QtImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) +{ + instance = QtImp::toQt( self ); + + switch( id ) { + + default: + break; + } + + QString msg = i18n( "QtImp has no method with id '%1'." ).arg( id ); + return throwError(exec, msg,KJS::ReferenceError); +} + + + +} // namespace KJSEmbed + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qt_imp.h b/kjsembed/qtbindings/qt_imp.h new file mode 100644 index 00000000..6bc3b489 --- /dev/null +++ b/kjsembed/qtbindings/qt_imp.h @@ -0,0 +1,96 @@ + + + +#ifndef KJSEMBED_Qt_H +#define KJSEMBED_Qt_H + +#include <kjs/interpreter.h> +#include <kjs/object.h> + +#include <kjsembed/jsobjectproxy_imp.h> + +class Qt; + +/** + * Namespace containing the KJSEmbed library. + */ +namespace KJSEmbed { + +/** + * Wrapper class for Qt methods. + * + * @author Richard Moore, [email protected] + */ +class QtImp : public JSProxyImp +{ +public: + /** Enumerates the constructors supported by this class. */ + enum Constructors { + + LastConstuctor = -1 + }; + + /** Enumerates the methods supported by this class. */ + enum Methods { + + Method_Last = -1 + }; + + QtImp( KJS::ExecState *exec, int id, bool constructor=false ); + ~QtImp(); + + /** + * Adds the static bindings for this class to the specified Object. The + * static bindings are the static methods and the enums of this class. + */ + static void addStaticBindings( KJS::ExecState *exec, KJS::Object &object ); + + /** + * Adds the bindings for this class to the specified Object. The bindings + * added are the instance methods of this class. + */ + static void addBindings( KJS::ExecState *exec, KJS::Object &object ); + + static Qt *toQt( KJS::Object &object ); + + // + // Constructors implemented by this class. + // + + + // + // Methods implemented by this class. + // + + + // + // JS binding code. + // + + /** Returns true iff this object implements the construct function. */ + virtual bool implementsConstruct() const { return cons; } + + /** Invokes the construct function. */ + virtual KJS::Object construct( KJS::ExecState *exec, const KJS::List &args ); + + /** Returns true iff this object implements the call function. */ + virtual bool implementsCall() const { return !cons; } + + /** Invokes the call function. */ + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + +private: + Qt *instance; // Temp + int id; + bool cons; +}; + +} // namespace KJSEmbed + +#endif // KJSEMBED_Qt_H + +// Local Variables: +// c-basic-offset: 4 +// End: + + diff --git a/kjsembed/qtbindings/qtbindings.pro b/kjsembed/qtbindings/qtbindings.pro new file mode 100644 index 00000000..eaaa1b7a --- /dev/null +++ b/kjsembed/qtbindings/qtbindings.pro @@ -0,0 +1,32 @@ +include(../qjsembed.pri) + +HEADERS += qcombobox_imp.h \ + qframe_imp.h \ + qlistviewitem_imp.h \ + qt_imp.h \ + qchecklistitem_imp.h + +SOURCES += \ + qlistviewitem_imp.cpp \ + qcombobox_imp.cpp \ + qframe_imp.cpp \ + qt_imp.cpp \ + qchecklistitem_imp.cpp \ + qcanvasellipse_imp.cpp \ + qcanvas_imp.cpp \ + qcanvasitem_imp.cpp \ + qcanvasitemlist_imp.cpp \ + qcanvasline_imp.cpp \ + qcanvaspixmaparray_imp.cpp \ + qcanvaspixmap_imp.cpp \ + qcanvaspolygonalitem_imp.cpp \ + qcanvaspolygon_imp.cpp \ + qcanvasrectangle_imp.cpp \ + qcanvasspline_imp.cpp \ + qcanvassprite_imp.cpp \ + qcanvastext_imp.cpp \ + qcanvasview_imp.cpp + +INCLUDEPATH += .. . ../.. +CONFIG += staticlib +TEMPLATE = lib |