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
July 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
957 discussions
Start a n
N
ew thread
Dmitry Timoshkov : advapi32: Rename the test to better represent the tested functionality.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 433393fd514c4b0b131e2b4707eb17041f3074d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=433393fd514c4b0b131e2b470…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Fri Jul 20 17:26:35 2007 +0900 advapi32: Rename the test to better represent the tested functionality. --- dlls/advapi32/tests/security.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index f67f0a6..ce7b8f7 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -1758,7 +1758,7 @@ static void test_GetNamedSecurityInfoA(void) ok(group != NULL, "group should not be NULL\n"); } -static void test_ConvertSecurityStringSecurityDescriptor(void) +static void test_ConvertStringSecurityDescriptor(void) { BOOL ret; PSECURITY_DESCRIPTOR pSD; @@ -1877,5 +1877,5 @@ START_TEST(security) test_impersonation_level(); test_SetEntriesInAcl(); test_GetNamedSecurityInfoA(); - test_ConvertSecurityStringSecurityDescriptor(); + test_ConvertStringSecurityDescriptor(); }
1
0
0
0
Dmitry Timoshkov : winex11.drv: Constify the pen dash data.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 7b77b917230869177724f3420c99132aa3064988 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b77b917230869177724f3420…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Fri Jul 20 17:25:09 2007 +0900 winex11.drv: Constify the pen dash data. --- dlls/winex11.drv/pen.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index d2a0284..96d9043 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -30,16 +30,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); */ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) { + static const char PEN_dash[] = { 16,8 }; + static const char PEN_dot[] = { 4,4 }; + static const char PEN_dashdot[] = { 12,8,4,8 }; + static const char PEN_dashdotdot[] = { 12,4,4,4,4,4 }; + static const char PEN_alternate[] = { 1,1 }; + static const char EXTPEN_dash[] = { 3,1 }; + static const char EXTPEN_dot[] = { 1,1 }; + static const char EXTPEN_dashdot[] = { 3,1,1,1 }; + static const char EXTPEN_dashdotdot[] = { 3,1,1,1,1,1 }; LOGPEN logpen; - static char PEN_dash[] = { 16,8 }; - static char PEN_dot[] = { 4,4 }; - static char PEN_dashdot[] = { 12,8,4,8 }; - static char PEN_dashdotdot[] = { 12,4,4,4,4,4 }; - static char PEN_alternate[] = { 1,1 }; - static char EXTPEN_dash[] = { 3,1 }; - static char EXTPEN_dot[] = { 1,1 }; - static char EXTPEN_dashdot[] = { 3,1,1,1 }; - static char EXTPEN_dashdotdot[] = { 3,1,1,1,1,1 }; int i; if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
1
0
0
0
Nigel Liang : winex11.drv: Implement XIMPreEditCaretCallback.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: c52ce9bccc2b6735b73e790f060e31e7544af88b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c52ce9bccc2b6735b73e790f0…
Author: Nigel Liang <ncliang(a)gmail.com> Date: Thu Jul 19 10:52:30 2007 -0700 winex11.drv: Implement XIMPreEditCaretCallback. --- dlls/user32/edit.c | 4 +++ dlls/winex11.drv/xim.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index fbc5a00..77ecf32 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -1032,6 +1032,8 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, break; case WM_IME_COMPOSITION: + { + int caret_pos = es->selection_end; if (es->composition_len == 0) { if (es->selection_start != es->selection_end) @@ -1043,7 +1045,9 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, es->composition_start = es->selection_end; } EDIT_ImeComposition(hwnd,lParam,es); + EDIT_SetCaretPos(es, caret_pos, es->flags & EF_AFTER_WRAP); break; + } case WM_IME_ENDCOMPOSITION: es->composition_len= 0; diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 7b31986..9e2d232 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -30,6 +30,7 @@ #include "winnls.h" #include "x11drv.h" #include "imm.h" +#include "ddk/imm.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(x11drv); @@ -39,6 +40,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); BOOL ximInComposeMode=FALSE; +typedef struct tagInputContextData +{ + BOOL bInternalState; + BOOL bRead; + BOOL bInComposition; + HFONT textfont; + + DWORD dwLock; + INPUTCONTEXT IMC; +} InputContextData; + static HIMC root_context; static XIMStyle ximStyle = 0; static XIMStyle ximStyleRoot = 0; @@ -56,6 +68,7 @@ static HIMC (WINAPI *pImmCreateContext)(void); static VOID (WINAPI *pImmSetOpenStatus)(HIMC,BOOL); static BOOL (WINAPI *pImmSetCompositionString)(HIMC, DWORD, LPWSTR, DWORD, LPWSTR, DWORD); +static LONG (WINAPI *pImmGetCompositionString)(HIMC, DWORD, LPVOID, DWORD); static VOID (WINAPI *pImmNotifyIME)(HIMC, DWORD, DWORD, DWORD); /* WINE specific messages from the xim in x11drv level */ @@ -92,6 +105,11 @@ static void LoadImmDll(void) if (!pImmSetCompositionString) WARN("IMM: pImmSetCompositionStringW not found in DLL\n"); + pImmGetCompositionString =(void *)GetProcAddress(hImmDll, "ImmGetCompositionStringW"); + + if (!pImmGetCompositionString) + WARN("IMM: pImmGetCompositionStringW not found in DLL\n"); + pImmNotifyIME = (void *)GetProcAddress( hImmDll, "ImmNotifyIME"); if (!pImmNotifyIME) @@ -310,7 +328,44 @@ static void XIMPreEditDrawCallback(XIM ic, XPointer client_data, static void XIMPreEditCaretCallback(XIC ic, XPointer client_data, XIMPreeditCaretCallbackStruct *P_C) { - FIXME("PreeditCaretCalback %p\n",ic); + TRACE("PreeditCaretCallback %p\n",ic); + + if (P_C) + { + int pos = pImmGetCompositionString(root_context, GCS_CURSORPOS, NULL, 0); + TRACE("pos: %d\n", pos); + switch(P_C->direction) + { + case XIMForwardChar: + case XIMForwardWord: + pos++; + break; + case XIMBackwardChar: + case XIMBackwardWord: + pos--; + break; + case XIMLineStart: + pos = 0; + break; + case XIMAbsolutePosition: + pos = P_C->position; + break; + case XIMDontChange: + P_C->position = pos; + return; + case XIMCaretUp: + case XIMCaretDown: + case XIMPreviousLine: + case XIMNextLine: + case XIMLineEnd: + FIXME("Not implemented\n"); + break; + } + SendMessageW(((InputContextData*)root_context)->IMC.hWnd, + EM_SETSEL, pos, pos); + P_C->position = pos; + } + TRACE("Finished\n"); } void X11DRV_ForceXIMReset(HWND hwnd)
1
0
0
0
Evan Stade : gdiplus: Added GdipSetPenStartCap.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 937432ac176d39d37429017296192d27ba9d7f64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=937432ac176d39d3742901729…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:23:13 2007 -0700 gdiplus: Added GdipSetPenStartCap. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/pen.c | 11 +++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index a0f57af..66f4de2 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -555,7 +555,7 @@ @ stdcall GdipSetPenLineJoin(ptr long) @ stdcall GdipSetPenMiterLimit(ptr long) @ stub GdipSetPenMode -@ stub GdipSetPenStartCap +@ stdcall GdipSetPenStartCap(ptr long) @ stub GdipSetPenTransform @ stub GdipSetPenUnit @ stub GdipSetPenWidth diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 7b14595..c003076 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -248,3 +248,14 @@ GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit) return Ok; } + +GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap) +{ + if(!pen) return InvalidParameter; + + GdipDeleteCustomLineCap(pen->customstart); + pen->customstart = NULL; + pen->startcap = cap; + + return Ok; +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index d181825..31d973b 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -38,6 +38,7 @@ GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap); GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen*,GpLineJoin); GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen*,REAL); +GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**); GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**);
1
0
0
0
Evan Stade : gdiplus: Updated GdipClonePen to clone pen's members by value, not reference.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 5306245c47cc59756497bc826b2292d668f79ae4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5306245c47cc59756497bc826…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:23:08 2007 -0700 gdiplus: Updated GdipClonePen to clone pen's members by value, not reference. --- dlls/gdiplus/pen.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index da6a482..7b14595 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -67,8 +67,6 @@ static DWORD gdip_to_gdi_join(GpLineJoin join) GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) { - LOGBRUSH lb; - if(!pen || !clonepen) return InvalidParameter; @@ -77,12 +75,13 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) memcpy(*clonepen, pen, sizeof(GpPen)); - lb.lbStyle = BS_SOLID; - lb.lbColor = (*clonepen)->color; - lb.lbHatch = 0; + GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart); + GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend); + GdipCloneBrush(pen->brush, &(*clonepen)->brush); (*clonepen)->gdipen = ExtCreatePen((*clonepen)->style, - roundr((*clonepen)->width), &lb, 0, NULL); + roundr((*clonepen)->width), + &(*clonepen)->brush->lb, 0, NULL); return Ok; }
1
0
0
0
Evan Stade : gdiplus: Added GdipCloneBrush.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: b2b4b87c3b2c6420056f8fd70ea2f01210e1b909 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b2b4b87c3b2c6420056f8fd70…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:23:04 2007 -0700 gdiplus: Added GdipCloneBrush. --- dlls/gdiplus/brush.c | 15 +++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 17 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index b39df22..21c92b5 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -21,6 +21,21 @@ #include "gdiplus.h" #include "gdiplus_private.h" +GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) +{ + if(!brush || !clone) + return InvalidParameter; + + *clone = GdipAlloc(sizeof(GpBrush)); + if (!*clone) return OutOfMemory; + + memcpy(*clone, brush, sizeof(GpBrush)); + + (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) { COLORREF col = ARGB2COLORREF(color); diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 755a70d..a0f57af 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -43,7 +43,7 @@ @ stub GdipClearPathMarkers @ stub GdipCloneBitmapArea @ stub GdipCloneBitmapAreaI -@ stub GdipCloneBrush +@ stdcall GdipCloneBrush(ptr ptr) @ stdcall GdipCloneCustomLineCap(ptr ptr) @ stub GdipCloneFont @ stub GdipCloneFontFamily diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 365e81a..d181825 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -64,6 +64,7 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics*,InterpolationMode); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); +GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
1
0
0
0
Evan Stade : gdiplus: Associate a brush with a pen.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 7af2e97a4a4688faf9fec35d02d38cd3193d0af2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7af2e97a4a4688faf9fec35d0…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:22:59 2007 -0700 gdiplus: Associate a brush with a pen. --- dlls/gdiplus/brush.c | 4 ++++ dlls/gdiplus/gdiplus_private.h | 3 +++ dlls/gdiplus/pen.c | 27 ++++++--------------------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 2a27fc8..b39df22 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -30,6 +30,10 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) *sf = GdipAlloc(sizeof(GpSolidFill)); if (!*sf) return OutOfMemory; + (*sf)->brush.lb.lbStyle = BS_SOLID; + (*sf)->brush.lb.lbColor = col; + (*sf)->brush.lb.lbHatch = 0; + (*sf)->brush.gdibrush = CreateSolidBrush(col); (*sf)->brush.bt = BrushTypeSolidColor; (*sf)->brush.color = col; diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 206d86c..71cfe39 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -21,6 +21,7 @@ #include <math.h> #include "windef.h" +#include "wingdi.h" #include "gdiplus.h" #define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER) @@ -54,6 +55,7 @@ struct GpPen{ GpLineJoin join; REAL miterlimit; GpDashStyle dash; + GpBrush *brush; }; struct GpGraphics{ @@ -69,6 +71,7 @@ struct GpBrush{ HBRUSH gdibrush; GpBrushType bt; COLORREF color; + LOGBRUSH lb; }; struct GpSolidFill{ diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 9601f8c..da6a482 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -90,7 +90,6 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit, GpPen **pen) { - LOGBRUSH lb; GpPen *gp_pen; if(!pen) @@ -107,14 +106,11 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit, gp_pen->join = LineJoinMiter; gp_pen->miterlimit = 10.0; gp_pen->dash = DashStyleSolid; - - lb.lbStyle = BS_SOLID; - lb.lbColor = gp_pen->color; - lb.lbHatch = 0; + GdipCreateSolidFill(color, (GpSolidFill **)(&gp_pen->brush)); if((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel)) { - gp_pen->gdipen = ExtCreatePen(gp_pen->style, (INT) gp_pen->width, &lb, - 0, NULL); + gp_pen->gdipen = ExtCreatePen(gp_pen->style, (INT) gp_pen->width, + &gp_pen->brush->lb, 0, NULL); } else { FIXME("UnitWorld, UnitPixel only supported units\n"); GdipFree(gp_pen); @@ -131,6 +127,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen) if(!pen) return InvalidParameter; DeleteObject(pen->gdipen); + GdipDeleteBrush(pen->brush); GdipDeleteCustomLineCap(pen->customstart); GdipDeleteCustomLineCap(pen->customend); GdipFree(pen); @@ -182,8 +179,6 @@ GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* custom GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash) { - LOGBRUSH lb; - if(!pen) return InvalidParameter; @@ -193,11 +188,7 @@ GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash) PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME); pen->style |= gdip_to_gdi_dash(dash); - lb.lbStyle = BS_SOLID; - lb.lbColor = pen->color; - lb.lbHatch = 0; - - pen->gdipen = ExtCreatePen(pen->style, (INT) pen->width, &lb, 0, NULL); + pen->gdipen = ExtCreatePen(pen->style, (INT) pen->width, &pen->brush->lb, 0, NULL); return Ok; } @@ -237,8 +228,6 @@ GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start, * Both kinds of miter joins clip if the angle is less than 11 degrees. */ GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join) { - LOGBRUSH lb; - if(!pen) return InvalidParameter; DeleteObject(pen->gdipen); @@ -246,11 +235,7 @@ GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join) pen->style &= ~(PS_JOIN_ROUND | PS_JOIN_BEVEL | PS_JOIN_MITER); pen->style |= gdip_to_gdi_join(join); - lb.lbStyle = BS_SOLID; - lb.lbColor = pen->color; - lb.lbHatch = 0; - - pen->gdipen = ExtCreatePen(pen->style, (INT) pen->width, &lb, 0, NULL); + pen->gdipen = ExtCreatePen(pen->style, (INT) pen->width, &pen->brush->lb, 0, NULL); return Ok; }
1
0
0
0
Evan Stade : gdiplus: Added rendering of custom line caps.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 85b5df42a792730c4343cbe021d2c69acee90141 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=85b5df42a792730c4343cbe02…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:22:51 2007 -0700 gdiplus: Added rendering of custom line caps. --- dlls/gdiplus/graphics.c | 120 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 83 insertions(+), 37 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 0720163..4a581d1 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -46,6 +46,32 @@ static void deg2xy(REAL angle, REAL x_0, REAL y_0, REAL *x, REAL *y) *y = y_0 + sin(radAngle) * hypotenuse; } +/* Converts from gdiplus path point type to gdi path point type. */ +static BYTE convert_path_point_type(BYTE type) +{ + BYTE ret; + + switch(type & PathPointTypePathTypeMask){ + case PathPointTypeBezier: + ret = PT_BEZIERTO; + break; + case PathPointTypeLine: + ret = PT_LINETO; + break; + case PathPointTypeStart: + ret = PT_MOVETO; + break; + default: + ERR("Bad point type\n"); + return 0; + } + + if(type & PathPointTypeCloseSubpath) + ret |= PT_CLOSEFIGURE; + + return ret; +} + /* GdipDrawPie/GdipFillPie helper function */ static GpStatus draw_pie(GpGraphics *graphics, HBRUSH gdibrush, HPEN gdipen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) @@ -106,13 +132,18 @@ static void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, /* Draws the linecap the specified color and size on the hdc. The linecap is in * direction of the line from x1, y1 to x2, y2 and is anchored on x2, y2. */ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, - REAL x1, REAL y1, REAL x2, REAL y2) + const GpCustomLineCap *custom, REAL x1, REAL y1, REAL x2, REAL y2) { HGDIOBJ oldbrush, oldpen; + GpMatrix *matrix = NULL; HBRUSH brush; HPEN pen; - POINT pt[4]; + PointF *custptf = NULL; + POINT pt[4], *custpt = NULL; + BYTE *tp = NULL; REAL theta, dsmall, dbig, dx, dy; + INT i, count; + LOGBRUSH lb; if(x2 != x1) theta = atan2(y2 - y1, x2 - x1); @@ -123,7 +154,11 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, return; brush = CreateSolidBrush(color); - pen = CreatePen(PS_SOLID, 1, color); + lb.lbStyle = BS_SOLID; + lb.lbColor = color; + lb.lbHatch = 0; + pen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT, + (cap == LineCapCustom ? size : 1), &lb, 0, NULL); oldbrush = SelectObject(hdc, brush); oldpen = SelectObject(hdc, pen); @@ -229,7 +264,44 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, roundr(y2 + 2.0 * dy), pt[0].x, pt[0].y, pt[1].x, pt[1].y); break; case LineCapCustom: - FIXME("line cap not implemented\n"); + if(!custom) + break; + + if(custom->fill){ + FIXME("fill-path custom line caps not implemented\n"); + break; + } + + count = custom->pathdata.Count; + custptf = GdipAlloc(count * sizeof(PointF)); + custpt = GdipAlloc(count * sizeof(POINT)); + tp = GdipAlloc(count); + + if(!custptf || !custpt || !tp || (GdipCreateMatrix(&matrix) != Ok)) + goto custend; + + memcpy(custptf, custom->pathdata.Points, count * sizeof(PointF)); + + GdipScaleMatrix(matrix, size, size, MatrixOrderAppend); + GdipRotateMatrix(matrix, (180.0 / M_PI) * (theta - M_PI_2), + MatrixOrderAppend); + GdipTranslateMatrix(matrix, x2, y2, MatrixOrderAppend); + GdipTransformMatrixPoints(matrix, custptf, count); + + for(i = 0; i < count; i++){ + custpt[i].x = roundr(custptf[i].X); + custpt[i].y = roundr(custptf[i].Y); + tp[i] = convert_path_point_type(custom->pathdata.Types[i]); + } + + PolyDraw(hdc, custpt, tp, count); + +custend: + GdipFree(custptf); + GdipFree(custpt); + GdipFree(tp); + GdipDeleteMatrix(matrix); + break; default: break; } @@ -303,8 +375,8 @@ static GpStatus draw_polyline(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt, if(pen->endcap == LineCapArrowAnchor) shorten_line_amt(pt[count-2].X, pt[count-2].Y, &x, &y, pen->width); - draw_cap(hdc, pen->color, pen->endcap, pen->width, pt[count-2].X, - pt[count-2].Y, pt[count - 1].X, pt[count - 1].Y); + draw_cap(hdc, pen->color, pen->endcap, pen->width, pen->customend, + pt[count-2].X, pt[count-2].Y, pt[count - 1].X, pt[count - 1].Y); } for(i = 0; i < count - 1; i ++){ @@ -386,7 +458,7 @@ static GpStatus draw_polybezier(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt, /* the direction of the line cap is parallel to the direction at the * end of the bezier (which, if it has been shortened, is not the same * as the direction from pt[count-2] to pt[count-1]) */ - draw_cap(hdc, pen->color, pen->endcap, pen->width, + draw_cap(hdc, pen->color, pen->endcap, pen->width, pen->customend, pt[count - 1].X - (ptf[3].X - ptf[2].X), pt[count - 1].Y - (ptf[3].Y - ptf[2].Y), pt[count - 1].X, pt[count - 1].Y); @@ -412,32 +484,6 @@ end: return status; } -/* Converts from gdiplus path point type to gdi path point type. */ -static BYTE convert_path_point_type(BYTE type) -{ - BYTE ret; - - switch(type & PathPointTypePathTypeMask){ - case PathPointTypeBezier: - ret = PT_BEZIERTO; - break; - case PathPointTypeLine: - ret = PT_LINETO; - break; - case PathPointTypeStart: - ret = PT_MOVETO; - break; - default: - ERR("Bad point type\n"); - return 0; - } - - if(type & PathPointTypeCloseSubpath) - ret |= PT_CLOSEFIGURE; - - return ret; -} - /* Draws a combination of bezier curves and lines between points. */ static GpStatus draw_poly(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt, GDIPCONST BYTE * types, INT count, BOOL caps) @@ -489,8 +535,7 @@ static GpStatus draw_poly(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt, if(pen->endcap == LineCapArrowAnchor) shorten_bezier_amt(ptf, pen->width); - - draw_cap(hdc, pen->color, pen->endcap, pen->width, + draw_cap(hdc, pen->color, pen->endcap, pen->width, pen->customend, pt[count - 1].X - (ptf[3].X - ptf[2].X), pt[count - 1].Y - (ptf[3].Y - ptf[2].Y), pt[count - 1].X, pt[count - 1].Y); @@ -507,8 +552,9 @@ static GpStatus draw_poly(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt, shorten_line_amt(pt[count - 2].X, pt[count - 2].Y, &x, &y, pen->width); - draw_cap(hdc, pen->color, pen->endcap, pen->width, pt[count - 2].X, - pt[count - 2].Y, pt[count - 1].X, pt[count - 1].Y); + draw_cap(hdc, pen->color, pen->endcap, pen->width, pen->customend, + pt[count - 2].X, pt[count - 2].Y, pt[count - 1].X, + pt[count - 1].Y); pti[count - 1].x = roundr(x); pti[count - 1].y = roundr(y);
1
0
0
0
Evan Stade : gdiplus: Added custom line cap setters.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 8f865f42ee368604b8e5e57ee305b5b19a85d62f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f865f42ee368604b8e5e57ee…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:22:43 2007 -0700 gdiplus: Added custom line cap setters. --- dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/pen.c | 43 ++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 1d8e424..755a70d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -544,8 +544,8 @@ @ stub GdipSetPenBrushFill @ stub GdipSetPenColor @ stub GdipSetPenCompoundArray -@ stub GdipSetPenCustomEndCap -@ stub GdipSetPenCustomStartCap +@ stdcall GdipSetPenCustomEndCap(ptr ptr) +@ stdcall GdipSetPenCustomStartCap(ptr ptr) @ stub GdipSetPenDashArray @ stub GdipSetPenDashCap197819 @ stub GdipSetPenDashOffset diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 5350a19..206d86c 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -49,6 +49,8 @@ struct GpPen{ GpLineCap endcap; GpLineCap startcap; GpDashCap dashcap; + GpCustomLineCap *customstart; + GpCustomLineCap *customend; GpLineJoin join; REAL miterlimit; GpDashStyle dash; diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 52ee8e2..9601f8c 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -130,6 +130,9 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen) { if(!pen) return InvalidParameter; DeleteObject(pen->gdipen); + + GdipDeleteCustomLineCap(pen->customstart); + GdipDeleteCustomLineCap(pen->customend); GdipFree(pen); return Ok; @@ -145,6 +148,38 @@ GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash) return Ok; } +GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap) +{ + GpCustomLineCap * cap; + GpStatus ret; + + if(!pen || !customCap) return InvalidParameter; + + if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){ + GdipDeleteCustomLineCap(pen->customend); + pen->endcap = LineCapCustom; + pen->customend = cap; + } + + return ret; +} + +GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap) +{ + GpCustomLineCap * cap; + GpStatus ret; + + if(!pen || !customCap) return InvalidParameter; + + if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){ + GdipDeleteCustomLineCap(pen->customstart); + pen->startcap = LineCapCustom; + pen->customstart = cap; + } + + return ret; +} + GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash) { LOGBRUSH lb; @@ -171,6 +206,9 @@ GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap) { if(!pen) return InvalidParameter; + /* The old custom cap gets deleted even if the new style is LineCapCustom. */ + GdipDeleteCustomLineCap(pen->customend); + pen->customend = NULL; pen->endcap = cap; return Ok; @@ -183,6 +221,11 @@ GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start, if(!pen) return InvalidParameter; + GdipDeleteCustomLineCap(pen->customend); + GdipDeleteCustomLineCap(pen->customstart); + pen->customend = NULL; + pen->customstart = NULL; + pen->startcap = start; pen->endcap = end; pen->dashcap = dash; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 901e03b..365e81a 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -31,6 +31,8 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen*,GpPen**); GpStatus WINGDIPAPI GdipCreatePen1(ARGB,REAL,GpUnit,GpPen**); GpStatus WINGDIPAPI GdipDeletePen(GpPen*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); +GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*); +GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);
1
0
0
0
Evan Stade : gdiplus: Use atan2 instead of atan.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: ea5898c0676634781538be7126c9de4f2c92d616 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea5898c0676634781538be712…
Author: Evan Stade <estade(a)gmail.com> Date: Thu Jul 19 18:22:47 2007 -0700 gdiplus: Use atan2 instead of atan. --- dlls/gdiplus/graphics.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 6123b69..0720163 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -112,17 +112,16 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, HBRUSH brush; HPEN pen; POINT pt[4]; - REAL theta, dsmall, dbig, dx, dy, invert; + REAL theta, dsmall, dbig, dx, dy; if(x2 != x1) - theta = atan((y2 - y1) / (x2 - x1)); + theta = atan2(y2 - y1, x2 - x1); else if(y2 != y1){ theta = M_PI_2 * (y2 > y1 ? 1.0 : -1.0); } else return; - invert = ((x2 - x1) >= 0.0 ? 1.0 : -1.0); brush = CreateSolidBrush(color); pen = CreatePen(PS_SOLID, 1, color); oldbrush = SelectObject(hdc, brush); @@ -164,14 +163,14 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, case LineCapArrowAnchor: size = size * 4.0 / sqrt(3.0); - dx = cos(M_PI / 6.0 + theta) * size * invert; - dy = sin(M_PI / 6.0 + theta) * size * invert; + dx = cos(M_PI / 6.0 + theta) * size; + dy = sin(M_PI / 6.0 + theta) * size; pt[0].x = roundr(x2 - dx); pt[0].y = roundr(y2 - dy); - dx = cos(- M_PI / 6.0 + theta) * size * invert; - dy = sin(- M_PI / 6.0 + theta) * size * invert; + dx = cos(- M_PI / 6.0 + theta) * size; + dy = sin(- M_PI / 6.0 + theta) * size; pt[1].x = roundr(x2 - dx); pt[1].y = roundr(y2 - dy); @@ -203,8 +202,8 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, pt[1].x = roundr(pt[0].x + 2.0 * dx); pt[1].y = roundr(pt[0].y + 2.0 * dy); - dx = cos(theta) * size * invert; - dy = sin(theta) * size * invert; + dx = cos(theta) * size; + dy = sin(theta) * size; pt[2].x = roundr(x2 + dx); pt[2].y = roundr(y2 + dy); @@ -213,8 +212,8 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, break; case LineCapRound: - dx = -cos(M_PI_2 + theta) * size * invert; - dy = -sin(M_PI_2 + theta) * size * invert; + dx = -cos(M_PI_2 + theta) * size; + dy = -sin(M_PI_2 + theta) * size; pt[0].x = ((x2 - x1) >= 0 ? floorf(x2 - dx) : ceilf(x2 - dx)); pt[0].y = ((y2 - y1) >= 0 ? floorf(y2 - dy) : ceilf(y2 - dy));
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
96
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
Results per page:
10
25
50
100
200