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 GdipTranslateWorldTransform.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 795b62216d6b0a9067e983e84f006c0c6bab2afc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=795b62216d6b0a9067e983e84…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:31 2007 -0700 gdiplus: Added GdipTranslateWorldTransform. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 9 +++++++++ include/gdiplusflat.h | 1 + 3 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index a624a90..3f2ceea 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -618,7 +618,7 @@ @ stub GdipTranslateRegion @ stub GdipTranslateRegionI @ stub GdipTranslateTextureTransform -@ stub GdipTranslateWorldTransform +@ stdcall GdipTranslateWorldTransform(ptr long long long) @ stub GdipVectorTransformMatrixPoints @ stub GdipVectorTransformMatrixPointsI @ stub GdipWarpPath diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 6be5de4..d9cf86f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1594,3 +1594,12 @@ GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix GdipDeleteMatrix(graphics->worldtrans); return GdipCloneMatrix(matrix, &graphics->worldtrans); } + +GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx, + REAL dy, GpMatrixOrder order) +{ + if(!graphics) + return InvalidParameter; + + return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order); +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 231f918..61d2e6d 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -97,6 +97,7 @@ GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics*,GpUnit); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*); +GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**); GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF*,INT,GpWrapMode,
1
0
0
0
Evan Stade : gdiplus: Better error checking in GdipBitmapLockBits.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: ff752456e123ded9d77a4654b7889709638a7aaa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff752456e123ded9d77a4654b…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:27 2007 -0700 gdiplus: Better error checking in GdipBitmapLockBits. --- dlls/gdiplus/image.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index a6cf671..633b225 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -142,16 +142,20 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, stride = (stride + 3) & ~3; buff = GdipAlloc(stride * abs_height); - if(!buff) return OutOfMemory; bmi.bmiHeader.biBitCount = bitspp; - GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, &bmi, DIB_RGB_COLORS); + + if(buff) + GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, &bmi, DIB_RGB_COLORS); if(!bm_is_selected){ SelectObject(hdc, old); DeleteDC(hdc); } + if(!buff) + return OutOfMemory; + lockeddata->Width = rect->Width; lockeddata->Height = rect->Height; lockeddata->PixelFormat = format;
1
0
0
0
Evan Stade : gdiplus: Added GdipSetTextureTransform stub.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 96a69f0508483546f9de505d37200cf656269aa3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96a69f0508483546f9de505d3…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:22 2007 -0700 gdiplus: Added GdipSetTextureTransform 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 ef60a4a..e91538e 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -625,3 +625,17 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb) return Ok; } + +GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture, + GDIPCONST GpMatrix *matrix) +{ + static int calls; + + if(!texture || !matrix) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + return Ok; +} diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c8059ca..a624a90 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -595,7 +595,7 @@ @ stub GdipSetStringFormatTrimming @ stub GdipSetTextContrast @ stub GdipSetTextRenderingHint -@ stub GdipSetTextureTransform +@ stdcall GdipSetTextureTransform(ptr ptr) @ stub GdipSetTextureWrapMode @ stdcall GdipSetWorldTransform(ptr ptr) @ stub GdipShearMatrix diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index aa05914..231f918 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -128,6 +128,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient*, ARGB*,INT*); GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient*,GpWrapMode); GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill*,ARGB); +GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *,GDIPCONST GpMatrix*); GpStatus WINGDIPAPI GdipAddPathArc(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath*,GDIPCONST GpPointF*,INT);
1
0
0
0
Evan Stade : gdiplus: Updated GdipCloneBrush, GdipDeleteBrush.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 8254c37ad8813442b20d661e07e0bd8b4f6240a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8254c37ad8813442b20d661e0…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:18 2007 -0700 gdiplus: Updated GdipCloneBrush, GdipDeleteBrush. --- dlls/gdiplus/brush.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 9d8699d..ef60a4a 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -85,7 +85,16 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) (*clone)->gdibrush = CreateSolidBrush((*clone)->lb.lbColor); break; + case BrushTypeTextureFill: + *clone = GdipAlloc(sizeof(GpTexture)); + if(!*clone) return OutOfMemory; + + memcpy(*clone, brush, sizeof(GpTexture)); + + (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); + break; default: + ERR("not implemented for brush type %d\n", brush->bt); return NotImplemented; } @@ -385,6 +394,7 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush) break; case BrushTypeSolidColor: case BrushTypeLinearGradient: + case BrushTypeTextureFill: default: break; }
1
0
0
0
Evan Stade : gdiplus: Added GdipCreateTextureIA.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: b9411ba374e9570f99bdc23b8769d7ccb64ad1c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b9411ba374e9570f99bdc23b8…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:14 2007 -0700 gdiplus: Added GdipCreateTextureIA. --- dlls/gdiplus/brush.c | 122 ++++++++++++++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 4 + include/gdiplusflat.h | 2 + include/gdiplusgpstubs.h | 2 + 5 files changed, 131 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 1c17560..9d8699d 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -16,10 +16,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdarg.h> + #include "windef.h" +#include "winbase.h" +#include "winuser.h" #include "wingdi.h" +#define COBJMACROS #include "objbase.h" +#include "olectl.h" +#include "ole2.h" #include "gdiplus.h" #include "gdiplus_private.h" @@ -242,6 +249,121 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) return Ok; } +/* FIXME: imageattr ignored */ +GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, + GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, + REAL height, GpTexture **texture) +{ + HDC hdc; + OLE_HANDLE hbm; + HBITMAP old = NULL; + BITMAPINFO bmi; + BITMAPINFOHEADER *bmih; + INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp; + BOOL bm_is_selected; + BYTE *dibits, *buff, *textbits; + + if(!image || !texture || x < 0.0 || y < 0.0 || width < 0.0 || height < 0.0) + return InvalidParameter; + + if(image->type != ImageTypeBitmap){ + FIXME("not implemented for image type %d\n", image->type); + return NotImplemented; + } + + n_x = roundr(x); + n_y = roundr(y); + n_width = roundr(width); + n_height = roundr(height); + + if(n_x + n_width > ((GpBitmap*)image)->width || + n_y + n_height > ((GpBitmap*)image)->height) + return InvalidParameter; + + IPicture_get_Handle(image->picture, &hbm); + if(!hbm) return GenericError; + IPicture_get_CurDC(image->picture, &hdc); + bm_is_selected = (hdc != 0); + + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biBitCount = 0; + + if(!bm_is_selected){ + hdc = CreateCompatibleDC(0); + old = SelectObject(hdc, (HBITMAP)hbm); + } + + /* fill out bmi */ + GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); + + bytespp = bmi.bmiHeader.biBitCount / 8; + abs_height = abs(bmi.bmiHeader.biHeight); + + if(n_x > bmi.bmiHeader.biWidth || n_x + n_width > bmi.bmiHeader.biWidth || + n_y > abs_height || n_y + n_height > abs_height) + return InvalidParameter; + + dibits = GdipAlloc(bmi.bmiHeader.biSizeImage); + + if(dibits) /* this is not a good place to error out */ + GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, dibits, &bmi, DIB_RGB_COLORS); + + if(!bm_is_selected){ + SelectObject(hdc, old); + DeleteDC(hdc); + } + + if(!dibits) + return OutOfMemory; + + image_stride = (bmi.bmiHeader.biWidth * bytespp + 3) & ~3; + stride = (n_width * bytespp + 3) & ~3; + buff = GdipAlloc(sizeof(BITMAPINFOHEADER) + stride * n_height); + if(!buff){ + GdipFree(dibits); + return OutOfMemory; + } + + bmih = (BITMAPINFOHEADER*)buff; + textbits = (BYTE*) (bmih + 1); + bmih->biSize = sizeof(BITMAPINFOHEADER); + bmih->biWidth = n_width; + bmih->biHeight = n_height; + bmih->biCompression = BI_RGB; + bmih->biSizeImage = stride * n_height; + bmih->biBitCount = bmi.bmiHeader.biBitCount; + bmih->biClrUsed = 0; + bmih->biPlanes = 1; + + /* image is flipped */ + if(bmi.bmiHeader.biHeight > 0){ + dibits += bmi.bmiHeader.biSizeImage; + image_stride *= -1; + textbits += stride * (n_height - 1); + stride *= -1; + } + + for(i = 0; i < n_height; i++) + memcpy(&textbits[i * stride], + &dibits[n_x * bytespp + (n_y + i) * image_stride], + abs(stride)); + + *texture = GdipAlloc(sizeof(GpTexture)); + if (!*texture) return OutOfMemory; + + (*texture)->brush.lb.lbStyle = BS_DIBPATTERNPT; + (*texture)->brush.lb.lbColor = DIB_RGB_COLORS; + (*texture)->brush.lb.lbHatch = (ULONG_PTR)buff; + + (*texture)->brush.gdibrush = CreateBrushIndirect(&(*texture)->brush.lb); + (*texture)->brush.bt = BrushTypeTextureFill; + + GdipFree(dibits); + GdipFree(buff); + + return Ok; +} + GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type) { if(!brush || !type) return InvalidParameter; diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 9296354..c8059ca 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -134,7 +134,7 @@ @ stub GdipCreateTexture2 @ stub GdipCreateTexture2I @ stub GdipCreateTexture -@ stub GdipCreateTextureIA +@ stdcall GdipCreateTextureIA(ptr ptr long long long long ptr) @ stub GdipCreateTextureIAI @ stdcall GdipDeleteBrush(ptr) @ stub GdipDeleteCachedBitmap diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 8555db7..485394e 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -115,6 +115,10 @@ struct GpLineGradient{ BOOL gamma; }; +struct GpTexture{ + GpBrush brush; +}; + struct GpPath{ GpFillMode fill; GpPathData pathdata; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 2060e28..aa05914 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -104,6 +104,8 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF*,INT,GpWrapMode, GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*, GpPathGradient**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); +GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage*,GDIPCONST GpImageAttributes*, + REAL,REAL,REAL,REAL,GpTexture**); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient*,BOOL*); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 6628dbc..253dd1f 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -35,6 +35,7 @@ class GpImageAttributes {}; class GpBitmap : public GpImage {}; class GpPathGradient : public GpBrush {}; class GpLineGradient : public GpBrush {}; +class GpTexture : public GpBrush {}; #else /* end of c++ declarations */ @@ -52,6 +53,7 @@ typedef struct GpImageAttributes GpImageAttributes; typedef struct GpBitmap GpBitmap; typedef struct GpPathGradient GpPathGradient; typedef struct GpLineGradient GpLineGradient; +typedef struct GpTexture GpTexture; #endif /* end of c declarations */
1
0
0
0
Evan Stade : gdiplus: Added GdipDrawImageRectRect.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 04d4c2621cb31b6d844c021fde10bcdad30c1a06 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=04d4c2621cb31b6d844c021fd…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:09 2007 -0700 gdiplus: Added GdipDrawImageRectRect. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 21 ++++++++++++++++++++- include/gdiplusflat.h | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b09ca8e..9296354 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -183,7 +183,7 @@ @ stub GdipDrawImagePointsRectI @ stub GdipDrawImageRect @ stub GdipDrawImageRectI -@ stub GdipDrawImageRectRect +@ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr) @ stub GdipDrawImageRectRectI @ stdcall GdipDrawLine(ptr ptr long long long long) @ stdcall GdipDrawLineI(ptr ptr long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5946fa3..6be5de4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1018,7 +1018,7 @@ GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, return Ok; } -/* FIXME: partially implemented */ +/* FIXME: partially implemented (only works for rectangular parallelograms) */ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes, @@ -1071,6 +1071,25 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image return Ok; } +GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, + REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, + REAL srcwidth, REAL srcheight, GpUnit srcUnit, + GDIPCONST GpImageAttributes* imageattr, DrawImageAbort callback, + VOID * callbackData) +{ + GpPointF points[3]; + + points[0].X = dstx; + points[0].Y = dsty; + points[1].X = dstx + dstwidth; + points[1].Y = dsty; + points[2].X = dstx; + points[2].Y = dsty + dstheight; + + return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy, + srcwidth, srcheight, srcUnit, imageattr, callback, callbackData); +} + GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index b190492..2060e28 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -66,6 +66,9 @@ GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics*,GpImage*,INT,INT); GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*, GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit, GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*); +GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics*,GpImage*,REAL,REAL,REAL, + REAL,REAL,REAL,REAL,REAL,GpUnit,GDIPCONST GpImageAttributes*,DrawImageAbort, + VOID*); GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics,GpPen*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics*,GpPen*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipDrawLines(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
1
0
0
0
Evan Stade : gdiplus: Replace GetDC(0) with CreateCompatibleDC(0).
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 9c30236dee4b0fae1c3be5be23fd5b6002ebd15d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c30236dee4b0fae1c3be5be2…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:05 2007 -0700 gdiplus: Replace GetDC(0) with CreateCompatibleDC(0). --- dlls/gdiplus/image.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index d779907..a6cf671 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -130,7 +130,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, bmi.bmiHeader.biBitCount = 0; if(!bm_is_selected){ - hdc = GetDC(0); + hdc = CreateCompatibleDC(0); old = SelectObject(hdc, (HBITMAP)hbm); } @@ -149,7 +149,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if(!bm_is_selected){ SelectObject(hdc, old); - ReleaseDC(0, hdc); + DeleteDC(hdc); } lockeddata->Width = rect->Width; @@ -210,7 +210,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, bmi.bmiHeader.biBitCount = 0; if(!bm_is_selected){ - hdc = GetDC(0); + hdc = CreateCompatibleDC(0); old = SelectObject(hdc, (HBITMAP)hbm); } @@ -221,7 +221,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, if(!bm_is_selected){ SelectObject(hdc, old); - ReleaseDC(0, hdc); + DeleteDC(hdc); } GdipFree(bitmap->bitmapbits); @@ -677,11 +677,11 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) if(!hdc){ HBITMAP old; - hdc = GetDC(0); + hdc = CreateCompatibleDC(0); old = SelectObject(hdc, (HBITMAP)hbm); GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); SelectObject(hdc, old); - ReleaseDC(0, hdc); + DeleteDC(hdc); } else GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS);
1
0
0
0
Evan Stade : gdiplus: Added GdipGetImageGraphicsContext.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 94a19d1f759b76de7d2127978a09e844b6026cde URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94a19d1f759b76de7d2127978…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Aug 9 18:25:01 2007 -0700 gdiplus: Added GdipGetImageGraphicsContext. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.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 50d2f6b..b09ca8e 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -287,7 +287,7 @@ @ stub GdipGetImageEncoders @ stub GdipGetImageEncodersSize @ stub GdipGetImageFlags -@ stub GdipGetImageGraphicsContext +@ stdcall GdipGetImageGraphicsContext(ptr ptr) @ stdcall GdipGetImageHeight(ptr ptr) @ stdcall GdipGetImageHorizontalResolution(ptr ptr) @ stub GdipGetImageItemData diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index d813678..d779907 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -384,9 +384,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream, GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { + HDC hdc; + if(!image) return InvalidParameter; + IPicture_get_CurDC(image->picture, &hdc); + DeleteDC(hdc); IPicture_Release(image->picture); GdipFree(image); @@ -429,6 +433,29 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, return Ok; } +GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, + GpGraphics **graphics) +{ + HDC hdc; + + if(!image || !graphics) + return InvalidParameter; + + if(image->type != ImageTypeBitmap){ + FIXME("not implemented for image type %d\n", image->type); + return NotImplemented; + } + + IPicture_get_CurDC(image->picture, &hdc); + + if(!hdc){ + hdc = CreateCompatibleDC(0); + IPicture_SelectPicture(image->picture, hdc, NULL, NULL); + } + + return GdipCreateFromHDC(hdc, graphics); +} + GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height) { if(!image || !height) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 33d0e33..b190492 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -192,6 +192,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipDisposeImage(GpImage*); GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*); +GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage*,GpGraphics**); GpStatus WINGDIPAPI GdipGetImageHeight(GpImage*,UINT*); GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage*,PixelFormat*);
1
0
0
0
Detlef Riekenberg : comdlg32/tests: Add simple tests for PrintDlgA.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: ef7a7794ca8b160ec1e51f6d5debc769b420d73a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef7a7794ca8b160ec1e51f6d5…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Aug 9 19:11:20 2007 +0200 comdlg32/tests: Add simple tests for PrintDlgA. --- dlls/comdlg32/tests/printdlg.c | 46 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c index 227c61f..27b0390 100644 --- a/dlls/comdlg32/tests/printdlg.c +++ b/dlls/comdlg32/tests/printdlg.c @@ -34,6 +34,51 @@ #include "wine/test.h" +/* ######## */ + +static void test_PageSetupDlgA(void) +{ + LPPAGESETUPDLGA pDlg; + DWORD res; + + pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PAGESETUPDLGA)) * 2); + if (!pDlg) return; + + SetLastError(0xdeadbeef); + res = PageSetupDlgA(NULL); + ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION), + "returned %u with %u and 0x%x (expected '0' and " + "CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError()); + + ZeroMemory(pDlg, sizeof(PAGESETUPDLGA)); + pDlg->lStructSize = sizeof(PAGESETUPDLGA) -1; + SetLastError(0xdeadbeef); + res = PageSetupDlgA(pDlg); + ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE), + "returned %u with %u and 0x%x (expected '0' and " + "CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError()); + + + ZeroMemory(pDlg, sizeof(PAGESETUPDLGA)); + pDlg->lStructSize = sizeof(PAGESETUPDLGA); + pDlg->Flags = PSD_RETURNDEFAULT; + SetLastError(0xdeadbeef); + res = PageSetupDlgA(pDlg); + ok( res || (CommDlgExtendedError() == PDERR_NODEFAULTPRN), + "returned %u with %u and 0x%x (expected '!= 0' or '0' and " + "PDERR_NODEFAULTPRN)\n", res, GetLastError(), CommDlgExtendedError()); + + ok( pDlg->hDevMode && pDlg->hDevNames, + "got %p and %p (expected '!= NULL' for both)\n", + pDlg->hDevMode, pDlg->hDevNames); + + GlobalFree(pDlg->hDevMode); + GlobalFree(pDlg->hDevNames); + + HeapFree(GetProcessHeap(), 0, pDlg); + +} + /* ##### */ static void test_PrintDlgA(void) @@ -78,6 +123,7 @@ static void test_PrintDlgA(void) START_TEST(printdlg) { + test_PageSetupDlgA(); test_PrintDlgA(); }
1
0
0
0
Detlef Riekenberg : comdlg32: Return defaults for hDevMode and hDevNames.
by Alexandre Julliard
10 Aug '07
10 Aug '07
Module: wine Branch: master Commit: 2ca1de9973923749812614fcf187cdb52ac4763a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ca1de9973923749812614fcf…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Aug 9 19:10:02 2007 +0200 comdlg32: Return defaults for hDevMode and hDevNames. --- dlls/comdlg32/printdlg.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index a1ad355..8491aa7 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -3398,14 +3398,16 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { /* short cut exit, just return default values */ if (setupdlg->Flags & PSD_RETURNDEFAULT) { - DEVMODEA *dm; - - dm = GlobalLock(pdlg.hDevMode); - PRINTDLG_PaperSizeA(&pdlg, dm->u1.s1.dmPaperSize, &setupdlg->ptPaperSize); - GlobalUnlock(pdlg.hDevMode); - setupdlg->ptPaperSize.x=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.x); - setupdlg->ptPaperSize.y=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.y); - return TRUE; + DEVMODEA *dm; + + setupdlg->hDevMode = pdlg.hDevMode; + setupdlg->hDevNames = pdlg.hDevNames; + dm = GlobalLock(pdlg.hDevMode); + PRINTDLG_PaperSizeA(&pdlg, dm->u1.s1.dmPaperSize, &setupdlg->ptPaperSize); + GlobalUnlock(pdlg.hDevMode); + setupdlg->ptPaperSize.x=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.x); + setupdlg->ptPaperSize.y=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.y); + return TRUE; } /* get dialog template */
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
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