Author: Lars Wassermann <[email protected]>
Branch:
Changeset: r114:2e5bc464d264
Date: 2013-03-04 12:52 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/2e5bc464d264/
Log: updated the bedisplay primitive and the according constants
diff --git a/spyvm/constants.py b/spyvm/constants.py
--- a/spyvm/constants.py
+++ b/spyvm/constants.py
@@ -71,7 +71,7 @@
SO_BLOCKCONTEXT_CLASS = 11
SO_POINT_CLASS = 12
SO_LARGEPOSITIVEINTEGER_CLASS = 13
-SO_DISPLAY_CLASS = 14
+SO_DISPLAY_OBJECT = 14
SO_MESSAGE_CLASS = 15
SO_COMPILEDMETHOD_CLASS = 16
SO_LOW_SPACE_SEMAPHORE = 17
@@ -113,7 +113,6 @@
"BlockClosure" : SO_BLOCKCLOSURE_CLASS,
"Point" : SO_POINT_CLASS,
"LargePositiveInteger" : SO_LARGEPOSITIVEINTEGER_CLASS,
-# "Display" : SO_DISPLAY_CLASS,
# "Message" : SO_MESSAGE_CLASS,
"CompiledMethod" : SO_COMPILEDMETHOD_CLASS,
"Semaphore" : SO_SEMAPHORE_CLASS,
@@ -133,6 +132,7 @@
"schedulerassociationpointer" : SO_SCHEDULERASSOCIATIONPOINTER,
"special_selectors": SO_SPECIAL_SELECTORS_ARRAY,
"smalltalkdict" : SO_SMALLTALK,
+ "display" : SO_DISPLAY_OBJECT,
}
LONG_BIT = 32
diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -530,6 +530,9 @@
@expose_primitive(BE_DISPLAY, unwrap_spec=[object])
def func(interp, s_frame, w_rcvr):
+ if not isinstance(w_rcvr, model.W_PointersObject) or w_rcvr.size() < 4:
+ raise PrimitiveFailedError
+ # the fields required are bits (a pointer to a Bitmap), width, height,
depth
interp.space.objtable['w_display'] = w_rcvr
return w_rcvr
diff --git a/spyvm/todo.txt b/spyvm/todo.txt
--- a/spyvm/todo.txt
+++ b/spyvm/todo.txt
@@ -15,7 +15,7 @@
[ ] SMALLINT_AS_FLOAT = 40 # essential
# the following are for graphics
[ ] BE_CURSOR = 101 # this primitive has two different implementations,
dependent on the argument count
-[ ] BE_DISPLAY = 102
+[ ] DRAW_RECTANGLE = 127
[ ] GET_NEXT_EVENT = 94
ReValidate primitives
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit