[svn:parrot] r44547 - in trunk: . examples/nci examples/sdl examples/sdl/lcd examples/sdl/minesweeper examples/sdl/tetris runtime/parrot/library runtime/parrot/library/SDL
coke at svn.parrot.org
coke at svn.parrot.org
Sun Feb 28 06:02:33 UTC 2010
Author: coke
Date: Sun Feb 28 06:02:31 2010
New Revision: 44547
URL: https://trac.parrot.org/parrot/changeset/44547
Log:
move SDL::* to SDL;*
Listed in deprecated.pod for a previous release, but no ticket listed.
Note: there aren't any tests for the SDL files, and they aren't built by
default; I verified that no new regressions were introduced in the build
of the library files and that examples_tests still passes.
Modified:
trunk/DEPRECATED.pod
trunk/examples/nci/sdl_blue_rectangle.pir
trunk/examples/sdl/anim_image.pir
trunk/examples/sdl/anim_image_dblbuf.pir
trunk/examples/sdl/blue_font.pir
trunk/examples/sdl/blue_rect.pir
trunk/examples/sdl/bounce_parrot_logo.pir
trunk/examples/sdl/lcd/clock.pir
trunk/examples/sdl/mandel.pir
trunk/examples/sdl/minesweeper/eventhandler.pir
trunk/examples/sdl/minesweeper/field.pir
trunk/examples/sdl/minesweeper/mines.pir
trunk/examples/sdl/move_parrot_logo.pir
trunk/examples/sdl/raw_pixels.pir
trunk/examples/sdl/tetris/app.pir
trunk/examples/sdl/tetris/block.pir
trunk/examples/sdl/tetris/board.pir
trunk/examples/sdl/tetris/eventhandler.pir
trunk/runtime/parrot/library/SDL.pir
trunk/runtime/parrot/library/SDL/App.pir
trunk/runtime/parrot/library/SDL/Button.pir
trunk/runtime/parrot/library/SDL/Color.pir
trunk/runtime/parrot/library/SDL/Constants.pir
trunk/runtime/parrot/library/SDL/Event.pir
trunk/runtime/parrot/library/SDL/EventHandler.pir
trunk/runtime/parrot/library/SDL/Font.pir
trunk/runtime/parrot/library/SDL/Image.pir
trunk/runtime/parrot/library/SDL/LCD.pir
trunk/runtime/parrot/library/SDL/Rect.pir
trunk/runtime/parrot/library/SDL/Sprite.pir
trunk/runtime/parrot/library/SDL/StopWatch.pir
trunk/runtime/parrot/library/SDL/Surface.pir
Modified: trunk/DEPRECATED.pod
==============================================================================
--- trunk/DEPRECATED.pod Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/DEPRECATED.pod Sun Feb 28 06:02:31 2010 (r44547)
@@ -308,9 +308,9 @@
=item Library name changes [eligible in 2.1]
-The use of C<::> a namespace separator is deprecated. Core libraries will
+The use of C<::> as a namespace separator is deprecated. Core libraries will
change to use multi-level keys instead. For example, C<'YAML::Dumper'> changes
-to C<['YAML'; 'Dumper']>. Affected libraries include C<SDL>.
+to C<['YAML'; 'Dumper']>.
=back
Modified: trunk/examples/nci/sdl_blue_rectangle.pir
==============================================================================
--- trunk/examples/nci/sdl_blue_rectangle.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/nci/sdl_blue_rectangle.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -26,11 +26,11 @@
.local pmc new_SDL_Rect
.local object screen
- SDL_Init = global "SDL::SDL_Init"
- SetVideoMode = global "SDL::SDL_SetVideoMode"
- SDL_Quit = global "SDL::SDL_Quit"
- SDL_UpdateRect = global "SDL::SDL_UpdateRect"
- SDL_FillRect = global "SDL::SDL_FillRect"
+ SDL_Init = global ['SDL'; 'SDL_Init']
+ SetVideoMode = global ['SDL'; 'SDL_SetVideoMode']
+ SDL_Quit = global ['SDL'; 'SDL_Quit']
+ SDL_UpdateRect = global ['SDL'; 'SDL_UpdateRect']
+ SDL_FillRect = global ['SDL'; 'SDL_FillRect']
new_SDL_Rect = global "new_SDL_Rect"
.begin_call
Modified: trunk/examples/sdl/anim_image.pir
==============================================================================
--- trunk/examples/sdl/anim_image.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/anim_image.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -23,34 +23,34 @@
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 1 )
.local pmc main_screen
main_screen = app.'surface'()
.local pmc dest_rect
- dest_rect = new 'SDL::Rect'
+ dest_rect = new ['SDL'; 'Rect']
dest_rect.'init'( 'height' => 100, 'width' => 100, 'x' => 0, 'y' => 190 )
.local pmc prev_rect
- prev_rect = new 'SDL::Rect'
+ prev_rect = new ['SDL'; 'Rect']
prev_rect.'init'( 'height' => 100, 'width' => 101, 'x' => 0, 'y' => 190 )
.local pmc source_rect
- source_rect = new 'SDL::Rect'
+ source_rect = new ['SDL'; 'Rect']
source_rect.'init'( 'height' => 56, 'width' => 100, 'x' => 0, 'y' => 0 )
.local pmc black
- black = new 'SDL::Color'
+ black = new ['SDL'; 'Color']
black.'init'( 'r' => 0, 'g' => 0, 'b' => 0 )
.local pmc image
- image = new 'SDL::Image'
+ image = new ['SDL'; 'Image']
image.'init'( 'examples/sdl/parrot_small.png' )
.local pmc sprite
- sprite = new 'SDL::Sprite'
+ sprite = new ['SDL'; 'Sprite']
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' => 0, 'dest_x' => 0, 'dest_y' => 190, 'bgcolor' => black )
.local num start_time
Modified: trunk/examples/sdl/anim_image_dblbuf.pir
==============================================================================
--- trunk/examples/sdl/anim_image_dblbuf.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/anim_image_dblbuf.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -22,34 +22,34 @@
load_bytecode "SDL/Sprite.pir"
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 1073741825 )
.local pmc main_screen
main_screen = app.'surface'()
.local pmc dest_rect
- dest_rect = new 'SDL::Rect'
+ dest_rect = new ['SDL'; 'Rect']
dest_rect.'init'( 'height' => 100, 'width' => 100, 'x' => 0, 'y' => 190 )
.local pmc prev_rect
- prev_rect = new 'SDL::Rect'
+ prev_rect = new ['SDL'; 'Rect']
prev_rect.'init'( 'height' => 100, 'width' => 101, 'x' => 0, 'y' => 190 )
.local pmc source_rect
- source_rect = new 'SDL::Rect'
+ source_rect = new ['SDL'; 'Rect']
source_rect.'init'( 'height' => 56, 'width' => 100, 'x' => 0, 'y' => 0 )
.local pmc black
- black = new 'SDL::Color'
+ black = new ['SDL'; 'Color']
black.'init'( 'r' => 0, 'g' => 0, 'b' => 0 )
.local pmc image
- image = new 'SDL::Image'
+ image = new ['SDL'; 'Image']
image.'init'( 'examples/sdl/parrot_small.png' )
.local pmc sprite
- sprite = new 'SDL::Sprite'
+ sprite = new ['SDL'; 'Sprite']
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' => 0, 'dest_x' => 0, 'dest_y' => 190, 'bgcolor' => black )
.local num start_time
Modified: trunk/examples/sdl/blue_font.pir
==============================================================================
--- trunk/examples/sdl/blue_font.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/blue_font.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -29,7 +29,7 @@
# create an SDL::App object
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 1 )
# fetch the SDL::Surface representing the main window
@@ -38,16 +38,16 @@
# create an SDL::Rect object
.local pmc rect
- new rect, 'SDL::Rect'
+ new rect, ['SDL'; 'Rect']
rect.'init'( 'height' => 100, 'width' => 100, 'x' => 194, 'y' => 208 )
# create SDL::Color objects
.local pmc blue
- new blue, 'SDL::Color'
+ new blue, ['SDL'; 'Color']
blue.'init'( 'r' => 0, 'g' => 0, 'b' => 255 )
.local pmc white
- new white, 'SDL::Color'
+ new white, ['SDL'; 'Color']
white.'init'( 'r' => 255, 'g' => 255, 'b' => 255 )
.local pmc file_pmc
@@ -62,11 +62,11 @@
have_font:
.local pmc font
- new font, 'SDL::Font'
+ new font, ['SDL'; 'Font']
font.'init'( 'font_file' => 'times.ttf', 'point_size' => 48 )
.local pmc full_rect
- full_rect = new 'SDL::Rect'
+ full_rect = new ['SDL'; 'Rect']
full_rect.'init'( 'width' => 640, 'height' => 480, 'x' => 0, 'y' => 0 )
main_screen.'fill_rect'( full_rect, white )
Modified: trunk/examples/sdl/blue_rect.pir
==============================================================================
--- trunk/examples/sdl/blue_rect.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/blue_rect.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -21,7 +21,7 @@
# create an SDL::App object
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 32, 'flags' => 1 )
# fetch the SDL::Surface representing the main window
@@ -30,12 +30,12 @@
# create an SDL::Rect object
.local pmc rect
- new rect, 'SDL::Rect'
+ new rect, ['SDL'; 'Rect']
rect.'init'( 'height' => 100, 'width' => 100, 'x' => 270, 'y' => 190 )
# create an SDL::Color object
.local pmc color
- new color, 'SDL::Color'
+ new color, ['SDL'; 'Color']
color.'init'( 'r' => 0, 'g' => 0, 'b' => 255 )
# draw the rectangle to the surface and update it
Modified: trunk/examples/sdl/bounce_parrot_logo.pir
==============================================================================
--- trunk/examples/sdl/bounce_parrot_logo.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/bounce_parrot_logo.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -27,22 +27,22 @@
load_bytecode "SDL/Event.pir"
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'width' => 640, 'height' => 480, 'bpp' => 0, 'flags' => 0 )
.local pmc main_screen
main_screen = app.'surface'()
.local pmc black
- black = new 'SDL::Color'
+ black = new ['SDL'; 'Color']
black.'init'( 'r' => 0, 'g' => 0, 'b' => 0 )
.local pmc image
- image = new 'SDL::Image'
+ image = new ['SDL'; 'Image']
image.'init'( 'examples/sdl/parrot_small.png' )
.local pmc sprite
- sprite = new 'SDL::Sprite'
+ sprite = new ['SDL'; 'Sprite']
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' => 0, 'dest_x' => 270, 'dest_y' => 212, 'bgcolor' => black )
_main_loop( main_screen, sprite )
@@ -55,14 +55,14 @@
.local pmc parent_class
.local pmc class_type
- get_class parent_class, 'SDL::EventHandler'
+ get_class parent_class, ['SDL'; 'EventHandler']
subclass class_type, parent_class, 'MoveLogo::EventHandler'
.local pmc event_handler
event_handler = new 'MoveLogo::EventHandler'
.local pmc event
- event = new 'SDL::Event'
+ event = new ['SDL'; 'Event']
event.'init'()
.local pmc handler_args
Modified: trunk/examples/sdl/lcd/clock.pir
==============================================================================
--- trunk/examples/sdl/lcd/clock.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/lcd/clock.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -35,7 +35,7 @@
# create the SDL application object
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 21, 'width' => 94, 'bpp' => 16, 'flags' => 5 )
.local pmc screen
@@ -44,7 +44,7 @@
# create the LCD
.local pmc lcd
- lcd = new 'SDL::LCD'
+ lcd = new ['SDL'; 'LCD']
set_global 'LCD', lcd
# draw the watch
@@ -67,8 +67,8 @@
.local pmc eh
.local pmc loop
- eh = new 'SDL::EventHandler'
- loop = new 'SDL::Event'
+ eh = new ['SDL'; 'EventHandler']
+ loop = new ['SDL'; 'Event']
loop.'init'()
loop.'process_events'( 0.1, eh )
.end
Modified: trunk/examples/sdl/mandel.pir
==============================================================================
--- trunk/examples/sdl/mandel.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/mandel.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -72,7 +72,7 @@
.param pmc opts
# create an SDL::App subclass
.local pmc app, cl
- cl = subclass 'SDL::App', 'Mandel'
+ cl = subclass ['SDL'; 'App'], 'Mandel'
addattribute cl, 'xstart'
addattribute cl, 'ystart'
addattribute cl, 'xend'
@@ -128,7 +128,7 @@
# create an SDL::Rect representing the entire main screen
.local pmc rect
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
rect.'init'( 'height' => h, 'width' => w, 'x' => 0, 'y' => 0 )
setattribute self, 'rect', rect
@@ -397,11 +397,11 @@
# init event system
.sub 'init_events' :method
.local pmc event, args, event_handler
- event = new 'SDL::Event'
+ event = new ['SDL'; 'Event']
event.'init'()
setattribute self, 'event', event
- $P0 = subclass 'SDL::EventHandler', ['Mandel'; 'EventHandler']
+ $P0 = subclass ['SDL'; 'EventHandler'], ['Mandel'; 'EventHandler']
event_handler = new ['Mandel'; 'EventHandler']
event_handler.'init'(self) # XXX unused
setattribute self, 'event_handler', event_handler
@@ -444,7 +444,7 @@
loop_g:
b = 0
loop_b:
- col = new 'SDL::Color'
+ col = new ['SDL'; 'Color']
col.'init'( 'r' => r, 'g' => g, 'b' => b )
push palette, col
b += 36
Modified: trunk/examples/sdl/minesweeper/eventhandler.pir
==============================================================================
--- trunk/examples/sdl/minesweeper/eventhandler.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/minesweeper/eventhandler.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -6,7 +6,7 @@
=head1 SYNOPSIS
- $P0 = new "SDL::Event"
+ $P0 = new ['SDL'; 'Event']
$P1 = new "Mines::EventHandler"
Modified: trunk/examples/sdl/minesweeper/field.pir
==============================================================================
--- trunk/examples/sdl/minesweeper/field.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/minesweeper/field.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -132,11 +132,11 @@
field = new 'ResizablePMCArray'
cache = new 'ResizablePMCArray'
- watch = new 'SDL::StopWatch', screen
+ watch = new ['SDL'; 'StopWatch'], screen
watch.'xpos'( 515 )
watch.'ypos'( 5 )
- lcd = new 'SDL::LCD'
+ lcd = new ['SDL'; 'LCD']
# This seems to call __init() with too many parameters
# lcd = 0
lcd.'_digits'( 4 )
@@ -172,7 +172,7 @@
# button
$P0 = new 'String'
$P0 = "examples/sdl/minesweeper/smiley.png"
- $P0 = new "SDL::Button", $P0
+ $P0 = new ['SDL'; 'Button'], $P0
$P0.'states'( 5 )
$P0.'pos'( 305, 2 )
$P0.'size'( 30, 30 )
@@ -324,10 +324,10 @@
$P0['y'] = 0
$P0['width'] = 0
$P0['height'] = 0
- dest_rect = new "SDL::Rect", $P0
+ dest_rect = new ['SDL'; 'Rect'], $P0
$P0['width'] = FIELD_WIDTH
$P0['height'] = FIELD_HEIGHT
- src_rect = new "SDL::Rect", $P0
+ src_rect = new ['SDL'; 'Rect'], $P0
set size, width
mul size, height
@@ -975,12 +975,12 @@
$P0 = new 'String'
$P0 = "examples/sdl/minesweeper/mines.png"
- image = new "SDL::Image", $P0
+ image = new ['SDL'; 'Image'], $P0
set_hll_global [ "Mines::Field" ], "field", image
$P0 = new 'String'
$P0 = "examples/sdl/minesweeper/mines_debug.png"
- image = new "SDL::Image", $P0
+ image = new ['SDL'; 'Image'], $P0
set_hll_global [ "Mines::Field" ], "field_debug", image
newclass $P0, "Mines::Field"
Modified: trunk/examples/sdl/minesweeper/mines.pir
==============================================================================
--- trunk/examples/sdl/minesweeper/mines.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/minesweeper/mines.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -48,7 +48,7 @@
$P0["flags"] = 5
# create the SDL object
- $P0 = new "SDL::App", $P0
+ $P0 = new ['SDL'; 'App'], $P0
screen = $P0."surface"()
# choose a "random" field
@@ -71,7 +71,7 @@
field.'draw'()
# runloop
- $P0 = new "SDL::Event"
+ $P0 = new ['SDL'; 'Event']
$P1 = new "Mines::EventHandler"
$P0."process_events"( 0.1, $P1, field )
Modified: trunk/examples/sdl/move_parrot_logo.pir
==============================================================================
--- trunk/examples/sdl/move_parrot_logo.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/move_parrot_logo.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -25,7 +25,7 @@
.local pmc app
.local int app_type
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'width' => 640, 'height' => 480, 'bpp' => 0, 'flags' => 0 )
@@ -35,7 +35,7 @@
.local pmc black
.local int color_type
- black = new 'SDL::Color'
+ black = new ['SDL'; 'Color']
black.'init'( 'r' => 0, 'g' => 0, 'b' => 0 )
.local pmc image
@@ -43,7 +43,7 @@
.local string filename
- image = new 'SDL::Image'
+ image = new ['SDL'; 'Image']
filename = 'examples/sdl/parrot_small.png'
image.'init'( 'file' => filename )
@@ -53,12 +53,12 @@
.local pmc sprite
.local int sprite_type
- sprite = new 'SDL::Sprite'
+ sprite = new ['SDL'; 'Sprite']
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' => 0, 'dest_x' => 270, 'dest_y' => 212, 'bgcolor' => black )
.local pmc parent_class
.local pmc class_type
- get_class parent_class, 'SDL::EventHandler'
+ get_class parent_class, ['SDL'; 'EventHandler']
subclass class_type, parent_class, 'MoveLogo::EventHandler'
.local pmc event_handler
@@ -69,7 +69,7 @@
.local pmc event
.local int event_type
- event = new 'SDL::Event'
+ event = new ['SDL'; 'Event']
event.'init'()
.local pmc handler_args
Modified: trunk/examples/sdl/raw_pixels.pir
==============================================================================
--- trunk/examples/sdl/raw_pixels.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/raw_pixels.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -26,7 +26,7 @@
.local pmc app
.local int app_type
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 1 )
# fetch the SDL::Surface representing the main window
@@ -37,17 +37,17 @@
# create an SDL::Rect representing the entire main screen
.local pmc rect
.local int rect_type
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
rect.'init'( 'height' => 480, 'width' => 640, 'x' => 0, 'y' => 0 )
# create a white color to paint the background; make new pixels show up
.local pmc white
- white = new 'SDL::Color'
+ white = new ['SDL'; 'Color']
white.'init'( 'r' => 255, 'g' => 255, 'b' => 255 )
# create a blue color to paint the new pixels
.local pmc blue
- blue = new 'SDL::Color'
+ blue = new ['SDL'; 'Color']
blue.'init'( 'r' => 0, 'g' => 0, 'b' => 255 )
# draw the background
Modified: trunk/examples/sdl/tetris/app.pir
==============================================================================
--- trunk/examples/sdl/tetris/app.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/tetris/app.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -92,7 +92,7 @@
$P0["flags"] = 1
# create the SDL object
- $P0 = new "SDL::App", $P0
+ $P0 = new ['SDL'; 'App'], $P0
# store the SDL object
setattribute self, 'SDL', $P0
@@ -177,7 +177,7 @@
getattribute eh, self, 'EventHandler'
- loop = new "SDL::Event"
+ loop = new ['SDL'; 'Event']
self."enableTimer"()
loop."process_events"( 0.1, eh, self )
@@ -329,7 +329,7 @@
hash["r"] = r
hash["g"] = g
hash["b"] = b
- color = new "SDL::Color", hash
+ color = new ['SDL'; 'Color'], hash
push palette, color
inc i
@@ -837,7 +837,7 @@
rect["height"] = 480
rect["x"] = 0
rect["y"] = 0
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
color = self."color"( 3 )
screen."fill_rect"( temp, color )
@@ -856,7 +856,7 @@
rect["height"] = 480
rect["x"] = 0
rect["y"] = 0
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
screen."update_rect"( temp )
self."enableTimer"()
Modified: trunk/examples/sdl/tetris/block.pir
==============================================================================
--- trunk/examples/sdl/tetris/block.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/tetris/block.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -439,7 +439,7 @@
rect["y"] = yp
rect["width"] = i
rect["height"] = i
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
surface."fill_rect"( temp, color )
sub i, 2
@@ -450,7 +450,7 @@
rect["y"] = yp
rect["width"] = i
rect["height"] = i
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
# lookup the color value
$P0 = app."color"( 0 )
@@ -478,7 +478,7 @@
rect["y"] = yp
rect["width"] = extent
rect["height"] = extent
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
inc extent
surface."fill_rect"( temp, color )
SKIP:
Modified: trunk/examples/sdl/tetris/board.pir
==============================================================================
--- trunk/examples/sdl/tetris/board.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/tetris/board.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -648,7 +648,7 @@
rect["y"] = ypos
rect["width"] = xp
rect["height"] = yp
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
color = palette[15]
surface."fill_rect"( temp, color )
NO_FIELDBACKGROUND:
@@ -682,7 +682,7 @@
rect["y"] = yp
rect["width"] = $I0
rect["height"] = $I0
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
$I0 = self[i]
$I1 = cache[i]
@@ -734,7 +734,7 @@
rect["y"] = yp
rect["width"] = w
rect["height"] = h
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
color = palette[15]
surface."fill_rect"( temp, color )
inc xp
@@ -745,7 +745,7 @@
rect["y"] = yp
rect["width"] = w
rect["height"] = h
- temp = new "SDL::Rect", rect
+ temp = new ['SDL'; 'Rect'], rect
color = palette[0]
surface."fill_rect"( temp, color )
getprop temp, "nextblock", self
Modified: trunk/examples/sdl/tetris/eventhandler.pir
==============================================================================
--- trunk/examples/sdl/tetris/eventhandler.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/examples/sdl/tetris/eventhandler.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -13,7 +13,7 @@
unless null $P0 goto END
load_bytecode "library/SDL/EventHandler.pir"
- get_class $P0, "SDL::EventHandler"
+ get_class $P0, ['SDL'; 'EventHandler']
subclass $P0, $P0, "Tetris::EventHandler"
$P1 = new 'String'
$P1 = "BUILD"
@@ -41,7 +41,7 @@
app = self."app"()
app."setTimer"( 0 )
- $P0 = get_hll_global [ "SDL::Event" ], "disptach_event"
+ $P0 = get_hll_global ['SDL'; 'Event'], "disptach_event"
ret = $P0()
app."setTimer"( 1 )
.return (ret)
Modified: trunk/runtime/parrot/library/SDL.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -53,9 +53,9 @@
.include 'datatypes.pasm'
.macro store_nci_func( func_name, signature )
- c_func_name = prefix . .func_name
+ c_func_name = 'SDL_' . .func_name
dlfunc c_function, libsdl, c_func_name, .signature
- set_hll_global ['SDL::NCI'], .func_name, c_function
+ set_hll_global ['SDL'; 'NCI'], .func_name, c_function
.endm
.sub _sdl_init :load
@@ -63,7 +63,7 @@
.local pmc layouts
layouts = new 'OrderedHash'
- set_hll_global ['SDL::NCI'], 'layouts', layouts
+ set_hll_global ['SDL'; 'NCI'], 'layouts', layouts
# this order matters; trust me!
_set_Event_layout( layouts )
@@ -127,11 +127,6 @@
OK_HINT2:
printerr "Hint: create a link from libSDL-1.2.so.0 to libSDL_image.so to disable the error messages.\n"
OK:
- .local string namespace
- namespace = 'SDL::NCI'
-
- .local string prefix
- prefix = 'SDL_'
.local string c_func_name
.local pmc c_function
@@ -139,43 +134,43 @@
.store_nci_func( 'Init', 'ii' )
# dlfunc sdl_function, libsdl, 'SDL_Init', 'ii'
-# set_hll_global ['SDL::NCI'], 'Init', sdl_function
+# set_hll_global ['SDL'; 'NCI'], 'Init', sdl_function
dlfunc sdl_function, libsdl, 'SDL_SetVideoMode', 'piiil'
- set_hll_global ['SDL::NCI'], 'SetVideoMode', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'SetVideoMode', sdl_function
dlfunc sdl_function, libsdl, 'SDL_Quit', 'v'
- set_hll_global ['SDL::NCI'], 'Quit', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'Quit', sdl_function
dlfunc sdl_function, libsdl, 'SDL_FillRect', 'ippi'
- set_hll_global ['SDL::NCI'], 'FillRect', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'FillRect', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpdateRect', 'vpiiii'
- set_hll_global ['SDL::NCI'], 'UpdateRect', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'UpdateRect', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpdateRects', 'vpip'
- set_hll_global ['SDL::NCI'], 'UpdateRects', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'UpdateRects', sdl_function
dlfunc sdl_function, libsdl, 'SDL_Flip', 'ip'
- set_hll_global ['SDL::NCI'], 'Flip', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'Flip', sdl_function
dlfunc sdl_function, libsdl, 'SDL_FreeSurface', 'vp'
- set_hll_global ['SDL::NCI'], 'FreeSurface', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'FreeSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_LoadBMP_RW', 'ppi'
- set_hll_global ['SDL::NCI'], 'LoadBMP_RW', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'LoadBMP_RW', sdl_function
dlfunc sdl_function, libsdl, 'SDL_DisplayFormat', 'pp'
- set_hll_global ['SDL::NCI'], 'DisplayFormat', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'DisplayFormat', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpperBlit', 'ipppp'
- set_hll_global ['SDL::NCI'], 'BlitSurface', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'BlitSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_WaitEvent', 'ip'
- set_hll_global ['SDL::NCI'], 'WaitEvent', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'WaitEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_PollEvent', 'ip'
- set_hll_global ['SDL::NCI'], 'PollEvent', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'PollEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetKeyName', 'ti'
- set_hll_global ['SDL::NCI'], 'GetKeyName', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'GetKeyName', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetError', 'tv'
- set_hll_global ['SDL::NCI'], 'GetError', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'GetError', sdl_function
dlfunc sdl_function, libsdl, 'SDL_SetColorKey', 'ipii'
- set_hll_global ['SDL::NCI'], 'SetColorKey', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'SetColorKey', sdl_function
dlfunc sdl_function, libsdl, 'SDL_LockSurface', 'ip'
- set_hll_global ['SDL::NCI'], 'LockSurface', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'LockSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UnlockSurface', 'vp'
- set_hll_global ['SDL::NCI'], 'UnlockSurface', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'UnlockSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_CreateRGBSurface', 'piiiiiiii'
- set_hll_global ['SDL::NCI'], 'CreateRGBSurface', sdl_function
+ set_hll_global ['SDL'; 'NCI'], 'CreateRGBSurface', sdl_function
.end
=item _init_image()
@@ -214,7 +209,7 @@
printerr "Hint: create a link from libSDL_image-1.2.so.0 to libSDL_image.so to disable the error messages.\n"
OK:
dlfunc nci_sub, image_lib, 'IMG_Load', 'pt'
- set_hll_global ['SDL::NCI'], 'IMG_Load', nci_sub
+ set_hll_global ['SDL'; 'NCI'], 'IMG_Load', nci_sub
.end
=item _init_ttf()
@@ -240,7 +235,7 @@
dlfunc nci_sub, ttf_lib, 'TTF_Init', 'i'
unless nci_sub goto error
- set_hll_global ['SDL::NCI::TTF'], 'Init', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'Init', nci_sub
# TTF_init() returns 0 if successful, -1 on error
.local int initialized
@@ -256,36 +251,36 @@
success:
dlfunc nci_sub, ttf_lib, 'TTF_OpenFont', 'pti'
- set_hll_global ['SDL::NCI::TTF'], 'OpenFont', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'OpenFont', nci_sub
#RNH changes: all text routines expect an integer, not a pmc, for color parameter
dlfunc nci_sub, ttf_lib, 'TTF_RenderText_Solid', 'ppti'
- set_hll_global ['SDL::NCI::TTF'], 'RenderText_Solid', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'RenderText_Solid', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Solid', 'ppti'
- set_hll_global ['SDL::NCI::TTF'], 'RenderUTF8_Solid', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'RenderUTF8_Solid', nci_sub
# this one could be wrong
dlfunc nci_sub, ttf_lib, 'TTF_RenderUNICODE_Solid', 'ppti'
- set_hll_global ['SDL::NCI::TTF'], 'RenderUNICODE_Solid', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'RenderUNICODE_Solid', nci_sub
# RNH Additions. Add UTF8_Shaded and FontLine skip
dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Shaded', 'pptii'
- set_hll_global ['SDL::NCI::TTF'], 'RenderUTF8_Shaded', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'RenderUTF8_Shaded', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_FontLineSkip', 'ip'
- set_hll_global ['SDL::NCI::TTF'], 'FontLineSkip', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'FontLineSkip', nci_sub
#end additions
dlfunc nci_sub, ttf_lib, 'TTF_SizeText', 'ipt33'
- set_hll_global ['SDL::NCI::TTF'], 'SizeText', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'SizeText', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_SizeUTF8', 'ipt33'
- set_hll_global ['SDL::NCI::TTF'], 'SizeUTF8', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'SizeUTF8', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_SizeUNICODE', 'ipt33'
- set_hll_global ['SDL::NCI::TTF'], 'SizeUNICODE', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'SizeUNICODE', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_CloseFont', 'vp'
- set_hll_global ['SDL::NCI::TTF'], 'CloseFont', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'CloseFont', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_Quit', 'vv'
- set_hll_global ['SDL::NCI::TTF'], 'Quit', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'Quit', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_WasInit', 'iv'
- set_hll_global ['SDL::NCI::TTF'], 'WasInit', nci_sub
+ set_hll_global ['SDL'; 'NCI'; 'TTF'], 'WasInit', nci_sub
.end
.sub _set_Event_layout
@@ -429,7 +424,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL'; 'NCI'], 'fetch_struct'
.local pmc rect
rect = fetch_struct( 'Rect', 0 )
@@ -453,7 +448,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL'; 'NCI'], 'fetch_struct'
# SDL_PixelFormat struct pointer
.local pmc pixelformat
@@ -553,7 +548,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL'; 'NCI'], 'fetch_struct'
.local pmc palette
palette = fetch_struct( 'Palette', 0 )
@@ -625,7 +620,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL'; 'NCI'], 'fetch_struct'
.local pmc color
color = fetch_struct( 'Color', 0 )
@@ -716,7 +711,7 @@
=cut
-.namespace [ 'SDL::NCI' ]
+.namespace [ 'SDL'; 'NCI' ]
.sub fetch_struct
.param string struct_name
@@ -726,7 +721,7 @@
.local pmc struct
# .local pmc fetch_layout
-# fetch_layout = get_hll_global ['SDL::NCI'], 'fetch_layout'
+# fetch_layout = get_hll_global ['SDL'; 'NCI'], 'fetch_layout'
initializer = fetch_layout( struct_name )
if managed == 1 goto build_managed
@@ -746,7 +741,7 @@
.local pmc layouts
.local pmc layout
- layouts = get_hll_global ['SDL::NCI'], 'layouts'
+ layouts = get_hll_global ['SDL'; 'NCI'], 'layouts'
exists $I0, layouts[ layout_name ]
if $I0 goto found
Modified: trunk/runtime/parrot/library/SDL/App.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/App.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/App.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -13,7 +13,7 @@
# create a new SDL::App object
.local pmc app
- app = new 'SDL::App'
+ app = new ['SDL'; 'App']
# set the app's arguments
.local pmc app_args
@@ -62,7 +62,7 @@
=cut
-.namespace [ 'SDL::App' ]
+.namespace [ 'SDL'; 'App' ]
.sub _initialize :load
@@ -73,7 +73,7 @@
.local pmc app_class
- newclass app_class, 'SDL::App'
+ newclass app_class, ['SDL'; 'App']
addattribute app_class, 'height'
addattribute app_class, 'width'
addattribute app_class, 'bpp'
@@ -121,7 +121,7 @@
.param int flags :named('flags')
.local pmc SetVideoMode
- SetVideoMode = get_hll_global ['SDL::NCI'], 'SetVideoMode'
+ SetVideoMode = get_hll_global ['SDL'; 'NCI'], 'SetVideoMode'
.local pmc screen
screen = SetVideoMode( width, height, bpp, flags )
@@ -129,7 +129,7 @@
# defined $I0, screen
.local pmc main_surface
- new main_surface, 'SDL::Surface'
+ new main_surface, ['SDL'; 'Surface']
main_surface.'wrap_surface'( screen )
@@ -178,7 +178,7 @@
.sub quit :method
.local pmc SDL_Quit
- SDL_Quit = get_hll_global ['SDL::NCI'], 'Quit'
+ SDL_Quit = get_hll_global ['SDL'; 'NCI'], 'Quit'
SDL_Quit()
.end
Modified: trunk/runtime/parrot/library/SDL/Button.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Button.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Button.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -11,7 +11,7 @@
$P0 = "filename/to/image.png"
# create the button
- button = new 'SDL::Button', $P0
+ button = new ['SDL'; 'Button'], $P0
# set the position
button.'xpos'( 10 )
@@ -41,16 +41,16 @@
=cut
-.namespace ['SDL::Button']
+.namespace ['SDL'; 'Button']
.sub __onload :load
.local pmc class
- class = get_class 'SDL::Button'
+ class = get_class ['SDL'; 'Button']
if_null class, define_class
.return()
define_class:
- newclass class, 'SDL::Button'
+ newclass class, ['SDL'; 'Button']
addattribute class, 'image'
addattribute class, 'status'
addattribute class, 'states'
@@ -66,7 +66,7 @@
.sub init_pmc :vtable :method
.param pmc name
- $P0 = new 'SDL::Image', name
+ $P0 = new ['SDL'; 'Image'], name
setattribute self, 'image', $P0
$P0 = new 'Integer'
@@ -77,7 +77,7 @@
$P0 = 1
setattribute self, 'states', $P0
- $P0 = new 'SDL::Rect'
+ $P0 = new ['SDL'; 'Rect']
setattribute self, 'rect', $P0
$P0 = new 'Integer'
@@ -173,7 +173,7 @@
drect = getattribute self, 'rect'
clicked = getattribute self, 'clicked'
- srect = new 'SDL::Rect'
+ srect = new ['SDL'; 'Rect']
$I1 = drect.'height'()
srect.'height'( $I1 )
Modified: trunk/runtime/parrot/library/SDL/Color.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Color.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Color.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -11,7 +11,7 @@
# create a new SDL::Color object
.local pmc color
- color = new 'SDL::Color'
+ color = new ['SDL'; 'Color']
# set the color values; this one's blue
color.'init'( 'r' => 0, 'g' => 0, 'b' => 255 )
@@ -41,13 +41,13 @@
=cut
-.namespace [ 'SDL::Color' ]
+.namespace [ 'SDL'; 'Color' ]
.sub _initialize :load
.local pmc color_class
- newclass color_class, 'SDL::Color'
+ newclass color_class, ['SDL'; 'Color']
addattribute color_class, 'color'
addattribute color_class, 'r'
@@ -86,7 +86,7 @@
.param int blue :named( 'b' )
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Color' )
Modified: trunk/runtime/parrot/library/SDL/Constants.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Constants.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Constants.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -24,7 +24,7 @@
=cut
-.namespace [ 'SDL::Constants' ]
+.namespace [ 'SDL'; 'Constants' ]
.sub _initialize :load
@@ -47,7 +47,7 @@
key_names = new 'FixedPMCArray'
key_names = 323
- set_hll_global ['SDL::Constants'], 'key_names', key_names
+ set_hll_global ['SDL'; 'Constants'], 'key_names', key_names
# list created with:
# $ cat /usr/include/SDL/SDL_keysym.h |
Modified: trunk/runtime/parrot/library/SDL/Event.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Event.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Event.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -12,7 +12,7 @@
# create a new SDL::Event object
.local pmc event
- event = new 'SDL::Event'
+ event = new ['SDL'; 'Event']
# ... create a new event_handler and its hander_args
@@ -39,12 +39,12 @@
=cut
-.namespace [ 'SDL::Event' ]
+.namespace [ 'SDL'; 'Event' ]
.sub _initialize :load
.local pmc event_class
- newclass event_class, 'SDL::Event'
+ newclass event_class, ['SDL'; 'Event']
addattribute event_class, 'event'
.end
@@ -60,7 +60,7 @@
.sub 'init' :method
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Event::Generic' )
@@ -92,7 +92,7 @@
assign_event:
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc layout
.local string ename
@@ -189,7 +189,7 @@
key_sym = event['sym']
.local pmc key_names
- get_hll_global key_names, ['SDL::Constants'], 'key_names'
+ get_hll_global key_names, ['SDL'; 'Constants'], 'key_names'
.local string key_name
key_name = key_names[ key_sym ]
@@ -241,13 +241,13 @@
if check_interval < 0.0001 goto use_wait
polling = 1
- GetEvent = get_hll_global ['SDL::NCI'], 'PollEvent'
+ GetEvent = get_hll_global ['SDL'; 'NCI'], 'PollEvent'
branch loop
use_wait:
polling = 0
- GetEvent = get_hll_global ['SDL::NCI'], 'WaitEvent'
+ GetEvent = get_hll_global ['SDL'; 'NCI'], 'WaitEvent'
loop:
event = self.'event'( 'Generic' )
@@ -288,7 +288,7 @@
event = self.'event'()
.local pmc PollEvent
- get_hll_global PollEvent, ['SDL::NCI'], 'PollEvent'
+ get_hll_global PollEvent, ['SDL'; 'NCI'], 'PollEvent'
.local int event_waiting
event_waiting = PollEvent( event )
Modified: trunk/runtime/parrot/library/SDL/EventHandler.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/EventHandler.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/EventHandler.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -15,8 +15,8 @@
.local pmc parent_class
.local pmc class_type
- get_class parent_class, 'SDL::EventHandler'
- subclass class_type, parent_class, 'My::Event::Handler'
+ get_class parent_class, ['SDL'; 'EventHandler']
+ subclass class_type, parent_class, ['My'; 'Event'; 'Handler']
# define your overridden methods
.sub key_down_down :method
@@ -40,7 +40,7 @@
# create a new event object
.local pmc event
- event = new 'SDL::Event'
+ event = new ['SDL'; 'Event']
# ... and process events
event.'process_events'( event_handler, handler_args )
@@ -59,12 +59,12 @@
=cut
-.namespace [ 'SDL::EventHandler' ]
+.namespace [ 'SDL'; 'EventHandler' ]
.sub _initialize :load
.local pmc handler_class
- newclass handler_class, 'SDL::EventHandler'
+ newclass handler_class, ['SDL'; 'EventHandler']
addattribute handler_class, 'args'
.return()
Modified: trunk/runtime/parrot/library/SDL/Font.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Font.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Font.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -12,7 +12,7 @@
# create a new SDL::Font object
.local pmc font
- font = new 'SDL::Font'
+ font = new ['SDL'; 'Font']
font.'init'( 'font_file' => 'myfont.ttf', 'point_size' => 48 )
@@ -35,7 +35,7 @@
=cut
-.namespace [ 'SDL::Font' ]
+.namespace [ 'SDL'; 'Font' ]
.sub _sdl_init :load
.local pmc init_ttf
@@ -44,7 +44,7 @@
.local pmc font_class
- newclass font_class, 'SDL::Font'
+ newclass font_class, ['SDL'; 'Font']
addattribute font_class, 'font'
addattribute font_class, 'size'
@@ -65,7 +65,7 @@
.param int font_size :named( 'point_size' )
.local pmc OpenFont
- OpenFont = get_hll_global ['SDL::NCI::TTF'], 'OpenFont'
+ OpenFont = get_hll_global ['SDL'; 'NCI'; 'TTF'], 'OpenFont'
.local pmc font
font = OpenFont( font_name, font_size )
@@ -106,7 +106,7 @@
h = font_surface.'height'()
.local pmc rect
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
rect.'init'( 'x' => 0, 'y' => 0, 'height' => h, 'width' => w )
@@ -133,12 +133,12 @@
font = self.'font'()
.local pmc font_surface
- font_surface = new 'SDL::Surface'
+ font_surface = new ['SDL'; 'Surface']
font_surface.'init'( 'height' => 0, 'width' => 0 )
# RNH use RenderUTF8 in preference to RenderText by default
.local pmc RenderUTF8_Solid
- get_hll_global RenderUTF8_Solid, ['SDL::NCI::TTF'], 'RenderUTF8_Solid'
+ get_hll_global RenderUTF8_Solid, ['SDL'; 'NCI'; 'TTF'], 'RenderUTF8_Solid'
.local int color
# RNH font routine takes color in the order rgb rather than bgr used by surface.pir hence cannot rely on color.get_integer
Modified: trunk/runtime/parrot/library/SDL/Image.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Image.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Image.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -12,7 +12,7 @@
# create a new SDL::Image object
.local pmc image
- image = new 'SDL::Image'
+ image = new ['SDL'; 'Image']
image.'init'( file => 'examples/sdl/parrot_small.png' )
# blit and update this object as you like!
@@ -33,12 +33,12 @@
=cut
-.namespace [ 'SDL::Image' ]
+.namespace [ 'SDL'; 'Image' ]
.sub _initialize :load
.local pmc image_class
- image_class = get_class 'SDL::Image'
+ image_class = get_class ['SDL'; 'Image']
if_null image_class, create_class
.return()
@@ -47,7 +47,7 @@
init_image = get_hll_global ['SDL'], '_init_image'
init_image()
- subclass image_class, 'SDL::Surface', 'SDL::Image'
+ subclass image_class, ['SDL'; 'Surface'], ['SDL'; 'Image']
.return()
.end
@@ -62,7 +62,7 @@
.param string filename :named( 'file' )
.local pmc IMG_Load
- IMG_Load = get_hll_global ['SDL::NCI'], 'IMG_Load'
+ IMG_Load = get_hll_global ['SDL'; 'NCI'], 'IMG_Load'
.local pmc image
Modified: trunk/runtime/parrot/library/SDL/LCD.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/LCD.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/LCD.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -8,7 +8,7 @@
=head1 SYNOPSIS
# create an LCD
- lcd = new 'SDL::LCD'
+ lcd = new ['SDL'; 'LCD']
# set the LCD position
lcd."xpos"( 10 )
@@ -36,11 +36,11 @@
=cut
-.namespace ["SDL::LCD"]
+.namespace ['SDL'; 'LCD']
.sub __onload :load
.local pmc class
- class = get_class 'SDL::LCD'
+ class = get_class ['SDL'; 'LCD']
if_null class, create_class
.return()
@@ -49,11 +49,11 @@
load_bytecode 'SDL/Rect.pir'
.local pmc digits
- digits = new 'SDL::Image'
+ digits = new ['SDL'; 'Image']
digits.'init'( 'runtime/parrot/library/SDL/LCD.png' )
set_global 'digits', digits
- newclass class, 'SDL::LCD'
+ newclass class, ['SDL'; 'LCD']
addattribute class, 'value'
addattribute class, 'numdigits'
addattribute class, 'xpos'
@@ -162,14 +162,14 @@
val = $S0
LEN_OK:
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
rect.'init'()
rect.'width'( 21 )
rect.'height'( 21 )
rect.'x'( 0 )
rect.'y'( 0 )
- drect = new 'SDL::Rect'
+ drect = new ['SDL'; 'Rect']
drect.'init'()
drect.'width'( 10 )
drect.'height'( 21 )
Modified: trunk/runtime/parrot/library/SDL/Rect.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Rect.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Rect.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -12,7 +12,7 @@
# create a new SDL::Rect object
.local pmc rect
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
# now set the arguments on the object
rect.'init'( 'x' => 270, 'y' => 190, 'height' => 100, 'width'=> 100 )
@@ -33,16 +33,16 @@
=cut
-.namespace [ 'SDL::Rect' ]
+.namespace [ 'SDL'; 'Rect' ]
.sub _initialize :load
.local pmc class
- class = get_class 'SDL::Rect'
+ class = get_class ['SDL'; 'Rect']
if_null class, create_class
.return()
create_class:
- newclass class, 'SDL::Rect'
+ newclass class, ['SDL'; 'Rect']
addattribute class, '_rect'
.return ()
.end
@@ -105,7 +105,7 @@
check_done:
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Rect' )
Modified: trunk/runtime/parrot/library/SDL/Sprite.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Sprite.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Sprite.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -14,7 +14,7 @@
# create a new SDL::Sprite object
.local pmc sprite
- sprite = new 'SDL::Sprite'
+ sprite = new ['SDL'; 'Sprite']
# set the sprite's arguments
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' => 0, 'dest_x' => 270, 'dest_y' => 212, 'bgcolor' => black )
@@ -43,12 +43,12 @@
=cut
-.namespace [ 'SDL::Sprite' ]
+.namespace [ 'SDL'; 'Sprite' ]
.sub _initialize :load
.local pmc sprite_class
- newclass sprite_class, 'SDL::Sprite'
+ newclass sprite_class, ['SDL'; 'Sprite']
addattribute sprite_class, 'surface'
addattribute sprite_class, 'source_rect'
@@ -143,14 +143,14 @@
done:
# first the source rectangle
.local pmc source_rect
- source_rect = new 'SDL::Rect'
+ source_rect = new ['SDL'; 'Rect']
source_rect.'init'( 'x' => source_x, 'y' => source_y, 'height' => height, 'width' => width )
setattribute self, 'source_rect', source_rect
# now the dest rectangle
.local pmc rect
- rect = new 'SDL::Rect'
+ rect = new ['SDL'; 'Rect']
rect.'init'( 'x' => dest_x, 'y' => dest_y )
setattribute self, 'rect', rect
@@ -158,7 +158,7 @@
# and now the previous rect
.local pmc prev_rect
- prev_rect = new 'SDL::Rect'
+ prev_rect = new ['SDL'; 'Rect']
prev_rect.'init'( 'x' => source_x, 'y' => source_y, 'height' => height, 'width' => width )
setattribute self, 'prev_rect', prev_rect
@@ -170,13 +170,13 @@
# the drawn rect
.local pmc drawn_rect
- drawn_rect = new 'SDL::Rect'
+ drawn_rect = new ['SDL'; 'Rect']
drawn_rect.'init'( 'x' => source_x, 'y' => source_y, 'height' => height, 'width' => width )
setattribute self, 'drawn_rect', drawn_rect
# the undrawn rect
.local pmc undrawn_rect
- undrawn_rect = new 'SDL::Rect'
+ undrawn_rect = new ['SDL'; 'Rect']
undrawn_rect.'init'( 'x' => source_x, 'y' => source_y, 'height' => height, 'width' => width )
setattribute self, 'undrawn_rect', undrawn_rect
Modified: trunk/runtime/parrot/library/SDL/StopWatch.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/StopWatch.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/StopWatch.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -8,7 +8,7 @@
=head1 SYNOPSIS
# create the stopwatch
- watch = new 'SDL::StopWatch', screen
+ watch = new ['SDL'; 'StopWatch'], screen
# set its position
watch.'xpos'( 5 )
@@ -33,18 +33,18 @@
.include "timer.pasm"
.include "iterator.pasm"
-.namespace ['SDL::StopWatch']
+.namespace ['SDL'; 'StopWatch']
.sub __onload :load
.local pmc class
- class = get_class 'SDL::StopWatch'
+ class = get_class ['SDL'; 'StopWatch']
if_null class, create_class
.return()
create_class:
load_bytecode "SDL/LCD.pir"
- class = get_class 'SDL::LCD'
- class = subclass class, 'SDL::StopWatch'
+ class = get_class ['SDL'; 'LCD']
+ class = subclass class, ['SDL'; 'StopWatch']
addattribute $P0, 'time'
addattribute $P0, 'precision'
addattribute $P0, 'start'
@@ -125,7 +125,7 @@
time $N0
start = $N0
- $P0 = find_global "SDL::StopWatch::Timer", "addWatch"
+ $P0 = find_global ['SDL'; 'StopWatch'; 'Timer'], "addWatch"
$P0( self )
END:
.end
@@ -161,7 +161,7 @@
total = $N0
start = 0
- $P0 = find_global "SDL::StopWatch::Timer", "removeWatch"
+ $P0 = find_global ['SDL'; 'StopWatch'; 'Timer'], "removeWatch"
$P0( self )
END:
.end
@@ -244,20 +244,20 @@
.local pmc screen
screen = getattribute self, 'screen'
- $P0 = find_global "SDL::LCD", "draw"
+ $P0 = find_global ['SDL'; 'LCD'], "draw"
$P0( screen )
.end
-.namespace ["SDL::StopWatch::Timer"]
+.namespace ['SDL'; 'StopWatch'; 'Timer']
.sub __onload :load
# XXX: an old array will be overwritten when loading this file again
$P0 = new 'ResizablePMCArray'
- store_global "SDL::StopWatch::Timer", "array", $P0
+ store_global ['SDL'; 'StopWatch'; 'Timer'], "array", $P0
$P0 = new 'FixedPMCArray'
- $P1 = find_global "SDL::StopWatch::Timer", "tick"
+ $P1 = find_global ['SDL'; 'StopWatch'; 'Timer'], "tick"
$P0 = 8
$P0[0] = .PARROT_TIMER_NSEC
$P0[1] = 0.1
@@ -269,15 +269,15 @@
$P0[7] = 0
$P0 = new 'Timer', $P0
- store_global "SDL::StopWatch::Timer", "timer", $P0
+ store_global ['SDL'; 'StopWatch'; 'Timer'], "timer", $P0
.end
.sub tick
.local pmc timer
.local pmc array
- timer = find_global "SDL::StopWatch::Timer", "timer"
- array = find_global "SDL::StopWatch::Timer", "array"
+ timer = find_global ['SDL'; 'StopWatch'; 'Timer'], "timer"
+ array = find_global ['SDL'; 'StopWatch'; 'Timer'], "array"
$I0 = array
if $I0 == 0 goto DISABLE
@@ -303,8 +303,8 @@
.local pmc timer
.local pmc array
- timer = find_global "SDL::StopWatch::Timer", "timer"
- array = find_global "SDL::StopWatch::Timer", "array"
+ timer = find_global ['SDL'; 'StopWatch'; 'Timer'], "timer"
+ array = find_global ['SDL'; 'StopWatch'; 'Timer'], "array"
push array, obj
timer[.PARROT_TIMER_RUNNING] = 1
@@ -315,8 +315,8 @@
.local pmc timer
.local pmc array
- timer = find_global "SDL::StopWatch::Timer", "timer"
- array = find_global "SDL::StopWatch::Timer", "array"
+ timer = find_global ['SDL'; 'StopWatch'; 'Timer'], "timer"
+ array = find_global ['SDL'; 'StopWatch'; 'Timer'], "array"
# XXX: stops all watches ATM; just remove the timer from the array
timer[.PARROT_TIMER_RUNNING] = 0
Modified: trunk/runtime/parrot/library/SDL/Surface.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Surface.pir Sun Feb 28 05:12:29 2010 (r44546)
+++ trunk/runtime/parrot/library/SDL/Surface.pir Sun Feb 28 06:02:31 2010 (r44547)
@@ -11,7 +11,7 @@
load_bytecode 'SDL/Surface.pir'
# create a new SDL::Surface object
- surface = new 'SDL::Surface'
+ surface = new ['SDL'; 'Surface']
surface.'init'( 'height' => 480, 'width' => 640 )
# ... blit to, fill, update, and flip this surface as necessary
@@ -32,16 +32,16 @@
=cut
-.namespace [ 'SDL::Surface' ]
+.namespace [ 'SDL'; 'Surface' ]
.sub _initialize :load
.local pmc class
- class = get_class 'SDL::Surface'
+ class = get_class ['SDL'; 'Surface']
if_null class, create_class
.return()
create_class:
- newclass class, 'SDL::Surface'
+ newclass class, ['SDL'; 'Surface']
addattribute class, 'surface'
.end
@@ -92,7 +92,7 @@
alpha = 0
create_surface:
- SDL_CreateRGBSurface = get_hll_global ['SDL::NCI'], 'CreateRGBSurface'
+ SDL_CreateRGBSurface = get_hll_global ['SDL'; 'NCI'], 'CreateRGBSurface'
.local pmc surface
surface = SDL_CreateRGBSurface( flags, width, height, depth, red, green, blue, alpha )
@@ -115,7 +115,7 @@
.param pmc surface_struct
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Surface' )
@@ -207,7 +207,7 @@
.param pmc color_object
.local pmc SDL_FillRect
- SDL_FillRect = get_hll_global ['SDL::NCI'], 'FillRect'
+ SDL_FillRect = get_hll_global ['SDL'; 'NCI'], 'FillRect'
.local pmc surface
getattribute surface, self, 'surface'
@@ -248,7 +248,7 @@
width = rect.'width'()
.local pmc SDL_UpdateRect
- SDL_UpdateRect = get_hll_global ['SDL::NCI'], 'UpdateRect'
+ SDL_UpdateRect = get_hll_global ['SDL'; 'NCI'], 'UpdateRect'
SDL_UpdateRect( surface, x, y, width, height )
.end
@@ -267,7 +267,7 @@
set count, rects
.local pmc fetch_layout
- get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL'; 'NCI'], 'fetch_layout'
.local pmc rect_array_layout
@@ -309,7 +309,7 @@
getattribute surface, self, 'surface'
.local pmc UpdateRects
- UpdateRects = get_hll_global ['SDL::NCI'], 'UpdateRects'
+ UpdateRects = get_hll_global ['SDL'; 'NCI'], 'UpdateRects'
UpdateRects( surface, count, rect_array )
.end
@@ -327,7 +327,7 @@
getattribute surface, self, 'surface'
.local pmc SDL_Flip
- SDL_Flip = get_hll_global ['SDL::NCI'], 'Flip'
+ SDL_Flip = get_hll_global ['SDL'; 'NCI'], 'Flip'
SDL_Flip( surface )
@@ -351,7 +351,7 @@
.param pmc dest
.local pmc SDL_BlitSurface
- SDL_BlitSurface = get_hll_global ['SDL::NCI'], 'BlitSurface'
+ SDL_BlitSurface = get_hll_global ['SDL'; 'NCI'], 'BlitSurface'
.local pmc source_surface
.local pmc dest_surface
@@ -400,7 +400,7 @@
getattribute surface, self, 'surface'
.local pmc SetColorKey
- SetColorKey = get_hll_global ['SDL::NCI'], 'SetColorKey'
+ SetColorKey = get_hll_global ['SDL'; 'NCI'], 'SetColorKey'
SetColorKey( surface, 8, color_value )
.end
@@ -435,7 +435,7 @@
surface = self.'surface'()
.local pmc LockSurface
- get_hll_global LockSurface, ['SDL::NCI'], 'LockSurface'
+ get_hll_global LockSurface, ['SDL'; 'NCI'], 'LockSurface'
LockSurface( surface )
@@ -453,7 +453,7 @@
surface = self.'surface'()
.local pmc UnlockSurface
- get_hll_global UnlockSurface, ['SDL::NCI'], 'UnlockSurface'
+ get_hll_global UnlockSurface, ['SDL'; 'NCI'], 'UnlockSurface'
UnlockSurface( surface )
More information about the parrot-commits
mailing list