Update of /cvsroot/wnd/wnd/wnd/gdi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30946
Modified Files:
bitmap.py font.py
Log Message:
bit of this and a bit of that
Index: font.py
===================================================================
RCS file: /cvsroot/wnd/wnd/wnd/gdi/font.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** font.py 29 Apr 2005 15:24:25 -0000 1.1.1.1
--- font.py 23 Jul 2005 19:29:33 -0000 1.2
***************
*** 250,254 ****
# TODO just a raw version so far
#
! # flags 'path_ellipsis', 'word_ellipsis', 'wordbreak' + some other DrawText flags are not implemented
# check flags
--- 250,254 ----
# TODO just a raw version so far
#
! # flags 'path_ellipsis', 'word_ellipsis', 'wordbreak' + some other DrawText flags are not yet implemented
# check flags
***************
*** 382,387 ****
#----------------------------------------------------------------------------------------------------------------
- def TextOutEx(self, dc, text, x, y, rect=None, spacing=None, *flags):
options = { 'opaque':2,'clipped':4,'glyph_index':16,'rtlreading':128}
flag = 0
--- 382,387 ----
#----------------------------------------------------------------------------------------------------------------
+ def TextOutEx(self, dc, text, x, y, *flags, **kwargs):
options = { 'opaque':2,'clipped':4,'glyph_index':16,'rtlreading':128}
flag = 0
***************
*** 389,396 ****
--- 389,400 ----
try: flag |= options[i]
except: raise ValueError("invalid flag: %s" % i)
+
+ rect= kwargs.get('rect')
if rect: rect = byref(rect)
+ spacing= kwargs.get('spacing')
if spacing:
arrSp=(c_int*len(spacing))(*spacing)
spacing = byref(arrSp)
+
hOldObject = gdi32.SelectObject(dc.handle, self.handle)
if not hOldObject: raise RuntimeError("invalid font")
Index: bitmap.py
===================================================================
RCS file: /cvsroot/wnd/wnd/wnd/gdi/bitmap.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** bitmap.py 29 Apr 2005 15:24:41 -0000 1.1.1.1
--- bitmap.py 23 Jul 2005 19:29:33 -0000 1.2
***************
*** 9,13 ****
from wnd.gdi.trackhandles import TrackHandler
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
! __all__= ("SYSTEM_BITMAPS", "FlipDibBits", "BitmapFromHandle", "DisposableBitmap", "CompatibleBitmap", "BitmapFromFile", "SystemBitmap")
SYSTEM_BITMAPS = {
--- 9,14 ----
from wnd.gdi.trackhandles import TrackHandler
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
! __all__= ("SYSTEM_BITMAPS", "FlipDibBits", "BitmapFromHandle", "DisposableBitmap", "CompatibleBitmap", "BitmapFromFile",
! "SystemBitmap", "BitmapFromBytes")
SYSTEM_BITMAPS = {
***************
*** 321,325 ****
--- 322,332 ----
BitmapFromHandle.__init__(self, handle)
+ #**************************************************
+ class BitmapFromBytes(BitmapFromHandle):
+ def __init__(self, w, h, colorplanes, bits, bytes):
+ handle = gdi32.CreateBitmap(w, h, colorplanes, bits, byref(bytes))
+ if not handle: raise RuntimeError("could not create bitmap")
+ BitmapFromHandle.__init__(self, handle)
|