From kde-commits Fri Nov 27 03:12:29 2009 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Fri, 27 Nov 2009 03:12:29 +0000 To: kde-commits Subject: KDE/kdeexamples/plasma/javascript/plasmoids/enumerateAPI/contents/code Message-Id: <1259291549.516166.12072.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125929155717774 SVN commit 1054900 by aseigo: more api M +123 -78 main.js --- trunk/KDE/kdeexamples/plasma/javascript/plasmoids/enumerateAPI/contents/code/main.js #1054899:1054900 @@ -1,3 +1,5 @@ +var text = true + classNames = new Array() classNames.push('BusyWidget') classNames.push('CheckBox') @@ -26,87 +28,103 @@ classNames.push('VideoWidget') classNames.push('WebView') -// ScrollWidget - var commonProperties = new Array -commonProperties.push("objectName" ) -commonProperties.push("parent" ) -commonProperties.push("id" ) -commonProperties.push("opacity" ) -commonProperties.push("enabled" ) -commonProperties.push("visible" ) -commonProperties.push("pos" ) -commonProperties.push("x" ) -commonProperties.push("y" ) -commonProperties.push("z" ) -commonProperties.push("rotation" ) -commonProperties.push("scale" ) -commonProperties.push("transformOriginPoint" ) -commonProperties.push("palette" ) -commonProperties.push("font" ) -commonProperties.push("layoutDirection" ) -commonProperties.push("size" ) -commonProperties.push("focusPolicy" ) -commonProperties.push("windowFlags" ) -commonProperties.push("windowTitle" ) -commonProperties.push("geometry" ) -commonProperties.push("parentWidget" ) -commonProperties.push("stylesheet" ) -commonProperties.push("nativeWidget" ) -commonProperties.push("destroyed(QObject*)" ) -commonProperties.push("destroyed()" ) -commonProperties.push("deleteLater()" ) -commonProperties.push("parentChanged()" ) -commonProperties.push("opacityChanged()" ) -commonProperties.push("visibleChanged()" ) -commonProperties.push("enabledChanged()" ) -commonProperties.push("xChanged()" ) -commonProperties.push("yChanged()" ) -commonProperties.push("zChanged()" ) -commonProperties.push("rotationChanged()" ) -commonProperties.push("scaleChanged()" ) -commonProperties.push("close()" ) -commonProperties.push("newProxyWidget(const QWidget*)" ) +commonProperties.push("objectName") +commonProperties.push("parent") +commonProperties.push("id") +commonProperties.push("opacity") +commonProperties.push("enabled") +commonProperties.push("visible") +commonProperties.push("pos") +commonProperties.push("x") +commonProperties.push("y") +commonProperties.push("z") +commonProperties.push("rotation") +commonProperties.push("scale") +commonProperties.push("transformOriginPoint") +commonProperties.push("palette") +commonProperties.push("font") +commonProperties.push("layoutDirection") +commonProperties.push("size") +commonProperties.push("focusPolicy") +commonProperties.push("windowFlags") +commonProperties.push("windowTitle") +commonProperties.push("geometry") +commonProperties.push("parentWidget") +commonProperties.push("stylesheet") +commonProperties.push("nativeWidget") +commonProperties.push("destroyed(QObject*)") +commonProperties.push("destroyed()") +commonProperties.push("deleteLater()") +commonProperties.push("parentChanged()") +commonProperties.push("opacityChanged()") +commonProperties.push("visibleChanged()") +commonProperties.push("enabledChanged()") +commonProperties.push("xChanged()") +commonProperties.push("yChanged()") +commonProperties.push("zChanged()") +commonProperties.push("rotationChanged()") +commonProperties.push("scaleChanged()") +commonProperties.push("close()") +commonProperties.push("newProxyWidget(const QWidget*)") commonProperties.push("styleSheet()") commonProperties.push("timerEvent(QTimerEvent*)") -var apihtml = '' -var apitext = '' -for (index in classNames) { - apihtml += '

' + classNames[index] + "

" + } + + return rv +} + + +var widgetApi = '' +for (index in classNames) { + var widgetName = classNames[index] + var widget = new this[widgetName] + widgetApi += enumerateObject(widgetName, widget, true) widget.deleteLater() } @@ -114,13 +132,40 @@ tabbar = new TabBar display = new TextEdit display.readOnly = true -display.text = apihtml -tabbar.addTab(i18n("HTML"), display) +display.text = widgetApi +tabbar.addTab(i18n("Widgets"), display) -bg = new ItemBackground +fsvg = new FrameSvg('panel-background') +var imageApi = enumerateObject('FrameSvg', fsvg, false) +svg = new Svg('panel-background') +imageApi += enumerateObject('Svg', svg, false) +pixmap = new QPixmap +imageApi += enumerateObject('QPixmap', pixmap, false) + display = new TextEdit display.readOnly = true -display.text = apitext -tabbar.addTab(i18n("Text"), display) +display.text = imageApi +tabbar.addTab(i18n("Images"), display) + +var p = new QPainter +var paintingApi = enumerateObject('QPainter', p, false) +p = new QColor +paintingApi += enumerateObject('QColor', p, false) +p = new QFont +paintingApi += enumerateObject('QFont', p, false) +p = new QPoint +paintingApi += enumerateObject('QPoint', p, false) +p = new QRectF +paintingApi += enumerateObject('QRectF', p, false) +p = new QSizeF(2,2) +paintingApi += enumerateObject('QSizeF ' + p.width, p, false) + +display = new TextEdit +display.readOnly = true +display.text = paintingApi +tabbar.addTab(i18n("Painting"), display) + + layout.addItem(tabbar) +