winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Added GdipCreateLineBrush.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 2b438a0220f31e8f1778012f62ba7eff758abfa9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2b438a0220f31e8f1778012f6…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:29 2007 -0700 gdiplus: Added GdipCreateLineBrush. --- dlls/gdiplus/brush.c | 29 +++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 9 +++++++++ include/gdiplusflat.h | 2 ++ include/gdiplusgpstubs.h | 2 ++ 5 files changed, 43 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 33b48ad..35e1659 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -77,6 +77,35 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) return Ok; } +GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint, + GDIPCONST GpPointF* endpoint, ARGB startcolor, ARGB endcolor, + GpWrapMode wrap, GpLineGradient **line) +{ + COLORREF col = ARGB2COLORREF(startcolor); + + if(!line || !startpoint || !endpoint) + return InvalidParameter; + + *line = GdipAlloc(sizeof(GpLineGradient)); + if(!*line) return OutOfMemory; + + (*line)->brush.lb.lbStyle = BS_SOLID; + (*line)->brush.lb.lbColor = col; + (*line)->brush.lb.lbHatch = 0; + (*line)->brush.gdibrush = CreateSolidBrush(col); + (*line)->brush.bt = BrushTypeLinearGradient; + + (*line)->startpoint.X = startpoint->X; + (*line)->startpoint.Y = startpoint->Y; + (*line)->endpoint.X = endpoint->X; + (*line)->endpoint.Y = endpoint->Y; + (*line)->startcolor = startcolor; + (*line)->endcolor = endcolor; + (*line)->wrap = wrap; + + return Ok; +} + GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points, INT count, GpWrapMode wrap, GpPathGradient **grad) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b188170..6811926 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -98,7 +98,7 @@ @ stub GdipCreateHalftonePalette @ stub GdipCreateHatchBrush @ stdcall GdipCreateImageAttributes(ptr) -@ stub GdipCreateLineBrush +@ stdcall GdipCreateLineBrush(ptr ptr long long long ptr) @ stub GdipCreateLineBrushFromRect @ stub GdipCreateLineBrushFromRectI @ stub GdipCreateLineBrushFromRectWithAngle diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 7f56ea7..1eacd46 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -104,6 +104,15 @@ struct GpPathGradient{ GpPointF focus; }; +struct GpLineGradient{ + GpBrush brush; + GpPointF startpoint; + GpPointF endpoint; + ARGB startcolor; + ARGB endcolor; + GpWrapMode wrap; +}; + struct GpPath{ GpFillMode fill; GpPathData pathdata; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 08f0696..963e8e4 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -49,6 +49,8 @@ GpStatus WINGDIPAPI GdipSetPenWidth(GpPen*,REAL); GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**); GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**); +GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF*,GDIPCONST GpPointF*, + ARGB,ARGB,GpWrapMode,GpLineGradient**); GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**); GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL, GDIPCONST WmfPlaceableFileHeader*,GpMetafile**); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 423cd9e..6628dbc 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -34,6 +34,7 @@ class GpMetafile : public GpImage {}; class GpImageAttributes {}; class GpBitmap : public GpImage {}; class GpPathGradient : public GpBrush {}; +class GpLineGradient : public GpBrush {}; #else /* end of c++ declarations */ @@ -50,6 +51,7 @@ typedef struct GpMetafile GpMetafile; typedef struct GpImageAttributes GpImageAttributes; typedef struct GpBitmap GpBitmap; typedef struct GpPathGradient GpPathGradient; +typedef struct GpLineGradient GpLineGradient; #endif /* end of c declarations */
1
0
0
0
Evan Stade : gdiplus: Added GdipSetLineWrapMode.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 37657bc4d14c4338d0ee64800f8c421f036287b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37657bc4d14c4338d0ee64800…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:32 2007 -0700 gdiplus: Added GdipSetLineWrapMode. --- dlls/gdiplus/brush.c | 13 ++++++++++++- dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 35e1659..5ad9b13 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -83,7 +83,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint, { COLORREF col = ARGB2COLORREF(startcolor); - if(!line || !startpoint || !endpoint) + if(!line || !startpoint || !endpoint || wrap == WrapModeClamp) return InvalidParameter; *line = GdipAlloc(sizeof(GpLineGradient)); @@ -316,6 +316,17 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb) return Ok; } +GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient *line, + GpWrapMode wrap) +{ + if(!line || wrap == WrapModeClamp) + return InvalidParameter; + + line->wrap = wrap; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad, ARGB argb) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 6811926..44026f7 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -542,7 +542,7 @@ @ stub GdipSetLinePresetBlend @ stub GdipSetLineSigmaBlend @ stub GdipSetLineTransform -@ stub GdipSetLineWrapMode +@ stdcall GdipSetLineWrapMode(ptr long) @ stdcall GdipSetMatrixElements(ptr long long long long long long) @ stub GdipSetMetafileDownLevelRasterizationLimit @ stdcall GdipSetPageScale(ptr long) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 963e8e4..713faac 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -106,6 +106,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*); GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient*, ARGB*,INT*); GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*); +GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient*,GpWrapMode); GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient*,ARGB); GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient*,GpPointF*); GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient*,REAL,REAL);
1
0
0
0
Evan Stade : gdiplus: Added GdipSetLineSigmaBlend stub.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 48ae8ea5422f631277142c4926d1763ec505448b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48ae8ea5422f631277142c492…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:36 2007 -0700 gdiplus: Added GdipSetLineSigmaBlend stub. --- dlls/gdiplus/brush.c | 14 ++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 16 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 5ad9b13..5fd6649 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -316,6 +316,20 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb) return Ok; } +GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient *line, REAL focus, + REAL scale) +{ + static int calls; + + if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient *line, GpWrapMode wrap) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 44026f7..6d0f042 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -540,7 +540,7 @@ @ stub GdipSetLineGammaCorrection @ stub GdipSetLineLinearBlend @ stub GdipSetLinePresetBlend -@ stub GdipSetLineSigmaBlend +@ stdcall GdipSetLineSigmaBlend(ptr long long) @ stub GdipSetLineTransform @ stdcall GdipSetLineWrapMode(ptr long) @ stdcall GdipSetMatrixElements(ptr long long long long long long) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 713faac..00ce4fc 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -106,6 +106,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*); GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient*, ARGB*,INT*); GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*); +GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient*,GpWrapMode); GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient*,ARGB); GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient*,GpPointF*);
1
0
0
0
Evan Stade : gdiplus: GdipLoadImageFromStream makes initializations.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 985ea4afac506cfa05914bca50f4c135808bee3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=985ea4afac506cfa05914bca5…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:20 2007 -0700 gdiplus: GdipLoadImageFromStream makes initializations. --- dlls/gdiplus/image.c | 92 +++++++++++++++++++++++++++++++------------------ 1 files changed, 58 insertions(+), 34 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index d672327..bd0fbab 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -318,10 +318,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream, GpBitmap **bitmap) { - BITMAPINFO bmi; - BITMAPCOREHEADER* bmch; - OLE_HANDLE hbm; - HDC hdc; GpStatus stat; stat = GdipLoadImageFromStream(stream, (GpImage**) bitmap); @@ -329,30 +325,11 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream, if(stat != Ok) return stat; - /* FIXME: make sure it's actually a bitmap */ - (*bitmap)->image.type = ImageTypeBitmap; - (*bitmap)->width = ipicture_pixel_width((*bitmap)->image.picture); - (*bitmap)->height = ipicture_pixel_height((*bitmap)->image.picture); - - /* get the pixel format */ - IPicture_get_Handle((*bitmap)->image.picture, &hbm); - IPicture_get_CurDC((*bitmap)->image.picture, &hdc); - - bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader); - bmch->bcSize = sizeof(BITMAPCOREHEADER); - - if(!hdc){ - HBITMAP old; - hdc = GetDC(0); - old = SelectObject(hdc, (HBITMAP)hbm); - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); - SelectObject(hdc, old); - ReleaseDC(0, hdc); + if((*bitmap)->image.type != ImageTypeBitmap){ + IPicture_Release((*bitmap)->image.picture); + GdipFree(bitmap); + return GenericError; /* FIXME: what error to return? */ } - else - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); - - (*bitmap)->format = (bmch->bcBitCount << 8) | PixelFormatGDI; return Ok; } @@ -594,21 +571,68 @@ GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) { + IPicture *pic; + short type; + if(!stream || !image) return InvalidParameter; - *image = GdipAlloc(sizeof(GpImage)); - if(!*image) return OutOfMemory; - if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, - (LPVOID*) &((*image)->picture)) != S_OK){ + (LPVOID*) &pic) != S_OK){ TRACE("Could not load picture\n"); - GdipFree(*image); return GenericError; } - /* FIXME: use IPicture_get_Type to get image type? */ - (*image)->type = ImageTypeUnknown; + IStream_AddRef(stream); + + IPicture_get_Type(pic, &type); + + if(type == PICTYPE_BITMAP){ + BITMAPINFO bmi; + BITMAPCOREHEADER* bmch; + OLE_HANDLE hbm; + HDC hdc; + + *image = GdipAlloc(sizeof(GpBitmap)); + if(!*image) return OutOfMemory; + (*image)->type = ImageTypeBitmap; + + (*((GpBitmap**) image))->width = ipicture_pixel_width(pic); + (*((GpBitmap**) image))->height = ipicture_pixel_height(pic); + + /* get the pixel format */ + IPicture_get_Handle(pic, &hbm); + IPicture_get_CurDC(pic, &hdc); + + bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader); + bmch->bcSize = sizeof(BITMAPCOREHEADER); + + if(!hdc){ + HBITMAP old; + hdc = GetDC(0); + old = SelectObject(hdc, (HBITMAP)hbm); + GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); + SelectObject(hdc, old); + ReleaseDC(0, hdc); + } + else + GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); + + (*((GpBitmap**) image))->format = (bmch->bcBitCount << 8) | PixelFormatGDI; + } + else if(type == PICTYPE_METAFILE || type == PICTYPE_ENHMETAFILE){ + /* FIXME: missing initialization code */ + *image = GdipAlloc(sizeof(GpMetafile)); + if(!*image) return OutOfMemory; + (*image)->type = ImageTypeMetafile; + } + else{ + *image = GdipAlloc(sizeof(GpImage)); + if(!*image) return OutOfMemory; + (*image)->type = ImageTypeUnknown; + } + + (*image)->picture = pic; return Ok; }
1
0
0
0
Evan Stade : gdiplus: Make GdipGetMetafileHeaderFromMetafile return Ok.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 3f9fad16923ed3d2e62b20d96b701c4cf35a3b02 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f9fad16923ed3d2e62b20d96…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:24 2007 -0700 gdiplus: Make GdipGetMetafileHeaderFromMetafile return Ok. --- dlls/gdiplus/image.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index bd0fbab..85cfc07 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -508,7 +508,7 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, if(!(calls++)) FIXME("not implemented\n"); - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID pid,
1
0
0
0
Evan Stade : gdiplus: Added GdipDrawImageI.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: de351ab9917778b95ff38c457e006efccaefe234 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de351ab9917778b95ff38c457…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:12 2007 -0700 gdiplus: Added GdipDrawImageI. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 27 +++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 29 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c49a395..b188170 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -174,7 +174,7 @@ @ stub GdipDrawEllipseI @ stub GdipDrawImage @ stub GdipDrawImageFX -@ stub GdipDrawImageI +@ stdcall GdipDrawImageI(ptr ptr long long) @ stub GdipDrawImagePointRect @ stub GdipDrawImagePointRectI @ stub GdipDrawImagePoints diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 57ad025..8d31661 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -989,6 +989,33 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, return retval; } +GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, + INT y) +{ + UINT width, height, srcw, srch; + + if(!graphics || !image) + return InvalidParameter; + + GdipGetImageWidth(image, &width); + GdipGetImageHeight(image, &height); + + srcw = width * (((REAL) INCH_HIMETRIC) / + ((REAL) GetDeviceCaps(graphics->hdc, LOGPIXELSX))); + srch = height * (((REAL) INCH_HIMETRIC) / + ((REAL) GetDeviceCaps(graphics->hdc, LOGPIXELSY))); + + if(image->type != ImageTypeMetafile){ + y += height; + height *= -1; + } + + IPicture_Render(image->picture, graphics->hdc, x, y, width, height, + 0, 0, srcw, srch, NULL); + + return Ok; +} + /* FIXME: partially implemented */ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index aba71ed..08f0696 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -58,6 +58,7 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL, REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL); +GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics*,GpImage*,INT,INT); GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*, GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit, GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*);
1
0
0
0
Evan Stade : gdiplus: Don't prematurely release stream.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 7d03a41325a77c2cc6893e19777e028542f7d6df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d03a41325a77c2cc6893e197…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:16 2007 -0700 gdiplus: Don't prematurely release stream. --- dlls/gdiplus/graphics.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 8d31661..3afdab2 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -803,6 +803,8 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, if(!hwmf || !metafile || !placeable) return InvalidParameter; + + *metafile = NULL; read = GetMetaFileBitsEx(hwmf, 0, NULL); if(!read) return GenericError; @@ -819,20 +821,20 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, if(CreateStreamOnHGlobal(copy, TRUE, &stream) != S_OK){ ERR("could not make stream\n"); - goto end; + GdipFree(copy); + goto err; } *metafile = GdipAlloc(sizeof(GpMetafile)); if(!*metafile){ retval = OutOfMemory; - goto end; + goto err; } if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, - (LPVOID*) &((*metafile)->image.picture)) != S_OK){ - GdipFree(*metafile); - goto end; - } + (LPVOID*) &((*metafile)->image.picture)) != S_OK) + goto err; + (*metafile)->image.type = ImageTypeMetafile; (*metafile)->bounds.X = ((REAL) placeable->BoundingBox.Left) / ((REAL) placeable->Inch); @@ -846,11 +848,11 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, if(delete) DeleteMetaFile(hwmf); - retval = Ok; + return Ok; -end: +err: + GdipFree(*metafile); IStream_Release(stream); - GdipFree(copy); return retval; }
1
0
0
0
Evan Stade : gdiplus: Return width and height of metafiles.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 0794e5daf3778495b34617a5d7ce8264069ae1ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0794e5daf3778495b34617a5d…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:09 2007 -0700 gdiplus: Return width and height of metafiles. --- dlls/gdiplus/gdiplus.c | 23 +++++++++++++++++++++++ dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 22 ---------------------- dlls/gdiplus/image.c | 16 ++++++++++++---- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 998cec8..e8499c6 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -263,3 +263,26 @@ GpStatus hresult_to_status(HRESULT res) return GenericError; } } + +/* converts a given unit to its value in pixels */ +REAL convert_unit(HDC hdc, GpUnit unit) +{ + switch(unit) + { + case UnitInch: + return (REAL) GetDeviceCaps(hdc, LOGPIXELSX); + case UnitPoint: + return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 72.0; + case UnitDocument: + return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 300.0; + case UnitMillimeter: + return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 25.4; + case UnitWorld: + ERR("cannot convert UnitWorld\n"); + return 0.0; + case UnitPixel: + case UnitDisplay: + default: + return 1.0; + } +} diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 130703d..7f56ea7 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -42,6 +42,7 @@ extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle); extern REAL gdiplus_atan2(REAL dy, REAL dx); extern GpStatus hresult_to_status(HRESULT res); +extern REAL convert_unit(HDC hdc, GpUnit unit); static inline INT roundr(REAL x) { diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 9787234..57ad025 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -82,28 +82,6 @@ static BYTE convert_path_point_type(BYTE type) return ret; } -static REAL convert_unit(HDC hdc, GpUnit unit) -{ - switch(unit) - { - case UnitInch: - return (REAL) GetDeviceCaps(hdc, LOGPIXELSX); - case UnitPoint: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 72.0; - case UnitDocument: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 300.0; - case UnitMillimeter: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 25.4; - case UnitWorld: - ERR("cannot convert UnitWorld\n"); - return 0.0; - case UnitPixel: - case UnitDisplay: - default: - return 1.0; - } -} - static INT prepare_dc(GpGraphics *graphics, GpPen *pen) { HPEN gdipen; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index da816b8..d672327 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -417,8 +417,12 @@ GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height) return InvalidParameter; if(image->type == ImageTypeMetafile){ - FIXME("not implemented for metafiles\n"); - return NotImplemented; + HDC hdc = GetDC(0); + + *height = roundr(convert_unit(hdc, ((GpMetafile*)image)->unit) * + ((GpMetafile*)image)->bounds.Height); + + ReleaseDC(0, hdc); } else if(image->type == ImageTypeBitmap) *height = ((GpBitmap*)image)->height; @@ -499,8 +503,12 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width) return InvalidParameter; if(image->type == ImageTypeMetafile){ - FIXME("not implemented for metafiles\n"); - return NotImplemented; + HDC hdc = GetDC(0); + + *width = roundr(convert_unit(hdc, ((GpMetafile*)image)->unit) * + ((GpMetafile*)image)->bounds.Width); + + ReleaseDC(0, hdc); } else if(image->type == ImageTypeBitmap) *width = ((GpBitmap*)image)->width;
1
0
0
0
Evan Stade : gdiplus: Added GdipCreateBitmapFromFile.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 8726f5ad2dfd68d385ecf2bc69513fe8d295073d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8726f5ad2dfd68d385ecf2bc6…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:04 2007 -0700 gdiplus: Added GdipCreateBitmapFromFile. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 22 ++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 24 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 218990d..c49a395 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -71,7 +71,7 @@ @ stub GdipConvertToEmfPlusToStream @ stub GdipCreateAdjustableArrowCap @ stub GdipCreateBitmapFromDirectDrawSurface -@ stub GdipCreateBitmapFromFile +@ stdcall GdipCreateBitmapFromFile(wstr ptr) @ stub GdipCreateBitmapFromFileICM @ stub GdipCreateBitmapFromGdiDib @ stub GdipCreateBitmapFromGraphics diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 59690c5..da816b8 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -229,6 +229,28 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, return Ok; } +GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, + GpBitmap **bitmap) +{ + GpStatus stat; + IStream *stream; + + if(!filename || !bitmap) + return InvalidParameter; + + stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); + + if(stat != Ok) + return stat; + + stat = GdipCreateBitmapFromStream(stream, bitmap); + + if(!stat) + IStream_Release(stream); + + return stat; +} + GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 1768419..aba71ed 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -167,6 +167,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*); GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap*,GDIPCONST GpRect*,UINT, PixelFormat,BitmapData*); +GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**);
1
0
0
0
Evan Stade : gdiplus: Added GdipCreateStreamOnFile.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 3ea77f5cfde7dbf1cacf35ff3f0e595eba01d7c7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ea77f5cfde7dbf1cacf35ff3…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:42:00 2007 -0700 gdiplus: Added GdipCreateStreamOnFile. --- dlls/gdiplus/Makefile.in | 2 +- dlls/gdiplus/gdiplus.c | 17 +++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 24 ++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/Makefile.in b/dlls/gdiplus/Makefile.in index d651c4c..ddf3d99 100644 --- a/dlls/gdiplus/Makefile.in +++ b/dlls/gdiplus/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = gdiplus.dll IMPORTLIB = libgdiplus.$(IMPLIBEXT) -IMPORTS = oleaut32 ole32 user32 gdi32 advapi32 kernel32 ntdll +IMPORTS = shlwapi oleaut32 ole32 user32 gdi32 advapi32 kernel32 ntdll EXTRALIBS = -luuid C_SRCS = \ diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 3787836..998cec8 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -27,6 +27,9 @@ #include "objbase.h" +#include "winreg.h" +#include "shlwapi.h" + #include "gdiplus.h" #include "gdiplus_private.h" @@ -246,3 +249,17 @@ REAL gdiplus_atan2(REAL dy, REAL dx) return atan2(dy, dx); } + +GpStatus hresult_to_status(HRESULT res) +{ + switch(res){ + case S_OK: + return Ok; + case E_OUTOFMEMORY: + return OutOfMemory; + case E_INVALIDARG: + return InvalidParameter; + default: + return GenericError; + } +} diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 7e53322..218990d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -129,7 +129,7 @@ @ stub GdipCreateRegionRectI @ stub GdipCreateRegionRgnData @ stdcall GdipCreateSolidFill(long ptr) -@ stub GdipCreateStreamOnFile +@ stdcall GdipCreateStreamOnFile(ptr long ptr) @ stub GdipCreateStringFormat @ stub GdipCreateTexture2 @ stub GdipCreateTexture2I diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 79440a2..130703d 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -41,6 +41,7 @@ COLORREF ARGB2COLORREF(ARGB color); extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle); extern REAL gdiplus_atan2(REAL dy, REAL dx); +extern GpStatus hresult_to_status(HRESULT res); static inline INT roundr(REAL x) { diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c21e891..9787234 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -30,6 +30,9 @@ #include "olectl.h" #include "ole2.h" +#include "winreg.h" +#include "shlwapi.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" @@ -873,6 +876,27 @@ end: return retval; } +GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, + UINT access, IStream **stream) +{ + DWORD dwMode; + HRESULT ret; + + if(!stream || !filename) + return InvalidParameter; + + if(access & GENERIC_WRITE) + dwMode = STGM_SHARE_DENY_WRITE | STGM_WRITE | STGM_CREATE; + else if(access & GENERIC_READ) + dwMode = STGM_SHARE_DENY_WRITE | STGM_READ | STGM_FAILIFTHERE; + else + return InvalidParameter; + + ret = SHCreateStreamOnFileW(filename, dwMode, stream); + + return hresult_to_status(ret); +} + GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics) { if(!graphics) return InvalidParameter; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 3035f0d..1768419 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -52,6 +52,7 @@ GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**); GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**); GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL, GDIPCONST WmfPlaceableFileHeader*,GpMetafile**); +GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR*,UINT,IStream**); GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *); GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,
1
0
0
0
← Newer
1
...
77
78
79
80
81
82
83
...
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200