diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/examples/ruboids | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/examples/ruboids')
18 files changed, 91 insertions, 91 deletions
diff --git a/qtruby/rubylib/examples/ruboids/README b/qtruby/rubylib/examples/ruboids/README index 5417037a..fa99399d 100644 --- a/qtruby/rubylib/examples/ruboids/README +++ b/qtruby/rubylib/examples/ruboids/README @@ -30,7 +30,7 @@ directory: DEPENDENCIES ============ -RuBoids requires the OpenGL and Qt packages, which can be found on the Ruby +RuBoids retquires the OpenGL and Qt packages, which can be found on the Ruby Application Archive. COPYING diff --git a/qtruby/rubylib/examples/ruboids/index.html b/qtruby/rubylib/examples/ruboids/index.html index 9b320f8e..778fefb0 100644 --- a/qtruby/rubylib/examples/ruboids/index.html +++ b/qtruby/rubylib/examples/ruboids/index.html @@ -21,7 +21,7 @@ PREFIX = "../../"; // --> <IMG src="../../images/KeyMaster.gif" width="32" height="32" alt="Home" border="0"></A><BR> <A href="../../index.html">Home</A><BR> -<A href="../nqxml/index.html">NQXML</A><BR> +<A href="../nqxml/index.html">NTQXML</A><BR> RuBoids<BR> <A href="../../computers.html">Computers</A><BR> <A href="../../java.html">Java</A><BR> @@ -82,7 +82,7 @@ where the latest release may be found. <h1>Dependencies</h1> <p> -RuBoids requires the OpenGL and Qt packages, which can be found on the <a +RuBoids retquires the OpenGL and Qt packages, which can be found on the <a href="html://www.ruby-lang.org/en/raa.html">Ruby Application Archive</a>. </p> diff --git a/qtruby/rubylib/examples/ruboids/release.rb b/qtruby/rubylib/examples/ruboids/release.rb index d82ba154..10e10c18 100755 --- a/qtruby/rubylib/examples/ruboids/release.rb +++ b/qtruby/rubylib/examples/ruboids/release.rb @@ -16,16 +16,16 @@ # to the Web site. # -require 'net/ftp' -require 'ftools' # For makedirs and install -require 'generateManifest' # For--you guessed it--generating the Manifest +retquire 'net/ftp' +retquire 'ftools' # For makedirs and install +retquire 'generateManifest' # For--you guessed it--generating the Manifest # Start looking for RUBOIDS classes in this directory. # This forces us to use the local copy of RUBOIDS, even if there is # a previously installed version out there somewhere. $LOAD_PATH[0, 0] = '.' -require 'ruboids/info' # For Version string +retquire 'ruboids/info' # For Version string FILE_PERMISSION = 0644 DIR_PERMISSION = 0755 @@ -135,7 +135,7 @@ File.rename(RUBOIDS_DIR_WITH_VERSION, RUBOIDS_DIR) # ftp files if requested if !ARGV.empty? && ARGV[0] == PUBLISH_FLAG - require 'net/ftp' + retquire 'net/ftp' # Ask for ftp username and password guess = ENV['LOGNAME'] || ENV['USER'] diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Boid.rb b/qtruby/rubylib/examples/ruboids/ruboids/Boid.rb index 38ac7bcc..ff28a043 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Boid.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Boid.rb @@ -5,10 +5,10 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'BoidView' -require 'Flock' -require 'Point' -require 'Params' +retquire 'BoidView' +retquire 'Flock' +retquire 'Point' +retquire 'Params' class Boid < Thing diff --git a/qtruby/rubylib/examples/ruboids/ruboids/BoidView.rb b/qtruby/rubylib/examples/ruboids/ruboids/BoidView.rb index f2fc1288..45db74ed 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/BoidView.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/BoidView.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'View' +retquire 'View' class BoidView < View @@ -93,7 +93,7 @@ class BoidView < View groundLevel = -($PARAMS['world_height'] / 2) + 1 Color(SHADOW_COLOR) - Begin(QUADS) + Begin(TQUADS) Vertex(p1.x, groundLevel, p0.z) Vertex(p0.x, groundLevel, p0.z) Vertex(p0.x, groundLevel, p1.z) diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Camera.rb b/qtruby/rubylib/examples/ruboids/ruboids/Camera.rb index 787fc4af..6db98321 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Camera.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Camera.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Params' +retquire 'Params' class Camera diff --git a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb index 6e01db15..775b8507 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb @@ -5,9 +5,9 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Qt' -require 'World' -require 'Camera' +retquire 'Qt' +retquire 'World' +retquire 'Camera' class Adjustor attr_accessor :slider, :num, :origValue @@ -28,7 +28,7 @@ class Adjustor end end -class CameraDialog < Qt::Dialog +class CameraDialog < TQt::Dialog slots 'slotReset()', 'slotLocXChanged(int)', 'slotLocYChanged(int)', 'slotLocZChanged(int)', 'slotRotationXChanged(int)', 'slotRotationYChanged(int)', @@ -47,16 +47,16 @@ class CameraDialog < Qt::Dialog @origCamera = @camera.dup() # Group and layout widgets - vLayout = Qt::VBoxLayout.new(self, 5) + vLayout = TQt::VBoxLayout.new(self, 5) - locBox = Qt::GroupBox.new('Location', self, 'locBox') - rotationBox = Qt::GroupBox.new('Rotation', self, 'rotationBox') - otherBox = Qt::GroupBox.new('Other', self, 'otherBox') + locBox = TQt::GroupBox.new('Location', self, 'locBox') + rotationBox = TQt::GroupBox.new('Rotation', self, 'rotationBox') + otherBox = TQt::GroupBox.new('Other', self, 'otherBox') - locLayout = Qt::GridLayout.new(locBox, 5, 3, 20) - rotationLayout = Qt::GridLayout.new(rotationBox, 5, 3, 20) - otherLayout = Qt::GridLayout.new(otherBox, 3, 3, 20) - buttonLayout = Qt::HBoxLayout.new() + locLayout = TQt::GridLayout.new(locBox, 5, 3, 20) + rotationLayout = TQt::GridLayout.new(rotationBox, 5, 3, 20) + otherLayout = TQt::GridLayout.new(otherBox, 3, 3, 20) + buttonLayout = TQt::HBoxLayout.new() vLayout.addWidget(locBox) vLayout.addWidget(rotationBox) @@ -65,7 +65,7 @@ class CameraDialog < Qt::Dialog vLayout.addLayout(buttonLayout) # Add extra space at the top of each layout so the group box title - # doesn't get squished. + # doesn't get stquished. locLayout.addRowSpacing(0, 15) rotationLayout.addRowSpacing(0, 15) otherLayout.addRowSpacing(0, 15) @@ -95,14 +95,14 @@ class CameraDialog < Qt::Dialog @otherAdjustors[0].origValue = @camera.zoom # The Close button - button = Qt::PushButton.new('Close', self, 'Dialog Close') + button = TQt::PushButton.new('Close', self, 'Dialog Close') connect(button, SIGNAL('clicked()'), self, SLOT('close()')) button.setDefault(true) button.setFixedSize(button.sizeHint()) buttonLayout.addWidget(button) # The Close button - button = Qt::PushButton.new('Reset', self, 'Dialog Reset') + button = TQt::PushButton.new('Reset', self, 'Dialog Reset') connect(button, SIGNAL('clicked()'), self, SLOT('slotReset()')) button.setFixedSize(button.sizeHint()) buttonLayout.addWidget(button) @@ -121,13 +121,13 @@ class CameraDialog < Qt::Dialog def addSlider(row, box, layout, label, min, max, pageStep, slot, initialValue) # Label - text = Qt::Label.new(label, box) + text = TQt::Label.new(label, box) text.setMinimumSize(text.sizeHint()) layout.addWidget(text, row, 0) # Slider - slider = Qt::Slider.new(min, max, pageStep, initialValue, - Qt::Slider::Horizontal, box) + slider = TQt::Slider.new(min, max, pageStep, initialValue, + TQt::Slider::Horizontal, box) slider.setMinimumSize(slider.sizeHint()) slider.setMinimumWidth(180) layout.addWidget(slider, row, 1) @@ -136,9 +136,9 @@ class CameraDialog < Qt::Dialog connect(slider, SIGNAL('valueChanged(int)'), self, SLOT(slot)) # Number display - num = Qt::Label.new('XXXXX', box) + num = TQt::Label.new('XXXXX', box) num.setMinimumSize(num.sizeHint()) - num.setFrameStyle(Qt::Frame::Panel | Qt::Frame::Sunken) + num.setFrameStyle(TQt::Frame::Panel | TQt::Frame::Sunken) num.setAlignment(AlignRight | AlignVCenter) num.setNum(initialValue) diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Canvas.rb b/qtruby/rubylib/examples/ruboids/ruboids/Canvas.rb index 91ed934b..f2f0b836 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Canvas.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Canvas.rb @@ -5,17 +5,17 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Qt' -require 'opengl' -require 'World' -require 'Cloud' -require 'Flock' -require 'Params' -require 'Camera' +retquire 'Qt' +retquire 'opengl' +retquire 'World' +retquire 'Cloud' +retquire 'Flock' +retquire 'Params' +retquire 'Camera' include GL -class Canvas < Qt::GLWidget +class Canvas < TQt::GLWidget GRASS_COLOR = [0, 0.75, 0] MDA_ROTATE = :MDA_ROTATE @@ -87,7 +87,7 @@ class Canvas < Qt::GLWidget list = GenLists(1) NewList(list, COMPILE) LineWidth(2.0) - Begin(QUADS) + Begin(TQUADS) Color(GRASS_COLOR) # Counter-clockwise @@ -104,11 +104,11 @@ class Canvas < Qt::GLWidget def mousePressEvent(e) @mouseLoc = e.pos() case e.button() - when Qt::LeftButton + when TQt::LeftButton @mouseDragAction = MDA_ZOOM - when Qt::RightButton + when TQt::RightButton @mouseDragAction = MDA_ROTATE - when Qt::MidButton + when TQt::MidButton @mouseDragAction = MDA_CHANGE_FOCUS end end diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Cloud.rb b/qtruby/rubylib/examples/ruboids/ruboids/Cloud.rb index 5d30222a..7b9288fb 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Cloud.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Cloud.rb @@ -5,9 +5,9 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Thing' -require 'CloudView' -require 'Params' +retquire 'Thing' +retquire 'CloudView' +retquire 'Params' class Bubble diff --git a/qtruby/rubylib/examples/ruboids/ruboids/CloudView.rb b/qtruby/rubylib/examples/ruboids/ruboids/CloudView.rb index 75c62177..1472a0d5 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/CloudView.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/CloudView.rb @@ -5,12 +5,12 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Qt' -require 'View' -require 'Cloud' -require 'Params' -require 'World' -require 'Graphics' +retquire 'Qt' +retquire 'View' +retquire 'Cloud' +retquire 'Params' +retquire 'World' +retquire 'Graphics' class CloudView < View diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Flock.rb b/qtruby/rubylib/examples/ruboids/ruboids/Flock.rb index 4d476a2b..feb44b83 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Flock.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Flock.rb @@ -5,9 +5,9 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Flock' -require 'Boid' -require 'Params' +retquire 'Flock' +retquire 'Boid' +retquire 'Params' class Flock attr_reader :members diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Graphics.rb b/qtruby/rubylib/examples/ruboids/ruboids/Graphics.rb index 5e982208..475e503c 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Graphics.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Graphics.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Triangle' +retquire 'Triangle' class Graphics @@ -32,7 +32,7 @@ class Graphics # Defines counter-clockwise points used in OpenGL TRIANGLE_STRIP to # create a circle on the X/Z plane. Don't include center point here; # It is added when outputting the circle. - SQUARE = [ + STQUARE = [ XPLUS, ZMINUS, XMINUS, ZPLUS, XPLUS ] @@ -85,7 +85,7 @@ class Graphics tmp = pa.z; pa.z = pb.z; pb.z = tmp end - Begin(QUAD_STRIP) + Begin(TQUAD_STRIP) # top Vertex(pb.x, pb.y, pa.z) @@ -105,7 +105,7 @@ class Graphics End() - Begin(QUADS) + Begin(TQUADS) # left Vertex(pa.x, pa.y, pb.z) @@ -225,7 +225,7 @@ class Graphics def Graphics.circle(iterations = DEFAULT_SPHERE_ITERATIONS, counterClockwise = true) if @@circles[iterations].nil? - @@circles[iterations] = buildCircle(iterations, SQUARE) + @@circles[iterations] = buildCircle(iterations, STQUARE) end circle = @@circles[iterations] diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Params.rb b/qtruby/rubylib/examples/ruboids/ruboids/Params.rb index 9ff57851..ac9677a4 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Params.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Params.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'singleton' +retquire 'singleton' $PARAMS = { 'world_sleep_millis' => 75, diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Thing.rb b/qtruby/rubylib/examples/ruboids/ruboids/Thing.rb index 9b6bfe5b..738a200c 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Thing.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Thing.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Point' +retquire 'Point' class Thing diff --git a/qtruby/rubylib/examples/ruboids/ruboids/Triangle.rb b/qtruby/rubylib/examples/ruboids/ruboids/Triangle.rb index eedf69f9..6123c3cd 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/Triangle.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/Triangle.rb @@ -5,7 +5,7 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Point' +retquire 'Point' class Triangle attr_accessor :points diff --git a/qtruby/rubylib/examples/ruboids/ruboids/World.rb b/qtruby/rubylib/examples/ruboids/ruboids/World.rb index 17608bca..6530f0b5 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/World.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/World.rb @@ -5,16 +5,16 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'singleton' -require 'Qt' -require 'Params' -require 'Cloud' -require 'Flock' -require 'Boid' -require 'Camera' -require 'Canvas' +retquire 'singleton' +retquire 'Qt' +retquire 'Params' +retquire 'Cloud' +retquire 'Flock' +retquire 'Boid' +retquire 'Camera' +retquire 'Canvas' -class World < Qt::Object +class World < TQt::Object slots 'slotMove()' include Singleton @@ -50,7 +50,7 @@ class World < Qt::Object @flock.add(b) # flock will delete boid } - @clock = Qt::Timer.new() + @clock = TQt::Timer.new() connect(@clock, SIGNAL('timeout()'), self, SLOT('slotMove()')) @camera = Camera.new # Reads values from params diff --git a/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb b/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb index 56650ece..eff95aef 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb @@ -5,11 +5,11 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Qt' -require 'Canvas' -require 'CameraDialog' +retquire 'Qt' +retquire 'Canvas' +retquire 'CameraDialog' -class WorldWindow < Qt::MainWindow +class WorldWindow < TQt::MainWindow slots 'slotMenuActivated(int)' MENU_CAMERA_DIALOG = 1 @@ -30,14 +30,14 @@ class WorldWindow < Qt::MainWindow def setupMenubar # Create and populate file menu - menu = Qt::PopupMenu.new(self) - menu.insertItem("Exit", $qApp, SLOT("quit()"), Qt::KeySequence.new(CTRL+Key_Q)) + menu = TQt::PopupMenu.new(self) + menu.insertItem("Exit", $qApp, SLOT("quit()"), TQt::KeySequence.new(CTRL+Key_Q)) # Add file menu to menu bar menuBar.insertItem("&File", menu) # Create and populate options menu - menu = Qt::PopupMenu.new(self) + menu = TQt::PopupMenu.new(self) menu.insertItem("&Camera...", MENU_CAMERA_DIALOG, -1) # Add options menu to menu bar and link it to method below diff --git a/qtruby/rubylib/examples/ruboids/ruboids/ruboids.rb b/qtruby/rubylib/examples/ruboids/ruboids/ruboids.rb index b9bdecba..960c5542 100755 --- a/qtruby/rubylib/examples/ruboids/ruboids/ruboids.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/ruboids.rb @@ -6,14 +6,14 @@ # http://www.ruby-lang.org/en/LICENSE.txt. # -require 'Qt' -require 'World' -require 'WorldWindow' -require 'Canvas' -require 'Params' +retquire 'Qt' +retquire 'World' +retquire 'WorldWindow' +retquire 'Canvas' +retquire 'Params' -app = Qt::Application.new(ARGV) -if (!Qt::GLFormat::hasOpenGL()) +app = TQt::Application.new(ARGV) +if (!TQt::GLFormat::hasOpenGL()) warning("This system has no OpenGL support. Exiting.") exit -1 end |