3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 /* Created by Markus Koenig <markus@stber-koenig.de> */
25 #ifndef __GDIPLUS_IMPL_H
26 #define __GDIPLUS_IMPL_H
27 #pragma GCC system_header
31 * GDI+ Bitmap, CachedBitmap, CustomLineCap, Font, FontCollection, FontFamily,
32 * Image, InstalledFontCollection, PrivateFontCollection, Region
33 * implementation. Definitions of these classes are in gdiplusheaders.h.
37 #error "A C++ compiler is required to include gdiplusimpl.h."
41 * FIXME: I called this file gdiplusimpl.h, but what should it really be called?
42 * Or did Microsoft create separate files for each class implemented here?
48 __inline__ Image* Image::FromFile(const WCHAR *filename,
49 BOOL useEmbeddedColorManagement)
51 return new Image(filename, useEmbeddedColorManagement);
54 __inline__ Image* Image::FromStream(IStream *stream,
55 BOOL useEmbeddedColorManagement)
57 return new Image(stream, useEmbeddedColorManagement);
60 __inline__ Image::Image(const WCHAR *filename, BOOL useEmbeddedColorManagement):
61 nativeImage(NULL), lastStatus(Ok)
63 if (useEmbeddedColorManagement) {
64 lastStatus = DllExports::GdipLoadImageFromFileICM(
65 filename, &nativeImage);
67 lastStatus = DllExports::GdipLoadImageFromFile(
68 filename, &nativeImage);
72 __inline__ Image::Image(IStream *stream, BOOL useEmbeddedColorManagement):
73 nativeImage(NULL), lastStatus(Ok)
75 if (useEmbeddedColorManagement) {
76 lastStatus = DllExports::GdipLoadImageFromStreamICM(
77 stream, &nativeImage);
79 lastStatus = DllExports::GdipLoadImageFromStream(
80 stream, &nativeImage);
84 __inline__ Status Image::FindFirstItem(ImageItemData *item)
86 // FIXME: can't test GdipFindFirstImageItem b/c it isn't exported in 1.0
87 return updateStatus(DllExports::GdipFindFirstImageItem(
91 __inline__ Status Image::FindNextItem(ImageItemData *item)
93 // FIXME: can't test GdipFindFirstImageItem b/c it isn't exported in 1.0
94 return updateStatus(DllExports::GdipFindNextImageItem(
98 __inline__ Status Image::GetAllPropertyItems(UINT totalBufferSize,
99 UINT numProperties, PropertyItem *allItems)
101 return updateStatus(DllExports::GdipGetAllPropertyItems(
102 nativeImage, totalBufferSize, numProperties, allItems));
105 __inline__ Status Image::GetBounds(RectF *srcRect, Unit *srcUnit)
107 return updateStatus(DllExports::GdipGetImageBounds(
108 nativeImage, srcRect, srcUnit));
111 __inline__ Status Image::GetEncoderParameterList(const CLSID *clsidEncoder,
112 UINT size, EncoderParameters *buffer)
114 return updateStatus(DllExports::GdipGetEncoderParameterList(
115 nativeImage, clsidEncoder, size, buffer));
118 __inline__ UINT Image::GetEncoderParameterListSize(const CLSID *clsidEncoder)
121 updateStatus(DllExports::GdipGetEncoderParameterListSize(
122 nativeImage, clsidEncoder, &result));
126 __inline__ UINT Image::GetFlags()
129 updateStatus(DllExports::GdipGetImageFlags(nativeImage, &result));
133 __inline__ UINT Image::GetFrameCount(const GUID *dimensionID)
136 updateStatus(DllExports::GdipImageGetFrameCount(
137 nativeImage, dimensionID, &result));
141 __inline__ UINT Image::GetFrameDimensionsCount()
144 updateStatus(DllExports::GdipImageGetFrameDimensionsCount(
145 nativeImage, &result));
149 __inline__ Status Image::GetFrameDimensionsList(GUID *dimensionIDs, UINT count)
151 return updateStatus(DllExports::GdipImageGetFrameDimensionsList(
152 nativeImage, dimensionIDs, count));
155 __inline__ UINT Image::GetHeight()
158 updateStatus(DllExports::GdipGetImageHeight(nativeImage, &result));
162 __inline__ REAL Image::GetHorizontalResolution()
165 updateStatus(DllExports::GdipGetImageHorizontalResolution(
166 nativeImage, &result));
170 __inline__ Status Image::GetItemData(ImageItemData *item)
172 // FIXME: can't test GdipGetImageItemData b/c it isn't exported in 1.0
173 return updateStatus(DllExports::GdipGetImageItemData(
177 __inline__ Status Image::GetPalette(ColorPalette *palette, INT size)
179 return updateStatus(DllExports::GdipGetImagePalette(
180 nativeImage, palette, size));
183 __inline__ INT Image::GetPaletteSize()
186 updateStatus(DllExports::GdipGetImagePaletteSize(nativeImage, &result));
190 __inline__ Status Image::GetPhysicalDimension(SizeF *size)
192 if (!size) return lastStatus = InvalidParameter;
193 return updateStatus(DllExports::GdipGetImageDimension(
194 nativeImage, &size->Width, &size->Height));
197 __inline__ PixelFormat Image::GetPixelFormat()
199 PixelFormat result = (PixelFormat) 0;
200 updateStatus(DllExports::GdipGetImagePixelFormat(nativeImage, &result));
204 __inline__ UINT Image::GetPropertyCount()
207 updateStatus(DllExports::GdipGetPropertyCount(nativeImage, &result));
211 __inline__ Status Image::GetPropertyIdList(UINT numOfProperty, PROPID *list)
213 return updateStatus(DllExports::GdipGetPropertyIdList(
214 nativeImage, numOfProperty, list));
217 __inline__ Status Image::GetPropertyItem(PROPID propId, UINT propSize,
218 PropertyItem *buffer)
220 return updateStatus(DllExports::GdipGetPropertyItem(
221 nativeImage, propId, propSize, buffer));
224 __inline__ UINT Image::GetPropertyItemSize(PROPID propId)
227 updateStatus(DllExports::GdipGetPropertyItemSize(
228 nativeImage, propId, &result));
232 __inline__ Status Image::GetPropertySize(
233 UINT *totalBufferSize, UINT *numProperties)
235 return updateStatus(DllExports::GdipGetPropertySize(
236 nativeImage, totalBufferSize, numProperties));
239 __inline__ Status Image::GetRawFormat(GUID *format)
241 return updateStatus(DllExports::GdipGetImageRawFormat(
242 nativeImage, format));
245 __inline__ Image* Image::GetThumbnailImage(UINT thumbWidth, UINT thumbHeight,
246 GetThumbnailImageAbort callback, VOID *callbackData)
248 GpImage *thumbImage = NULL;
249 Status status = updateStatus(DllExports::GdipGetImageThumbnail(
250 nativeImage, thumbWidth, thumbHeight, &thumbImage,
251 callback, callbackData));
254 Image *result = new Image(thumbImage, Ok);
256 DllExports::GdipDisposeImage(thumbImage);
257 lastStatus = OutOfMemory;
265 __inline__ ImageType Image::GetType() const
267 ImageType result = ImageTypeUnknown;
268 updateStatus(DllExports::GdipGetImageType(nativeImage, &result));
272 __inline__ REAL Image::GetVerticalResolution()
275 updateStatus(DllExports::GdipGetImageVerticalResolution(
276 nativeImage, &result));
280 __inline__ UINT Image::GetWidth()
283 updateStatus(DllExports::GdipGetImageWidth(nativeImage, &result));
287 __inline__ Status Image::RemovePropertyItem(PROPID propId)
289 return updateStatus(DllExports::GdipRemovePropertyItem(
290 nativeImage, propId));
293 __inline__ Status Image::RotateFlip(RotateFlipType rotateFlipType)
295 return updateStatus(DllExports::GdipImageRotateFlip(
296 nativeImage, rotateFlipType));
299 __inline__ Status Image::Save(const WCHAR *filename, const CLSID *clsidEncoder,
300 const EncoderParameters *encoderParams)
302 return updateStatus(DllExports::GdipSaveImageToFile(
303 nativeImage, filename, clsidEncoder, encoderParams));
306 __inline__ Status Image::Save(IStream *stream, const CLSID *clsidEncoder,
307 const EncoderParameters *encoderParams)
309 return updateStatus(DllExports::GdipSaveImageToStream(
310 nativeImage, stream, clsidEncoder, encoderParams));
313 __inline__ Status Image::SaveAdd(const EncoderParameters *encoderParams)
315 return updateStatus(DllExports::GdipSaveAdd(
316 nativeImage, encoderParams));
319 __inline__ Status Image::SaveAdd(Image *newImage,
320 const EncoderParameters *encoderParams)
322 return updateStatus(DllExports::GdipSaveAddImage(
324 newImage ? newImage->nativeImage : NULL,
328 __inline__ Status Image::SelectActiveFrame(
329 const GUID *dimensionID, UINT frameIndex)
331 return updateStatus(DllExports::GdipImageSelectActiveFrame(
332 nativeImage, dimensionID, frameIndex));
335 __inline__ Status Image::SetAbort(GdiplusAbort *pIAbort)
337 // FIXME: can't test GdipImageSetAbort because it isn't exported in 1.0
338 return updateStatus(DllExports::GdipImageSetAbort(
339 nativeImage, pIAbort));
342 __inline__ Status Image::SetPalette(const ColorPalette *palette)
344 return updateStatus(DllExports::GdipSetImagePalette(
345 nativeImage, palette));
348 __inline__ Status Image::SetPropertyItem(const PropertyItem *item)
350 return updateStatus(DllExports::GdipSetPropertyItem(nativeImage, item));
356 __inline__ Bitmap* Bitmap::FromBITMAPINFO(const BITMAPINFO *gdiBitmapInfo,
359 return new Bitmap(gdiBitmapInfo, gdiBitmapData);
362 __inline__ Bitmap* Bitmap::FromDirectDrawSurface7(IDirectDrawSurface7 *surface)
364 return new Bitmap(surface);
367 __inline__ Bitmap* Bitmap::FromFile(const WCHAR *filename,
368 BOOL useEmbeddedColorManagement)
370 return new Bitmap(filename, useEmbeddedColorManagement);
373 __inline__ Bitmap* Bitmap::FromHBITMAP(HBITMAP hbm, HPALETTE hpal)
375 return new Bitmap(hbm, hpal);
378 __inline__ Bitmap* Bitmap::FromHICON(HICON icon)
380 return new Bitmap(icon);
383 __inline__ Bitmap* Bitmap::FromResource(
384 HINSTANCE hInstance, const WCHAR *bitmapName)
386 return new Bitmap(hInstance, bitmapName);
389 __inline__ Bitmap* Bitmap::FromStream(IStream *stream,
390 BOOL useEmbeddedColorManagement)
392 return new Bitmap(stream, useEmbeddedColorManagement);
395 //TODO: [GDI+ 1.1] Bitmap::ApplyEffect
396 //__inline__ Status Bitmap::ApplyEffect(Bitmap **inputs, INT numInputs,
397 // Effect *effect, RECT *ROI, RECT *outputRect, Bitmap **output)
399 // return NotImplemented;
402 __inline__ Status Bitmap::InitializePalette(ColorPalette *palette,
403 PaletteType paletteType, INT optimalColors,
404 BOOL useTransparentColor, Bitmap *bitmap)
406 // FIXME: can't test GdipInitializePalette b/c it isn't exported in 1.0
407 return DllExports::GdipInitializePalette(palette, paletteType,
408 optimalColors, useTransparentColor,
409 bitmap ? (GpBitmap*) bitmap->nativeImage : NULL);
412 __inline__ Bitmap::Bitmap(const BITMAPINFO *gdiBitmapInfo, VOID *gdiBitmapData):
415 GpBitmap *nativeBitmap = NULL;
416 lastStatus = DllExports::GdipCreateBitmapFromGdiDib(
417 gdiBitmapInfo, gdiBitmapData, &nativeBitmap);
418 nativeImage = nativeBitmap;
421 __inline__ Bitmap::Bitmap(IDirectDrawSurface7 *surface): Image(NULL, Ok)
423 GpBitmap *nativeBitmap = NULL;
424 lastStatus = DllExports::GdipCreateBitmapFromDirectDrawSurface(
425 surface, &nativeBitmap);
426 nativeImage = nativeBitmap;
429 __inline__ Bitmap::Bitmap(const WCHAR *filename,
430 BOOL useEmbeddedColorManagement): Image(NULL, Ok)
432 GpBitmap *nativeBitmap = NULL;
433 if (useEmbeddedColorManagement) {
434 lastStatus = DllExports::GdipCreateBitmapFromFileICM(
435 filename, &nativeBitmap);
437 lastStatus = DllExports::GdipCreateBitmapFromFile(
438 filename, &nativeBitmap);
440 nativeImage = nativeBitmap;
443 __inline__ Bitmap::Bitmap(HBITMAP hbm, HPALETTE hpal):
446 GpBitmap *nativeBitmap = NULL;
447 lastStatus = DllExports::GdipCreateBitmapFromHBITMAP(
448 hbm, hpal, &nativeBitmap);
449 nativeImage = nativeBitmap;
452 __inline__ Bitmap::Bitmap(HICON hicon):
455 GpBitmap *nativeBitmap = NULL;
456 lastStatus = DllExports::GdipCreateBitmapFromHICON(hicon, &nativeBitmap);
457 nativeImage = nativeBitmap;
460 __inline__ Bitmap::Bitmap(HINSTANCE hInstance, const WCHAR *bitmapName):
463 GpBitmap *nativeBitmap = NULL;
464 lastStatus = DllExports::GdipCreateBitmapFromResource(
465 hInstance, bitmapName, &nativeBitmap);
466 nativeImage = nativeBitmap;
469 __inline__ Bitmap::Bitmap(IStream *stream, BOOL useEmbeddedColorManagement):
472 GpBitmap *nativeBitmap = NULL;
473 if (useEmbeddedColorManagement) {
474 lastStatus = DllExports::GdipCreateBitmapFromStreamICM(
475 stream, &nativeBitmap);
477 lastStatus = DllExports::GdipCreateBitmapFromStream(
478 stream, &nativeBitmap);
480 nativeImage = nativeBitmap;
483 __inline__ Bitmap::Bitmap(INT width, INT height, Graphics *target):
486 GpBitmap *nativeBitmap = NULL;
487 lastStatus = DllExports::GdipCreateBitmapFromGraphics(
488 width, height, target ? target->nativeGraphics : NULL,
490 nativeImage = nativeBitmap;
493 __inline__ Bitmap::Bitmap(INT width, INT height, PixelFormat format):
496 GpBitmap *nativeBitmap = NULL;
497 lastStatus = DllExports::GdipCreateBitmapFromScan0(
498 width, height, 0, format, NULL, &nativeBitmap);
499 nativeImage = nativeBitmap;
502 __inline__ Bitmap::Bitmap(INT width, INT height, INT stride,
503 PixelFormat format, BYTE *scan0): Image(NULL, Ok)
505 GpBitmap *nativeBitmap = NULL;
506 lastStatus = DllExports::GdipCreateBitmapFromScan0(
507 width, height, stride, format, scan0, &nativeBitmap);
508 nativeImage = nativeBitmap;
511 __inline__ Bitmap* Bitmap::Clone(const RectF& rect, PixelFormat format) const
513 return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
516 __inline__ Bitmap* Bitmap::Clone(const Rect& rect, PixelFormat format) const
518 return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
521 __inline__ Bitmap* Bitmap::Clone(REAL x, REAL y, REAL width, REAL height,
522 PixelFormat format) const
524 GpBitmap *cloneBitmap = NULL;
525 Status status = updateStatus(DllExports::GdipCloneBitmapArea(
526 x, y, width, height, format,
527 (GpBitmap*) nativeImage, &cloneBitmap));
529 Bitmap *result = new Bitmap(cloneBitmap, lastStatus);
531 DllExports::GdipDisposeImage(cloneBitmap);
532 lastStatus = OutOfMemory;
540 __inline__ Bitmap* Bitmap::Clone(INT x, INT y, INT width, INT height,
541 PixelFormat format) const
543 GpBitmap *cloneBitmap = NULL;
544 Status status = updateStatus(DllExports::GdipCloneBitmapAreaI(
545 x, y, width, height, format,
546 (GpBitmap*) nativeImage, &cloneBitmap));
548 Bitmap *result = new Bitmap(cloneBitmap, lastStatus);
550 DllExports::GdipDisposeImage(cloneBitmap);
551 lastStatus = OutOfMemory;
559 //TODO: [GDI+ 1.1] Bitmap::ApplyEffect
560 //__inline__ Status Bitmap::ApplyEffect(Effect *effect, RECT *ROI)
562 // return NotImplemented;
565 __inline__ Status Bitmap::ConvertFormat(PixelFormat format,
566 DitherType ditherType, PaletteType paletteType,
567 ColorPalette *palette, REAL alphaThresholdPercent)
569 // FIXME: can't test GdipBitmapConvertFormat b/c it isn't exported in 1.0
570 return updateStatus(DllExports::GdipBitmapConvertFormat(
571 (GpBitmap*) nativeImage, format, ditherType,
572 paletteType, palette, alphaThresholdPercent));
575 __inline__ Status Bitmap::GetHBITMAP(
576 const Color& colorBackground, HBITMAP *hbmReturn) const
578 return updateStatus(DllExports::GdipCreateHBITMAPFromBitmap(
579 (GpBitmap*) nativeImage, hbmReturn,
580 colorBackground.GetValue()));
583 __inline__ Status Bitmap::GetHICON(HICON *icon) const
585 return updateStatus(DllExports::GdipCreateHICONFromBitmap(
586 (GpBitmap*) nativeImage, icon));
589 __inline__ Status Bitmap::GetHistogram(HistogramFormat format,
590 UINT numberOfEntries,
591 UINT *channel0, UINT *channel1,
592 UINT *channel2, UINT *channel3) const
594 return updateStatus(DllExports::GdipBitmapGetHistogram(
595 (GpBitmap*) nativeImage, format, numberOfEntries,
596 channel0, channel1, channel2, channel3));
599 __inline__ Status Bitmap::GetHistogramSize(HistogramFormat format,
600 UINT *numberOfEntries) const
602 return updateStatus(DllExports::GdipBitmapGetHistogramSize(
603 format, numberOfEntries));
606 __inline__ Status Bitmap::GetPixel(INT x, INT y, Color *color) const
608 return updateStatus(DllExports::GdipBitmapGetPixel(
609 (GpBitmap*) nativeImage, x, y,
610 color ? &color->Value : NULL));
613 __inline__ Status Bitmap::LockBits(const Rect *rect, UINT flags,
614 PixelFormat format, BitmapData *lockedBitmapData)
616 return updateStatus(DllExports::GdipBitmapLockBits(
617 (GpBitmap*) nativeImage, rect, flags, format,
621 __inline__ Status Bitmap::SetPixel(INT x, INT y, const Color& color)
623 return updateStatus(DllExports::GdipBitmapSetPixel(
624 (GpBitmap*) nativeImage, x, y, color.GetValue()));
627 __inline__ Status Bitmap::SetResolution(REAL xdpi, REAL ydpi)
629 return updateStatus(DllExports::GdipBitmapSetResolution(
630 (GpBitmap*) nativeImage, xdpi, ydpi));
633 __inline__ Status Bitmap::UnlockBits(BitmapData *lockedBitmapData)
635 return updateStatus(DllExports::GdipBitmapUnlockBits(
636 (GpBitmap*) nativeImage, lockedBitmapData));
642 __inline__ CachedBitmap::CachedBitmap(Bitmap *bitmap, Graphics *graphics):
643 nativeCachedBitmap(NULL), lastStatus(Ok)
645 lastStatus = DllExports::GdipCreateCachedBitmap(
646 bitmap ? ((GpBitmap*) bitmap->nativeImage) : NULL,
647 graphics ? graphics->nativeGraphics : NULL,
648 &nativeCachedBitmap);
651 __inline__ CachedBitmap::~CachedBitmap()
653 DllExports::GdipDeleteCachedBitmap(nativeCachedBitmap);
659 __inline__ CustomLineCap::CustomLineCap(
660 const GraphicsPath *fillPath,
661 const GraphicsPath *strokePath,
662 LineCap baseCap, REAL baseInset):
663 nativeCustomLineCap(NULL), lastStatus(Ok)
665 lastStatus = DllExports::GdipCreateCustomLineCap(
666 fillPath ? fillPath->nativePath : NULL,
667 strokePath ? strokePath->nativePath : NULL,
668 baseCap, baseInset, &nativeCustomLineCap);
671 __inline__ LineCap CustomLineCap::GetBaseCap() const
673 LineCap result = LineCapFlat;
674 updateStatus(DllExports::GdipGetCustomLineCapBaseCap(
675 nativeCustomLineCap, &result));
679 __inline__ REAL CustomLineCap::GetBaseInset() const
682 updateStatus(DllExports::GdipGetCustomLineCapBaseInset(
683 nativeCustomLineCap, &result));
687 __inline__ Status CustomLineCap::GetStrokeCaps(LineCap *startCap,
688 LineCap *endCap) const
690 return updateStatus(DllExports::GdipGetCustomLineCapStrokeCaps(
691 nativeCustomLineCap, startCap, endCap));
694 __inline__ LineJoin CustomLineCap::GetStrokeJoin() const
696 LineJoin result = LineJoinMiter;
697 updateStatus(DllExports::GdipGetCustomLineCapStrokeJoin(
698 nativeCustomLineCap, &result));
702 __inline__ REAL CustomLineCap::GetWidthScale() const
705 updateStatus(DllExports::GdipGetCustomLineCapWidthScale(
706 nativeCustomLineCap, &result));
710 __inline__ Status CustomLineCap::SetBaseCap(LineCap baseCap)
712 return updateStatus(DllExports::GdipSetCustomLineCapBaseCap(
713 nativeCustomLineCap, baseCap));
716 __inline__ Status CustomLineCap::SetBaseInset(REAL inset)
718 return updateStatus(DllExports::GdipSetCustomLineCapBaseInset(
719 nativeCustomLineCap, inset));
722 __inline__ Status CustomLineCap::SetStrokeCap(LineCap strokeCap)
724 return updateStatus(DllExports::GdipSetCustomLineCapStrokeCaps(
725 nativeCustomLineCap, strokeCap, strokeCap));
728 __inline__ Status CustomLineCap::SetStrokeCaps(LineCap startCap, LineCap endCap)
730 return updateStatus(DllExports::GdipSetCustomLineCapStrokeCaps(
731 nativeCustomLineCap, startCap, endCap));
734 __inline__ Status CustomLineCap::SetStrokeJoin(LineJoin lineJoin)
736 return updateStatus(DllExports::GdipSetCustomLineCapStrokeJoin(
737 nativeCustomLineCap, lineJoin));
740 __inline__ Status CustomLineCap::SetWidthScale(REAL widthScale)
742 return updateStatus(DllExports::GdipSetCustomLineCapWidthScale(
743 nativeCustomLineCap, widthScale));
749 __inline__ Font::Font(const FontFamily *family,
750 REAL emSize, INT style, Unit unit):
751 nativeFont(NULL), lastStatus(Ok)
753 lastStatus = DllExports::GdipCreateFont(
754 family ? family->nativeFontFamily : NULL,
755 emSize, style, unit, &nativeFont);
758 __inline__ Font::Font(HDC hdc, HFONT hfont):
759 nativeFont(NULL), lastStatus(Ok)
762 if (GetObject(hfont, sizeof logfont, &logfont)) {
763 lastStatus = DllExports::GdipCreateFontFromLogfontW(
764 hdc, &logfont, &nativeFont);
766 lastStatus = DllExports::GdipCreateFontFromDC(
771 __inline__ Font::Font(HDC hdc, const LOGFONTA *logfont):
772 nativeFont(NULL), lastStatus(Ok)
774 lastStatus = DllExports::GdipCreateFontFromLogfontA(
775 hdc, logfont, &nativeFont);
778 __inline__ Font::Font(HDC hdc, const LOGFONTW *logfont):
779 nativeFont(NULL), lastStatus(Ok)
781 lastStatus = DllExports::GdipCreateFontFromLogfontW(
782 hdc, logfont, &nativeFont);
785 __inline__ Font::Font(HDC hdc):
786 nativeFont(NULL), lastStatus(Ok)
788 lastStatus = DllExports::GdipCreateFontFromDC(hdc, &nativeFont);
791 __inline__ Font::Font(const WCHAR *familyName, REAL emSize, INT style,
792 Unit unit, const FontCollection *fontCollection):
793 nativeFont(NULL), lastStatus(Ok)
795 GpFontFamily *nativeFamily = NULL;
796 lastStatus = DllExports::GdipCreateFontFamilyFromName(
798 fontCollection ? fontCollection->nativeFontCollection : NULL,
802 lastStatus = DllExports::GdipCreateFont(
803 nativeFamily, emSize, style, unit, &nativeFont);
804 DllExports::GdipDeleteFontFamily(nativeFamily);
808 __inline__ Font::~Font()
810 DllExports::GdipDeleteFont(nativeFont);
813 __inline__ Font* Font::Clone() const
815 GpFont *cloneFont = NULL;
816 Status status = updateStatus(DllExports::GdipCloneFont(
817 nativeFont, &cloneFont));
819 Font *result = new Font(cloneFont, lastStatus);
821 DllExports::GdipDeleteFont(cloneFont);
822 lastStatus = OutOfMemory;
830 __inline__ Status Font::GetFamily(FontFamily *family) const
832 if (!family) return lastStatus = InvalidParameter;
833 // FIXME: do we need to call GdipDeleteFontFamily first?
834 return family->lastStatus = updateStatus(DllExports::GdipGetFamily(
835 nativeFont, &family->nativeFontFamily));
838 __inline__ REAL Font::GetHeight(const Graphics *graphics) const
841 updateStatus(DllExports::GdipGetFontHeight(
842 nativeFont, graphics ? graphics->nativeGraphics : NULL,
847 __inline__ REAL Font::GetHeight(REAL dpi) const
850 updateStatus(DllExports::GdipGetFontHeightGivenDPI(
851 nativeFont, dpi, &result));
855 __inline__ Status Font::GetLogFontA(const Graphics *graphics, LOGFONTA *logfontA)
858 return updateStatus(DllExports::GdipGetLogFontA(
859 nativeFont, graphics ? graphics->nativeGraphics : NULL,
863 __inline__ Status Font::GetLogFontW(const Graphics *graphics, LOGFONTW *logfontW)
866 return updateStatus(DllExports::GdipGetLogFontW(
867 nativeFont, graphics ? graphics->nativeGraphics : NULL,
871 __inline__ REAL Font::GetSize() const
874 updateStatus(DllExports::GdipGetFontSize(nativeFont, &result));
878 __inline__ INT Font::GetStyle() const
880 INT result = FontStyleRegular;
881 updateStatus(DllExports::GdipGetFontStyle(nativeFont, &result));
885 __inline__ Unit Font::GetUnit() const
887 Unit result = UnitPoint;
888 updateStatus(DllExports::GdipGetFontUnit(nativeFont, &result));
895 __inline__ FontCollection::FontCollection():
896 nativeFontCollection(NULL), lastStatus(Ok)
900 __inline__ Status FontCollection::GetFamilies(INT numSought,
901 FontFamily *families, INT *numFound) const
903 if (numSought <= 0 || !families || !numFound)
904 return lastStatus = InvalidParameter;
906 for (int i = 0; i < numSought; ++i) {
907 families[i].nativeFontFamily = NULL;
908 families[i].lastStatus = FontFamilyNotFound;
912 GpFontFamily **nativeFamilyArray = (GpFontFamily**)
913 DllExports::GdipAlloc(numSought * sizeof (GpFontFamily*));
914 if (!nativeFamilyArray)
915 return lastStatus = OutOfMemory;
917 Status status = updateStatus(DllExports::GdipGetFontCollectionFamilyList(
918 nativeFontCollection, numSought, nativeFamilyArray,
921 // FIXME: must the native GpFontFamily objects be cloned? Seems so.
922 // (if this is not done, the "Creating a Private Font Collection"
923 // example crashes on "delete[] pFontFamily")
926 for (int i = 0; i < *numFound; ++i) {
927 families[i].lastStatus =
928 updateStatus(DllExports::GdipCloneFontFamily(
929 nativeFamilyArray[i],
930 &families[i].nativeFontFamily));
934 DllExports::GdipFree(nativeFamilyArray);
938 __inline__ INT FontCollection::GetFamilyCount() const
941 updateStatus(DllExports::GdipGetFontCollectionFamilyCount(
942 nativeFontCollection, &result));
949 // FIXME: do FontFamily::GenericMonospace() et al. need to be thread safe?
950 // FIXME: maybe put parts of this in gdiplus.c
952 extern "C" void *_GdipFontFamilyCachedGenericMonospace;
953 extern "C" void *_GdipFontFamilyCachedGenericSansSerif;
954 extern "C" void *_GdipFontFamilyCachedGenericSerif;
956 __inline__ const FontFamily* FontFamily::GenericMonospace()
958 if (!_GdipFontFamilyCachedGenericMonospace) {
959 GpFontFamily *nativeFontFamily = 0;
960 Status status = DllExports::GdipGetGenericFontFamilyMonospace(
962 if (status == Ok && nativeFontFamily) {
963 _GdipFontFamilyCachedGenericMonospace = (void*)
964 new FontFamily(nativeFontFamily, Ok);
967 return (FontFamily*) _GdipFontFamilyCachedGenericMonospace;
970 __inline__ const FontFamily* FontFamily::GenericSansSerif()
972 if (!_GdipFontFamilyCachedGenericSansSerif) {
973 GpFontFamily *nativeFontFamily = 0;
974 Status status = DllExports::GdipGetGenericFontFamilySansSerif(
976 if (status == Ok && nativeFontFamily) {
977 _GdipFontFamilyCachedGenericSansSerif = (void*)
978 new FontFamily(nativeFontFamily, Ok);
981 return (FontFamily*) _GdipFontFamilyCachedGenericSansSerif;
984 __inline__ const FontFamily* FontFamily::GenericSerif()
986 if (!_GdipFontFamilyCachedGenericSerif) {
987 GpFontFamily *nativeFontFamily = 0;
988 Status status = DllExports::GdipGetGenericFontFamilySerif(
990 if (status == Ok && nativeFontFamily) {
991 _GdipFontFamilyCachedGenericSerif = (void*)
992 new FontFamily(nativeFontFamily, Ok);
995 return (FontFamily*) _GdipFontFamilyCachedGenericSerif;
998 __inline__ FontFamily::FontFamily():
999 nativeFontFamily(NULL), lastStatus(Ok)
1003 __inline__ FontFamily::FontFamily(const WCHAR *name,
1004 const FontCollection *fontCollection):
1005 nativeFontFamily(NULL), lastStatus(Ok)
1007 lastStatus = DllExports::GdipCreateFontFamilyFromName(name,
1008 fontCollection ? fontCollection->nativeFontCollection : NULL,
1012 __inline__ FontFamily::~FontFamily()
1014 DllExports::GdipDeleteFontFamily(nativeFontFamily);
1017 __inline__ FontFamily* FontFamily::Clone() const
1019 GpFontFamily *cloneFontFamily = NULL;
1020 Status status = updateStatus(DllExports::GdipCloneFontFamily(
1021 nativeFontFamily, &cloneFontFamily));
1023 FontFamily *result = new FontFamily(cloneFontFamily, lastStatus);
1025 DllExports::GdipDeleteFontFamily(cloneFontFamily);
1026 lastStatus = OutOfMemory;
1034 __inline__ UINT16 FontFamily::GetCellAscent(INT style) const
1037 updateStatus(DllExports::GdipGetCellAscent(
1038 nativeFontFamily, style, &result));
1042 __inline__ UINT16 FontFamily::GetCellDescent(INT style) const
1045 updateStatus(DllExports::GdipGetCellDescent(
1046 nativeFontFamily, style, &result));
1050 __inline__ UINT16 FontFamily::GetEmHeight(INT style) const
1053 updateStatus(DllExports::GdipGetEmHeight(
1054 nativeFontFamily, style, &result));
1058 __inline__ Status FontFamily::GetFamilyName(WCHAR name[LF_FACESIZE],
1059 LANGID language) const
1061 return updateStatus(DllExports::GdipGetFamilyName(
1062 nativeFontFamily, name, language));
1065 __inline__ UINT16 FontFamily::GetLineSpacing(INT style) const
1068 updateStatus(DllExports::GdipGetLineSpacing(
1069 nativeFontFamily, style, &result));
1073 __inline__ BOOL FontFamily::IsStyleAvailable(INT style) const
1075 BOOL result = FALSE;
1076 updateStatus(DllExports::GdipIsStyleAvailable(
1077 nativeFontFamily, style, &result));
1082 // InstalledFontCollection
1084 __inline__ InstalledFontCollection::InstalledFontCollection()
1086 lastStatus = DllExports::GdipNewInstalledFontCollection(
1087 &nativeFontCollection);
1091 // PrivateFontCollection
1093 __inline__ PrivateFontCollection::PrivateFontCollection()
1095 lastStatus = DllExports::GdipNewPrivateFontCollection(
1096 &nativeFontCollection);
1099 __inline__ Status PrivateFontCollection::AddFontFile(const WCHAR *filename)
1101 return updateStatus(DllExports::GdipPrivateAddFontFile(
1102 nativeFontCollection, filename));
1105 __inline__ Status PrivateFontCollection::AddMemoryFont(
1106 const VOID *memory, INT length)
1108 return updateStatus(DllExports::GdipPrivateAddMemoryFont(
1109 nativeFontCollection, memory, length));
1115 __inline__ Region* Region::FromHRGN(HRGN hrgn)
1117 return new Region(hrgn);
1120 __inline__ Region::Region(): nativeRegion(NULL), lastStatus(Ok)
1122 lastStatus = DllExports::GdipCreateRegion(&nativeRegion);
1125 __inline__ Region::Region(const RectF& rect): nativeRegion(NULL), lastStatus(Ok)
1127 lastStatus = DllExports::GdipCreateRegionRect(&rect, &nativeRegion);
1130 __inline__ Region::Region(const Rect& rect): nativeRegion(NULL), lastStatus(Ok)
1132 lastStatus = DllExports::GdipCreateRegionRectI(&rect, &nativeRegion);
1135 __inline__ Region::Region(const GraphicsPath *path):
1136 nativeRegion(NULL), lastStatus(Ok)
1138 lastStatus = DllExports::GdipCreateRegionPath(
1139 path ? path->nativePath : NULL, &nativeRegion);
1142 __inline__ Region::Region(const BYTE *regionData, INT size):
1143 nativeRegion(NULL), lastStatus(Ok)
1145 lastStatus = DllExports::GdipCreateRegionRgnData(
1146 regionData, size, &nativeRegion);
1149 __inline__ Region::Region(HRGN hrgn): nativeRegion(NULL), lastStatus(Ok)
1151 lastStatus = DllExports::GdipCreateRegionHrgn(hrgn, &nativeRegion);
1154 __inline__ Region::~Region()
1156 DllExports::GdipDeleteRegion(nativeRegion);
1159 __inline__ Region* Region::Clone() const
1161 GpRegion *cloneRegion = NULL;
1162 Status status = updateStatus(DllExports::GdipCloneRegion(
1163 nativeRegion, &cloneRegion));
1165 Region *result = new Region(cloneRegion, lastStatus);
1167 DllExports::GdipDeleteRegion(cloneRegion);
1168 lastStatus = OutOfMemory;
1176 __inline__ Status Region::Complement(const RectF& rect)
1178 return updateStatus(DllExports::GdipCombineRegionRect(
1179 nativeRegion, &rect, CombineModeComplement));
1182 __inline__ Status Region::Complement(const Rect& rect)
1184 return updateStatus(DllExports::GdipCombineRegionRectI(
1185 nativeRegion, &rect, CombineModeComplement));
1188 __inline__ Status Region::Complement(const Region *region)
1190 return updateStatus(DllExports::GdipCombineRegionRegion(
1191 nativeRegion, region ? region->nativeRegion : NULL,
1192 CombineModeComplement));
1195 __inline__ Status Region::Complement(const GraphicsPath *path)
1197 return updateStatus(DllExports::GdipCombineRegionPath(
1198 nativeRegion, path ? path->nativePath : NULL,
1199 CombineModeComplement));
1202 __inline__ BOOL Region::Equals(const Region *region, const Graphics *graphics)
1205 BOOL result = FALSE;
1206 updateStatus(DllExports::GdipIsEqualRegion(
1207 nativeRegion, region ? region->nativeRegion : NULL,
1208 graphics ? graphics->nativeGraphics : NULL, &result));
1212 __inline__ Status Region::Exclude(const RectF& rect)
1214 return updateStatus(DllExports::GdipCombineRegionRect(
1215 nativeRegion, &rect, CombineModeExclude));
1218 __inline__ Status Region::Exclude(const Rect& rect)
1220 return updateStatus(DllExports::GdipCombineRegionRectI(
1221 nativeRegion, &rect, CombineModeExclude));
1224 __inline__ Status Region::Exclude(const Region *region)
1226 return updateStatus(DllExports::GdipCombineRegionRegion(
1227 nativeRegion, region ? region->nativeRegion : NULL,
1228 CombineModeExclude));
1231 __inline__ Status Region::Exclude(const GraphicsPath *path)
1233 return updateStatus(DllExports::GdipCombineRegionPath(
1234 nativeRegion, path ? path->nativePath : NULL,
1235 CombineModeExclude));
1238 __inline__ Status Region::GetBounds(RectF *rect, const Graphics *graphics) const
1240 return updateStatus(DllExports::GdipGetRegionBounds(nativeRegion,
1241 graphics ? graphics->nativeGraphics : NULL, rect));
1244 __inline__ Status Region::GetBounds(Rect *rect, const Graphics *graphics) const
1246 return updateStatus(DllExports::GdipGetRegionBoundsI(nativeRegion,
1247 graphics ? graphics->nativeGraphics : NULL, rect));
1250 __inline__ Status Region::GetData(BYTE *buffer, UINT bufferSize,
1251 UINT *sizeFilled) const
1253 return updateStatus(DllExports::GdipGetRegionData(
1254 nativeRegion, buffer, bufferSize, sizeFilled));
1257 __inline__ UINT Region::GetDataSize() const
1260 updateStatus(DllExports::GdipGetRegionDataSize(nativeRegion, &result));
1264 __inline__ HRGN Region::GetHRGN(const Graphics *graphics) const
1267 updateStatus(DllExports::GdipGetRegionHRgn(nativeRegion,
1268 graphics ? graphics->nativeGraphics : NULL, &result));
1272 __inline__ Status Region::GetRegionScans(const Matrix *matrix,
1273 RectF *rects, INT *count) const
1275 return updateStatus(DllExports::GdipGetRegionScans(
1276 nativeRegion, rects, count,
1277 matrix ? matrix->nativeMatrix : NULL));
1280 __inline__ Status Region::GetRegionScans(const Matrix *matrix,
1281 Rect *rects, INT *count) const
1283 return updateStatus(DllExports::GdipGetRegionScansI(
1284 nativeRegion, rects, count,
1285 matrix ? matrix->nativeMatrix : NULL));
1288 __inline__ UINT Region::GetRegionScansCount(const Matrix *matrix) const
1291 updateStatus(DllExports::GdipGetRegionScansCount(
1292 nativeRegion, &result,
1293 matrix ? matrix->nativeMatrix : NULL));
1297 __inline__ Status Region::Intersect(const RectF& rect)
1299 return updateStatus(DllExports::GdipCombineRegionRect(
1300 nativeRegion, &rect, CombineModeIntersect));
1303 __inline__ Status Region::Intersect(const Rect& rect)
1305 return updateStatus(DllExports::GdipCombineRegionRectI(
1306 nativeRegion, &rect, CombineModeIntersect));
1309 __inline__ Status Region::Intersect(const Region *region)
1311 return updateStatus(DllExports::GdipCombineRegionRegion(
1312 nativeRegion, region ? region->nativeRegion : NULL,
1313 CombineModeIntersect));
1316 __inline__ Status Region::Intersect(const GraphicsPath *path)
1318 return updateStatus(DllExports::GdipCombineRegionPath(
1319 nativeRegion, path ? path->nativePath : NULL,
1320 CombineModeIntersect));
1323 __inline__ BOOL Region::IsEmpty(const Graphics *graphics) const
1325 BOOL result = FALSE;
1326 updateStatus(DllExports::GdipIsEmptyRegion(nativeRegion,
1327 graphics ? graphics->nativeGraphics : NULL, &result));
1331 __inline__ BOOL Region::IsInfinite(const Graphics *graphics) const
1333 BOOL result = FALSE;
1334 updateStatus(DllExports::GdipIsInfiniteRegion(nativeRegion,
1335 graphics ? graphics->nativeGraphics : NULL, &result));
1339 __inline__ BOOL Region::IsVisible(REAL x, REAL y,
1340 const Graphics *graphics) const
1342 BOOL result = FALSE;
1343 updateStatus(DllExports::GdipIsVisibleRegionPoint(
1345 graphics ? graphics->nativeGraphics : NULL, &result));
1349 __inline__ BOOL Region::IsVisible(INT x, INT y,
1350 const Graphics *graphics) const
1352 BOOL result = FALSE;
1353 updateStatus(DllExports::GdipIsVisibleRegionPointI(
1355 graphics ? graphics->nativeGraphics : NULL, &result));
1359 __inline__ BOOL Region::IsVisible(const PointF& point,
1360 const Graphics *graphics) const
1362 BOOL result = FALSE;
1363 updateStatus(DllExports::GdipIsVisibleRegionPoint(
1364 nativeRegion, point.X, point.Y,
1365 graphics ? graphics->nativeGraphics : NULL, &result));
1369 __inline__ BOOL Region::IsVisible(const Point& point,
1370 const Graphics *graphics) const
1372 BOOL result = FALSE;
1373 updateStatus(DllExports::GdipIsVisibleRegionPointI(
1374 nativeRegion, point.X, point.Y,
1375 graphics ? graphics->nativeGraphics : NULL, &result));
1379 __inline__ BOOL Region::IsVisible(REAL x, REAL y, REAL width, REAL height,
1380 const Graphics *graphics) const
1382 BOOL result = FALSE;
1383 updateStatus(DllExports::GdipIsVisibleRegionRect(
1384 nativeRegion, x, y, width, height,
1385 graphics ? graphics->nativeGraphics : NULL, &result));
1389 __inline__ BOOL Region::IsVisible(INT x, INT y, INT width, INT height,
1390 const Graphics *graphics) const
1392 BOOL result = FALSE;
1393 updateStatus(DllExports::GdipIsVisibleRegionRectI(
1394 nativeRegion, x, y, width, height,
1395 graphics ? graphics->nativeGraphics : NULL, &result));
1399 __inline__ BOOL Region::IsVisible(const RectF& rect,
1400 const Graphics *graphics) const
1402 BOOL result = FALSE;
1403 updateStatus(DllExports::GdipIsVisibleRegionRect(
1404 nativeRegion, rect.X, rect.Y, rect.Width, rect.Height,
1405 graphics ? graphics->nativeGraphics : NULL, &result));
1409 __inline__ BOOL Region::IsVisible(const Rect& rect,
1410 const Graphics *graphics) const
1412 BOOL result = FALSE;
1413 updateStatus(DllExports::GdipIsVisibleRegionRectI(
1414 nativeRegion, rect.X, rect.Y, rect.Width, rect.Height,
1415 graphics ? graphics->nativeGraphics : NULL, &result));
1419 __inline__ Status Region::MakeEmpty()
1421 return updateStatus(DllExports::GdipSetEmpty(nativeRegion));
1424 __inline__ Status Region::MakeInfinite()
1426 return updateStatus(DllExports::GdipSetInfinite(nativeRegion));
1429 __inline__ Status Region::Transform(const Matrix *matrix)
1431 return updateStatus(DllExports::GdipTransformRegion(
1432 nativeRegion, matrix ? matrix->nativeMatrix : NULL));
1435 __inline__ Status Region::Translate(REAL dx, REAL dy)
1437 return updateStatus(DllExports::GdipTranslateRegion(
1438 nativeRegion, dx, dy));
1441 __inline__ Status Region::Translate(INT dx, INT dy)
1443 return updateStatus(DllExports::GdipTranslateRegionI(
1444 nativeRegion, dx, dy));
1447 __inline__ Status Region::Union(const RectF& rect)
1449 return updateStatus(DllExports::GdipCombineRegionRect(
1450 nativeRegion, &rect, CombineModeUnion));
1453 __inline__ Status Region::Union(const Rect& rect)
1455 return updateStatus(DllExports::GdipCombineRegionRectI(
1456 nativeRegion, &rect, CombineModeUnion));
1459 __inline__ Status Region::Union(const Region *region)
1461 return updateStatus(DllExports::GdipCombineRegionRegion(
1462 nativeRegion, region ? region->nativeRegion : NULL,
1466 __inline__ Status Region::Union(const GraphicsPath *path)
1468 return updateStatus(DllExports::GdipCombineRegionPath(
1469 nativeRegion, path ? path->nativePath : NULL,
1473 __inline__ Status Region::Xor(const RectF& rect)
1475 return updateStatus(DllExports::GdipCombineRegionRect(
1476 nativeRegion, &rect, CombineModeXor));
1479 __inline__ Status Region::Xor(const Rect& rect)
1481 return updateStatus(DllExports::GdipCombineRegionRectI(
1482 nativeRegion, &rect, CombineModeXor));
1485 __inline__ Status Region::Xor(const Region *region)
1487 return updateStatus(DllExports::GdipCombineRegionRegion(
1488 nativeRegion, region ? region->nativeRegion : NULL,
1492 __inline__ Status Region::Xor(const GraphicsPath *path)
1494 return updateStatus(DllExports::GdipCombineRegionPath(
1495 nativeRegion, path ? path->nativePath : NULL,
1502 __inline__ BOOL GraphicsPath::IsOutlineVisible(REAL x, REAL y, const Pen *pen,
1503 const Graphics *g) const
1505 BOOL result = FALSE;
1506 updateStatus(DllExports::GdipIsOutlineVisiblePathPoint(
1507 nativePath, x, y, pen ? pen->nativePen : NULL,
1508 g ? g->nativeGraphics : NULL, &result));
1512 __inline__ BOOL GraphicsPath::IsOutlineVisible(INT x, INT y, const Pen *pen,
1513 const Graphics *g) const
1515 BOOL result = FALSE;
1516 updateStatus(DllExports::GdipIsOutlineVisiblePathPointI(
1517 nativePath, x, y, pen ? pen->nativePen : NULL,
1518 g ? g->nativeGraphics : NULL, &result));
1522 __inline__ BOOL GraphicsPath::IsOutlineVisible(const PointF& point, const Pen *pen,
1523 const Graphics *g) const
1525 BOOL result = FALSE;
1526 updateStatus(DllExports::GdipIsOutlineVisiblePathPoint(
1527 nativePath, point.X, point.Y,
1528 pen ? pen->nativePen : NULL,
1529 g ? g->nativeGraphics : NULL, &result));
1533 __inline__ BOOL GraphicsPath::IsOutlineVisible(const Point& point, const Pen *pen,
1534 const Graphics *g) const
1536 BOOL result = FALSE;
1537 updateStatus(DllExports::GdipIsOutlineVisiblePathPointI(
1538 nativePath, point.X, point.Y,
1539 pen ? pen->nativePen : NULL,
1540 g ? g->nativeGraphics : NULL, &result));
1544 __inline__ BOOL GraphicsPath::IsVisible(REAL x, REAL y, const Graphics *g) const
1546 BOOL result = FALSE;
1547 updateStatus(DllExports::GdipIsVisiblePathPoint(
1549 g ? g->nativeGraphics : NULL, &result));
1552 __inline__ BOOL GraphicsPath::IsVisible(INT x, INT y, const Graphics *g) const
1554 BOOL result = FALSE;
1555 updateStatus(DllExports::GdipIsVisiblePathPointI(
1557 g ? g->nativeGraphics : NULL, &result));
1561 __inline__ BOOL GraphicsPath::IsVisible(const PointF& point,
1562 const Graphics *g) const
1564 BOOL result = FALSE;
1565 updateStatus(DllExports::GdipIsVisiblePathPoint(
1566 nativePath, point.X, point.Y,
1567 g ? g->nativeGraphics : NULL, &result));
1571 __inline__ BOOL GraphicsPath::IsVisible(const Point& point, const Graphics *g) const
1573 BOOL result = FALSE;
1574 updateStatus(DllExports::GdipIsVisiblePathPointI(
1575 nativePath, point.X, point.Y,
1576 g ? g->nativeGraphics : NULL, &result));
1583 __inline__ Status PathData::AllocateArrays(INT capacity)
1586 return InvalidParameter;
1587 } else if (Count < capacity) {
1590 PointF *pointArray = (PointF*)
1591 DllExports::GdipAlloc(capacity * sizeof(PointF));
1595 BYTE *typeArray = (BYTE*)
1596 DllExports::GdipAlloc(capacity * sizeof(BYTE));
1598 DllExports::GdipFree(pointArray);
1603 Points = pointArray;
1609 __inline__ VOID PathData::FreeArrays()
1611 if (Points) DllExports::GdipFree(Points);
1612 if (Types) DllExports::GdipFree(Types);
1618 #endif /* __GDIPLUS_IMPL_H */