From 05faf6919b74153a080ff6cdc00914b6bdf7fd7c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Jun 2010 12:29:21 -0700 Subject: [PATCH 01/41] new vocab images.cocoa: load image objects using native cocoa api --- basis/cocoa/cocoa.factor | 2 + basis/images/cocoa/authors.txt | 1 + basis/images/cocoa/cocoa.factor | 64 ++++++++++++++++++++++++++++++++ basis/images/cocoa/platforms.txt | 1 + basis/images/cocoa/summary.txt | 1 + 5 files changed, 69 insertions(+) create mode 100644 basis/images/cocoa/authors.txt create mode 100644 basis/images/cocoa/cocoa.factor create mode 100644 basis/images/cocoa/platforms.txt create mode 100644 basis/images/cocoa/summary.txt diff --git a/basis/cocoa/cocoa.factor b/basis/cocoa/cocoa.factor index fb21843c0f..53f22addcb 100644 --- a/basis/cocoa/cocoa.factor +++ b/basis/cocoa/cocoa.factor @@ -43,7 +43,9 @@ SYNTAX: IMPORT: scan [ ] import-objc-class ; "NSApplication" "NSArray" "NSAutoreleasePool" + "NSBitmapImageRep" "NSBundle" + "NSColorSpace" "NSData" "NSDictionary" "NSError" diff --git a/basis/images/cocoa/authors.txt b/basis/images/cocoa/authors.txt new file mode 100644 index 0000000000..f13c9c1e77 --- /dev/null +++ b/basis/images/cocoa/authors.txt @@ -0,0 +1 @@ +Joe Groff diff --git a/basis/images/cocoa/cocoa.factor b/basis/images/cocoa/cocoa.factor new file mode 100644 index 0000000000..2150747138 --- /dev/null +++ b/basis/images/cocoa/cocoa.factor @@ -0,0 +1,64 @@ +! (c)2010 Joe Groff bsd license +USING: accessors alien.data cocoa cocoa.classes cocoa.messages +combinators core-foundation.data core-graphics.types fry images +images.loader io kernel literals ; +IN: images.cocoa + +SINGLETON: ns-image +! "png" ns-image register-image-class +! "tif" ns-image register-image-class +! "tiff" ns-image register-image-class +! "gif" ns-image register-image-class +! "jpg" ns-image register-image-class +! "jpeg" ns-image register-image-class +! "bmp" ns-image register-image-class +! "ico" ns-image register-image-class + +CONSTANT: NSImageRepLoadStatusUnknownType -1 +CONSTANT: NSImageRepLoadStatusReadingHeader -2 +CONSTANT: NSImageRepLoadStatusWillNeedAllData -3 +CONSTANT: NSImageRepLoadStatusInvalidData -4 +CONSTANT: NSImageRepLoadStatusUnexpectedEOF -5 +CONSTANT: NSImageRepLoadStatusCompleted -6 + +CONSTANT: NSColorRenderingIntentDefault 0 +CONSTANT: NSColorRenderingIntentAbsoluteColorimetric 1 +CONSTANT: NSColorRenderingIntentRelativeColorimetric 2 +CONSTANT: NSColorRenderingIntentPerceptual 3 +CONSTANT: NSColorRenderingIntentSaturation 4 + +ERROR: ns-image-unknown-type ; +ERROR: ns-image-invalid-data ; +ERROR: ns-image-unexpected-eof ; +ERROR: ns-image-planar-images-not-supported ; + + + +: load-image-rep ( -- image-rep ) + NSBitmapImageRep contents -> autorelease -> imageRepWithData: + NSColorSpace -> genericRGBColorSpace + NSColorRenderingIntentDefault + -> bitmapImageRepByConvertingToColorSpace:renderingIntent: ; + +: image-rep>image ( image-rep -- image ) + image new swap { + [ -> size CGSize>dim >>dim ] + [ -> bitmapData ] + [ -> bytesPerPlane memory>byte-array >>bitmap ] + } cleave + RGBA >>component-order + ubyte-components >>component-type + f >>upside-down? ; + +M: ns-image stream>image + drop [ load-image-rep ] with-input-stream image-rep>image ; diff --git a/basis/images/cocoa/platforms.txt b/basis/images/cocoa/platforms.txt new file mode 100644 index 0000000000..6e806f449e --- /dev/null +++ b/basis/images/cocoa/platforms.txt @@ -0,0 +1 @@ +macosx diff --git a/basis/images/cocoa/summary.txt b/basis/images/cocoa/summary.txt new file mode 100644 index 0000000000..628cce90e9 --- /dev/null +++ b/basis/images/cocoa/summary.txt @@ -0,0 +1 @@ +Image loading using MacOS X's native Cocoa APIs From e433b16b42983eb4f3faa29a744db382bbed2e24 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Jun 2010 12:42:14 -0700 Subject: [PATCH 02/41] cocoa.messages: return cocoa char* values as void* instead of c-string --- basis/cocoa/messages/messages.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 029b3f46e6..4b2c2f2a33 100644 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -109,7 +109,7 @@ H{ { "d" c:double } { "B" c:bool } { "v" c:void } - { "*" c:c-string } + { "*" c:void* } { "?" unknown_type } { "@" id } { "#" Class } From 3029a9475648c250d3d9aab853d7c881a0e70b28 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Jun 2010 13:31:07 -0700 Subject: [PATCH 03/41] images.cocoa: work around broken limited-stream behavior --- basis/images/cocoa/cocoa.factor | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/basis/images/cocoa/cocoa.factor b/basis/images/cocoa/cocoa.factor index 2150747138..1d71738904 100644 --- a/basis/images/cocoa/cocoa.factor +++ b/basis/images/cocoa/cocoa.factor @@ -1,18 +1,18 @@ ! (c)2010 Joe Groff bsd license USING: accessors alien.data cocoa cocoa.classes cocoa.messages combinators core-foundation.data core-graphics.types fry images -images.loader io kernel literals ; +images.loader io io.streams.limited kernel literals ; IN: images.cocoa SINGLETON: ns-image -! "png" ns-image register-image-class -! "tif" ns-image register-image-class -! "tiff" ns-image register-image-class -! "gif" ns-image register-image-class -! "jpg" ns-image register-image-class -! "jpeg" ns-image register-image-class -! "bmp" ns-image register-image-class -! "ico" ns-image register-image-class +"png" ns-image register-image-class +"tif" ns-image register-image-class +"tiff" ns-image register-image-class +"gif" ns-image register-image-class +"jpg" ns-image register-image-class +"jpeg" ns-image register-image-class +"bmp" ns-image register-image-class +"ico" ns-image register-image-class CONSTANT: NSImageRepLoadStatusUnknownType -1 CONSTANT: NSImageRepLoadStatusReadingHeader -2 @@ -61,4 +61,6 @@ PRIVATE> f >>upside-down? ; M: ns-image stream>image - drop [ load-image-rep ] with-input-stream image-rep>image ; + drop + dup limited-stream? [ stream-eofs >>mode ] when + [ load-image-rep ] with-input-stream image-rep>image ; From 0d35e277ea4fe0d46c02fbab6fe602efc61d3cfb Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Jun 2010 13:44:16 -0700 Subject: [PATCH 04/41] images, opengl.textures, images.cocoa: add support for premultiplied alpha so we can use data from cocoa images --- Raytrace.app/Contents/Info.plist | 18 ++++++++++++++++++ basis/images/cocoa/cocoa.factor | 6 ++++-- basis/images/images.factor | 5 ++++- basis/opengl/textures/textures.factor | 15 ++++++++++++--- extra/gpu/textures/textures.factor | 2 +- 5 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 Raytrace.app/Contents/Info.plist diff --git a/Raytrace.app/Contents/Info.plist b/Raytrace.app/Contents/Info.plist new file mode 100644 index 0000000000..776fd81472 --- /dev/null +++ b/Raytrace.app/Contents/Info.plist @@ -0,0 +1,18 @@ + + + + + CFBundleExecutable + gpu.demos.raytrace + CFBundleIconFile + Icon.icns + CFBundleIdentifier + org.factor.gpu.demos.raytrace + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Raytrace.app + CFBundlePackageType + APPL + + diff --git a/basis/images/cocoa/cocoa.factor b/basis/images/cocoa/cocoa.factor index 1d71738904..166a5f8196 100644 --- a/basis/images/cocoa/cocoa.factor +++ b/basis/images/cocoa/cocoa.factor @@ -1,7 +1,8 @@ ! (c)2010 Joe Groff bsd license USING: accessors alien.data cocoa cocoa.classes cocoa.messages combinators core-foundation.data core-graphics.types fry images -images.loader io io.streams.limited kernel literals ; +images.loader io io.streams.limited kernel literals math +sequences ; IN: images.cocoa SINGLETON: ns-image @@ -52,12 +53,13 @@ PRIVATE> : image-rep>image ( image-rep -- image ) image new swap { - [ -> size CGSize>dim >>dim ] + [ -> size CGSize>dim [ >integer ] map >>dim ] [ -> bitmapData ] [ -> bytesPerPlane memory>byte-array >>bitmap ] } cleave RGBA >>component-order ubyte-components >>component-type + t >>premultiplied-alpha? f >>upside-down? ; M: ns-image stream>image diff --git a/basis/images/images.factor b/basis/images/images.factor index 6cbcdb9508..db731d2045 100644 --- a/basis/images/images.factor +++ b/basis/images/images.factor @@ -62,7 +62,10 @@ UNION: alpha-channel BGRA RGBA ABGR ARGB LA A INTENSITY ; UNION: alpha-channel-precedes-colors ABGR ARGB XBGR XRGB ; -TUPLE: image dim component-order component-type upside-down? bitmap ; +TUPLE: image + dim component-order component-type + upside-down? premultiplied-alpha? + bitmap ; : ( -- image ) image new ; inline diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index dacea0888a..bba4165304 100644 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -312,12 +312,21 @@ TUPLE: single-texture < disposable image dim loc texture-coords texture display- [ init-texture texture-coords>> gl-texture-coord-pointer ] tri swap gl-fill-rect ; +: set-blend-mode ( texture -- ) + image>> dup has-alpha? + [ premultiplied-alpha?>> [ GL_ONE GL_ONE_MINUS_SRC_ALPHA glBlendFunc ] when ] + [ drop GL_BLEND glDisable ] if ; + +: reset-blend-mode ( texture -- ) + image>> dup has-alpha? + [ premultiplied-alpha?>> [ GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc ] when ] + [ drop GL_BLEND glEnable ] if ; + : draw-textured-rect ( dim texture -- ) [ - [ image>> has-alpha? [ GL_BLEND glDisable ] unless ] + [ set-blend-mode ] [ (draw-textured-rect) GL_TEXTURE_2D 0 glBindTexture ] - [ image>> has-alpha? [ GL_BLEND glEnable ] unless ] - tri + [ reset-blend-mode ] tri ] with-texturing ; : texture-coords ( texture -- coords ) diff --git a/extra/gpu/textures/textures.factor b/extra/gpu/textures/textures.factor index a240aae945..55e6f7c0f4 100644 --- a/extra/gpu/textures/textures.factor +++ b/extra/gpu/textures/textures.factor @@ -309,7 +309,7 @@ TYPED: read-compressed-texture ( tdt: texture-data-target level: integer -- byte : read-texture-image ( tdt level -- image ) [ texture-dim ] - [ drop texture-object [ component-order>> ] [ component-type>> ] bi f ] + [ drop texture-object [ component-order>> ] [ component-type>> ] bi f f ] [ read-texture ] 2tri image boa ; inline From 5c95d90da3b95834a3a1a8b8eedd0437680c5d84 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Jun 2010 13:45:04 -0700 Subject: [PATCH 05/41] ui.images: load images.cocoa backend by default instead of images.png/images.tiff on macosx --- basis/ui/images/images.factor | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index b97a5c14fe..e9c527a3a6 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: namespaces cache images images.loader accessors assocs -kernel opengl opengl.gl opengl.textures ui.gadgets.worlds -memoize images.png images.tiff ; +USING: accessors assocs cache combinators images images.loader +kernel memoize namespaces opengl opengl.gl opengl.textures system +ui.gadgets.worlds vocabs.loader ; IN: ui.images TUPLE: image-name path ; @@ -30,3 +30,15 @@ PRIVATE> : image-dim ( image-name -- dim ) cached-image dim>> ; + +<< +{ + { [ os macosx? ] [ + "images.cocoa" require + ] } + [ + "images.png" require + "images.tiff" require + ] +} cond +>> From cd183a24b411cbdac7aeef6682fe822631c4e928 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 11:33:25 -0700 Subject: [PATCH 06/41] new vocab windows.gdiplus: bindings to GDI+ (not tested yet) --- basis/windows/gdiplus/gdiplus.factor | 1610 ++++++++++++++++++++++++++ basis/windows/gdiplus/platforms.txt | 1 + basis/windows/nt/nt.factor | 1 + 3 files changed, 1612 insertions(+) create mode 100644 basis/windows/gdiplus/gdiplus.factor create mode 100644 basis/windows/gdiplus/platforms.txt diff --git a/basis/windows/gdiplus/gdiplus.factor b/basis/windows/gdiplus/gdiplus.factor new file mode 100644 index 0000000000..0199fe685e --- /dev/null +++ b/basis/windows/gdiplus/gdiplus.factor @@ -0,0 +1,1610 @@ +! (c)2010 Joe Groff bsd license +USING: alien.c-types alien.destructors alien.syntax windows.types ; +IN: windows.gdiplus + +LIBRARY: gdiplus + +FUNCTION: void* GdipAlloc ( SIZE_T size ) ; +FUNCTION: void GdipFree ( void* mem ) ; + +DESTRUCTOR: GdipFree + +TYPEDEF: float REAL + +ENUM: GpStatus + { Ok 0 } + { GenericError 1 } + { InvalidParameter 2 } + { OutOfMemory 3 } + { ObjectBusy 4 } + { InsufficientBuffer 5 } + { NotImplemented 6 } + { Win32Error 7 } + { WrongState 8 } + { Aborted 9 } + { FileNotFound 10 } + { ValueOverflow 11 } + { AccessDenied 12 } + { UnknownImageFormat 13 } + { FontFamilyNotFound 14 } + { FontStyleNotFound 15 } + { NotTrueTypeFont 16 } + { UnsupportedGdiplusVersion 17 } + { GdiplusNotInitialized 18 } + { PropertyNotFound 19 } + { PropertyNotSupported 20 } + { ProfileNotFound 21 } ; + +CALLBACK: BOOL ImageAbort ( void* data ) ; +TYPEDEF: ImageAbort DrawImageAbort +TYPEDEF: ImageAbort GetThumbnailImageAbort + +STRUCT: GpPoint + { X INT } + { Y INT } ; + +STRUCT: GpPointF + { X REAL } + { Y REAL } ; + +STRUCT: GpPathData + { Count INT } + { Points GpPointF* } + { Types BYTE* } ; + +STRUCT: GpRectF + { X REAL } + { Y REAL } + { Width REAL } + { Height REAL } ; + +STRUCT: GpRect + { X INT } + { Y INT } + { Width INT } + { Height INT } ; + +STRUCT: CharacterRange + { First INT } + { Length INT } ; + +TYPEDEF: UINT GraphicsState +TYPEDEF: UINT GraphicsContainer + +ENUM: GpUnit + { UnitWorld 0 } + { UnitDisplay 1 } + { UnitPixel 2 } + { UnitPoint 3 } + { UnitInch 4 } + { UnitDocument 5 } + { UnitMillimeter 6 } ; + +ENUM: GpBrushType + { BrushTypeSolidColor 0 } + { BrushTypeHatchFill 1 } + { BrushTypeTextureFill 2 } + { BrushTypePathGradient 3 } + { BrushTypeLinearGradient 4 } ; + +ENUM: GpFillMode + { FillModeAlternate 0 } + { FillModeWinding 1 } ; + +ENUM: GpLineCap + { LineCapFlat HEX: 00 } + { LineCapSquare HEX: 01 } + { LineCapRound HEX: 02 } + { LineCapTriangle HEX: 03 } + + { LineCapNoAnchor HEX: 10 } + { LineCapSquareAnchor HEX: 11 } + { LineCapRoundAnchor HEX: 12 } + { LineCapDiamondAnchor HEX: 13 } + { LineCapArrowAnchor HEX: 14 } + + { LineCapCustom HEX: ff } + { LineCapAnchorMask HEX: f0 } ; + +ENUM: PathPointType + { PathPointTypeStart 0 } + { PathPointTypeLine 1 } + { PathPointTypeBezier 3 } + { PathPointTypePathTypeMask 7 } + { PathPointTypePathDashMode 16 } + { PathPointTypePathMarker 32 } + { PathPointTypeCloseSubpath 128 } + { PathPointTypeBezier3 3 } ; + +ENUM: GpPenType + { PenTypeSolidColor BrushTypeSolidColor } + { PenTypeHatchFill BrushTypeHatchFill } + { PenTypeTextureFill BrushTypeTextureFill } + { PenTypePathGradient BrushTypePathGradient } + { PenTypeLinearGradient BrushTypeLinearGradient } + { PenTypeUnknown -1 } ; + +ENUM: GpLineJoin + { LineJoinMiter 0 } + { LineJoinBevel 1 } + { LineJoinRound 2 } + { LineJoinMiterClipped 3 } ; + +ENUM: QualityMode + { QualityModeInvalid -1 } + { QualityModeDefault 0 } + { QualityModeLow 1 } + { QualityModeHigh 2 } ; + +ENUM: SmoothingMode + { SmoothingModeInvalid QualityModeInvalid } + { SmoothingModeDefault QualityModeDefault } + { SmoothingModeHighSpeed QualityModeLow } + { SmoothingModeHighQuality QualityModeHigh } + SmoothingModeNone + SmoothingModeAntiAlias ; + +ENUM: CompositingQuality + { CompositingQualityInvalid QualityModeInvalid } + { CompositingQualityDefault QualityModeDefault } + { CompositingQualityHighSpeed QualityModeLow } + { CompositingQualityHighQuality QualityModeHigh } + CompositingQualityGammaCorrected + CompositingQualityAssumeLinear ; + +ENUM: InterpolationMode + { InterpolationModeInvalid QualityModeInvalid } + { InterpolationModeDefault QualityModeDefault } + { InterpolationModeLowQuality QualityModeLow } + { InterpolationModeHighQuality QualityModeHigh } + InterpolationModeBilinear + InterpolationModeBicubic + InterpolationModeNearestNeighbor + InterpolationModeHighQualityBilinear + InterpolationModeHighQualityBicubic ; + +ENUM: PenAlignment + { PenAlignmentCenter 0 } + { PenAlignmentInset 1 } ; + +ENUM: PixelOffsetMode + { PixelOffsetModeInvalid QualityModeInvalid } + { PixelOffsetModeDefault QualityModeDefault } + { PixelOffsetModeHighSpeed QualityModeLow } + { PixelOffsetModeHighQuality QualityModeHigh } + PixelOffsetModeNone + PixelOffsetModeHalf ; + +ENUM: GpDashCap + { DashCapFlat 0 } + { DashCapRound 2 } + { DashCapTriangle 3 } ; + +ENUM: GpDashStyle + DashStyleSolid + DashStyleDash + DashStyleDot + DashStyleDashDot + DashStyleDashDotDot + DashStyleCustom ; + +ENUM: GpMatrixOrder + { MatrixOrderPrepend 0 } + { MatrixOrderAppend 1 } ; + +ENUM: ImageType + ImageTypeUnknown + ImageTypeBitmap + ImageTypeMetafile ; + +ENUM: WarpMode + WarpModePerspective + WarpModeBilinear ; + +ENUM: GpWrapMode + WrapModeTile + WrapModeTileFlipX + WrapModeTileFlipY + WrapModeTileFlipXY + WrapModeClamp ; + +ENUM: MetafileType + MetafileTypeInvalid + MetafileTypeWmf + MetafileTypeWmfPlaceable + MetafileTypeEmf + MetafileTypeEmfPlusOnly + MetafileTypeEmfPlusDual ; + +ENUM: LinearGradientMode + LinearGradientModeHorizontal + LinearGradientModeVertical + LinearGradientModeForwardDiagonal + LinearGradientModeBackwardDiagonal ; + +ENUM: EmfType + { EmfTypeEmfOnly MetafileTypeEmf } + { EmfTypeEmfPlusOnly MetafileTypeEmfPlusOnly } + { EmfTypeEmfPlusDual MetafileTypeEmfPlusDual } ; + +ENUM: CompositingMode + CompositingModeSourceOver + CompositingModeSourceCopy ; + +ENUM: TextRenderingHint + { TextRenderingHintSystemDefault 0 } + TextRenderingHintSingleBitPerPixelGridFit + TextRenderingHintSingleBitPerPixel + TextRenderingHintAntiAliasGridFit + TextRenderingHintAntiAlias + TextRenderingHintClearTypeGridFit ; + +ENUM: StringAlignment + { StringAlignmentNear 0 } + { StringAlignmentCenter 1 } + { StringAlignmentFar 2 } ; + +ENUM: StringDigitSubstitute + { StringDigitSubstituteUser 0 } + { StringDigitSubstituteNone 1 } + { StringDigitSubstituteNational 2 } + { StringDigitSubstituteTraditional 3 } ; + +ENUM: StringFormatFlags + { StringFormatFlagsDirectionRightToLeft HEX: 00000001 } + { StringFormatFlagsDirectionVertical HEX: 00000002 } + { StringFormatFlagsNoFitBlackBox HEX: 00000004 } + { StringFormatFlagsDisplayFormatControl HEX: 00000020 } + { StringFormatFlagsNoFontFallback HEX: 00000400 } + { StringFormatFlagsMeasureTrailingSpaces HEX: 00000800 } + { StringFormatFlagsNoWrap HEX: 00001000 } + { StringFormatFlagsLineLimit HEX: 00002000 } + { StringFormatFlagsNoClip HEX: 00004000 } ; + +ENUM: StringTrimming + { StringTrimmingNone 0 } + { StringTrimmingCharacter 1 } + { StringTrimmingWord 2 } + { StringTrimmingEllipsisCharacter 3 } + { StringTrimmingEllipsisWord 4 } + { StringTrimmingEllipsisPath 5 } ; + +ENUM: FontStyle + { FontStyleRegular 0 } + { FontStyleBold 1 } + { FontStyleItalic 2 } + { FontStyleBoldItalic 3 } + { FontStyleUnderline 4 } + { FontStyleStrikeout 8 } ; + +ENUM: HotkeyPrefix + { HotkeyPrefixNone 0 } + { HotkeyPrefixShow 1 } + { HotkeyPrefixHide 2 } ; + +ENUM: PaletteFlags + { PaletteFlagsHasAlpha 1 } + { PaletteFlagsGrayScale 2 } + { PaletteFlagsHalftone 4 } ; + +ENUM: ImageCodecFlags + { ImageCodecFlagsEncoder 1 } + { ImageCodecFlagsDecoder 2 } + { ImageCodecFlagsSupportBitmap 4 } + { ImageCodecFlagsSupportVector 8 } + { ImageCodecFlagsSeekableEncode 16 } + { ImageCodecFlagsBlockingDecode 32 } + { ImageCodecFlagsBuiltin 65536 } + { ImageCodecFlagsSystem 131072 } + { ImageCodecFlagsUser 262144 } ; + +ENUM: ImageFlags + { ImageFlagsNone 0 } + { ImageFlagsScalable HEX: 0001 } + { ImageFlagsHasAlpha HEX: 0002 } + { ImageFlagsHasTranslucent HEX: 0004 } + { ImageFlagsPartiallyScalable HEX: 0008 } + { ImageFlagsColorSpaceRGB HEX: 0010 } + { ImageFlagsColorSpaceCMYK HEX: 0020 } + { ImageFlagsColorSpaceGRAY HEX: 0040 } + { ImageFlagsColorSpaceYCBCR HEX: 0080 } + { ImageFlagsColorSpaceYCCK HEX: 0100 } + { ImageFlagsHasRealDPI HEX: 1000 } + { ImageFlagsHasRealPixelSize HEX: 2000 } + { ImageFlagsReadOnly HEX: 00010000 } + { ImageFlagsCaching HEX: 00020000 } ; + +ENUM: CombineMode + CombineModeReplace + CombineModeIntersect + CombineModeUnion + CombineModeXor + CombineModeExclude + CombineModeComplement ; + +ENUM: GpFlushIntention + { FlushIntentionFlush 0 } + { FlushIntentionSync 1 } ; + +ENUM: GpCoordinateSpace + CoordinateSpaceWorld + CoordinateSpacePage + CoordinateSpaceDevice ; + +ENUM: GpTestControlEnum + { TestControlForceBilinear 0 } + { TestControlNoICM 1 } + { TestControlGetBuildNumber 2 } ; + +ENUM: MetafileFrameUnit + { MetafileFrameUnitPixel UnitPixel } + { MetafileFrameUnitPoint UnitPoint } + { MetafileFrameUnitInch UnitInch } + { MetafileFrameUnitDocument UnitDocument } + { MetafileFrameUnitMillimeter UnitMillimeter } + MetafileFrameUnitGdi ; + +ENUM: HatchStyle + { HatchStyleHorizontal 0 } + { HatchStyleVertical 1 } + { HatchStyleForwardDiagonal 2 } + { HatchStyleBackwardDiagonal 3 } + { HatchStyleCross 4 } + { HatchStyleDiagonalCross 5 } + { HatchStyle05Percent 6 } + { HatchStyle10Percent 7 } + { HatchStyle20Percent 8 } + { HatchStyle25Percent 9 } + { HatchStyle30Percent 10 } + { HatchStyle40Percent 11 } + { HatchStyle50Percent 12 } + { HatchStyle60Percent 13 } + { HatchStyle70Percent 14 } + { HatchStyle75Percent 15 } + { HatchStyle80Percent 16 } + { HatchStyle90Percent 17 } + { HatchStyleLightDownwardDiagonal 18 } + { HatchStyleLightUpwardDiagonal 19 } + { HatchStyleDarkDownwardDiagonal 20 } + { HatchStyleDarkUpwardDiagonal 21 } + { HatchStyleWideDownwardDiagonal 22 } + { HatchStyleWideUpwardDiagonal 23 } + { HatchStyleLightVertical 24 } + { HatchStyleLightHorizontal 25 } + { HatchStyleNarrowVertical 26 } + { HatchStyleNarrowHorizontal 27 } + { HatchStyleDarkVertical 28 } + { HatchStyleDarkHorizontal 29 } + { HatchStyleDashedDownwardDiagonal 30 } + { HatchStyleDashedUpwardDiagonal 31 } + { HatchStyleDashedHorizontal 32 } + { HatchStyleDashedVertical 33 } + { HatchStyleSmallConfetti 34 } + { HatchStyleLargeConfetti 35 } + { HatchStyleZigZag 36 } + { HatchStyleWave 37 } + { HatchStyleDiagonalBrick 38 } + { HatchStyleHorizontalBrick 39 } + { HatchStyleWeave 40 } + { HatchStylePlaid 41 } + { HatchStyleDivot 42 } + { HatchStyleDottedGrid 43 } + { HatchStyleDottedDiamond 44 } + { HatchStyleShingle 45 } + { HatchStyleTrellis 46 } + { HatchStyleSphere 47 } + { HatchStyleSmallGrid 48 } + { HatchStyleSmallCheckerBoard 49 } + { HatchStyleLargeCheckerBoard 50 } + { HatchStyleOutlinedDiamond 51 } + { HatchStyleSolidDiamond 52 } + { HatchStyleTotal 53 } + { HatchStyleLargeGrid 4 } + { HatchStyleMin 0 } + { HatchStyleMax 52 } ; + +ENUM: DebugEventLevel + DebugEventLevelFatal + DebugEventLevelWarning ; + +CALLBACK: void DebugEventProc ( DebugEventLevel level, c-string msg ) ; +CALLBACK: GpStatus NotificationHookProc ( ULONG_PTR* x ) ; +CALLBACK: void NotificationUnhookProc ( ULONG_PTR x ) ; + +STRUCT: GdiplusStartupInput + { GdiplusVersion UINT32 } + { DebugEventCallback DebugEventProc } + { SuppressBackgroundThread BOOL } + { SuppressExternalCodecs BOOL } ; + +STRUCT: GdiplusStartupOutput + { NotificationHook NotificationHookProc } + { NotificationUnhook NotificationUnhookProc } ; + +FUNCTION: GpStatus GdiplusStartup ( ULONG_PTR* x, GdiplusStartupInput* in, GdiplusStartupOutput* out ) ; +FUNCTION: void GdiplusShutdown ( ULONG_PTR x ); + +TYPEDEF: DWORD ARGB +TYPEDEF: INT PixelFormat + + + +CONSTANT: PixelFormatIndexed HEX: 00010000 +CONSTANT: PixelFormatGDI HEX: 00020000 +CONSTANT: PixelFormatAlpha HEX: 00040000 +CONSTANT: PixelFormatPAlpha HEX: 00080000 +CONSTANT: PixelFormatExtended HEX: 00100000 +CONSTANT: PixelFormatCanonical HEX: 00200000 +CONSTANT: +CONSTANT: PixelFormatUndefined 0 +CONSTANT: PixelFormatDontCare 0 +CONSTANT: PixelFormatMax 15 + +: PixelFormat1bppIndexed ( -- x ) + 1 1 PixelFormatIndexed PixelFormatGDI bitor pixel-format-constant ; inline +: PixelFormat4bppIndexed ( -- x ) + 2 4 PixelFormatIndexed PixelFormatGDI bitor pixel-format-constant ; inline +: PixelFormat8bppIndexed ( -- x ) + 3 8 PixelFormatIndexed PixelFormatGDI bitor pixel-format-constant ; inline +: PixelFormat16bppGrayScale ( -- x ) + 4 16 PixelFormatExtended pixel-format-constant ; inline +: PixelFormat16bppRGB555 ( -- x ) + 5 16 PixelFormatGDI pixel-format-constant ; inline +: PixelFormat16bppRGB565 ( -- x ) + 6 16 PixelFormatGDI pixel-format-constant ; inline +: PixelFormat16bppARGB1555 ( -- x ) + 7 16 PixelFormatAlpha PixelFormatGDI bitor pixel-format-constant ; inline +: PixelFormat24bppRGB ( -- x ) + 8 24 PixelFormatGDI pixel-format-constant ; inline +: PixelFormat32bppRGB ( -- x ) + 9 32 PixelFormatGDI pixel-format-constant ; inline +: PixelFormat32bppARGB ( -- x ) + 10 32 PixelFormatAlpha PixelFormatGDI PixelFormatCanonical bitor bitor pixel-format-constant ; inline +: PixelFormat32bppPARGB ( -- x ) + 11 32 PixelFormatAlpha PixelFormatPAlpha PixelFormatGDI bitor bitor pixel-format-constant ; inline +: PixelFormat48bppRGB ( -- x ) + 12 48 PixelFormatExtended pixel-format-constant ; inline +: PixelFormat64bppARGB ( -- x ) + 13 64 PixelFormatAlpha PixelFormatCanonical PixelFormatExtended bitor bitor pixel-format-constant ; inline +: PixelFormat64bppPARGB ( -- x ) + 14 64 PixelFormatAlpha PixelFormatPAlpha PixelFormatExtended bitor bitor pixel-format-constant ; inline + +STRUCT: ColorPalette + { Flags UINT } + { Count UINT } + { Entries ARGB[1] } ; + +STRUCT: ENHMETAHEADER3 + { iType DWORD } + { nSize DWORD } + { rclBounds RECTL } + { rclFrame RECTL } + { dSignature DWORD } + { nVersion DWORD } + { nBytes DWORD } + { nRecords DWORD } + { nHandles WORD } + { sReserved WORD } + { nDescription DWORD } + { offDescription DWORD } + { nPalEntries DWORD } + { szlDevice SIZEL } + { szlMillimeters SIZEL } ; + +STRUCT: PWMFRect16 + { Left INT16 } + { Top INT16 } + { Right INT16 } + { Bottom INT16 } ; + +STRUCT: WmfPlaceableFileHeader + { Key UINT32 } + { Hmf INT16 } + { BoundingBox PWMFRect16 } + { Inch INT16 } + { Reserved INT16[2] } + { Checksum INT16 } ; + +CONSTANT: GDIP_EMFPLUSFLAGS_DISPLAY 1 + +! XXX we don't have a METAHEADER struct defined +! UNION-STRUCT: MetafileHeader-union +! { WmfHeader METAHEADER } +! { EmfHeader ENHMETAHEADER3 } ; + +UNION-STRUCT: MetafileHeader-union + { EmfHeader ENHMETAHEADER3 } ; + +STRUCT: MetafileHeader + { Type MetafileType } + { Size UINT } + { Version UINT } + { EmfPlusFlags UINT } + { DpiX REAL } + { DpiY REAL } + { X INT } + { Y INT } + { Width INT } + { Height INT } + { Header-union MetafileHeader-union } + { EmfPlusHeaderSize INT } + { LogicalDpiX INT } + { LogicalDpiY INT } ; + +CONSTANT: ImageFormatUndefined GUID: {b96b3ca9-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatMemoryBMP GUID: {b96b3caa-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatBMP GUID: {b96b3cab-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatEMF GUID: {b96b3cac-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatWMF GUID: {b96b3cad-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatJPEG GUID: {b96b3cae-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatPNG GUID: {b96b3caf-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatGIF GUID: {b96b3cb0-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatTIFF GUID: {b96b3cb1-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatEXIF GUID: {b96b3cb2-0728-11d3-9d7b-0000f81ef32e} +CONSTANT: ImageFormatIcon GUID: {b96b3cb5-0728-11d3-9d7b-0000f81ef32e} + +CONSTANT: FrameDimensionTime GUID: {6aedbd6d-3fb5-418a-83a6-7f45229dc872} +CONSTANT: FrameDimensionPage GUID: {7462dc86-6180-4c7e-8e3f-ee7333a7a483} +CONSTANT: FrameDimensionResolution GUID: {84236f7b-3bd3-428f-8dab-4ea1439ca315} + +ENUM: ImageLockMode + { ImageLockModeRead 1 } + { ImageLockModeWrite 2 } + { ImageLockModeUserInputBuf 4 } ; + +ENUM: RotateFlipType + { RotateNoneFlipNone 0 } + { Rotate180FlipXY RotateNoneFlipNone } + + { Rotate90FlipNone 1 } + { Rotate270FlipXY Rotate90FlipNone } + + { Rotate180FlipNone 2 } + { RotateNoneFlipXY Rotate180FlipNone } + + { Rotate270FlipNone 3 } + { Rotate90FlipXY Rotate270FlipNone } + + { RotateNoneFlipX 4 } + { Rotate180FlipY RotateNoneFlipX } + + { Rotate90FlipX 5 } + { Rotate270FlipY Rotate90FlipX } + + { Rotate180FlipX 6 } + { RotateNoneFlipY Rotate180FlipX } + + { Rotate270FlipX 7 } + { Rotate90FlipY Rotate270Flip } ; + +STRUCT: EncoderParameter + { Guid GUID } + { NumberOfValues ULONG } + { Type ULONG } + { Value void* } ; + +STRUCT: EncoderParameters + { Count UINT } + { Parameter EncoderParameter[1] } ; + +STRUCT: ImageCodecInfo + { Clsid CLSID } + { FormatID GUID } + { CodecName WCHAR* } + { DllName WCHAR* } + { FormatDescription WCHAR* } + { FilenameExtension WCHAR* } + { MimeType WCHAR* } + { Flags DWORD } + { Version DWORD } + { SigCount DWORD } + { SigSize DWORD } + { SigPattern BYTE* } + { SigMask BYTE* } ; + +STRUCT: BitmapData + { Width UINT } + { Height UINT } + { Stride INT } + { PixelFormat PixelFormat } + { Scan0 void* } + { Reserved UINT_PTR } ; + +STRUCT: ImageItemData + { Size UINT } + { Position UINT } + { Desc void* } + { DescSize UINT } + { Data void* } + { DataSize UINT } + { Cookie UINT } ; + +STRUCT: PropertyItem + { id PROPID } + { length ULONG } + { type WORD } + { value void* } ; + +CONSTANT: PropertyTagTypeByte 1 +CONSTANT: PropertyTagTypeASCII 2 +CONSTANT: PropertyTagTypeShort 3 +CONSTANT: PropertyTagTypeLong 4 +CONSTANT: PropertyTagTypeRational 5 +CONSTANT: PropertyTagTypeUndefined 7 +CONSTANT: PropertyTagTypeSLONG 9 +CONSTANT: PropertyTagTypeSRational 10 + +CONSTANT: PropertyTagExifIFD HEX: 8769 +CONSTANT: PropertyTagGpsIFD HEX: 8825 + +CONSTANT: PropertyTagNewSubfileType HEX: 00FE +CONSTANT: PropertyTagSubfileType HEX: 00FF +CONSTANT: PropertyTagImageWidth HEX: 0100 +CONSTANT: PropertyTagImageHeight HEX: 0101 +CONSTANT: PropertyTagBitsPerSample HEX: 0102 +CONSTANT: PropertyTagCompression HEX: 0103 +CONSTANT: PropertyTagPhotometricInterp HEX: 0106 +CONSTANT: PropertyTagThreshHolding HEX: 0107 +CONSTANT: PropertyTagCellWidth HEX: 0108 +CONSTANT: PropertyTagCellHeight HEX: 0109 +CONSTANT: PropertyTagFillOrder HEX: 010A +CONSTANT: PropertyTagDocumentName HEX: 010D +CONSTANT: PropertyTagImageDescription HEX: 010E +CONSTANT: PropertyTagEquipMake HEX: 010F +CONSTANT: PropertyTagEquipModel HEX: 0110 +CONSTANT: PropertyTagStripOffsets HEX: 0111 +CONSTANT: PropertyTagOrientation HEX: 0112 +CONSTANT: PropertyTagSamplesPerPixel HEX: 0115 +CONSTANT: PropertyTagRowsPerStrip HEX: 0116 +CONSTANT: PropertyTagStripBytesCount HEX: 0117 +CONSTANT: PropertyTagMinSampleValue HEX: 0118 +CONSTANT: PropertyTagMaxSampleValue HEX: 0119 +CONSTANT: PropertyTagXResolution HEX: 011A +CONSTANT: PropertyTagYResolution HEX: 011B +CONSTANT: PropertyTagPlanarConfig HEX: 011C +CONSTANT: PropertyTagPageName HEX: 011D +CONSTANT: PropertyTagXPosition HEX: 011E +CONSTANT: PropertyTagYPosition HEX: 011F +CONSTANT: PropertyTagFreeOffset HEX: 0120 +CONSTANT: PropertyTagFreeByteCounts HEX: 0121 +CONSTANT: PropertyTagGrayResponseUnit HEX: 0122 +CONSTANT: PropertyTagGrayResponseCurve HEX: 0123 +CONSTANT: PropertyTagT4Option HEX: 0124 +CONSTANT: PropertyTagT6Option HEX: 0125 +CONSTANT: PropertyTagResolutionUnit HEX: 0128 +CONSTANT: PropertyTagPageNumber HEX: 0129 +CONSTANT: PropertyTagTransferFuncition HEX: 012D +CONSTANT: PropertyTagSoftwareUsed HEX: 0131 +CONSTANT: PropertyTagDateTime HEX: 0132 +CONSTANT: PropertyTagArtist HEX: 013B +CONSTANT: PropertyTagHostComputer HEX: 013C +CONSTANT: PropertyTagPredictor HEX: 013D +CONSTANT: PropertyTagWhitePoint HEX: 013E +CONSTANT: PropertyTagPrimaryChromaticities HEX: 013F +CONSTANT: PropertyTagColorMap HEX: 0140 +CONSTANT: PropertyTagHalftoneHints HEX: 0141 +CONSTANT: PropertyTagTileWidth HEX: 0142 +CONSTANT: PropertyTagTileLength HEX: 0143 +CONSTANT: PropertyTagTileOffset HEX: 0144 +CONSTANT: PropertyTagTileByteCounts HEX: 0145 +CONSTANT: PropertyTagInkSet HEX: 014C +CONSTANT: PropertyTagInkNames HEX: 014D +CONSTANT: PropertyTagNumberOfInks HEX: 014E +CONSTANT: PropertyTagDotRange HEX: 0150 +CONSTANT: PropertyTagTargetPrinter HEX: 0151 +CONSTANT: PropertyTagExtraSamples HEX: 0152 +CONSTANT: PropertyTagSampleFormat HEX: 0153 +CONSTANT: PropertyTagSMinSampleValue HEX: 0154 +CONSTANT: PropertyTagSMaxSampleValue HEX: 0155 +CONSTANT: PropertyTagTransferRange HEX: 0156 + +CONSTANT: PropertyTagJPEGProc HEX: 0200 +CONSTANT: PropertyTagJPEGInterFormat HEX: 0201 +CONSTANT: PropertyTagJPEGInterLength HEX: 0202 +CONSTANT: PropertyTagJPEGRestartInterval HEX: 0203 +CONSTANT: PropertyTagJPEGLosslessPredictors HEX: 0205 +CONSTANT: PropertyTagJPEGPointTransforms HEX: 0206 +CONSTANT: PropertyTagJPEGQTables HEX: 0207 +CONSTANT: PropertyTagJPEGDCTables HEX: 0208 +CONSTANT: PropertyTagJPEGACTables HEX: 0209 + +CONSTANT: PropertyTagYCbCrCoefficients HEX: 0211 +CONSTANT: PropertyTagYCbCrSubsampling HEX: 0212 +CONSTANT: PropertyTagYCbCrPositioning HEX: 0213 +CONSTANT: PropertyTagREFBlackWhite HEX: 0214 + +CONSTANT: PropertyTagICCProfile HEX: 8773 + +CONSTANT: PropertyTagGamma HEX: 0301 +CONSTANT: PropertyTagICCProfileDescriptor HEX: 0302 +CONSTANT: PropertyTagSRGBRenderingIntent HEX: 0303 + +CONSTANT: PropertyTagImageTitle HEX: 0320 +CONSTANT: PropertyTagCopyright HEX: 8298 + +CONSTANT: PropertyTagResolutionXUnit HEX: 5001 +CONSTANT: PropertyTagResolutionYUnit HEX: 5002 +CONSTANT: PropertyTagResolutionXLengthUnit HEX: 5003 +CONSTANT: PropertyTagResolutionYLengthUnit HEX: 5004 +CONSTANT: PropertyTagPrintFlags HEX: 5005 +CONSTANT: PropertyTagPrintFlagsVersion HEX: 5006 +CONSTANT: PropertyTagPrintFlagsCrop HEX: 5007 +CONSTANT: PropertyTagPrintFlagsBleedWidth HEX: 5008 +CONSTANT: PropertyTagPrintFlagsBleedWidthScale HEX: 5009 +CONSTANT: PropertyTagHalftoneLPI HEX: 500A +CONSTANT: PropertyTagHalftoneLPIUnit HEX: 500B +CONSTANT: PropertyTagHalftoneDegree HEX: 500C +CONSTANT: PropertyTagHalftoneShape HEX: 500D +CONSTANT: PropertyTagHalftoneMisc HEX: 500E +CONSTANT: PropertyTagHalftoneScreen HEX: 500F +CONSTANT: PropertyTagJPEGQuality HEX: 5010 +CONSTANT: PropertyTagGridSize HEX: 5011 +CONSTANT: PropertyTagThumbnailFormat HEX: 5012 +CONSTANT: PropertyTagThumbnailWidth HEX: 5013 +CONSTANT: PropertyTagThumbnailHeight HEX: 5014 +CONSTANT: PropertyTagThumbnailColorDepth HEX: 5015 +CONSTANT: PropertyTagThumbnailPlanes HEX: 5016 +CONSTANT: PropertyTagThumbnailRawBytes HEX: 5017 +CONSTANT: PropertyTagThumbnailSize HEX: 5018 +CONSTANT: PropertyTagThumbnailCompressedSize HEX: 5019 +CONSTANT: PropertyTagColorTransferFunction HEX: 501A +CONSTANT: PropertyTagThumbnailData HEX: 501B + +CONSTANT: PropertyTagThumbnailImageWidth HEX: 5020 +CONSTANT: PropertyTagThumbnailImageHeight HEX: 5021 +CONSTANT: PropertyTagThumbnailBitsPerSample HEX: 5022 +CONSTANT: PropertyTagThumbnailCompression HEX: 5023 +CONSTANT: PropertyTagThumbnailPhotometricInterp HEX: 5024 +CONSTANT: PropertyTagThumbnailImageDescription HEX: 5025 +CONSTANT: PropertyTagThumbnailEquipMake HEX: 5026 +CONSTANT: PropertyTagThumbnailEquipModel HEX: 5027 +CONSTANT: PropertyTagThumbnailStripOffsets HEX: 5028 +CONSTANT: PropertyTagThumbnailOrientation HEX: 5029 +CONSTANT: PropertyTagThumbnailSamplesPerPixel HEX: 502A +CONSTANT: PropertyTagThumbnailRowsPerStrip HEX: 502B +CONSTANT: PropertyTagThumbnailStripBytesCount HEX: 502C +CONSTANT: PropertyTagThumbnailResolutionX HEX: 502D +CONSTANT: PropertyTagThumbnailResolutionY HEX: 502E +CONSTANT: PropertyTagThumbnailPlanarConfig HEX: 502F +CONSTANT: PropertyTagThumbnailResolutionUnit HEX: 5030 +CONSTANT: PropertyTagThumbnailTransferFunction HEX: 5031 +CONSTANT: PropertyTagThumbnailSoftwareUsed HEX: 5032 +CONSTANT: PropertyTagThumbnailDateTime HEX: 5033 +CONSTANT: PropertyTagThumbnailArtist HEX: 5034 +CONSTANT: PropertyTagThumbnailWhitePoint HEX: 5035 +CONSTANT: PropertyTagThumbnailPrimaryChromaticities HEX: 5036 +CONSTANT: PropertyTagThumbnailYCbCrCoefficients HEX: 5037 +CONSTANT: PropertyTagThumbnailYCbCrSubsampling HEX: 5038 +CONSTANT: PropertyTagThumbnailYCbCrPositioning HEX: 5039 +CONSTANT: PropertyTagThumbnailRefBlackWhite HEX: 503A +CONSTANT: PropertyTagThumbnailCopyRight HEX: 503B + +CONSTANT: PropertyTagLuminanceTable HEX: 5090 +CONSTANT: PropertyTagChrominanceTable HEX: 5091 + +CONSTANT: PropertyTagFrameDelay HEX: 5100 +CONSTANT: PropertyTagLoopCount HEX: 5101 + +CONSTANT: PropertyTagPixelUnit HEX: 5110 +CONSTANT: PropertyTagPixelPerUnitX HEX: 5111 +CONSTANT: PropertyTagPixelPerUnitY HEX: 5112 +CONSTANT: PropertyTagPaletteHistogram HEX: 5113 + +CONSTANT: PropertyTagExifExposureTime HEX: 829A +CONSTANT: PropertyTagExifFNumber HEX: 829D + +CONSTANT: PropertyTagExifExposureProg HEX: 8822 +CONSTANT: PropertyTagExifSpectralSense HEX: 8824 +CONSTANT: PropertyTagExifISOSpeed HEX: 8827 +CONSTANT: PropertyTagExifOECF HEX: 8828 + +CONSTANT: PropertyTagExifVer HEX: 9000 +CONSTANT: PropertyTagExifDTOrig HEX: 9003 +CONSTANT: PropertyTagExifDTDigitized HEX: 9004 + +CONSTANT: PropertyTagExifCompConfig HEX: 9101 +CONSTANT: PropertyTagExifCompBPP HEX: 9102 + +CONSTANT: PropertyTagExifShutterSpeed HEX: 9201 +CONSTANT: PropertyTagExifAperture HEX: 9202 +CONSTANT: PropertyTagExifBrightness HEX: 9203 +CONSTANT: PropertyTagExifExposureBias HEX: 9204 +CONSTANT: PropertyTagExifMaxAperture HEX: 9205 +CONSTANT: PropertyTagExifSubjectDist HEX: 9206 +CONSTANT: PropertyTagExifMeteringMode HEX: 9207 +CONSTANT: PropertyTagExifLightSource HEX: 9208 +CONSTANT: PropertyTagExifFlash HEX: 9209 +CONSTANT: PropertyTagExifFocalLength HEX: 920A +CONSTANT: PropertyTagExifMakerNote HEX: 927C +CONSTANT: PropertyTagExifUserComment HEX: 9286 +CONSTANT: PropertyTagExifDTSubsec HEX: 9290 +CONSTANT: PropertyTagExifDTOrigSS HEX: 9291 +CONSTANT: PropertyTagExifDTDigSS HEX: 9292 + +CONSTANT: PropertyTagExifFPXVer HEX: A000 +CONSTANT: PropertyTagExifColorSpace HEX: A001 +CONSTANT: PropertyTagExifPixXDim HEX: A002 +CONSTANT: PropertyTagExifPixYDim HEX: A003 +CONSTANT: PropertyTagExifRelatedWav HEX: A004 +CONSTANT: PropertyTagExifInterop HEX: A005 +CONSTANT: PropertyTagExifFlashEnergy HEX: A20B +CONSTANT: PropertyTagExifSpatialFR HEX: A20C +CONSTANT: PropertyTagExifFocalXRes HEX: A20E +CONSTANT: PropertyTagExifFocalYRes HEX: A20F +CONSTANT: PropertyTagExifFocalResUnit HEX: A210 +CONSTANT: PropertyTagExifSubjectLoc HEX: A214 +CONSTANT: PropertyTagExifExposureIndex HEX: A215 +CONSTANT: PropertyTagExifSensingMethod HEX: A217 +CONSTANT: PropertyTagExifFileSource HEX: A300 +CONSTANT: PropertyTagExifSceneType HEX: A301 +CONSTANT: PropertyTagExifCfaPattern HEX: A302 + +CONSTANT: PropertyTagGpsVer HEX: 0000 +CONSTANT: PropertyTagGpsLatitudeRef HEX: 0001 +CONSTANT: PropertyTagGpsLatitude HEX: 0002 +CONSTANT: PropertyTagGpsLongitudeRef HEX: 0003 +CONSTANT: PropertyTagGpsLongitude HEX: 0004 +CONSTANT: PropertyTagGpsAltitudeRef HEX: 0005 +CONSTANT: PropertyTagGpsAltitude HEX: 0006 +CONSTANT: PropertyTagGpsGpsTime HEX: 0007 +CONSTANT: PropertyTagGpsGpsSatellites HEX: 0008 +CONSTANT: PropertyTagGpsGpsStatus HEX: 0009 +CONSTANT: PropertyTagGpsGpsMeasureMode HEX: 000A +CONSTANT: PropertyTagGpsGpsDop HEX: 000B +CONSTANT: PropertyTagGpsSpeedRef HEX: 000C +CONSTANT: PropertyTagGpsSpeed HEX: 000D +CONSTANT: PropertyTagGpsTrackRef HEX: 000E +CONSTANT: PropertyTagGpsTrack HEX: 000F +CONSTANT: PropertyTagGpsImgDirRef HEX: 0010 +CONSTANT: PropertyTagGpsImgDir HEX: 0011 +CONSTANT: PropertyTagGpsMapDatum HEX: 0012 +CONSTANT: PropertyTagGpsDestLatRef HEX: 0013 +CONSTANT: PropertyTagGpsDestLat HEX: 0014 +CONSTANT: PropertyTagGpsDestLongRef HEX: 0015 +CONSTANT: PropertyTagGpsDestLong HEX: 0016 +CONSTANT: PropertyTagGpsDestBearRef HEX: 0017 +CONSTANT: PropertyTagGpsDestBear HEX: 0018 +CONSTANT: PropertyTagGpsDestDistRef HEX: 0019 +CONSTANT: PropertyTagGpsDestDist HEX: 001A + +ENUM: ColorChannelFlags + ColorChannelFlagsC + ColorChannelFlagsM + ColorChannelFlagsY + ColorChannelFlagsK + ColorChannelFlagsLast ; + +STRUCT: GpColor + { Argb ARGB } ; + +STRUCT: ColorMatrix + { m REAL[5][5] } ; + +ENUM: ColorMatrixFlags + { ColorMatrixFlagsDefault 0 } + { ColorMatrixFlagsSkipGrays 1 } + { ColorMatrixFlagsAltGray 2 } ; + +ENUM: ColorAdjustType + { ColorAdjustTypeDefault } + { ColorAdjustTypeBitmap } + { ColorAdjustTypeBrush } + { ColorAdjustTypePen } + { ColorAdjustTypeText } + { ColorAdjustTypeCount } + { ColorAdjustTypeAny } ; + +STRUCT: ColorMap + { oldColor GpColor } + { newColor GpColor } ; + +C-TYPE: GpGraphics +C-TYPE: GpPen +C-TYPE: GpBrush +C-TYPE: GpHatch +C-TYPE: GpSolidFill +C-TYPE: GpPath +C-TYPE: GpMatrix +C-TYPE: GpPathIterator +C-TYPE: GpCustomLineCap +C-TYPE: GpAdjustableArrowCap +C-TYPE: GpImage +C-TYPE: GpMetafile +C-TYPE: GpImageAttributes +C-TYPE: GpCachedBitmap +C-TYPE: GpBitmap +C-TYPE: GpPathGradient +C-TYPE: GpLineGradient +C-TYPE: GpTexture +C-TYPE: GpFont +C-TYPE: GpFontCollection +C-TYPE: GpFontFamily +C-TYPE: GpStringFormat +C-TYPE: GpRegion +C-TYPE: CGpEffect + +FUNCTION: GpStatus GdipCreateAdjustableArrowCap ( REAL x, REAL x, BOOL x, GpAdjustableArrowCap** x ) ; +FUNCTION: GpStatus GdipGetAdjustableArrowCapFillState ( GpAdjustableArrowCap* x, BOOL* x ) ; +FUNCTION: GpStatus GdipGetAdjustableArrowCapHeight ( GpAdjustableArrowCap* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetAdjustableArrowCapMiddleInset ( GpAdjustableArrowCap* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetAdjustableArrowCapWidth ( GpAdjustableArrowCap* x, REAL* x ) ; +FUNCTION: GpStatus GdipSetAdjustableArrowCapFillState ( GpAdjustableArrowCap* x, BOOL x ) ; +FUNCTION: GpStatus GdipSetAdjustableArrowCapHeight ( GpAdjustableArrowCap* x, REAL x ) ; +FUNCTION: GpStatus GdipSetAdjustableArrowCapMiddleInset ( GpAdjustableArrowCap* x, REAL x ) ; +FUNCTION: GpStatus GdipSetAdjustableArrowCapWidth ( GpAdjustableArrowCap* x, REAL x ) ; + +FUNCTION: GpStatus GdipBitmapApplyEffect ( GpBitmap* x, CGpEffect* x, RECT* x, BOOL x, VOID** x, INT* x ) ; +FUNCTION: GpStatus GdipBitmapCreateApplyEffect ( GpBitmap** x, INT x, CGpEffect* x, RECT* x, RECT* x, GpBitmap** x, BOOL x, VOID** x, INT* x ) ; +FUNCTION: GpStatus GdipBitmapGetPixel ( GpBitmap* x, INT x, INT x, ARGB* x ) ; +FUNCTION: GpStatus GdipBitmapLockBits ( GpBitmap* x, GpRect* x, UINT x, + PixelFormat x, BitmapData* x ) ; +FUNCTION: GpStatus GdipBitmapSetPixel ( GpBitmap* x, INT x, INT x, ARGB x ) ; +FUNCTION: GpStatus GdipBitmapSetResolution ( GpBitmap* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipBitmapUnlockBits ( GpBitmap* x, BitmapData* x ) ; +FUNCTION: GpStatus GdipCloneBitmapArea ( REAL x, REAL x, REAL x, REAL x, PixelFormat x, GpBitmap* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCloneBitmapAreaI ( INT x, INT x, INT x, INT x, PixelFormat x, GpBitmap* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromFile ( WCHAR* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromFileICM ( WCHAR* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromGdiDib ( BITMAPINFO* x, VOID* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromGraphics ( INT x, INT x, GpGraphics* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromHBITMAP ( HBITMAP x, HPALETTE x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromHICON ( HICON x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromResource ( HINSTANCE x, WCHAR* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromScan0 ( INT x, INT x, INT x, PixelFormat x, BYTE* x, + GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromStream ( IStream* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateBitmapFromStreamICM ( IStream* x, GpBitmap** x ) ; +FUNCTION: GpStatus GdipCreateHBITMAPFromBitmap ( GpBitmap* x, HBITMAP* x, ARGB x ) ; +FUNCTION: GpStatus GdipCreateHICONFromBitmap ( GpBitmap* x, HICON* x ) ; +FUNCTION: GpStatus GdipDeleteEffect ( CGpEffect* x ) ; +FUNCTION: GpStatus GdipSetEffectParameters ( CGpEffect* x, const VOID* x, const UINT x ) ; + + +FUNCTION: GpStatus GdipCloneBrush ( GpBrush* x, GpBrush** x ) ; +FUNCTION: GpStatus GdipDeleteBrush ( GpBrush* x ) ; +FUNCTION: GpStatus GdipGetBrushType ( GpBrush* x, GpBrushType* x ) ; + + +FUNCTION: GpStatus GdipCreateCachedBitmap ( GpBitmap* x, GpGraphics* x, + GpCachedBitmap** x ) ; +FUNCTION: GpStatus GdipDeleteCachedBitmap ( GpCachedBitmap* x ) ; +FUNCTION: GpStatus GdipDrawCachedBitmap ( GpGraphics* x, GpCachedBitmap* x, INT x, INT x ) ; + + +FUNCTION: GpStatus GdipCloneCustomLineCap ( GpCustomLineCap* x, GpCustomLineCap** x ) ; +FUNCTION: GpStatus GdipCreateCustomLineCap ( GpPath* x, GpPath* x, GpLineCap x, REAL x, + GpCustomLineCap** x ) ; +FUNCTION: GpStatus GdipDeleteCustomLineCap ( GpCustomLineCap* x ) ; +FUNCTION: GpStatus GdipGetCustomLineCapBaseCap ( GpCustomLineCap* x, GpLineCap* x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapBaseCap ( GpCustomLineCap* x, GpLineCap x ) ; +FUNCTION: GpStatus GdipGetCustomLineCapBaseInset ( GpCustomLineCap* x, REAL* x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapBaseInset ( GpCustomLineCap* x, REAL x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapStrokeCaps ( GpCustomLineCap* x, GpLineCap x, + GpLineCap x ) ; +FUNCTION: GpStatus GdipGetCustomLineCapStrokeJoin ( GpCustomLineCap* x, GpLineJoin* x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapStrokeJoin ( GpCustomLineCap* x, GpLineJoin x ) ; +FUNCTION: GpStatus GdipGetCustomLineCapWidthScale ( GpCustomLineCap* x, REAL* x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapWidthScale ( GpCustomLineCap* x, REAL x ) ; +FUNCTION: GpStatus GdipSetCustomLineCapBaseInset ( GpCustomLineCap* x, REAL x ) ; + + +FUNCTION: GpStatus GdipCloneFont ( GpFont* x, GpFont** x ) ; +FUNCTION: GpStatus GdipCreateFont ( GpFontFamily* x, REAL x, INT x, Unit x, + GpFont** x ) ; +FUNCTION: GpStatus GdipCreateFontFromDC ( HDC x, GpFont** x ) ; +FUNCTION: GpStatus GdipCreateFontFromLogfontA ( HDC x, LOGFONTA* x, GpFont** x ) ; +FUNCTION: GpStatus GdipCreateFontFromLogfontW ( HDC x, LOGFONTW* x, GpFont** x ) ; +FUNCTION: GpStatus GdipDeleteFont ( GpFont* x ) ; +FUNCTION: GpStatus GdipGetLogFontA ( GpFont* x, GpGraphics* x, LOGFONTA* x ) ; +FUNCTION: GpStatus GdipGetLogFontW ( GpFont* x, GpGraphics* x, LOGFONTW* x ) ; +FUNCTION: GpStatus GdipGetFamily ( GpFont* x, GpFontFamily** x ) ; +FUNCTION: GpStatus GdipGetFontUnit ( GpFont* x, Unit* x ) ; +FUNCTION: GpStatus GdipGetFontSize ( GpFont* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetFontStyle ( GpFont* x, INT* x ) ; +FUNCTION: GpStatus GdipGetFontHeight ( GpFont* x, GpGraphics* x, + REAL* x ) ; +FUNCTION: GpStatus GdipGetFontHeightGivenDPI ( GpFont* x, REAL x, REAL* x ) ; + + +FUNCTION: GpStatus GdipNewInstalledFontCollection ( GpFontCollection** x ) ; +FUNCTION: GpStatus GdipNewPrivateFontCollection ( GpFontCollection** x ) ; +FUNCTION: GpStatus GdipDeletePrivateFontCollection ( GpFontCollection** x ) ; +FUNCTION: GpStatus GdipPrivateAddFontFile ( GpFontCollection* x, WCHAR* x ) ; +FUNCTION: GpStatus GdipPrivateAddMemoryFont ( GpFontCollection* x, + void* x, INT x ) ; +FUNCTION: GpStatus GdipGetFontCollectionFamilyCount ( GpFontCollection* x, INT* x ) ; +FUNCTION: GpStatus GdipGetFontCollectionFamilyList ( GpFontCollection* x, INT x, + GpFontFamily*[] x, INT* x ) ; + + +FUNCTION: GpStatus GdipCloneFontFamily ( GpFontFamily* x, GpFontFamily** x ) ; +FUNCTION: GpStatus GdipCreateFontFamilyFromName ( WCHAR* x, + GpFontCollection* x, GpFontFamily** x ) ; +FUNCTION: GpStatus GdipDeleteFontFamily ( GpFontFamily* x ) ; +FUNCTION: GpStatus GdipGetFamilyName ( GpFontFamily* x, WCHAR* x, LANGID x ) ; +FUNCTION: GpStatus GdipGetCellAscent ( GpFontFamily* x, INT x, UINT16* x ) ; +FUNCTION: GpStatus GdipGetCellDescent ( GpFontFamily* x, INT x, UINT16* x ) ; +FUNCTION: GpStatus GdipGetEmHeight ( GpFontFamily* x, INT x, UINT16* x ) ; +FUNCTION: GpStatus GdipGetGenericFontFamilySansSerif ( GpFontFamily** x ) ; +FUNCTION: GpStatus GdipGetGenericFontFamilySerif ( GpFontFamily** x ) ; +FUNCTION: GpStatus GdipGetGenericFontFamilyMonospace ( GpFontFamily** x ) ; +FUNCTION: GpStatus GdipGetLineSpacing ( GpFontFamily* x, INT x, UINT16* x ) ; +FUNCTION: GpStatus GdipIsStyleAvailable ( GpFontFamily * x, INT x, BOOL* x ) ; + + +FUNCTION: GpStatus GdipFlush ( GpGraphics* x, GpFlushIntention x ) ; +FUNCTION: GpStatus GdipBeginContainer ( GpGraphics* x, GpRectF* x, GpRectF* x, GpUnit x, GraphicsContainer* x ) ; +FUNCTION: GpStatus GdipBeginContainer2 ( GpGraphics* x, GraphicsContainer* x ) ; +FUNCTION: GpStatus GdipBeginContainerI ( GpGraphics* x, GpRect* x, GpRect* x, GpUnit x, GraphicsContainer* x ) ; +FUNCTION: GpStatus GdipEndContainer ( GpGraphics* x, GraphicsContainer x ) ; +FUNCTION: GpStatus GdipComment ( GpGraphics* x, UINT x, BYTE* x ) ; +FUNCTION: GpStatus GdipCreateFromHDC ( HDC x, GpGraphics** x ) ; +FUNCTION: GpStatus GdipCreateFromHDC2 ( HDC x, HANDLE x, GpGraphics** x ) ; +FUNCTION: GpStatus GdipCreateFromHWND ( HWND x, GpGraphics** x ) ; +FUNCTION: GpStatus GdipCreateFromHWNDICM ( HWND x, GpGraphics** x ) ; +FUNCTION: HPALETTE GdipCreateHalftonePalette ( void x ) ; +FUNCTION: GpStatus GdipDeleteGraphics ( GpGraphics * x ) ; +FUNCTION: GpStatus GdipDrawArc ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawArcI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawBezier ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawBezierI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawBeziers ( GpGraphics* x, GpPen* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawBeziersI ( GpGraphics* x, GpPen* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawClosedCurve ( GpGraphics* x, GpPen* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawClosedCurveI ( GpGraphics* x, GpPen* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawClosedCurve2 ( GpGraphics* x, GpPen* x, GpPointF* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawClosedCurve2I ( GpGraphics* x, GpPen* x, GpPoint* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawCurve ( GpGraphics* x, GpPen* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawCurveI ( GpGraphics* x, GpPen* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawCurve2 ( GpGraphics* x, GpPen* x, GpPointF* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawCurve2I ( GpGraphics* x, GpPen* x, GpPoint* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawCurve3 ( GpGraphics* x, GpPen* x, GpPointF* x, INT x, INT x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawCurve3I ( GpGraphics* x, GpPen* x, GpPoint* x, INT x, INT x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipDrawDriverString ( GpGraphics* x, UINT16* x, INT x, + GpFont* x, GpBrush* x, PointF* x, INT x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipDrawEllipse ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawEllipseI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawImage ( GpGraphics* x, GpImage* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawImageI ( GpGraphics* x, GpImage* x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawImagePointRect ( GpGraphics* x, GpImage* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, GpUnit x ) ; +FUNCTION: GpStatus GdipDrawImagePointRectI ( GpGraphics* x, GpImage* x, INT x, INT x, INT x, INT x, INT x, INT x, GpUnit x ) ; +FUNCTION: GpStatus GdipDrawImagePoints ( GpGraphics* x, GpImage* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawImagePointsI ( GpGraphics* x, GpImage* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawImagePointsRect ( GpGraphics* x, GpImage* x, + GpPointF* x, INT x, REAL x, REAL x, REAL x, REAL x, GpUnit x, + GpImageAttributes* x, DrawImageAbort x, VOID* x ) ; +FUNCTION: GpStatus GdipDrawImagePointsRectI ( GpGraphics* x, GpImage* x, + GpPoint* x, INT x, INT x, INT x, INT x, INT x, GpUnit x, + GpImageAttributes* x, DrawImageAbort x, VOID* x ) ; +FUNCTION: GpStatus GdipDrawImageRect ( GpGraphics* x, GpImage* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawImageRectI ( GpGraphics* x, GpImage* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawImageRectRect ( GpGraphics* x, GpImage* x, REAL x, REAL x, REAL x, + REAL x, REAL x, REAL x, REAL x, REAL x, GpUnit x, GpImageAttributes* x, DrawImageAbort x, + VOID* x ) ; +FUNCTION: GpStatus GdipDrawImageRectRectI ( GpGraphics* x, GpImage* x, INT x, INT x, INT x, + INT x, INT x, INT x, INT x, INT x, GpUnit x, GpImageAttributes* x, DrawImageAbort x, + VOID* x ) ; +FUNCTION: GpStatus GdipDrawLine ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawLineI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawLines ( GpGraphics* x, GpPen* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawLinesI ( GpGraphics* x, GpPen* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawPath ( GpGraphics* x, GpPen* x, GpPath* x ) ; +FUNCTION: GpStatus GdipDrawPie ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawPieI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawPolygon ( GpGraphics* x, GpPen* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawPolygonI ( GpGraphics* x, GpPen* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipDrawRectangle ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipDrawRectangleI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipDrawRectangles ( GpGraphics* x, GpPen* x, GpRectF* x, INT x ) ; +FUNCTION: GpStatus GdipDrawRectanglesI ( GpGraphics* x, GpPen* x, GpRect* x, INT x ) ; +FUNCTION: GpStatus GdipDrawString ( GpGraphics* x, WCHAR* x, INT x, + GpFont* x, RectF* x, GpStringFormat* x, + GpBrush* x ) ; +FUNCTION: GpStatus GdipFillClosedCurve2 ( GpGraphics* x, GpBrush* x, GpPointF* x, INT x, + REAL x, GpFillMode x ) ; +FUNCTION: GpStatus GdipFillClosedCurve2I ( GpGraphics* x, GpBrush* x, GpPoint* x, INT x, + REAL x, GpFillMode x ) ; +FUNCTION: GpStatus GdipFillEllipse ( GpGraphics* x, GpBrush* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipFillEllipseI ( GpGraphics* x, GpBrush* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipFillPath ( GpGraphics* x, GpBrush* x, GpPath* x ) ; +FUNCTION: GpStatus GdipFillPie ( GpGraphics* x, GpBrush* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipFillPieI ( GpGraphics* x, GpBrush* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipFillPolygon ( GpGraphics* x, GpBrush* x, GpPointF* x, + INT x, GpFillMode x ) ; +FUNCTION: GpStatus GdipFillPolygonI ( GpGraphics* x, GpBrush* x, GpPoint* x, + INT x, GpFillMode x ) ; +FUNCTION: GpStatus GdipFillPolygon2 ( GpGraphics* x, GpBrush* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipFillPolygon2I ( GpGraphics* x, GpBrush* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipFillRectangle ( GpGraphics* x, GpBrush* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipFillRectangleI ( GpGraphics* x, GpBrush* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipFillRectangles ( GpGraphics* x, GpBrush* x, GpRectF* x, INT x ) ; +FUNCTION: GpStatus GdipFillRectanglesI ( GpGraphics* x, GpBrush* x, GpRect* x, INT x ) ; +FUNCTION: GpStatus GdipFillRegion ( GpGraphics* x, GpBrush* x, GpRegion* x ) ; +FUNCTION: GpStatus GdipGetClip ( GpGraphics* x, GpRegion* x ) ; +FUNCTION: GpStatus GdipGetClipBounds ( GpGraphics* x, GpRectF* x ) ; +FUNCTION: GpStatus GdipGetClipBoundsI ( GpGraphics* x, GpRect* x ) ; +FUNCTION: GpStatus GdipGetCompositingMode ( GpGraphics* x, CompositingMode* x ) ; +FUNCTION: GpStatus GdipGetCompositingQuality ( GpGraphics* x, CompositingQuality* x ) ; +FUNCTION: GpStatus GdipGetDC ( GpGraphics* x, HDC* x ) ; +FUNCTION: GpStatus GdipGetDpiX ( GpGraphics* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetDpiY ( GpGraphics* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetImageDecoders ( UINT x, UINT x, ImageCodecInfo* x ) ; +FUNCTION: GpStatus GdipGetImageDecodersSize ( UINT* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetImageGraphicsContext ( GpImage* x, GpGraphics** x ) ; +FUNCTION: GpStatus GdipGetInterpolationMode ( GpGraphics* x, InterpolationMode* x ) ; +FUNCTION: GpStatus GdipGetNearestColor ( GpGraphics* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetPageScale ( GpGraphics* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetPageUnit ( GpGraphics* x, GpUnit* x ) ; +FUNCTION: GpStatus GdipGetPixelOffsetMode ( GpGraphics* x, PixelOffsetMode* x ) ; +FUNCTION: GpStatus GdipGetSmoothingMode ( GpGraphics* x, SmoothingMode* x ) ; +FUNCTION: GpStatus GdipGetTextContrast ( GpGraphics* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetTextRenderingHint ( GpGraphics* x, TextRenderingHint* x ) ; +FUNCTION: GpStatus GdipGetWorldTransform ( GpGraphics* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipGraphicsClear ( GpGraphics* x, ARGB x ) ; +FUNCTION: GpStatus GdipGetVisibleClipBounds ( GpGraphics* x, GpRectF* x ) ; +FUNCTION: GpStatus GdipGetVisibleClipBoundsI ( GpGraphics* x, GpRect* x ) ; +FUNCTION: GpStatus GdipIsClipEmpty ( GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisiblePoint ( GpGraphics* x, REAL x, REAL x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisiblePointI ( GpGraphics* x, INT x, INT x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRect ( GpGraphics* x, REAL x, REAL x, REAL x, REAL x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRectI ( GpGraphics* x, INT x, INT x, INT x, INT x, BOOL* x ) ; +FUNCTION: GpStatus GdipMeasureCharacterRanges ( GpGraphics* x, WCHAR* x, + INT x, GpFont* x, RectF* x, GpStringFormat* x, INT x, + GpRegion** x ) ; +FUNCTION: GpStatus GdipMeasureDriverString ( GpGraphics* x, UINT16* x, INT x, + GpFont* x, PointF* x, INT x, GpMatrix* x, RectF* x ) ; +FUNCTION: GpStatus GdipMeasureString ( GpGraphics* x, WCHAR* x, INT x, + GpFont* x, RectF* x, GpStringFormat* x, RectF* x, INT* x, INT* x ) ; +FUNCTION: GpStatus GdipMultiplyWorldTransform ( GpGraphics* x, GpMatrix* x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipRecordMetafileFileName ( WCHAR* x, HDC x, EmfType x, + GpRectF* x, MetafileFrameUnit x, WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipRecordMetafileFileNameI ( WCHAR* x, HDC x, EmfType x, + GpRect* x, MetafileFrameUnit x, WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipRecordMetafileI ( HDC x, EmfType x, GpRect* x, + MetafileFrameUnit x, WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipReleaseDC ( GpGraphics* x, HDC x ) ; +FUNCTION: GpStatus GdipResetClip ( GpGraphics* x ) ; +FUNCTION: GpStatus GdipResetWorldTransform ( GpGraphics* x ) ; +FUNCTION: GpStatus GdipRestoreGraphics ( GpGraphics* x, GraphicsState x ) ; +FUNCTION: GpStatus GdipRotateWorldTransform ( GpGraphics* x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSaveGraphics ( GpGraphics* x, GraphicsState* x ) ; +FUNCTION: GpStatus GdipScaleWorldTransform ( GpGraphics* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSetClipHrgn ( GpGraphics* x, HRGN x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetClipGraphics ( GpGraphics* x, GpGraphics* x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetClipPath ( GpGraphics* x, GpPath* x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetClipRect ( GpGraphics* x, REAL x, REAL x, REAL x, REAL x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetClipRectI ( GpGraphics* x, INT x, INT x, INT x, INT x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetClipRegion ( GpGraphics* x, GpRegion* x, CombineMode x ) ; +FUNCTION: GpStatus GdipSetCompositingMode ( GpGraphics* x, CompositingMode x ) ; +FUNCTION: GpStatus GdipSetCompositingQuality ( GpGraphics* x, CompositingQuality x ) ; +FUNCTION: GpStatus GdipSetInterpolationMode ( GpGraphics* x, InterpolationMode x ) ; +FUNCTION: GpStatus GdipSetPageScale ( GpGraphics* x, REAL x ) ; +FUNCTION: GpStatus GdipSetPageUnit ( GpGraphics* x, GpUnit x ) ; +FUNCTION: GpStatus GdipSetPixelOffsetMode ( GpGraphics* x, PixelOffsetMode x ) ; +FUNCTION: GpStatus GdipSetRenderingOrigin ( GpGraphics* x, INT x, INT x ) ; +FUNCTION: GpStatus GdipSetSmoothingMode ( GpGraphics* x, SmoothingMode x ) ; +FUNCTION: GpStatus GdipSetTextContrast ( GpGraphics* x, UINT x ) ; +FUNCTION: GpStatus GdipSetTextRenderingHint ( GpGraphics* x, TextRenderingHint x ) ; +FUNCTION: GpStatus GdipSetWorldTransform ( GpGraphics* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipTransformPoints ( GpGraphics* x, GpCoordinateSpace x, GpCoordinateSpace x, + GpPointF * x, INT x ) ; +FUNCTION: GpStatus GdipTransformPointsI ( GpGraphics* x, GpCoordinateSpace x, GpCoordinateSpace x, + GpPoint * x, INT x ) ; +FUNCTION: GpStatus GdipTranslateClip ( GpGraphics* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipTranslateClipI ( GpGraphics* x, INT x, INT x ) ; +FUNCTION: GpStatus GdipTranslateWorldTransform ( GpGraphics* x, REAL x, REAL x, GpMatrixOrder x ) ; + + +FUNCTION: GpStatus GdipAddPathArc ( GpPath* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathArcI ( GpPath* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathBezier ( GpPath* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathBezierI ( GpPath* x, INT x, INT x, INT x, INT x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipAddPathBeziers ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathBeziersI ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathClosedCurve ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathClosedCurveI ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathClosedCurve2 ( GpPath* x, GpPointF* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathClosedCurve2I ( GpPath* x, GpPoint* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathCurve ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathCurveI ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathCurve2 ( GpPath* x, GpPointF* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathCurve2I ( GpPath* x, GpPoint* x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathCurve3 ( GpPath* x, GpPointF* x, INT x, INT x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathCurve3I ( GpPath* x, GpPoint* x, INT x, INT x, INT x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathEllipse ( GpPath* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathEllipseI ( GpPath* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipAddPathLine ( GpPath* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathLineI ( GpPath* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipAddPathLine2 ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathLine2I ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathPath ( GpPath* x, GpPath* x, BOOL x ) ; +FUNCTION: GpStatus GdipAddPathPie ( GpPath* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathPieI ( GpPath* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathPolygon ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathPolygonI ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathRectangle ( GpPath* x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipAddPathRectangleI ( GpPath* x, INT x, INT x, INT x, INT x ) ; +FUNCTION: GpStatus GdipAddPathRectangles ( GpPath* x, GpRectF* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathRectanglesI ( GpPath* x, GpRect* x, INT x ) ; +FUNCTION: GpStatus GdipAddPathString ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, RectF* x, GpStringFormat* x ) ; +FUNCTION: GpStatus GdipAddPathStringI ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, Rect* x, GpStringFormat* x ) ; +FUNCTION: GpStatus GdipClearPathMarkers ( GpPath* x ) ; +FUNCTION: GpStatus GdipClonePath ( GpPath* x, GpPath** x ) ; +FUNCTION: GpStatus GdipClosePathFigure ( GpPath* x ) ; +FUNCTION: GpStatus GdipClosePathFigures ( GpPath* x ) ; +FUNCTION: GpStatus GdipCreatePath ( GpFillMode x, GpPath** x ) ; +FUNCTION: GpStatus GdipCreatePath2 ( GpPointF* x, BYTE* x, INT x, + GpFillMode x, GpPath** x ) ; +FUNCTION: GpStatus GdipCreatePath2I ( GpPoint* x, BYTE* x, INT x, GpFillMode x, GpPath** x ) ; +FUNCTION: GpStatus GdipDeletePath ( GpPath* x ) ; +FUNCTION: GpStatus GdipFlattenPath ( GpPath* x, GpMatrix* x, REAL x ) ; +FUNCTION: GpStatus GdipIsOutlineVisiblePathPoint ( GpPath* x, REAL x, REAL x, GpPen* x, + GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsOutlineVisiblePathPointI ( GpPath* x, INT x, INT x, GpPen* x, + GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisiblePathPoint ( GpPath* x, REAL x, REAL x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisiblePathPointI ( GpPath* x, INT x, INT x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipGetPathData ( GpPath* x, GpPathData* x ) ; +FUNCTION: GpStatus GdipGetPathFillMode ( GpPath* x, GpFillMode* x ) ; +FUNCTION: GpStatus GdipGetPathLastPoint ( GpPath* x, GpPointF* x ) ; +FUNCTION: GpStatus GdipGetPathPoints ( GpPath* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipGetPathPointsI ( GpPath* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipGetPathTypes ( GpPath* x, BYTE* x, INT x ) ; +FUNCTION: GpStatus GdipGetPathWorldBounds ( GpPath* x, GpRectF* x, GpMatrix* x, GpPen* x ) ; +FUNCTION: GpStatus GdipGetPathWorldBoundsI ( GpPath* x, GpRect* x, GpMatrix* x, GpPen* x ) ; +FUNCTION: GpStatus GdipGetPointCount ( GpPath* x, INT* x ) ; +FUNCTION: GpStatus GdipResetPath ( GpPath* x ) ; +FUNCTION: GpStatus GdipReversePath ( GpPath* x ) ; +FUNCTION: GpStatus GdipSetPathFillMode ( GpPath* x, GpFillMode x ) ; +FUNCTION: GpStatus GdipSetPathMarker ( GpPath* x ) ; +FUNCTION: GpStatus GdipStartPathFigure ( GpPath* x ) ; +FUNCTION: GpStatus GdipTransformPath ( GpPath* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipWarpPath ( GpPath* x, GpMatrix* x, GpPointF* x, INT x, REAL x, + REAL x, REAL x, REAL x, WarpMode x, REAL x ) ; +FUNCTION: GpStatus GdipWidenPath ( GpPath* x, GpPen* x, GpMatrix* x, REAL x ) ; + + +FUNCTION: GpStatus GdipCreateHatchBrush ( HatchStyle x, ARGB x, ARGB x, GpHatch** x ) ; +FUNCTION: GpStatus GdipGetHatchBackgroundColor ( GpHatch* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetHatchForegroundColor ( GpHatch* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetHatchStyle ( GpHatch* x, HatchStyle* x ) ; + + +FUNCTION: GpStatus GdipCloneImage ( GpImage* x, GpImage** x ) ; +FUNCTION: GpStatus GdipCloneImageAttributes ( GpImageAttributes* x, GpImageAttributes** x ) ; +FUNCTION: GpStatus GdipDisposeImage ( GpImage* x ) ; +FUNCTION: GpStatus GdipEmfToWmfBits ( HENHMETAFILE x, UINT x, LPBYTE x, INT x, INT x ) ; +FUNCTION: GpStatus GdipFindFirstImageItem ( GpImage* x, ImageItemData* x ) ; +FUNCTION: GpStatus GdipFindNextImageItem ( GpImage* x, ImageItemData* x ) ; +FUNCTION: GpStatus GdipGetAllPropertyItems ( GpImage* x, UINT x, UINT x, PropertyItem* x ) ; +FUNCTION: GpStatus GdipGetImageBounds ( GpImage* x, GpRectF* x, GpUnit* x ) ; +FUNCTION: GpStatus GdipGetImageDimension ( GpImage* x, REAL* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetImageFlags ( GpImage* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetImageHeight ( GpImage* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetImageHorizontalResolution ( GpImage* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetImageItemData ( GpImage* x, ImageItemData* x ) ; +FUNCTION: GpStatus GdipGetImagePalette ( GpImage* x, ColorPalette* x, INT x ) ; +FUNCTION: GpStatus GdipGetImagePaletteSize ( GpImage* x, INT* x ) ; +FUNCTION: GpStatus GdipGetImagePixelFormat ( GpImage* x, PixelFormat* x ) ; +FUNCTION: GpStatus GdipGetImageRawFormat ( GpImage* x, GUID* x ) ; +FUNCTION: GpStatus GdipGetImageThumbnail ( GpImage* x, UINT x, UINT x, GpImage** x, GetThumbnailImageAbort x, VOID* x ) ; +FUNCTION: GpStatus GdipGetImageType ( GpImage* x, ImageType* x ) ; +FUNCTION: GpStatus GdipGetImageVerticalResolution ( GpImage* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetImageWidth ( GpImage* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetPropertyCount ( GpImage* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetPropertyIdList ( GpImage* x, UINT x, PROPID* x ) ; +FUNCTION: GpStatus GdipGetPropertyItem ( GpImage* x, PROPID x, UINT x, PropertyItem* x ) ; +FUNCTION: GpStatus GdipGetPropertyItemSize ( GpImage* x, PROPID x, UINT* x ) ; +FUNCTION: GpStatus GdipGetPropertySize ( GpImage* x, UINT* x, UINT* x ) ; +FUNCTION: GpStatus GdipImageForceValidation ( GpImage* x ) ; +FUNCTION: GpStatus GdipImageGetFrameCount ( GpImage* x, GUID* x, UINT* x ) ; +FUNCTION: GpStatus GdipImageGetFrameDimensionsCount ( GpImage* x, UINT* x ) ; +FUNCTION: GpStatus GdipImageGetFrameDimensionsList ( GpImage* x, GUID* x, UINT x ) ; +FUNCTION: GpStatus GdipImageRotateFlip ( GpImage* x, RotateFlipType x ) ; +FUNCTION: GpStatus GdipImageSelectActiveFrame ( GpImage* x, GUID* x, UINT x ) ; +FUNCTION: GpStatus GdipLoadImageFromFile ( WCHAR* x, GpImage** x ) ; +FUNCTION: GpStatus GdipLoadImageFromFileICM ( WCHAR* x, GpImage** x ) ; +FUNCTION: GpStatus GdipLoadImageFromStream ( IStream* x, GpImage** x ) ; +FUNCTION: GpStatus GdipLoadImageFromStreamICM ( IStream* x, GpImage** x ) ; +FUNCTION: GpStatus GdipRemovePropertyItem ( GpImage* x, PROPID x ) ; +FUNCTION: GpStatus GdipSaveImageToFile ( GpImage* x, WCHAR* x, CLSID* x, EncoderParameters* x ) ; +FUNCTION: GpStatus GdipSaveImageToStream ( GpImage* x, IStream* x, + CLSID* x, EncoderParameters* x ) ; +FUNCTION: GpStatus GdipSetImagePalette ( GpImage* x, ColorPalette* x ) ; +FUNCTION: GpStatus GdipSetPropertyItem ( GpImage* x, PropertyItem* x ) ; + + +FUNCTION: GpStatus GdipCreateImageAttributes ( GpImageAttributes** x ) ; +FUNCTION: GpStatus GdipDisposeImageAttributes ( GpImageAttributes* x ) ; +FUNCTION: GpStatus GdipSetImageAttributesCachedBackground ( GpImageAttributes* x, + BOOL x ) ; +FUNCTION: GpStatus GdipSetImageAttributesColorKeys ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, ARGB x, ARGB x ) ; +FUNCTION: GpStatus GdipSetImageAttributesColorMatrix ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, ColorMatrix* x, ColorMatrix* x, + ColorMatrixFlags x ) ; +FUNCTION: GpStatus GdipSetImageAttributesGamma ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, REAL x ) ; +FUNCTION: GpStatus GdipSetImageAttributesNoOp ( GpImageAttributes* x, + ColorAdjustType x, BOOL x ) ; +FUNCTION: GpStatus GdipSetImageAttributesOutputChannel ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, ColorChannelFlags x ) ; +FUNCTION: GpStatus GdipSetImageAttributesOutputChannelColorProfile ( + GpImageAttributes* x, ColorAdjustType x, BOOL x, WCHAR* x ) ; +FUNCTION: GpStatus GdipSetImageAttributesRemapTable ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, UINT x, ColorMap* x ) ; +FUNCTION: GpStatus GdipSetImageAttributesThreshold ( GpImageAttributes* x, + ColorAdjustType x, BOOL x, REAL x ) ; +FUNCTION: GpStatus GdipSetImageAttributesToIdentity ( GpImageAttributes* x, + ColorAdjustType x ) ; +FUNCTION: GpStatus GdipSetImageAttributesWrapMode ( GpImageAttributes* x, WrapMode x, + ARGB x, BOOL x ) ; + + +FUNCTION: GpStatus GdipCreateLineBrush ( GpPointF* x, GpPointF* x, + ARGB x, ARGB x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipCreateLineBrushI ( GpPoint* x, GpPoint* x, + ARGB x, ARGB x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipCreateLineBrushFromRect ( GpRectF* x, ARGB x, ARGB x, + LinearGradientMode x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipCreateLineBrushFromRectI ( GpRect* x, ARGB x, ARGB x, + LinearGradientMode x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipCreateLineBrushFromRectWithAngle ( GpRectF* x, + ARGB x, ARGB x, REAL x, BOOL x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipCreateLineBrushFromRectWithAngleI ( GpRect* x, + ARGB x, ARGB x, REAL x, BOOL x, GpWrapMode x, GpLineGradient** x ) ; +FUNCTION: GpStatus GdipGetLineColors ( GpLineGradient* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetLineGammaCorrection ( GpLineGradient* x, BOOL* x ) ; +FUNCTION: GpStatus GdipGetLineRect ( GpLineGradient* x, GpRectF* x ) ; +FUNCTION: GpStatus GdipGetLineRectI ( GpLineGradient* x, GpRect* x ) ; +FUNCTION: GpStatus GdipGetLineWrapMode ( GpLineGradient* x, GpWrapMode* x ) ; +FUNCTION: GpStatus GdipSetLineBlend ( GpLineGradient* x, REAL* x, + REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetLineBlend ( GpLineGradient* x, REAL* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetLineBlendCount ( GpLineGradient* x, INT* x ) ; +FUNCTION: GpStatus GdipSetLinePresetBlend ( GpLineGradient* x, ARGB* x, + REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetLinePresetBlend ( GpLineGradient* x, ARGB* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetLinePresetBlendCount ( GpLineGradient* x, INT* x ) ; +FUNCTION: GpStatus GdipResetLineTransform ( GpLineGradient* x ) ; +FUNCTION: GpStatus GdipRotateLineTransform ( GpLineGradient* x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipScaleLineTransform ( GpLineGradient* x, REAL x, REAL x, + GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSetLineColors ( GpLineGradient* x, ARGB x, ARGB x ) ; +FUNCTION: GpStatus GdipSetLineGammaCorrection ( GpLineGradient* x, BOOL x ) ; +FUNCTION: GpStatus GdipSetLineSigmaBlend ( GpLineGradient* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipSetLineTransform ( GpLineGradient* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipSetLineLinearBlend ( GpLineGradient* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipSetLineWrapMode ( GpLineGradient* x, GpWrapMode x ) ; +FUNCTION: GpStatus GdipTranslateLineTransform ( GpLineGradient* x, REAL x, REAL x, + GpMatrixOrder x ) ; + + +FUNCTION: GpStatus GdipCloneMatrix ( GpMatrix* x, GpMatrix** x ) ; +FUNCTION: GpStatus GdipCreateMatrix ( GpMatrix** x ) ; +FUNCTION: GpStatus GdipCreateMatrix2 ( REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, GpMatrix** x ) ; +FUNCTION: GpStatus GdipCreateMatrix3 ( GpRectF * x, GpPointF* x, GpMatrix** x ) ; +FUNCTION: GpStatus GdipCreateMatrix3I ( GpRect* x, GpPoint* x, GpMatrix** x ) ; +FUNCTION: GpStatus GdipDeleteMatrix ( GpMatrix* x ) ; +FUNCTION: GpStatus GdipGetMatrixElements ( GpMatrix* x, REAL* x ) ; +FUNCTION: GpStatus GdipInvertMatrix ( GpMatrix* x ) ; +FUNCTION: GpStatus GdipIsMatrixEqual ( GpMatrix* x, GpMatrix* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsMatrixIdentity ( GpMatrix* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsMatrixInvertible ( GpMatrix* x, BOOL* x ) ; +FUNCTION: GpStatus GdipMultiplyMatrix ( GpMatrix* x, GpMatrix* x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipRotateMatrix ( GpMatrix* x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipShearMatrix ( GpMatrix* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipScaleMatrix ( GpMatrix* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSetMatrixElements ( GpMatrix* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipTransformMatrixPoints ( GpMatrix* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipTransformMatrixPointsI ( GpMatrix* x, GpPoint* x, INT x ) ; +FUNCTION: GpStatus GdipTranslateMatrix ( GpMatrix* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipVectorTransformMatrixPoints ( GpMatrix* x, GpPointF* x, INT x ) ; +FUNCTION: GpStatus GdipVectorTransformMatrixPointsI ( GpMatrix* x, GpPoint* x, INT x ) ; + + +FUNCTION: GpStatus GdipConvertToEmfPlus ( const GpGraphics* x, GpMetafile* x, INT* x, + EmfType x, const WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipConvertToEmfPlusToFile ( const GpGraphics* x, GpMetafile* x, INT* x, const WCHAR* x, EmfType x, const WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipConvertToEmfPlusToStream ( const GpGraphics* x, GpMetafile* x, INT* x, IStream* x, EmfType x, const WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipCreateMetafileFromEmf ( HENHMETAFILE x, BOOL x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipCreateMetafileFromWmf ( HMETAFILE x, BOOL x, + WmfPlaceableFileHeader* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipCreateMetafileFromWmfFile ( WCHAR* x, WmfPlaceableFileHeader* x, + GpMetafile** x ) ; +FUNCTION: GpStatus GdipCreateMetafileFromFile ( WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipCreateMetafileFromStream ( IStream* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipSetMetafileDownLevelRasterizationLimit ( GpMetafile* x, UINT x ) ; + + +FUNCTION: GpStatus GdipGetMetafileHeaderFromEmf ( HENHMETAFILE x, MetafileHeader* x ) ; +FUNCTION: GpStatus GdipGetMetafileHeaderFromFile ( WCHAR* x, MetafileHeader* x ) ; +FUNCTION: GpStatus GdipGetMetafileHeaderFromMetafile ( GpMetafile* x, MetafileHeader* x ) ; +FUNCTION: GpStatus GdipGetMetafileHeaderFromStream ( IStream* x, MetafileHeader* x ) ; +FUNCTION: GpStatus GdipGetMetafileHeaderFromWmf ( HMETAFILE x, WmfPlaceableFileHeader* x, MetafileHeader* x ) ; + + +FUNCTION: GpStatus WINAPI GdiplusNotificationHook ( ULONG_PTR* x ) ; +FUNCTION: void WINAPI GdiplusNotificationUnhook ( ULONG_PTR x ) ; + + +FUNCTION: GpStatus GdipCreatePathGradient ( GpPointF* x, INT x, GpWrapMode x, GpPathGradient** x ) ; +FUNCTION: GpStatus GdipCreatePathGradientI ( GpPoint* x, INT x, GpWrapMode x, GpPathGradient** x ) ; +FUNCTION: GpStatus GdipCreatePathGradientFromPath ( GpPath* x, + GpPathGradient** x ) ; +FUNCTION: GpStatus GdipGetPathGradientBlend ( GpPathGradient* x, REAL* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetPathGradientBlendCount ( GpPathGradient* x, INT* x ) ; +FUNCTION: GpStatus GdipGetPathGradientCenterColor ( GpPathGradient* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetPathGradientCenterPoint ( GpPathGradient* x, GpPointF* x ) ; +FUNCTION: GpStatus GdipGetPathGradientCenterPointI ( GpPathGradient* x, GpPoint* x ) ; +FUNCTION: GpStatus GdipGetPathGradientFocusScales ( GpPathGradient* x, REAL* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetPathGradientGammaCorrection ( GpPathGradient* x, BOOL* x ) ; +FUNCTION: GpStatus GdipGetPathGradientPointCount ( GpPathGradient* x, INT* x ) ; +FUNCTION: GpStatus GdipSetPathGradientPresetBlend ( GpPathGradient* x, + ARGB* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetPathGradientRect ( GpPathGradient* x, GpRectF* x ) ; +FUNCTION: GpStatus GdipGetPathGradientRectI ( GpPathGradient* x, GpRect* x ) ; +FUNCTION: GpStatus GdipGetPathGradientSurroundColorsWithCount ( GpPathGradient* x, + ARGB* x, INT* x ) ; +FUNCTION: GpStatus GdipGetPathGradientWrapMode ( GpPathGradient* x, GpWrapMode* x ) ; +FUNCTION: GpStatus GdipSetPathGradientBlend ( GpPathGradient* x, REAL* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipSetPathGradientCenterColor ( GpPathGradient* x, ARGB x ) ; +FUNCTION: GpStatus GdipSetPathGradientCenterPoint ( GpPathGradient* x, GpPointF* x ) ; +FUNCTION: GpStatus GdipSetPathGradientCenterPointI ( GpPathGradient* x, GpPoint* x ) ; +FUNCTION: GpStatus GdipSetPathGradientFocusScales ( GpPathGradient* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipSetPathGradientGammaCorrection ( GpPathGradient* x, BOOL x ) ; +FUNCTION: GpStatus GdipSetPathGradientSigmaBlend ( GpPathGradient* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipSetPathGradientSurroundColorsWithCount ( GpPathGradient* x, + ARGB* x, INT* x ) ; +FUNCTION: GpStatus GdipSetPathGradientWrapMode ( GpPathGradient* x, GpWrapMode x ) ; +FUNCTION: GpStatus GdipGetPathGradientSurroundColorCount ( GpPathGradient* x, INT* x ) ; + + +FUNCTION: GpStatus GdipCreatePathIter ( GpPathIterator** x, GpPath* x ) ; +FUNCTION: GpStatus GdipDeletePathIter ( GpPathIterator* x ) ; +FUNCTION: GpStatus GdipPathIterCopyData ( GpPathIterator* x, INT* x, GpPointF* x, BYTE* x, + INT x, INT x ) ; +FUNCTION: GpStatus GdipPathIterGetCount ( GpPathIterator* x, INT* x ) ; +FUNCTION: GpStatus GdipPathIterGetSubpathCount ( GpPathIterator* x, INT* x ) ; +FUNCTION: GpStatus GdipPathIterEnumerate ( GpPathIterator* x, INT* x, GpPointF* x, BYTE* x, INT x ) ; +FUNCTION: GpStatus GdipPathIterHasCurve ( GpPathIterator* x, BOOL* x ) ; +FUNCTION: GpStatus GdipPathIterIsValid ( GpPathIterator* x, BOOL* x ) ; +FUNCTION: GpStatus GdipPathIterNextMarker ( GpPathIterator* x, INT* x, INT* x, INT* x ) ; +FUNCTION: GpStatus GdipPathIterNextMarkerPath ( GpPathIterator* x, INT* x, GpPath* x ) ; +FUNCTION: GpStatus GdipPathIterNextPathType ( GpPathIterator* x, INT* x, BYTE* x, INT* x, INT* x ) ; +FUNCTION: GpStatus GdipPathIterNextSubpath ( GpPathIterator* x, INT* x, INT* x, INT* x, BOOL* x ) ; +FUNCTION: GpStatus GdipPathIterNextSubpathPath ( GpPathIterator* x, INT* x, GpPath* x, BOOL* x ) ; +FUNCTION: GpStatus GdipPathIterRewind ( GpPathIterator* x ) ; + + +FUNCTION: GpStatus GdipClonePen ( GpPen* x, GpPen** x ) ; +FUNCTION: GpStatus GdipCreatePen1 ( ARGB x, REAL x, GpUnit x, GpPen** x ) ; +FUNCTION: GpStatus GdipCreatePen2 ( GpBrush* x, REAL x, GpUnit x, GpPen** x ) ; +FUNCTION: GpStatus GdipDeletePen ( GpPen* x ) ; +FUNCTION: GpStatus GdipGetPenBrushFill ( GpPen* x, GpBrush** x ) ; +FUNCTION: GpStatus GdipGetPenColor ( GpPen* x, ARGB* x ) ; +FUNCTION: GpStatus GdipGetPenCustomStartCap ( GpPen* x, GpCustomLineCap** x ) ; +FUNCTION: GpStatus GdipGetPenCustomEndCap ( GpPen* x, GpCustomLineCap** x ) ; +FUNCTION: GpStatus GdipGetPenDashArray ( GpPen* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipGetPenDashCount ( GpPen* x, INT* x ) ; +FUNCTION: GpStatus GdipGetPenDashOffset ( GpPen* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetPenDashStyle ( GpPen* x, GpDashStyle* x ) ; +FUNCTION: GpStatus GdipGetPenMode ( GpPen* x, GpPenAlignment* x ) ; +FUNCTION: GpStatus GdipResetPenTransform ( GpPen* x ) ; +FUNCTION: GpStatus GdipScalePenTransform ( GpPen* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSetPenBrushFill ( GpPen* x, GpBrush* x ) ; +FUNCTION: GpStatus GdipSetPenColor ( GpPen* x, ARGB x ) ; +FUNCTION: GpStatus GdipSetPenCompoundArray ( GpPen* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipSetPenCustomEndCap ( GpPen* x, GpCustomLineCap* x ) ; +FUNCTION: GpStatus GdipSetPenCustomStartCap ( GpPen* x, GpCustomLineCap* x ) ; +FUNCTION: GpStatus GdipSetPenDashArray ( GpPen* x, REAL* x, INT x ) ; +FUNCTION: GpStatus GdipSetPenDashCap197819 ( GpPen* x, GpDashCap x ) ; +FUNCTION: GpStatus GdipSetPenDashOffset ( GpPen* x, REAL x ) ; +FUNCTION: GpStatus GdipSetPenDashStyle ( GpPen* x, GpDashStyle x ) ; +FUNCTION: GpStatus GdipSetPenEndCap ( GpPen* x, GpLineCap x ) ; +FUNCTION: GpStatus GdipGetPenFillType ( GpPen* x, GpPenType* x ) ; +FUNCTION: GpStatus GdipSetPenLineCap197819 ( GpPen* x, GpLineCap x, GpLineCap x, GpDashCap x ) ; +FUNCTION: GpStatus GdipSetPenLineJoin ( GpPen* x, GpLineJoin x ) ; +FUNCTION: GpStatus GdipSetPenMode ( GpPen* x, GpPenAlignment x ) ; +FUNCTION: GpStatus GdipSetPenMiterLimit ( GpPen* x, REAL x ) ; +FUNCTION: GpStatus GdipSetPenStartCap ( GpPen* x, GpLineCap x ) ; +FUNCTION: GpStatus GdipSetPenWidth ( GpPen* x, REAL x ) ; +FUNCTION: GpStatus GdipGetPenDashCap197819 ( GpPen* x, GpDashCap* x ) ; +FUNCTION: GpStatus GdipGetPenEndCap ( GpPen* x, GpLineCap* x ) ; +FUNCTION: GpStatus GdipGetPenLineJoin ( GpPen* x, GpLineJoin* x ) ; +FUNCTION: GpStatus GdipGetPenMiterLimit ( GpPen* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetPenStartCap ( GpPen* x, GpLineCap* x ) ; +FUNCTION: GpStatus GdipGetPenUnit ( GpPen* x, GpUnit* x ) ; +FUNCTION: GpStatus GdipGetPenWidth ( GpPen* x, REAL* x ) ; + + +FUNCTION: GpStatus GdipCloneRegion ( GpRegion * x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipCombineRegionPath ( GpRegion * x, GpPath * x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRect ( GpRegion * x, GpRectF * x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRectI ( GpRegion * x, GpRect * x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRegion ( GpRegion * x, GpRegion * x, CombineMode x ) ; +FUNCTION: GpStatus GdipCreateRegion ( GpRegion ** x ) ; +FUNCTION: GpStatus GdipCreateRegionPath ( GpPath * x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipCreateRegionRect ( GpRectF * x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipCreateRegionRectI ( GpRect * x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipCreateRegionRgnData ( BYTE * x, INT x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipCreateRegionHrgn ( HRGN x, GpRegion ** x ) ; +FUNCTION: GpStatus GdipDeleteRegion ( GpRegion * x ) ; +FUNCTION: GpStatus GdipGetRegionBounds ( GpRegion * x, GpGraphics * x, GpRectF * x ) ; +FUNCTION: GpStatus GdipGetRegionBoundsI ( GpRegion * x, GpGraphics * x, GpRect * x ) ; +FUNCTION: GpStatus GdipGetRegionData ( GpRegion * x, BYTE * x, UINT x, UINT * x ) ; +FUNCTION: GpStatus GdipGetRegionDataSize ( GpRegion * x, UINT * x ) ; +FUNCTION: GpStatus GdipGetRegionHRgn ( GpRegion * x, GpGraphics * x, HRGN * x ) ; +FUNCTION: GpStatus GdipIsEmptyRegion ( GpRegion * x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsEqualRegion ( GpRegion * x, GpRegion * x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsInfiniteRegion ( GpRegion * x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionPoint ( GpRegion * x, REAL x, REAL x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionPointI ( GpRegion * x, INT x, INT x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionRect ( GpRegion * x, REAL x, REAL x, REAL x, REAL x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionRectI ( GpRegion * x, INT x, INT x, INT x, INT x, GpGraphics * x, BOOL * x ) ; +FUNCTION: GpStatus GdipSetEmpty ( GpRegion * x ) ; +FUNCTION: GpStatus GdipSetInfinite ( GpRegion * x ) ; +FUNCTION: GpStatus GdipTransformRegion ( GpRegion * x, GpMatrix * x ) ; +FUNCTION: GpStatus GdipTranslateRegion ( GpRegion * x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipTranslateRegionI ( GpRegion * x, INT x, INT x ) ; + + +FUNCTION: GpStatus GdipCreateSolidFill ( ARGB x, GpSolidFill** x ) ; +FUNCTION: GpStatus GdipGetSolidFillColor ( GpSolidFill* x, ARGB* x ) ; +FUNCTION: GpStatus GdipSetSolidFillColor ( GpSolidFill* x, ARGB x ) ; + + +FUNCTION: GpStatus GdipCloneStringFormat ( GpStringFormat* x, GpStringFormat** x ) ; +FUNCTION: GpStatus GdipCreateStringFormat ( INT x, LANGID x, GpStringFormat** x ) ; +FUNCTION: GpStatus GdipDeleteStringFormat ( GpStringFormat* x ) ; +FUNCTION: GpStatus GdipGetStringFormatAlign ( GpStringFormat* x, StringAlignment* x ) ; +FUNCTION: GpStatus GdipGetStringFormatDigitSubstitution ( GpStringFormat* x, LANGID* x, + StringDigitSubstitute* x ) ; +FUNCTION: GpStatus GdipGetStringFormatFlags ( GpStringFormat* x, INT* x ) ; +FUNCTION: GpStatus GdipGetStringFormatHotkeyPrefix ( GpStringFormat* x, INT* x ) ; +FUNCTION: GpStatus GdipGetStringFormatLineAlign ( GpStringFormat* x, StringAlignment* x ) ; +FUNCTION: GpStatus GdipGetStringFormatMeasurableCharacterRangeCount ( + GpStringFormat* x, INT* x ) ; +FUNCTION: GpStatus GdipGetStringFormatTabStopCount ( GpStringFormat* x, INT* x ) ; +FUNCTION: GpStatus GdipGetStringFormatTabStops ( GpStringFormat* x, INT x, REAL* x, REAL* x ) ; +FUNCTION: GpStatus GdipGetStringFormatTrimming ( GpStringFormat* x, StringTrimming* x ) ; +FUNCTION: GpStatus GdipSetStringFormatAlign ( GpStringFormat* x, StringAlignment x ) ; +FUNCTION: GpStatus GdipSetStringFormatDigitSubstitution ( GpStringFormat* x, LANGID x, StringDigitSubstitute x ) ; +FUNCTION: GpStatus GdipSetStringFormatHotkeyPrefix ( GpStringFormat* x, INT x ) ; +FUNCTION: GpStatus GdipSetStringFormatLineAlign ( GpStringFormat* x, StringAlignment x ) ; +FUNCTION: GpStatus GdipSetStringFormatMeasurableCharacterRanges ( + GpStringFormat* x, INT x, CharacterRange* x ) ; +FUNCTION: GpStatus GdipSetStringFormatTabStops ( GpStringFormat* x, REAL x, INT x, REAL* x ) ; +FUNCTION: GpStatus GdipSetStringFormatTrimming ( GpStringFormat* x, StringTrimming x ) ; +FUNCTION: GpStatus GdipSetStringFormatFlags ( GpStringFormat* x, INT x ) ; +FUNCTION: GpStatus GdipStringFormatGetGenericDefault ( GpStringFormat ** x ) ; +FUNCTION: GpStatus GdipStringFormatGetGenericTypographic ( GpStringFormat ** x ) ; + + +FUNCTION: GpStatus GdipCreateTexture ( GpImage* x, GpWrapMode x, GpTexture** x ) ; +FUNCTION: GpStatus GdipCreateTexture2 ( GpImage* x, GpWrapMode x, REAL x, REAL x, REAL x, REAL x, GpTexture** x ) ; +FUNCTION: GpStatus GdipCreateTexture2I ( GpImage* x, GpWrapMode x, INT x, INT x, INT x, INT x, GpTexture** x ) ; +FUNCTION: GpStatus GdipCreateTextureIA ( GpImage* x, GpImageAttributes* x, + REAL x, REAL x, REAL x, REAL x, GpTexture** x ) ; +FUNCTION: GpStatus GdipCreateTextureIAI ( GpImage* x, GpImageAttributes* x, + INT x, INT x, INT x, INT x, GpTexture** x ) ; +FUNCTION: GpStatus GdipGetTextureTransform ( GpTexture* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipGetTextureWrapMode ( GpTexture* x, GpWrapMode* x ) ; +FUNCTION: GpStatus GdipMultiplyTextureTransform ( GpTexture* x, + GpMatrix* x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipResetTextureTransform ( GpTexture* x ) ; +FUNCTION: GpStatus GdipRotateTextureTransform ( GpTexture* x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipScaleTextureTransform ( GpTexture* x, REAL x, REAL x, GpMatrixOrder x ) ; +FUNCTION: GpStatus GdipSetTextureTransform ( GpTexture * x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipSetTextureWrapMode ( GpTexture* x, GpWrapMode x ) ; +FUNCTION: GpStatus GdipTranslateTextureTransform ( GpTexture* x, REAL x, REAL x, + GpMatrixOrder x ) ; + + +FUNCTION: GpStatus GdipCreateStreamOnFile ( WCHAR* x, UINT x, IStream** x ) ; +FUNCTION: GpStatus GdipGetImageEncodersSize ( UINT *numEncoders x, UINT *size x ) ; +FUNCTION: GpStatus GdipGetImageEncoders ( UINT numEncoders x, UINT size x, ImageCodecInfo *encoders x ) ; +FUNCTION: GpStatus GdipTestControl ( GpTestControlEnum x, void* x ) ; diff --git a/basis/windows/gdiplus/platforms.txt b/basis/windows/gdiplus/platforms.txt new file mode 100644 index 0000000000..8e1a55995e --- /dev/null +++ b/basis/windows/gdiplus/platforms.txt @@ -0,0 +1 @@ +windows diff --git a/basis/windows/nt/nt.factor b/basis/windows/nt/nt.factor index 4b119ba5fa..7a875b295b 100644 --- a/basis/windows/nt/nt.factor +++ b/basis/windows/nt/nt.factor @@ -12,6 +12,7 @@ USING: alien sequences alien.libraries ; { "libm" "msvcrt.dll" cdecl } { "gl" "opengl32.dll" stdcall } { "glu" "glu32.dll" stdcall } + { "gdiplus" "gdiplus.dll" stdcall } { "ole32" "ole32.dll" stdcall } { "usp10" "usp10.dll" stdcall } { "psapi" "psapi.dll" stdcall } From 0cb3eff34b1d03344d2894fdf34d6f99e21bf5f5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 15:56:44 -0700 Subject: [PATCH 07/41] alien.enums: allow enum members to be given values based on other enum symbols' values --- basis/alien/enums/enums-tests.factor | 4 ++++ basis/alien/enums/enums.factor | 9 +++------ basis/alien/parser/parser.factor | 8 ++++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/basis/alien/enums/enums-tests.factor b/basis/alien/enums/enums-tests.factor index f0c665830d..52337594a1 100644 --- a/basis/alien/enums/enums-tests.factor +++ b/basis/alien/enums/enums-tests.factor @@ -33,3 +33,7 @@ ENUM: instrument_t < ushort trombone trumpet ; { V{ { red 0 } { green 3 } { blue 4 } } } [ color_t "c-type" word-prop members>> ] unit-test + +ENUM: colores { rojo red } { verde green } { azul blue } { colorado rojo } ; + +[ { 0 3 4 0 } ] [ { rojo verde azul colorado } [ enum>number ] map ] unit-test diff --git a/basis/alien/enums/enums.factor b/basis/alien/enums/enums.factor index 18000105e7..4ac7c24cb5 100644 --- a/basis/alien/enums/enums.factor +++ b/basis/alien/enums/enums.factor @@ -12,7 +12,7 @@ PRIVATE> GENERIC: enum>number ( enum -- number ) foldable M: integer enum>number ; -M: symbol enum>number "enum-value" word-prop ; +M: word enum>number "enum-value" word-prop ; number "enum-value" set-word-prop ; : define-enum-members ( member-names -- ) - [ - [ first define-symbol ] - [ first2 define-enum-value ] bi - ] each ; + [ first define-symbol ] each ; : define-enum-constructor ( word -- ) [ name>> "<" ">" surround create-in ] keep diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index 332683a0ac..baca25e078 100755 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -4,7 +4,7 @@ USING: accessors alien alien.c-types alien.libraries arrays assocs classes combinators combinators.short-circuit compiler.units effects grouping kernel parser sequences splitting words fry locals lexer namespaces summary math -vocabs.parser words.constant ; +vocabs.parser words.constant alien.enums ; IN: alien.parser SYMBOL: current-library @@ -75,8 +75,12 @@ M: pointer return-type-name to>> return-type-name CHAR: * suffix ; "*" ?head [ [ ] dip parse-pointers ] when ; +: define-enum-value ( class value -- ) + enum>number "enum-value" set-word-prop ; + : next-enum-member ( members name value -- members value' ) - [ 2array suffix! ] [ 1 + ] bi ; + [ define-enum-value ] + [ [ 2array suffix! ] [ enum>number 1 + ] bi ] 2bi ; : parse-enum-name ( -- name ) scan (CREATE-C-TYPE) dup save-location ; From e140cf09f49dcfb3147ae5a7378ecb94ce5f4208 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 16:30:45 -0700 Subject: [PATCH 08/41] windows.gdiplus: clean up so it loads --- basis/windows/com/com.factor | 4 + basis/windows/gdiplus/gdiplus.factor | 159 +++++++++++++++------------ basis/windows/ole32/ole32.factor | 3 + basis/windows/types/types.factor | 6 +- 4 files changed, 99 insertions(+), 73 deletions(-) diff --git a/basis/windows/com/com.factor b/basis/windows/com/com.factor index 094859009d..bdc055f787 100644 --- a/basis/windows/com/com.factor +++ b/basis/windows/com/com.factor @@ -51,3 +51,7 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ; over [ com-release ] curry [ ] cleanup ; inline DESTRUCTOR: com-release + +! XXX interfaces used by other libraries that should be fleshed out +C-TYPE: IStream + diff --git a/basis/windows/gdiplus/gdiplus.factor b/basis/windows/gdiplus/gdiplus.factor index 0199fe685e..9e8bb692ab 100644 --- a/basis/windows/gdiplus/gdiplus.factor +++ b/basis/windows/gdiplus/gdiplus.factor @@ -1,5 +1,7 @@ ! (c)2010 Joe Groff bsd license -USING: alien.c-types alien.destructors alien.syntax windows.types ; +USING: alien.c-types alien.destructors alien.syntax +classes.struct kernel math windows.com windows.com.syntax +windows.kernel32 windows.ole32 windows.types ; IN: windows.gdiplus LIBRARY: gdiplus @@ -163,7 +165,7 @@ ENUM: InterpolationMode InterpolationModeHighQualityBilinear InterpolationModeHighQualityBicubic ; -ENUM: PenAlignment +ENUM: GpPenAlignment { PenAlignmentCenter 0 } { PenAlignmentInset 1 } ; @@ -422,7 +424,7 @@ STRUCT: GdiplusStartupOutput { NotificationUnhook NotificationUnhookProc } ; FUNCTION: GpStatus GdiplusStartup ( ULONG_PTR* x, GdiplusStartupInput* in, GdiplusStartupOutput* out ) ; -FUNCTION: void GdiplusShutdown ( ULONG_PTR x ); +FUNCTION: void GdiplusShutdown ( ULONG_PTR x ) ; TYPEDEF: DWORD ARGB TYPEDEF: INT PixelFormat @@ -438,7 +440,7 @@ CONSTANT: PixelFormatAlpha HEX: 00040000 CONSTANT: PixelFormatPAlpha HEX: 00080000 CONSTANT: PixelFormatExtended HEX: 00100000 CONSTANT: PixelFormatCanonical HEX: 00200000 -CONSTANT: + CONSTANT: PixelFormatUndefined 0 CONSTANT: PixelFormatDontCare 0 CONSTANT: PixelFormatMax 15 @@ -477,6 +479,17 @@ STRUCT: ColorPalette { Count UINT } { Entries ARGB[1] } ; +! XXX RECTL and SIZEL should go with other metafile definitions if we add them +STRUCT: RECTL + { left LONG } + { top LONG } + { right LONG } + { bottom LONG } ; + +STRUCT: SIZEL + { width LONG } + { height LONG } ; + STRUCT: ENHMETAHEADER3 { iType DWORD } { nSize DWORD } @@ -578,7 +591,7 @@ ENUM: RotateFlipType { RotateNoneFlipY Rotate180FlipX } { Rotate270FlipX 7 } - { Rotate90FlipY Rotate270Flip } ; + { Rotate90FlipY Rotate270FlipX } ; STRUCT: EncoderParameter { Guid GUID } @@ -889,13 +902,13 @@ ENUM: ColorMatrixFlags { ColorMatrixFlagsAltGray 2 } ; ENUM: ColorAdjustType - { ColorAdjustTypeDefault } - { ColorAdjustTypeBitmap } - { ColorAdjustTypeBrush } - { ColorAdjustTypePen } - { ColorAdjustTypeText } - { ColorAdjustTypeCount } - { ColorAdjustTypeAny } ; + ColorAdjustTypeDefault + ColorAdjustTypeBitmap + ColorAdjustTypeBrush + ColorAdjustTypePen + ColorAdjustTypeText + ColorAdjustTypeCount + ColorAdjustTypeAny ; STRUCT: ColorMap { oldColor GpColor } @@ -926,6 +939,10 @@ C-TYPE: GpStringFormat C-TYPE: GpRegion C-TYPE: CGpEffect +! dummy out other windows types we don't care to define yet +C-TYPE: LOGFONTA +C-TYPE: LOGFONTW + FUNCTION: GpStatus GdipCreateAdjustableArrowCap ( REAL x, REAL x, BOOL x, GpAdjustableArrowCap** x ) ; FUNCTION: GpStatus GdipGetAdjustableArrowCapFillState ( GpAdjustableArrowCap* x, BOOL* x ) ; FUNCTION: GpStatus GdipGetAdjustableArrowCapHeight ( GpAdjustableArrowCap* x, REAL* x ) ; @@ -960,7 +977,7 @@ FUNCTION: GpStatus GdipCreateBitmapFromStreamICM ( IStream* x, GpBitmap** x ) ; FUNCTION: GpStatus GdipCreateHBITMAPFromBitmap ( GpBitmap* x, HBITMAP* x, ARGB x ) ; FUNCTION: GpStatus GdipCreateHICONFromBitmap ( GpBitmap* x, HICON* x ) ; FUNCTION: GpStatus GdipDeleteEffect ( CGpEffect* x ) ; -FUNCTION: GpStatus GdipSetEffectParameters ( CGpEffect* x, const VOID* x, const UINT x ) ; +FUNCTION: GpStatus GdipSetEffectParameters ( CGpEffect* x, VOID* x, UINT x ) ; FUNCTION: GpStatus GdipCloneBrush ( GpBrush* x, GpBrush** x ) ; @@ -988,11 +1005,9 @@ FUNCTION: GpStatus GdipGetCustomLineCapStrokeJoin ( GpCustomLineCap* x, GpLineJo FUNCTION: GpStatus GdipSetCustomLineCapStrokeJoin ( GpCustomLineCap* x, GpLineJoin x ) ; FUNCTION: GpStatus GdipGetCustomLineCapWidthScale ( GpCustomLineCap* x, REAL* x ) ; FUNCTION: GpStatus GdipSetCustomLineCapWidthScale ( GpCustomLineCap* x, REAL x ) ; -FUNCTION: GpStatus GdipSetCustomLineCapBaseInset ( GpCustomLineCap* x, REAL x ) ; - FUNCTION: GpStatus GdipCloneFont ( GpFont* x, GpFont** x ) ; -FUNCTION: GpStatus GdipCreateFont ( GpFontFamily* x, REAL x, INT x, Unit x, +FUNCTION: GpStatus GdipCreateFont ( GpFontFamily* x, REAL x, INT x, GpUnit x, GpFont** x ) ; FUNCTION: GpStatus GdipCreateFontFromDC ( HDC x, GpFont** x ) ; FUNCTION: GpStatus GdipCreateFontFromLogfontA ( HDC x, LOGFONTA* x, GpFont** x ) ; @@ -1001,7 +1016,7 @@ FUNCTION: GpStatus GdipDeleteFont ( GpFont* x ) ; FUNCTION: GpStatus GdipGetLogFontA ( GpFont* x, GpGraphics* x, LOGFONTA* x ) ; FUNCTION: GpStatus GdipGetLogFontW ( GpFont* x, GpGraphics* x, LOGFONTW* x ) ; FUNCTION: GpStatus GdipGetFamily ( GpFont* x, GpFontFamily** x ) ; -FUNCTION: GpStatus GdipGetFontUnit ( GpFont* x, Unit* x ) ; +FUNCTION: GpStatus GdipGetFontUnit ( GpFont* x, GpUnit* x ) ; FUNCTION: GpStatus GdipGetFontSize ( GpFont* x, REAL* x ) ; FUNCTION: GpStatus GdipGetFontStyle ( GpFont* x, INT* x ) ; FUNCTION: GpStatus GdipGetFontHeight ( GpFont* x, GpGraphics* x, @@ -1017,7 +1032,7 @@ FUNCTION: GpStatus GdipPrivateAddMemoryFont ( GpFontCollection* x, void* x, INT x ) ; FUNCTION: GpStatus GdipGetFontCollectionFamilyCount ( GpFontCollection* x, INT* x ) ; FUNCTION: GpStatus GdipGetFontCollectionFamilyList ( GpFontCollection* x, INT x, - GpFontFamily*[] x, INT* x ) ; + GpFontFamily** x, INT* x ) ; FUNCTION: GpStatus GdipCloneFontFamily ( GpFontFamily* x, GpFontFamily** x ) ; @@ -1032,7 +1047,7 @@ FUNCTION: GpStatus GdipGetGenericFontFamilySansSerif ( GpFontFamily** x ) ; FUNCTION: GpStatus GdipGetGenericFontFamilySerif ( GpFontFamily** x ) ; FUNCTION: GpStatus GdipGetGenericFontFamilyMonospace ( GpFontFamily** x ) ; FUNCTION: GpStatus GdipGetLineSpacing ( GpFontFamily* x, INT x, UINT16* x ) ; -FUNCTION: GpStatus GdipIsStyleAvailable ( GpFontFamily * x, INT x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsStyleAvailable ( GpFontFamily* x, INT x, BOOL* x ) ; FUNCTION: GpStatus GdipFlush ( GpGraphics* x, GpFlushIntention x ) ; @@ -1045,8 +1060,8 @@ FUNCTION: GpStatus GdipCreateFromHDC ( HDC x, GpGraphics** x ) ; FUNCTION: GpStatus GdipCreateFromHDC2 ( HDC x, HANDLE x, GpGraphics** x ) ; FUNCTION: GpStatus GdipCreateFromHWND ( HWND x, GpGraphics** x ) ; FUNCTION: GpStatus GdipCreateFromHWNDICM ( HWND x, GpGraphics** x ) ; -FUNCTION: HPALETTE GdipCreateHalftonePalette ( void x ) ; -FUNCTION: GpStatus GdipDeleteGraphics ( GpGraphics * x ) ; +FUNCTION: HPALETTE GdipCreateHalftonePalette ( ) ; +FUNCTION: GpStatus GdipDeleteGraphics ( GpGraphics* x ) ; FUNCTION: GpStatus GdipDrawArc ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; FUNCTION: GpStatus GdipDrawArcI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x, REAL x, REAL x ) ; FUNCTION: GpStatus GdipDrawBezier ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, REAL x ) ; @@ -1064,7 +1079,7 @@ FUNCTION: GpStatus GdipDrawCurve2I ( GpGraphics* x, GpPen* x, GpPoint* x, INT x, FUNCTION: GpStatus GdipDrawCurve3 ( GpGraphics* x, GpPen* x, GpPointF* x, INT x, INT x, INT x, REAL x ) ; FUNCTION: GpStatus GdipDrawCurve3I ( GpGraphics* x, GpPen* x, GpPoint* x, INT x, INT x, INT x, REAL x ) ; FUNCTION: GpStatus GdipDrawDriverString ( GpGraphics* x, UINT16* x, INT x, - GpFont* x, GpBrush* x, PointF* x, INT x, GpMatrix* x ) ; + GpFont* x, GpBrush* x, GpPointF* x, INT x, GpMatrix* x ) ; FUNCTION: GpStatus GdipDrawEllipse ( GpGraphics* x, GpPen* x, REAL x, REAL x, REAL x, REAL x ) ; FUNCTION: GpStatus GdipDrawEllipseI ( GpGraphics* x, GpPen* x, INT x, INT x, INT x, INT x ) ; FUNCTION: GpStatus GdipDrawImage ( GpGraphics* x, GpImage* x, REAL x, REAL x ) ; @@ -1101,7 +1116,7 @@ FUNCTION: GpStatus GdipDrawRectangleI ( GpGraphics* x, GpPen* x, INT x, INT x, I FUNCTION: GpStatus GdipDrawRectangles ( GpGraphics* x, GpPen* x, GpRectF* x, INT x ) ; FUNCTION: GpStatus GdipDrawRectanglesI ( GpGraphics* x, GpPen* x, GpRect* x, INT x ) ; FUNCTION: GpStatus GdipDrawString ( GpGraphics* x, WCHAR* x, INT x, - GpFont* x, RectF* x, GpStringFormat* x, + GpFont* x, GpRectF* x, GpStringFormat* x, GpBrush* x ) ; FUNCTION: GpStatus GdipFillClosedCurve2 ( GpGraphics* x, GpBrush* x, GpPointF* x, INT x, REAL x, GpFillMode x ) ; @@ -1152,12 +1167,12 @@ FUNCTION: GpStatus GdipIsVisiblePointI ( GpGraphics* x, INT x, INT x, BOOL* x ) FUNCTION: GpStatus GdipIsVisibleRect ( GpGraphics* x, REAL x, REAL x, REAL x, REAL x, BOOL* x ) ; FUNCTION: GpStatus GdipIsVisibleRectI ( GpGraphics* x, INT x, INT x, INT x, INT x, BOOL* x ) ; FUNCTION: GpStatus GdipMeasureCharacterRanges ( GpGraphics* x, WCHAR* x, - INT x, GpFont* x, RectF* x, GpStringFormat* x, INT x, + INT x, GpFont* x, GpRectF* x, GpStringFormat* x, INT x, GpRegion** x ) ; FUNCTION: GpStatus GdipMeasureDriverString ( GpGraphics* x, UINT16* x, INT x, - GpFont* x, PointF* x, INT x, GpMatrix* x, RectF* x ) ; + GpFont* x, GpPointF* x, INT x, GpMatrix* x, GpRectF* x ) ; FUNCTION: GpStatus GdipMeasureString ( GpGraphics* x, WCHAR* x, INT x, - GpFont* x, RectF* x, GpStringFormat* x, RectF* x, INT* x, INT* x ) ; + GpFont* x, GpRectF* x, GpStringFormat* x, GpRectF* x, INT* x, INT* x ) ; FUNCTION: GpStatus GdipMultiplyWorldTransform ( GpGraphics* x, GpMatrix* x, GpMatrixOrder x ) ; FUNCTION: GpStatus GdipRecordMetafileFileName ( WCHAR* x, HDC x, EmfType x, GpRectF* x, MetafileFrameUnit x, WCHAR* x, GpMetafile** x ) ; @@ -1190,9 +1205,9 @@ FUNCTION: GpStatus GdipSetTextContrast ( GpGraphics* x, UINT x ) ; FUNCTION: GpStatus GdipSetTextRenderingHint ( GpGraphics* x, TextRenderingHint x ) ; FUNCTION: GpStatus GdipSetWorldTransform ( GpGraphics* x, GpMatrix* x ) ; FUNCTION: GpStatus GdipTransformPoints ( GpGraphics* x, GpCoordinateSpace x, GpCoordinateSpace x, - GpPointF * x, INT x ) ; + GpPointF* x, INT x ) ; FUNCTION: GpStatus GdipTransformPointsI ( GpGraphics* x, GpCoordinateSpace x, GpCoordinateSpace x, - GpPoint * x, INT x ) ; + GpPoint* x, INT x ) ; FUNCTION: GpStatus GdipTranslateClip ( GpGraphics* x, REAL x, REAL x ) ; FUNCTION: GpStatus GdipTranslateClipI ( GpGraphics* x, INT x, INT x ) ; FUNCTION: GpStatus GdipTranslateWorldTransform ( GpGraphics* x, REAL x, REAL x, GpMatrixOrder x ) ; @@ -1229,8 +1244,8 @@ FUNCTION: GpStatus GdipAddPathRectangle ( GpPath* x, REAL x, REAL x, REAL x, REA FUNCTION: GpStatus GdipAddPathRectangleI ( GpPath* x, INT x, INT x, INT x, INT x ) ; FUNCTION: GpStatus GdipAddPathRectangles ( GpPath* x, GpRectF* x, INT x ) ; FUNCTION: GpStatus GdipAddPathRectanglesI ( GpPath* x, GpRect* x, INT x ) ; -FUNCTION: GpStatus GdipAddPathString ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, RectF* x, GpStringFormat* x ) ; -FUNCTION: GpStatus GdipAddPathStringI ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, Rect* x, GpStringFormat* x ) ; +FUNCTION: GpStatus GdipAddPathString ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, GpRectF* x, GpStringFormat* x ) ; +FUNCTION: GpStatus GdipAddPathStringI ( GpPath* x, WCHAR* x, INT x, GpFontFamily* x, INT x, REAL x, GpRect* x, GpStringFormat* x ) ; FUNCTION: GpStatus GdipClearPathMarkers ( GpPath* x ) ; FUNCTION: GpStatus GdipClonePath ( GpPath* x, GpPath** x ) ; FUNCTION: GpStatus GdipClosePathFigure ( GpPath* x ) ; @@ -1340,7 +1355,7 @@ FUNCTION: GpStatus GdipSetImageAttributesThreshold ( GpImageAttributes* x, ColorAdjustType x, BOOL x, REAL x ) ; FUNCTION: GpStatus GdipSetImageAttributesToIdentity ( GpImageAttributes* x, ColorAdjustType x ) ; -FUNCTION: GpStatus GdipSetImageAttributesWrapMode ( GpImageAttributes* x, WrapMode x, +FUNCTION: GpStatus GdipSetImageAttributesWrapMode ( GpImageAttributes* x, GpWrapMode x, ARGB x, BOOL x ) ; @@ -1386,7 +1401,7 @@ FUNCTION: GpStatus GdipTranslateLineTransform ( GpLineGradient* x, REAL x, REAL FUNCTION: GpStatus GdipCloneMatrix ( GpMatrix* x, GpMatrix** x ) ; FUNCTION: GpStatus GdipCreateMatrix ( GpMatrix** x ) ; FUNCTION: GpStatus GdipCreateMatrix2 ( REAL x, REAL x, REAL x, REAL x, REAL x, REAL x, GpMatrix** x ) ; -FUNCTION: GpStatus GdipCreateMatrix3 ( GpRectF * x, GpPointF* x, GpMatrix** x ) ; +FUNCTION: GpStatus GdipCreateMatrix3 ( GpRectF* x, GpPointF* x, GpMatrix** x ) ; FUNCTION: GpStatus GdipCreateMatrix3I ( GpRect* x, GpPoint* x, GpMatrix** x ) ; FUNCTION: GpStatus GdipDeleteMatrix ( GpMatrix* x ) ; FUNCTION: GpStatus GdipGetMatrixElements ( GpMatrix* x, REAL* x ) ; @@ -1406,10 +1421,10 @@ FUNCTION: GpStatus GdipVectorTransformMatrixPoints ( GpMatrix* x, GpPointF* x, I FUNCTION: GpStatus GdipVectorTransformMatrixPointsI ( GpMatrix* x, GpPoint* x, INT x ) ; -FUNCTION: GpStatus GdipConvertToEmfPlus ( const GpGraphics* x, GpMetafile* x, INT* x, - EmfType x, const WCHAR* x, GpMetafile** x ) ; -FUNCTION: GpStatus GdipConvertToEmfPlusToFile ( const GpGraphics* x, GpMetafile* x, INT* x, const WCHAR* x, EmfType x, const WCHAR* x, GpMetafile** x ) ; -FUNCTION: GpStatus GdipConvertToEmfPlusToStream ( const GpGraphics* x, GpMetafile* x, INT* x, IStream* x, EmfType x, const WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipConvertToEmfPlus ( GpGraphics* x, GpMetafile* x, INT* x, + EmfType x, WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipConvertToEmfPlusToFile ( GpGraphics* x, GpMetafile* x, INT* x, WCHAR* x, EmfType x, WCHAR* x, GpMetafile** x ) ; +FUNCTION: GpStatus GdipConvertToEmfPlusToStream ( GpGraphics* x, GpMetafile* x, INT* x, IStream* x, EmfType x, WCHAR* x, GpMetafile** x ) ; FUNCTION: GpStatus GdipCreateMetafileFromEmf ( HENHMETAFILE x, BOOL x, GpMetafile** x ) ; FUNCTION: GpStatus GdipCreateMetafileFromWmf ( HMETAFILE x, BOOL x, WmfPlaceableFileHeader* x, GpMetafile** x ) ; @@ -1427,8 +1442,8 @@ FUNCTION: GpStatus GdipGetMetafileHeaderFromStream ( IStream* x, MetafileHeader* FUNCTION: GpStatus GdipGetMetafileHeaderFromWmf ( HMETAFILE x, WmfPlaceableFileHeader* x, MetafileHeader* x ) ; -FUNCTION: GpStatus WINAPI GdiplusNotificationHook ( ULONG_PTR* x ) ; -FUNCTION: void WINAPI GdiplusNotificationUnhook ( ULONG_PTR x ) ; +FUNCTION: GpStatus GdiplusNotificationHook ( ULONG_PTR* x ) ; +FUNCTION: void GdiplusNotificationUnhook ( ULONG_PTR x ) ; FUNCTION: GpStatus GdipCreatePathGradient ( GpPointF* x, INT x, GpWrapMode x, GpPathGradient** x ) ; @@ -1521,35 +1536,35 @@ FUNCTION: GpStatus GdipGetPenUnit ( GpPen* x, GpUnit* x ) ; FUNCTION: GpStatus GdipGetPenWidth ( GpPen* x, REAL* x ) ; -FUNCTION: GpStatus GdipCloneRegion ( GpRegion * x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipCombineRegionPath ( GpRegion * x, GpPath * x, CombineMode x ) ; -FUNCTION: GpStatus GdipCombineRegionRect ( GpRegion * x, GpRectF * x, CombineMode x ) ; -FUNCTION: GpStatus GdipCombineRegionRectI ( GpRegion * x, GpRect * x, CombineMode x ) ; -FUNCTION: GpStatus GdipCombineRegionRegion ( GpRegion * x, GpRegion * x, CombineMode x ) ; -FUNCTION: GpStatus GdipCreateRegion ( GpRegion ** x ) ; -FUNCTION: GpStatus GdipCreateRegionPath ( GpPath * x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipCreateRegionRect ( GpRectF * x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipCreateRegionRectI ( GpRect * x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipCreateRegionRgnData ( BYTE * x, INT x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipCreateRegionHrgn ( HRGN x, GpRegion ** x ) ; -FUNCTION: GpStatus GdipDeleteRegion ( GpRegion * x ) ; -FUNCTION: GpStatus GdipGetRegionBounds ( GpRegion * x, GpGraphics * x, GpRectF * x ) ; -FUNCTION: GpStatus GdipGetRegionBoundsI ( GpRegion * x, GpGraphics * x, GpRect * x ) ; -FUNCTION: GpStatus GdipGetRegionData ( GpRegion * x, BYTE * x, UINT x, UINT * x ) ; -FUNCTION: GpStatus GdipGetRegionDataSize ( GpRegion * x, UINT * x ) ; -FUNCTION: GpStatus GdipGetRegionHRgn ( GpRegion * x, GpGraphics * x, HRGN * x ) ; -FUNCTION: GpStatus GdipIsEmptyRegion ( GpRegion * x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsEqualRegion ( GpRegion * x, GpRegion * x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsInfiniteRegion ( GpRegion * x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsVisibleRegionPoint ( GpRegion * x, REAL x, REAL x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsVisibleRegionPointI ( GpRegion * x, INT x, INT x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsVisibleRegionRect ( GpRegion * x, REAL x, REAL x, REAL x, REAL x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipIsVisibleRegionRectI ( GpRegion * x, INT x, INT x, INT x, INT x, GpGraphics * x, BOOL * x ) ; -FUNCTION: GpStatus GdipSetEmpty ( GpRegion * x ) ; -FUNCTION: GpStatus GdipSetInfinite ( GpRegion * x ) ; -FUNCTION: GpStatus GdipTransformRegion ( GpRegion * x, GpMatrix * x ) ; -FUNCTION: GpStatus GdipTranslateRegion ( GpRegion * x, REAL x, REAL x ) ; -FUNCTION: GpStatus GdipTranslateRegionI ( GpRegion * x, INT x, INT x ) ; +FUNCTION: GpStatus GdipCloneRegion ( GpRegion* x, GpRegion** x ) ; +FUNCTION: GpStatus GdipCombineRegionPath ( GpRegion* x, GpPath* x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRect ( GpRegion* x, GpRectF* x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRectI ( GpRegion* x, GpRect* x, CombineMode x ) ; +FUNCTION: GpStatus GdipCombineRegionRegion ( GpRegion* x, GpRegion* x, CombineMode x ) ; +FUNCTION: GpStatus GdipCreateRegion ( GpRegion** x ) ; +FUNCTION: GpStatus GdipCreateRegionPath ( GpPath* x, GpRegion** x ) ; +FUNCTION: GpStatus GdipCreateRegionRect ( GpRectF* x, GpRegion** x ) ; +FUNCTION: GpStatus GdipCreateRegionRectI ( GpRect* x, GpRegion** x ) ; +FUNCTION: GpStatus GdipCreateRegionRgnData ( BYTE* x, INT x, GpRegion** x ) ; +FUNCTION: GpStatus GdipCreateRegionHrgn ( HRGN x, GpRegion** x ) ; +FUNCTION: GpStatus GdipDeleteRegion ( GpRegion* x ) ; +FUNCTION: GpStatus GdipGetRegionBounds ( GpRegion* x, GpGraphics* x, GpRectF* x ) ; +FUNCTION: GpStatus GdipGetRegionBoundsI ( GpRegion* x, GpGraphics* x, GpRect* x ) ; +FUNCTION: GpStatus GdipGetRegionData ( GpRegion* x, BYTE* x, UINT x, UINT* x ) ; +FUNCTION: GpStatus GdipGetRegionDataSize ( GpRegion* x, UINT* x ) ; +FUNCTION: GpStatus GdipGetRegionHRgn ( GpRegion* x, GpGraphics* x, HRGN* x ) ; +FUNCTION: GpStatus GdipIsEmptyRegion ( GpRegion* x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsEqualRegion ( GpRegion* x, GpRegion* x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsInfiniteRegion ( GpRegion* x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionPoint ( GpRegion* x, REAL x, REAL x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionPointI ( GpRegion* x, INT x, INT x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionRect ( GpRegion* x, REAL x, REAL x, REAL x, REAL x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipIsVisibleRegionRectI ( GpRegion* x, INT x, INT x, INT x, INT x, GpGraphics* x, BOOL* x ) ; +FUNCTION: GpStatus GdipSetEmpty ( GpRegion* x ) ; +FUNCTION: GpStatus GdipSetInfinite ( GpRegion* x ) ; +FUNCTION: GpStatus GdipTransformRegion ( GpRegion* x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipTranslateRegion ( GpRegion* x, REAL x, REAL x ) ; +FUNCTION: GpStatus GdipTranslateRegionI ( GpRegion* x, INT x, INT x ) ; FUNCTION: GpStatus GdipCreateSolidFill ( ARGB x, GpSolidFill** x ) ; @@ -1580,8 +1595,8 @@ FUNCTION: GpStatus GdipSetStringFormatMeasurableCharacterRanges ( FUNCTION: GpStatus GdipSetStringFormatTabStops ( GpStringFormat* x, REAL x, INT x, REAL* x ) ; FUNCTION: GpStatus GdipSetStringFormatTrimming ( GpStringFormat* x, StringTrimming x ) ; FUNCTION: GpStatus GdipSetStringFormatFlags ( GpStringFormat* x, INT x ) ; -FUNCTION: GpStatus GdipStringFormatGetGenericDefault ( GpStringFormat ** x ) ; -FUNCTION: GpStatus GdipStringFormatGetGenericTypographic ( GpStringFormat ** x ) ; +FUNCTION: GpStatus GdipStringFormatGetGenericDefault ( GpStringFormat** x ) ; +FUNCTION: GpStatus GdipStringFormatGetGenericTypographic ( GpStringFormat** x ) ; FUNCTION: GpStatus GdipCreateTexture ( GpImage* x, GpWrapMode x, GpTexture** x ) ; @@ -1598,13 +1613,13 @@ FUNCTION: GpStatus GdipMultiplyTextureTransform ( GpTexture* x, FUNCTION: GpStatus GdipResetTextureTransform ( GpTexture* x ) ; FUNCTION: GpStatus GdipRotateTextureTransform ( GpTexture* x, REAL x, GpMatrixOrder x ) ; FUNCTION: GpStatus GdipScaleTextureTransform ( GpTexture* x, REAL x, REAL x, GpMatrixOrder x ) ; -FUNCTION: GpStatus GdipSetTextureTransform ( GpTexture * x, GpMatrix* x ) ; +FUNCTION: GpStatus GdipSetTextureTransform ( GpTexture* x, GpMatrix* x ) ; FUNCTION: GpStatus GdipSetTextureWrapMode ( GpTexture* x, GpWrapMode x ) ; FUNCTION: GpStatus GdipTranslateTextureTransform ( GpTexture* x, REAL x, REAL x, GpMatrixOrder x ) ; FUNCTION: GpStatus GdipCreateStreamOnFile ( WCHAR* x, UINT x, IStream** x ) ; -FUNCTION: GpStatus GdipGetImageEncodersSize ( UINT *numEncoders x, UINT *size x ) ; -FUNCTION: GpStatus GdipGetImageEncoders ( UINT numEncoders x, UINT size x, ImageCodecInfo *encoders x ) ; +FUNCTION: GpStatus GdipGetImageEncodersSize ( UINT* numEncoders, UINT* size ) ; +FUNCTION: GpStatus GdipGetImageEncoders ( UINT numEncoders, UINT size, ImageCodecInfo* encoders ) ; FUNCTION: GpStatus GdipTestControl ( GpTestControlEnum x, void* x ) ; diff --git a/basis/windows/ole32/ole32.factor b/basis/windows/ole32/ole32.factor index 538a142878..8b0a2406c7 100644 --- a/basis/windows/ole32/ole32.factor +++ b/basis/windows/ole32/ole32.factor @@ -13,6 +13,9 @@ TYPEDEF: void* LPUNKNOWN TYPEDEF: LPWSTR LPOLESTR TYPEDEF: LPWSTR LPCOLESTR +TYPEDEF: GUID IID +TYPEDEF: GUID CLSID + TYPEDEF: REFGUID LPGUID TYPEDEF: REFGUID REFIID TYPEDEF: REFGUID REFCLSID diff --git a/basis/windows/types/types.factor b/basis/windows/types/types.factor index e2e4b113a4..3490e8083d 100644 --- a/basis/windows/types/types.factor +++ b/basis/windows/types/types.factor @@ -16,6 +16,8 @@ TYPEDEF: wchar_t WCHAR TYPEDEF: short SHORT TYPEDEF: ushort USHORT +TYPEDEF: short INT16 +TYPEDEF: ushort UINT16 TYPEDEF: ushort WORD TYPEDEF: ulong DWORD @@ -94,7 +96,7 @@ TYPEDEF: HANDLE HDDEDATA TYPEDEF: HANDLE HDESK TYPEDEF: HANDLE HDROP TYPEDEF: HANDLE HDWP -TYPEDEF: HANDLE HENMETAFILE +TYPEDEF: HANDLE HENHMETAFILE TYPEDEF: HANDLE HFONT TYPEDEF: HANDLE HGDIOBJ TYPEDEF: HANDLE HGLOBAL @@ -398,3 +400,5 @@ STRUCT: TEXTMETRICW { tmCharSet BYTE } ; TYPEDEF: TEXTMETRICW* LPTEXTMETRIC + +TYPEDEF: ULONG PROPID From 93a893f8f47c0baa6638b984f19a0801d85d0013 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 16:42:15 -0700 Subject: [PATCH 09/41] windows.gdiplus: resolve ambiguity introduced by auto-use --- basis/windows/gdiplus/gdiplus.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/windows/gdiplus/gdiplus.factor b/basis/windows/gdiplus/gdiplus.factor index 9e8bb692ab..2291628f17 100644 --- a/basis/windows/gdiplus/gdiplus.factor +++ b/basis/windows/gdiplus/gdiplus.factor @@ -2,6 +2,7 @@ USING: alien.c-types alien.destructors alien.syntax classes.struct kernel math windows.com windows.com.syntax windows.kernel32 windows.ole32 windows.types ; +FROM: alien.c-types => float ; IN: windows.gdiplus LIBRARY: gdiplus From 6bca9f2e15bc9fa08c000abd80b28055af33999b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 19:41:51 -0700 Subject: [PATCH 10/41] windows.com: add IStream interface --- basis/windows/com/com.factor | 45 +++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/basis/windows/com/com.factor b/basis/windows/com/com.factor index bdc055f787..b69189786f 100644 --- a/basis/windows/com/com.factor +++ b/basis/windows/com/com.factor @@ -1,6 +1,6 @@ USING: alien alien.c-types alien.destructors windows.com.syntax windows.ole32 windows.types continuations kernel alien.syntax -libc destructors accessors alien.data ; +libc destructors accessors alien.data classes.struct windows.kernel32 ; IN: windows.com LIBRARY: ole32 @@ -31,6 +31,47 @@ COM-INTERFACE: IDropTarget IUnknown {00000122-0000-0000-C000-000000000046} HRESULT DragLeave ( ) HRESULT Drop ( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) ; +COM-INTERFACE: ISequentialStream IUnknown {0C733A30-2A1C-11CE-ADE5-00AA0044773D} + HRESULT Read ( void* pv, ULONG cb, ULONG* pcbRead ) + HRESULT Write ( void* pv, ULONG cb, ULONG* pcbWritten ) ; + +STRUCT: STATSTG + { pwcsName LPOLESTR } + { type DWORD } + { cbSize ULARGE_INTEGER } + { mtime FILETIME } + { ctime FILETIME } + { atime FILETIME } + { grfMode DWORD } + { grfLocksSupported DWORD } + { clsid CLSID } + { grfStateBits DWORD } + { reserved DWORD } ; + +CONSTANT: STGTY_STORAGE 1 +CONSTANT: STGTY_STREAM 2 +CONSTANT: STGTY_LOCKBYTES 3 +CONSTANT: STGTY_PROPERTY 4 + +CONSTANT: STREAM_SEEK_SET 0 +CONSTANT: STREAM_SEEK_CUR 1 +CONSTANT: STREAM_SEEK_END 2 + +CONSTANT: LOCK_WRITE 1 +CONSTANT: LOCK_EXCLUSIVE 2 +CONSTANT: LOCK_ONLYONCE 4 + +COM-INTERFACE: IStream ISequentialStream {0000000C-0000-0000-C000-000000000046} + HRESULT Seek ( LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition ) + HRESULT SetSize ( ULARGE_INTEGER* libNewSize ) + HRESULT CopyTo ( IStream* pstm, ULARGE_INTEGER* cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten ) + HRESULT Commit ( DWORD grfCommitFlags ) + HRESULT Revert ( ) + HRESULT LockRegion ( ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType ) + HRESULT UnlockRegion ( ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType ) + HRESULT Stat ( STATSTG* pstatstg, DWORD grfStatFlag ) + HRESULT Clone ( IStream** ppstm ) ; + FUNCTION: HRESULT RegisterDragDrop ( HWND hWnd, IDropTarget* pDropTarget ) ; FUNCTION: HRESULT RevokeDragDrop ( HWND hWnd ) ; FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ; @@ -52,6 +93,4 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ; DESTRUCTOR: com-release -! XXX interfaces used by other libraries that should be fleshed out -C-TYPE: IStream From 780c190d69d5a7a484f2aceae2aa926a651d762f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Jun 2010 21:51:49 -0700 Subject: [PATCH 11/41] new vocab windows.streams: COM IStream wrapper for factor streams --- basis/windows/com/com.factor | 10 ++- basis/windows/streams/platforms.txt | 1 + basis/windows/streams/streams.factor | 112 +++++++++++++++++++++++++++ basis/windows/streams/summary.txt | 1 + 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 basis/windows/streams/platforms.txt create mode 100644 basis/windows/streams/streams.factor create mode 100644 basis/windows/streams/summary.txt diff --git a/basis/windows/com/com.factor b/basis/windows/com/com.factor index b69189786f..46ae1ae154 100644 --- a/basis/windows/com/com.factor +++ b/basis/windows/com/com.factor @@ -48,6 +48,12 @@ STRUCT: STATSTG { grfStateBits DWORD } { reserved DWORD } ; +CONSTANT: STGM_READ 0 +CONSTANT: STGM_WRITE 1 +CONSTANT: STGM_READWRITE 2 + +CONSTANT: STG_E_INVALIDFUNCTION HEX: 80030001 + CONSTANT: STGTY_STORAGE 1 CONSTANT: STGTY_STREAM 2 CONSTANT: STGTY_LOCKBYTES 3 @@ -61,10 +67,12 @@ CONSTANT: LOCK_WRITE 1 CONSTANT: LOCK_EXCLUSIVE 2 CONSTANT: LOCK_ONLYONCE 4 +CONSTANT: GUID_NULL GUID: {00000000-0000-0000-0000-000000000000} + COM-INTERFACE: IStream ISequentialStream {0000000C-0000-0000-C000-000000000046} HRESULT Seek ( LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition ) HRESULT SetSize ( ULARGE_INTEGER* libNewSize ) - HRESULT CopyTo ( IStream* pstm, ULARGE_INTEGER* cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten ) + HRESULT CopyTo ( IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten ) HRESULT Commit ( DWORD grfCommitFlags ) HRESULT Revert ( ) HRESULT LockRegion ( ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType ) diff --git a/basis/windows/streams/platforms.txt b/basis/windows/streams/platforms.txt new file mode 100644 index 0000000000..3646795db5 --- /dev/null +++ b/basis/windows/streams/platforms.txt @@ -0,0 +1 @@ +windows diff --git a/basis/windows/streams/streams.factor b/basis/windows/streams/streams.factor new file mode 100644 index 0000000000..f16fe5a927 --- /dev/null +++ b/basis/windows/streams/streams.factor @@ -0,0 +1,112 @@ +USING: accessors alien.c-types classes.struct combinators +continuations io kernel libc literals locals sequences +specialized-arrays windows.com memoize +windows.com.wrapper windows.kernel32 windows.ole32 +windows.types ; +IN: windows.streams + +SPECIALIZED-ARRAY: uchar + + buf + buf length :> bytes + pv buf bytes memcpy + out-read [ bytes out-read 0 ULONG set-alien-value ] when + + cb bytes = [ S_OK ] [ S_FALSE ] if + ] with-hresult ; inline + +:: IStream-write ( stream pv cb out-written -- hresult ) + [ + pv cb stream stream-write + out-written [ cb out-written 0 ULONG set-alien-value ] when + S_OK + ] with-hresult ; inline + +: origin>seek-type ( origin -- seek-type ) + { + { $ STREAM_SEEK_SET [ seek-absolute ] } + { $ STREAM_SEEK_CUR [ seek-relative ] } + { $ STREAM_SEEK_END [ seek-end ] } + } case ; + +:: IStream-seek ( stream move origin new-position -- hresult ) + [ + move origin origin>seek-type stream stream-seek + new-position [ + stream stream-tell new-position 0 ULARGE_INTEGER set-alien-value + ] when + S_OK + ] with-hresult ; inline + +:: IStream-set-size ( stream new-size -- hresult ) + STG_E_INVALIDFUNCTION ; + +:: IStream-copy-to ( stream other-stream cb out-read out-written -- hresult ) + [ + cb stream stream-read :> buf + buf length :> bytes + out-read [ bytes out-read 0 ULONG set-alien-value ] when + + other-stream buf bytes out-written IStream::Write + ] with-hresult ; inline + +:: IStream-commit ( stream flags -- hresult ) + stream stream-flush S_OK ; + +:: IStream-revert ( stream -- hresult ) + STG_E_INVALIDFUNCTION ; + +:: IStream-lock-region ( stream offset cb lock-type -- hresult ) + STG_E_INVALIDFUNCTION ; + +:: IStream-unlock-region ( stream offset cb lock-type -- hresult ) + STG_E_INVALIDFUNCTION ; + +:: IStream-stat ( stream out-stat stat-flag -- hresult ) + [ + out-stat + f >>pwcsName + STGTY_STREAM >>type + 0 >>cbSize + FILETIME >>mtime + FILETIME >>ctime + FILETIME >>atime + STGM_READWRITE >>grfMode + 0 >>grfLocksSupported + GUID_NULL >>clsid + 0 >>grfStateBits + 0 >>reserved + ] with-hresult ; + +:: IStream-clone ( out-clone-stream -- hresult ) + f out-clone-stream 0 void* set-alien-value + STG_E_INVALIDFUNCTION ; + +MEMO: stream-wrapper ( -- wrapper ) + { + { IStream { + [ IStream-read ] + [ IStream-write ] + [ IStream-seek ] + [ IStream-set-size ] + [ IStream-copy-to ] + [ IStream-commit ] + [ IStream-revert ] + [ IStream-lock-region ] + [ IStream-unlock-region ] + [ IStream-stat ] + [ IStream-clone ] + } } + } ; + +PRIVATE> + +: stream>IStream ( stream -- IStream ) + stream-wrapper com-wrap ; diff --git a/basis/windows/streams/summary.txt b/basis/windows/streams/summary.txt new file mode 100644 index 0000000000..3578124ca3 --- /dev/null +++ b/basis/windows/streams/summary.txt @@ -0,0 +1 @@ +IStream interface wrapper for Factor stream objects From 5a3b6960e0f520339c8032866fa5e8705a139af5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Jul 2010 22:35:49 -0700 Subject: [PATCH 12/41] windows.streams: attempt to determine stream size because GdipCreateBitmapFromStream requires its IStream to report it --- basis/windows/streams/streams.factor | 60 ++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/basis/windows/streams/streams.factor b/basis/windows/streams/streams.factor index f16fe5a927..956b4aad10 100644 --- a/basis/windows/streams/streams.factor +++ b/basis/windows/streams/streams.factor @@ -69,12 +69,20 @@ SPECIALIZED-ARRAY: uchar :: IStream-unlock-region ( stream offset cb lock-type -- hresult ) STG_E_INVALIDFUNCTION ; +FROM: io.ports => tell-handle ; +:: stream-size ( stream -- size ) + stream stream-tell :> old-pos + 0 seek-end stream stream-seek + stream handle>> tell-handle :> size + old-pos seek-absolute stream stream-seek + size ; + :: IStream-stat ( stream out-stat stat-flag -- hresult ) [ out-stat f >>pwcsName STGTY_STREAM >>type - 0 >>cbSize + stream stream-size >>cbSize FILETIME >>mtime FILETIME >>ctime FILETIME >>atime @@ -83,28 +91,46 @@ SPECIALIZED-ARRAY: uchar GUID_NULL >>clsid 0 >>grfStateBits 0 >>reserved + drop + S_OK ] with-hresult ; :: IStream-clone ( out-clone-stream -- hresult ) f out-clone-stream 0 void* set-alien-value STG_E_INVALIDFUNCTION ; -MEMO: stream-wrapper ( -- wrapper ) - { - { IStream { - [ IStream-read ] - [ IStream-write ] - [ IStream-seek ] - [ IStream-set-size ] - [ IStream-copy-to ] - [ IStream-commit ] - [ IStream-revert ] - [ IStream-lock-region ] - [ IStream-unlock-region ] - [ IStream-stat ] - [ IStream-clone ] - } } - } ; +USE: tools.annotations +: watch-istream-callbacks ( -- ) + \ IStream-read watch + \ IStream-write watch + \ IStream-seek watch + \ IStream-set-size watch + \ IStream-copy-to watch + \ IStream-commit watch + \ IStream-revert watch + \ IStream-lock-region watch + \ IStream-unlock-region watch + \ IStream-stat watch + \ IStream-clone watch ; + +CONSTANT: stream-wrapper + $[ + { + { IStream { + [ IStream-read ] + [ IStream-write ] + [ IStream-seek ] + [ IStream-set-size ] + [ IStream-copy-to ] + [ IStream-commit ] + [ IStream-revert ] + [ IStream-lock-region ] + [ IStream-unlock-region ] + [ IStream-stat ] + [ IStream-clone ] + } } + } + ] PRIVATE> From 099607bfdd70bf25d96619b5c6a467d1b4806c03 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Jul 2010 22:36:24 -0700 Subject: [PATCH 13/41] windows.gdiplus: start-gdi+/stop-gdi+/check-gdi+-status helper words --- basis/windows/gdiplus/gdiplus.factor | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/basis/windows/gdiplus/gdiplus.factor b/basis/windows/gdiplus/gdiplus.factor index 2291628f17..66300f9a90 100644 --- a/basis/windows/gdiplus/gdiplus.factor +++ b/basis/windows/gdiplus/gdiplus.factor @@ -1,5 +1,5 @@ ! (c)2010 Joe Groff bsd license -USING: alien.c-types alien.destructors alien.syntax +USING: alien.c-types alien.data alien.destructors alien.syntax classes.struct kernel math windows.com windows.com.syntax windows.kernel32 windows.ole32 windows.types ; FROM: alien.c-types => float ; @@ -1624,3 +1624,26 @@ FUNCTION: GpStatus GdipCreateStreamOnFile ( WCHAR* x, UINT x, IStream** x ) ; FUNCTION: GpStatus GdipGetImageEncodersSize ( UINT* numEncoders, UINT* size ) ; FUNCTION: GpStatus GdipGetImageEncoders ( UINT numEncoders, UINT size, ImageCodecInfo* encoders ) ; FUNCTION: GpStatus GdipTestControl ( GpTestControlEnum x, void* x ) ; + +ERROR: gdi+-error status ; + +: check-gdi+-status ( GpStatus -- ) + dup Ok = [ drop ] [ gdi+-error ] if ; + +CONSTANT: standard-gdi+-startup-input + S{ GdiplusStartupInput + { GdiplusVersion 1 } + { DebugEventCallback f } + { SuppressBackgroundThread 0 } + { SuppressExternalCodecs 0 } + } + +: (start-gdi+) ( startup-input -- token startup-output ) + { ULONG_PTR GdiplusStartupOutput } + [ swapd GdiplusStartup check-gdi+-status ] [ ] with-out-parameters ; +: start-gdi+ ( -- token ) + standard-gdi+-startup-input (start-gdi+) drop ; inline +: stop-gdi+ ( token -- ) + GdiplusShutdown ; + +DESTRUCTOR: stop-gdi+ From 958e08690378c26341cab4aaff481852f04eda62 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Jul 2010 22:37:14 -0700 Subject: [PATCH 14/41] new vocab images.gdiplus: image loading using standard windows gdi+ library --- basis/images/gdiplus/gdiplus.factor | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 basis/images/gdiplus/gdiplus.factor diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor new file mode 100644 index 0000000000..bc5d031820 --- /dev/null +++ b/basis/images/gdiplus/gdiplus.factor @@ -0,0 +1,64 @@ +! (c)2010 Joe Groff bsd license +USING: accessors alien.c-types alien.data alien.enums +classes.struct destructors images images.loader +io.streams.limited kernel locals math windows.com +windows.gdiplus windows.streams windows.types ; +FROM: images => ARGB ; +IN: images.gdiplus + +SINGLETON: gdi+-image +! "png" gdi+-image register-image-class +! "tif" gdi+-image register-image-class +! "tiff" gdi+-image register-image-class +! "gif" gdi+-image register-image-class +! "jpg" gdi+-image register-image-class +! "jpeg" gdi+-image register-image-class +! "bmp" gdi+-image register-image-class +! "ico" gdi+-image register-image-class + + ( x y w h -- rect ) + GpRect ; inline + +: stream>gdi+-bitmap ( stream -- bitmap ) + stream>IStream &com-release + { void* } [ GdipCreateBitmapFromStream check-gdi+-status ] + [ ] with-out-parameters &GdipFree ; + +: gdi+-bitmap-width ( bitmap -- w ) + { UINT } [ GdipGetImageWidth check-gdi+-status ] + [ ] with-out-parameters ; +: gdi+-bitmap-height ( bitmap -- w ) + { UINT } [ GdipGetImageHeight check-gdi+-status ] + [ ] with-out-parameters ; +: gdi+-lock-bitmap ( bitmap rect mode format -- data ) + { BitmapData } [ GdipBitmapLockBits check-gdi+-status ] + [ clone ] with-out-parameters ; + +:: gdi+-bitmap>data ( bitmap -- w h pixels ) + bitmap [ gdi+-bitmap-width ] [ gdi+-bitmap-height ] bi :> ( w h ) + bitmap 0 0 w h ImageLockModeRead enum>number + PixelFormat32bppARGB gdi+-lock-bitmap :> bitmap-data + bitmap-data [ Scan0>> ] [ Stride>> ] [ Height>> * 4 * ] tri + memory>byte-array :> pixels + bitmap bitmap-data GdipBitmapUnlockBits check-gdi+-status + w h pixels ; + +:: data>image ( w h pixels -- image ) + image new + { w h } >>dim + pixels >>bitmap + ARGB >>component-order + ubyte-components >>component-type + f >>upside-down? ; + +PRIVATE> + +M: gdi+-image stream>image + drop + dup limited-stream? [ stream-eofs >>mode ] when [ + start-gdi+ &stop-gdi+ drop + stream>gdi+-bitmap + gdi+-bitmap>data + data>image + ] with-destructors ; From 509f100806b28694aa23588586b240cc1f8b379e Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Jul 2010 22:47:01 -0700 Subject: [PATCH 15/41] windows.streams: remove some code used for debugging --- basis/windows/streams/streams.factor | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/basis/windows/streams/streams.factor b/basis/windows/streams/streams.factor index 956b4aad10..5ec2664ea8 100644 --- a/basis/windows/streams/streams.factor +++ b/basis/windows/streams/streams.factor @@ -99,20 +99,6 @@ FROM: io.ports => tell-handle ; f out-clone-stream 0 void* set-alien-value STG_E_INVALIDFUNCTION ; -USE: tools.annotations -: watch-istream-callbacks ( -- ) - \ IStream-read watch - \ IStream-write watch - \ IStream-seek watch - \ IStream-set-size watch - \ IStream-copy-to watch - \ IStream-commit watch - \ IStream-revert watch - \ IStream-lock-region watch - \ IStream-unlock-region watch - \ IStream-stat watch - \ IStream-clone watch ; - CONSTANT: stream-wrapper $[ { From 8816b1e215d9bee3b44d9e279cb3e6d60204b694 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 7 Jul 2010 09:07:26 -0700 Subject: [PATCH 16/41] ui.images: load images.gdiplus as default image handler on windows --- basis/images/gdiplus/gdiplus.factor | 16 ++++++++-------- basis/ui/images/images.factor | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor index bc5d031820..95fdc3dd44 100644 --- a/basis/images/gdiplus/gdiplus.factor +++ b/basis/images/gdiplus/gdiplus.factor @@ -7,14 +7,14 @@ FROM: images => ARGB ; IN: images.gdiplus SINGLETON: gdi+-image -! "png" gdi+-image register-image-class -! "tif" gdi+-image register-image-class -! "tiff" gdi+-image register-image-class -! "gif" gdi+-image register-image-class -! "jpg" gdi+-image register-image-class -! "jpeg" gdi+-image register-image-class -! "bmp" gdi+-image register-image-class -! "ico" gdi+-image register-image-class +"png" gdi+-image register-image-class +"tif" gdi+-image register-image-class +"tiff" gdi+-image register-image-class +"gif" gdi+-image register-image-class +"jpg" gdi+-image register-image-class +"jpeg" gdi+-image register-image-class +"bmp" gdi+-image register-image-class +"ico" gdi+-image register-image-class ( x y w h -- rect ) diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index e9c527a3a6..7084f1aac1 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -33,9 +33,8 @@ PRIVATE> << { - { [ os macosx? ] [ - "images.cocoa" require - ] } + { [ os macosx? ] [ "images.cocoa" require ] } + { [ os winnt? ] [ "images.gdiplus" require ] } [ "images.png" require "images.tiff" require From 987c2b81535ff6656961dc2a71135a98be8176ef Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 7 Jul 2010 13:52:18 -0700 Subject: [PATCH 17/41] windows.streams: get rid of workaround for stream-tell bug --- basis/windows/streams/streams.factor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/basis/windows/streams/streams.factor b/basis/windows/streams/streams.factor index 5ec2664ea8..33c519e500 100644 --- a/basis/windows/streams/streams.factor +++ b/basis/windows/streams/streams.factor @@ -69,11 +69,10 @@ SPECIALIZED-ARRAY: uchar :: IStream-unlock-region ( stream offset cb lock-type -- hresult ) STG_E_INVALIDFUNCTION ; -FROM: io.ports => tell-handle ; :: stream-size ( stream -- size ) stream stream-tell :> old-pos 0 seek-end stream stream-seek - stream handle>> tell-handle :> size + stream stream-tell :> size old-pos seek-absolute stream stream-seek size ; From aa047a8c793b4d995b41f62413bca8c23915b2fa Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 7 Jul 2010 13:54:24 -0700 Subject: [PATCH 18/41] images.gdiplus: don't multiply stride by pixel size because that's part of the stride already, noob --- basis/images/gdiplus/gdiplus.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor index 95fdc3dd44..b2c31f383e 100644 --- a/basis/images/gdiplus/gdiplus.factor +++ b/basis/images/gdiplus/gdiplus.factor @@ -39,7 +39,7 @@ SINGLETON: gdi+-image bitmap [ gdi+-bitmap-width ] [ gdi+-bitmap-height ] bi :> ( w h ) bitmap 0 0 w h ImageLockModeRead enum>number PixelFormat32bppARGB gdi+-lock-bitmap :> bitmap-data - bitmap-data [ Scan0>> ] [ Stride>> ] [ Height>> * 4 * ] tri + bitmap-data [ Scan0>> ] [ Stride>> ] [ Height>> * ] tri memory>byte-array :> pixels bitmap bitmap-data GdipBitmapUnlockBits check-gdi+-status w h pixels ; From e228d8478f47e6dedebe51d9f3d1ade1333316ee Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 7 Jul 2010 14:51:16 -0700 Subject: [PATCH 19/41] images.gdiplus: GDI+ "ARGB" is little-endian, so really maps to opengl BGRA --- basis/images/gdiplus/gdiplus.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor index b2c31f383e..0e9549f892 100644 --- a/basis/images/gdiplus/gdiplus.factor +++ b/basis/images/gdiplus/gdiplus.factor @@ -2,8 +2,8 @@ USING: accessors alien.c-types alien.data alien.enums classes.struct destructors images images.loader io.streams.limited kernel locals math windows.com -windows.gdiplus windows.streams windows.types ; -FROM: images => ARGB ; +windows.gdiplus windows.streams windows.types typed +byte-arrays grouping sequences ; IN: images.gdiplus SINGLETON: gdi+-image @@ -48,7 +48,7 @@ SINGLETON: gdi+-image image new { w h } >>dim pixels >>bitmap - ARGB >>component-order + BGRA >>component-order ubyte-components >>component-type f >>upside-down? ; From abf0aed9853134ec649cd0a903a2c5bb3ac75d57 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 11 Jul 2010 08:41:55 -0700 Subject: [PATCH 20/41] images.cocoa, images.gdiplus: remove hacks around old limited-stream throwing behavior --- basis/images/cocoa/cocoa.factor | 4 +--- basis/images/gdiplus/gdiplus.factor | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/basis/images/cocoa/cocoa.factor b/basis/images/cocoa/cocoa.factor index 166a5f8196..115315aa18 100644 --- a/basis/images/cocoa/cocoa.factor +++ b/basis/images/cocoa/cocoa.factor @@ -1,8 +1,7 @@ ! (c)2010 Joe Groff bsd license USING: accessors alien.data cocoa cocoa.classes cocoa.messages combinators core-foundation.data core-graphics.types fry images -images.loader io io.streams.limited kernel literals math -sequences ; +images.loader io kernel literals math sequences ; IN: images.cocoa SINGLETON: ns-image @@ -64,5 +63,4 @@ PRIVATE> M: ns-image stream>image drop - dup limited-stream? [ stream-eofs >>mode ] when [ load-image-rep ] with-input-stream image-rep>image ; diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor index 0e9549f892..97bc52375f 100644 --- a/basis/images/gdiplus/gdiplus.factor +++ b/basis/images/gdiplus/gdiplus.factor @@ -55,8 +55,7 @@ SINGLETON: gdi+-image PRIVATE> M: gdi+-image stream>image - drop - dup limited-stream? [ stream-eofs >>mode ] when [ + drop [ start-gdi+ &stop-gdi+ drop stream>gdi+-bitmap gdi+-bitmap>data From 67a1a0bdead3309e9ea5057284da98d037e155a5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 11 Jul 2010 08:44:27 -0700 Subject: [PATCH 21/41] ui.images, images.loader: move platform-specific image loader setup into images.loader --- basis/images/loader/loader.factor | 12 +++++++++++- basis/ui/images/images.factor | 10 ---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/basis/images/loader/loader.factor b/basis/images/loader/loader.factor index 7e1dc9ca31..461131fdf9 100644 --- a/basis/images/loader/loader.factor +++ b/basis/images/loader/loader.factor @@ -3,7 +3,7 @@ USING: assocs byte-arrays io.encodings.binary io.files io.pathnames io.streams.byte-array io.streams.limited io.streams.throwing kernel namespaces sequences strings -unicode.case fry ; +unicode.case fry system vocabs.loader combinators ; IN: images.loader ERROR: unknown-image-extension extension ; @@ -51,3 +51,13 @@ GENERIC: image>stream ( image class -- ) [ image-class ] [ ] bi binary [ image>stream ] with-file-writer ; +<< +{ + { [ os macosx? ] [ "images.cocoa" require ] } + { [ os winnt? ] [ "images.gdiplus" require ] } + [ + "images.png" require + "images.tiff" require + ] +} cond +>> diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index 7084f1aac1..2ec04a532e 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -31,13 +31,3 @@ PRIVATE> : image-dim ( image-name -- dim ) cached-image dim>> ; -<< -{ - { [ os macosx? ] [ "images.cocoa" require ] } - { [ os winnt? ] [ "images.gdiplus" require ] } - [ - "images.png" require - "images.tiff" require - ] -} cond ->> From 74dc8db962c7f31ab7b9503153f21e1a2be41171 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 16 Jul 2010 11:36:20 -0700 Subject: [PATCH 22/41] Revert "ui.images, images.loader: move platform-specific image loader setup into images.loader" This reverts commit 2bbf752cbeeccc555c66fcb2b16a29e0369765b8. --- basis/images/loader/loader.factor | 12 +----------- basis/ui/images/images.factor | 10 ++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/basis/images/loader/loader.factor b/basis/images/loader/loader.factor index 461131fdf9..7e1dc9ca31 100644 --- a/basis/images/loader/loader.factor +++ b/basis/images/loader/loader.factor @@ -3,7 +3,7 @@ USING: assocs byte-arrays io.encodings.binary io.files io.pathnames io.streams.byte-array io.streams.limited io.streams.throwing kernel namespaces sequences strings -unicode.case fry system vocabs.loader combinators ; +unicode.case fry ; IN: images.loader ERROR: unknown-image-extension extension ; @@ -51,13 +51,3 @@ GENERIC: image>stream ( image class -- ) [ image-class ] [ ] bi binary [ image>stream ] with-file-writer ; -<< -{ - { [ os macosx? ] [ "images.cocoa" require ] } - { [ os winnt? ] [ "images.gdiplus" require ] } - [ - "images.png" require - "images.tiff" require - ] -} cond ->> diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index 2ec04a532e..7084f1aac1 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -31,3 +31,13 @@ PRIVATE> : image-dim ( image-name -- dim ) cached-image dim>> ; +<< +{ + { [ os macosx? ] [ "images.cocoa" require ] } + { [ os winnt? ] [ "images.gdiplus" require ] } + [ + "images.png" require + "images.tiff" require + ] +} cond +>> From a4e71b2cad73b3d273ddb4dbccfab578ac4bd50f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 16 Jul 2010 11:47:23 -0700 Subject: [PATCH 23/41] alien.enums: make it so that define-enum assigns enum values again for non-parsed enum types --- basis/alien/enums/enums-tests.factor | 12 ++++++++++++ basis/alien/enums/enums.factor | 10 +++++++--- basis/alien/syntax/syntax.factor | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/basis/alien/enums/enums-tests.factor b/basis/alien/enums/enums-tests.factor index 52337594a1..a1813d632e 100644 --- a/basis/alien/enums/enums-tests.factor +++ b/basis/alien/enums/enums-tests.factor @@ -37,3 +37,15 @@ ENUM: instrument_t < ushort trombone trumpet ; ENUM: colores { rojo red } { verde green } { azul blue } { colorado rojo } ; [ { 0 3 4 0 } ] [ { rojo verde azul colorado } [ enum>number ] map ] unit-test + +SYMBOLS: couleurs rouge vert bleu jaune azure ; + +<< couleurs int { + { rouge red } + { vert green } + { bleu blue } + { jaune 14 } + { azure bleu } +} define-enum >> + +[ { 0 3 4 14 4 } ] [ { rouge vert bleu jaune azure } [ enum>number ] map ] unit-test diff --git a/basis/alien/enums/enums.factor b/basis/alien/enums/enums.factor index 4ac7c24cb5..c568c2af4c 100644 --- a/basis/alien/enums/enums.factor +++ b/basis/alien/enums/enums.factor @@ -29,11 +29,11 @@ M: enum-c-type c-type-unboxer-quot drop [ enum>number ] ; M: enum-c-type c-type-setter [ enum>number ] swap base-type>> c-type-setter '[ _ 2dip @ ] ; -number "enum-value" set-word-prop ; + -: define-enum ( word base-type members -- ) +: (define-enum) ( word base-type members -- ) [ dup define-enum-constructor ] 2dip dup define-enum-members swap typedef ; + +: define-enum ( word base-type members -- ) + [ (define-enum) ] + [ [ first2 define-enum-value ] each ] bi ; PREDICATE: enum-c-type-word < c-type-word "c-type" word-prop enum-c-type? ; diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index 6c2dc5ca85..22ad3bd174 100755 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -29,7 +29,7 @@ SYNTAX: TYPEDEF: scan-c-type CREATE-C-TYPE dup save-location typedef ; SYNTAX: ENUM: - parse-enum define-enum ; + parse-enum (define-enum) ; SYNTAX: C-TYPE: void CREATE-C-TYPE typedef ; From 9f7847d8ece3440c6b1fa258663277f0c1d103cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Fri, 16 Jul 2010 23:26:48 +0200 Subject: [PATCH 24/41] images.gtk: use GdkPixbuf to load images --- basis/glib/ffi/ffi.factor | 2 +- basis/images/gtk/authors.txt | 1 + basis/images/gtk/gtk.factor | 89 ++++++++++++++++++++++++++++++++++ basis/images/gtk/platforms.txt | 2 + basis/images/gtk/summary.txt | 1 + basis/ui/images/images.factor | 5 +- 6 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 basis/images/gtk/authors.txt create mode 100644 basis/images/gtk/gtk.factor create mode 100644 basis/images/gtk/platforms.txt create mode 100644 basis/images/gtk/summary.txt diff --git a/basis/glib/ffi/ffi.factor b/basis/glib/ffi/ffi.factor index 99183a88dc..7724cf5698 100644 --- a/basis/glib/ffi/ffi.factor +++ b/basis/glib/ffi/ffi.factor @@ -67,7 +67,7 @@ TYPEDEF: guint16 gunichar2 TYPEDEF: gpointer pointer TYPEDEF: gpointer any -IMPLEMENT-STRUCTS: GPollFD GSource GSourceFuncs ; +IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ; GIR: vocab:glib/GLib-2.0.gir diff --git a/basis/images/gtk/authors.txt b/basis/images/gtk/authors.txt new file mode 100644 index 0000000000..156a81af57 --- /dev/null +++ b/basis/images/gtk/authors.txt @@ -0,0 +1 @@ +Philipp Brüschweiler diff --git a/basis/images/gtk/gtk.factor b/basis/images/gtk/gtk.factor new file mode 100644 index 0000000000..6f6921d21f --- /dev/null +++ b/basis/images/gtk/gtk.factor @@ -0,0 +1,89 @@ +! Copyright (C) 2010 Philipp Brüschweiler. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors alien.c-types alien.data alien.strings +alien.syntax arrays classes.struct combinators destructors +gdk.pixbuf.ffi gio.ffi glib.ffi gobject.ffi grouping images +images.loader io io.encodings.utf8 +kernel libc locals math sequences specialized-arrays ; +IN: images.gtk +SPECIALIZED-ARRAY: uchar + +SINGLETON: gtk-image +"png" gtk-image register-image-class +"tif" gtk-image register-image-class +"tiff" gtk-image register-image-class +"gif" gtk-image register-image-class +"jpg" gtk-image register-image-class +"jpeg" gtk-image register-image-class +"bmp" gtk-image register-image-class +"ico" gtk-image register-image-class + +ERROR: g-error domain code message ; + +GInputStream ( data -- GInputStream ) + [ malloc-byte-array &free ] [ length ] bi + f g_memory_input_stream_new_from_data &g_object_unref ; + +: GError>g-error ( GError -- g-error ) + [ domain>> g_quark_to_string utf8 alien>string ] + [ code>> ] + [ message>> utf8 alien>string ] tri + \ g-error boa ; + +: handle-GError ( GError/f -- ) + [ + [ GError>g-error ] + [ g_error_free ] bi + throw + ] when* ; + +STRUCT: GErrorPointer { to pointer: GError } ; + +: GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf ) + f GErrorPointer malloc-struct &free + [ gdk_pixbuf_new_from_stream ] keep + to>> handle-GError &g_object_unref ; + +: image-data ( GdkPixbuf -- data ) + [let + { + [ gdk_pixbuf_get_pixels ] + [ gdk_pixbuf_get_width ] + [ gdk_pixbuf_get_height ] + [ gdk_pixbuf_get_rowstride ] + [ gdk_pixbuf_get_n_channels ] + [ gdk_pixbuf_get_bits_per_sample ] + } cleave :> ( pixels w h rowstride channels bps ) + bps channels * 7 + 8 /i w * :> bytes-per-row + pixels rowstride h * + rowstride + [ bytes-per-row head-slice ] map concat + ] ; + +: component-type ( GdkPixbuf -- component-type ) + gdk_pixbuf_get_bits_per_sample { + { 8 [ ubyte-components ] } + { 16 [ ushort-components ] } + { 32 [ uint-components ] } + } case ; + +: GdkPixbuf>image ( GdkPixbuf -- image ) + [ image new ] dip + { + [ [ gdk_pixbuf_get_width ] [ gdk_pixbuf_get_height ] bi 2array >>dim ] + [ image-data >>bitmap ] + [ gdk_pixbuf_get_has_alpha RGBA RGB ? >>component-order ] + [ component-type >>component-type ] + } cleave + f >>premultiplied-alpha? + f >>upside-down? ; + +PRIVATE> + +M: gtk-image stream>image + drop [ + stream-contents data>GInputStream + GInputStream>GdkPixbuf GdkPixbuf>image + ] with-destructors ; diff --git a/basis/images/gtk/platforms.txt b/basis/images/gtk/platforms.txt new file mode 100644 index 0000000000..a26481a4e1 --- /dev/null +++ b/basis/images/gtk/platforms.txt @@ -0,0 +1,2 @@ +linux +bsd diff --git a/basis/images/gtk/summary.txt b/basis/images/gtk/summary.txt new file mode 100644 index 0000000000..7813e5636c --- /dev/null +++ b/basis/images/gtk/summary.txt @@ -0,0 +1 @@ +Image loading using GTK's GdkPixbuf API diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor index 7084f1aac1..e5d81b8ccc 100644 --- a/basis/ui/images/images.factor +++ b/basis/ui/images/images.factor @@ -35,9 +35,6 @@ PRIVATE> { { [ os macosx? ] [ "images.cocoa" require ] } { [ os winnt? ] [ "images.gdiplus" require ] } - [ - "images.png" require - "images.tiff" require - ] + [ "images.gtk" require ] } cond >> From bb50d31b39c929f0da971161840d405b5463c6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sat, 17 Jul 2010 11:47:31 +0200 Subject: [PATCH 25/41] images.gtk: update to new with-out-parameters, small speedup when loading aligned images --- basis/images/gtk/gtk.factor | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/basis/images/gtk/gtk.factor b/basis/images/gtk/gtk.factor index 6f6921d21f..9b50bf6a62 100644 --- a/basis/images/gtk/gtk.factor +++ b/basis/images/gtk/gtk.factor @@ -39,27 +39,30 @@ ERROR: g-error domain code message ; throw ] when* ; -STRUCT: GErrorPointer { to pointer: GError } ; - : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf ) - f GErrorPointer malloc-struct &free - [ gdk_pixbuf_new_from_stream ] keep - to>> handle-GError &g_object_unref ; + f { { pointer: GError initial: f } } + [ gdk_pixbuf_new_from_stream ] with-out-parameters + handle-GError &g_object_unref ; : image-data ( GdkPixbuf -- data ) - [let - { - [ gdk_pixbuf_get_pixels ] - [ gdk_pixbuf_get_width ] - [ gdk_pixbuf_get_height ] - [ gdk_pixbuf_get_rowstride ] - [ gdk_pixbuf_get_n_channels ] - [ gdk_pixbuf_get_bits_per_sample ] - } cleave :> ( pixels w h rowstride channels bps ) + { + [ gdk_pixbuf_get_pixels ] + [ gdk_pixbuf_get_width ] + [ gdk_pixbuf_get_height ] + [ gdk_pixbuf_get_rowstride ] + [ gdk_pixbuf_get_n_channels ] + [ gdk_pixbuf_get_bits_per_sample ] + } cleave + [let :> ( pixels w h rowstride channels bps ) bps channels * 7 + 8 /i w * :> bytes-per-row - pixels rowstride h * - rowstride - [ bytes-per-row head-slice ] map concat + + bytes-per-row rowstride = + [ pixels h rowstride * memory>byte-array ] + [ + pixels rowstride h * + rowstride + [ bytes-per-row head-slice ] map concat + ] if ] ; : component-type ( GdkPixbuf -- component-type ) From 03114a65c95466a183a3a607efa39c43ffeffa8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sat, 17 Jul 2010 18:02:36 +0200 Subject: [PATCH 26/41] game.input.gtk: copy of game.input.x11 with gtk-specific way to get the dpy --- basis/game/input/gtk/authors.txt | 2 + basis/game/input/gtk/gtk.factor | 114 +++++++++++++++++++++++++++++ basis/game/input/gtk/platforms.txt | 1 + basis/game/input/gtk/summary.txt | 1 + basis/game/input/gtk/tags.txt | 1 + basis/game/input/input.factor | 2 +- 6 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 basis/game/input/gtk/authors.txt create mode 100644 basis/game/input/gtk/gtk.factor create mode 100644 basis/game/input/gtk/platforms.txt create mode 100644 basis/game/input/gtk/summary.txt create mode 100644 basis/game/input/gtk/tags.txt diff --git a/basis/game/input/gtk/authors.txt b/basis/game/input/gtk/authors.txt new file mode 100644 index 0000000000..d73be90188 --- /dev/null +++ b/basis/game/input/gtk/authors.txt @@ -0,0 +1,2 @@ +Erik Charlebois +William Schlieper diff --git a/basis/game/input/gtk/gtk.factor b/basis/game/input/gtk/gtk.factor new file mode 100644 index 0000000000..9eac60022a --- /dev/null +++ b/basis/game/input/gtk/gtk.factor @@ -0,0 +1,114 @@ +! Copyright (C) 2010 Erik Charlebois, William Schlieper. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors alien.c-types alien.data alien.syntax assocs +bit-arrays game.input gdk.ffi generalizations kernel math +namespaces sequences system x11.xlib ; +IN: game.input.gtk + +SINGLETON: gtk-game-input-backend + +gtk-game-input-backend game-input-backend set-global + +LIBRARY: gdk +FUNCTION: Display* gdk_x11_display_get_xdisplay ( GdkDisplay* display ) ; + +: get-dpy ( -- dpy ) + gdk_display_get_default gdk_x11_display_get_xdisplay ; + +M: gtk-game-input-backend (open-game-input) + ; + +M: gtk-game-input-backend (close-game-input) + ; + +M: gtk-game-input-backend (reset-game-input) + ; + +M: gtk-game-input-backend get-controllers + { } ; + +M: gtk-game-input-backend product-string + drop "" ; + +M: gtk-game-input-backend product-id + drop f ; + +M: gtk-game-input-backend instance-id + drop f ; + +M: gtk-game-input-backend read-controller + drop controller-state new ; + +M: gtk-game-input-backend calibrate-controller + drop ; + +M: gtk-game-input-backend vibrate-controller + 3drop ; + +HOOK: x>hid-bit-order os ( -- x ) + +M: linux x>hid-bit-order + { + 0 0 0 0 0 0 0 0 + 0 41 30 31 32 33 34 35 + 36 37 38 39 45 46 42 43 + 20 26 8 21 23 28 24 12 + 18 19 47 48 40 224 4 22 + 7 9 10 11 13 14 15 51 + 52 53 225 49 29 27 6 25 + 5 17 16 54 55 56 229 85 + 226 44 57 58 59 60 61 62 + 63 64 65 66 67 83 71 95 + 96 97 86 92 93 94 87 91 + 90 89 98 99 0 0 0 68 + 69 0 0 0 0 0 0 0 + 88 228 84 70 0 0 74 82 + 75 80 79 77 81 78 73 76 + 127 129 128 102 103 0 72 0 + 0 0 0 227 231 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + } ; inline + +: x-bits>hid-bits ( bit-array -- bit-array ) + 256 iota zip [ first ] filter values + x>hid-bit-order [ nth ] curry map + 256 swap [ t swap pick set-nth ] each ; + +M: gtk-game-input-backend read-keyboard + get-dpy 256 [ XQueryKeymap drop ] keep + x-bits>hid-bits keyboard-state boa ; + +: query-pointer ( -- x y buttons ) + get-dpy dup XDefaultRootWindow + { int int int int int int int } + [ XQueryPointer drop ] with-out-parameters + [ 4 ndrop ] 3dip ; + +SYMBOL: mouse-reset? + +M: gtk-game-input-backend read-mouse + mouse-reset? get [ reset-mouse ] unless + query-pointer + mouse-state new + swap 256 /i >>buttons + swap 400 - >>dy + swap 400 - >>dx + 0 >>scroll-dy 0 >>scroll-dx ; + +M: gtk-game-input-backend reset-mouse + get-dpy dup XDefaultRootWindow dup + 0 0 0 0 400 400 XWarpPointer drop t mouse-reset? set-global ; diff --git a/basis/game/input/gtk/platforms.txt b/basis/game/input/gtk/platforms.txt new file mode 100644 index 0000000000..a08e1f35eb --- /dev/null +++ b/basis/game/input/gtk/platforms.txt @@ -0,0 +1 @@ +linux diff --git a/basis/game/input/gtk/summary.txt b/basis/game/input/gtk/summary.txt new file mode 100644 index 0000000000..5c88274722 --- /dev/null +++ b/basis/game/input/gtk/summary.txt @@ -0,0 +1 @@ +Linux backend for game input. diff --git a/basis/game/input/gtk/tags.txt b/basis/game/input/gtk/tags.txt new file mode 100644 index 0000000000..84d4140a70 --- /dev/null +++ b/basis/game/input/gtk/tags.txt @@ -0,0 +1 @@ +games diff --git a/basis/game/input/input.factor b/basis/game/input/input.factor index 213b638574..eb01e94b99 100644 --- a/basis/game/input/input.factor +++ b/basis/game/input/input.factor @@ -108,6 +108,6 @@ SYMBOLS: pressed released ; { { [ os windows? ] [ "game.input.dinput" require ] } { [ os macosx? ] [ "game.input.iokit" require ] } - { [ os linux? ] [ "game.input.x11" require ] } + { [ os linux? ] [ "game.input.gtk" require ] } [ ] } cond From 8130d9cc72f9b8616d43a4ec2c5ef7cbeb1075c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sun, 18 Jul 2010 16:18:27 +0200 Subject: [PATCH 27/41] game.input.gtk: clean up confusing reset-mouse/read-mouse interaction --- basis/game/input/gtk/gtk.factor | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/basis/game/input/gtk/gtk.factor b/basis/game/input/gtk/gtk.factor index 9eac60022a..57db116c97 100644 --- a/basis/game/input/gtk/gtk.factor +++ b/basis/game/input/gtk/gtk.factor @@ -16,7 +16,7 @@ FUNCTION: Display* gdk_x11_display_get_xdisplay ( GdkDisplay* display ) ; gdk_display_get_default gdk_x11_display_get_xdisplay ; M: gtk-game-input-backend (open-game-input) - ; + reset-mouse ; M: gtk-game-input-backend (close-game-input) ; @@ -98,10 +98,7 @@ M: gtk-game-input-backend read-keyboard [ XQueryPointer drop ] with-out-parameters [ 4 ndrop ] 3dip ; -SYMBOL: mouse-reset? - M: gtk-game-input-backend read-mouse - mouse-reset? get [ reset-mouse ] unless query-pointer mouse-state new swap 256 /i >>buttons @@ -111,4 +108,4 @@ M: gtk-game-input-backend read-mouse M: gtk-game-input-backend reset-mouse get-dpy dup XDefaultRootWindow dup - 0 0 0 0 400 400 XWarpPointer drop t mouse-reset? set-global ; + 0 0 0 0 400 400 XWarpPointer drop ; From 03ae0f645c38ef268cccfd3181083d7bb72a94ea Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 18 Jul 2010 13:41:01 -0700 Subject: [PATCH 28/41] calendar: since-1970 shouldn't convert to >local-time; this causes words like "gmt" to return time in local time --- basis/calendar/calendar.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index d9a6dfb370..4e6b35161f 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -532,7 +532,7 @@ M: integer end-of-year 12 31 ; dup midnight time- ; : since-1970 ( duration -- timestamp ) - unix-1970 time+ >local-time ; + unix-1970 time+ ; : timestamp>unix-time ( timestamp -- seconds ) unix-1970 time- second>> ; From 035ba3bc93b6986e7de946174f67877dc34e2862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Thu, 22 Jul 2010 12:39:16 +0200 Subject: [PATCH 29/41] ui.backend.gtk, tools.deploy.unix: support for icons --- basis/glib/ffi/ffi.factor | 18 ++++++++++++++-- basis/images/gtk/gtk.factor | 15 ------------- basis/tools/deploy/unix/unix.factor | 23 +++++++++++++------- basis/ui/backend/gtk/gtk.factor | 29 +++++++++++++++++++------- basis/ui/backend/gtk/icon.ico | Bin 0 -> 15086 bytes core/vocabs/loader/loader-docs.factor | 2 +- 6 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 basis/ui/backend/gtk/icon.ico diff --git a/basis/glib/ffi/ffi.factor b/basis/glib/ffi/ffi.factor index 7724cf5698..a0dc3a3fdb 100644 --- a/basis/glib/ffi/ffi.factor +++ b/basis/glib/ffi/ffi.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2009 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.destructors -alien.libraries alien.syntax combinators compiler.units gir -kernel system vocabs.parser words ; +alien.libraries alien.strings alien.syntax combinators gir +io.encodings.utf8 kernel system vocabs.parser words ; IN: glib.ffi << @@ -78,3 +78,17 @@ CALLBACK: gboolean GSourceFuncsPrepareFunc ( GSource* source, gint* timeout_ ) ; CALLBACK: gboolean GSourceFuncsCheckFunc ( GSource* source ) ; CALLBACK: gboolean GSourceFuncsDispatchFunc ( GSource* source, GSourceFunc callback, gpointer user_data ) ; +ERROR: g-error domain code message ; + +: GError>g-error ( GError -- g-error ) + [ domain>> g_quark_to_string utf8 alien>string ] + [ code>> ] + [ message>> utf8 alien>string ] tri + \ g-error boa ; + +: handle-GError ( GError/f -- ) + [ + [ GError>g-error ] + [ g_error_free ] bi + throw + ] when* ; diff --git a/basis/images/gtk/gtk.factor b/basis/images/gtk/gtk.factor index 9b50bf6a62..e08ac996ad 100644 --- a/basis/images/gtk/gtk.factor +++ b/basis/images/gtk/gtk.factor @@ -18,27 +18,12 @@ SINGLETON: gtk-image "bmp" gtk-image register-image-class "ico" gtk-image register-image-class -ERROR: g-error domain code message ; - GInputStream ( data -- GInputStream ) [ malloc-byte-array &free ] [ length ] bi f g_memory_input_stream_new_from_data &g_object_unref ; -: GError>g-error ( GError -- g-error ) - [ domain>> g_quark_to_string utf8 alien>string ] - [ code>> ] - [ message>> utf8 alien>string ] tri - \ g-error boa ; - -: handle-GError ( GError/f -- ) - [ - [ GError>g-error ] - [ g_error_free ] bi - throw - ] when* ; - : GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf ) f { { pointer: GError initial: f } } [ gdk_pixbuf_new_from_stream ] with-out-parameters diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index 1b6b8596e2..2fba79ad1e 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -1,25 +1,34 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: io io.pathnames io.directories io.files -io.files.info.unix io.backend kernel namespaces make sequences -system tools.deploy.backend tools.deploy.config -tools.deploy.config.editor assocs hashtables prettyprint ; +USING: io io.backend io.directories io.files io.files.info.unix +io.pathnames kernel namespaces sequences system +tools.deploy.backend tools.deploy.config +tools.deploy.config.editor vocabs.loader vocabs.metadata ; IN: tools.deploy.unix +: used-ico ( vocab -- ico ) + dup vocab-windows-icon-path vocab-append-path + [ exists? ] keep "vocab:ui/backend/gtk/icon.ico" ? ; + +: copy-ico ( vocab bundle-name -- ) + [ used-ico ] + [ "ui/backend/gtk/icon.ico" append-path ] bi* + copy-file ; + : create-app-dir ( vocab bundle-name -- vm ) - copy-vm + [ copy-vm ] [ copy-ico ] 2bi dup OCT: 755 set-file-permissions ; : bundle-name ( -- str ) deploy-name get ; M: unix deploy* ( vocab -- ) - "." resource-path [ + "resource:" [ dup deploy-config [ [ bundle-name create-app-dir ] keep [ bundle-name image-name ] keep namespace make-deploy-image bundle-name "" [ copy-resources ] [ copy-libraries ] 3bi - bundle-name normalize-path [ "Binary deployed to " % % "." % ] "" make print + bundle-name normalize-path "Binary deployed to " "." surround print ] bind ] with-directory ; diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 4d72abdd5e..2e0a776dfe 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -1,14 +1,16 @@ ! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien.accessors alien.c-types alien.data -alien.strings arrays assocs classes.struct command-line destructors -gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi gtk.gl.ffi -io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel libc -literals locals math math.bitwise math.order math.vectors namespaces -sequences strings system threads ui ui.backend ui.clipboards -ui.commands ui.event-loop ui.gadgets ui.gadgets.menus -ui.gadgets.private ui.gadgets.worlds ui.gestures ui.pixel-formats -ui.pixel-formats.private ui.private ; +alien.strings alien.syntax arrays assocs classes.struct +command-line destructors gdk.ffi gdk.gl.ffi glib.ffi +gobject.ffi gtk.ffi gtk.gl.ffi io.backend +io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel +libc literals locals math math.bitwise math.order math.vectors +namespaces sequences strings system threads ui ui.backend +ui.clipboards ui.commands ui.event-loop ui.gadgets +ui.gadgets.menus ui.gadgets.private ui.gadgets.worlds +ui.gestures ui.pixel-formats ui.pixel-formats.private +ui.private ; RENAME: windows ui.private => ui:windows EXCLUDE: ui.gadgets.editors => change-caret ; RENAME: change-caret ui.gadgets.editors => editors:change-caret @@ -264,10 +266,21 @@ SYMBOL: next-timeout f g_source_attach drop nano-count next-timeout set-global ; +: load-icon ( -- ) + ! This file is not in a resource.txt because it can be + ! overwritten when deploying. See 'Vocabulary icons' + ! in the docs. + "vocab:ui/backend/gtk/icon.ico" + normalize-path utf8 string>alien + { { pointer: GError initial: f } } + [ gtk_window_set_default_icon_from_file ] with-out-parameters + handle-GError drop ; + M: gtk-ui-backend (with-ui) [ f f gtk_init f f gtk_gl_init + load-icon init-clipboard start-ui stop-io-thread diff --git a/basis/ui/backend/gtk/icon.ico b/basis/ui/backend/gtk/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1df40e3d4e21f4bc3c5f202140f72c17077d0857 GIT binary patch literal 15086 zcmch83tW`fnf^D-<>Q>g_c6>c3^T(p+yrJEa6pio!*v7^K|}-*@rHnapeQO{L5)$P zQR?PmHd?bu%%&T=Ns~>x>D5hkn{?BEx4TXD-*(&7Zku#BZMMcnH%8>_bB0JXDqhq1 z{SN25obR0Xob#Ud^1LsSq>;3e&nKadlb)RtFMdx#6^&%H zXmxgvo+amnQcp>^W!cUwR=nt+X;$^9bM@hi#>VwuC28e{NLtxGk{0ME-m*r}Ux0Ze z7`L`vbqTEZxcDdk+4Hq|bZ;^uI{b%U?oylB8GcM%_WuX3W7H zicqpq(rEh36wEIH^K)TNF~nVHWl7T_sHd3fBJFxfdk^MdFoY0Wf?i3O!dPm7DL9U| z1ml)vVNFXx*IZK2w82!}^^v1{c!c+>4e=A9=2vcHH1^su%M~W##N$`b|lpO45VGQ;-86_PwPsJML z;5r}IMJNI4oB5Pl+c&B%+x-sBsoQ{OyGVNF!=Ud3X#E=I@CxSeJ(O2*|0>O#^Icqj zi+YM)BiXgD(c;B(L327}SQ1UmcMwmBnWYpk7VR`hD$e*F{0vr?9`Zs3PvX24C!(Z$ zItN@AxiE(qj2CUHSRRWt`vI%y+Q$_CtHPT-&1##c$^ z>@zGWYlNocen9dUh;u#@`Lyj$}#MD)dLF6l&1k?mn=@ESY$VjaUmi zXpaM}u^7(^J!PaR`4neNN0YNOtf;AgqzBF#m+s=`?n8f28`ejI*UdCzmczMtb3XPX zo8&hhkOQr+Dz$6BODj9iK_6TMZU2RN9>reuqb$W7#aSrB8WrL`57$1FM4FNlMWXCX z3f0~gFELM%fu&AYum_Q#UC0^}b0#yr*{WCUu5q4J6Q^z@S#w5HH$K6WH$L&-#-+Oz zIk`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@%0>KirZ z*PTP|_sw)io0dnGT{zEGxMURoJg#mYDV!_V5UaGNX=p4Ec&j(C-l?G2?OK z&OeHrz`e-#t%sc#jU2P_HN4)w{JEZSezJsXPnL|Je2fwoezHVzp%kGEqTrb%eXeNm Jjrb1b{{YY9Rd@gZ literal 0 HcmV?d00001 diff --git a/core/vocabs/loader/loader-docs.factor b/core/vocabs/loader/loader-docs.factor index d3736db9bf..0224ec9450 100755 --- a/core/vocabs/loader/loader-docs.factor +++ b/core/vocabs/loader/loader-docs.factor @@ -28,7 +28,7 @@ ARTICLE: "vocabs.roots" "Vocabulary roots" { $subsections "add-vocab-roots" } ; ARTICLE: "vocabs.icons" "Vocabulary icons" -"An icon file representing the vocabulary can be provided for use by " { $link "tools.deploy" } ". A file named " { $snippet "icon.ico" } " will be used as the application icon when the application is deployed on Windows. A file named " { $snippet "icon.icns" } " will be used when the application is deployed on MacOS X." ; +"An icon file representing the vocabulary can be provided for use by " { $link "tools.deploy" } ". A file named " { $snippet "icon.ico" } " will be used as the application icon when the application is deployed on Windows, Linux or the *BSD. A file named " { $snippet "icon.icns" } " will be used when the application is deployed on MacOS X." ; ARTICLE: "vocabs.loader" "Vocabulary loader" "The " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } " words load vocabularies using the vocabulary loader. The vocabulary loader is implemented in the " { $vocab-link "vocabs.loader" } " vocabulary." From 39d475e9969a6ae3a15c8300d31fadbe17b79996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Thu, 22 Jul 2010 22:48:18 +0200 Subject: [PATCH 30/41] ui.backend.gtk: use png instead of ico to represent icons --- basis/tools/deploy/unix/unix.factor | 14 +++++++------- basis/ui/backend/gtk/gtk.factor | 2 +- basis/ui/backend/gtk/icon.ico | Bin 15086 -> 0 bytes basis/ui/backend/gtk/icon.png | Bin 0 -> 7299 bytes core/vocabs/loader/loader-docs.factor | 7 ++++++- extra/hello-ui/deploy.factor | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 basis/ui/backend/gtk/icon.ico create mode 100644 basis/ui/backend/gtk/icon.png diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index 2fba79ad1e..ba7dd4d95e 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -6,17 +6,17 @@ tools.deploy.backend tools.deploy.config tools.deploy.config.editor vocabs.loader vocabs.metadata ; IN: tools.deploy.unix -: used-ico ( vocab -- ico ) - dup vocab-windows-icon-path vocab-append-path - [ exists? ] keep "vocab:ui/backend/gtk/icon.ico" ? ; +: used-icon ( vocab -- ico ) + dup vocab-dir "icon.png" append-path vocab-append-path + [ exists? ] keep "vocab:ui/backend/gtk/icon.png" ? ; -: copy-ico ( vocab bundle-name -- ) - [ used-ico ] - [ "ui/backend/gtk/icon.ico" append-path ] bi* +: copy-icon ( vocab bundle-name -- ) + [ used-icon ] + [ "ui/backend/gtk/icon.png" append-path ] bi* copy-file ; : create-app-dir ( vocab bundle-name -- vm ) - [ copy-vm ] [ copy-ico ] 2bi + [ copy-vm ] [ copy-icon ] 2bi dup OCT: 755 set-file-permissions ; : bundle-name ( -- str ) diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 2e0a776dfe..57b406f6fd 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -270,7 +270,7 @@ SYMBOL: next-timeout ! This file is not in a resource.txt because it can be ! overwritten when deploying. See 'Vocabulary icons' ! in the docs. - "vocab:ui/backend/gtk/icon.ico" + "vocab:ui/backend/gtk/icon.png" normalize-path utf8 string>alien { { pointer: GError initial: f } } [ gtk_window_set_default_icon_from_file ] with-out-parameters diff --git a/basis/ui/backend/gtk/icon.ico b/basis/ui/backend/gtk/icon.ico deleted file mode 100644 index 1df40e3d4e21f4bc3c5f202140f72c17077d0857..0000000000000000000000000000000000000000 GIT binary patch literal 0 H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--git a/basis/ui/backend/gtk/icon.png b/basis/ui/backend/gtk/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a1da637d2100932d651e0dfb10d5212c869f8116 GIT binary patch literal 7299 zcmV-}9DL)6P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(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ayA9p6wCi9YIL8>Cm0gU^uJ8bXJGG zZ93f2ro;JxC_K431TTcE*wv^Hf3?05&ZRVHOKVUYSD>oVkIohqtSJ>sB2`QbI9Y+Q zfXjPF;5m-tOahl1tPl$7eNfz_VEL=y^;Qk)npLPzsnFP}L84WIbXySb-`OKBofs2; z)LV~xTQ#_)U5DG+ba=2M2%ql^!WXkTd^M}XlN~{La!m-olGWi$2?f8_6M?UdBynwv z3VPEr0eiCoa?Hn=ql_6#MDE>(QkTr-RhP4ZU{v#+d}_kF{)$4qt22;R_u>c&JT> zkGAPB+usPAN0Zo_(jb~tpr$E+RV^x5vKkcnokIRQ*8J<*NF$e9VFg1?g}`EdW=bef z-mHQzr9rq^g_evCYX@Vnce=~;oAWdFt3z>ktW|?2+I0AbjvzeqD)1*VIy}&(!}+WZ zN85Cm%V@B%JqX=t4Vs%(XlPNPE}_7RW)9)$z4;{|@LY~!=5jTAzM-ld zAy~nRqCQrdRKS(eKp9Cw`XiH;pC21F)7kBwZ@1}iUq*vRGdet$(cw~7hZCF7&qP?1u>l~AC(DFBw0RjfFvAlgdu4S9Lod;caU6mU6aiOW-L`Gy8B zD`-}*=-8M!ydlZ{zAKDN7j`(V>=}?go6+E0N`q5r4dzoS3^c0{Yf-_Q(!iQfpt!D* z2`Lp>T4mTA0Ps5zYCMd$nsN*wJC~c6&t3nAb$cO~<10r#r8Dz}1U9$o@OWnkUN}2# zet9y(j(3G%sv`(PEh?;PRv{1%psh(kQE?zIi(Fm_&*j!iTuvd+vQG`=1Q1 zP~h@4H;PRPxUxDQ-P6Y|WOQ8WkMiHG^WwiY`0$rW74IKQW6df*ltjI(Fz8`MFmkyc zh)UF8#Obm8vyyo#AJMnRv`cY002ovPDHLkV1gX{@rnQd literal 0 HcmV?d00001 diff --git a/core/vocabs/loader/loader-docs.factor b/core/vocabs/loader/loader-docs.factor index 0224ec9450..033479f910 100755 --- a/core/vocabs/loader/loader-docs.factor +++ b/core/vocabs/loader/loader-docs.factor @@ -28,7 +28,12 @@ ARTICLE: "vocabs.roots" "Vocabulary roots" { $subsections "add-vocab-roots" } ; ARTICLE: "vocabs.icons" "Vocabulary icons" -"An icon file representing the vocabulary can be provided for use by " { $link "tools.deploy" } ". A file named " { $snippet "icon.ico" } " will be used as the application icon when the application is deployed on Windows, Linux or the *BSD. A file named " { $snippet "icon.icns" } " will be used when the application is deployed on MacOS X." ; +"An icon file representing the vocabulary can be provided for use by " { $link "tools.deploy" } ". If any of the following files exist inside the vocabulary directory, they will be used as icons when the application is deployed." +{ $list + { { $snippet "icon.ico" } " on Windows" } + { { $snippet "icon.icns" } " on MacOS X" } + { { $snippet "icon.png" } " on Linux and *BSD" } +} ; ARTICLE: "vocabs.loader" "Vocabulary loader" "The " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } " words load vocabularies using the vocabulary loader. The vocabulary loader is implemented in the " { $vocab-link "vocabs.loader" } " vocabulary." diff --git a/extra/hello-ui/deploy.factor b/extra/hello-ui/deploy.factor index ceff9857cb..cf851f5a95 100644 --- a/extra/hello-ui/deploy.factor +++ b/extra/hello-ui/deploy.factor @@ -5,7 +5,7 @@ H{ { deploy-c-types? f } { deploy-unicode? f } { "stop-after-last-window?" t } - { deploy-io 1 } + { deploy-io 2 } { deploy-reflection 1 } { deploy-word-props? f } { deploy-math? t } From 8c61b874b7c471ace734d0b2b87abdf2ae6b9ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Mon, 26 Jul 2010 21:11:53 +0200 Subject: [PATCH 31/41] ui.backend.gtk: load icon data directly into factor.image when deploying, no io is needed --- basis/gdk/pixbuf/ffi/ffi.factor | 13 ++++++- basis/images/gtk/gtk.factor | 23 ++++------- basis/tools/deploy/shaker/shaker.factor | 8 ++++ .../tools/deploy/shaker/strip-gtk-icon.factor | 13 +++++++ basis/tools/deploy/unix/unix.factor | 18 ++------- basis/ui/backend/gtk/gtk.factor | 36 +++++++++--------- basis/ui/backend/gtk/icon.png | Bin 7299 -> 0 bytes 7 files changed, 62 insertions(+), 49 deletions(-) create mode 100644 basis/tools/deploy/shaker/strip-gtk-icon.factor delete mode 100644 basis/ui/backend/gtk/icon.png diff --git a/basis/gdk/pixbuf/ffi/ffi.factor b/basis/gdk/pixbuf/ffi/ffi.factor index a87ca77c3b..38959c9004 100644 --- a/basis/gdk/pixbuf/ffi/ffi.factor +++ b/basis/gdk/pixbuf/ffi/ffi.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2009 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.libraries combinators kernel system -gobject-introspection gio.ffi glib.ffi gmodule.ffi gobject.ffi ; +USING: alien alien.data alien.libraries alien.syntax +combinators gio.ffi glib.ffi gmodule.ffi gobject-introspection +gobject.ffi kernel libc sequences system ; EXCLUDE: alien.c-types => pointer ; IN: gdk.pixbuf.ffi @@ -15,3 +16,11 @@ IN: gdk.pixbuf.ffi GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir +: data>GInputStream ( data -- GInputStream ) + [ malloc-byte-array &free ] [ length ] bi + f g_memory_input_stream_new_from_data ; + +: GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf ) + f { { pointer: GError initial: f } } + [ gdk_pixbuf_new_from_stream ] with-out-parameters + handle-GError ; diff --git a/basis/images/gtk/gtk.factor b/basis/images/gtk/gtk.factor index e08ac996ad..4957a4d216 100644 --- a/basis/images/gtk/gtk.factor +++ b/basis/images/gtk/gtk.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2010 Philipp Brüschweiler. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors alien.c-types alien.data alien.strings -alien.syntax arrays classes.struct combinators destructors -gdk.pixbuf.ffi gio.ffi glib.ffi gobject.ffi grouping images -images.loader io io.encodings.utf8 -kernel libc locals math sequences specialized-arrays ; +USING: accessors alien.c-types alien.data arrays combinators +destructors gdk.pixbuf.ffi gobject.ffi grouping images +images.loader io kernel locals math sequences +specialized-arrays ; IN: images.gtk SPECIALIZED-ARRAY: uchar @@ -20,15 +19,6 @@ SINGLETON: gtk-image GInputStream ( data -- GInputStream ) - [ malloc-byte-array &free ] [ length ] bi - f g_memory_input_stream_new_from_data &g_object_unref ; - -: GInputStream>GdkPixbuf ( GInputStream -- GdkPixbuf ) - f { { pointer: GError initial: f } } - [ gdk_pixbuf_new_from_stream ] with-out-parameters - handle-GError &g_object_unref ; - : image-data ( GdkPixbuf -- data ) { [ gdk_pixbuf_get_pixels ] @@ -72,6 +62,7 @@ PRIVATE> M: gtk-image stream>image drop [ - stream-contents data>GInputStream - GInputStream>GdkPixbuf GdkPixbuf>image + stream-contents data>GInputStream &g_object_unref + GInputStream>GdkPixbuf &g_object_unref + GdkPixbuf>image ] with-destructors ; diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 941b3e07f2..e74bfda3ce 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -93,6 +93,13 @@ IN: tools.deploy.shaker run-file ] when ; +: strip-gtk-icon ( -- ) + "ui.backend.gtk" vocab [ + "Stripping GTK icon loading code" show + "vocab:tools/deploy/shaker/strip-gtk-icon.factor" + run-file + ] when ; + : strip-specialized-arrays ( -- ) strip-dictionary? "specialized-arrays" vocab and [ "Stripping specialized arrays" show @@ -534,6 +541,7 @@ SYMBOL: deploy-vocab strip-destructors strip-call strip-cocoa + strip-gtk-icon strip-debugger strip-ui-error-hook strip-specialized-arrays diff --git a/basis/tools/deploy/shaker/strip-gtk-icon.factor b/basis/tools/deploy/shaker/strip-gtk-icon.factor new file mode 100644 index 0000000000..c472b3e020 --- /dev/null +++ b/basis/tools/deploy/shaker/strip-gtk-icon.factor @@ -0,0 +1,13 @@ +! Copyright (C) 2010 Philipp Brüschweiler +! See http://factorcode.org/license.txt for BSD license. +USING: kernel tools.deploy.shaker literals namespaces +vocabs.loader io.pathnames io.files io.encodings.binary ; +IN: ui.backend.gtk + +CONSTANT: get-icon-data + $[ + deploy-vocab get + dup vocab-dir "icon.png" append-path vocab-append-path + [ exists? ] keep "resource:misc/icons/Factor_48x48.png" ? + binary file-contents + ] diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index ba7dd4d95e..95abb0d875 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -1,22 +1,12 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: io io.backend io.directories io.files io.files.info.unix -io.pathnames kernel namespaces sequences system -tools.deploy.backend tools.deploy.config -tools.deploy.config.editor vocabs.loader vocabs.metadata ; +USING: io io.backend io.directories io.files.info.unix kernel +namespaces sequences system tools.deploy.backend +tools.deploy.config tools.deploy.config.editor ; IN: tools.deploy.unix -: used-icon ( vocab -- ico ) - dup vocab-dir "icon.png" append-path vocab-append-path - [ exists? ] keep "vocab:ui/backend/gtk/icon.png" ? ; - -: copy-icon ( vocab bundle-name -- ) - [ used-icon ] - [ "ui/backend/gtk/icon.png" append-path ] bi* - copy-file ; - : create-app-dir ( vocab bundle-name -- vm ) - [ copy-vm ] [ copy-icon ] 2bi + copy-vm dup OCT: 755 set-file-permissions ; : bundle-name ( -- str ) diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index da74a40a88..c5b1ff9eeb 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -1,16 +1,17 @@ ! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien.accessors alien.c-types alien.data -alien.strings alien.syntax arrays assocs classes.struct -command-line destructors gdk.ffi gdk.gl.ffi glib.ffi +alien.strings arrays assocs classes.struct command-line +destructors gdk.ffi gdk.gl.ffi gdk.pixbuf.ffi glib.ffi gobject.ffi gtk.ffi gtk.gl.ffi io.backend -io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel -libc literals locals math math.bitwise math.order math.vectors -namespaces sequences strings system threads ui ui.backend -ui.clipboards ui.commands ui.event-loop ui.gadgets -ui.gadgets.editors ui.gadgets.menus ui.gadgets.private -ui.gadgets.worlds ui.gestures ui.pixel-formats -ui.pixel-formats.private ui.private ; +io.backend.unix.multiplexers io.encodings.binary +io.encodings.utf8 io.files io.thread kernel libc literals +locals math math.bitwise math.order math.vectors namespaces +sequences strings system threads ui ui.backend ui.clipboards +ui.commands ui.event-loop ui.gadgets ui.gadgets.editors +ui.gadgets.menus ui.gadgets.private ui.gadgets.worlds +ui.gestures ui.pixel-formats ui.pixel-formats.private +ui.private ; IN: ui.backend.gtk SINGLETON: gtk-ui-backend @@ -268,15 +269,16 @@ SYMBOL: next-timeout f g_source_attach drop nano-count next-timeout set-global ; +! This word gets replaced when deploying. See 'Vocabulary icons' +! in the docs and tools.deploy.shaker.gtk-icon +: get-icon-data ( -- byte-array ) + "resource:misc/icons/Factor_48x48.png" binary file-contents ; + : load-icon ( -- ) - ! This file is not in a resource.txt because it can be - ! overwritten when deploying. See 'Vocabulary icons' - ! in the docs. - "vocab:ui/backend/gtk/icon.png" - normalize-path utf8 string>alien - { { pointer: GError initial: f } } - [ gtk_window_set_default_icon_from_file ] with-out-parameters - handle-GError drop ; + get-icon-data [ + data>GInputStream &g_object_unref + GInputStream>GdkPixbuf gtk_window_set_default_icon + ] with-destructors ; M: gtk-ui-backend (with-ui) [ diff --git a/basis/ui/backend/gtk/icon.png b/basis/ui/backend/gtk/icon.png deleted file mode 100644 index a1da637d2100932d651e0dfb10d5212c869f8116..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7299 zcmV-}9DL)6P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKv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qt22;R_u>c&JT> zkGAPB+usPAN0Zo_(jb~tpr$E+RV^x5vKkcnokIRQ*8J<*NF$e9VFg1?g}`EdW=bef z-mHQzr9rq^g_evCYX@Vnce=~;oAWdFt3z>ktW|?2+I0AbjvzeqD)1*VIy}&(!}+WZ zN85Cm%V@B%JqX=t4Vs%(XlPNPE}_7RW)9)$z4;{|@LY~!=5jTAzM-ld zAy~nRqCQrdRKS(eKp9Cw`XiH;pC21F)7kBwZ@1}iUq*vRGdet$(cw~7hZCF7&qP?1u>l~AC(DFBw0RjfFvAlgdu4S9Lod;caU6mU6aiOW-L`Gy8B zD`-}*=-8M!ydlZ{zAKDN7j`(V>=}?go6+E0N`q5r4dzoS3^c0{Yf-_Q(!iQfpt!D* z2`Lp>T4mTA0Ps5zYCMd$nsN*wJC~c6&t3nAb$cO~<10r#r8Dz}1U9$o@OWnkUN}2# zet9y(j(3G%sv`(PEh?;PRv{1%psh(kQE?zIi(Fm_&*j!iTuvd+vQG`=1Q1 zP~h@4H;PRPxUxDQ-P6Y|WOQ8WkMiHG^WwiY`0$rW74IKQW6df*ltjI(Fz8`MFmkyc zh)UF8#Obm8vyyo#AJMnRv`cY002ovPDHLkV1gX{@rnQd From 72f7bced2bd7b4c4cc1540d45c27852ce58b178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sat, 31 Jul 2010 20:27:24 +0200 Subject: [PATCH 32/41] images.gdiplus: add platform.txt --- basis/images/gdiplus/platforms.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 basis/images/gdiplus/platforms.txt diff --git a/basis/images/gdiplus/platforms.txt b/basis/images/gdiplus/platforms.txt new file mode 100644 index 0000000000..8e1a55995e --- /dev/null +++ b/basis/images/gdiplus/platforms.txt @@ -0,0 +1 @@ +windows From 4c7a88c8a40306ee97957863e76423916991ad3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sat, 31 Jul 2010 20:34:15 +0200 Subject: [PATCH 33/41] images: fix some tests that broke due to an additional slot in image --- basis/images/images-tests.factor | 4 ++-- .../tesselation/tesselation-tests.factor | 16 ++++++++-------- extra/images/testing/bmp/42red_24bit.fig | Bin 5179 -> 5180 bytes extra/images/testing/bmp/rgb_8bit.fig | Bin 30059 -> 30060 bytes extra/images/testing/gif/alpha.fig | Bin 74 -> 75 bytes .../testing/gif/astronaut_animation.fig | Bin 7132 -> 7133 bytes extra/images/testing/gif/checkmark.fig | Bin 3540 -> 3541 bytes extra/images/testing/gif/circle.fig | Bin 460 -> 461 bytes extra/images/testing/gif/monochrome.fig | Bin 203 -> 204 bytes extra/images/testing/gif/noise.fig | Bin 65599 -> 65600 bytes extra/images/testing/pbm/test.ascii.fig | Bin 25659 -> 25660 bytes extra/images/testing/pbm/test.binary.fig | Bin 25659 -> 25660 bytes extra/images/testing/pgm/radial.ascii.fig | Bin 16443 -> 16444 bytes extra/images/testing/pgm/radial.binary.fig | Bin 16443 -> 16444 bytes extra/images/testing/png/basn2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/basn6a08.fig | Bin 4156 -> 4157 bytes extra/images/testing/png/f00n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/f01n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/f02n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/f03n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/f04n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/z00n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/z03n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/z06n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/png/z09n2c08.fig | Bin 3131 -> 3132 bytes extra/images/testing/ppm/ascii.fig | Bin 57660 -> 57661 bytes extra/images/testing/ppm/binary.fig | Bin 57660 -> 57661 bytes extra/images/testing/tiff/alpha.fig | Bin 74 -> 75 bytes extra/images/testing/tiff/color_spectrum.fig | Bin 117567 -> 117568 bytes extra/images/testing/tiff/noise.fig | Bin 49213 -> 49214 bytes extra/images/testing/tiff/octagon.fig | Bin 4156 -> 4157 bytes extra/images/testing/tiff/rgb.fig | Bin 268899 -> 268900 bytes extra/model-viewer/model-viewer.factor | 14 ++++++++++---- 33 files changed, 20 insertions(+), 14 deletions(-) diff --git a/basis/images/images-tests.factor b/basis/images/images-tests.factor index ff49834a65..1fda9b3b81 100644 --- a/basis/images/images-tests.factor +++ b/basis/images/images-tests.factor @@ -3,7 +3,7 @@ USING: images tools.test kernel accessors ; IN: images.tests -[ B{ 57 57 57 255 } ] [ 1 1 T{ image f { 2 3 } RGBA ubyte-components f B{ +[ B{ 57 57 57 255 } ] [ 1 1 T{ image f { 2 3 } RGBA ubyte-components f f B{ 0 0 0 0 0 0 0 0 0 0 0 0 @@ -19,7 +19,7 @@ IN: images.tests 57 57 57 255 0 0 0 0 0 0 0 0 -} ] [ B{ 57 57 57 255 } 1 1 T{ image f { 2 3 } RGBA ubyte-components f B{ +} ] [ B{ 57 57 57 255 } 1 1 T{ image f { 2 3 } RGBA ubyte-components f f B{ 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/basis/images/tesselation/tesselation-tests.factor b/basis/images/tesselation/tesselation-tests.factor index 9db58649a0..5999c15d5c 100644 --- a/basis/images/tesselation/tesselation-tests.factor +++ b/basis/images/tesselation/tesselation-tests.factor @@ -10,12 +10,12 @@ IN: images.tesselation [ { { - T{ image f { 2 2 } L ubyte-components f B{ 1 2 5 6 } } - T{ image f { 2 2 } L ubyte-components f B{ 3 4 7 8 } } + T{ image f { 2 2 } L ubyte-components f f B{ 1 2 5 6 } } + T{ image f { 2 2 } L ubyte-components f f B{ 3 4 7 8 } } } { - T{ image f { 2 2 } L ubyte-components f B{ 9 10 13 14 } } - T{ image f { 2 2 } L ubyte-components f B{ 11 12 15 16 } } + T{ image f { 2 2 } L ubyte-components f f B{ 9 10 13 14 } } + T{ image f { 2 2 } L ubyte-components f f B{ 11 12 15 16 } } } } ] [ @@ -30,12 +30,12 @@ IN: images.tesselation [ { { - T{ image f { 2 2 } L ubyte-components f B{ 1 2 4 5 } } - T{ image f { 1 2 } L ubyte-components f B{ 3 6 } } + T{ image f { 2 2 } L ubyte-components f f B{ 1 2 4 5 } } + T{ image f { 1 2 } L ubyte-components f f B{ 3 6 } } } { - T{ image f { 2 1 } L ubyte-components f B{ 7 8 } } - T{ image f { 1 1 } L ubyte-components f B{ 9 } } + T{ image f { 2 1 } L ubyte-components f f B{ 7 8 } } + T{ image f { 1 1 } L ubyte-components f f B{ 9 } } } } ] [ diff --git a/extra/images/testing/bmp/42red_24bit.fig b/extra/images/testing/bmp/42red_24bit.fig index 9c2ce17edbc877ef4b7117ca90e7b980b2c30800..4616f0dce28c8f1a3ac7368bf5aaed56df4f8fe9 100644 GIT binary patch delta 112 zcmdn3u}4EVq`bH_GdD3kwYUvJCALizR$<9=WD=R&$YwDyztT{0tZ1Oq2oXH>9y(WL)iJKUZ vHTeu*9*8?JKz4FI58LDf?no#t4OFQM#72|iOmnxMHnYP;N+j2 Vz#23;fTe2k22TFX+nKf$0RXPL8Q%Z^ delta 72 zcmaF!it+U;M&Xe1;?~UE#PrnSHVBp2I#F1K#gVDhV6q@{+T;xaJd+FfI5$7A6Jwmb ZUO;}bf#}}J4kA30cQbKr-p91A2mlU=8sh)} diff --git a/extra/images/testing/gif/alpha.fig b/extra/images/testing/gif/alpha.fig index b36a8f6666f5776bedf5ff9a0d10cc4dc9e8e3a8..46dc59425a47efd97e17eecd6255b49c615da96d 100644 GIT binary patch delta 45 ncmebB77i&dZq3Y1OiwLtgHVZW6NOcU^BgDqXJ7y#2mrAGbLI}* delta 44 mcmebF5)LUZZq3Y1OiwLtgHVaB6NOcU94Gu|U;rWr0I>mK@(yeO diff --git a/extra/images/testing/gif/astronaut_animation.fig b/extra/images/testing/gif/astronaut_animation.fig index 905da6d827a7f7ec2e0828a8fe14fe0acfae5ffa..88e8e9bd18c463aa884f4f85e79adde150831813 100644 GIT binary patch delta 40 rcmca(e%D+$q`bH_GdD3kwYUvJCALizR%Oj|WRhMmu~B1VN`*84Pzn!o delta 39 qcmca>e#cxmq`bH_GdD3kwYUvJCALl!R%LNyl3pHq)$ delta 40 rcmcaAeMMS0q`bH_GdD3kwYUvJCALl!R%LNy;+-*BkvC=ILK9v9Kur#N diff --git a/extra/images/testing/gif/circle.fig b/extra/images/testing/gif/circle.fig index 330397f7d72a0e59d5907fb2875061af67a5ad55..9f291efb331dbacdf8cd232241892636d4135006 100644 GIT binary patch delta 31 icmX@Ze3n@_q`bH_GdD3kwYUvJCALizR^4bml@S2N>I@bD diff --git a/extra/images/testing/gif/monochrome.fig b/extra/images/testing/gif/monochrome.fig index 69de84564eefd3e015bece2d117f1ad565a7fe31..3c03fe22c395e925ac32f59ca414227cbd5bb4e0 100644 GIT binary patch delta 30 hcmX@jc!p6pq`bH_GdD3kwYUvJCALizR-I@*1pv6q3+?~_ delta 40 rcmX@Zc$!f-q`bH_GdD3kwYUvJCALl!R%Lc%oG{T*cwzv{#NbK*I3^B_ diff --git a/extra/images/testing/gif/noise.fig b/extra/images/testing/gif/noise.fig index a2650e971fd0d6a6ff7d38028db8c75aaef37edf..c4d6aa43c70d9388b97a40c685ea347ea1043bc8 100644 GIT binary patch delta 35 mcmdnrz;d90ML49qxHU63F+H`o4MHWhO%zsdw47?m$OZuYf(;P> delta 35 mcmX@mz_P!AML49qxHU63F+H`o4MHWhP83#ew4Q3s$O-`ciVYJ0 diff --git a/extra/images/testing/pbm/test.ascii.fig b/extra/images/testing/pbm/test.ascii.fig index aee805ec6985a325ad215ee428ef13f16dc889c4..ae2174290a1f588929883556220b9a992c093168 100644 GIT binary patch delta 115 zcmdmef^p9YM&Xe1;?~UE#PrnSHVBp2Hc?oGCC`y5W%9-7?uiNflRvn-PE3fJ#4k8G gATVWOg7zeSAqYzo&H{=dWHDGella*eTeHRk02uNr4FCWD delta 110 zcmdmUf^qi=M&Xe1;?~UE#PrnSHVBp2I#F1K*^wz_vS4iQfUu?q~4*-TQD;EF& diff --git a/extra/images/testing/pbm/test.binary.fig b/extra/images/testing/pbm/test.binary.fig index aee805ec6985a325ad215ee428ef13f16dc889c4..ae2174290a1f588929883556220b9a992c093168 100644 GIT binary patch delta 115 zcmdmef^p9YM&Xe1;?~UE#PrnSHVBp2Hc?oGCC`y5W%9-7?uiNflRvn-PE3fJ#4k8G gATVWOg7zeSAqYzo&H{=dWHDGella*eTeHRk02uNr4FCWD delta 110 zcmdmUf^qi=M&Xe1;?~UE#PrnSHVBp2I#F1K*^wz_vS4iQfUu?q~4*-TQD;EF& diff --git a/extra/images/testing/pgm/radial.ascii.fig b/extra/images/testing/pgm/radial.ascii.fig index 6e52311b94202145e080cf8f4dc7794d43490754..4fce1e636cb0cd0ef0f0babfe362afc623dd2c7d 100644 GIT binary patch delta 33 kcmdnpz__P@Q8=W$xHU63F+H`o4MHWhO%ztyXvXRQ0O3dsod5s; delta 33 kcmdnfz_`1CQ8=W$xHU63F+H`o4MHWhP83$zXu;wD0O3arod5s; diff --git a/extra/images/testing/pgm/radial.binary.fig b/extra/images/testing/pgm/radial.binary.fig index 6e52311b94202145e080cf8f4dc7794d43490754..4fce1e636cb0cd0ef0f0babfe362afc623dd2c7d 100644 GIT binary patch delta 33 kcmdnpz__P@Q8=W$xHU63F+H`o4MHWhO%ztyXvXRQ0O3dsod5s; delta 33 kcmdnfz_`1CQ8=W$xHU63F+H`o4MHWhP83$zXu;wD0O3arod5s; diff --git a/extra/images/testing/png/basn2c08.fig b/extra/images/testing/png/basn2c08.fig index 84f8c97b931b3cca7e8b88467380408d08dda514..655695610dfa983adc491f004ace769e81901b0b 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/basn6a08.fig b/extra/images/testing/png/basn6a08.fig index f188879876599d23890b964b0ea157f64c3b2d72..723e1b419230711f140db00ddaeaac38afe262f3 100644 GIT binary patch delta 31 icmdm^uvbAiq`bH_GdD3kwYUvJCALizR^4dMDgXe-tqZRJ delta 31 icmdn1utz~Sq`bH_GdD3kwYUvJCALl!R^4dHA^-r#s|&9H diff --git a/extra/images/testing/png/f00n2c08.fig b/extra/images/testing/png/f00n2c08.fig index 6a6aef9b0f9e6e1b8bd1bdc2c056395598894bdf..f2e7a981ba7a531617a50e649dba523706b4612f 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/f01n2c08.fig b/extra/images/testing/png/f01n2c08.fig index f08c0bbee3f8c6dc780e90a61657632ce012aac0..097a24a849648ee426419091b14f3061fdd04111 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/f02n2c08.fig b/extra/images/testing/png/f02n2c08.fig index 722f02a5ff03d74adb5191a4216f60132287d19e..3a6a60106a1787bb6d73d8ec589be2be5c07bbf8 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/f03n2c08.fig b/extra/images/testing/png/f03n2c08.fig index 2a37fe6c7bd9e7ddd17da74a950be5446eff9ea6..ae91abddb729b22eebb1e56e4152e0a8c062cc5d 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/f04n2c08.fig b/extra/images/testing/png/f04n2c08.fig index c0db771fa4c96be556e71fefbac36107943cf1d8..8116a4554290310083615016b870b950db00492a 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/z00n2c08.fig b/extra/images/testing/png/z00n2c08.fig index 9d171e68b750d75b3cf68ee47b1f8a147470d381..79e5991dbb03ff5b93575061db2fbd447468382e 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/z03n2c08.fig b/extra/images/testing/png/z03n2c08.fig index 9d171e68b750d75b3cf68ee47b1f8a147470d381..79e5991dbb03ff5b93575061db2fbd447468382e 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/z06n2c08.fig b/extra/images/testing/png/z06n2c08.fig index 9d171e68b750d75b3cf68ee47b1f8a147470d381..79e5991dbb03ff5b93575061db2fbd447468382e 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/png/z09n2c08.fig b/extra/images/testing/png/z09n2c08.fig index 9d171e68b750d75b3cf68ee47b1f8a147470d381..79e5991dbb03ff5b93575061db2fbd447468382e 100644 GIT binary patch delta 31 icmdlju}4BUq`bH_GdD3kwYUvJCALizR@rFA$^!t!l?#^u delta 31 icmdlZv0Fkoq`bH_GdD3kwYUvJCALl!R@rF5!UF)slM9ys diff --git a/extra/images/testing/ppm/ascii.fig b/extra/images/testing/ppm/ascii.fig index 68a1fa1ac10fd7c8dcdddb7407527bd327f83baf..9f95883c38bbeb57b2d265a2a8d8f0fc19a4d6ec 100644 GIT binary patch delta 65 zcmdmUhmK@(yeO diff --git a/extra/images/testing/tiff/color_spectrum.fig b/extra/images/testing/tiff/color_spectrum.fig index 7050c13f6c865f9d2b28589742cfe2faa119e2e6..5213f8d30ed7420c0d9cddb4f1818c6ede934ca9 100644 GIT binary patch delta 48 zcmdl#js3thcHxln;?~UE#PrnSHVBp2Hc?oeHP4Zm@$^Q=djiceg4<;T8I^Yd0M6wR Ai2wiq delta 47 zcmX>wjeY+#cHxln;?~UE#PrnSHVBp2I#F1i#gUou^hU?~0?l%Q+vNlqm39FDyKWI3 diff --git a/extra/images/testing/tiff/noise.fig b/extra/images/testing/tiff/noise.fig index dd582aaef329e1c2962f815148dce85dcda02823..e207120c9dfd334e8ad4430e34c515e11a42ce40 100644 GIT binary patch delta 33 kcmdnnz`U=4SvaJ;xHU63F+H`o4MHWhO%zt!Xu)~_0OHIIDF6Tf delta 33 kcmdnjz`VDCSvaJ;xHU63F+H`o4MHWhP83$#XvJ~>0OHFHDF6Tf diff --git a/extra/images/testing/tiff/octagon.fig b/extra/images/testing/tiff/octagon.fig index 0b66c62662120287e7c6ff5de4b3c356a8ee3b81..9273f3edaa5459e6c41677b70f297574206ed1c9 100644 GIT binary patch delta 40 rcmdm^uvbAiq`bH_GdD3kwYUvJCALizR%OX^WD=OH&!@UE;SN6lIo}Rw delta 39 qcmdn1utz~Sq`bH_GdD3kwYUvJCALl!R%Lc%5}0hjr@Arm4nF`X@eTR_ diff --git a/extra/images/testing/tiff/rgb.fig b/extra/images/testing/tiff/rgb.fig index c09b1cd10e2b21e1e543015c5f6e5b33e0c699eb..8fb52821ff0b4ed74ee2158673f8c7c74b73617d 100644 GIT binary patch delta 45 wcmaF7Mc~O60pXDH;?~UE#PrnSHVBp2Hc?o;(X!Q&vDK2P)slIuC5x660JAU + { 1 1 } >>dim + BGR >>component-order + ubyte-components >>component-type + B{ 255 255 255 } >>bitmap ; : up-image ( -- image ) - { 1 1 } BGR ubyte-components f - B{ 0 0 0 } image boa ; + + { 1 1 } >>dim + BGR >>component-order + ubyte-components >>component-type + B{ 0 0 0 } >>bitmap ; : make-texture ( pathname alt -- texture ) swap [ nip load-image ] [ ] if* From a820c1091d93c906daab218b1599241bee52afe7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 27 Aug 2011 13:48:30 -0700 Subject: [PATCH 34/41] alien: merge enum improvements from Blei/gtk-image-loader --- basis/alien/enums/enums-tests.factor | 16 ++++++++++++++++ basis/alien/enums/enums.factor | 17 +++++++++-------- basis/alien/parser/parser.factor | 5 +++-- basis/alien/syntax/syntax.factor | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/basis/alien/enums/enums-tests.factor b/basis/alien/enums/enums-tests.factor index f0c665830d..a7fd665e13 100644 --- a/basis/alien/enums/enums-tests.factor +++ b/basis/alien/enums/enums-tests.factor @@ -33,3 +33,19 @@ ENUM: instrument_t < ushort trombone trumpet ; { V{ { red 0 } { green 3 } { blue 4 } } } [ color_t "c-type" word-prop members>> ] unit-test + +ENUM: colores { rojo red } { verde green } { azul blue } { colorado rojo } ; + +[ { 0 3 4 0 } ] [ { rojo verde azul colorado } [ enum>number ] map ] unit-test + +SYMBOLS: couleurs rouge vert bleu jaune azure ; + +<< \ couleurs int { + { rouge red } + { vert green } + { bleu blue } + { jaune 14 } + { azure bleu } +} define-enum >> + +[ { 0 3 4 14 4 } ] [ { rouge vert bleu jaune azure } [ enum>number ] map ] unit-test diff --git a/basis/alien/enums/enums.factor b/basis/alien/enums/enums.factor index b0755c130b..5634805f5d 100644 --- a/basis/alien/enums/enums.factor +++ b/basis/alien/enums/enums.factor @@ -30,16 +30,13 @@ M: enum-c-type c-type-unboxer-quot drop [ enum>number ] ; M: enum-c-type c-type-setter [ enum>number ] swap base-type>> c-type-setter '[ _ 2dip @ ] ; +: define-enum-value ( class value -- ) + enum>number "enum-value" set-word-prop ; + > "<" ">" surround create-in ] keep @@ -47,10 +44,14 @@ M: enum-c-type c-type-setter PRIVATE> -: define-enum ( word base-type members -- ) +: (define-enum) ( word base-type members -- ) [ dup define-enum-constructor ] 2dip [ define-enum-members ] [ swap typedef ] bi ; + +: define-enum ( word base-type members -- ) + [ (define-enum) ] + [ [ define-enum-value ] assoc-each ] bi ; PREDICATE: enum-c-type-word < c-type-word "c-type" word-prop enum-c-type? ; diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index 6d0cbb79cc..09fedc5e3c 100755 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -4,7 +4,7 @@ USING: accessors alien alien.c-types alien.libraries arrays assocs classes combinators combinators.short-circuit compiler.units effects grouping kernel parser sequences splitting words fry locals lexer namespaces summary math -vocabs.parser words.constant classes.parser ; +vocabs.parser words.constant classes.parser alien.enums ; IN: alien.parser SYMBOL: current-library @@ -84,7 +84,8 @@ M: pointer return-type-name to>> return-type-name CHAR: * suffix ; [ [ ] dip parse-pointers ] when ; : next-enum-member ( members name value -- members value' ) - [ 2array suffix! ] [ 1 + ] bi ; + [ define-enum-value ] + [ [ 2array suffix! ] [ enum>number 1 + ] bi ] 2bi ; : parse-enum-name ( -- name ) scan (CREATE-C-TYPE) dup save-location ; diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index 259f99a833..fe5a6dcadc 100755 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -29,7 +29,7 @@ SYNTAX: TYPEDEF: scan-c-type CREATE-C-TYPE dup save-location typedef ; SYNTAX: ENUM: - parse-enum define-enum ; + parse-enum (define-enum) ; SYNTAX: C-TYPE: void CREATE-C-TYPE typedef ; From 3616f932508856a576acb0ebeaade8f241d95756 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 27 Aug 2011 13:52:20 -0700 Subject: [PATCH 35/41] windows: merge library manifest from old windows.nt in Blei/gtk-image-loader --- basis/windows/windows.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/windows/windows.factor b/basis/windows/windows.factor index 4996d55f2e..f3bf040bcb 100644 --- a/basis/windows/windows.factor +++ b/basis/windows/windows.factor @@ -17,6 +17,7 @@ CONSTANT: MAX_UNICODE_PATH 32768 { "iphlpapi" "iphlpapi.dll" stdcall } { "libc" "msvcrt.dll" cdecl } { "libm" "msvcrt.dll" cdecl } + { "gdiplus" "gdiplus.dll" stdcall } { "gl" "opengl32.dll" stdcall } { "glu" "glu32.dll" stdcall } { "ole32" "ole32.dll" stdcall } From 39b00a1b39c14d99a00f28e87c3daa6ebc8ab108 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 14:08:54 -0700 Subject: [PATCH 36/41] graphviz.ffi: refactor it to not make FFI calls at parse time --- extra/graphviz/ffi/ffi.factor | 18 +++--------------- extra/graphviz/render/render.factor | 20 ++++++++------------ 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/extra/graphviz/ffi/ffi.factor b/extra/graphviz/ffi/ffi.factor index 2ec65cf7ca..50fccf0a1f 100644 --- a/extra/graphviz/ffi/ffi.factor +++ b/extra/graphviz/ffi/ffi.factor @@ -3,12 +3,9 @@ USING: accessors alien alien.c-types alien.destructors alien.libraries alien.syntax combinators debugger destructors fry io kernel literals math prettyprint sequences splitting -system words.constant -graphviz -; +system memoize graphviz ; IN: graphviz.ffi -<< "libgraph" { { [ os macosx? ] [ "libgraph.dylib" ] } { [ os unix? ] [ "libgraph.so" ] } @@ -21,7 +18,6 @@ IN: graphviz.ffi { [ os unix? ] [ "libgvc.so" ] } { [ os winnt? ] [ "gvc.dll" ] } } cond cdecl add-library ->> LIBRARY: libgraph @@ -85,11 +81,7 @@ FUNCTION: int agsafeset ( void* obj, LIBRARY: libgvc ! Graphviz contexts -! This must be wrapped in << >> so that GVC_t*, gvContext, and -! &gvFreeContext can be used to compute the supported-engines -! and supported-formats constants below. -<< C-TYPE: GVC_t FUNCTION: GVC_t* gvContext ( ) ; @@ -112,7 +104,6 @@ M: ffi-errors error. int-gvFreeContext dup zero? [ drop ] [ ffi-errors ] if ; DESTRUCTOR: gvFreeContext ->> ! Layout @@ -130,8 +121,6 @@ FUNCTION: int gvRenderFilename ( GVC_t* gvc, ! Supported layout engines (dot, neato, etc.) and output ! formats (png, jpg, etc.) - -<< ->> -CONSTANT: supported-engines $[ API_layout plugin-list ] -CONSTANT: supported-formats $[ API_device plugin-list ] +MEMO: supported-engines ( -- seq ) API_layout plugin-list ; +MEMO: supported-formats ( -- seq ) API_device plugin-list ; diff --git a/extra/graphviz/render/render.factor b/extra/graphviz/render/render.factor index 0fd17a68b3..76857b1b85 100644 --- a/extra/graphviz/render/render.factor +++ b/extra/graphviz/render/render.factor @@ -1,11 +1,9 @@ ! Copyright (C) 2011 Alex Vondrak. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors combinators continuations destructors -images.viewer io.backend io.files.unique kernel locals -namespaces parser sequences summary unicode.case words -graphviz.ffi -graphviz.builder -; +USING: accessors combinators compiler.units continuations +destructors images.viewer io.backend io.files.unique kernel +locals namespaces parser sequences summary unicode.case words +graphviz.ffi graphviz.builder ; IN: graphviz.render SYMBOL: default-layout @@ -109,8 +107,6 @@ PRIVATE> : preview-window ( graph -- ) (preview) image-window ; inline -<< - PRIVATE> -supported-engines [ define-graphviz-by-engine ] each -supported-formats [ define-graphviz-by-format ] each - ->> +[ + supported-engines [ define-graphviz-by-engine ] each + supported-formats [ define-graphviz-by-format ] each +] with-compilation-unit From 385a51b3ef9e1e56b67d15b154181ca493c231be Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 16:44:48 -0700 Subject: [PATCH 37/41] Fixes #35 - -1 should throw an error --- basis/bit-arrays/bit-arrays-tests.factor | 2 ++ basis/bit-arrays/bit-arrays.factor | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/basis/bit-arrays/bit-arrays-tests.factor b/basis/bit-arrays/bit-arrays-tests.factor index 46089e3f7b..3e9daa291d 100644 --- a/basis/bit-arrays/bit-arrays-tests.factor +++ b/basis/bit-arrays/bit-arrays-tests.factor @@ -2,6 +2,8 @@ USING: alien sequences sequences.private arrays bit-arrays kernel tools.test math random ; IN: bit-arrays.tests +[ -1 ] [ T{ bad-array-length f -1 } = ] must-fail-with + [ 100 ] [ 100 length ] unit-test [ diff --git a/basis/bit-arrays/bit-arrays.factor b/basis/bit-arrays/bit-arrays.factor index ade7d8ddac..6097bed4f9 100644 --- a/basis/bit-arrays/bit-arrays.factor +++ b/basis/bit-arrays/bit-arrays.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2007, 2010 Slava Pestov. +! Copyright (C) 2007, 2011 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.data accessors io.binary math math.bitwise alien.accessors kernel kernel.private sequences @@ -41,8 +41,12 @@ TUPLE: bit-array PRIVATE> +ERROR: bad-array-length n ; + : ( n -- bit-array ) - dup bits>bytes bit-array boa ; inline + dup 0 < [ bad-array-length ] when + dup bits>bytes + bit-array boa ; inline M: bit-array length length>> ; inline From 48dfa97f97c6936d14f0dca5a1be1cd2428eee0d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 16:44:59 -0700 Subject: [PATCH 38/41] nibble-arrays: -1 should throw an error --- basis/nibble-arrays/nibble-arrays-tests.factor | 2 ++ basis/nibble-arrays/nibble-arrays.factor | 3 +++ 2 files changed, 5 insertions(+) diff --git a/basis/nibble-arrays/nibble-arrays-tests.factor b/basis/nibble-arrays/nibble-arrays-tests.factor index 363f30678d..92a38e509b 100644 --- a/basis/nibble-arrays/nibble-arrays-tests.factor +++ b/basis/nibble-arrays/nibble-arrays-tests.factor @@ -1,6 +1,8 @@ USING: nibble-arrays tools.test sequences kernel math ; IN: nibble-arrays.tests +[ -1 ] [ T{ bad-array-length f -1 } = ] must-fail-with + [ t ] [ 16 iota dup >nibble-array sequence= ] unit-test [ N{ 4 2 1 3 } ] [ N{ 3 1 2 4 } reverse ] unit-test [ N{ 1 4 9 0 9 4 } ] [ N{ 1 2 3 4 5 6 } [ sq ] map ] unit-test diff --git a/basis/nibble-arrays/nibble-arrays.factor b/basis/nibble-arrays/nibble-arrays.factor index 712b62f20b..0e7298165c 100644 --- a/basis/nibble-arrays/nibble-arrays.factor +++ b/basis/nibble-arrays/nibble-arrays.factor @@ -30,7 +30,10 @@ CONSTANT: nibble BIN: 1111 PRIVATE> +ERROR: bad-array-length n ; + : ( n -- nibble-array ) + dup 0 < [ bad-array-length ] when dup nibbles>bytes nibble-array boa ; inline M: nibble-array length length>> ; From 1f4da36b4bb82a9a5294bcbefc4139c46357eaf9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 17:06:41 -0700 Subject: [PATCH 39/41] Fixes #32 - double clicks were not handled properly in ui.backend.gtk --- basis/ui/backend/gtk/gtk.factor | 55 +++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index db316120c4..fe2732fb9f 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -160,9 +160,6 @@ CONSTANT: action-key-codes { $ GDK_SCROLL_RIGHT { 1 0 } } } at ; -: mouse-event>gesture ( event -- modifiers button loc ) - [ event-modifiers ] [ button>> ] [ event-loc ] tri ; - : on-motion ( win event user-data -- ? ) drop swap [ event-loc ] dip window @@ -173,23 +170,33 @@ CONSTANT: action-key-codes :: on-button-press ( win event user-data -- ? ) win window :> world - event mouse-event>gesture :> ( modifiers button loc ) - button { - { 8 [ ] } - { 9 [ ] } - [ modifiers swap loc world - send-button-down ] - } case t ; + event type>> GDK_BUTTON_PRESS = [ + event button>> { + { 8 [ ] } + { 9 [ ] } + [ + event event-modifiers swap + event event-loc + world + send-button-down + ] + } case + ] when t ; :: on-button-release ( win event user-data -- ? ) win window :> world - event mouse-event>gesture :> ( modifiers button loc ) - button { - { 8 [ world left-action send-action ] } - { 9 [ world right-action send-action ] } - [ modifiers swap loc world - send-button-up ] - } case t ; + event type>> GDK_BUTTON_RELEASE = [ + event button>> { + { 8 [ world left-action send-action ] } + { 9 [ world right-action send-action ] } + [ + event event-modifiers swap + event event-loc + world + send-button-up + ] + } case + ] when t ; : on-scroll ( win event user-data -- ? ) drop swap [ @@ -202,7 +209,7 @@ CONSTANT: action-key-codes : key-event>gesture ( event -- mods sym/f action? ) [ event-modifiers ] [ key-sym ] bi ; - + : on-key-press ( win event user-data -- ? ) drop swap [ key-event>gesture ] [ window ] bi* propagate-key-gesture t ; @@ -318,7 +325,7 @@ CONSTANT: action-key-codes :: configure-im ( win im -- ) im win gtk_widget_get_window gtk_im_context_set_client_window im f gtk_im_context_set_use_preedit - + im "commit" [ on-commit yield ] GtkIMContext:commit win connect-signal-with-data im "retrieve-surrounding" [ on-retrieve-surrounding yield ] @@ -349,7 +356,7 @@ CONSTANT: window-controls>decor-flags { normal-title-bar $ GDK_DECOR_TITLE } { textured-background 0 } } - + CONSTANT: window-controls>func-flags H{ { close-button $ GDK_FUNC_CLOSE } @@ -444,18 +451,18 @@ M:: gtk-ui-backend (open-window) ( world -- ) win im world handle<< world win register-window - + win world [ window-loc>> auto-position ] [ dim>> first2 gtk_window_set_default_size ] 2bi win "factor" "Factor" [ utf8 string>alien ] bi@ gtk_window_set_wmclass - + world configure-gl win gtk_widget_realize win world window-controls>> configure-window-controls - + win im configure-im win connect-user-input-signals win connect-win-state-signals @@ -478,7 +485,7 @@ M: gtk-ui-backend (set-fullscreen) M: gtk-ui-backend (fullscreen?) handle>> fullscreen?>> ; - + M: gtk-ui-backend raise-window* handle>> window>> gtk_window_present ; From fd08f9ad8f45b1f1f84dc41653ff745759066921 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 17:14:56 -0700 Subject: [PATCH 40/41] Fixes #33 - ui.gadgets.glass had a scoping issue, so text selection would stop working after opening a popup --- basis/ui/gadgets/glass/glass.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/ui/gadgets/glass/glass.factor b/basis/ui/gadgets/glass/glass.factor index d6b87193ca..34c641040e 100644 --- a/basis/ui/gadgets/glass/glass.factor +++ b/basis/ui/gadgets/glass/glass.factor @@ -45,7 +45,7 @@ PRIVATE> : show-glass ( owner child visible-rect -- ) - dup gadget-child hand-clicked set + dup gadget-child hand-clicked set-global dup owner>> find-world add-glass ; \ glass H{ From b3a282365263c21bb2d2fe207671a552dead6a3a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 27 Aug 2011 17:20:30 -0700 Subject: [PATCH 41/41] graphviz.ffi: fix help lint --- extra/graphviz/ffi/ffi-docs.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/graphviz/ffi/ffi-docs.factor b/extra/graphviz/ffi/ffi-docs.factor index 0398e17223..adbedd7cff 100644 --- a/extra/graphviz/ffi/ffi-docs.factor +++ b/extra/graphviz/ffi/ffi-docs.factor @@ -13,7 +13,7 @@ HELP: ffi-errors HELP: supported-engines { $values - { "value" array } + { "seq" array } } { $description "An " { $link array } " of " { $link string } "s representing all valid " { $emphasis "layout engines" } ". For example, the " { $emphasis "dot" } " engine is typically included in a Graphviz installation, so " { $snippet "\"dot\"" } " will be an element of " { $link supported-engines } ". See " { $url "http://graphviz.org/Documentation.php" } " for more details." } { $notes "This constant's definition is determined at parse-time by asking the system's Graphviz installation what engines are supported." } @@ -21,7 +21,7 @@ HELP: supported-engines HELP: supported-formats { $values - { "value" array } + { "seq" array } } { $description "An " { $link array } " of " { $link string } "s representing all valid " { $emphasis "layout formats" } ". For example, Graphviz can typically render using the Postscript format, in which case " { $snippet "\"ps\"" } " will be an element of " { $link supported-formats } ". See " { $url "http://graphviz.org/Documentation.php" } " for more details." } { $notes "This constant's definition is determined at parse-time by asking the system's Graphviz installation what formats are supported."