undead.stream.* is now deprecated.

This commit is contained in:
haru-s 2024-03-31 15:35:48 +09:00
parent c95bfdf95f
commit b5cb580f2d
3 changed files with 23 additions and 23 deletions

View file

@ -1391,7 +1391,7 @@ public:
/// ///
final HENHMETAFILE handle() @property // getter HENHMETAFILE handle() @property // getter
{ {
return hemf; return hemf;
} }
@ -1469,10 +1469,10 @@ class Picture: Image // docmain
/// ///
// Throws exception on failure. // Throws exception on failure.
this(DStream stm) deprecated this(DStream stm)
{ {
this.ipic = _fromDStream(stm); _ipicture = _fromDStream(stm);
if(!this.ipic) if(!_ipicture)
throw new DflException("Unable to load picture from stream"); throw new DflException("Unable to load picture from stream");
} }
@ -1480,8 +1480,8 @@ class Picture: Image // docmain
// Throws exception on failure. // Throws exception on failure.
this(Dstring fileName) this(Dstring fileName)
{ {
this.ipic = _fromFileName(fileName); _ipicture = _fromFileName(fileName);
if(!this.ipic) if(!_ipicture)
throw new DflException("Unable to load picture from file '" ~ fileName ~ "'"); throw new DflException("Unable to load picture from file '" ~ fileName ~ "'");
} }
@ -1489,21 +1489,21 @@ class Picture: Image // docmain
/// ditto /// ditto
this(void[] mem) this(void[] mem)
{ {
this.ipic = _fromMemory(mem); _ipicture = _fromMemory(mem);
if(!this.ipic) if(!_ipicture)
throw new DflException("Unable to load picture from memory"); throw new DflException("Unable to load picture from memory");
} }
private this(dfl.internal.wincom.IPicture ipic) private this(dfl.internal.wincom.IPicture ipic)
{ {
this.ipic = ipic; _ipicture = ipic;
} }
/// ///
// Returns null on failure instead of throwing exception. // Returns null on failure instead of throwing exception.
static Picture fromStream(DStream stm) deprecated static Picture fromStream(DStream stm)
{ {
auto ipic = _fromDStream(stm); auto ipic = _fromDStream(stm);
if(!ipic) if(!ipic)
@ -1542,7 +1542,7 @@ class Picture: Image // docmain
lhy = loghimY; lhy = loghimY;
width = MAP_LOGHIM_TO_PIX(lhx, GetDeviceCaps(hdc, LOGPIXELSX)); width = MAP_LOGHIM_TO_PIX(lhx, GetDeviceCaps(hdc, LOGPIXELSX));
height = MAP_LOGHIM_TO_PIX(lhy, GetDeviceCaps(hdc, LOGPIXELSY)); height = MAP_LOGHIM_TO_PIX(lhy, GetDeviceCaps(hdc, LOGPIXELSY));
ipic.Render(hdc, pt.x, pt.y + height, width, -height, 0, 0, lhx, lhy, null); _ipicture.Render(hdc, pt.x, pt.y + height, width, -height, 0, 0, lhx, lhy, null);
} }
/// ditto /// ditto
@ -1558,7 +1558,7 @@ class Picture: Image // docmain
int lhx, lhy; int lhx, lhy;
lhx = loghimX; lhx = loghimX;
lhy = loghimY; lhy = loghimY;
ipic.Render(hdc, r.x, r.y + r.height, r.width, -r.height, 0, 0, lhx, lhy, null); _ipicture.Render(hdc, r.x, r.y + r.height, r.width, -r.height, 0, 0, lhx, lhy, null);
} }
/// ditto /// ditto
@ -1572,7 +1572,7 @@ class Picture: Image // docmain
final @property OLE_XSIZE_HIMETRIC loghimX() // getter final @property OLE_XSIZE_HIMETRIC loghimX() // getter
{ {
OLE_XSIZE_HIMETRIC xsz; OLE_XSIZE_HIMETRIC xsz;
if(S_OK != ipic.get_Width(&xsz)) if(S_OK != _ipicture.get_Width(&xsz))
return 0; // ? return 0; // ?
return xsz; return xsz;
} }
@ -1581,7 +1581,7 @@ class Picture: Image // docmain
final @property OLE_YSIZE_HIMETRIC loghimY() // getter final @property OLE_YSIZE_HIMETRIC loghimY() // getter
{ {
OLE_YSIZE_HIMETRIC ysz; OLE_YSIZE_HIMETRIC ysz;
if(S_OK != ipic.get_Height(&ysz)) if(S_OK != _ipicture.get_Height(&ysz))
return 0; // ? return 0; // ?
return ysz; return ysz;
} }
@ -1670,10 +1670,10 @@ class Picture: Image // docmain
_hbmimgtype = HBITMAP.init; _hbmimgtype = HBITMAP.init;
} }
if(ipic) if(_ipicture)
{ {
ipic.Release(); _ipicture.Release();
ipic = null; _ipicture = null;
} }
} }
@ -1761,7 +1761,7 @@ class Picture: Image // docmain
private: private:
dfl.internal.wincom.IPicture ipic = null; dfl.internal.wincom.IPicture _ipicture = null;
static dfl.internal.wincom.IPicture _fromIStream(dfl.internal.wincom.IStream istm) static dfl.internal.wincom.IPicture _fromIStream(dfl.internal.wincom.IStream istm)
@ -1797,7 +1797,7 @@ class Picture: Image // docmain
} }
static dfl.internal.wincom.IPicture _fromDStream(DStream stm) deprecated static dfl.internal.wincom.IPicture _fromDStream(DStream stm)
in in
{ {
assert(stm !is null); assert(stm !is null);

View file

@ -44,7 +44,7 @@ class DflComObject: ComObject // package
} }
class DStreamToIStream: DflComObject, dfl.internal.wincom.IStream deprecated class DStreamToIStream: DflComObject, dfl.internal.wincom.IStream
{ {
this(DStream sourceDStream) this(DStream sourceDStream)
{ {

View file

@ -337,11 +337,11 @@ alias charIsHexDigit = std.ascii.isHexDigit;
private import undead.stream;// dfl.internal.stream is deprecated. private import undead.stream;// dfl.internal.stream is deprecated.
alias DStream = undead.stream.Stream;// dfl.internal.stream.Stream is deprecated. deprecated alias DStream = undead.stream.Stream;// dfl.internal.stream.Stream is deprecated.
alias DOutputStream = undead.stream.OutputStream;//dfl.internal.stream.OutputStream is deprecated. deprecated alias DOutputStream = undead.stream.OutputStream;//dfl.internal.stream.OutputStream is deprecated.
alias DStreamException = undead.stream.StreamException;//dfl.internal.stream.StreamException is deprecated. deprecated alias DStreamException = undead.stream.StreamException;//dfl.internal.stream.StreamException is deprecated.
alias DObject = Object; alias DObject = Object;