qtbindings 4.6.3.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +9 -0
- data/CMakeLists.txt +22 -0
- data/COPYING.LIB.txt +510 -0
- data/COPYING.txt +286 -0
- data/KNOWN_ISSUES.txt +20 -0
- data/README.txt +92 -0
- data/Rakefile +96 -0
- data/TODO.txt +2 -0
- data/bin/1.8/rbrcc.exe +0 -0
- data/bin/1.8/rbuic4.exe +0 -0
- data/bin/1.8/smokeapi.exe +0 -0
- data/bin/1.8/smokedeptool.exe +0 -0
- data/bin/1.9/rbrcc.exe +0 -0
- data/bin/1.9/rbuic4.exe +0 -0
- data/bin/1.9/smokeapi.exe +0 -0
- data/bin/1.9/smokedeptool.exe +0 -0
- data/bin/Qt3Support4.dll +0 -0
- data/bin/QtAssistantClient4.dll +0 -0
- data/bin/QtCLucene4.dll +0 -0
- data/bin/QtCore4.dll +0 -0
- data/bin/QtDesigner4.dll +0 -0
- data/bin/QtDesignerComponents4.dll +0 -0
- data/bin/QtGui4.dll +0 -0
- data/bin/QtHelp4.dll +0 -0
- data/bin/QtMultimedia4.dll +0 -0
- data/bin/QtNetwork4.dll +0 -0
- data/bin/QtOpenGL4.dll +0 -0
- data/bin/QtScript4.dll +0 -0
- data/bin/QtScriptTools4.dll +0 -0
- data/bin/QtSql4.dll +0 -0
- data/bin/QtSvg4.dll +0 -0
- data/bin/QtTest4.dll +0 -0
- data/bin/QtWebKit4.dll +0 -0
- data/bin/QtXml4.dll +0 -0
- data/bin/QtXmlPatterns4.dll +0 -0
- data/bin/libgcc_s_dw2-1.dll +0 -0
- data/bin/mingwm10.dll +0 -0
- data/bin/phonon4.dll +0 -0
- data/bin/plugins/arthurplugin.dll +0 -0
- data/bin/plugins/containerextension.dll +0 -0
- data/bin/plugins/customwidgetplugin.dll +0 -0
- data/bin/plugins/phononwidgets.dll +0 -0
- data/bin/plugins/qcncodecs4.dll +0 -0
- data/bin/plugins/qgif4.dll +0 -0
- data/bin/plugins/qglgraphicssystem4.dll +0 -0
- data/bin/plugins/qico4.dll +0 -0
- data/bin/plugins/qjpcodecs4.dll +0 -0
- data/bin/plugins/qjpeg4.dll +0 -0
- data/bin/plugins/qkrcodecs4.dll +0 -0
- data/bin/plugins/qmng4.dll +0 -0
- data/bin/plugins/qsqlite4.dll +0 -0
- data/bin/plugins/qsqlodbc4.dll +0 -0
- data/bin/plugins/qsvg4.dll +0 -0
- data/bin/plugins/qsvgicon4.dll +0 -0
- data/bin/plugins/qt3supportwidgets.dll +0 -0
- data/bin/plugins/qtaccessiblecompatwidgets4.dll +0 -0
- data/bin/plugins/qtaccessiblewidgets4.dll +0 -0
- data/bin/plugins/qtiff4.dll +0 -0
- data/bin/plugins/qtracegraphicssystem4.dll +0 -0
- data/bin/plugins/qtwcodecs4.dll +0 -0
- data/bin/plugins/qwebview.dll +0 -0
- data/bin/plugins/taskmenuextension.dll +0 -0
- data/bin/plugins/worldtimeclockplugin.dll +0 -0
- data/bin/rbqtapi +152 -0
- data/bin/rbrcc +18 -0
- data/bin/rbuic4 +18 -0
- data/bin/smokeapi +18 -0
- data/bin/smokedeptool +18 -0
- data/examples/base/kicons.rb +54 -0
- data/examples/base/rui.rb +21 -0
- data/examples/designer/calculatorbuilder/calculatorbuilder.qrc +5 -0
- data/examples/designer/calculatorbuilder/calculatorform.rb +60 -0
- data/examples/designer/calculatorbuilder/calculatorform.ui +299 -0
- data/examples/designer/calculatorbuilder/main.rb +34 -0
- data/examples/designer/calculatorbuilder/makefile +2 -0
- data/examples/designer/calculatorform/calculatorform.rb +46 -0
- data/examples/designer/calculatorform/calculatorform.ui +277 -0
- data/examples/designer/calculatorform/main.rb +32 -0
- data/examples/designer/calculatorform/makefile +3 -0
- data/examples/desktop/screenshot/main.rb +32 -0
- data/examples/desktop/screenshot/screenshot.rb +156 -0
- data/examples/desktop/systray/images/bad.svg +64 -0
- data/examples/desktop/systray/images/heart.svg +55 -0
- data/examples/desktop/systray/images/trash.svg +58 -0
- data/examples/desktop/systray/main.rb +41 -0
- data/examples/desktop/systray/makefile +2 -0
- data/examples/desktop/systray/systray.qrc +7 -0
- data/examples/desktop/systray/window.rb +223 -0
- data/examples/dialogs/complexwizard/complexwizard.rb +140 -0
- data/examples/dialogs/complexwizard/licensewizard.rb +294 -0
- data/examples/dialogs/complexwizard/main.rb +31 -0
- data/examples/dialogs/configdialog/configdialog.rb +109 -0
- data/examples/dialogs/configdialog/images/config.png +0 -0
- data/examples/dialogs/configdialog/images/query.png +0 -0
- data/examples/dialogs/configdialog/images/update.png +0 -0
- data/examples/dialogs/configdialog/main.rb +31 -0
- data/examples/dialogs/configdialog/pages.rb +140 -0
- data/examples/dialogs/extension/finddialog.rb +89 -0
- data/examples/dialogs/extension/main.rb +31 -0
- data/examples/dialogs/findfiles/main.rb +32 -0
- data/examples/dialogs/findfiles/window.rb +177 -0
- data/examples/dialogs/simplewizard/classwizard.rb +374 -0
- data/examples/dialogs/simplewizard/main.rb +31 -0
- data/examples/dialogs/simplewizard/simplewizard.rb +110 -0
- data/examples/dialogs/standarddialogs/dialog.rb +340 -0
- data/examples/dialogs/standarddialogs/main.rb +31 -0
- data/examples/dialogs/tabdialog/main.rb +38 -0
- data/examples/dialogs/tabdialog/tabdialog.rb +178 -0
- data/examples/draganddrop/draggableicons/dragwidget.rb +125 -0
- data/examples/draganddrop/draggableicons/images/boat.png +0 -0
- data/examples/draganddrop/draggableicons/images/car.png +0 -0
- data/examples/draganddrop/draggableicons/images/house.png +0 -0
- data/examples/draganddrop/draggableicons/main.rb +41 -0
- data/examples/draganddrop/draggabletext/draglabel.rb +51 -0
- data/examples/draganddrop/draggabletext/dragwidget.rb +94 -0
- data/examples/draganddrop/draggabletext/main.rb +33 -0
- data/examples/draganddrop/draggabletext/words.txt +41 -0
- data/examples/draganddrop/dropsite/dropsitewidget.rb +98 -0
- data/examples/draganddrop/dropsite/dropsitewindow.rb +114 -0
- data/examples/draganddrop/dropsite/main.rb +33 -0
- data/examples/draganddrop/fridgemagnets/draglabel.rb +78 -0
- data/examples/draganddrop/fridgemagnets/dragwidget.rb +130 -0
- data/examples/draganddrop/fridgemagnets/main.rb +33 -0
- data/examples/draganddrop/fridgemagnets/words.txt +48 -0
- data/examples/draganddrop/puzzle/example.jpg +0 -0
- data/examples/draganddrop/puzzle/main.rb +33 -0
- data/examples/draganddrop/puzzle/mainwindow.rb +136 -0
- data/examples/draganddrop/puzzle/pieceslist.rb +95 -0
- data/examples/draganddrop/puzzle/puzzlewidget.rb +190 -0
- data/examples/graphicsview/collidingmice/images/cheese.jpg +0 -0
- data/examples/graphicsview/collidingmice/main.rb +53 -0
- data/examples/graphicsview/collidingmice/makefile +2 -0
- data/examples/graphicsview/collidingmice/mice.qrc +5 -0
- data/examples/graphicsview/collidingmice/mouse.rb +176 -0
- data/examples/graphicsview/dragdroprobot/coloritem.rb +86 -0
- data/examples/graphicsview/dragdroprobot/images/head.png +0 -0
- data/examples/graphicsview/dragdroprobot/main.rb +57 -0
- data/examples/graphicsview/dragdroprobot/makefile +2 -0
- data/examples/graphicsview/dragdroprobot/robot.qrc +5 -0
- data/examples/graphicsview/dragdroprobot/robot.rb +246 -0
- data/examples/itemviews/chart/chart.qrc +5 -0
- data/examples/itemviews/chart/main.rb +33 -0
- data/examples/itemviews/chart/mainwindow.rb +151 -0
- data/examples/itemviews/chart/makefile +2 -0
- data/examples/itemviews/chart/mydata.cht +8 -0
- data/examples/itemviews/chart/pieview.rb +516 -0
- data/examples/itemviews/chart/qtdata.cht +14 -0
- data/examples/itemviews/dirview/main.rb +39 -0
- data/examples/itemviews/pixelator/imagemodel.rb +51 -0
- data/examples/itemviews/pixelator/images.qrc +5 -0
- data/examples/itemviews/pixelator/images/qt.png +0 -0
- data/examples/itemviews/pixelator/main.rb +34 -0
- data/examples/itemviews/pixelator/mainwindow.rb +218 -0
- data/examples/itemviews/pixelator/makefile +3 -0
- data/examples/itemviews/pixelator/pixeldelegate.rb +67 -0
- data/examples/itemviews/puzzle/example.jpg +0 -0
- data/examples/itemviews/puzzle/main.rb +36 -0
- data/examples/itemviews/puzzle/mainwindow.rb +143 -0
- data/examples/itemviews/puzzle/piecesmodel.rb +174 -0
- data/examples/itemviews/puzzle/puzzlewidget.rb +192 -0
- data/examples/itemviews/simpledommodel/domitem.rb +62 -0
- data/examples/itemviews/simpledommodel/dommodel.rb +139 -0
- data/examples/itemviews/simpledommodel/main.rb +33 -0
- data/examples/itemviews/simpledommodel/mainwindow.rb +66 -0
- data/examples/itemviews/simpletreemodel/default.txt +40 -0
- data/examples/itemviews/simpletreemodel/main.rb +41 -0
- data/examples/itemviews/simpletreemodel/makefile +2 -0
- data/examples/itemviews/simpletreemodel/simpletreemodel.qrc +5 -0
- data/examples/itemviews/simpletreemodel/treeitem.rb +67 -0
- data/examples/itemviews/simpletreemodel/treemodel.rb +164 -0
- data/examples/itemviews/sortingmodel/default.txt +40 -0
- data/examples/itemviews/sortingmodel/main.rb +53 -0
- data/examples/itemviews/sortingmodel/treeitem.rb +73 -0
- data/examples/itemviews/sortingmodel/treemodel.rb +166 -0
- data/examples/itemviews/spinboxdelegate/main.rb +47 -0
- data/examples/itemviews/spinboxdelegate/spinboxdelegate.rb +62 -0
- data/examples/killerfilter/killerfilter.rb +55 -0
- data/examples/layouts/basiclayouts/dialog.rb +110 -0
- data/examples/layouts/basiclayouts/main.rb +31 -0
- data/examples/layouts/borderlayout/borderlayout.rb +190 -0
- data/examples/layouts/borderlayout/main.rb +32 -0
- data/examples/layouts/borderlayout/window.rb +52 -0
- data/examples/layouts/flowlayouts/flowlayout.rb +108 -0
- data/examples/layouts/flowlayouts/main.rb +32 -0
- data/examples/layouts/flowlayouts/window.rb +43 -0
- data/examples/mainwindows/application/images/copy.png +0 -0
- data/examples/mainwindows/application/images/cut.png +0 -0
- data/examples/mainwindows/application/images/new.png +0 -0
- data/examples/mainwindows/application/images/open.png +0 -0
- data/examples/mainwindows/application/images/paste.png +0 -0
- data/examples/mainwindows/application/images/save.png +0 -0
- data/examples/mainwindows/application/main.rb +32 -0
- data/examples/mainwindows/application/mainwindow.rb +285 -0
- data/examples/mainwindows/dockwidgets/images/new.png +0 -0
- data/examples/mainwindows/dockwidgets/images/print.png +0 -0
- data/examples/mainwindows/dockwidgets/images/save.png +0 -0
- data/examples/mainwindows/dockwidgets/images/undo.png +0 -0
- data/examples/mainwindows/dockwidgets/main.rb +32 -0
- data/examples/mainwindows/dockwidgets/mainwindow.rb +302 -0
- data/examples/mainwindows/mdi/images/copy.png +0 -0
- data/examples/mainwindows/mdi/images/cut.png +0 -0
- data/examples/mainwindows/mdi/images/new.png +0 -0
- data/examples/mainwindows/mdi/images/open.png +0 -0
- data/examples/mainwindows/mdi/images/paste.png +0 -0
- data/examples/mainwindows/mdi/images/save.png +0 -0
- data/examples/mainwindows/mdi/main.rb +32 -0
- data/examples/mainwindows/mdi/mainwindow.rb +363 -0
- data/examples/mainwindows/mdi/mdichild.rb +152 -0
- data/examples/mainwindows/menus/main.rb +32 -0
- data/examples/mainwindows/menus/mainwindow.rb +327 -0
- data/examples/mainwindows/recentfiles/main.rb +32 -0
- data/examples/mainwindows/recentfiles/mainwindow.rb +258 -0
- data/examples/mainwindows/sdi/images/copy.png +0 -0
- data/examples/mainwindows/sdi/images/cut.png +0 -0
- data/examples/mainwindows/sdi/images/new.png +0 -0
- data/examples/mainwindows/sdi/images/open.png +0 -0
- data/examples/mainwindows/sdi/images/paste.png +0 -0
- data/examples/mainwindows/sdi/images/save.png +0 -0
- data/examples/mainwindows/sdi/main.rb +32 -0
- data/examples/mainwindows/sdi/mainwindow.rb +335 -0
- data/examples/network/broadcastreceiver/main.rb +32 -0
- data/examples/network/broadcastreceiver/receiver.rb +64 -0
- data/examples/network/broadcastsender/main.rb +32 -0
- data/examples/network/broadcastsender/sender.rb +70 -0
- data/examples/network/fortuneclient/client.rb +150 -0
- data/examples/network/fortuneclient/main.rb +32 -0
- data/examples/network/fortuneserver/main.rb +32 -0
- data/examples/network/fortuneserver/server.rb +88 -0
- data/examples/network/ftp/ftpwindow.rb +254 -0
- data/examples/network/ftp/images/cdtoparent.png +0 -0
- data/examples/network/ftp/images/dir.png +0 -0
- data/examples/network/ftp/images/file.png +0 -0
- data/examples/network/ftp/main.rb +32 -0
- data/examples/network/http/httpwindow.rb +187 -0
- data/examples/network/http/main.rb +32 -0
- data/examples/network/loopback/dialog.rb +163 -0
- data/examples/network/loopback/main.rb +32 -0
- data/examples/opengl/grabber/glwidget.rb +265 -0
- data/examples/opengl/grabber/main.rb +32 -0
- data/examples/opengl/grabber/mainwindow.rb +189 -0
- data/examples/opengl/hellogl/glwidget.rb +226 -0
- data/examples/opengl/hellogl/main.rb +32 -0
- data/examples/opengl/hellogl/window.rb +66 -0
- data/examples/opengl/textures/glwidget.rb +151 -0
- data/examples/opengl/textures/images/side1.png +0 -0
- data/examples/opengl/textures/images/side2.png +0 -0
- data/examples/opengl/textures/images/side3.png +0 -0
- data/examples/opengl/textures/images/side4.png +0 -0
- data/examples/opengl/textures/images/side5.png +0 -0
- data/examples/opengl/textures/images/side6.png +0 -0
- data/examples/opengl/textures/main.rb +32 -0
- data/examples/opengl/textures/window.rb +77 -0
- data/examples/painting/basicdrawing/images/brick.png +0 -0
- data/examples/painting/basicdrawing/images/qt-logo.png +0 -0
- data/examples/painting/basicdrawing/main.rb +32 -0
- data/examples/painting/basicdrawing/renderarea.rb +166 -0
- data/examples/painting/basicdrawing/window.rb +215 -0
- data/examples/painting/concentriccircles/circlewidget.rb +88 -0
- data/examples/painting/concentriccircles/main.rb +32 -0
- data/examples/painting/concentriccircles/window.rb +72 -0
- data/examples/painting/fontsampler/main.rb +32 -0
- data/examples/painting/fontsampler/mainwindow.rb +368 -0
- data/examples/painting/fontsampler/mainwindowbase.ui +136 -0
- data/examples/painting/fontsampler/makefile +8 -0
- data/examples/painting/fontsampler/previewdialog.rb +256 -0
- data/examples/painting/fontsampler/previewdialogbase.ui +224 -0
- data/examples/painting/fontsampler/previewlabel.rb +43 -0
- data/examples/painting/imagecomposition/imagecomposer.rb +152 -0
- data/examples/painting/imagecomposition/imagecomposition.qrc +6 -0
- data/examples/painting/imagecomposition/images/background.png +0 -0
- data/examples/painting/imagecomposition/images/blackrectangle.png +0 -0
- data/examples/painting/imagecomposition/images/butterfly.png +0 -0
- data/examples/painting/imagecomposition/images/checker.png +0 -0
- data/examples/painting/imagecomposition/main.rb +33 -0
- data/examples/painting/imagecomposition/makefile +2 -0
- data/examples/painting/painterpaths/main.rb +32 -0
- data/examples/painting/painterpaths/renderarea.rb +97 -0
- data/examples/painting/painterpaths/window.rb +247 -0
- data/examples/painting/svgviewer/files/bubbles.svg +212 -0
- data/examples/painting/svgviewer/files/cubic.svg +77 -0
- data/examples/painting/svgviewer/files/spheres.svg +79 -0
- data/examples/painting/svgviewer/main.rb +38 -0
- data/examples/painting/svgviewer/mainwindow.rb +99 -0
- data/examples/painting/svgviewer/makefile +2 -0
- data/examples/painting/svgviewer/svgview.rb +156 -0
- data/examples/painting/svgviewer/svgviewer.qrc +6 -0
- data/examples/painting/svgviewer/svgwindow.rb +87 -0
- data/examples/painting/transformations/main.rb +32 -0
- data/examples/painting/transformations/renderarea.rb +127 -0
- data/examples/painting/transformations/window.rb +153 -0
- data/examples/passivepopup/passivepopup.rb +38 -0
- data/examples/qdbus/chat/chat.rb +146 -0
- data/examples/qdbus/chat/chat_adaptor.rb +12 -0
- data/examples/qdbus/chat/chat_interface.rb +13 -0
- data/examples/qdbus/chat/chatmainwindow.ui +184 -0
- data/examples/qdbus/chat/chatsetnickname.ui +145 -0
- data/examples/qdbus/chat/makefile +8 -0
- data/examples/qdbus/complexpingpong/complexping.rb +92 -0
- data/examples/qdbus/complexpingpong/complexpong.rb +83 -0
- data/examples/qdbus/complexpingpong/ping-common.rb +1 -0
- data/examples/qdbus/listnames/listnames.rb +69 -0
- data/examples/qdbus/pingpong/ping-common.rb +1 -0
- data/examples/qdbus/pingpong/ping.rb +52 -0
- data/examples/qdbus/pingpong/pong.rb +55 -0
- data/examples/qdbus/remotecontrolledcar/car/car.rb +151 -0
- data/examples/qdbus/remotecontrolledcar/car/main.rb +50 -0
- data/examples/qdbus/remotecontrolledcar/controller/controller.rb +66 -0
- data/examples/qdbus/remotecontrolledcar/controller/controller.ui +61 -0
- data/examples/qdbus/remotecontrolledcar/controller/main.rb +32 -0
- data/examples/qdbus/remotecontrolledcar/controller/makefile +2 -0
- data/examples/qtscribble/scribble.rb +270 -0
- data/examples/richtext/calendar/main.rb +33 -0
- data/examples/richtext/calendar/mainwindow.rb +173 -0
- data/examples/richtext/orderform/detailsdialog.rb +130 -0
- data/examples/richtext/orderform/main.rb +34 -0
- data/examples/richtext/orderform/mainwindow.rb +194 -0
- data/examples/richtext/syntaxhighlighter/examples/example +79 -0
- data/examples/richtext/syntaxhighlighter/highlighter.rb +90 -0
- data/examples/richtext/syntaxhighlighter/main.rb +34 -0
- data/examples/richtext/syntaxhighlighter/mainwindow.rb +105 -0
- data/examples/ruboids/Manifest +26 -0
- data/examples/ruboids/README +53 -0
- data/examples/ruboids/TODO +29 -0
- data/examples/ruboids/boids.properties +33 -0
- data/examples/ruboids/generateManifest.rb +42 -0
- data/examples/ruboids/index.html +147 -0
- data/examples/ruboids/release.rb +152 -0
- data/examples/ruboids/ruboids/Boid.rb +141 -0
- data/examples/ruboids/ruboids/BoidView.rb +159 -0
- data/examples/ruboids/ruboids/Camera.rb +24 -0
- data/examples/ruboids/ruboids/CameraDialog.rb +218 -0
- data/examples/ruboids/ruboids/Canvas.rb +143 -0
- data/examples/ruboids/ruboids/Cloud.rb +61 -0
- data/examples/ruboids/ruboids/CloudView.rb +54 -0
- data/examples/ruboids/ruboids/Flock.rb +47 -0
- data/examples/ruboids/ruboids/Graphics.rb +278 -0
- data/examples/ruboids/ruboids/Params.rb +87 -0
- data/examples/ruboids/ruboids/Point.rb +153 -0
- data/examples/ruboids/ruboids/Thing.rb +34 -0
- data/examples/ruboids/ruboids/Triangle.rb +21 -0
- data/examples/ruboids/ruboids/View.rb +88 -0
- data/examples/ruboids/ruboids/World.rb +82 -0
- data/examples/ruboids/ruboids/WorldWindow.rb +52 -0
- data/examples/ruboids/ruboids/info.rb +12 -0
- data/examples/ruboids/ruboids/ruboids.rb +29 -0
- data/examples/run_all.rb +14 -0
- data/examples/textedit/textedit.rb +150 -0
- data/examples/tutorial/t1/t1.rb +10 -0
- data/examples/tutorial/t10/cannon.rb +72 -0
- data/examples/tutorial/t10/lcdrange.rb +45 -0
- data/examples/tutorial/t10/t10.rb +55 -0
- data/examples/tutorial/t11/cannon.rb +124 -0
- data/examples/tutorial/t11/lcdrange.rb +45 -0
- data/examples/tutorial/t11/t11.rb +65 -0
- data/examples/tutorial/t12/cannon.rb +158 -0
- data/examples/tutorial/t12/lcdrange.rb +59 -0
- data/examples/tutorial/t12/t12.rb +66 -0
- data/examples/tutorial/t13/cannon.rb +208 -0
- data/examples/tutorial/t13/gamebrd.rb +113 -0
- data/examples/tutorial/t13/lcdrange.rb +60 -0
- data/examples/tutorial/t13/t13.rb +11 -0
- data/examples/tutorial/t14/cannon.rb +263 -0
- data/examples/tutorial/t14/gamebrd.rb +123 -0
- data/examples/tutorial/t14/lcdrange.rb +63 -0
- data/examples/tutorial/t14/t14.rb +11 -0
- data/examples/tutorial/t2/t2.rb +16 -0
- data/examples/tutorial/t3/t3.rb +18 -0
- data/examples/tutorial/t4/t4.rb +25 -0
- data/examples/tutorial/t5/t5.rb +37 -0
- data/examples/tutorial/t6/t6.rb +52 -0
- data/examples/tutorial/t7/lcdrange.rb +32 -0
- data/examples/tutorial/t7/t7.rb +42 -0
- data/examples/tutorial/t8/cannon.rb +38 -0
- data/examples/tutorial/t8/lcdrange.rb +45 -0
- data/examples/tutorial/t8/t8.rb +43 -0
- data/examples/tutorial/t9/cannon.rb +45 -0
- data/examples/tutorial/t9/lcdrange.rb +46 -0
- data/examples/tutorial/t9/t9.rb +43 -0
- data/examples/widgets/analogclock/analogclock.rb +94 -0
- data/examples/widgets/analogclock/main.rb +9 -0
- data/examples/widgets/calculator/button.rb +45 -0
- data/examples/widgets/calculator/calculator.rb +382 -0
- data/examples/widgets/calculator/main.rb +32 -0
- data/examples/widgets/charactermap/characterwidget.rb +110 -0
- data/examples/widgets/charactermap/main.rb +32 -0
- data/examples/widgets/charactermap/mainwindow.rb +118 -0
- data/examples/widgets/digitalclock/digitalclock.rb +30 -0
- data/examples/widgets/digitalclock/main.rb +9 -0
- data/examples/widgets/groupbox/main.rb +32 -0
- data/examples/widgets/groupbox/window.rb +134 -0
- data/examples/widgets/icons/iconpreviewarea.rb +111 -0
- data/examples/widgets/icons/iconsizespinbox.rb +39 -0
- data/examples/widgets/icons/imagedelegate.rb +73 -0
- data/examples/widgets/icons/images/designer.png +0 -0
- data/examples/widgets/icons/images/find_disabled.png +0 -0
- data/examples/widgets/icons/images/find_normal.png +0 -0
- data/examples/widgets/icons/images/monkey_off_128x128.png +0 -0
- data/examples/widgets/icons/images/monkey_off_16x16.png +0 -0
- data/examples/widgets/icons/images/monkey_off_32x32.png +0 -0
- data/examples/widgets/icons/images/monkey_off_64x64.png +0 -0
- data/examples/widgets/icons/images/monkey_on_128x128.png +0 -0
- data/examples/widgets/icons/images/monkey_on_16x16.png +0 -0
- data/examples/widgets/icons/images/monkey_on_32x32.png +0 -0
- data/examples/widgets/icons/images/monkey_on_64x64.png +0 -0
- data/examples/widgets/icons/images/qtopia_16x16.png +0 -0
- data/examples/widgets/icons/images/qtopia_32x32.png +0 -0
- data/examples/widgets/icons/images/qtopia_48x48.png +0 -0
- data/examples/widgets/icons/main.rb +32 -0
- data/examples/widgets/icons/mainwindow.rb +351 -0
- data/examples/widgets/imageviewer/imageviewer.rb +219 -0
- data/examples/widgets/imageviewer/main.rb +32 -0
- data/examples/widgets/lineedits/main.rb +32 -0
- data/examples/widgets/lineedits/window.rb +199 -0
- data/examples/widgets/movie/images/open.png +0 -0
- data/examples/widgets/movie/images/pause.png +0 -0
- data/examples/widgets/movie/images/play.png +0 -0
- data/examples/widgets/movie/images/quit.png +0 -0
- data/examples/widgets/movie/images/stop.png +0 -0
- data/examples/widgets/movie/main.rb +32 -0
- data/examples/widgets/movie/movieplayer.rb +201 -0
- data/examples/widgets/movie/movies/fire.mng +0 -0
- data/examples/widgets/screenshot/main.rb +32 -0
- data/examples/widgets/screenshot/screenshot.rb +155 -0
- data/examples/widgets/scribble/main.rb +32 -0
- data/examples/widgets/scribble/mainwindow.rb +202 -0
- data/examples/widgets/scribble/scribblearea.rb +154 -0
- data/examples/widgets/sliders/main.rb +32 -0
- data/examples/widgets/sliders/slidersgroup.rb +97 -0
- data/examples/widgets/sliders/window.rb +124 -0
- data/examples/widgets/spinboxes/main.rb +32 -0
- data/examples/widgets/spinboxes/window.rb +213 -0
- data/examples/widgets/tetrix/main.rb +33 -0
- data/examples/widgets/tetrix/tetrixboard.rb +346 -0
- data/examples/widgets/tetrix/tetrixpiece.rb +135 -0
- data/examples/widgets/tetrix/tetrixwindow.rb +88 -0
- data/examples/widgets/tooltips/images/circle.png +0 -0
- data/examples/widgets/tooltips/images/square.png +0 -0
- data/examples/widgets/tooltips/images/triangle.png +0 -0
- data/examples/widgets/tooltips/main.rb +32 -0
- data/examples/widgets/tooltips/shapeitem.rb +31 -0
- data/examples/widgets/tooltips/sortingbox.rb +222 -0
- data/examples/widgets/wiggly/dialog.rb +48 -0
- data/examples/widgets/wiggly/main.rb +9 -0
- data/examples/widgets/wiggly/wigglywidget.rb +76 -0
- data/examples/widgets/windowflags/controllerwindow.rb +195 -0
- data/examples/widgets/windowflags/main.rb +32 -0
- data/examples/widgets/windowflags/previewwindow.rb +103 -0
- data/examples/xml/dombookmarks/frank.xbel +230 -0
- data/examples/xml/dombookmarks/jennifer.xbel +93 -0
- data/examples/xml/dombookmarks/main.rb +34 -0
- data/examples/xml/dombookmarks/mainwindow.rb +129 -0
- data/examples/xml/dombookmarks/xbeltree.rb +172 -0
- data/examples/xml/saxbookmarks/frank.xbel +230 -0
- data/examples/xml/saxbookmarks/jennifer.xbel +93 -0
- data/examples/xml/saxbookmarks/main.rb +34 -0
- data/examples/xml/saxbookmarks/mainwindow.rb +144 -0
- data/examples/xml/saxbookmarks/xbelgenerator.rb +95 -0
- data/examples/xml/saxbookmarks/xbelhandler.rb +122 -0
- data/ext/CMakeLists.txt +22 -0
- data/ext/cmake/modules/CMakeCSharpCompiler.cmake.in +7 -0
- data/ext/cmake/modules/CMakeCSharpInformation.cmake +366 -0
- data/ext/cmake/modules/CMakeDetermineCSharpCompiler.cmake +85 -0
- data/ext/cmake/modules/CMakeTestCSharpCompiler.cmake +1 -0
- data/ext/cmake/modules/CheckCXXSourceCompiles.cmake +68 -0
- data/ext/cmake/modules/FindMono.cmake +36 -0
- data/ext/cmake/modules/FindPHP5.cmake +179 -0
- data/ext/cmake/modules/FindPerlMore.cmake +78 -0
- data/ext/cmake/modules/FindQScintilla.cmake +57 -0
- data/ext/cmake/modules/FindQt4.cmake +1271 -0
- data/ext/cmake/modules/FindQwt5.cmake +104 -0
- data/ext/cmake/modules/FindRuby.cmake +261 -0
- data/ext/cmake/modules/FindSmoke.cmake +78 -0
- data/ext/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake +85 -0
- data/ext/cmake/modules/MacroLogFeature.cmake +146 -0
- data/ext/cmake/modules/MacroOptionalAddBindings.cmake +47 -0
- data/ext/cmake/modules/MacroOptionalFindPackage.cmake +48 -0
- data/ext/cmake/modules/MacroPushRequiredVars.cmake +47 -0
- data/ext/cmake/modules/Qt4ConfigDependentSettings.cmake +384 -0
- data/ext/cmake/modules/Qt4Macros.cmake +414 -0
- data/ext/generator/CMakeLists.txt +38 -0
- data/ext/generator/generator_export.h +31 -0
- data/ext/generator/generatorenvironment.cpp +52 -0
- data/ext/generator/generatorenvironment.h +35 -0
- data/ext/generator/generatorpreprocessor.cpp +242 -0
- data/ext/generator/generatorpreprocessor.h +83 -0
- data/ext/generator/generators/CMakeLists.txt +4 -0
- data/ext/generator/generators/dump/CMakeLists.txt +10 -0
- data/ext/generator/generators/dump/generator_dump.cpp +36 -0
- data/ext/generator/generators/smoke/CMakeLists.txt +13 -0
- data/ext/generator/generators/smoke/generator_smoke.cpp +233 -0
- data/ext/generator/generators/smoke/globals.h +138 -0
- data/ext/generator/generators/smoke/helpers.cpp +773 -0
- data/ext/generator/generators/smoke/writeClasses.cpp +502 -0
- data/ext/generator/generators/smoke/writeSmokeDataFile.cpp +729 -0
- data/ext/generator/generatorvisitor.cpp +922 -0
- data/ext/generator/generatorvisitor.h +119 -0
- data/ext/generator/main.cpp +239 -0
- data/ext/generator/name_compiler.cpp +205 -0
- data/ext/generator/name_compiler.h +76 -0
- data/ext/generator/options.cpp +32 -0
- data/ext/generator/options.h +45 -0
- data/ext/generator/parser/CMakeLists.txt +41 -0
- data/ext/generator/parser/ast.cpp +21 -0
- data/ext/generator/parser/ast.h +923 -0
- data/ext/generator/parser/astutilities.h +65 -0
- data/ext/generator/parser/codegenerator.cpp +867 -0
- data/ext/generator/parser/codegenerator.h +180 -0
- data/ext/generator/parser/codemodel_fwd.h +76 -0
- data/ext/generator/parser/commentformatter.cpp +54 -0
- data/ext/generator/parser/commentformatter.h +45 -0
- data/ext/generator/parser/commentparser.cpp +109 -0
- data/ext/generator/parser/commentparser.h +84 -0
- data/ext/generator/parser/control.cpp +40 -0
- data/ext/generator/parser/control.h +51 -0
- data/ext/generator/parser/cppparser_export.h +33 -0
- data/ext/generator/parser/default_visitor.cpp +470 -0
- data/ext/generator/parser/default_visitor.h +116 -0
- data/ext/generator/parser/dumptree.cpp +146 -0
- data/ext/generator/parser/dumptree.h +50 -0
- data/ext/generator/parser/indexedstring.cpp +213 -0
- data/ext/generator/parser/indexedstring.h +147 -0
- data/ext/generator/parser/kdevelop-parser-rev +1 -0
- data/ext/generator/parser/kdevvarlengtharray.h +346 -0
- data/ext/generator/parser/lexer.cpp +963 -0
- data/ext/generator/parser/lexer.h +308 -0
- data/ext/generator/parser/listnode.cpp +20 -0
- data/ext/generator/parser/listnode.h +97 -0
- data/ext/generator/parser/memorypool.cpp +20 -0
- data/ext/generator/parser/memorypool.h +41 -0
- data/ext/generator/parser/name_compiler.cpp +190 -0
- data/ext/generator/parser/name_compiler.h +77 -0
- data/ext/generator/parser/parser.cpp +4706 -0
- data/ext/generator/parser/parser.h +300 -0
- data/ext/generator/parser/parsesession.cpp +105 -0
- data/ext/generator/parser/parsesession.h +87 -0
- data/ext/generator/parser/problem.h +21 -0
- data/ext/generator/parser/rpp/CMakeLists.txt +39 -0
- data/ext/generator/parser/rpp/Makefile.am +13 -0
- data/ext/generator/parser/rpp/anchor.h +51 -0
- data/ext/generator/parser/rpp/appendedlist.h +363 -0
- data/ext/generator/parser/rpp/chartools.cpp +126 -0
- data/ext/generator/parser/rpp/chartools.h +90 -0
- data/ext/generator/parser/rpp/macrorepository.cpp +44 -0
- data/ext/generator/parser/rpp/macrorepository.h +59 -0
- data/ext/generator/parser/rpp/pp-configuration +86 -0
- data/ext/generator/parser/rpp/pp-engine.cpp +1216 -0
- data/ext/generator/parser/rpp/pp-engine.h +267 -0
- data/ext/generator/parser/rpp/pp-environment.cpp +271 -0
- data/ext/generator/parser/rpp/pp-environment.h +119 -0
- data/ext/generator/parser/rpp/pp-internal.cpp +38 -0
- data/ext/generator/parser/rpp/pp-internal.h +37 -0
- data/ext/generator/parser/rpp/pp-location.cpp +191 -0
- data/ext/generator/parser/rpp/pp-location.h +89 -0
- data/ext/generator/parser/rpp/pp-macro-expander.cpp +568 -0
- data/ext/generator/parser/rpp/pp-macro-expander.cpp.orig +558 -0
- data/ext/generator/parser/rpp/pp-macro-expander.h +130 -0
- data/ext/generator/parser/rpp/pp-macro.cpp +153 -0
- data/ext/generator/parser/rpp/pp-macro.h +176 -0
- data/ext/generator/parser/rpp/pp-scanner.cpp +310 -0
- data/ext/generator/parser/rpp/pp-scanner.h +97 -0
- data/ext/generator/parser/rpp/pp-stream.cpp +425 -0
- data/ext/generator/parser/rpp/pp-stream.h +183 -0
- data/ext/generator/parser/rpp/preprocessor.cpp +65 -0
- data/ext/generator/parser/rpp/preprocessor.h +80 -0
- data/ext/generator/parser/rpp/rpp.pri +2 -0
- data/ext/generator/parser/rpp/test/t001.cpp +23 -0
- data/ext/generator/parser/rpp/test/t002.cpp +15 -0
- data/ext/generator/parser/rpp/test/t003.cpp +10 -0
- data/ext/generator/parser/rpp/test/t004.cpp +9 -0
- data/ext/generator/parser/rpp/test/t005.cpp +10 -0
- data/ext/generator/parser/rpp/test/t006.cpp +10 -0
- data/ext/generator/parser/rpp/test/t007.cpp +6 -0
- data/ext/generator/parser/rpp/test/t008.cpp +6 -0
- data/ext/generator/parser/rpp/test/t009.cpp +5 -0
- data/ext/generator/parser/rpp/test/t010.cpp +15 -0
- data/ext/generator/parser/rpp/test/t011.cpp +9 -0
- data/ext/generator/parser/rpp/tests/CMakeLists.txt +13 -0
- data/ext/generator/parser/rpp/tests/main.cpp +69 -0
- data/ext/generator/parser/rxx.pri +50 -0
- data/ext/generator/parser/rxx_allocator.h +128 -0
- data/ext/generator/parser/safetycounter.h +57 -0
- data/ext/generator/parser/simplecursor.h +74 -0
- data/ext/generator/parser/stringhelpers.cpp +577 -0
- data/ext/generator/parser/stringhelpers.h +118 -0
- data/ext/generator/parser/symbol.h +140 -0
- data/ext/generator/parser/tests/CMakeLists.txt +30 -0
- data/ext/generator/parser/tests/test_generator.cpp +259 -0
- data/ext/generator/parser/tests/test_parser.cpp +474 -0
- data/ext/generator/parser/tests/test_pool.cpp +109 -0
- data/ext/generator/parser/tests/test_pool.h +35 -0
- data/ext/generator/parser/tests/testconfig.h.cmake +4 -0
- data/ext/generator/parser/tokens.cpp +364 -0
- data/ext/generator/parser/tokens.h +147 -0
- data/ext/generator/parser/type_compiler.cpp +135 -0
- data/ext/generator/parser/type_compiler.h +68 -0
- data/ext/generator/parser/visitor.cpp +115 -0
- data/ext/generator/parser/visitor.h +138 -0
- data/ext/generator/type.cpp +195 -0
- data/ext/generator/type.h +497 -0
- data/ext/generator/type_compiler.cpp +275 -0
- data/ext/generator/type_compiler.h +80 -0
- data/ext/ruby/CMakeLists.txt +63 -0
- data/ext/ruby/qtruby/AUTHORS +54 -0
- data/ext/ruby/qtruby/CMakeLists.txt +4 -0
- data/ext/ruby/qtruby/COPYING +355 -0
- data/ext/ruby/qtruby/COPYING.LIB +510 -0
- data/ext/ruby/qtruby/ChangeLog +3732 -0
- data/ext/ruby/qtruby/INSTALL +79 -0
- data/ext/ruby/qtruby/README +264 -0
- data/ext/ruby/qtruby/TODO +8 -0
- data/ext/ruby/qtruby/bin/CMakeLists.txt +1 -0
- data/ext/ruby/qtruby/bin/rbqtapi +152 -0
- data/ext/ruby/qtruby/examples/base/kicons.rb +54 -0
- data/ext/ruby/qtruby/examples/base/rui.rb +21 -0
- data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorbuilder.qrc +5 -0
- data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorform.rb +60 -0
- data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorform.ui +299 -0
- data/ext/ruby/qtruby/examples/designer/calculatorbuilder/main.rb +33 -0
- data/ext/ruby/qtruby/examples/designer/calculatorbuilder/makefile +2 -0
- data/ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb +46 -0
- data/ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.ui +277 -0
- data/ext/ruby/qtruby/examples/designer/calculatorform/main.rb +32 -0
- data/ext/ruby/qtruby/examples/designer/calculatorform/makefile +3 -0
- data/ext/ruby/qtruby/examples/desktop/screenshot/main.rb +32 -0
- data/ext/ruby/qtruby/examples/desktop/screenshot/screenshot.rb +156 -0
- data/ext/ruby/qtruby/examples/desktop/systray/images/bad.svg +64 -0
- data/ext/ruby/qtruby/examples/desktop/systray/images/heart.svg +55 -0
- data/ext/ruby/qtruby/examples/desktop/systray/images/trash.svg +58 -0
- data/ext/ruby/qtruby/examples/desktop/systray/main.rb +41 -0
- data/ext/ruby/qtruby/examples/desktop/systray/makefile +2 -0
- data/ext/ruby/qtruby/examples/desktop/systray/systray.qrc +7 -0
- data/ext/ruby/qtruby/examples/desktop/systray/window.rb +223 -0
- data/ext/ruby/qtruby/examples/dialogs/complexwizard/complexwizard.rb +140 -0
- data/ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb +294 -0
- data/ext/ruby/qtruby/examples/dialogs/complexwizard/main.rb +31 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/configdialog.rb +109 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/images/config.png +0 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/images/query.png +0 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/images/update.png +0 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/main.rb +31 -0
- data/ext/ruby/qtruby/examples/dialogs/configdialog/pages.rb +140 -0
- data/ext/ruby/qtruby/examples/dialogs/extension/finddialog.rb +89 -0
- data/ext/ruby/qtruby/examples/dialogs/extension/main.rb +31 -0
- data/ext/ruby/qtruby/examples/dialogs/findfiles/main.rb +32 -0
- data/ext/ruby/qtruby/examples/dialogs/findfiles/window.rb +177 -0
- data/ext/ruby/qtruby/examples/dialogs/simplewizard/classwizard.rb +374 -0
- data/ext/ruby/qtruby/examples/dialogs/simplewizard/main.rb +31 -0
- data/ext/ruby/qtruby/examples/dialogs/simplewizard/simplewizard.rb +110 -0
- data/ext/ruby/qtruby/examples/dialogs/standarddialogs/dialog.rb +340 -0
- data/ext/ruby/qtruby/examples/dialogs/standarddialogs/main.rb +31 -0
- data/ext/ruby/qtruby/examples/dialogs/tabdialog/main.rb +38 -0
- data/ext/ruby/qtruby/examples/dialogs/tabdialog/tabdialog.rb +178 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggableicons/dragwidget.rb +125 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/boat.png +0 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/car.png +0 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/house.png +0 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggableicons/main.rb +41 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggabletext/draglabel.rb +51 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggabletext/dragwidget.rb +94 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggabletext/main.rb +33 -0
- data/ext/ruby/qtruby/examples/draganddrop/draggabletext/words.txt +41 -0
- data/ext/ruby/qtruby/examples/draganddrop/dropsite/dropsitewidget.rb +98 -0
- data/ext/ruby/qtruby/examples/draganddrop/dropsite/dropsitewindow.rb +114 -0
- data/ext/ruby/qtruby/examples/draganddrop/dropsite/main.rb +33 -0
- data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/draglabel.rb +78 -0
- data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/dragwidget.rb +130 -0
- data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/main.rb +33 -0
- data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/words.txt +48 -0
- data/ext/ruby/qtruby/examples/draganddrop/puzzle/example.jpg +0 -0
- data/ext/ruby/qtruby/examples/draganddrop/puzzle/main.rb +33 -0
- data/ext/ruby/qtruby/examples/draganddrop/puzzle/mainwindow.rb +136 -0
- data/ext/ruby/qtruby/examples/draganddrop/puzzle/pieceslist.rb +95 -0
- data/ext/ruby/qtruby/examples/draganddrop/puzzle/puzzlewidget.rb +190 -0
- data/ext/ruby/qtruby/examples/graphicsview/collidingmice/images/cheese.jpg +0 -0
- data/ext/ruby/qtruby/examples/graphicsview/collidingmice/main.rb +53 -0
- data/ext/ruby/qtruby/examples/graphicsview/collidingmice/makefile +2 -0
- data/ext/ruby/qtruby/examples/graphicsview/collidingmice/mice.qrc +5 -0
- data/ext/ruby/qtruby/examples/graphicsview/collidingmice/mouse.rb +176 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/coloritem.rb +86 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/images/head.png +0 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/main.rb +57 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/makefile +2 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/robot.qrc +5 -0
- data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/robot.rb +246 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/chart.qrc +5 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/main.rb +33 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/mainwindow.rb +151 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/makefile +2 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/mydata.cht +8 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/pieview.rb +516 -0
- data/ext/ruby/qtruby/examples/itemviews/chart/qtdata.cht +14 -0
- data/ext/ruby/qtruby/examples/itemviews/dirview/main.rb +39 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/imagemodel.rb +51 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/images.qrc +5 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/images/qt.png +0 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/main.rb +34 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/mainwindow.rb +218 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/makefile +3 -0
- data/ext/ruby/qtruby/examples/itemviews/pixelator/pixeldelegate.rb +67 -0
- data/ext/ruby/qtruby/examples/itemviews/puzzle/example.jpg +0 -0
- data/ext/ruby/qtruby/examples/itemviews/puzzle/main.rb +36 -0
- data/ext/ruby/qtruby/examples/itemviews/puzzle/mainwindow.rb +143 -0
- data/ext/ruby/qtruby/examples/itemviews/puzzle/piecesmodel.rb +174 -0
- data/ext/ruby/qtruby/examples/itemviews/puzzle/puzzlewidget.rb +192 -0
- data/ext/ruby/qtruby/examples/itemviews/simpledommodel/domitem.rb +62 -0
- data/ext/ruby/qtruby/examples/itemviews/simpledommodel/dommodel.rb +139 -0
- data/ext/ruby/qtruby/examples/itemviews/simpledommodel/main.rb +33 -0
- data/ext/ruby/qtruby/examples/itemviews/simpledommodel/mainwindow.rb +66 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/default.txt +40 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/main.rb +41 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/makefile +2 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/simpletreemodel.qrc +5 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/treeitem.rb +67 -0
- data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/treemodel.rb +164 -0
- data/ext/ruby/qtruby/examples/itemviews/sortingmodel/default.txt +40 -0
- data/ext/ruby/qtruby/examples/itemviews/sortingmodel/main.rb +53 -0
- data/ext/ruby/qtruby/examples/itemviews/sortingmodel/treeitem.rb +73 -0
- data/ext/ruby/qtruby/examples/itemviews/sortingmodel/treemodel.rb +166 -0
- data/ext/ruby/qtruby/examples/itemviews/spinboxdelegate/main.rb +47 -0
- data/ext/ruby/qtruby/examples/itemviews/spinboxdelegate/spinboxdelegate.rb +62 -0
- data/ext/ruby/qtruby/examples/killerfilter/killerfilter.rb +55 -0
- data/ext/ruby/qtruby/examples/layouts/basiclayouts/dialog.rb +110 -0
- data/ext/ruby/qtruby/examples/layouts/basiclayouts/main.rb +31 -0
- data/ext/ruby/qtruby/examples/layouts/borderlayout/borderlayout.rb +190 -0
- data/ext/ruby/qtruby/examples/layouts/borderlayout/main.rb +32 -0
- data/ext/ruby/qtruby/examples/layouts/borderlayout/window.rb +52 -0
- data/ext/ruby/qtruby/examples/layouts/flowlayouts/flowlayout.rb +108 -0
- data/ext/ruby/qtruby/examples/layouts/flowlayouts/main.rb +32 -0
- data/ext/ruby/qtruby/examples/layouts/flowlayouts/window.rb +43 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/copy.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/cut.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/new.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/open.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/paste.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/images/save.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/application/mainwindow.rb +285 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/new.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/print.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/save.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/undo.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/mainwindow.rb +302 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/copy.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/cut.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/new.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/open.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/paste.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/images/save.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/mainwindow.rb +363 -0
- data/ext/ruby/qtruby/examples/mainwindows/mdi/mdichild.rb +152 -0
- data/ext/ruby/qtruby/examples/mainwindows/menus/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/menus/mainwindow.rb +327 -0
- data/ext/ruby/qtruby/examples/mainwindows/recentfiles/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/recentfiles/mainwindow.rb +258 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/copy.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/cut.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/new.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/open.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/paste.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/images/save.png +0 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/main.rb +32 -0
- data/ext/ruby/qtruby/examples/mainwindows/sdi/mainwindow.rb +335 -0
- data/ext/ruby/qtruby/examples/network/broadcastreceiver/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/broadcastreceiver/receiver.rb +64 -0
- data/ext/ruby/qtruby/examples/network/broadcastsender/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/broadcastsender/sender.rb +70 -0
- data/ext/ruby/qtruby/examples/network/fortuneclient/client.rb +150 -0
- data/ext/ruby/qtruby/examples/network/fortuneclient/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/fortuneserver/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/fortuneserver/server.rb +88 -0
- data/ext/ruby/qtruby/examples/network/ftp/ftpwindow.rb +254 -0
- data/ext/ruby/qtruby/examples/network/ftp/images/cdtoparent.png +0 -0
- data/ext/ruby/qtruby/examples/network/ftp/images/dir.png +0 -0
- data/ext/ruby/qtruby/examples/network/ftp/images/file.png +0 -0
- data/ext/ruby/qtruby/examples/network/ftp/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/http/httpwindow.rb +187 -0
- data/ext/ruby/qtruby/examples/network/http/main.rb +32 -0
- data/ext/ruby/qtruby/examples/network/loopback/dialog.rb +163 -0
- data/ext/ruby/qtruby/examples/network/loopback/main.rb +32 -0
- data/ext/ruby/qtruby/examples/opengl/grabber/glwidget.rb +265 -0
- data/ext/ruby/qtruby/examples/opengl/grabber/main.rb +32 -0
- data/ext/ruby/qtruby/examples/opengl/grabber/mainwindow.rb +189 -0
- data/ext/ruby/qtruby/examples/opengl/hellogl/glwidget.rb +226 -0
- data/ext/ruby/qtruby/examples/opengl/hellogl/main.rb +32 -0
- data/ext/ruby/qtruby/examples/opengl/hellogl/window.rb +66 -0
- data/ext/ruby/qtruby/examples/opengl/textures/glwidget.rb +151 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side1.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side2.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side3.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side4.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side5.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/images/side6.png +0 -0
- data/ext/ruby/qtruby/examples/opengl/textures/main.rb +32 -0
- data/ext/ruby/qtruby/examples/opengl/textures/window.rb +77 -0
- data/ext/ruby/qtruby/examples/painting/basicdrawing/images/brick.png +0 -0
- data/ext/ruby/qtruby/examples/painting/basicdrawing/images/qt-logo.png +0 -0
- data/ext/ruby/qtruby/examples/painting/basicdrawing/main.rb +32 -0
- data/ext/ruby/qtruby/examples/painting/basicdrawing/renderarea.rb +166 -0
- data/ext/ruby/qtruby/examples/painting/basicdrawing/window.rb +215 -0
- data/ext/ruby/qtruby/examples/painting/concentriccircles/circlewidget.rb +88 -0
- data/ext/ruby/qtruby/examples/painting/concentriccircles/main.rb +32 -0
- data/ext/ruby/qtruby/examples/painting/concentriccircles/window.rb +72 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/main.rb +32 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/mainwindow.rb +368 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/mainwindowbase.ui +136 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/makefile +8 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/previewdialog.rb +256 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/previewdialogbase.ui +224 -0
- data/ext/ruby/qtruby/examples/painting/fontsampler/previewlabel.rb +43 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/imagecomposer.rb +152 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/imagecomposition.qrc +6 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/images/background.png +0 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/images/blackrectangle.png +0 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/images/butterfly.png +0 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/images/checker.png +0 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/main.rb +33 -0
- data/ext/ruby/qtruby/examples/painting/imagecomposition/makefile +2 -0
- data/ext/ruby/qtruby/examples/painting/painterpaths/main.rb +32 -0
- data/ext/ruby/qtruby/examples/painting/painterpaths/renderarea.rb +97 -0
- data/ext/ruby/qtruby/examples/painting/painterpaths/window.rb +247 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/files/bubbles.svg +212 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/files/cubic.svg +77 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/files/spheres.svg +79 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/main.rb +38 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/mainwindow.rb +99 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/makefile +2 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/svgview.rb +156 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/svgviewer.qrc +6 -0
- data/ext/ruby/qtruby/examples/painting/svgviewer/svgwindow.rb +87 -0
- data/ext/ruby/qtruby/examples/painting/transformations/main.rb +32 -0
- data/ext/ruby/qtruby/examples/painting/transformations/renderarea.rb +127 -0
- data/ext/ruby/qtruby/examples/painting/transformations/window.rb +153 -0
- data/ext/ruby/qtruby/examples/passivepopup/passivepopup.rb +38 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/chat.rb +146 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/chat_adaptor.rb +12 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/chat_interface.rb +13 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/chatmainwindow.ui +184 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/chatsetnickname.ui +145 -0
- data/ext/ruby/qtruby/examples/qdbus/chat/makefile +8 -0
- data/ext/ruby/qtruby/examples/qdbus/complexpingpong/complexping.rb +92 -0
- data/ext/ruby/qtruby/examples/qdbus/complexpingpong/complexpong.rb +83 -0
- data/ext/ruby/qtruby/examples/qdbus/complexpingpong/ping-common.rb +1 -0
- data/ext/ruby/qtruby/examples/qdbus/listnames/listnames.rb +69 -0
- data/ext/ruby/qtruby/examples/qdbus/pingpong/ping-common.rb +1 -0
- data/ext/ruby/qtruby/examples/qdbus/pingpong/ping.rb +52 -0
- data/ext/ruby/qtruby/examples/qdbus/pingpong/pong.rb +55 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/car/car.rb +151 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/car/main.rb +50 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/controller.rb +66 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/controller.ui +61 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/main.rb +32 -0
- data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/makefile +2 -0
- data/ext/ruby/qtruby/examples/qtscribble/scribble.rb +270 -0
- data/ext/ruby/qtruby/examples/richtext/calendar/main.rb +33 -0
- data/ext/ruby/qtruby/examples/richtext/calendar/mainwindow.rb +173 -0
- data/ext/ruby/qtruby/examples/richtext/orderform/detailsdialog.rb +130 -0
- data/ext/ruby/qtruby/examples/richtext/orderform/main.rb +34 -0
- data/ext/ruby/qtruby/examples/richtext/orderform/mainwindow.rb +194 -0
- data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/examples/example +79 -0
- data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/highlighter.rb +90 -0
- data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/main.rb +34 -0
- data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/mainwindow.rb +105 -0
- data/ext/ruby/qtruby/examples/ruboids/Manifest +26 -0
- data/ext/ruby/qtruby/examples/ruboids/README +53 -0
- data/ext/ruby/qtruby/examples/ruboids/TODO +29 -0
- data/ext/ruby/qtruby/examples/ruboids/boids.properties +33 -0
- data/ext/ruby/qtruby/examples/ruboids/generateManifest.rb +42 -0
- data/ext/ruby/qtruby/examples/ruboids/index.html +147 -0
- data/ext/ruby/qtruby/examples/ruboids/release.rb +152 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Boid.rb +141 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/BoidView.rb +159 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Camera.rb +24 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/CameraDialog.rb +218 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Canvas.rb +143 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Cloud.rb +61 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/CloudView.rb +54 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Flock.rb +47 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Graphics.rb +278 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Params.rb +87 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Point.rb +153 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Thing.rb +34 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/Triangle.rb +21 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/View.rb +88 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/World.rb +82 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/WorldWindow.rb +52 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/info.rb +12 -0
- data/ext/ruby/qtruby/examples/ruboids/ruboids/ruboids.rb +29 -0
- data/ext/ruby/qtruby/examples/textedit/textedit.rb +150 -0
- data/ext/ruby/qtruby/examples/tutorial/t1/t1.rb +10 -0
- data/ext/ruby/qtruby/examples/tutorial/t10/cannon.rb +72 -0
- data/ext/ruby/qtruby/examples/tutorial/t10/lcdrange.rb +45 -0
- data/ext/ruby/qtruby/examples/tutorial/t10/t10.rb +55 -0
- data/ext/ruby/qtruby/examples/tutorial/t11/cannon.rb +124 -0
- data/ext/ruby/qtruby/examples/tutorial/t11/lcdrange.rb +45 -0
- data/ext/ruby/qtruby/examples/tutorial/t11/t11.rb +65 -0
- data/ext/ruby/qtruby/examples/tutorial/t12/cannon.rb +158 -0
- data/ext/ruby/qtruby/examples/tutorial/t12/lcdrange.rb +59 -0
- data/ext/ruby/qtruby/examples/tutorial/t12/t12.rb +66 -0
- data/ext/ruby/qtruby/examples/tutorial/t13/cannon.rb +208 -0
- data/ext/ruby/qtruby/examples/tutorial/t13/gamebrd.rb +113 -0
- data/ext/ruby/qtruby/examples/tutorial/t13/lcdrange.rb +60 -0
- data/ext/ruby/qtruby/examples/tutorial/t13/t13.rb +11 -0
- data/ext/ruby/qtruby/examples/tutorial/t14/cannon.rb +263 -0
- data/ext/ruby/qtruby/examples/tutorial/t14/gamebrd.rb +123 -0
- data/ext/ruby/qtruby/examples/tutorial/t14/lcdrange.rb +63 -0
- data/ext/ruby/qtruby/examples/tutorial/t14/t14.rb +11 -0
- data/ext/ruby/qtruby/examples/tutorial/t2/t2.rb +16 -0
- data/ext/ruby/qtruby/examples/tutorial/t3/t3.rb +18 -0
- data/ext/ruby/qtruby/examples/tutorial/t4/t4.rb +25 -0
- data/ext/ruby/qtruby/examples/tutorial/t5/t5.rb +37 -0
- data/ext/ruby/qtruby/examples/tutorial/t6/t6.rb +52 -0
- data/ext/ruby/qtruby/examples/tutorial/t7/lcdrange.rb +32 -0
- data/ext/ruby/qtruby/examples/tutorial/t7/t7.rb +42 -0
- data/ext/ruby/qtruby/examples/tutorial/t8/cannon.rb +38 -0
- data/ext/ruby/qtruby/examples/tutorial/t8/lcdrange.rb +45 -0
- data/ext/ruby/qtruby/examples/tutorial/t8/t8.rb +43 -0
- data/ext/ruby/qtruby/examples/tutorial/t9/cannon.rb +45 -0
- data/ext/ruby/qtruby/examples/tutorial/t9/lcdrange.rb +46 -0
- data/ext/ruby/qtruby/examples/tutorial/t9/t9.rb +43 -0
- data/ext/ruby/qtruby/examples/widgets/analogclock/analogclock.rb +94 -0
- data/ext/ruby/qtruby/examples/widgets/analogclock/main.rb +9 -0
- data/ext/ruby/qtruby/examples/widgets/calculator/button.rb +45 -0
- data/ext/ruby/qtruby/examples/widgets/calculator/calculator.rb +382 -0
- data/ext/ruby/qtruby/examples/widgets/calculator/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/charactermap/characterwidget.rb +110 -0
- data/ext/ruby/qtruby/examples/widgets/charactermap/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/charactermap/mainwindow.rb +118 -0
- data/ext/ruby/qtruby/examples/widgets/digitalclock/digitalclock.rb +30 -0
- data/ext/ruby/qtruby/examples/widgets/digitalclock/main.rb +9 -0
- data/ext/ruby/qtruby/examples/widgets/groupbox/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/groupbox/window.rb +134 -0
- data/ext/ruby/qtruby/examples/widgets/icons/iconpreviewarea.rb +111 -0
- data/ext/ruby/qtruby/examples/widgets/icons/iconsizespinbox.rb +39 -0
- data/ext/ruby/qtruby/examples/widgets/icons/imagedelegate.rb +73 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/designer.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/find_disabled.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/find_normal.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_128x128.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_16x16.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_32x32.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_64x64.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_128x128.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_16x16.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_32x32.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_64x64.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_16x16.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_32x32.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_48x48.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/icons/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/icons/mainwindow.rb +351 -0
- data/ext/ruby/qtruby/examples/widgets/imageviewer/imageviewer.rb +219 -0
- data/ext/ruby/qtruby/examples/widgets/imageviewer/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/lineedits/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/lineedits/window.rb +199 -0
- data/ext/ruby/qtruby/examples/widgets/movie/images/open.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/movie/images/pause.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/movie/images/play.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/movie/images/quit.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/movie/images/stop.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/movie/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/movie/movieplayer.rb +201 -0
- data/ext/ruby/qtruby/examples/widgets/movie/movies/fire.mng +0 -0
- data/ext/ruby/qtruby/examples/widgets/screenshot/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/screenshot/screenshot.rb +155 -0
- data/ext/ruby/qtruby/examples/widgets/scribble/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/scribble/mainwindow.rb +202 -0
- data/ext/ruby/qtruby/examples/widgets/scribble/scribblearea.rb +154 -0
- data/ext/ruby/qtruby/examples/widgets/sliders/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb +97 -0
- data/ext/ruby/qtruby/examples/widgets/sliders/window.rb +124 -0
- data/ext/ruby/qtruby/examples/widgets/spinboxes/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/spinboxes/window.rb +213 -0
- data/ext/ruby/qtruby/examples/widgets/tetrix/main.rb +33 -0
- data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixboard.rb +346 -0
- data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixpiece.rb +135 -0
- data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixwindow.rb +88 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/images/circle.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/images/square.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/images/triangle.png +0 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/shapeitem.rb +31 -0
- data/ext/ruby/qtruby/examples/widgets/tooltips/sortingbox.rb +222 -0
- data/ext/ruby/qtruby/examples/widgets/wiggly/dialog.rb +48 -0
- data/ext/ruby/qtruby/examples/widgets/wiggly/main.rb +9 -0
- data/ext/ruby/qtruby/examples/widgets/wiggly/wigglywidget.rb +76 -0
- data/ext/ruby/qtruby/examples/widgets/windowflags/controllerwindow.rb +195 -0
- data/ext/ruby/qtruby/examples/widgets/windowflags/main.rb +32 -0
- data/ext/ruby/qtruby/examples/widgets/windowflags/previewwindow.rb +103 -0
- data/ext/ruby/qtruby/examples/xml/dombookmarks/frank.xbel +230 -0
- data/ext/ruby/qtruby/examples/xml/dombookmarks/jennifer.xbel +93 -0
- data/ext/ruby/qtruby/examples/xml/dombookmarks/main.rb +34 -0
- data/ext/ruby/qtruby/examples/xml/dombookmarks/mainwindow.rb +129 -0
- data/ext/ruby/qtruby/examples/xml/dombookmarks/xbeltree.rb +172 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/frank.xbel +230 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/jennifer.xbel +93 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/main.rb +34 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/mainwindow.rb +144 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/xbelgenerator.rb +95 -0
- data/ext/ruby/qtruby/examples/xml/saxbookmarks/xbelhandler.rb +122 -0
- data/ext/ruby/qtruby/rails_support/CMakeLists.txt +1 -0
- data/ext/ruby/qtruby/rails_support/active_item_model.rb +234 -0
- data/ext/ruby/qtruby/rails_support/active_table_model.rb +122 -0
- data/ext/ruby/qtruby/src/CMakeLists.txt +103 -0
- data/ext/ruby/qtruby/src/Qt.cpp +1279 -0
- data/ext/ruby/qtruby/src/extconf.rb +11 -0
- data/ext/ruby/qtruby/src/handlers.cpp +2622 -0
- data/ext/ruby/qtruby/src/lib/CMakeLists.txt +16 -0
- data/ext/ruby/qtruby/src/lib/Qt.rb +1 -0
- data/ext/ruby/qtruby/src/lib/Qt/CMakeLists.txt +9 -0
- data/ext/ruby/qtruby/src/lib/Qt/qtruby4.rb +3177 -0
- data/ext/ruby/qtruby/src/lib/Qt3.rb +6 -0
- data/ext/ruby/qtruby/src/lib/Qt4.rb +6 -0
- data/ext/ruby/qtruby/src/marshall.h +66 -0
- data/ext/ruby/qtruby/src/marshall_basetypes.h +208 -0
- data/ext/ruby/qtruby/src/marshall_complex.h +175 -0
- data/ext/ruby/qtruby/src/marshall_macros.h +647 -0
- data/ext/ruby/qtruby/src/marshall_primitives.h +290 -0
- data/ext/ruby/qtruby/src/marshall_types.cpp +815 -0
- data/ext/ruby/qtruby/src/marshall_types.h +240 -0
- data/ext/ruby/qtruby/src/qtruby.cpp +2483 -0
- data/ext/ruby/qtruby/src/qtruby.h +185 -0
- data/ext/ruby/qtruby/src/smokeruby.h +164 -0
- data/ext/ruby/qtruby/test/opoverloading.rb +46 -0
- data/ext/ruby/qtruby/test/unittests.rb +151 -0
- data/ext/ruby/qtruby/tools/CMakeLists.txt +2 -0
- data/ext/ruby/qtruby/tools/rbrcc/CMakeLists.txt +6 -0
- data/ext/ruby/qtruby/tools/rbrcc/Messages.sh +7 -0
- data/ext/ruby/qtruby/tools/rbrcc/main.cpp +173 -0
- data/ext/ruby/qtruby/tools/rbrcc/rbrcc.pro +14 -0
- data/ext/ruby/qtruby/tools/rbrcc/rcc.cpp +648 -0
- data/ext/ruby/qtruby/tools/rbrcc/rcc.h +165 -0
- data/ext/ruby/qtruby/tools/rbuic/CMakeLists.txt +35 -0
- data/ext/ruby/qtruby/tools/rbuic/LICENSE.GPL +280 -0
- data/ext/ruby/qtruby/tools/rbuic/Messages.sh +7 -0
- data/ext/ruby/qtruby/tools/rbuic/TODO +4 -0
- data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.cpp +106 -0
- data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.h +95 -0
- data/ext/ruby/qtruby/tools/rbuic/databaseinfo.cpp +102 -0
- data/ext/ruby/qtruby/tools/rbuic/databaseinfo.h +85 -0
- data/ext/ruby/qtruby/tools/rbuic/driver.cpp +384 -0
- data/ext/ruby/qtruby/tools/rbuic/driver.h +141 -0
- data/ext/ruby/qtruby/tools/rbuic/globaldefs.h +60 -0
- data/ext/ruby/qtruby/tools/rbuic/main.cpp +201 -0
- data/ext/ruby/qtruby/tools/rbuic/option.h +107 -0
- data/ext/ruby/qtruby/tools/rbuic/rbuic.pri +23 -0
- data/ext/ruby/qtruby/tools/rbuic/rbuic4.pro +43 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.cpp +150 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.h +83 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.cpp +217 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.h +85 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.cpp +185 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.h +86 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.cpp +88 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.h +83 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.cpp +126 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.h +87 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp +2478 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.h +314 -0
- data/ext/ruby/qtruby/tools/rbuic/ruby/ruby.pri +18 -0
- data/ext/ruby/qtruby/tools/rbuic/treewalker.cpp +318 -0
- data/ext/ruby/qtruby/tools/rbuic/treewalker.h +139 -0
- data/ext/ruby/qtruby/tools/rbuic/ui4.cpp +7623 -0
- data/ext/ruby/qtruby/tools/rbuic/ui4.h +3180 -0
- data/ext/ruby/qtruby/tools/rbuic/uic.cpp +438 -0
- data/ext/ruby/qtruby/tools/rbuic/uic.h +154 -0
- data/ext/ruby/qtruby/tools/rbuic/utils.h +125 -0
- data/ext/ruby/qtruby/tools/rbuic/validator.cpp +100 -0
- data/ext/ruby/qtruby/tools/rbuic/validator.h +80 -0
- data/ext/ruby/qtscript/CMakeLists.txt +19 -0
- data/ext/ruby/qtscript/qtscript.cpp +82 -0
- data/ext/ruby/qtscript/qtscript.rb +40 -0
- data/ext/ruby/qtscript/qtscripthandlers.cpp +36 -0
- data/ext/ruby/qtscript/smokedata.cpp +1403 -0
- data/ext/ruby/qttest/CMakeLists.txt +18 -0
- data/ext/ruby/qttest/ChangeLog +9 -0
- data/ext/ruby/qttest/examples/myfirsttest.rb +30 -0
- data/ext/ruby/qttest/qttest.cpp +82 -0
- data/ext/ruby/qttest/qttest.rb +166 -0
- data/ext/ruby/qttest/qttesthandlers.cpp +35 -0
- data/ext/ruby/qtuitools/CMakeLists.txt +16 -0
- data/ext/ruby/qtuitools/qtuitools.cpp +82 -0
- data/ext/ruby/qtuitools/qtuitools.rb +17 -0
- data/ext/ruby/qtuitools/qtuitoolshandlers.cpp +31 -0
- data/ext/ruby/qtwebkit/CMakeLists.txt +17 -0
- data/ext/ruby/qtwebkit/qtwebkit.cpp +66 -0
- data/ext/ruby/qtwebkit/qtwebkit.rb +17 -0
- data/ext/ruby/qtwebkit/qtwebkithandlers.cpp +39 -0
- data/ext/smoke/CMakeLists.txt +35 -0
- data/ext/smoke/deptool/CMakeLists.txt +7 -0
- data/ext/smoke/deptool/main.cpp +128 -0
- data/ext/smoke/qt_smoke.h +16 -0
- data/ext/smoke/qtcore/CMakeLists.txt +88 -0
- data/ext/smoke/qtcore/QtGuess.txt +181 -0
- data/ext/smoke/qtcore/config.xml.cmake +10 -0
- data/ext/smoke/qtcore/qt-config.xml.cmake +21 -0
- data/ext/smoke/qtcore/qtcore_includes.h +1 -0
- data/ext/smoke/qtcore/smokeconfig.xml +189 -0
- data/ext/smoke/qtcore/tests/CMakeLists.txt +13 -0
- data/ext/smoke/qtcore/tests/test.cpp +846 -0
- data/ext/smoke/qtcore_smoke.h +16 -0
- data/ext/smoke/qtdbus/CMakeLists.txt +38 -0
- data/ext/smoke/qtdbus/config.xml.cmake +11 -0
- data/ext/smoke/qtdbus/qtdbus_includes.h +2 -0
- data/ext/smoke/qtdbus/smokeconfig.xml +63 -0
- data/ext/smoke/qtdbus_smoke.h +16 -0
- data/ext/smoke/qtgui/CMakeLists.txt +76 -0
- data/ext/smoke/qtgui/config.xml.cmake +11 -0
- data/ext/smoke/qtgui/qtgui_includes.h +7 -0
- data/ext/smoke/qtgui/smokeconfig.xml +490 -0
- data/ext/smoke/qtgui_smoke.h +16 -0
- data/ext/smoke/qtmultimedia/CMakeLists.txt +42 -0
- data/ext/smoke/qtmultimedia/config.xml.cmake +12 -0
- data/ext/smoke/qtmultimedia/qtmultimedia_includes.h +3 -0
- data/ext/smoke/qtmultimedia/smokeconfig.xml +50 -0
- data/ext/smoke/qtmultimedia_smoke.h +16 -0
- data/ext/smoke/qtnetwork/CMakeLists.txt +38 -0
- data/ext/smoke/qtnetwork/config.xml.cmake +11 -0
- data/ext/smoke/qtnetwork/qtnetwork_includes.h +2 -0
- data/ext/smoke/qtnetwork/smokeconfig.xml +76 -0
- data/ext/smoke/qtnetwork_smoke.h +16 -0
- data/ext/smoke/qtopengl/CMakeLists.txt +43 -0
- data/ext/smoke/qtopengl/config.xml.cmake +12 -0
- data/ext/smoke/qtopengl/qtopengl_includes.h +3 -0
- data/ext/smoke/qtopengl/smokeconfig.xml +56 -0
- data/ext/smoke/qtopengl_smoke.h +16 -0
- data/ext/smoke/qtscript/CMakeLists.txt +31 -0
- data/ext/smoke/qtscript/config.xml.cmake +11 -0
- data/ext/smoke/qtscript/qtscript_includes.h +14 -0
- data/ext/smoke/qtscript/smokeconfig.xml +39 -0
- data/ext/smoke/qtscript_smoke.h +16 -0
- data/ext/smoke/qtsql/CMakeLists.txt +41 -0
- data/ext/smoke/qtsql/config.xml.cmake +11 -0
- data/ext/smoke/qtsql/qtsql_includes.h +2 -0
- data/ext/smoke/qtsql/smokeconfig.xml +56 -0
- data/ext/smoke/qtsql_smoke.h +16 -0
- data/ext/smoke/qtsvg/CMakeLists.txt +43 -0
- data/ext/smoke/qtsvg/config.xml.cmake +12 -0
- data/ext/smoke/qtsvg/qtsvg_includes.h +3 -0
- data/ext/smoke/qtsvg/smokeconfig.xml +45 -0
- data/ext/smoke/qtsvg_smoke.h +16 -0
- data/ext/smoke/qttest/CMakeLists.txt +35 -0
- data/ext/smoke/qttest/config.xml.cmake +12 -0
- data/ext/smoke/qttest/qttest_includes.h +14 -0
- data/ext/smoke/qttest/smokeconfig.xml +36 -0
- data/ext/smoke/qttest_smoke.h +16 -0
- data/ext/smoke/qtuitools/CMakeLists.txt +30 -0
- data/ext/smoke/qtuitools/config.xml.cmake +12 -0
- data/ext/smoke/qtuitools/qtuitools_includes.h +1 -0
- data/ext/smoke/qtuitools/smokeconfig.xml +20 -0
- data/ext/smoke/qtuitools_smoke.h +16 -0
- data/ext/smoke/qtwebkit/CMakeLists.txt +36 -0
- data/ext/smoke/qtwebkit/config.xml.cmake +11 -0
- data/ext/smoke/qtwebkit/qtwebkit_includes.h +1 -0
- data/ext/smoke/qtwebkit/smokeconfig.xml +45 -0
- data/ext/smoke/qtwebkit_smoke.h +16 -0
- data/ext/smoke/qtxml/CMakeLists.txt +41 -0
- data/ext/smoke/qtxml/config.xml.cmake +11 -0
- data/ext/smoke/qtxml/qtxml_includes.h +2 -0
- data/ext/smoke/qtxml/smokeconfig.xml +70 -0
- data/ext/smoke/qtxml_smoke.h +16 -0
- data/ext/smoke/qtxmlpatterns/CMakeLists.txt +42 -0
- data/ext/smoke/qtxmlpatterns/config.xml.cmake +12 -0
- data/ext/smoke/qtxmlpatterns/qtxmlpatterns_includes.h +3 -0
- data/ext/smoke/qtxmlpatterns/smokeconfig.xml +80 -0
- data/ext/smoke/qtxmlpatterns_smoke.h +16 -0
- data/ext/smoke/smoke.h +557 -0
- data/ext/smoke/smokeapi/CMakeLists.txt +9 -0
- data/ext/smoke/smokeapi/main.cpp +309 -0
- data/ext/smoke/smokebase/CMakeLists.txt +11 -0
- data/ext/smoke/smokebase/smokebase.cpp +6 -0
- data/ext/smoke/solid_smoke.h +16 -0
- data/extconf.rb +231 -0
- data/lib/1.8/libqtruby4shared.dll +0 -0
- data/lib/1.8/libsmokebase.dll +0 -0
- data/lib/1.8/libsmokeqtcore.dll +0 -0
- data/lib/1.8/libsmokeqtgui.dll +0 -0
- data/lib/1.8/libsmokeqtmultimedia.dll +0 -0
- data/lib/1.8/libsmokeqtnetwork.dll +0 -0
- data/lib/1.8/libsmokeqtopengl.dll +0 -0
- data/lib/1.8/libsmokeqtscript.dll +0 -0
- data/lib/1.8/libsmokeqtsql.dll +0 -0
- data/lib/1.8/libsmokeqtsvg.dll +0 -0
- data/lib/1.8/libsmokeqttest.dll +0 -0
- data/lib/1.8/libsmokeqtuitools.dll +0 -0
- data/lib/1.8/libsmokeqtwebkit.dll +0 -0
- data/lib/1.8/libsmokeqtxml.dll +0 -0
- data/lib/1.8/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/1.8/qtruby4.so +0 -0
- data/lib/1.8/qtscript.so +0 -0
- data/lib/1.8/qttest.so +0 -0
- data/lib/1.8/qtuitools.so +0 -0
- data/lib/1.8/qtwebkit.so +0 -0
- data/lib/1.9/libqtruby4shared.dll +0 -0
- data/lib/1.9/libsmokebase.dll +0 -0
- data/lib/1.9/libsmokeqtcore.dll +0 -0
- data/lib/1.9/libsmokeqtgui.dll +0 -0
- data/lib/1.9/libsmokeqtmultimedia.dll +0 -0
- data/lib/1.9/libsmokeqtnetwork.dll +0 -0
- data/lib/1.9/libsmokeqtopengl.dll +0 -0
- data/lib/1.9/libsmokeqtscript.dll +0 -0
- data/lib/1.9/libsmokeqtsql.dll +0 -0
- data/lib/1.9/libsmokeqtsvg.dll +0 -0
- data/lib/1.9/libsmokeqttest.dll +0 -0
- data/lib/1.9/libsmokeqtuitools.dll +0 -0
- data/lib/1.9/libsmokeqtwebkit.dll +0 -0
- data/lib/1.9/libsmokeqtxml.dll +0 -0
- data/lib/1.9/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/1.9/qtruby4.so +0 -0
- data/lib/1.9/qtscript.so +0 -0
- data/lib/1.9/qttest.so +0 -0
- data/lib/1.9/qtuitools.so +0 -0
- data/lib/1.9/qtwebkit.so +0 -0
- data/lib/Qt.rb +1 -0
- data/lib/Qt/qtruby4.rb +3177 -0
- data/lib/Qt4.rb +20 -0
- data/lib/qtbindings_version.rb +2 -0
- data/lib/qtscript/qtscript.rb +40 -0
- data/lib/qttest/qttest.rb +166 -0
- data/lib/qtuitools/qtuitools.rb +17 -0
- data/lib/qtwebkit/qtwebkit.rb +17 -0
- data/qtbindings.gemspec +18 -0
- data/qtbindingsnative.gemspec +18 -0
- metadata +1297 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
marshall_types.h - Derived from the PerlQt sources, see AUTHORS
|
3
|
+
for details
|
4
|
+
-------------------
|
5
|
+
begin : Fri Jul 4 2003
|
6
|
+
copyright : (C) 2003-2006 by Richard Dale
|
7
|
+
email : Richard_Dale@tipitina.demon.co.uk
|
8
|
+
***************************************************************************/
|
9
|
+
|
10
|
+
/***************************************************************************
|
11
|
+
* *
|
12
|
+
* This program is free software; you can redistribute it and/or modify *
|
13
|
+
* it under the terms of the GNU Lesser General Public License as *
|
14
|
+
* published by the Free Software Foundation; either version 2 of the *
|
15
|
+
* License, or (at your option) any later version. *
|
16
|
+
* *
|
17
|
+
***************************************************************************/
|
18
|
+
|
19
|
+
#ifndef MARSHALL_TYPES_H
|
20
|
+
#define MARSHALL_TYPES_H
|
21
|
+
|
22
|
+
#include <QtCore/qstring.h>
|
23
|
+
#include <QtCore/qobject.h>
|
24
|
+
#include <QtCore/qmetaobject.h>
|
25
|
+
|
26
|
+
#include <smoke/smoke.h>
|
27
|
+
|
28
|
+
#include "marshall.h"
|
29
|
+
#include "qtruby.h"
|
30
|
+
#include "smokeruby.h"
|
31
|
+
|
32
|
+
Marshall::HandlerFn getMarshallFn(const SmokeType &type);
|
33
|
+
|
34
|
+
extern void smokeStackToQtStack(Smoke::Stack stack, void ** o, int start, int end, QList<MocArgument*> args);
|
35
|
+
extern void smokeStackFromQtStack(Smoke::Stack stack, void ** _o, int start, int end, QList<MocArgument*> args);
|
36
|
+
|
37
|
+
namespace QtRuby {
|
38
|
+
|
39
|
+
class Q_DECL_EXPORT MethodReturnValueBase : public Marshall
|
40
|
+
{
|
41
|
+
public:
|
42
|
+
MethodReturnValueBase(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack);
|
43
|
+
const Smoke::Method &method();
|
44
|
+
Smoke::StackItem &item();
|
45
|
+
Smoke *smoke();
|
46
|
+
SmokeType type();
|
47
|
+
void next();
|
48
|
+
bool cleanup();
|
49
|
+
void unsupported();
|
50
|
+
VALUE * var();
|
51
|
+
protected:
|
52
|
+
Smoke *_smoke;
|
53
|
+
Smoke::Index _method;
|
54
|
+
Smoke::Stack _stack;
|
55
|
+
SmokeType _st;
|
56
|
+
VALUE *_retval;
|
57
|
+
virtual const char *classname();
|
58
|
+
};
|
59
|
+
|
60
|
+
|
61
|
+
class Q_DECL_EXPORT VirtualMethodReturnValue : public MethodReturnValueBase {
|
62
|
+
public:
|
63
|
+
VirtualMethodReturnValue(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE retval);
|
64
|
+
Marshall::Action action();
|
65
|
+
|
66
|
+
private:
|
67
|
+
VALUE _retval2;
|
68
|
+
};
|
69
|
+
|
70
|
+
|
71
|
+
class Q_DECL_EXPORT MethodReturnValue : public MethodReturnValueBase {
|
72
|
+
public:
|
73
|
+
MethodReturnValue(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE * retval);
|
74
|
+
Marshall::Action action();
|
75
|
+
|
76
|
+
private:
|
77
|
+
const char *classname();
|
78
|
+
};
|
79
|
+
|
80
|
+
class Q_DECL_EXPORT MethodCallBase : public Marshall
|
81
|
+
{
|
82
|
+
public:
|
83
|
+
MethodCallBase(Smoke *smoke, Smoke::Index meth);
|
84
|
+
MethodCallBase(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack);
|
85
|
+
Smoke *smoke();
|
86
|
+
SmokeType type();
|
87
|
+
Smoke::StackItem &item();
|
88
|
+
const Smoke::Method &method();
|
89
|
+
virtual int items() = 0;
|
90
|
+
virtual void callMethod() = 0;
|
91
|
+
void next();
|
92
|
+
void unsupported();
|
93
|
+
|
94
|
+
protected:
|
95
|
+
Smoke *_smoke;
|
96
|
+
Smoke::Index _method;
|
97
|
+
Smoke::Stack _stack;
|
98
|
+
int _cur;
|
99
|
+
Smoke::Index *_args;
|
100
|
+
bool _called;
|
101
|
+
VALUE *_sp;
|
102
|
+
virtual const char* classname();
|
103
|
+
};
|
104
|
+
|
105
|
+
|
106
|
+
class Q_DECL_EXPORT VirtualMethodCall : public MethodCallBase {
|
107
|
+
public:
|
108
|
+
VirtualMethodCall(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE obj, VALUE *sp);
|
109
|
+
~VirtualMethodCall();
|
110
|
+
Marshall::Action action();
|
111
|
+
VALUE * var();
|
112
|
+
int items();
|
113
|
+
void callMethod();
|
114
|
+
bool cleanup();
|
115
|
+
|
116
|
+
private:
|
117
|
+
VALUE _obj;
|
118
|
+
};
|
119
|
+
|
120
|
+
|
121
|
+
class Q_DECL_EXPORT MethodCall : public MethodCallBase {
|
122
|
+
public:
|
123
|
+
MethodCall(Smoke *smoke, Smoke::Index method, VALUE target, VALUE *sp, int items);
|
124
|
+
~MethodCall();
|
125
|
+
Marshall::Action action();
|
126
|
+
VALUE * var();
|
127
|
+
|
128
|
+
inline void callMethod() {
|
129
|
+
if(_called) return;
|
130
|
+
_called = true;
|
131
|
+
|
132
|
+
if (_target == Qnil && !(method().flags & Smoke::mf_static)) {
|
133
|
+
rb_raise(rb_eArgError, "%s is not a class method\n", _smoke->methodNames[method().name]);
|
134
|
+
}
|
135
|
+
|
136
|
+
Smoke::ClassFn fn = _smoke->classes[method().classId].classFn;
|
137
|
+
void * ptr = 0;
|
138
|
+
|
139
|
+
if (_o != 0) {
|
140
|
+
const Smoke::Class &cl = _smoke->classes[method().classId];
|
141
|
+
|
142
|
+
ptr = _o->smoke->cast( _o->ptr,
|
143
|
+
_o->classId,
|
144
|
+
_o->smoke->idClass(cl.className, true).index );
|
145
|
+
}
|
146
|
+
|
147
|
+
_items = -1;
|
148
|
+
(*fn)(method().method, ptr, _stack);
|
149
|
+
if (method().flags & Smoke::mf_ctor) {
|
150
|
+
Smoke::StackItem s[2];
|
151
|
+
s[1].s_voidp = qtruby_modules[_smoke].binding;
|
152
|
+
(*fn)(0, _stack[0].s_voidp, s);
|
153
|
+
}
|
154
|
+
MethodReturnValue r(_smoke, _method, _stack, &_retval);
|
155
|
+
}
|
156
|
+
|
157
|
+
int items();
|
158
|
+
bool cleanup();
|
159
|
+
private:
|
160
|
+
VALUE _target;
|
161
|
+
smokeruby_object * _o;
|
162
|
+
VALUE *_sp;
|
163
|
+
int _items;
|
164
|
+
VALUE _retval;
|
165
|
+
const char *classname();
|
166
|
+
};
|
167
|
+
|
168
|
+
|
169
|
+
class Q_DECL_EXPORT SigSlotBase : public Marshall {
|
170
|
+
public:
|
171
|
+
SigSlotBase(QList<MocArgument*> args);
|
172
|
+
~SigSlotBase();
|
173
|
+
const MocArgument &arg();
|
174
|
+
SmokeType type();
|
175
|
+
Smoke::StackItem &item();
|
176
|
+
VALUE * var();
|
177
|
+
Smoke *smoke();
|
178
|
+
virtual const char *mytype() = 0;
|
179
|
+
virtual void mainfunction() = 0;
|
180
|
+
void unsupported();
|
181
|
+
void next();
|
182
|
+
void prepareReturnValue(void** o);
|
183
|
+
|
184
|
+
protected:
|
185
|
+
QList<MocArgument*> _args;
|
186
|
+
int _cur;
|
187
|
+
bool _called;
|
188
|
+
Smoke::Stack _stack;
|
189
|
+
int _items;
|
190
|
+
VALUE *_sp;
|
191
|
+
};
|
192
|
+
|
193
|
+
|
194
|
+
class Q_DECL_EXPORT EmitSignal : public SigSlotBase {
|
195
|
+
QObject *_obj;
|
196
|
+
int _id;
|
197
|
+
VALUE * _result;
|
198
|
+
public:
|
199
|
+
EmitSignal(QObject *obj, int id, int items, QList<MocArgument*> args, VALUE * sp, VALUE * result);
|
200
|
+
Marshall::Action action();
|
201
|
+
Smoke::StackItem &item();
|
202
|
+
const char *mytype();
|
203
|
+
void emitSignal();
|
204
|
+
void mainfunction();
|
205
|
+
bool cleanup();
|
206
|
+
|
207
|
+
};
|
208
|
+
|
209
|
+
class Q_DECL_EXPORT InvokeNativeSlot : public SigSlotBase {
|
210
|
+
QObject *_obj;
|
211
|
+
int _id;
|
212
|
+
VALUE * _result;
|
213
|
+
public:
|
214
|
+
InvokeNativeSlot(QObject *obj, int id, int items, QList<MocArgument*> args, VALUE * sp, VALUE * result);
|
215
|
+
Marshall::Action action();
|
216
|
+
Smoke::StackItem &item();
|
217
|
+
const char *mytype();
|
218
|
+
void invokeSlot();
|
219
|
+
void mainfunction();
|
220
|
+
bool cleanup();
|
221
|
+
};
|
222
|
+
|
223
|
+
class Q_DECL_EXPORT InvokeSlot : public SigSlotBase {
|
224
|
+
VALUE _obj;
|
225
|
+
ID _slotname;
|
226
|
+
void **_o;
|
227
|
+
public:
|
228
|
+
InvokeSlot(VALUE obj, ID slotname, QList<MocArgument*> args, void ** o);
|
229
|
+
~InvokeSlot();
|
230
|
+
Marshall::Action action();
|
231
|
+
const char *mytype();
|
232
|
+
bool cleanup();
|
233
|
+
void copyArguments();
|
234
|
+
void invokeSlot();
|
235
|
+
void mainfunction();
|
236
|
+
};
|
237
|
+
|
238
|
+
}
|
239
|
+
|
240
|
+
#endif
|
@@ -0,0 +1,2483 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
qtruby.cpp - description
|
3
|
+
-------------------
|
4
|
+
begin : Fri Jul 4 2003
|
5
|
+
copyright : (C) 2003-2006 by Richard Dale
|
6
|
+
email : Richard_Dale@tipitina.demon.co.uk
|
7
|
+
***************************************************************************/
|
8
|
+
|
9
|
+
/***************************************************************************
|
10
|
+
* *
|
11
|
+
* This program is free software; you can redistribute it and/or modify *
|
12
|
+
* it under the terms of the GNU Lesser General Public License as *
|
13
|
+
* published by the Free Software Foundation; either version 2 of the *
|
14
|
+
* License, or (at your option) any later version. *
|
15
|
+
* *
|
16
|
+
***************************************************************************/
|
17
|
+
|
18
|
+
#include <QtCore/qabstractitemmodel.h>
|
19
|
+
#include <QtCore/qglobal.h>
|
20
|
+
#include <QtCore/qhash.h>
|
21
|
+
#include <QtCore/qline.h>
|
22
|
+
#include <QtCore/qmetaobject.h>
|
23
|
+
#include <QtCore/qobject.h>
|
24
|
+
#include <QtCore/qrect.h>
|
25
|
+
#include <QtCore/qregexp.h>
|
26
|
+
#include <QtCore/qstring.h>
|
27
|
+
#include <QtCore/qvariant.h>
|
28
|
+
#include <QtGui/qapplication.h>
|
29
|
+
#include <QtGui/qbitmap.h>
|
30
|
+
#include <QtGui/qcolor.h>
|
31
|
+
#include <QtGui/qcursor.h>
|
32
|
+
#include <QtGui/qfont.h>
|
33
|
+
#include <QtGui/qicon.h>
|
34
|
+
#include <QtGui/qitemselectionmodel.h>
|
35
|
+
#include <QtGui/qpalette.h>
|
36
|
+
#include <QtGui/qpen.h>
|
37
|
+
#include <QtGui/qpixmap.h>
|
38
|
+
#include <QtGui/qpolygon.h>
|
39
|
+
#include <QtGui/qtextformat.h>
|
40
|
+
#include <QtGui/qwidget.h>
|
41
|
+
|
42
|
+
#ifdef QT_QTDBUS
|
43
|
+
#include <QtDBus/qdbusargument.h>
|
44
|
+
#endif
|
45
|
+
|
46
|
+
#include <smoke/smoke.h>
|
47
|
+
|
48
|
+
#include <smoke/qtcore_smoke.h>
|
49
|
+
#include <smoke/qtgui_smoke.h>
|
50
|
+
#include <smoke/qtxml_smoke.h>
|
51
|
+
#include <smoke/qtsql_smoke.h>
|
52
|
+
#include <smoke/qtopengl_smoke.h>
|
53
|
+
#include <smoke/qtnetwork_smoke.h>
|
54
|
+
#include <smoke/qtsvg_smoke.h>
|
55
|
+
|
56
|
+
#ifdef QT_QTDBUS
|
57
|
+
#include <smoke/qtdbus_smoke.h>
|
58
|
+
#endif
|
59
|
+
|
60
|
+
#include <ruby.h>
|
61
|
+
#undef read
|
62
|
+
#undef write
|
63
|
+
#undef connect
|
64
|
+
#undef accept
|
65
|
+
|
66
|
+
#include "marshall_types.h"
|
67
|
+
#include "qtruby.h"
|
68
|
+
|
69
|
+
extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
70
|
+
extern bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
71
|
+
|
72
|
+
extern TypeHandler Qt_handlers[];
|
73
|
+
extern const char * resolve_classname_qt(smokeruby_object * o);
|
74
|
+
|
75
|
+
extern "C" {
|
76
|
+
|
77
|
+
static VALUE
|
78
|
+
qdebug(VALUE klass, VALUE msg)
|
79
|
+
{
|
80
|
+
qDebug("%s", StringValuePtr(msg));
|
81
|
+
return klass;
|
82
|
+
}
|
83
|
+
|
84
|
+
static VALUE
|
85
|
+
qfatal(VALUE klass, VALUE msg)
|
86
|
+
{
|
87
|
+
qFatal("%s", StringValuePtr(msg));
|
88
|
+
return klass;
|
89
|
+
}
|
90
|
+
|
91
|
+
static VALUE
|
92
|
+
qwarning(VALUE klass, VALUE msg)
|
93
|
+
{
|
94
|
+
qWarning("%s", StringValuePtr(msg));
|
95
|
+
return klass;
|
96
|
+
}
|
97
|
+
|
98
|
+
//---------- Ruby methods (for all functions except fully qualified statics & enums) ---------
|
99
|
+
|
100
|
+
|
101
|
+
// Takes a variable name and a QProperty with QVariant value, and returns a '
|
102
|
+
// variable=value' pair with the value in ruby inspect style
|
103
|
+
static QString
|
104
|
+
inspectProperty(QMetaProperty property, const char * name, QVariant & value)
|
105
|
+
{
|
106
|
+
if (property.isEnumType()) {
|
107
|
+
QMetaEnum e = property.enumerator();
|
108
|
+
return QString(" %1=%2::%3").arg(name).arg(e.scope()).arg(e.valueToKey(value.toInt()));
|
109
|
+
}
|
110
|
+
|
111
|
+
switch (value.type()) {
|
112
|
+
case QVariant::String:
|
113
|
+
{
|
114
|
+
if (value.toString().isNull()) {
|
115
|
+
return QString(" %1=nil").arg(name);
|
116
|
+
} else {
|
117
|
+
return QString(" %1=%2").arg(name).arg(value.toString());
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
case QVariant::Bool:
|
122
|
+
{
|
123
|
+
QString rubyName;
|
124
|
+
QRegExp name_re("^(is|has)(.)(.*)");
|
125
|
+
|
126
|
+
if (name_re.indexIn(name) != -1) {
|
127
|
+
rubyName = name_re.cap(2).toLower() + name_re.cap(3) + "?";
|
128
|
+
} else {
|
129
|
+
rubyName = name;
|
130
|
+
}
|
131
|
+
|
132
|
+
return QString(" %1=%2").arg(rubyName).arg(value.toString());
|
133
|
+
}
|
134
|
+
|
135
|
+
case QVariant::Color:
|
136
|
+
{
|
137
|
+
QColor c = value.value<QColor>();
|
138
|
+
return QString(" %1=#<Qt::Color:0x0 %2>").arg(name).arg(c.name());
|
139
|
+
}
|
140
|
+
|
141
|
+
case QVariant::Cursor:
|
142
|
+
{
|
143
|
+
QCursor c = value.value<QCursor>();
|
144
|
+
return QString(" %1=#<Qt::Cursor:0x0 shape=%2>").arg(name).arg(c.shape());
|
145
|
+
}
|
146
|
+
|
147
|
+
case QVariant::Double:
|
148
|
+
{
|
149
|
+
return QString(" %1=%2").arg(name).arg(value.toDouble());
|
150
|
+
}
|
151
|
+
|
152
|
+
case QVariant::Font:
|
153
|
+
{
|
154
|
+
QFont f = value.value<QFont>();
|
155
|
+
return QString( " %1=#<Qt::Font:0x0 family=%2, pointSize=%3, weight=%4, italic=%5, bold=%6, underline=%7, strikeOut=%8>")
|
156
|
+
.arg(name)
|
157
|
+
.arg(f.family())
|
158
|
+
.arg(f.pointSize())
|
159
|
+
.arg(f.weight())
|
160
|
+
.arg(f.italic() ? "true" : "false")
|
161
|
+
.arg(f.bold() ? "true" : "false")
|
162
|
+
.arg(f.underline() ? "true" : "false")
|
163
|
+
.arg(f.strikeOut() ? "true" : "false");
|
164
|
+
}
|
165
|
+
|
166
|
+
case QVariant::Line:
|
167
|
+
{
|
168
|
+
QLine l = value.toLine();
|
169
|
+
return QString(" %1=#<Qt::Line:0x0 x1=%2, y1=%3, x2=%4, y2=%5>")
|
170
|
+
.arg(name)
|
171
|
+
.arg(l.x1())
|
172
|
+
.arg(l.y1())
|
173
|
+
.arg(l.x2())
|
174
|
+
.arg(l.y2());
|
175
|
+
}
|
176
|
+
|
177
|
+
case QVariant::LineF:
|
178
|
+
{
|
179
|
+
QLineF l = value.toLineF();
|
180
|
+
return QString(" %1=#<Qt::LineF:0x0 x1=%2, y1=%3, x2=%4, y2=%5>")
|
181
|
+
.arg(name)
|
182
|
+
.arg(l.x1())
|
183
|
+
.arg(l.y1())
|
184
|
+
.arg(l.x2())
|
185
|
+
.arg(l.y2());
|
186
|
+
}
|
187
|
+
|
188
|
+
case QVariant::Point:
|
189
|
+
{
|
190
|
+
QPoint p = value.toPoint();
|
191
|
+
return QString(" %1=#<Qt::Point:0x0 x=%2, y=%3>").arg(name).arg(p.x()).arg(p.y());
|
192
|
+
}
|
193
|
+
|
194
|
+
case QVariant::PointF:
|
195
|
+
{
|
196
|
+
QPointF p = value.toPointF();
|
197
|
+
return QString(" %1=#<Qt::PointF:0x0 x=%2, y=%3>").arg(name).arg(p.x()).arg(p.y());
|
198
|
+
}
|
199
|
+
|
200
|
+
case QVariant::Rect:
|
201
|
+
{
|
202
|
+
QRect r = value.toRect();
|
203
|
+
return QString(" %1=#<Qt::Rect:0x0 left=%2, right=%3, top=%4, bottom=%5>")
|
204
|
+
.arg(name)
|
205
|
+
.arg(r.left()).arg(r.right()).arg(r.top()).arg(r.bottom());
|
206
|
+
}
|
207
|
+
|
208
|
+
case QVariant::RectF:
|
209
|
+
{
|
210
|
+
QRectF r = value.toRectF();
|
211
|
+
return QString(" %1=#<Qt::RectF:0x0 left=%2, right=%3, top=%4, bottom=%5>")
|
212
|
+
.arg(name)
|
213
|
+
.arg(r.left()).arg(r.right()).arg(r.top()).arg(r.bottom());
|
214
|
+
}
|
215
|
+
|
216
|
+
case QVariant::Size:
|
217
|
+
{
|
218
|
+
QSize s = value.toSize();
|
219
|
+
return QString(" %1=#<Qt::Size:0x0 width=%2, height=%3>")
|
220
|
+
.arg(name)
|
221
|
+
.arg(s.width()).arg(s.height());
|
222
|
+
}
|
223
|
+
|
224
|
+
case QVariant::SizeF:
|
225
|
+
{
|
226
|
+
QSizeF s = value.toSizeF();
|
227
|
+
return QString(" %1=#<Qt::SizeF:0x0 width=%2, height=%3>")
|
228
|
+
.arg(name)
|
229
|
+
.arg(s.width()).arg(s.height());
|
230
|
+
}
|
231
|
+
|
232
|
+
case QVariant::SizePolicy:
|
233
|
+
{
|
234
|
+
QSizePolicy s = value.value<QSizePolicy>();
|
235
|
+
return QString(" %1=#<Qt::SizePolicy:0x0 horizontalPolicy=%2, verticalPolicy=%3>")
|
236
|
+
.arg(name)
|
237
|
+
.arg(s.horizontalPolicy())
|
238
|
+
.arg(s.verticalPolicy());
|
239
|
+
}
|
240
|
+
|
241
|
+
case QVariant::Brush:
|
242
|
+
// case QVariant::ColorGroup:
|
243
|
+
case QVariant::Image:
|
244
|
+
case QVariant::Palette:
|
245
|
+
case QVariant::Pixmap:
|
246
|
+
case QVariant::Region:
|
247
|
+
{
|
248
|
+
return QString(" %1=#<Qt::%2:0x0>").arg(name).arg(value.typeName() + 1);
|
249
|
+
}
|
250
|
+
|
251
|
+
default:
|
252
|
+
return QString(" %1=%2").arg(name)
|
253
|
+
.arg((value.isNull() || value.toString().isNull()) ? "nil" : value.toString() );
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
// Retrieves the properties for a QObject and returns them as 'name=value' pairs
|
258
|
+
// in a ruby inspect string. For example:
|
259
|
+
//
|
260
|
+
// #<Qt::HBoxLayout:0x30139030 name=unnamed, margin=0, spacing=0, resizeMode=3>
|
261
|
+
//
|
262
|
+
static VALUE
|
263
|
+
inspect_qobject(VALUE self)
|
264
|
+
{
|
265
|
+
if (TYPE(self) != T_DATA) {
|
266
|
+
return Qnil;
|
267
|
+
}
|
268
|
+
|
269
|
+
// Start with #<Qt::HBoxLayout:0x30139030> from the original inspect() call
|
270
|
+
// Drop the closing '>'
|
271
|
+
VALUE inspect_str = rb_call_super(0, 0);
|
272
|
+
rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
|
273
|
+
|
274
|
+
smokeruby_object * o = 0;
|
275
|
+
Data_Get_Struct(self, smokeruby_object, o);
|
276
|
+
QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
277
|
+
|
278
|
+
QString value_list;
|
279
|
+
value_list.append(QString(" objectName=\"%1\"").arg(qobject->objectName()));
|
280
|
+
|
281
|
+
if (qobject->isWidgetType()) {
|
282
|
+
QWidget * w = (QWidget *) qobject;
|
283
|
+
value_list.append(QString(", x=%1, y=%2, width=%3, height=%4")
|
284
|
+
.arg(w->x())
|
285
|
+
.arg(w->y())
|
286
|
+
.arg(w->width())
|
287
|
+
.arg(w->height()) );
|
288
|
+
}
|
289
|
+
|
290
|
+
value_list.append(">");
|
291
|
+
rb_str_cat2(inspect_str, value_list.toLatin1());
|
292
|
+
|
293
|
+
return inspect_str;
|
294
|
+
}
|
295
|
+
|
296
|
+
// Retrieves the properties for a QObject and pretty_prints them as 'name=value' pairs
|
297
|
+
// For example:
|
298
|
+
//
|
299
|
+
// #<Qt::HBoxLayout:0x30139030
|
300
|
+
// name=unnamed,
|
301
|
+
// margin=0,
|
302
|
+
// spacing=0,
|
303
|
+
// resizeMode=3>
|
304
|
+
//
|
305
|
+
static VALUE
|
306
|
+
pretty_print_qobject(VALUE self, VALUE pp)
|
307
|
+
{
|
308
|
+
if (TYPE(self) != T_DATA) {
|
309
|
+
return Qnil;
|
310
|
+
}
|
311
|
+
|
312
|
+
// Start with #<Qt::HBoxLayout:0x30139030>
|
313
|
+
// Drop the closing '>'
|
314
|
+
VALUE inspect_str = rb_funcall(self, rb_intern("to_s"), 0, 0);
|
315
|
+
rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
|
316
|
+
rb_funcall(pp, rb_intern("text"), 1, inspect_str);
|
317
|
+
rb_funcall(pp, rb_intern("breakable"), 0);
|
318
|
+
|
319
|
+
smokeruby_object * o = 0;
|
320
|
+
Data_Get_Struct(self, smokeruby_object, o);
|
321
|
+
QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
322
|
+
|
323
|
+
QString value_list;
|
324
|
+
|
325
|
+
if (qobject->parent() != 0) {
|
326
|
+
QString parentInspectString;
|
327
|
+
VALUE obj = getPointerObject(qobject->parent());
|
328
|
+
if (obj != Qnil) {
|
329
|
+
VALUE parent_inspect_str = rb_funcall(obj, rb_intern("to_s"), 0, 0);
|
330
|
+
rb_str_resize(parent_inspect_str, RSTRING_LEN(parent_inspect_str) - 1);
|
331
|
+
parentInspectString = StringValuePtr(parent_inspect_str);
|
332
|
+
} else {
|
333
|
+
parentInspectString.sprintf("#<%s:0x0", qobject->parent()->metaObject()->className());
|
334
|
+
}
|
335
|
+
|
336
|
+
if (qobject->parent()->isWidgetType()) {
|
337
|
+
QWidget * w = (QWidget *) qobject->parent();
|
338
|
+
value_list = QString(" parent=%1 objectName=\"%2\", x=%3, y=%4, width=%5, height=%6>,\n")
|
339
|
+
.arg(parentInspectString)
|
340
|
+
.arg(w->objectName())
|
341
|
+
.arg(w->x())
|
342
|
+
.arg(w->y())
|
343
|
+
.arg(w->width())
|
344
|
+
.arg(w->height());
|
345
|
+
} else {
|
346
|
+
value_list = QString(" parent=%1 objectName=\"%2\">,\n")
|
347
|
+
.arg(parentInspectString)
|
348
|
+
.arg(qobject->parent()->objectName());
|
349
|
+
}
|
350
|
+
|
351
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
|
352
|
+
}
|
353
|
+
|
354
|
+
if (qobject->children().count() != 0) {
|
355
|
+
value_list = QString(" children=Array (%1 element(s)),\n")
|
356
|
+
.arg(qobject->children().count());
|
357
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
|
358
|
+
}
|
359
|
+
|
360
|
+
value_list = QString(" metaObject=#<Qt::MetaObject:0x0");
|
361
|
+
value_list.append(QString(" className=%1").arg(qobject->metaObject()->className()));
|
362
|
+
|
363
|
+
if (qobject->metaObject()->superClass() != 0) {
|
364
|
+
value_list.append( QString(", superClass=#<Qt::MetaObject:0x0 className=%1>")
|
365
|
+
.arg(qobject->metaObject()->superClass()->className()) );
|
366
|
+
}
|
367
|
+
|
368
|
+
value_list.append(">,\n");
|
369
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
|
370
|
+
|
371
|
+
QMetaProperty property = qobject->metaObject()->property(0);
|
372
|
+
QVariant value = property.read(qobject);
|
373
|
+
value_list = " " + inspectProperty(property, property.name(), value);
|
374
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
|
375
|
+
|
376
|
+
for (int index = 1; index < qobject->metaObject()->propertyCount(); index++) {
|
377
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(",\n"));
|
378
|
+
|
379
|
+
property = qobject->metaObject()->property(index);
|
380
|
+
value = property.read(qobject);
|
381
|
+
value_list = " " + inspectProperty(property, property.name(), value);
|
382
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
|
383
|
+
}
|
384
|
+
|
385
|
+
rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(">"));
|
386
|
+
|
387
|
+
return self;
|
388
|
+
}
|
389
|
+
|
390
|
+
static VALUE
|
391
|
+
q_register_resource_data(VALUE /*self*/, VALUE version, VALUE tree_value, VALUE name_value, VALUE data_value)
|
392
|
+
{
|
393
|
+
const unsigned char * tree = (const unsigned char *) malloc(RSTRING_LEN(tree_value));
|
394
|
+
memcpy((void *) tree, (const void *) RSTRING_PTR(tree_value), RSTRING_LEN(tree_value));
|
395
|
+
|
396
|
+
const unsigned char * name = (const unsigned char *) malloc(RSTRING_LEN(name_value));
|
397
|
+
memcpy((void *) name, (const void *) RSTRING_PTR(name_value), RSTRING_LEN(name_value));
|
398
|
+
|
399
|
+
const unsigned char * data = (const unsigned char *) malloc(RSTRING_LEN(data_value));
|
400
|
+
memcpy((void *) data, (const void *) RSTRING_PTR(data_value), RSTRING_LEN(data_value));
|
401
|
+
|
402
|
+
return qRegisterResourceData(NUM2INT(version), tree, name, data) ? Qtrue : Qfalse;
|
403
|
+
}
|
404
|
+
|
405
|
+
static VALUE
|
406
|
+
q_unregister_resource_data(VALUE /*self*/, VALUE version, VALUE tree_value, VALUE name_value, VALUE data_value)
|
407
|
+
{
|
408
|
+
const unsigned char * tree = (const unsigned char *) malloc(RSTRING_LEN(tree_value));
|
409
|
+
memcpy((void *) tree, (const void *) RSTRING_PTR(tree_value), RSTRING_LEN(tree_value));
|
410
|
+
|
411
|
+
const unsigned char * name = (const unsigned char *) malloc(RSTRING_LEN(name_value));
|
412
|
+
memcpy((void *) name, (const void *) RSTRING_PTR(name_value), RSTRING_LEN(name_value));
|
413
|
+
|
414
|
+
const unsigned char * data = (const unsigned char *) malloc(RSTRING_LEN(data_value));
|
415
|
+
memcpy((void *) data, (const void *) RSTRING_PTR(data_value), RSTRING_LEN(data_value));
|
416
|
+
|
417
|
+
return qUnregisterResourceData(NUM2INT(version), tree, name, data) ? Qtrue : Qfalse;
|
418
|
+
}
|
419
|
+
|
420
|
+
static VALUE
|
421
|
+
qabstract_item_model_rowcount(int argc, VALUE * argv, VALUE self)
|
422
|
+
{
|
423
|
+
smokeruby_object *o = value_obj_info(self);
|
424
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
425
|
+
if (argc == 0) {
|
426
|
+
return INT2NUM(model->rowCount());
|
427
|
+
}
|
428
|
+
|
429
|
+
if (argc == 1) {
|
430
|
+
smokeruby_object * mi = value_obj_info(argv[0]);
|
431
|
+
QModelIndex * modelIndex = (QModelIndex *) mi->ptr;
|
432
|
+
return INT2NUM(model->rowCount(*modelIndex));
|
433
|
+
}
|
434
|
+
|
435
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
436
|
+
}
|
437
|
+
|
438
|
+
static VALUE
|
439
|
+
qabstract_item_model_columncount(int argc, VALUE * argv, VALUE self)
|
440
|
+
{
|
441
|
+
smokeruby_object *o = value_obj_info(self);
|
442
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
443
|
+
if (argc == 0) {
|
444
|
+
return INT2NUM(model->columnCount());
|
445
|
+
}
|
446
|
+
|
447
|
+
if (argc == 1) {
|
448
|
+
smokeruby_object * mi = value_obj_info(argv[0]);
|
449
|
+
QModelIndex * modelIndex = (QModelIndex *) mi->ptr;
|
450
|
+
return INT2NUM(model->columnCount(*modelIndex));
|
451
|
+
}
|
452
|
+
|
453
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
454
|
+
}
|
455
|
+
|
456
|
+
static VALUE
|
457
|
+
qabstract_item_model_data(int argc, VALUE * argv, VALUE self)
|
458
|
+
{
|
459
|
+
smokeruby_object * o = value_obj_info(self);
|
460
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
461
|
+
smokeruby_object * mi = value_obj_info(argv[0]);
|
462
|
+
QModelIndex * modelIndex = (QModelIndex *) mi->ptr;
|
463
|
+
QVariant value;
|
464
|
+
if (argc == 1) {
|
465
|
+
value = model->data(*modelIndex);
|
466
|
+
} else if (argc == 2) {
|
467
|
+
value = model->data(*modelIndex, NUM2INT(rb_funcall(argv[1], rb_intern("to_i"), 0)));
|
468
|
+
} else {
|
469
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
470
|
+
}
|
471
|
+
|
472
|
+
|
473
|
+
smokeruby_object * result = alloc_smokeruby_object( true,
|
474
|
+
o->smoke,
|
475
|
+
o->smoke->findClass("QVariant").index,
|
476
|
+
new QVariant(value) );
|
477
|
+
return set_obj_info("Qt::Variant", result);
|
478
|
+
}
|
479
|
+
|
480
|
+
static VALUE
|
481
|
+
qabstract_item_model_setdata(int argc, VALUE * argv, VALUE self)
|
482
|
+
{
|
483
|
+
smokeruby_object *o = value_obj_info(self);
|
484
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
485
|
+
smokeruby_object * mi = value_obj_info(argv[0]);
|
486
|
+
QModelIndex * modelIndex = (QModelIndex *) mi->ptr;
|
487
|
+
smokeruby_object * v = value_obj_info(argv[1]);
|
488
|
+
QVariant * variant = (QVariant *) v->ptr;
|
489
|
+
|
490
|
+
if (argc == 2) {
|
491
|
+
return (model->setData(*modelIndex, *variant) ? Qtrue : Qfalse);
|
492
|
+
}
|
493
|
+
|
494
|
+
if (argc == 3) {
|
495
|
+
return (model->setData( *modelIndex,
|
496
|
+
*variant,
|
497
|
+
NUM2INT(rb_funcall(argv[2], rb_intern("to_i"), 0)) ) ? Qtrue : Qfalse);
|
498
|
+
}
|
499
|
+
|
500
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
501
|
+
}
|
502
|
+
|
503
|
+
static VALUE
|
504
|
+
qabstract_item_model_flags(VALUE self, VALUE model_index)
|
505
|
+
{
|
506
|
+
smokeruby_object *o = value_obj_info(self);
|
507
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
508
|
+
smokeruby_object * mi = value_obj_info(model_index);
|
509
|
+
const QModelIndex * modelIndex = (const QModelIndex *) mi->ptr;
|
510
|
+
return INT2NUM((int) model->flags(*modelIndex));
|
511
|
+
}
|
512
|
+
|
513
|
+
static VALUE
|
514
|
+
qabstract_item_model_insertrows(int argc, VALUE * argv, VALUE self)
|
515
|
+
{
|
516
|
+
smokeruby_object *o = value_obj_info(self);
|
517
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
518
|
+
|
519
|
+
if (argc == 2) {
|
520
|
+
return (model->insertRows(NUM2INT(argv[0]), NUM2INT(argv[1])) ? Qtrue : Qfalse);
|
521
|
+
}
|
522
|
+
|
523
|
+
if (argc == 3) {
|
524
|
+
smokeruby_object * mi = value_obj_info(argv[2]);
|
525
|
+
const QModelIndex * modelIndex = (const QModelIndex *) mi->ptr;
|
526
|
+
return (model->insertRows(NUM2INT(argv[0]), NUM2INT(argv[1]), *modelIndex) ? Qtrue : Qfalse);
|
527
|
+
}
|
528
|
+
|
529
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
530
|
+
}
|
531
|
+
|
532
|
+
static VALUE
|
533
|
+
qabstract_item_model_insertcolumns(int argc, VALUE * argv, VALUE self)
|
534
|
+
{
|
535
|
+
smokeruby_object *o = value_obj_info(self);
|
536
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
537
|
+
|
538
|
+
if (argc == 2) {
|
539
|
+
return (model->insertColumns(NUM2INT(argv[0]), NUM2INT(argv[1])) ? Qtrue : Qfalse);
|
540
|
+
}
|
541
|
+
|
542
|
+
if (argc == 3) {
|
543
|
+
smokeruby_object * mi = value_obj_info(argv[2]);
|
544
|
+
const QModelIndex * modelIndex = (const QModelIndex *) mi->ptr;
|
545
|
+
return (model->insertColumns(NUM2INT(argv[0]), NUM2INT(argv[1]), *modelIndex) ? Qtrue : Qfalse);
|
546
|
+
}
|
547
|
+
|
548
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
549
|
+
}
|
550
|
+
|
551
|
+
static VALUE
|
552
|
+
qabstract_item_model_removerows(int argc, VALUE * argv, VALUE self)
|
553
|
+
{
|
554
|
+
smokeruby_object *o = value_obj_info(self);
|
555
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
556
|
+
|
557
|
+
if (argc == 2) {
|
558
|
+
return (model->removeRows(NUM2INT(argv[0]), NUM2INT(argv[1])) ? Qtrue : Qfalse);
|
559
|
+
}
|
560
|
+
|
561
|
+
if (argc == 3) {
|
562
|
+
smokeruby_object * mi = value_obj_info(argv[2]);
|
563
|
+
const QModelIndex * modelIndex = (const QModelIndex *) mi->ptr;
|
564
|
+
return (model->removeRows(NUM2INT(argv[0]), NUM2INT(argv[1]), *modelIndex) ? Qtrue : Qfalse);
|
565
|
+
}
|
566
|
+
|
567
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
568
|
+
}
|
569
|
+
|
570
|
+
static VALUE
|
571
|
+
qabstract_item_model_removecolumns(int argc, VALUE * argv, VALUE self)
|
572
|
+
{
|
573
|
+
smokeruby_object *o = value_obj_info(self);
|
574
|
+
QAbstractItemModel * model = (QAbstractItemModel *) o->ptr;
|
575
|
+
|
576
|
+
if (argc == 2) {
|
577
|
+
return (model->removeColumns(NUM2INT(argv[0]), NUM2INT(argv[1])) ? Qtrue : Qfalse);
|
578
|
+
}
|
579
|
+
|
580
|
+
if (argc == 3) {
|
581
|
+
smokeruby_object * mi = value_obj_info(argv[2]);
|
582
|
+
const QModelIndex * modelIndex = (const QModelIndex *) mi->ptr;
|
583
|
+
return (model->removeRows(NUM2INT(argv[0]), NUM2INT(argv[1]), *modelIndex) ? Qtrue : Qfalse);
|
584
|
+
}
|
585
|
+
|
586
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
587
|
+
}
|
588
|
+
|
589
|
+
// There is a QByteArray operator method in the Smoke lib that takes a QString
|
590
|
+
// arg and returns a QString. This is normally the desired behaviour, so
|
591
|
+
// special case a '+' method here.
|
592
|
+
static VALUE
|
593
|
+
qbytearray_append(VALUE self, VALUE str)
|
594
|
+
{
|
595
|
+
smokeruby_object *o = value_obj_info(self);
|
596
|
+
QByteArray * bytes = (QByteArray *) o->ptr;
|
597
|
+
(*bytes) += (const char *) StringValuePtr(str);
|
598
|
+
return self;
|
599
|
+
}
|
600
|
+
|
601
|
+
static VALUE
|
602
|
+
qbytearray_data(VALUE self)
|
603
|
+
{
|
604
|
+
smokeruby_object *o = value_obj_info(self);
|
605
|
+
QByteArray * bytes = (QByteArray *) o->ptr;
|
606
|
+
return rb_str_new(bytes->data(), bytes->size());
|
607
|
+
}
|
608
|
+
|
609
|
+
static VALUE
|
610
|
+
qimage_bits(VALUE self)
|
611
|
+
{
|
612
|
+
smokeruby_object *o = value_obj_info(self);
|
613
|
+
QImage * image = static_cast<QImage *>(o->ptr);
|
614
|
+
const uchar * bytes = image->bits();
|
615
|
+
return rb_str_new((const char *) bytes, image->numBytes());
|
616
|
+
}
|
617
|
+
|
618
|
+
static VALUE
|
619
|
+
qimage_scan_line(VALUE self, VALUE ix)
|
620
|
+
{
|
621
|
+
smokeruby_object *o = value_obj_info(self);
|
622
|
+
QImage * image = static_cast<QImage *>(o->ptr);
|
623
|
+
const uchar * bytes = image->scanLine(NUM2INT(ix));
|
624
|
+
return rb_str_new((const char *) bytes, image->bytesPerLine());
|
625
|
+
}
|
626
|
+
|
627
|
+
#ifdef QT_QTDBUS
|
628
|
+
static VALUE
|
629
|
+
qdbusargument_endarraywrite(VALUE self)
|
630
|
+
{
|
631
|
+
smokeruby_object *o = value_obj_info(self);
|
632
|
+
QDBusArgument * arg = (QDBusArgument *) o->ptr;
|
633
|
+
arg->endArray();
|
634
|
+
return self;
|
635
|
+
}
|
636
|
+
|
637
|
+
static VALUE
|
638
|
+
qdbusargument_endmapwrite(VALUE self)
|
639
|
+
{
|
640
|
+
smokeruby_object *o = value_obj_info(self);
|
641
|
+
QDBusArgument * arg = (QDBusArgument *) o->ptr;
|
642
|
+
arg->endMap();
|
643
|
+
return self;
|
644
|
+
}
|
645
|
+
|
646
|
+
static VALUE
|
647
|
+
qdbusargument_endmapentrywrite(VALUE self)
|
648
|
+
{
|
649
|
+
smokeruby_object *o = value_obj_info(self);
|
650
|
+
QDBusArgument * arg = (QDBusArgument *) o->ptr;
|
651
|
+
arg->endMapEntry();
|
652
|
+
return self;
|
653
|
+
}
|
654
|
+
|
655
|
+
static VALUE
|
656
|
+
qdbusargument_endstructurewrite(VALUE self)
|
657
|
+
{
|
658
|
+
smokeruby_object *o = value_obj_info(self);
|
659
|
+
QDBusArgument * arg = (QDBusArgument *) o->ptr;
|
660
|
+
arg->endStructure();
|
661
|
+
return self;
|
662
|
+
}
|
663
|
+
|
664
|
+
#endif
|
665
|
+
|
666
|
+
// The QtRuby runtime's overloaded method resolution mechanism can't currently
|
667
|
+
// distinguish between Ruby Arrays containing different sort of instances.
|
668
|
+
// Unfortunately Qt::Painter.drawLines() and Qt::Painter.drawRects() methods can
|
669
|
+
// be passed a Ruby Array as an argument containing either Qt::Points or Qt::PointFs
|
670
|
+
// for instance. These methods need to call the correct Qt C++ methods, so special case
|
671
|
+
// the overload method resolution for now..
|
672
|
+
static VALUE
|
673
|
+
qpainter_drawlines(int argc, VALUE * argv, VALUE self)
|
674
|
+
{
|
675
|
+
static Smoke::Index drawlines_pointf_vector = 0;
|
676
|
+
static Smoke::Index drawlines_point_vector = 0;
|
677
|
+
static Smoke::Index drawlines_linef_vector = 0;
|
678
|
+
static Smoke::Index drawlines_line_vector = 0;
|
679
|
+
|
680
|
+
if (argc == 1 && TYPE(argv[0]) == T_ARRAY && RARRAY_LEN(argv[0]) > 0) {
|
681
|
+
if (drawlines_point_vector == 0) {
|
682
|
+
Smoke::ModuleIndex nameId = qtcore_Smoke->findMethodName("QPainter", "drawLines?");
|
683
|
+
Smoke::ModuleIndex meth = qtcore_Smoke->findMethod(qtcore_Smoke->findClass("QPainter"), nameId);
|
684
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
685
|
+
i = -i; // turn into ambiguousMethodList index
|
686
|
+
while (meth.smoke->ambiguousMethodList[i] != 0) {
|
687
|
+
const char * argType = meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name;
|
688
|
+
|
689
|
+
if (qstrcmp(argType, "const QVector<QPointF>&" ) == 0) {
|
690
|
+
drawlines_pointf_vector = meth.smoke->ambiguousMethodList[i];
|
691
|
+
} else if (qstrcmp(argType, "const QVector<QPoint>&" ) == 0) {
|
692
|
+
drawlines_point_vector = meth.smoke->ambiguousMethodList[i];
|
693
|
+
} else if (qstrcmp(argType, "const QVector<QLineF>&" ) == 0) {
|
694
|
+
drawlines_linef_vector = meth.smoke->ambiguousMethodList[i];
|
695
|
+
} else if (qstrcmp(argType, "const QVector<QLine>&" ) == 0) {
|
696
|
+
drawlines_line_vector = meth.smoke->ambiguousMethodList[i];
|
697
|
+
}
|
698
|
+
|
699
|
+
i++;
|
700
|
+
}
|
701
|
+
}
|
702
|
+
|
703
|
+
smokeruby_object * o = value_obj_info(rb_ary_entry(argv[0], 0));
|
704
|
+
|
705
|
+
if (qstrcmp(o->smoke->classes[o->classId].className, "QPointF") == 0) {
|
706
|
+
_current_method.smoke = qtcore_Smoke;
|
707
|
+
_current_method.index = drawlines_pointf_vector;
|
708
|
+
} else if (qstrcmp(o->smoke->classes[o->classId].className, "QPoint") == 0) {
|
709
|
+
_current_method.smoke = qtcore_Smoke;
|
710
|
+
_current_method.index = drawlines_point_vector;
|
711
|
+
} else if (qstrcmp(o->smoke->classes[o->classId].className, "QLineF") == 0) {
|
712
|
+
_current_method.smoke = qtcore_Smoke;
|
713
|
+
_current_method.index = drawlines_linef_vector;
|
714
|
+
} else if (qstrcmp(o->smoke->classes[o->classId].className, "QLine") == 0) {
|
715
|
+
_current_method.smoke = qtcore_Smoke;
|
716
|
+
_current_method.index = drawlines_line_vector;
|
717
|
+
} else {
|
718
|
+
return rb_call_super(argc, argv);
|
719
|
+
}
|
720
|
+
|
721
|
+
QtRuby::MethodCall c(qtcore_Smoke, _current_method.index, self, argv, argc-1);
|
722
|
+
c.next();
|
723
|
+
return self;
|
724
|
+
}
|
725
|
+
|
726
|
+
return rb_call_super(argc, argv);
|
727
|
+
}
|
728
|
+
|
729
|
+
static VALUE
|
730
|
+
qpainter_drawrects(int argc, VALUE * argv, VALUE self)
|
731
|
+
{
|
732
|
+
static Smoke::Index drawlines_rectf_vector = 0;
|
733
|
+
static Smoke::Index drawlines_rect_vector = 0;
|
734
|
+
|
735
|
+
if (argc == 1 && TYPE(argv[0]) == T_ARRAY && RARRAY_LEN(argv[0]) > 0) {
|
736
|
+
if (drawlines_rectf_vector == 0) {
|
737
|
+
Smoke::ModuleIndex nameId = qtcore_Smoke->findMethodName("QPainter", "drawRects?");
|
738
|
+
Smoke::ModuleIndex meth = qtcore_Smoke->findMethod(qtcore_Smoke->findClass("QPainter"), nameId);
|
739
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
740
|
+
i = -i; // turn into ambiguousMethodList index
|
741
|
+
while (meth.smoke->ambiguousMethodList[i] != 0) {
|
742
|
+
const char * argType = meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name;
|
743
|
+
|
744
|
+
if (qstrcmp(argType, "const QVector<QRectF>&" ) == 0) {
|
745
|
+
drawlines_rectf_vector = meth.smoke->ambiguousMethodList[i];
|
746
|
+
} else if (qstrcmp(argType, "const QVector<QRect>&" ) == 0) {
|
747
|
+
drawlines_rect_vector = meth.smoke->ambiguousMethodList[i];
|
748
|
+
}
|
749
|
+
|
750
|
+
i++;
|
751
|
+
}
|
752
|
+
}
|
753
|
+
|
754
|
+
smokeruby_object * o = value_obj_info(rb_ary_entry(argv[0], 0));
|
755
|
+
|
756
|
+
if (qstrcmp(o->smoke->classes[o->classId].className, "QRectF") == 0) {
|
757
|
+
_current_method.smoke = qtcore_Smoke;
|
758
|
+
_current_method.index = drawlines_rectf_vector;
|
759
|
+
} else if (qstrcmp(o->smoke->classes[o->classId].className, "QRect") == 0) {
|
760
|
+
_current_method.smoke = qtcore_Smoke;
|
761
|
+
_current_method.index = drawlines_rect_vector;
|
762
|
+
} else {
|
763
|
+
return rb_call_super(argc, argv);
|
764
|
+
}
|
765
|
+
|
766
|
+
QtRuby::MethodCall c(qtcore_Smoke, _current_method.index, self, argv, argc-1);
|
767
|
+
c.next();
|
768
|
+
return self;
|
769
|
+
}
|
770
|
+
|
771
|
+
return rb_call_super(argc, argv);
|
772
|
+
}
|
773
|
+
|
774
|
+
static VALUE
|
775
|
+
qabstractitemmodel_createindex(int argc, VALUE * argv, VALUE self)
|
776
|
+
{
|
777
|
+
if (argc == 2 || argc == 3) {
|
778
|
+
smokeruby_object * o = value_obj_info(self);
|
779
|
+
Smoke::ModuleIndex nameId = o->smoke->idMethodName("createIndex$$$");
|
780
|
+
Smoke::ModuleIndex meth = o->smoke->findMethod(qtcore_Smoke->findClass("QAbstractItemModel"), nameId);
|
781
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
782
|
+
i = -i; // turn into ambiguousMethodList index
|
783
|
+
while (o->smoke->ambiguousMethodList[i] != 0) {
|
784
|
+
if ( qstrcmp( o->smoke->types[o->smoke->argumentList[o->smoke->methods[o->smoke->ambiguousMethodList[i]].args + 2]].name,
|
785
|
+
"void*" ) == 0 )
|
786
|
+
{
|
787
|
+
const Smoke::Method &m = o->smoke->methods[o->smoke->ambiguousMethodList[i]];
|
788
|
+
Smoke::ClassFn fn = o->smoke->classes[m.classId].classFn;
|
789
|
+
Smoke::StackItem stack[4];
|
790
|
+
stack[1].s_int = NUM2INT(argv[0]);
|
791
|
+
stack[2].s_int = NUM2INT(argv[1]);
|
792
|
+
if (argc == 2) {
|
793
|
+
stack[3].s_voidp = (void*) Qnil;
|
794
|
+
} else {
|
795
|
+
stack[3].s_voidp = (void*) argv[2];
|
796
|
+
}
|
797
|
+
(*fn)(m.method, o->ptr, stack);
|
798
|
+
smokeruby_object * result = alloc_smokeruby_object( true,
|
799
|
+
o->smoke,
|
800
|
+
o->smoke->idClass("QModelIndex").index,
|
801
|
+
stack[0].s_voidp );
|
802
|
+
|
803
|
+
return set_obj_info("Qt::ModelIndex", result);
|
804
|
+
}
|
805
|
+
|
806
|
+
i++;
|
807
|
+
}
|
808
|
+
}
|
809
|
+
|
810
|
+
return rb_call_super(argc, argv);
|
811
|
+
}
|
812
|
+
|
813
|
+
static VALUE
|
814
|
+
qmodelindex_internalpointer(VALUE self)
|
815
|
+
{
|
816
|
+
smokeruby_object *o = value_obj_info(self);
|
817
|
+
QModelIndex * index = (QModelIndex *) o->ptr;
|
818
|
+
void * ptr = index->internalPointer();
|
819
|
+
return ptr != 0 ? (VALUE) ptr : Qnil;
|
820
|
+
}
|
821
|
+
|
822
|
+
static VALUE
|
823
|
+
qitemselection_at(VALUE self, VALUE i)
|
824
|
+
{
|
825
|
+
smokeruby_object *o = value_obj_info(self);
|
826
|
+
QItemSelection * item = (QItemSelection *) o->ptr;
|
827
|
+
QItemSelectionRange range = item->at(NUM2INT(i));
|
828
|
+
|
829
|
+
smokeruby_object * result = alloc_smokeruby_object( true,
|
830
|
+
o->smoke,
|
831
|
+
o->smoke->idClass("QItemSelectionRange").index,
|
832
|
+
new QItemSelectionRange(range) );
|
833
|
+
|
834
|
+
return set_obj_info("Qt::ItemSelectionRange", result);
|
835
|
+
}
|
836
|
+
|
837
|
+
static VALUE
|
838
|
+
qitemselection_count(VALUE self)
|
839
|
+
{
|
840
|
+
smokeruby_object *o = value_obj_info(self);
|
841
|
+
QItemSelection * item = (QItemSelection *) o->ptr;
|
842
|
+
return INT2NUM(item->count());
|
843
|
+
}
|
844
|
+
|
845
|
+
static VALUE
|
846
|
+
metaObject(VALUE self)
|
847
|
+
{
|
848
|
+
VALUE metaObject = rb_funcall(qt_internal_module, rb_intern("getMetaObject"), 2, Qnil, self);
|
849
|
+
return metaObject;
|
850
|
+
}
|
851
|
+
|
852
|
+
/* This shouldn't be needed, but kalyptus doesn't generate a staticMetaObject
|
853
|
+
method for QObject::staticMetaObject, although it does for all the other
|
854
|
+
classes, and it isn't obvious what the problem with it is.
|
855
|
+
So add this as a hack to work round the bug.
|
856
|
+
*/
|
857
|
+
static VALUE
|
858
|
+
qobject_staticmetaobject(VALUE /*klass*/)
|
859
|
+
{
|
860
|
+
QMetaObject * meta = new QMetaObject(QObject::staticMetaObject);
|
861
|
+
|
862
|
+
smokeruby_object * m = alloc_smokeruby_object( true,
|
863
|
+
qtcore_Smoke,
|
864
|
+
qtcore_Smoke->idClass("QMetaObject").index,
|
865
|
+
meta );
|
866
|
+
|
867
|
+
VALUE obj = set_obj_info("Qt::MetaObject", m);
|
868
|
+
return obj;
|
869
|
+
}
|
870
|
+
|
871
|
+
static VALUE
|
872
|
+
cast_object_to(VALUE /*self*/, VALUE object, VALUE new_klass)
|
873
|
+
{
|
874
|
+
smokeruby_object *o = value_obj_info(object);
|
875
|
+
|
876
|
+
VALUE new_klassname = rb_funcall(new_klass, rb_intern("name"), 0);
|
877
|
+
|
878
|
+
Smoke::ModuleIndex * cast_to_id = classcache.value(StringValuePtr(new_klassname));
|
879
|
+
if (cast_to_id == 0) {
|
880
|
+
rb_raise(rb_eArgError, "unable to find class \"%s\" to cast to\n", StringValuePtr(new_klassname));
|
881
|
+
}
|
882
|
+
|
883
|
+
smokeruby_object * o_cast = alloc_smokeruby_object( o->allocated,
|
884
|
+
cast_to_id->smoke,
|
885
|
+
(int) cast_to_id->index,
|
886
|
+
o->smoke->cast(o->ptr, o->classId, (int) cast_to_id->index) );
|
887
|
+
|
888
|
+
VALUE obj = Data_Wrap_Struct(new_klass, smokeruby_mark, smokeruby_free, (void *) o_cast);
|
889
|
+
mapPointer(obj, o_cast, o_cast->classId, 0);
|
890
|
+
return obj;
|
891
|
+
}
|
892
|
+
|
893
|
+
static VALUE
|
894
|
+
qobject_qt_metacast(VALUE self, VALUE klass)
|
895
|
+
{
|
896
|
+
smokeruby_object *o = value_obj_info(self);
|
897
|
+
if (o == 0 || o->ptr == 0) {
|
898
|
+
return Qnil;
|
899
|
+
}
|
900
|
+
|
901
|
+
const char * classname = rb_class2name(klass);
|
902
|
+
Smoke::ModuleIndex * mi = classcache.value(classname);
|
903
|
+
if (mi == 0) {
|
904
|
+
return Qnil;
|
905
|
+
}
|
906
|
+
|
907
|
+
QObject* qobj = (QObject*) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
908
|
+
if (qobj == 0) {
|
909
|
+
return Qnil;
|
910
|
+
}
|
911
|
+
|
912
|
+
void* ret = qobj->qt_metacast(mi->smoke->classes[mi->index].className);
|
913
|
+
|
914
|
+
if (ret == 0) {
|
915
|
+
return Qnil;
|
916
|
+
}
|
917
|
+
|
918
|
+
smokeruby_object * o_cast = alloc_smokeruby_object( o->allocated,
|
919
|
+
mi->smoke,
|
920
|
+
(int) mi->index,
|
921
|
+
ret );
|
922
|
+
|
923
|
+
VALUE obj = Data_Wrap_Struct(klass, smokeruby_mark, smokeruby_free, (void *) o_cast);
|
924
|
+
mapPointer(obj, o_cast, o_cast->classId, 0);
|
925
|
+
return obj;
|
926
|
+
}
|
927
|
+
|
928
|
+
static VALUE
|
929
|
+
qsignalmapper_mapping(int argc, VALUE * argv, VALUE self)
|
930
|
+
{
|
931
|
+
if (argc == 1 && TYPE(argv[0]) == T_DATA) {
|
932
|
+
smokeruby_object *o = value_obj_info(self);
|
933
|
+
smokeruby_object *a = value_obj_info(argv[0]);
|
934
|
+
|
935
|
+
Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
|
936
|
+
nameId = o->smoke->idMethodName("mapping#");
|
937
|
+
Smoke::ModuleIndex ci(o->smoke, o->classId);
|
938
|
+
Smoke::ModuleIndex meth = o->smoke->findMethod(ci, nameId);
|
939
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
940
|
+
i = -i; // turn into ambiguousMethodList index
|
941
|
+
while (meth.smoke->ambiguousMethodList[i] != 0) {
|
942
|
+
if ( ( qstrcmp( meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
|
943
|
+
"QObject*" ) == 0
|
944
|
+
&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QObject")
|
945
|
+
&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") )
|
946
|
+
|| ( qstrcmp( meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
|
947
|
+
"QWidget*" ) == 0
|
948
|
+
&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )
|
949
|
+
{
|
950
|
+
_current_method.smoke = meth.smoke;
|
951
|
+
_current_method.index = meth.smoke->ambiguousMethodList[i];
|
952
|
+
QtRuby::MethodCall c(meth.smoke, _current_method.index, self, argv, 1);
|
953
|
+
c.next();
|
954
|
+
return *(c.var());
|
955
|
+
}
|
956
|
+
|
957
|
+
i++;
|
958
|
+
}
|
959
|
+
}
|
960
|
+
|
961
|
+
return rb_call_super(argc, argv);
|
962
|
+
}
|
963
|
+
|
964
|
+
static VALUE
|
965
|
+
qsignalmapper_set_mapping(int argc, VALUE * argv, VALUE self)
|
966
|
+
{
|
967
|
+
if (argc == 2 && TYPE(argv[0]) == T_DATA && TYPE(argv[1]) == T_DATA) {
|
968
|
+
smokeruby_object *o = value_obj_info(self);
|
969
|
+
smokeruby_object *a = value_obj_info(argv[1]);
|
970
|
+
|
971
|
+
Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
|
972
|
+
nameId = o->smoke->idMethodName("setMapping##");
|
973
|
+
Smoke::ModuleIndex ci(o->smoke, o->classId);
|
974
|
+
Smoke::ModuleIndex meth = o->smoke->findMethod(ci, nameId);
|
975
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
976
|
+
i = -i; // turn into ambiguousMethodList index
|
977
|
+
while (meth.smoke->ambiguousMethodList[i] != 0) {
|
978
|
+
if ( ( qstrcmp( meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args + 1]].name,
|
979
|
+
"QObject*" ) == 0
|
980
|
+
&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QObject")
|
981
|
+
&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") )
|
982
|
+
|| ( qstrcmp( meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args + 1]].name,
|
983
|
+
"QWidget*" ) == 0
|
984
|
+
&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )
|
985
|
+
{
|
986
|
+
_current_method.smoke = meth.smoke;
|
987
|
+
_current_method.index = meth.smoke->ambiguousMethodList[i];
|
988
|
+
QtRuby::MethodCall c(meth.smoke, _current_method.index, self, argv, 2);
|
989
|
+
c.next();
|
990
|
+
return *(c.var());
|
991
|
+
}
|
992
|
+
|
993
|
+
i++;
|
994
|
+
}
|
995
|
+
}
|
996
|
+
|
997
|
+
return rb_call_super(argc, argv);
|
998
|
+
}
|
999
|
+
|
1000
|
+
static int rObject_typeId;
|
1001
|
+
|
1002
|
+
// QMetaType helpers
|
1003
|
+
static void delete_ruby_object(void *ptr)
|
1004
|
+
{
|
1005
|
+
rb_gc_unregister_address((VALUE*) ptr);
|
1006
|
+
delete (VALUE*) ptr;
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
static void *create_ruby_object(const void *copyFrom)
|
1010
|
+
{
|
1011
|
+
VALUE *object;
|
1012
|
+
|
1013
|
+
if (copyFrom) {
|
1014
|
+
object = new VALUE(*(VALUE*) copyFrom);
|
1015
|
+
} else {
|
1016
|
+
object = new VALUE(Qnil);
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
rb_gc_register_address(object);
|
1020
|
+
return object;
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
static VALUE
|
1024
|
+
qvariant_value(VALUE /*self*/, VALUE variant_value_klass, VALUE variant_value)
|
1025
|
+
{
|
1026
|
+
void * value_ptr = 0;
|
1027
|
+
VALUE result = Qnil;
|
1028
|
+
smokeruby_object * vo = 0;
|
1029
|
+
|
1030
|
+
smokeruby_object *o = value_obj_info(variant_value);
|
1031
|
+
if (o == 0 || o->ptr == 0) {
|
1032
|
+
return Qnil;
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
QVariant * variant = (QVariant*) o->ptr;
|
1036
|
+
|
1037
|
+
if (variant->userType() == rObject_typeId) {
|
1038
|
+
return *(VALUE*) variant->data();
|
1039
|
+
#ifdef QT_QTDBUS
|
1040
|
+
} else if (variant->userType() == qMetaTypeId<QDBusObjectPath>()) {
|
1041
|
+
QString s = qVariantValue<QDBusObjectPath>(*variant).path();
|
1042
|
+
return rb_str_new2(s.toLatin1());
|
1043
|
+
} else if (variant->userType() == qMetaTypeId<QDBusSignature>()) {
|
1044
|
+
QString s = qVariantValue<QDBusSignature>(*variant).signature();
|
1045
|
+
return rb_str_new2(s.toLatin1());
|
1046
|
+
} else if (variant->userType() == qMetaTypeId<QDBusVariant>()) {
|
1047
|
+
QVariant *ptr = new QVariant(qVariantValue<QDBusVariant>(*variant).variant());
|
1048
|
+
vo = alloc_smokeruby_object(true, qtcore_Smoke, qtcore_Smoke->idClass("QVariant").index, ptr);
|
1049
|
+
return set_obj_info("Qt::Variant", vo);
|
1050
|
+
#endif
|
1051
|
+
} else if (variant->type() >= QVariant::UserType) {
|
1052
|
+
// If the QVariant contains a user type, don't bother to look at the Ruby class argument
|
1053
|
+
value_ptr = QMetaType::construct(QMetaType::type(variant->typeName()), (void *) variant->constData());
|
1054
|
+
Smoke::ModuleIndex mi = o->smoke->findClass(variant->typeName());
|
1055
|
+
vo = alloc_smokeruby_object(true, mi.smoke, mi.index, value_ptr);
|
1056
|
+
return set_obj_info(qtruby_modules[mi.smoke].binding->className(mi.index), vo);
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
const char * classname = rb_class2name(variant_value_klass);
|
1060
|
+
Smoke::ModuleIndex * value_class_id = classcache.value(classname);
|
1061
|
+
if (value_class_id == 0) {
|
1062
|
+
return Qnil;
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
if (qstrcmp(classname, "Qt::Pixmap") == 0) {
|
1066
|
+
QPixmap v = qVariantValue<QPixmap>(*variant);
|
1067
|
+
value_ptr = (void *) new QPixmap(v);
|
1068
|
+
} else if (qstrcmp(classname, "Qt::Font") == 0) {
|
1069
|
+
QFont v = qVariantValue<QFont>(*variant);
|
1070
|
+
value_ptr = (void *) new QFont(v);
|
1071
|
+
} else if (qstrcmp(classname, "Qt::Brush") == 0) {
|
1072
|
+
QBrush v = qVariantValue<QBrush>(*variant);
|
1073
|
+
value_ptr = (void *) new QBrush(v);
|
1074
|
+
} else if (qstrcmp(classname, "Qt::Color") == 0) {
|
1075
|
+
QColor v = qVariantValue<QColor>(*variant);
|
1076
|
+
value_ptr = (void *) new QColor(v);
|
1077
|
+
} else if (qstrcmp(classname, "Qt::Palette") == 0) {
|
1078
|
+
QPalette v = qVariantValue<QPalette>(*variant);
|
1079
|
+
value_ptr = (void *) new QPalette(v);
|
1080
|
+
} else if (qstrcmp(classname, "Qt::Icon") == 0) {
|
1081
|
+
QIcon v = qVariantValue<QIcon>(*variant);
|
1082
|
+
value_ptr = (void *) new QIcon(v);
|
1083
|
+
} else if (qstrcmp(classname, "Qt::Image") == 0) {
|
1084
|
+
QImage v = qVariantValue<QImage>(*variant);
|
1085
|
+
value_ptr = (void *) new QImage(v);
|
1086
|
+
} else if (qstrcmp(classname, "Qt::Polygon") == 0) {
|
1087
|
+
QPolygon v = qVariantValue<QPolygon>(*variant);
|
1088
|
+
value_ptr = (void *) new QPolygon(v);
|
1089
|
+
} else if (qstrcmp(classname, "Qt::Region") == 0) {
|
1090
|
+
QRegion v = qVariantValue<QRegion>(*variant);
|
1091
|
+
value_ptr = (void *) new QRegion(v);
|
1092
|
+
} else if (qstrcmp(classname, "Qt::Bitmap") == 0) {
|
1093
|
+
QBitmap v = qVariantValue<QBitmap>(*variant);
|
1094
|
+
value_ptr = (void *) new QBitmap(v);
|
1095
|
+
} else if (qstrcmp(classname, "Qt::Cursor") == 0) {
|
1096
|
+
QCursor v = qVariantValue<QCursor>(*variant);
|
1097
|
+
value_ptr = (void *) new QCursor(v);
|
1098
|
+
} else if (qstrcmp(classname, "Qt::SizePolicy") == 0) {
|
1099
|
+
QSizePolicy v = qVariantValue<QSizePolicy>(*variant);
|
1100
|
+
value_ptr = (void *) new QSizePolicy(v);
|
1101
|
+
} else if (qstrcmp(classname, "Qt::KeySequence") == 0) {
|
1102
|
+
QKeySequence v = qVariantValue<QKeySequence>(*variant);
|
1103
|
+
value_ptr = (void *) new QKeySequence(v);
|
1104
|
+
} else if (qstrcmp(classname, "Qt::Pen") == 0) {
|
1105
|
+
QPen v = qVariantValue<QPen>(*variant);
|
1106
|
+
value_ptr = (void *) new QPen(v);
|
1107
|
+
} else if (qstrcmp(classname, "Qt::TextLength") == 0) {
|
1108
|
+
QTextLength v = qVariantValue<QTextLength>(*variant);
|
1109
|
+
value_ptr = (void *) new QTextLength(v);
|
1110
|
+
} else if (qstrcmp(classname, "Qt::TextFormat") == 0) {
|
1111
|
+
QTextFormat v = qVariantValue<QTextFormat>(*variant);
|
1112
|
+
value_ptr = (void *) new QTextFormat(v);
|
1113
|
+
} else if (qstrcmp(classname, "Qt::Variant") == 0) {
|
1114
|
+
value_ptr = (void *) new QVariant(*((QVariant *) variant->constData()));
|
1115
|
+
} else {
|
1116
|
+
// Assume the value of the Qt::Variant can be obtained
|
1117
|
+
// with a call such as Qt::Variant.toPoint()
|
1118
|
+
QByteArray toValueMethodName(classname);
|
1119
|
+
if (toValueMethodName.startsWith("Qt::")) {
|
1120
|
+
toValueMethodName.remove(0, strlen("Qt::"));
|
1121
|
+
}
|
1122
|
+
toValueMethodName.prepend("to");
|
1123
|
+
return rb_funcall(variant_value, rb_intern(toValueMethodName), 1, variant_value);
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
vo = alloc_smokeruby_object(true, value_class_id->smoke, value_class_id->index, value_ptr);
|
1127
|
+
result = set_obj_info(classname, vo);
|
1128
|
+
|
1129
|
+
return result;
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
static VALUE create_qvariant_one_arg(VALUE arg)
|
1133
|
+
{
|
1134
|
+
return rb_funcall(qvariant_class, rb_intern("new"), 1, arg);
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
static VALUE
|
1138
|
+
qvariant_from_value(int argc, VALUE * argv, VALUE self)
|
1139
|
+
{
|
1140
|
+
if (argc == 2) {
|
1141
|
+
Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
|
1142
|
+
if (TYPE(argv[0]) == T_DATA) {
|
1143
|
+
nameId = qtcore_Smoke->idMethodName("QVariant#");
|
1144
|
+
} else if (TYPE(argv[0]) == T_ARRAY || TYPE(argv[0]) == T_ARRAY) {
|
1145
|
+
nameId = qtcore_Smoke->idMethodName("QVariant?");
|
1146
|
+
} else {
|
1147
|
+
nameId = qtcore_Smoke->idMethodName("QVariant$");
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
Smoke::ModuleIndex meth = qtcore_Smoke->findMethod(qtcore_Smoke->idClass("QVariant"), nameId);
|
1151
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
1152
|
+
i = -i; // turn into ambiguousMethodList index
|
1153
|
+
while (meth.smoke->ambiguousMethodList[i] != 0) {
|
1154
|
+
if ( qstrcmp( meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
|
1155
|
+
StringValuePtr(argv[1]) ) == 0 )
|
1156
|
+
{
|
1157
|
+
_current_method.smoke = meth.smoke;
|
1158
|
+
_current_method.index = meth.smoke->ambiguousMethodList[i];
|
1159
|
+
QtRuby::MethodCall c(meth.smoke, _current_method.index, self, argv, 0);
|
1160
|
+
c.next();
|
1161
|
+
return *(c.var());
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
i++;
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
QVariant * v = 0;
|
1169
|
+
|
1170
|
+
const char * classname = rb_obj_classname(argv[0]);
|
1171
|
+
smokeruby_object *o = value_obj_info(argv[0]);
|
1172
|
+
int type = 0;
|
1173
|
+
|
1174
|
+
if (qstrcmp(classname, "Qt::Enum") == 0) {
|
1175
|
+
return rb_funcall(qvariant_class, rb_intern("new"), 1, rb_funcall(argv[0], rb_intern("to_i"), 0));
|
1176
|
+
} else if (o && o->ptr && (type = QVariant::nameToType(o->smoke->className(o->classId)))) {
|
1177
|
+
v = new QVariant(type, o->ptr);
|
1178
|
+
} else {
|
1179
|
+
int error = 0;
|
1180
|
+
VALUE result = rb_protect(&create_qvariant_one_arg, argv[0], &error);
|
1181
|
+
if (!error) {
|
1182
|
+
return result;
|
1183
|
+
} else {
|
1184
|
+
VALUE lasterr = rb_gv_get("$!");
|
1185
|
+
VALUE klass = rb_class_path(CLASS_OF(lasterr));
|
1186
|
+
if (qstrcmp(StringValuePtr(klass), "ArgumentError") == 0) {
|
1187
|
+
// ArgumentError - no suitable constructor found
|
1188
|
+
// Create a QVariant that contains an rObject
|
1189
|
+
v = new QVariant(rObject_typeId, &argv[0]);
|
1190
|
+
} else {
|
1191
|
+
rb_raise(lasterr, "while creating the QVariant");
|
1192
|
+
}
|
1193
|
+
}
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
smokeruby_object * vo = alloc_smokeruby_object(true, qtcore_Smoke, qtcore_Smoke->idClass("QVariant").index, v);
|
1197
|
+
VALUE result = set_obj_info("Qt::Variant", vo);
|
1198
|
+
|
1199
|
+
return result;
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
static VALUE
|
1203
|
+
new_qvariant(int argc, VALUE * argv, VALUE self)
|
1204
|
+
{
|
1205
|
+
static Smoke::Index new_qvariant_qlist = 0;
|
1206
|
+
static Smoke::Index new_qvariant_qmap = 0;
|
1207
|
+
|
1208
|
+
if (new_qvariant_qlist == 0) {
|
1209
|
+
Smoke::ModuleIndex nameId = qtcore_Smoke->findMethodName("Qvariant", "QVariant?");
|
1210
|
+
Smoke::ModuleIndex meth = qtcore_Smoke->findMethod(qtcore_Smoke->findClass("QVariant"), nameId);
|
1211
|
+
Smoke::Index i = meth.smoke->methodMaps[meth.index].method;
|
1212
|
+
i = -i; // turn into ambiguousMethodList index
|
1213
|
+
while (qtcore_Smoke->ambiguousMethodList[i] != 0) {
|
1214
|
+
const char * argType = meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name;
|
1215
|
+
|
1216
|
+
if (qstrcmp(argType, "const QList<QVariant>&" ) == 0) {
|
1217
|
+
new_qvariant_qlist = meth.smoke->ambiguousMethodList[i];
|
1218
|
+
} else if (qstrcmp(argType, "const QMap<QString,QVariant>&" ) == 0) {
|
1219
|
+
new_qvariant_qmap = meth.smoke->ambiguousMethodList[i];
|
1220
|
+
}
|
1221
|
+
|
1222
|
+
i++;
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
if (argc == 1 && TYPE(argv[0]) == T_HASH) {
|
1227
|
+
_current_method.smoke = qtcore_Smoke;
|
1228
|
+
_current_method.index = new_qvariant_qmap;
|
1229
|
+
QtRuby::MethodCall c(qtcore_Smoke, _current_method.index, self, argv, argc-1);
|
1230
|
+
c.next();
|
1231
|
+
return *(c.var());
|
1232
|
+
} else if ( argc == 1
|
1233
|
+
&& TYPE(argv[0]) == T_ARRAY
|
1234
|
+
&& RARRAY_LEN(argv[0]) > 0
|
1235
|
+
&& TYPE(rb_ary_entry(argv[0], 0)) != T_STRING )
|
1236
|
+
{
|
1237
|
+
_current_method.smoke = qtcore_Smoke;
|
1238
|
+
_current_method.index = new_qvariant_qlist;
|
1239
|
+
QtRuby::MethodCall c(qtcore_Smoke, _current_method.index, self, argv, argc-1);
|
1240
|
+
c.next();
|
1241
|
+
return *(c.var());
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
return rb_call_super(argc, argv);
|
1245
|
+
}
|
1246
|
+
|
1247
|
+
static VALUE module_method_missing(int argc, VALUE * argv, VALUE klass)
|
1248
|
+
{
|
1249
|
+
return class_method_missing(argc, argv, klass);
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
/*
|
1253
|
+
|
1254
|
+
class LCDRange < Qt::Widget
|
1255
|
+
|
1256
|
+
def initialize(s, parent, name)
|
1257
|
+
super(parent, name)
|
1258
|
+
init()
|
1259
|
+
...
|
1260
|
+
|
1261
|
+
For a case such as the above, the QWidget can't be instantiated until
|
1262
|
+
the initializer has been run up to the point where 'super(parent, name)'
|
1263
|
+
is called. Only then, can the number and type of arguments passed to the
|
1264
|
+
constructor be known. However, the rest of the intializer
|
1265
|
+
can't be run until 'self' is a proper T_DATA object with a wrapped C++
|
1266
|
+
instance.
|
1267
|
+
|
1268
|
+
The solution is to run the initialize code twice. First, only up to the
|
1269
|
+
'super(parent, name)' call, where the QWidget would get instantiated in
|
1270
|
+
initialize_qt(). And then rb_throw() jumps out of the
|
1271
|
+
initializer returning the wrapped object as a result.
|
1272
|
+
|
1273
|
+
The second time round 'self' will be the wrapped instance of type T_DATA,
|
1274
|
+
so initialize() can be allowed to proceed to the end.
|
1275
|
+
*/
|
1276
|
+
static VALUE
|
1277
|
+
initialize_qt(int argc, VALUE * argv, VALUE self)
|
1278
|
+
{
|
1279
|
+
VALUE retval = Qnil;
|
1280
|
+
VALUE temp_obj;
|
1281
|
+
|
1282
|
+
if (TYPE(self) == T_DATA) {
|
1283
|
+
// If a ruby block was passed then run that now
|
1284
|
+
if (rb_block_given_p()) {
|
1285
|
+
rb_funcall(qt_internal_module, rb_intern("run_initializer_block"), 2, self, rb_block_proc());
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
return self;
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
VALUE klass = rb_funcall(self, rb_intern("class"), 0);
|
1292
|
+
VALUE constructor_name = rb_str_new2("new");
|
1293
|
+
|
1294
|
+
VALUE * temp_stack = ALLOCA_N(VALUE, argc+4);
|
1295
|
+
|
1296
|
+
temp_stack[0] = rb_str_new2("Qt");
|
1297
|
+
temp_stack[1] = constructor_name;
|
1298
|
+
temp_stack[2] = klass;
|
1299
|
+
temp_stack[3] = self;
|
1300
|
+
|
1301
|
+
for (int count = 0; count < argc; count++) {
|
1302
|
+
temp_stack[count+4] = argv[count];
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
{
|
1306
|
+
QByteArray * mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass));
|
1307
|
+
|
1308
|
+
if (_current_method.index == -1) {
|
1309
|
+
retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+4, temp_stack);
|
1310
|
+
if (_current_method.index != -1) {
|
1311
|
+
// Success. Cache result.
|
1312
|
+
methcache.insert(*mcid, new Smoke::ModuleIndex(_current_method));
|
1313
|
+
}
|
1314
|
+
}
|
1315
|
+
}
|
1316
|
+
|
1317
|
+
if (_current_method.index == -1) {
|
1318
|
+
// Another longjmp here..
|
1319
|
+
rb_raise(rb_eArgError, "unresolved constructor call %s\n", rb_class2name(klass));
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
{
|
1323
|
+
// Allocate the MethodCall within a C block. Otherwise, because the continue_new_instance()
|
1324
|
+
// call below will longjmp out, it wouldn't give C++ an opportunity to clean up
|
1325
|
+
QtRuby::MethodCall c(_current_method.smoke, _current_method.index, self, temp_stack+4, argc);
|
1326
|
+
c.next();
|
1327
|
+
temp_obj = *(c.var());
|
1328
|
+
}
|
1329
|
+
|
1330
|
+
smokeruby_object * p = 0;
|
1331
|
+
Data_Get_Struct(temp_obj, smokeruby_object, p);
|
1332
|
+
|
1333
|
+
smokeruby_object * o = alloc_smokeruby_object( true,
|
1334
|
+
p->smoke,
|
1335
|
+
p->classId,
|
1336
|
+
p->ptr );
|
1337
|
+
p->ptr = 0;
|
1338
|
+
p->allocated = false;
|
1339
|
+
|
1340
|
+
VALUE result = Data_Wrap_Struct(klass, smokeruby_mark, smokeruby_free, o);
|
1341
|
+
mapObject(result, result);
|
1342
|
+
// Off with a longjmp, never to return..
|
1343
|
+
rb_throw("newqt", result);
|
1344
|
+
/*NOTREACHED*/
|
1345
|
+
return self;
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
VALUE
|
1349
|
+
new_qt(int argc, VALUE * argv, VALUE klass)
|
1350
|
+
{
|
1351
|
+
VALUE * temp_stack = ALLOCA_N(VALUE, argc + 1);
|
1352
|
+
temp_stack[0] = rb_obj_alloc(klass);
|
1353
|
+
|
1354
|
+
for (int count = 0; count < argc; count++) {
|
1355
|
+
temp_stack[count+1] = argv[count];
|
1356
|
+
}
|
1357
|
+
|
1358
|
+
VALUE result = rb_funcall2(qt_internal_module, rb_intern("try_initialize"), argc+1, temp_stack);
|
1359
|
+
rb_obj_call_init(result, argc, argv);
|
1360
|
+
|
1361
|
+
return result;
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
|
1365
|
+
// Returns $qApp.ARGV() - the original ARGV array with Qt command line options removed
|
1366
|
+
static VALUE
|
1367
|
+
qapplication_argv(VALUE /*self*/)
|
1368
|
+
{
|
1369
|
+
VALUE result = rb_ary_new();
|
1370
|
+
// Drop argv[0], as it isn't included in the ruby global ARGV
|
1371
|
+
for (int index = 1; index < qApp->argc(); index++) {
|
1372
|
+
rb_ary_push(result, rb_str_new2(qApp->argv()[index]));
|
1373
|
+
}
|
1374
|
+
|
1375
|
+
return result;
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
//----------------- Sig/Slot ------------------
|
1379
|
+
|
1380
|
+
|
1381
|
+
static VALUE
|
1382
|
+
qt_signal(int argc, VALUE * argv, VALUE self)
|
1383
|
+
{
|
1384
|
+
smokeruby_object *o = value_obj_info(self);
|
1385
|
+
QObject *qobj = (QObject*)o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
1386
|
+
if (qobj->signalsBlocked()) {
|
1387
|
+
return Qfalse;
|
1388
|
+
}
|
1389
|
+
|
1390
|
+
#if RUBY_VERSION >= 0x10900
|
1391
|
+
QLatin1String signalname(rb_id2name(rb_frame_callee()));
|
1392
|
+
#else
|
1393
|
+
QLatin1String signalname(rb_id2name(rb_frame_last_func()));
|
1394
|
+
#endif
|
1395
|
+
VALUE metaObject_value = rb_funcall(qt_internal_module, rb_intern("getMetaObject"), 2, Qnil, self);
|
1396
|
+
|
1397
|
+
smokeruby_object *ometa = value_obj_info(metaObject_value);
|
1398
|
+
if (ometa == 0) {
|
1399
|
+
return Qnil;
|
1400
|
+
}
|
1401
|
+
|
1402
|
+
int i = -1;
|
1403
|
+
const QMetaObject * m = (QMetaObject*) ometa->ptr;
|
1404
|
+
for (i = m->methodCount() - 1; i > -1; i--) {
|
1405
|
+
if (m->method(i).methodType() == QMetaMethod::Signal) {
|
1406
|
+
QString name(m->method(i).signature());
|
1407
|
+
static QRegExp * rx = 0;
|
1408
|
+
if (rx == 0) {
|
1409
|
+
rx = new QRegExp("\\(.*");
|
1410
|
+
}
|
1411
|
+
name.replace(*rx, "");
|
1412
|
+
|
1413
|
+
if (name == signalname) {
|
1414
|
+
break;
|
1415
|
+
}
|
1416
|
+
}
|
1417
|
+
}
|
1418
|
+
|
1419
|
+
if (i == -1) {
|
1420
|
+
return Qnil;
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
QList<MocArgument*> args = get_moc_arguments(o->smoke, m->method(i).typeName(), m->method(i).parameterTypes());
|
1424
|
+
|
1425
|
+
VALUE result = Qnil;
|
1426
|
+
// Okay, we have the signal info. *whew*
|
1427
|
+
QtRuby::EmitSignal signal(qobj, i, argc, args, argv, &result);
|
1428
|
+
signal.next();
|
1429
|
+
|
1430
|
+
return result;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
static VALUE
|
1434
|
+
qt_metacall(int /*argc*/, VALUE * argv, VALUE self)
|
1435
|
+
{
|
1436
|
+
// Arguments: QMetaObject::Call _c, int id, void ** _o
|
1437
|
+
QMetaObject::Call _c = (QMetaObject::Call) NUM2INT( rb_funcall( qt_internal_module,
|
1438
|
+
rb_intern("get_qinteger"),
|
1439
|
+
1,
|
1440
|
+
argv[0] ) );
|
1441
|
+
int id = NUM2INT(argv[1]);
|
1442
|
+
void ** _o = 0;
|
1443
|
+
|
1444
|
+
// Note that for a slot with no args and no return type,
|
1445
|
+
// it isn't an error to get a NULL value of _o here.
|
1446
|
+
Data_Get_Struct(argv[2], void*, _o);
|
1447
|
+
// Assume the target slot is a C++ one
|
1448
|
+
smokeruby_object *o = value_obj_info(self);
|
1449
|
+
Smoke::ModuleIndex nameId = o->smoke->idMethodName("qt_metacall$$?");
|
1450
|
+
Smoke::ModuleIndex classIdx(o->smoke, o->classId);
|
1451
|
+
Smoke::ModuleIndex meth = nameId.smoke->findMethod(classIdx, nameId);
|
1452
|
+
if (meth.index > 0) {
|
1453
|
+
const Smoke::Method &m = meth.smoke->methods[meth.smoke->methodMaps[meth.index].method];
|
1454
|
+
Smoke::ClassFn fn = meth.smoke->classes[m.classId].classFn;
|
1455
|
+
Smoke::StackItem i[4];
|
1456
|
+
i[1].s_enum = _c;
|
1457
|
+
i[2].s_int = id;
|
1458
|
+
i[3].s_voidp = _o;
|
1459
|
+
(*fn)(m.method, o->ptr, i);
|
1460
|
+
int ret = i[0].s_int;
|
1461
|
+
if (ret < 0) {
|
1462
|
+
return INT2NUM(ret);
|
1463
|
+
}
|
1464
|
+
} else {
|
1465
|
+
// Should never happen..
|
1466
|
+
rb_raise(rb_eRuntimeError, "Cannot find %s::qt_metacall() method\n",
|
1467
|
+
o->smoke->classes[o->classId].className );
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
if (_c != QMetaObject::InvokeMetaMethod) {
|
1471
|
+
return argv[1];
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
QObject * qobj = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
1475
|
+
// get obj metaobject with a virtual call
|
1476
|
+
const QMetaObject *metaobject = qobj->metaObject();
|
1477
|
+
|
1478
|
+
// get method/property count
|
1479
|
+
int count = 0;
|
1480
|
+
if (_c == QMetaObject::InvokeMetaMethod) {
|
1481
|
+
count = metaobject->methodCount();
|
1482
|
+
} else {
|
1483
|
+
count = metaobject->propertyCount();
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
if (_c == QMetaObject::InvokeMetaMethod) {
|
1487
|
+
QMetaMethod method = metaobject->method(id);
|
1488
|
+
|
1489
|
+
if (method.methodType() == QMetaMethod::Signal) {
|
1490
|
+
metaobject->activate(qobj, id, (void**) _o);
|
1491
|
+
return INT2NUM(id - count);
|
1492
|
+
}
|
1493
|
+
|
1494
|
+
QList<MocArgument*> mocArgs = get_moc_arguments(o->smoke, method.typeName(), method.parameterTypes());
|
1495
|
+
|
1496
|
+
QString name(method.signature());
|
1497
|
+
static QRegExp * rx = 0;
|
1498
|
+
if (rx == 0) {
|
1499
|
+
rx = new QRegExp("\\(.*");
|
1500
|
+
}
|
1501
|
+
name.replace(*rx, "");
|
1502
|
+
QtRuby::InvokeSlot slot(self, rb_intern(name.toLatin1()), mocArgs, _o);
|
1503
|
+
slot.next();
|
1504
|
+
}
|
1505
|
+
|
1506
|
+
return INT2NUM(id - count);
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
static VALUE
|
1510
|
+
qobject_connect(int argc, VALUE * argv, VALUE self)
|
1511
|
+
{
|
1512
|
+
if (rb_block_given_p()) {
|
1513
|
+
if (argc == 1) {
|
1514
|
+
return rb_funcall(qt_internal_module, rb_intern("signal_connect"), 3, self, argv[0], rb_block_proc());
|
1515
|
+
} else if (argc == 2) {
|
1516
|
+
return rb_funcall(qt_internal_module, rb_intern("connect"), 4, argv[0], argv[1], self, rb_block_proc());
|
1517
|
+
} else if (argc == 3) {
|
1518
|
+
return rb_funcall(qt_internal_module, rb_intern("connect"), 4, argv[0], argv[1], argv[2], rb_block_proc());
|
1519
|
+
} else {
|
1520
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
1521
|
+
}
|
1522
|
+
} else {
|
1523
|
+
if (argc == 3 && TYPE(argv[1]) != T_STRING) {
|
1524
|
+
return rb_funcall(qt_internal_module, rb_intern("method_connect"), 4, self, argv[0], argv[1], argv[2]);
|
1525
|
+
} else {
|
1526
|
+
return rb_call_super(argc, argv);
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
static VALUE
|
1532
|
+
qtimer_single_shot(int argc, VALUE * argv, VALUE /*self*/)
|
1533
|
+
{
|
1534
|
+
if (rb_block_given_p()) {
|
1535
|
+
if (argc == 2) {
|
1536
|
+
return rb_funcall(qt_internal_module, rb_intern("single_shot_timer_connect"), 3, argv[0], argv[1], rb_block_proc());
|
1537
|
+
} else {
|
1538
|
+
rb_raise(rb_eArgError, "Invalid argument list");
|
1539
|
+
}
|
1540
|
+
} else {
|
1541
|
+
return rb_call_super(argc, argv);
|
1542
|
+
}
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
// --------------- Ruby C functions for Qt::_internal.* helpers ----------------
|
1546
|
+
|
1547
|
+
|
1548
|
+
static VALUE
|
1549
|
+
getMethStat(VALUE /*self*/)
|
1550
|
+
{
|
1551
|
+
VALUE result_list = rb_ary_new();
|
1552
|
+
rb_ary_push(result_list, INT2NUM((int)methcache.size()));
|
1553
|
+
rb_ary_push(result_list, INT2NUM((int)methcache.count()));
|
1554
|
+
return result_list;
|
1555
|
+
}
|
1556
|
+
|
1557
|
+
static VALUE
|
1558
|
+
getClassStat(VALUE /*self*/)
|
1559
|
+
{
|
1560
|
+
VALUE result_list = rb_ary_new();
|
1561
|
+
rb_ary_push(result_list, INT2NUM((int)classcache.size()));
|
1562
|
+
rb_ary_push(result_list, INT2NUM((int)classcache.count()));
|
1563
|
+
return result_list;
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
static VALUE
|
1567
|
+
getIsa(VALUE /*self*/, VALUE classId)
|
1568
|
+
{
|
1569
|
+
VALUE parents_list = rb_ary_new();
|
1570
|
+
|
1571
|
+
int id = NUM2INT(rb_funcall(classId, rb_intern("index"), 0));
|
1572
|
+
Smoke* smoke = smokeList[NUM2INT(rb_funcall(classId, rb_intern("smoke"), 0))];
|
1573
|
+
|
1574
|
+
Smoke::Index *parents =
|
1575
|
+
smoke->inheritanceList +
|
1576
|
+
smoke->classes[id].parents;
|
1577
|
+
|
1578
|
+
while(*parents) {
|
1579
|
+
//logger("\tparent: %s", qtcore_Smoke->classes[*parents].className);
|
1580
|
+
rb_ary_push(parents_list, rb_str_new2(smoke->classes[*parents++].className));
|
1581
|
+
}
|
1582
|
+
return parents_list;
|
1583
|
+
}
|
1584
|
+
|
1585
|
+
// Return the class name of a QObject. Note that the name will be in the
|
1586
|
+
// form of Qt::Widget rather than QWidget. Is this a bug or a feature?
|
1587
|
+
static VALUE
|
1588
|
+
class_name(VALUE self)
|
1589
|
+
{
|
1590
|
+
VALUE klass = rb_funcall(self, rb_intern("class"), 0);
|
1591
|
+
return rb_funcall(klass, rb_intern("name"), 0);
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
// Allow classnames in both 'Qt::Widget' and 'QWidget' formats to be
|
1595
|
+
// used as an argument to Qt::Object.inherits()
|
1596
|
+
static VALUE
|
1597
|
+
inherits_qobject(int argc, VALUE * argv, VALUE /*self*/)
|
1598
|
+
{
|
1599
|
+
if (argc != 1) {
|
1600
|
+
return rb_call_super(argc, argv);
|
1601
|
+
}
|
1602
|
+
|
1603
|
+
Smoke::ModuleIndex * classId = classcache.value(StringValuePtr(argv[0]));
|
1604
|
+
|
1605
|
+
if (classId == 0) {
|
1606
|
+
return rb_call_super(argc, argv);
|
1607
|
+
} else {
|
1608
|
+
VALUE super_class = rb_str_new2(classId->smoke->classes[classId->index].className);
|
1609
|
+
return rb_call_super(argc, &super_class);
|
1610
|
+
}
|
1611
|
+
}
|
1612
|
+
|
1613
|
+
/* Adapted from the internal function qt_qFindChildren() in qobject.cpp */
|
1614
|
+
static void
|
1615
|
+
rb_qFindChildren_helper(VALUE parent, const QString &name, VALUE re,
|
1616
|
+
const QMetaObject &mo, VALUE list)
|
1617
|
+
{
|
1618
|
+
if (parent == Qnil || list == Qnil)
|
1619
|
+
return;
|
1620
|
+
VALUE children = rb_funcall(parent, rb_intern("children"), 0);
|
1621
|
+
VALUE rv = Qnil;
|
1622
|
+
for (int i = 0; i < RARRAY_LEN(children); ++i) {
|
1623
|
+
rv = RARRAY_PTR(children)[i];
|
1624
|
+
smokeruby_object *o = value_obj_info(rv);
|
1625
|
+
QObject * obj = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
1626
|
+
|
1627
|
+
// The original code had 'if (mo.cast(obj))' as a test, but it doesn't work here
|
1628
|
+
if (obj->qt_metacast(mo.className()) != 0) {
|
1629
|
+
if (re != Qnil) {
|
1630
|
+
VALUE re_test = rb_funcall(re, rb_intern("=~"), 1, rb_funcall(rv, rb_intern("objectName"), 0));
|
1631
|
+
if (re_test != Qnil && re_test != Qfalse) {
|
1632
|
+
rb_ary_push(list, rv);
|
1633
|
+
}
|
1634
|
+
} else {
|
1635
|
+
if (name.isNull() || obj->objectName() == name) {
|
1636
|
+
rb_ary_push(list, rv);
|
1637
|
+
}
|
1638
|
+
}
|
1639
|
+
}
|
1640
|
+
rb_qFindChildren_helper(rv, name, re, mo, list);
|
1641
|
+
}
|
1642
|
+
return;
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
/* Should mimic Qt4's QObject::findChildren method with this syntax:
|
1646
|
+
obj.findChildren(Qt::Widget, "Optional Widget Name")
|
1647
|
+
*/
|
1648
|
+
static VALUE
|
1649
|
+
find_qobject_children(int argc, VALUE *argv, VALUE self)
|
1650
|
+
{
|
1651
|
+
if (argc < 1 || argc > 2) rb_raise(rb_eArgError, "Invalid argument list");
|
1652
|
+
Check_Type(argv[0], T_CLASS);
|
1653
|
+
|
1654
|
+
QString name;
|
1655
|
+
VALUE re = Qnil;
|
1656
|
+
if (argc == 2) {
|
1657
|
+
// If the second arg isn't a String, assume it's a regular expression
|
1658
|
+
if (TYPE(argv[1]) == T_STRING) {
|
1659
|
+
name = QString::fromLatin1(StringValuePtr(argv[1]));
|
1660
|
+
} else {
|
1661
|
+
re = argv[1];
|
1662
|
+
}
|
1663
|
+
}
|
1664
|
+
|
1665
|
+
VALUE metaObject = rb_funcall(argv[0], rb_intern("staticMetaObject"), 0);
|
1666
|
+
smokeruby_object *o = value_obj_info(metaObject);
|
1667
|
+
QMetaObject * mo = (QMetaObject*) o->ptr;
|
1668
|
+
VALUE result = rb_ary_new();
|
1669
|
+
rb_qFindChildren_helper(self, name, re, *mo, result);
|
1670
|
+
return result;
|
1671
|
+
}
|
1672
|
+
|
1673
|
+
/* Adapted from the internal function qt_qFindChild() in qobject.cpp */
|
1674
|
+
static VALUE
|
1675
|
+
rb_qFindChild_helper(VALUE parent, const QString &name, const QMetaObject &mo)
|
1676
|
+
{
|
1677
|
+
if (parent == Qnil)
|
1678
|
+
return Qnil;
|
1679
|
+
VALUE children = rb_funcall(parent, rb_intern("children"), 0);
|
1680
|
+
VALUE rv;
|
1681
|
+
int i;
|
1682
|
+
for (i = 0; i < RARRAY_LEN(children); ++i) {
|
1683
|
+
rv = RARRAY_PTR(children)[i];
|
1684
|
+
smokeruby_object *o = value_obj_info(rv);
|
1685
|
+
QObject * obj = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
|
1686
|
+
if (obj->qt_metacast(mo.className()) != 0 && (name.isNull() || obj->objectName() == name))
|
1687
|
+
return rv;
|
1688
|
+
}
|
1689
|
+
for (i = 0; i < RARRAY_LEN(children); ++i) {
|
1690
|
+
rv = rb_qFindChild_helper(RARRAY_PTR(children)[i], name, mo);
|
1691
|
+
if (rv != Qnil)
|
1692
|
+
return rv;
|
1693
|
+
}
|
1694
|
+
return Qnil;
|
1695
|
+
}
|
1696
|
+
|
1697
|
+
static VALUE
|
1698
|
+
find_qobject_child(int argc, VALUE *argv, VALUE self)
|
1699
|
+
{
|
1700
|
+
if (argc < 1 || argc > 2) rb_raise(rb_eArgError, "Invalid argument list");
|
1701
|
+
Check_Type(argv[0], T_CLASS);
|
1702
|
+
|
1703
|
+
QString name;
|
1704
|
+
if (argc == 2) {
|
1705
|
+
name = QString::fromLatin1(StringValuePtr(argv[1]));
|
1706
|
+
}
|
1707
|
+
|
1708
|
+
VALUE metaObject = rb_funcall(argv[0], rb_intern("staticMetaObject"), 0);
|
1709
|
+
smokeruby_object *o = value_obj_info(metaObject);
|
1710
|
+
QMetaObject * mo = (QMetaObject*) o->ptr;
|
1711
|
+
return rb_qFindChild_helper(self, name, *mo);
|
1712
|
+
}
|
1713
|
+
|
1714
|
+
static VALUE
|
1715
|
+
setDebug(VALUE self, VALUE on_value)
|
1716
|
+
{
|
1717
|
+
int on = NUM2INT(on_value);
|
1718
|
+
do_debug = on;
|
1719
|
+
return self;
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
static VALUE
|
1723
|
+
debugging(VALUE /*self*/)
|
1724
|
+
{
|
1725
|
+
return INT2NUM(do_debug);
|
1726
|
+
}
|
1727
|
+
|
1728
|
+
static VALUE
|
1729
|
+
get_arg_type_name(VALUE /*self*/, VALUE method_value, VALUE idx_value)
|
1730
|
+
{
|
1731
|
+
int method = NUM2INT(rb_funcall(method_value, rb_intern("index"), 0));
|
1732
|
+
int smokeIndex = NUM2INT(rb_funcall(method_value, rb_intern("smoke"), 0));
|
1733
|
+
Smoke * smoke = smokeList[smokeIndex];
|
1734
|
+
int idx = NUM2INT(idx_value);
|
1735
|
+
const Smoke::Method &m = smoke->methods[method];
|
1736
|
+
Smoke::Index *args = smoke->argumentList + m.args;
|
1737
|
+
return rb_str_new2((char*)smoke->types[args[idx]].name);
|
1738
|
+
}
|
1739
|
+
|
1740
|
+
static VALUE
|
1741
|
+
classIsa(VALUE /*self*/, VALUE className_value, VALUE base_value)
|
1742
|
+
{
|
1743
|
+
char *className = StringValuePtr(className_value);
|
1744
|
+
char *base = StringValuePtr(base_value);
|
1745
|
+
return Smoke::isDerivedFrom(className, base) ? Qtrue : Qfalse;
|
1746
|
+
}
|
1747
|
+
|
1748
|
+
static VALUE
|
1749
|
+
isEnum(VALUE /*self*/, VALUE enumName_value)
|
1750
|
+
{
|
1751
|
+
char *enumName = StringValuePtr(enumName_value);
|
1752
|
+
Smoke::Index typeId = 0;
|
1753
|
+
Smoke* s = 0;
|
1754
|
+
for (int i = 0; i < smokeList.count(); i++) {
|
1755
|
+
typeId = smokeList[i]->idType(enumName);
|
1756
|
+
if (typeId > 0) {
|
1757
|
+
s = smokeList[i];
|
1758
|
+
break;
|
1759
|
+
}
|
1760
|
+
}
|
1761
|
+
return typeId > 0
|
1762
|
+
&& ( (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_enum
|
1763
|
+
|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_ulong
|
1764
|
+
|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_long
|
1765
|
+
|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_uint
|
1766
|
+
|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_int ) ? Qtrue : Qfalse;
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
static VALUE
|
1770
|
+
insert_pclassid(VALUE self, VALUE p_value, VALUE mi_value)
|
1771
|
+
{
|
1772
|
+
char *p = StringValuePtr(p_value);
|
1773
|
+
int ix = NUM2INT(rb_funcall(mi_value, rb_intern("index"), 0));
|
1774
|
+
int smokeidx = NUM2INT(rb_funcall(mi_value, rb_intern("smoke"), 0));
|
1775
|
+
Smoke::ModuleIndex mi(smokeList[smokeidx], ix);
|
1776
|
+
classcache.insert(QByteArray(p), new Smoke::ModuleIndex(mi));
|
1777
|
+
IdToClassNameMap.insert(mi, new QByteArray(p));
|
1778
|
+
return self;
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
static VALUE
|
1782
|
+
classid2name(VALUE /*self*/, VALUE mi_value)
|
1783
|
+
{
|
1784
|
+
int ix = NUM2INT(rb_funcall(mi_value, rb_intern("index"), 0));
|
1785
|
+
int smokeidx = NUM2INT(rb_funcall(mi_value, rb_intern("smoke"), 0));
|
1786
|
+
Smoke::ModuleIndex mi(smokeList[smokeidx], ix);
|
1787
|
+
return rb_str_new2(IdToClassNameMap[mi]->constData());
|
1788
|
+
}
|
1789
|
+
|
1790
|
+
static VALUE
|
1791
|
+
find_pclassid(VALUE /*self*/, VALUE p_value)
|
1792
|
+
{
|
1793
|
+
char *p = StringValuePtr(p_value);
|
1794
|
+
Smoke::ModuleIndex *r = classcache.value(QByteArray(p));
|
1795
|
+
if (r != 0) {
|
1796
|
+
return rb_funcall(moduleindex_class, rb_intern("new"), 2, INT2NUM(smokeList.indexOf(r->smoke)), INT2NUM(r->index));
|
1797
|
+
} else {
|
1798
|
+
return rb_funcall(moduleindex_class, rb_intern("new"), 2, 0, 0);
|
1799
|
+
}
|
1800
|
+
}
|
1801
|
+
|
1802
|
+
static VALUE
|
1803
|
+
get_value_type(VALUE /*self*/, VALUE ruby_value)
|
1804
|
+
{
|
1805
|
+
return rb_str_new2(value_to_type_flag(ruby_value));
|
1806
|
+
}
|
1807
|
+
|
1808
|
+
static QMetaObject*
|
1809
|
+
parent_meta_object(VALUE obj)
|
1810
|
+
{
|
1811
|
+
smokeruby_object* o = value_obj_info(obj);
|
1812
|
+
Smoke::ModuleIndex nameId = o->smoke->idMethodName("metaObject");
|
1813
|
+
Smoke::ModuleIndex classIdx(o->smoke, o->classId);
|
1814
|
+
Smoke::ModuleIndex meth = o->smoke->findMethod(classIdx, nameId);
|
1815
|
+
if (meth.index <= 0) {
|
1816
|
+
// Should never happen..
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
const Smoke::Method &methodId = meth.smoke->methods[meth.smoke->methodMaps[meth.index].method];
|
1820
|
+
Smoke::ClassFn fn = o->smoke->classes[methodId.classId].classFn;
|
1821
|
+
Smoke::StackItem i[1];
|
1822
|
+
(*fn)(methodId.method, o->ptr, i);
|
1823
|
+
return (QMetaObject*) i[0].s_voidp;
|
1824
|
+
}
|
1825
|
+
|
1826
|
+
static VALUE
|
1827
|
+
make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_value, VALUE data_value)
|
1828
|
+
{
|
1829
|
+
QMetaObject* superdata = 0;
|
1830
|
+
|
1831
|
+
if (parentMeta == Qnil) {
|
1832
|
+
// The parent class is a Smoke class, so call metaObject() on the
|
1833
|
+
// instance to get it via a smoke library call
|
1834
|
+
superdata = parent_meta_object(obj);
|
1835
|
+
} else {
|
1836
|
+
// The parent class is a custom Ruby class whose metaObject
|
1837
|
+
// was constructed at runtime
|
1838
|
+
smokeruby_object* p = value_obj_info(parentMeta);
|
1839
|
+
superdata = (QMetaObject *) p->ptr;
|
1840
|
+
}
|
1841
|
+
|
1842
|
+
char *stringdata = new char[RSTRING_LEN(stringdata_value)];
|
1843
|
+
|
1844
|
+
int count = RARRAY_LEN(data_value);
|
1845
|
+
uint * data = new uint[count];
|
1846
|
+
|
1847
|
+
memcpy( (void *) stringdata, RSTRING_PTR(stringdata_value), RSTRING_LEN(stringdata_value) );
|
1848
|
+
|
1849
|
+
for (long i = 0; i < count; i++) {
|
1850
|
+
VALUE rv = rb_ary_entry(data_value, i);
|
1851
|
+
data[i] = NUM2UINT(rv);
|
1852
|
+
}
|
1853
|
+
|
1854
|
+
QMetaObject ob = {
|
1855
|
+
{ superdata, stringdata, data, 0 }
|
1856
|
+
} ;
|
1857
|
+
|
1858
|
+
QMetaObject * meta = new QMetaObject;
|
1859
|
+
*meta = ob;
|
1860
|
+
|
1861
|
+
#ifdef DEBUG
|
1862
|
+
printf("make_metaObject() superdata: %p %s\n", meta->d.superdata, superdata->className());
|
1863
|
+
|
1864
|
+
printf(
|
1865
|
+
" // content:\n"
|
1866
|
+
" %d, // revision\n"
|
1867
|
+
" %d, // classname\n"
|
1868
|
+
" %d, %d, // classinfo\n"
|
1869
|
+
" %d, %d, // methods\n"
|
1870
|
+
" %d, %d, // properties\n"
|
1871
|
+
" %d, %d, // enums/sets\n",
|
1872
|
+
data[0], data[1], data[2], data[3],
|
1873
|
+
data[4], data[5], data[6], data[7], data[8], data[9]);
|
1874
|
+
|
1875
|
+
int s = data[3];
|
1876
|
+
|
1877
|
+
if (data[2] > 0) {
|
1878
|
+
printf("\n // classinfo: key, value\n");
|
1879
|
+
for (uint j = 0; j < data[2]; j++) {
|
1880
|
+
printf(" %d, %d\n", data[s + (j * 2)], data[s + (j * 2) + 1]);
|
1881
|
+
}
|
1882
|
+
}
|
1883
|
+
|
1884
|
+
s = data[5];
|
1885
|
+
bool signal_headings = true;
|
1886
|
+
bool slot_headings = true;
|
1887
|
+
|
1888
|
+
for (uint j = 0; j < data[4]; j++) {
|
1889
|
+
if (signal_headings && (data[s + (j * 5) + 4] & 0x04) != 0) {
|
1890
|
+
printf("\n // signals: signature, parameters, type, tag, flags\n");
|
1891
|
+
signal_headings = false;
|
1892
|
+
}
|
1893
|
+
|
1894
|
+
if (slot_headings && (data[s + (j * 5) + 4] & 0x08) != 0) {
|
1895
|
+
printf("\n // slots: signature, parameters, type, tag, flags\n");
|
1896
|
+
slot_headings = false;
|
1897
|
+
}
|
1898
|
+
|
1899
|
+
printf(" %d, %d, %d, %d, 0x%2.2x\n",
|
1900
|
+
data[s + (j * 5)], data[s + (j * 5) + 1], data[s + (j * 5) + 2],
|
1901
|
+
data[s + (j * 5) + 3], data[s + (j * 5) + 4]);
|
1902
|
+
}
|
1903
|
+
|
1904
|
+
s += (data[4] * 5);
|
1905
|
+
for (uint j = 0; j < data[6]; j++) {
|
1906
|
+
printf("\n // properties: name, type, flags\n");
|
1907
|
+
printf(" %d, %d, 0x%8.8x\n",
|
1908
|
+
data[s + (j * 3)], data[s + (j * 3) + 1], data[s + (j * 3) + 2]);
|
1909
|
+
}
|
1910
|
+
|
1911
|
+
s += (data[6] * 3);
|
1912
|
+
for (int i = s; i < count; i++) {
|
1913
|
+
printf("\n %d // eod\n", data[i]);
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
printf("\nqt_meta_stringdata:\n \"");
|
1917
|
+
|
1918
|
+
int strlength = 0;
|
1919
|
+
for (int j = 0; j < RSTRING_LEN(stringdata_value); j++) {
|
1920
|
+
strlength++;
|
1921
|
+
if (meta->d.stringdata[j] == 0) {
|
1922
|
+
printf("\\0");
|
1923
|
+
if (strlength > 40) {
|
1924
|
+
printf("\"\n \"");
|
1925
|
+
strlength = 0;
|
1926
|
+
}
|
1927
|
+
} else {
|
1928
|
+
printf("%c", meta->d.stringdata[j]);
|
1929
|
+
}
|
1930
|
+
}
|
1931
|
+
printf("\"\n\n");
|
1932
|
+
|
1933
|
+
#endif
|
1934
|
+
smokeruby_object * m = alloc_smokeruby_object( true,
|
1935
|
+
qtcore_Smoke,
|
1936
|
+
qtcore_Smoke->idClass("QMetaObject").index,
|
1937
|
+
meta );
|
1938
|
+
|
1939
|
+
return Data_Wrap_Struct(qmetaobject_class, smokeruby_mark, smokeruby_free, m);
|
1940
|
+
}
|
1941
|
+
|
1942
|
+
static VALUE
|
1943
|
+
add_metaobject_methods(VALUE self, VALUE klass)
|
1944
|
+
{
|
1945
|
+
rb_define_method(klass, "qt_metacall", (VALUE (*) (...)) qt_metacall, -1);
|
1946
|
+
rb_define_method(klass, "metaObject", (VALUE (*) (...)) metaObject, 0);
|
1947
|
+
return self;
|
1948
|
+
}
|
1949
|
+
|
1950
|
+
static VALUE
|
1951
|
+
add_signal_methods(VALUE self, VALUE klass, VALUE signalNames)
|
1952
|
+
{
|
1953
|
+
for (long index = 0; index < RARRAY_LEN(signalNames); index++) {
|
1954
|
+
VALUE signal = rb_ary_entry(signalNames, index);
|
1955
|
+
rb_define_method(klass, StringValuePtr(signal), (VALUE (*) (...)) qt_signal, -1);
|
1956
|
+
}
|
1957
|
+
return self;
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
static VALUE
|
1961
|
+
dispose(VALUE self)
|
1962
|
+
{
|
1963
|
+
smokeruby_object *o = value_obj_info(self);
|
1964
|
+
if (o == 0 || o->ptr == 0) { return Qnil; }
|
1965
|
+
|
1966
|
+
const char *className = o->smoke->classes[o->classId].className;
|
1967
|
+
if(do_debug & qtdb_gc) printf("Deleting (%s*)%p\n", className, o->ptr);
|
1968
|
+
|
1969
|
+
unmapPointer(o, o->classId, 0);
|
1970
|
+
object_count--;
|
1971
|
+
|
1972
|
+
char *methodName = new char[strlen(className) + 2];
|
1973
|
+
methodName[0] = '~';
|
1974
|
+
strcpy(methodName + 1, className);
|
1975
|
+
Smoke::ModuleIndex nameId = o->smoke->findMethodName(className, methodName);
|
1976
|
+
Smoke::ModuleIndex classIdx(o->smoke, o->classId);
|
1977
|
+
Smoke::ModuleIndex meth = nameId.smoke->findMethod(classIdx, nameId);
|
1978
|
+
if(meth.index > 0) {
|
1979
|
+
const Smoke::Method &m = meth.smoke->methods[meth.smoke->methodMaps[meth.index].method];
|
1980
|
+
Smoke::ClassFn fn = meth.smoke->classes[m.classId].classFn;
|
1981
|
+
Smoke::StackItem i[1];
|
1982
|
+
(*fn)(m.method, o->ptr, i);
|
1983
|
+
}
|
1984
|
+
delete[] methodName;
|
1985
|
+
o->ptr = 0;
|
1986
|
+
o->allocated = false;
|
1987
|
+
|
1988
|
+
return Qnil;
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
static VALUE
|
1992
|
+
is_disposed(VALUE self)
|
1993
|
+
{
|
1994
|
+
smokeruby_object *o = value_obj_info(self);
|
1995
|
+
return (o != 0 && o->ptr != 0) ? Qfalse : Qtrue;
|
1996
|
+
}
|
1997
|
+
|
1998
|
+
VALUE
|
1999
|
+
isQObject(VALUE /*self*/, VALUE c)
|
2000
|
+
{
|
2001
|
+
return Smoke::isDerivedFrom(StringValuePtr(c), "QObject");
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
// Returns the Smoke classId of a ruby instance
|
2005
|
+
static VALUE
|
2006
|
+
idInstance(VALUE /*self*/, VALUE instance)
|
2007
|
+
{
|
2008
|
+
smokeruby_object *o = value_obj_info(instance);
|
2009
|
+
if(!o)
|
2010
|
+
return Qnil;
|
2011
|
+
|
2012
|
+
return rb_funcall(moduleindex_class, rb_intern("new"), 2, INT2NUM(smokeList.indexOf(o->smoke)), INT2NUM(o->classId));
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
static VALUE
|
2016
|
+
findClass(VALUE /*self*/, VALUE name_value)
|
2017
|
+
{
|
2018
|
+
char *name = StringValuePtr(name_value);
|
2019
|
+
Smoke::ModuleIndex mi = Smoke::findClass(name);
|
2020
|
+
return rb_funcall(moduleindex_class, rb_intern("new"), 2, INT2NUM(smokeList.indexOf(mi.smoke)), INT2NUM(mi.index));
|
2021
|
+
}
|
2022
|
+
|
2023
|
+
// static VALUE
|
2024
|
+
// idMethodName(VALUE /*self*/, VALUE name_value)
|
2025
|
+
// {
|
2026
|
+
// char *name = StringValuePtr(name_value);
|
2027
|
+
// return INT2NUM(qtcore_Smoke->idMethodName(name).index);
|
2028
|
+
// }
|
2029
|
+
//
|
2030
|
+
// static VALUE
|
2031
|
+
// idMethod(VALUE /*self*/, VALUE idclass_value, VALUE idmethodname_value)
|
2032
|
+
// {
|
2033
|
+
// int idclass = NUM2INT(idclass_value);
|
2034
|
+
// int idmethodname = NUM2INT(idmethodname_value);
|
2035
|
+
// return INT2NUM(qtcore_Smoke->idMethod(idclass, idmethodname).index);
|
2036
|
+
// }
|
2037
|
+
|
2038
|
+
static VALUE
|
2039
|
+
dumpCandidates(VALUE /*self*/, VALUE rmeths)
|
2040
|
+
{
|
2041
|
+
VALUE errmsg = rb_str_new2("");
|
2042
|
+
if(rmeths != Qnil) {
|
2043
|
+
int count = RARRAY_LEN(rmeths);
|
2044
|
+
for(int i = 0; i < count; i++) {
|
2045
|
+
rb_str_catf(errmsg, "\t");
|
2046
|
+
int id = NUM2INT(rb_funcall(rb_ary_entry(rmeths, i), rb_intern("index"), 0));
|
2047
|
+
Smoke* smoke = smokeList[NUM2INT(rb_funcall(rb_ary_entry(rmeths, i), rb_intern("smoke"), 0))];
|
2048
|
+
const Smoke::Method &meth = smoke->methods[id];
|
2049
|
+
const char *tname = smoke->types[meth.ret].name;
|
2050
|
+
if(meth.flags & Smoke::mf_enum) {
|
2051
|
+
rb_str_catf(errmsg, "enum ");
|
2052
|
+
rb_str_catf(errmsg, "%s::%s", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
|
2053
|
+
rb_str_catf(errmsg, "\n");
|
2054
|
+
} else {
|
2055
|
+
if(meth.flags & Smoke::mf_static) rb_str_catf(errmsg, "static ");
|
2056
|
+
rb_str_catf(errmsg, "%s ", (tname ? tname:"void"));
|
2057
|
+
rb_str_catf(errmsg, "%s::%s(", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
|
2058
|
+
for(int i = 0; i < meth.numArgs; i++) {
|
2059
|
+
if(i) rb_str_catf(errmsg, ", ");
|
2060
|
+
tname = smoke->types[smoke->argumentList[meth.args+i]].name;
|
2061
|
+
rb_str_catf(errmsg, "%s", (tname ? tname:"void"));
|
2062
|
+
}
|
2063
|
+
rb_str_catf(errmsg, ")");
|
2064
|
+
if(meth.flags & Smoke::mf_const) rb_str_catf(errmsg, " const");
|
2065
|
+
rb_str_catf(errmsg, "\n");
|
2066
|
+
}
|
2067
|
+
}
|
2068
|
+
}
|
2069
|
+
return errmsg;
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
static VALUE
|
2073
|
+
isConstMethod(VALUE /*self*/, VALUE idx)
|
2074
|
+
{
|
2075
|
+
int id = NUM2INT(rb_funcall(idx, rb_intern("index"), 0));
|
2076
|
+
Smoke* smoke = smokeList[NUM2INT(rb_funcall(idx, rb_intern("smoke"), 0))];
|
2077
|
+
const Smoke::Method &meth = smoke->methods[id];
|
2078
|
+
return (meth.flags & Smoke::mf_const) ? Qtrue : Qfalse;
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
static VALUE
|
2082
|
+
isObject(VALUE /*self*/, VALUE obj)
|
2083
|
+
{
|
2084
|
+
void * ptr = 0;
|
2085
|
+
ptr = value_to_ptr(obj);
|
2086
|
+
return (ptr > 0 ? Qtrue : Qfalse);
|
2087
|
+
}
|
2088
|
+
|
2089
|
+
static VALUE
|
2090
|
+
setCurrentMethod(VALUE self, VALUE meth_value)
|
2091
|
+
{
|
2092
|
+
int smokeidx = NUM2INT(rb_funcall(meth_value, rb_intern("smoke"), 0));
|
2093
|
+
int meth = NUM2INT(rb_funcall(meth_value, rb_intern("index"), 0));
|
2094
|
+
// FIXME: damn, this is lame, and it doesn't handle ambiguous methods
|
2095
|
+
_current_method.smoke = smokeList[smokeidx]; //qtcore_Smoke->methodMaps[meth].method;
|
2096
|
+
_current_method.index = meth;
|
2097
|
+
return self;
|
2098
|
+
}
|
2099
|
+
|
2100
|
+
static VALUE
|
2101
|
+
getClassList(VALUE /*self*/)
|
2102
|
+
{
|
2103
|
+
VALUE class_list = rb_ary_new();
|
2104
|
+
|
2105
|
+
for (int i = 1; i <= qtcore_Smoke->numClasses; i++) {
|
2106
|
+
if (qtcore_Smoke->classes[i].className && !qtcore_Smoke->classes[i].external)
|
2107
|
+
rb_ary_push(class_list, rb_str_new2(qtcore_Smoke->classes[i].className));
|
2108
|
+
}
|
2109
|
+
|
2110
|
+
for (int i = 1; i <= qtgui_Smoke->numClasses; i++) {
|
2111
|
+
if (qtgui_Smoke->classes[i].className && !qtgui_Smoke->classes[i].external)
|
2112
|
+
rb_ary_push(class_list, rb_str_new2(qtgui_Smoke->classes[i].className));
|
2113
|
+
}
|
2114
|
+
|
2115
|
+
for (int i = 1; i <= qtxml_Smoke->numClasses; i++) {
|
2116
|
+
if (qtxml_Smoke->classes[i].className && !qtxml_Smoke->classes[i].external)
|
2117
|
+
rb_ary_push(class_list, rb_str_new2(qtxml_Smoke->classes[i].className));
|
2118
|
+
}
|
2119
|
+
|
2120
|
+
for (int i = 1; i <= qtsql_Smoke->numClasses; i++) {
|
2121
|
+
if (qtsql_Smoke->classes[i].className && !qtsql_Smoke->classes[i].external)
|
2122
|
+
rb_ary_push(class_list, rb_str_new2(qtsql_Smoke->classes[i].className));
|
2123
|
+
}
|
2124
|
+
|
2125
|
+
for (int i = 1; i <= qtopengl_Smoke->numClasses; i++) {
|
2126
|
+
if (qtopengl_Smoke->classes[i].className && !qtopengl_Smoke->classes[i].external)
|
2127
|
+
rb_ary_push(class_list, rb_str_new2(qtopengl_Smoke->classes[i].className));
|
2128
|
+
}
|
2129
|
+
|
2130
|
+
for (int i = 1; i <= qtnetwork_Smoke->numClasses; i++) {
|
2131
|
+
if (qtnetwork_Smoke->classes[i].className && !qtnetwork_Smoke->classes[i].external)
|
2132
|
+
rb_ary_push(class_list, rb_str_new2(qtnetwork_Smoke->classes[i].className));
|
2133
|
+
}
|
2134
|
+
|
2135
|
+
for (int i = 1; i <= qtsvg_Smoke->numClasses; i++) {
|
2136
|
+
if (qtsvg_Smoke->classes[i].className && !qtsvg_Smoke->classes[i].external)
|
2137
|
+
rb_ary_push(class_list, rb_str_new2(qtsvg_Smoke->classes[i].className));
|
2138
|
+
}
|
2139
|
+
|
2140
|
+
#ifdef QT_QTDBUS
|
2141
|
+
for (int i = 1; i <= qtdbus_Smoke->numClasses; i++) {
|
2142
|
+
if (qtdbus_Smoke->classes[i].className && !qtdbus_Smoke->classes[i].external)
|
2143
|
+
rb_ary_push(class_list, rb_str_new2(qtdbus_Smoke->classes[i].className));
|
2144
|
+
}
|
2145
|
+
#endif
|
2146
|
+
|
2147
|
+
return class_list;
|
2148
|
+
}
|
2149
|
+
|
2150
|
+
static VALUE
|
2151
|
+
create_qobject_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
|
2152
|
+
{
|
2153
|
+
const char *package = strdup(StringValuePtr(package_value));
|
2154
|
+
// this won't work:
|
2155
|
+
// strdup(StringValuePtr(rb_funcall(module_value, rb_intern("name"), 0)))
|
2156
|
+
// any ideas why?
|
2157
|
+
VALUE value_moduleName = rb_funcall(module_value, rb_intern("name"), 0);
|
2158
|
+
const char *moduleName = strdup(StringValuePtr(value_moduleName));
|
2159
|
+
VALUE klass = module_value;
|
2160
|
+
|
2161
|
+
QString packageName(package);
|
2162
|
+
|
2163
|
+
foreach(QString s, packageName.mid(strlen(moduleName) + 2).split("::")) {
|
2164
|
+
klass = rb_define_class_under(klass, (const char*) s.toLatin1(), qt_base_class);
|
2165
|
+
}
|
2166
|
+
|
2167
|
+
if (packageName == "Qt::Application" || packageName == "Qt::CoreApplication" ) {
|
2168
|
+
rb_define_method(klass, "ARGV", (VALUE (*) (...)) qapplication_argv, 0);
|
2169
|
+
} else if (packageName == "Qt::Object") {
|
2170
|
+
rb_define_singleton_method(klass, "staticMetaObject", (VALUE (*) (...)) qobject_staticmetaobject, 0);
|
2171
|
+
} else if (packageName == "Qt::AbstractTableModel") {
|
2172
|
+
qtablemodel_class = rb_define_class_under(qt_module, "TableModel", klass);
|
2173
|
+
rb_define_method(qtablemodel_class, "rowCount", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
|
2174
|
+
rb_define_method(qtablemodel_class, "row_count", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
|
2175
|
+
rb_define_method(qtablemodel_class, "columnCount", (VALUE (*) (...)) qabstract_item_model_columncount, -1);
|
2176
|
+
rb_define_method(qtablemodel_class, "column_count", (VALUE (*) (...)) qabstract_item_model_columncount, -1);
|
2177
|
+
rb_define_method(qtablemodel_class, "data", (VALUE (*) (...)) qabstract_item_model_data, -1);
|
2178
|
+
rb_define_method(qtablemodel_class, "setData", (VALUE (*) (...)) qabstract_item_model_setdata, -1);
|
2179
|
+
rb_define_method(qtablemodel_class, "set_data", (VALUE (*) (...)) qabstract_item_model_setdata, -1);
|
2180
|
+
rb_define_method(qtablemodel_class, "flags", (VALUE (*) (...)) qabstract_item_model_flags, 1);
|
2181
|
+
rb_define_method(qtablemodel_class, "insertRows", (VALUE (*) (...)) qabstract_item_model_insertrows, -1);
|
2182
|
+
rb_define_method(qtablemodel_class, "insert_rows", (VALUE (*) (...)) qabstract_item_model_insertrows, -1);
|
2183
|
+
rb_define_method(qtablemodel_class, "insertColumns", (VALUE (*) (...)) qabstract_item_model_insertcolumns, -1);
|
2184
|
+
rb_define_method(qtablemodel_class, "insert_columns", (VALUE (*) (...)) qabstract_item_model_insertcolumns, -1);
|
2185
|
+
rb_define_method(qtablemodel_class, "removeRows", (VALUE (*) (...)) qabstract_item_model_removerows, -1);
|
2186
|
+
rb_define_method(qtablemodel_class, "remove_rows", (VALUE (*) (...)) qabstract_item_model_removerows, -1);
|
2187
|
+
rb_define_method(qtablemodel_class, "removeColumns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
|
2188
|
+
rb_define_method(qtablemodel_class, "remove_columns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
|
2189
|
+
|
2190
|
+
qlistmodel_class = rb_define_class_under(qt_module, "ListModel", klass);
|
2191
|
+
rb_define_method(qlistmodel_class, "rowCount", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
|
2192
|
+
rb_define_method(qlistmodel_class, "row_count", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
|
2193
|
+
rb_define_method(qlistmodel_class, "columnCount", (VALUE (*) (...)) qabstract_item_model_columncount, -1);
|
2194
|
+
rb_define_method(qlistmodel_class, "column_count", (VALUE (*) (...)) qabstract_item_model_columncount, -1);
|
2195
|
+
rb_define_method(qlistmodel_class, "data", (VALUE (*) (...)) qabstract_item_model_data, -1);
|
2196
|
+
rb_define_method(qlistmodel_class, "setData", (VALUE (*) (...)) qabstract_item_model_setdata, -1);
|
2197
|
+
rb_define_method(qlistmodel_class, "set_data", (VALUE (*) (...)) qabstract_item_model_setdata, -1);
|
2198
|
+
rb_define_method(qlistmodel_class, "flags", (VALUE (*) (...)) qabstract_item_model_flags, 1);
|
2199
|
+
rb_define_method(qlistmodel_class, "insertRows", (VALUE (*) (...)) qabstract_item_model_insertrows, -1);
|
2200
|
+
rb_define_method(qlistmodel_class, "insert_rows", (VALUE (*) (...)) qabstract_item_model_insertrows, -1);
|
2201
|
+
rb_define_method(qlistmodel_class, "insertColumns", (VALUE (*) (...)) qabstract_item_model_insertcolumns, -1);
|
2202
|
+
rb_define_method(qlistmodel_class, "insert_columns", (VALUE (*) (...)) qabstract_item_model_insertcolumns, -1);
|
2203
|
+
rb_define_method(qlistmodel_class, "removeRows", (VALUE (*) (...)) qabstract_item_model_removerows, -1);
|
2204
|
+
rb_define_method(qlistmodel_class, "remove_rows", (VALUE (*) (...)) qabstract_item_model_removerows, -1);
|
2205
|
+
rb_define_method(qlistmodel_class, "removeColumns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
|
2206
|
+
rb_define_method(qlistmodel_class, "remove_columns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
|
2207
|
+
}
|
2208
|
+
else if (packageName == "Qt::AbstractItemModel") {
|
2209
|
+
rb_define_method(klass, "createIndex", (VALUE (*) (...)) qabstractitemmodel_createindex, -1);
|
2210
|
+
rb_define_method(klass, "create_index", (VALUE (*) (...)) qabstractitemmodel_createindex, -1);
|
2211
|
+
} else if (packageName == "Qt::Timer") {
|
2212
|
+
rb_define_singleton_method(klass, "singleShot", (VALUE (*) (...)) qtimer_single_shot, -1);
|
2213
|
+
rb_define_singleton_method(klass, "single_shot", (VALUE (*) (...)) qtimer_single_shot, -1);
|
2214
|
+
}
|
2215
|
+
|
2216
|
+
|
2217
|
+
rb_define_method(klass, "qobject_cast", (VALUE (*) (...)) qobject_qt_metacast, 1);
|
2218
|
+
rb_define_method(klass, "inspect", (VALUE (*) (...)) inspect_qobject, 0);
|
2219
|
+
rb_define_method(klass, "pretty_print", (VALUE (*) (...)) pretty_print_qobject, 1);
|
2220
|
+
rb_define_method(klass, "className", (VALUE (*) (...)) class_name, 0);
|
2221
|
+
rb_define_method(klass, "class_name", (VALUE (*) (...)) class_name, 0);
|
2222
|
+
rb_define_method(klass, "inherits", (VALUE (*) (...)) inherits_qobject, -1);
|
2223
|
+
rb_define_method(klass, "findChildren", (VALUE (*) (...)) find_qobject_children, -1);
|
2224
|
+
rb_define_method(klass, "find_children", (VALUE (*) (...)) find_qobject_children, -1);
|
2225
|
+
rb_define_method(klass, "findChild", (VALUE (*) (...)) find_qobject_child, -1);
|
2226
|
+
rb_define_method(klass, "find_child", (VALUE (*) (...)) find_qobject_child, -1);
|
2227
|
+
rb_define_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);
|
2228
|
+
rb_define_singleton_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);
|
2229
|
+
|
2230
|
+
foreach(QtRubyModule m, qtruby_modules.values()) {
|
2231
|
+
if (m.class_created)
|
2232
|
+
m.class_created(package, module_value, klass);
|
2233
|
+
}
|
2234
|
+
|
2235
|
+
free((void *) package);
|
2236
|
+
return klass;
|
2237
|
+
}
|
2238
|
+
|
2239
|
+
static VALUE
|
2240
|
+
create_qt_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
|
2241
|
+
{
|
2242
|
+
const char *package = strdup(StringValuePtr(package_value));
|
2243
|
+
// this won't work:
|
2244
|
+
// strdup(StringValuePtr(rb_funcall(module_value, rb_intern("name"), 0)))
|
2245
|
+
// any ideas why?
|
2246
|
+
VALUE value_moduleName = rb_funcall(module_value, rb_intern("name"), 0);
|
2247
|
+
const char *moduleName = strdup(StringValuePtr(value_moduleName));
|
2248
|
+
VALUE klass = module_value;
|
2249
|
+
QString packageName(package);
|
2250
|
+
|
2251
|
+
rb_define_singleton_method(module_value, "method_missing", (VALUE (*) (...)) module_method_missing, -1);
|
2252
|
+
rb_define_singleton_method(module_value, "const_missing", (VALUE (*) (...)) module_method_missing, -1);
|
2253
|
+
|
2254
|
+
foreach(QString s, packageName.mid(strlen(moduleName) + 2).split("::")) {
|
2255
|
+
klass = rb_define_class_under(klass, (const char*) s.toLatin1(), qt_base_class);
|
2256
|
+
}
|
2257
|
+
|
2258
|
+
if (packageName == "Qt::MetaObject") {
|
2259
|
+
qmetaobject_class = klass;
|
2260
|
+
} else if (packageName == "Qt::Variant") {
|
2261
|
+
qvariant_class = klass;
|
2262
|
+
rb_define_singleton_method(qvariant_class, "fromValue", (VALUE (*) (...)) qvariant_from_value, -1);
|
2263
|
+
rb_define_singleton_method(qvariant_class, "from_value", (VALUE (*) (...)) qvariant_from_value, -1);
|
2264
|
+
rb_define_singleton_method(qvariant_class, "new", (VALUE (*) (...)) new_qvariant, -1);
|
2265
|
+
} else if (packageName == "Qt::ByteArray") {
|
2266
|
+
rb_define_method(klass, "+", (VALUE (*) (...)) qbytearray_append, 1);
|
2267
|
+
rb_define_method(klass, "data", (VALUE (*) (...)) qbytearray_data, 0);
|
2268
|
+
rb_define_method(klass, "constData", (VALUE (*) (...)) qbytearray_data, 0);
|
2269
|
+
rb_define_method(klass, "const_data", (VALUE (*) (...)) qbytearray_data, 0);
|
2270
|
+
} else if (packageName == "Qt::Char") {
|
2271
|
+
rb_define_method(klass, "to_s", (VALUE (*) (...)) qchar_to_s, 0);
|
2272
|
+
} else if (packageName == "Qt::Image") {
|
2273
|
+
rb_define_method(klass, "bits", (VALUE (*) (...)) qimage_bits, 0);
|
2274
|
+
rb_define_method(klass, "scanLine", (VALUE (*) (...)) qimage_scan_line, 1);
|
2275
|
+
} else if (packageName == "Qt::ItemSelection") {
|
2276
|
+
rb_define_method(klass, "[]", (VALUE (*) (...)) qitemselection_at, 1);
|
2277
|
+
rb_define_method(klass, "at", (VALUE (*) (...)) qitemselection_at, 1);
|
2278
|
+
rb_define_method(klass, "count", (VALUE (*) (...)) qitemselection_count, 0);
|
2279
|
+
rb_define_method(klass, "length", (VALUE (*) (...)) qitemselection_count, 0);
|
2280
|
+
} else if (packageName == "Qt::Painter") {
|
2281
|
+
rb_define_method(klass, "drawLines", (VALUE (*) (...)) qpainter_drawlines, -1);
|
2282
|
+
rb_define_method(klass, "draw_lines", (VALUE (*) (...)) qpainter_drawlines, -1);
|
2283
|
+
rb_define_method(klass, "drawRects", (VALUE (*) (...)) qpainter_drawrects, -1);
|
2284
|
+
rb_define_method(klass, "draw_rects", (VALUE (*) (...)) qpainter_drawrects, -1);
|
2285
|
+
} else if (packageName == "Qt::ModelIndex") {
|
2286
|
+
rb_define_method(klass, "internalPointer", (VALUE (*) (...)) qmodelindex_internalpointer, 0);
|
2287
|
+
rb_define_method(klass, "internal_pointer", (VALUE (*) (...)) qmodelindex_internalpointer, 0);
|
2288
|
+
} else if (packageName == "Qt::SignalMapper") {
|
2289
|
+
rb_define_method(klass, "mapping", (VALUE (*) (...)) qsignalmapper_mapping, -1);
|
2290
|
+
rb_define_method(klass, "setMapping", (VALUE (*) (...)) qsignalmapper_set_mapping, -1);
|
2291
|
+
rb_define_method(klass, "set_mapping", (VALUE (*) (...)) qsignalmapper_set_mapping, -1);
|
2292
|
+
#ifdef QT_QTDBUS
|
2293
|
+
} else if (packageName == "Qt::DBusArgument") {
|
2294
|
+
rb_define_method(klass, "endArrayWrite", (VALUE (*) (...)) qdbusargument_endarraywrite, 0);
|
2295
|
+
rb_define_method(klass, "end_array_write", (VALUE (*) (...)) qdbusargument_endarraywrite, 0);
|
2296
|
+
rb_define_method(klass, "endMapEntryWrite", (VALUE (*) (...)) qdbusargument_endmapentrywrite, 0);
|
2297
|
+
rb_define_method(klass, "end_map_entry_write", (VALUE (*) (...)) qdbusargument_endmapentrywrite, 0);
|
2298
|
+
rb_define_method(klass, "endMapWrite", (VALUE (*) (...)) qdbusargument_endmapwrite, 0);
|
2299
|
+
rb_define_method(klass, "end_map_write", (VALUE (*) (...)) qdbusargument_endmapwrite, 0);
|
2300
|
+
rb_define_method(klass, "endStructureWrite", (VALUE (*) (...)) qdbusargument_endstructurewrite, 0);
|
2301
|
+
rb_define_method(klass, "end_structure_write", (VALUE (*) (...)) qdbusargument_endstructurewrite, 0);
|
2302
|
+
#endif
|
2303
|
+
}
|
2304
|
+
|
2305
|
+
foreach(QtRubyModule m, qtruby_modules.values()) {
|
2306
|
+
if (m.class_created)
|
2307
|
+
m.class_created(package, module_value, klass);
|
2308
|
+
}
|
2309
|
+
|
2310
|
+
free((void *) package);
|
2311
|
+
return klass;
|
2312
|
+
}
|
2313
|
+
|
2314
|
+
static VALUE
|
2315
|
+
version(VALUE /*self*/)
|
2316
|
+
{
|
2317
|
+
return rb_str_new2(QT_VERSION_STR);
|
2318
|
+
}
|
2319
|
+
|
2320
|
+
static VALUE
|
2321
|
+
qtruby_version(VALUE /*self*/)
|
2322
|
+
{
|
2323
|
+
return rb_str_new2(QTRUBY_VERSION);
|
2324
|
+
}
|
2325
|
+
|
2326
|
+
static VALUE
|
2327
|
+
set_application_terminated(VALUE /*self*/, VALUE yn)
|
2328
|
+
{
|
2329
|
+
application_terminated = (yn == Qtrue ? true : false);
|
2330
|
+
return Qnil;
|
2331
|
+
}
|
2332
|
+
|
2333
|
+
static VALUE
|
2334
|
+
set_qtruby_embedded_wrapped(VALUE /*self*/, VALUE yn)
|
2335
|
+
{
|
2336
|
+
set_qtruby_embedded( yn == Qtrue );
|
2337
|
+
return Qnil;
|
2338
|
+
}
|
2339
|
+
|
2340
|
+
#define INIT_BINDING(module) \
|
2341
|
+
static QtRuby::Binding module##_binding = QtRuby::Binding(module##_Smoke); \
|
2342
|
+
QtRubyModule module = { "QtRuby_" #module, resolve_classname_qt, 0, &module##_binding }; \
|
2343
|
+
qtruby_modules[module##_Smoke] = module; \
|
2344
|
+
smokeList << module##_Smoke;
|
2345
|
+
|
2346
|
+
extern Q_DECL_EXPORT void
|
2347
|
+
Init_qtruby4()
|
2348
|
+
{
|
2349
|
+
init_qtcore_Smoke();
|
2350
|
+
init_qtgui_Smoke();
|
2351
|
+
init_qtxml_Smoke();
|
2352
|
+
init_qtsql_Smoke();
|
2353
|
+
init_qtopengl_Smoke();
|
2354
|
+
init_qtnetwork_Smoke();
|
2355
|
+
init_qtsvg_Smoke();
|
2356
|
+
#ifdef QT_QTDBUS
|
2357
|
+
init_qtdbus_Smoke();
|
2358
|
+
#endif
|
2359
|
+
install_handlers(Qt_handlers);
|
2360
|
+
|
2361
|
+
INIT_BINDING(qtcore)
|
2362
|
+
INIT_BINDING(qtgui)
|
2363
|
+
INIT_BINDING(qtxml)
|
2364
|
+
INIT_BINDING(qtsql)
|
2365
|
+
INIT_BINDING(qtopengl)
|
2366
|
+
INIT_BINDING(qtnetwork)
|
2367
|
+
INIT_BINDING(qtsvg)
|
2368
|
+
#ifdef QT_QTDBUS
|
2369
|
+
INIT_BINDING(qtdbus)
|
2370
|
+
#endif
|
2371
|
+
|
2372
|
+
if (qt_module == Qnil) {
|
2373
|
+
qt_module = rb_define_module("Qt");
|
2374
|
+
qt_internal_module = rb_define_module_under(qt_module, "Internal");
|
2375
|
+
qt_base_class = rb_define_class_under(qt_module, "Base", rb_cObject);
|
2376
|
+
moduleindex_class = rb_define_class_under(qt_internal_module, "ModuleIndex", rb_cObject);
|
2377
|
+
}
|
2378
|
+
|
2379
|
+
rb_define_singleton_method(qt_base_class, "new", (VALUE (*) (...)) new_qt, -1);
|
2380
|
+
rb_define_method(qt_base_class, "initialize", (VALUE (*) (...)) initialize_qt, -1);
|
2381
|
+
rb_define_singleton_method(qt_base_class, "method_missing", (VALUE (*) (...)) class_method_missing, -1);
|
2382
|
+
rb_define_singleton_method(qt_module, "method_missing", (VALUE (*) (...)) module_method_missing, -1);
|
2383
|
+
rb_define_method(qt_base_class, "method_missing", (VALUE (*) (...)) method_missing, -1);
|
2384
|
+
|
2385
|
+
rb_define_singleton_method(qt_base_class, "const_missing", (VALUE (*) (...)) class_method_missing, -1);
|
2386
|
+
rb_define_singleton_method(qt_module, "const_missing", (VALUE (*) (...)) module_method_missing, -1);
|
2387
|
+
rb_define_method(qt_base_class, "const_missing", (VALUE (*) (...)) method_missing, -1);
|
2388
|
+
|
2389
|
+
rb_define_method(qt_base_class, "dispose", (VALUE (*) (...)) dispose, 0);
|
2390
|
+
rb_define_method(qt_base_class, "isDisposed", (VALUE (*) (...)) is_disposed, 0);
|
2391
|
+
rb_define_method(qt_base_class, "disposed?", (VALUE (*) (...)) is_disposed, 0);
|
2392
|
+
|
2393
|
+
rb_define_method(qt_base_class, "qVariantValue", (VALUE (*) (...)) qvariant_value, 2);
|
2394
|
+
rb_define_method(qt_base_class, "qVariantFromValue", (VALUE (*) (...)) qvariant_from_value, -1);
|
2395
|
+
|
2396
|
+
rb_define_method(rb_cObject, "qDebug", (VALUE (*) (...)) qdebug, 1);
|
2397
|
+
rb_define_method(rb_cObject, "qFatal", (VALUE (*) (...)) qfatal, 1);
|
2398
|
+
rb_define_method(rb_cObject, "qWarning", (VALUE (*) (...)) qwarning, 1);
|
2399
|
+
|
2400
|
+
rb_define_module_function(qt_internal_module, "getMethStat", (VALUE (*) (...)) getMethStat, 0);
|
2401
|
+
rb_define_module_function(qt_internal_module, "getClassStat", (VALUE (*) (...)) getClassStat, 0);
|
2402
|
+
rb_define_module_function(qt_internal_module, "getIsa", (VALUE (*) (...)) getIsa, 1);
|
2403
|
+
rb_define_module_function(qt_internal_module, "setDebug", (VALUE (*) (...)) setDebug, 1);
|
2404
|
+
rb_define_module_function(qt_internal_module, "debug", (VALUE (*) (...)) debugging, 0);
|
2405
|
+
rb_define_module_function(qt_internal_module, "get_arg_type_name", (VALUE (*) (...)) get_arg_type_name, 2);
|
2406
|
+
rb_define_module_function(qt_internal_module, "classIsa", (VALUE (*) (...)) classIsa, 2);
|
2407
|
+
rb_define_module_function(qt_internal_module, "isEnum", (VALUE (*) (...)) isEnum, 1);
|
2408
|
+
rb_define_module_function(qt_internal_module, "insert_pclassid", (VALUE (*) (...)) insert_pclassid, 2);
|
2409
|
+
rb_define_module_function(qt_internal_module, "classid2name", (VALUE (*) (...)) classid2name, 1);
|
2410
|
+
rb_define_module_function(qt_internal_module, "find_pclassid", (VALUE (*) (...)) find_pclassid, 1);
|
2411
|
+
rb_define_module_function(qt_internal_module, "get_value_type", (VALUE (*) (...)) get_value_type, 1);
|
2412
|
+
|
2413
|
+
rb_define_module_function(qt_internal_module, "make_metaObject", (VALUE (*) (...)) make_metaObject, 4);
|
2414
|
+
rb_define_module_function(qt_internal_module, "addMetaObjectMethods", (VALUE (*) (...)) add_metaobject_methods, 1);
|
2415
|
+
rb_define_module_function(qt_internal_module, "addSignalMethods", (VALUE (*) (...)) add_signal_methods, 2);
|
2416
|
+
rb_define_module_function(qt_internal_module, "mapObject", (VALUE (*) (...)) mapObject, 1);
|
2417
|
+
|
2418
|
+
rb_define_module_function(qt_internal_module, "isQObject", (VALUE (*) (...)) isQObject, 1);
|
2419
|
+
rb_define_module_function(qt_internal_module, "idInstance", (VALUE (*) (...)) idInstance, 1);
|
2420
|
+
rb_define_module_function(qt_internal_module, "findClass", (VALUE (*) (...)) findClass, 1);
|
2421
|
+
// rb_define_module_function(qt_internal_module, "idMethodName", (VALUE (*) (...)) idMethodName, 1);
|
2422
|
+
// rb_define_module_function(qt_internal_module, "idMethod", (VALUE (*) (...)) idMethod, 2);
|
2423
|
+
rb_define_module_function(qt_internal_module, "findMethod", (VALUE (*) (...)) findMethod, 2);
|
2424
|
+
rb_define_module_function(qt_internal_module, "findAllMethods", (VALUE (*) (...)) findAllMethods, -1);
|
2425
|
+
rb_define_module_function(qt_internal_module, "findAllMethodNames", (VALUE (*) (...)) findAllMethodNames, 3);
|
2426
|
+
rb_define_module_function(qt_internal_module, "dumpCandidates", (VALUE (*) (...)) dumpCandidates, 1);
|
2427
|
+
rb_define_module_function(qt_internal_module, "isConstMethod", (VALUE (*) (...)) isConstMethod, 1);
|
2428
|
+
rb_define_module_function(qt_internal_module, "isObject", (VALUE (*) (...)) isObject, 1);
|
2429
|
+
rb_define_module_function(qt_internal_module, "setCurrentMethod", (VALUE (*) (...)) setCurrentMethod, 1);
|
2430
|
+
rb_define_module_function(qt_internal_module, "getClassList", (VALUE (*) (...)) getClassList, 0);
|
2431
|
+
rb_define_module_function(qt_internal_module, "create_qt_class", (VALUE (*) (...)) create_qt_class, 2);
|
2432
|
+
rb_define_module_function(qt_internal_module, "create_qobject_class", (VALUE (*) (...)) create_qobject_class, 2);
|
2433
|
+
rb_define_module_function(qt_internal_module, "cast_object_to", (VALUE (*) (...)) cast_object_to, 2);
|
2434
|
+
rb_define_module_function(qt_module, "dynamic_cast", (VALUE (*) (...)) cast_object_to, 2);
|
2435
|
+
rb_define_module_function(qt_internal_module, "kross2smoke", (VALUE (*) (...)) kross2smoke, 2);
|
2436
|
+
rb_define_module_function(qt_internal_module, "set_qtruby_embedded", (VALUE (*) (...)) set_qtruby_embedded_wrapped, 1);
|
2437
|
+
|
2438
|
+
rb_define_module_function(qt_internal_module, "application_terminated=", (VALUE (*) (...)) set_application_terminated, 1);
|
2439
|
+
|
2440
|
+
rb_define_module_function(qt_module, "version", (VALUE (*) (...)) version, 0);
|
2441
|
+
rb_define_module_function(qt_module, "qtruby_version", (VALUE (*) (...)) qtruby_version, 0);
|
2442
|
+
|
2443
|
+
rb_define_module_function(qt_module, "qRegisterResourceData", (VALUE (*) (...)) q_register_resource_data, 4);
|
2444
|
+
rb_define_module_function(qt_module, "qUnregisterResourceData", (VALUE (*) (...)) q_unregister_resource_data, 4);
|
2445
|
+
|
2446
|
+
// A problem has been found with QtRuby when it is run with Ruby 1.9.1
|
2447
|
+
// and GC.stess is true.
|
2448
|
+
// In the smokeruby_mark() function called during garbage collection,
|
2449
|
+
// any virtual methods which are called on the instances being checked
|
2450
|
+
// could have overriden by Ruby methods. So the Wt::Ruby runtime uses
|
2451
|
+
// 'respond_to()' to find out whether they have been overriden.
|
2452
|
+
// However, this involves calling 'rb_intern()' on the method name,
|
2453
|
+
// which means memory could be allocated, giving an error when running under
|
2454
|
+
// GC.stress mode. So workround it by pre-allocating any strings with
|
2455
|
+
// rb_intern() for all the C++ methods used in smokeruby_mark()
|
2456
|
+
rb_intern("children");
|
2457
|
+
rb_intern("childItems");
|
2458
|
+
rb_intern("childCount");
|
2459
|
+
rb_intern("child");
|
2460
|
+
rb_intern("hasChildren");
|
2461
|
+
rb_intern("parent");
|
2462
|
+
rb_intern("parentItem");
|
2463
|
+
rb_intern("item");
|
2464
|
+
rb_intern("items");
|
2465
|
+
rb_intern("rowCount");
|
2466
|
+
rb_intern("rowAt");
|
2467
|
+
rb_intern("columnCount");
|
2468
|
+
rb_intern("elementAt");
|
2469
|
+
rb_intern("columnAt");
|
2470
|
+
rb_intern("topLevelItem");
|
2471
|
+
rb_intern("itemAt");
|
2472
|
+
rb_intern("internalPointer");
|
2473
|
+
|
2474
|
+
rb_require("Qt/qtruby4.rb");
|
2475
|
+
|
2476
|
+
rObject_typeId = QMetaType::registerType("rObject", &delete_ruby_object, &create_ruby_object);
|
2477
|
+
|
2478
|
+
// Do package initialization
|
2479
|
+
rb_funcall(qt_internal_module, rb_intern("init_all_classes"), 0);
|
2480
|
+
}
|
2481
|
+
|
2482
|
+
}
|
2483
|
+
// kate: space-indent false;
|