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
November 2006
----- 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
792 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Added put_fontFamily implementation.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 7c478bf71943b2e0c9f004a087c1780e098fb114 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c478bf71943b2e0c9f004a08…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 17 13:05:48 2006 +0100 mshtml: Added put_fontFamily implementation. --- dlls/mshtml/htmlstyle.c | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 9bc0333..e9c6529 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -46,6 +46,33 @@ typedef struct { #define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl); +static const WCHAR attrFontFamily[] = + {'f','o','n','t','-','f','a','m','i','l','y',0}; + +static HRESULT set_style_attr(HTMLStyle *This, LPCWSTR name, LPCWSTR value) +{ + nsAString str_name, str_value, str_empty; + nsresult nsres; + + static const PRUnichar wszEmpty[] = {0}; + + TRACE("(%p)->(%s %s)\n", This, debugstr_w(name), debugstr_w(value)); + + nsAString_Init(&str_name, name); + nsAString_Init(&str_value, value); + nsAString_Init(&str_empty, wszEmpty); + + nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &str_name, &str_value, &str_empty); + if(NS_FAILED(nsres)) + ERR("SetProperty failed: %08x\n", nsres); + + nsAString_Finish(&str_name); + nsAString_Finish(&str_value); + nsAString_Finish(&str_empty); + + return S_OK; +} + #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface) static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv) @@ -135,8 +162,10 @@ static HRESULT WINAPI HTMLStyle_Invoke(I static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_attr(This, attrFontFamily, v); } static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
1
0
0
0
Jacek Caban : mshtml: Store nsIDOMCSSStyleDeclaration in HTMLStyle.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 5a9980e1b73c591c1f682cb6142b6fb19cc9012e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a9980e1b73c591c1f682cb61…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 17 13:05:01 2006 +0100 mshtml: Store nsIDOMCSSStyleDeclaration in HTMLStyle. --- dlls/mshtml/htmlelem.c | 23 +++++++++++++++++++++-- dlls/mshtml/htmlstyle.c | 7 ++++++- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/nsiface.idl | 30 ++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 57419b0..37abb51 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -243,11 +243,30 @@ static HRESULT WINAPI HTMLElement_get_pa static HRESULT WINAPI HTMLElement_get_style(IHTMLElement *iface, IHTMLStyle **p) { HTMLElement *This = HTMLELEM_THIS(iface); + nsIDOMElementCSSInlineStyle *nselemstyle; + nsIDOMCSSStyleDeclaration *nsstyle; + nsresult nsres; TRACE("(%p)->(%p)\n", This, p); - /* FIXME: Store IHTMLStyle instead of creating a new instance in every call. */ - *p = HTMLStyle_Create(); + nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMElementCSSInlineStyle, + (void**)&nselemstyle); + if(NS_FAILED(nsres)) { + ERR("Coud not get nsIDOMCSSStyleDeclaration interface: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, &nsstyle); + nsIDOMElementCSSInlineStyle_Release(nselemstyle); + if(NS_FAILED(nsres)) { + ERR("GetStyle failed: %08x\n", nsres); + return E_FAIL; + } + + /* FIXME: Store style instead of creating a new instance in each call */ + *p = HTMLStyle_Create(nsstyle); + + nsIDOMCSSStyleDeclaration_Release(nsstyle); return S_OK; } diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 57000d7..9bc0333 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -40,6 +40,8 @@ typedef struct { const IHTMLStyleVtbl *lpHTMLStyleVtbl; LONG ref; + + nsIDOMCSSStyleDeclaration *nsstyle; } HTMLStyle; #define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl); @@ -1578,12 +1580,15 @@ static const IHTMLStyleVtbl HTMLStyleVtb HTMLStyle_toString }; -IHTMLStyle *HTMLStyle_Create(void) +IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle) { HTMLStyle *ret = mshtml_alloc(sizeof(HTMLStyle)); ret->lpHTMLStyleVtbl = &HTMLStyleVtbl; ret->ref = 1; + ret->nsstyle = nsstyle; + + nsIDOMCSSStyleDeclaration_AddRef(nsstyle); return HTMLSTYLE(ret); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 287d574..abc283b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -329,7 +329,7 @@ void set_document_bscallback(HTMLDocumen IHlink *Hlink_Create(void); IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*); IHTMLTxtRange *HTMLTxtRange_Create(nsISelection*); -IHTMLStyle *HTMLStyle_Create(void); +IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*); void HTMLElement_Create(HTMLDOMNode*); void HTMLBodyElement_Create(HTMLElement*); diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 0e59bc9..39a9da7 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -110,6 +110,8 @@ typedef nsISupports nsIDOMHTMLCollection typedef nsISupports nsIDOMRange; typedef nsISupports nsIEditor; typedef nsISupports nsIWebProgressListener; +typedef nsISupports nsIDOMCSSValue; +typedef nsISupports nsIDOMCSSRule; [ object, @@ -377,6 +379,25 @@ interface nsIUploadChannel : nsISupports [ object, + uuid(a6cf90be-15b3-11d2-932e-00805f8add32) +] +interface nsIDOMCSSStyleDeclaration : nsISupports +{ + nsresult GetCssText(nsAString *aCssText); + nsresult SetCssText(const nsAString *aCssText); + nsresult GetPropertyValue(const nsAString *propertyName, nsAString *_retval); + nsresult GetPropertyCSSValue(const nsAString *propertyName, nsIDOMCSSValue **_retval); + nsresult RemoveProperty(const nsAString *propertyName, nsAString *_retval); + nsresult GetPropertyPriority(const nsAString *propertyName, nsAString *_retval); + nsresult SetProperty(const nsAString *propertyName, const nsAString *value, + const nsAString *priority); + nsresult GetLength(PRUint32 *aLength); + nsresult Item(PRUint32 index, nsAString *_retval); + nsresult GetParentRule(nsIDOMCSSRule **aParentRule); +} + +[ + object, uuid(a6cf907d-15b3-11d2-932e-00805f8add32) ] interface nsIDOMNodeList : nsISupports @@ -462,6 +483,15 @@ interface nsIDOMElement : nsIDOMNode PRBool *_retval); } +[ + object, + uuid(99715845-95fc-4a56-aa53-214b65c26e22) +] +interface nsIDOMElementCSSInlineStyle : nsISupports +{ + nsresult GetStyle(nsIDOMCSSStyleDeclaration **aStyle); +} + cpp_quote("#undef GetClassName"); [
1
0
0
0
Jacek Caban : mshtml: Added get_style implementation.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 5b1af5b7d16452794f600c05b9460118cea34478 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b1af5b7d16452794f600c05b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 17 13:04:06 2006 +0100 mshtml: Added get_style implementation. --- dlls/mshtml/Makefile.in | 1 + dlls/mshtml/htmlelem.c | 8 +- dlls/mshtml/htmlstyle.c | 1589 ++++++++++++++++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + 4 files changed, 1597 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5b1af5b7d16452794f600…
1
0
0
0
Alexandre Julliard : include: Install adshlp.h too.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 1447e6f63496a3d39631ffccc33a7ec464c2ac59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1447e6f63496a3d39631ffccc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 15:47:16 2006 +0100 include: Install adshlp.h too. --- include/Makefile.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/Makefile.in b/include/Makefile.in index c55919b..2dc8a68 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -70,6 +70,7 @@ WINDOWS_INCLUDES = \ $(WINDOWS_IDL_INCLUDES) \ accctrl.h \ aclapi.h \ + adshlp.h \ advpub.h \ appmgmt.h \ audevcod.h \
1
0
0
0
Alexandre Julliard : include: Get rid of heap.h.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 2731998ae6f08effced497ba115b67ab3232ecc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2731998ae6f08effced497ba1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 15:29:40 2006 +0100 include: Get rid of heap.h. --- dlls/wineps.drv/escape.c | 37 ++++++++++++++++++++++++++----------- dlls/wineps.drv/init.c | 10 +++++++--- dlls/winspool.drv/info.c | 23 +++++++++++++++++------ include/heap.h | 46 ---------------------------------------------- 4 files changed, 50 insertions(+), 66 deletions(-) diff --git a/dlls/wineps.drv/escape.c b/dlls/wineps.drv/escape.c index 3572084..dcc972e 100644 --- a/dlls/wineps.drv/escape.c +++ b/dlls/wineps.drv/escape.c @@ -28,7 +28,6 @@ #include "psdrv.h" #include "wine/debug.h" #include "winspool.h" -#include "heap.h" WINE_DEFAULT_DEBUG_CHANNEL(psdrv); @@ -434,22 +433,38 @@ INT PSDRV_StartDocA( PSDRV_PDEVICE *phys INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc ) { DOCINFOA docA; - INT ret; + INT ret, len; + LPSTR docname = NULL, output = NULL, datatype = NULL; docA.cbSize = doc->cbSize; - docA.lpszDocName = doc->lpszDocName ? - HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszDocName ) : NULL; - docA.lpszOutput = doc->lpszOutput ? - HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszOutput ) : NULL; - docA.lpszDatatype = doc->lpszDatatype ? - HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszDatatype ) : NULL; + if (doc->lpszDocName) + { + len = WideCharToMultiByte( CP_ACP, 0, doc->lpszDocName, -1, NULL, 0, NULL, NULL ); + if ((docname = HeapAlloc( GetProcessHeap(), 0, len ))) + WideCharToMultiByte( CP_ACP, 0, doc->lpszDocName, -1, docname, len, NULL, NULL ); + } + if (doc->lpszOutput) + { + len = WideCharToMultiByte( CP_ACP, 0, doc->lpszOutput, -1, NULL, 0, NULL, NULL ); + if ((output = HeapAlloc( GetProcessHeap(), 0, len ))) + WideCharToMultiByte( CP_ACP, 0, doc->lpszOutput, -1, output, len, NULL, NULL ); + } + if (doc->lpszDatatype) + { + len = WideCharToMultiByte( CP_ACP, 0, doc->lpszDatatype, -1, NULL, 0, NULL, NULL ); + if ((datatype = HeapAlloc( GetProcessHeap(), 0, len ))) + WideCharToMultiByte( CP_ACP, 0, doc->lpszDatatype, -1, datatype, len, NULL, NULL ); + } + docA.lpszDocName = docname; + docA.lpszOutput = output; + docA.lpszDatatype = datatype; docA.fwType = doc->fwType; ret = PSDRV_StartDocA(physDev, &docA); - HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszDocName ); - HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszOutput ); - HeapFree( GetProcessHeap(), 0, (LPSTR)docA.lpszDatatype ); + HeapFree( GetProcessHeap(), 0, docname ); + HeapFree( GetProcessHeap(), 0, output ); + HeapFree( GetProcessHeap(), 0, datatype ); return ret; } diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 0868e22..8ec88b5 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -22,6 +22,7 @@ #include "config.h" #include "wine/port.h" +#include <stdarg.h> #include <string.h> #ifdef HAVE_UNISTD_H # include <unistd.h> @@ -33,13 +34,14 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#include "wine/debug.h" +#include "windef.h" +#include "winbase.h" #include "winerror.h" #include "wownt32.h" -#include "heap.h" #include "winreg.h" #include "psdrv.h" #include "winspool.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(psdrv); @@ -353,7 +355,9 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEV physDev->logPixelsY = physDev->pi->ppd->DefaultResolution; if (output) { - physDev->job.output = HEAP_strdupWtoA( PSDRV_Heap, 0, output ); + INT len = WideCharToMultiByte( CP_ACP, 0, output, -1, NULL, 0, NULL, NULL ); + if ((physDev->job.output = HeapAlloc( PSDRV_Heap, 0, len ))) + WideCharToMultiByte( CP_ACP, 0, output, -1, physDev->job.output, len, NULL, NULL ); } else physDev->job.output = NULL; physDev->job.hJob = 0; diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 8759257..38e4dc8 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -58,7 +58,6 @@ #include "wine/unicode.h" #include "wine/debug.h" #include "wine/list.h" -#include "heap.h" #include "winnls.h" #include "ddk/winsplp.h" @@ -332,6 +331,18 @@ static LPWSTR strdupW(LPCWSTR p) return ret; } +static LPSTR strdupWtoA( LPCWSTR str ) +{ + LPSTR ret; + INT len; + + if (!str) return NULL; + len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); + ret = HeapAlloc( GetProcessHeap(), 0, len ); + if(ret) WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); + return ret; +} + /* Returns the number of bytes in an ansi \0\0 terminated string (multi_sz). The result includes all \0s (specifically the last two). */ static int multi_sz_lenA(const char *str) @@ -1589,8 +1600,8 @@ INT WINAPI DeviceCapabilitiesW(LPCWSTR p const DEVMODEW *pDevMode) { LPDEVMODEA dmA = DEVMODEdupWtoA(GetProcessHeap(), pDevMode); - LPSTR pDeviceA = HEAP_strdupWtoA(GetProcessHeap(),0,pDevice); - LPSTR pPortA = HEAP_strdupWtoA(GetProcessHeap(),0,pPort); + LPSTR pDeviceA = strdupWtoA(pDevice); + LPSTR pPortA = strdupWtoA(pPort); INT ret; if(pOutput && (fwCapability == DC_BINNAMES || @@ -1653,7 +1664,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWn SetLastError(ERROR_INVALID_HANDLE); return -1; } - lpName = HEAP_strdupWtoA(GetProcessHeap(),0,lpNameW); + lpName = strdupWtoA(lpNameW); } if (!GDI_CallExtDeviceMode16) @@ -1685,7 +1696,7 @@ LONG WINAPI DocumentPropertiesW(HWND hWn LPDEVMODEW pDevModeInput, DWORD fMode) { - LPSTR pDeviceNameA = HEAP_strdupWtoA(GetProcessHeap(),0,pDeviceName); + LPSTR pDeviceNameA = strdupWtoA(pDeviceName); LPDEVMODEA pDevModeInputA = DEVMODEdupWtoA(GetProcessHeap(),pDevModeInput); LPDEVMODEA pDevModeOutputA = NULL; LONG ret; @@ -3228,7 +3239,7 @@ static BOOL WINSPOOL_GetStringFromReg(HK if(unicode) ret = RegQueryValueExW(hkey, ValueName, 0, &type, ptr, &sz); else { - LPSTR ValueNameA = HEAP_strdupWtoA(GetProcessHeap(),0,ValueName); + LPSTR ValueNameA = strdupWtoA(ValueName); ret = RegQueryValueExA(hkey, ValueNameA, 0, &type, ptr, &sz); HeapFree(GetProcessHeap(),0,ValueNameA); } diff --git a/include/heap.h b/include/heap.h deleted file mode 100644 index b0432f7..0000000 --- a/include/heap.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Win32 heap definitions - * - * Copyright 1996 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_HEAP_H -#define __WINE_HEAP_H - -#include <stdarg.h> -#include <string.h> - -#include <windef.h> -#include <winbase.h> -#include <winnls.h> - -/* strdup macros */ -/* DO NOT USE IT!! it will go away soon */ - -inline static LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str ) -{ - LPSTR ret; - INT len; - - if (!str) return NULL; - len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); - ret = HeapAlloc( heap, flags, len ); - if(ret) WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); - return ret; -} - -#endif /* __WINE_HEAP_H */
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the gdi.h include.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 75b8f88875050573a0565ff996cd09ea16ee566e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=75b8f88875050573a0565ff99…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:52:07 2006 +0100 gdi32: Get rid of the gdi.h include. --- dlls/gdi32/bidi.c | 1 - dlls/gdi32/bitblt.c | 6 ++++- dlls/gdi32/bitmap.c | 6 +++- dlls/gdi32/brush.c | 1 - dlls/gdi32/clipping.c | 1 - dlls/gdi32/dc.c | 1 - dlls/gdi32/dib.c | 1 - dlls/gdi32/driver.c | 1 - dlls/gdi32/enhmetafile.c | 1 - dlls/gdi32/enhmfdrv/bitblt.c | 1 - dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 - dlls/gdi32/enhmfdrv/graphics.c | 5 +++- dlls/gdi32/enhmfdrv/init.c | 1 - dlls/gdi32/enhmfdrv/objects.c | 1 - dlls/gdi32/env.c | 6 ++++- dlls/gdi32/font.c | 1 - dlls/gdi32/freetype.c | 1 - dlls/gdi32/gdi16.c | 1 - dlls/gdi32/gdi_main.c | 1 - dlls/gdi32/gdi_private.h | 3 ++ dlls/gdi32/gdiobj.c | 1 - dlls/gdi32/mapping.c | 6 ++++- dlls/gdi32/metafile.c | 5 +++- dlls/gdi32/metafile16.c | 1 - dlls/gdi32/mfdrv/bitblt.c | 1 - dlls/gdi32/mfdrv/graphics.c | 1 - dlls/gdi32/mfdrv/init.c | 1 - dlls/gdi32/mfdrv/mapping.c | 1 - dlls/gdi32/mfdrv/metafiledrv.h | 1 - dlls/gdi32/mfdrv/objects.c | 1 - dlls/gdi32/opengl.c | 1 - dlls/gdi32/painting.c | 1 - dlls/gdi32/palette.c | 3 +- dlls/gdi32/path.c | 1 - dlls/gdi32/pen.c | 1 - dlls/gdi32/printdrv.c | 1 - dlls/gdi32/region.c | 1 - dlls/gdi32/wing.c | 5 +++- dlls/winex11.drv/x11ddraw.c | 4 ++- dlls/winex11.drv/xrender.c | 1 - include/gdi.h | 39 ---------------------------------- include/wingdi.h | 8 +++++++ 42 files changed, 47 insertions(+), 79 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=75b8f88875050573a0565…
1
0
0
0
Alexandre Julliard : gdi32: Stop exporting GDI_GetObjPtr and GDI_ReleaseObj .
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 456891b37771583ab70f72687ba9343aed582b8f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=456891b37771583ab70f72687…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:39:04 2006 +0100 gdi32: Stop exporting GDI_GetObjPtr and GDI_ReleaseObj. --- dlls/gdi32/gdi32.spec | 6 ------ dlls/gdi32/gdi_private.h | 37 +++++++++++++++++++++++++++++++++++++ include/gdi.h | 43 ------------------------------------------- 3 files changed, 37 insertions(+), 49 deletions(-) diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index cea9a5c..10ec996 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -528,9 +528,3 @@ # GDI objects @ cdecl __wine_make_gdi_object_system(long long) - -################################################################ -# Wine dll separation hacks, these will go away, don't use them -# -@ cdecl GDI_GetObjPtr(long long) -@ cdecl GDI_ReleaseObj(long) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 31130a6..f4d8900 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -39,6 +39,33 @@ typedef struct { /* extra stock object: default 1x1 bitmap for memory DCs */ #define DEFAULT_BITMAP (STOCK_LAST+1) + /* GDI objects magic numbers */ +#define FIRST_MAGIC 0x4f47 +#define PEN_MAGIC 0x4f47 +#define BRUSH_MAGIC 0x4f48 +#define FONT_MAGIC 0x4f49 +#define PALETTE_MAGIC 0x4f4a +#define BITMAP_MAGIC 0x4f4b +#define REGION_MAGIC 0x4f4c +#define DC_MAGIC 0x4f4d +#define DISABLED_DC_MAGIC 0x4f4e +#define META_DC_MAGIC 0x4f4f +#define METAFILE_MAGIC 0x4f50 +#define METAFILE_DC_MAGIC 0x4f51 +#define ENHMETAFILE_MAGIC 0x4f52 +#define ENHMETAFILE_DC_MAGIC 0x4f53 +#define MEMORY_DC_MAGIC 0x4f54 +#define EXT_PEN_MAGIC 0x4f55 +#define LAST_MAGIC 0x4f55 + +#define MAGIC_DONTCARE 0xffff + +/* GDI constants for making objects private/system (naming undoc. !) */ +#define OBJECT_PRIVATE 0x2000 +#define OBJECT_NOSYSTEM 0x8000 + +#define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM)) + struct gdi_obj_funcs { HGDIOBJ (*pSelectObject)( HGDIOBJ handle, void *obj, HDC hdc ); @@ -55,6 +82,14 @@ struct hdc_list struct hdc_list *next; }; +typedef struct tagGDIOBJHDR +{ + WORD wMagic; + DWORD dwCount; + const struct gdi_obj_funcs *funcs; + struct hdc_list *hdcs; +} GDIOBJHDR; + /* Device functions for the Wine driver interface */ typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */ @@ -406,6 +441,8 @@ extern BOOL GDI_Init(void); extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs ); extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj ); extern BOOL GDI_FreeObject( HGDIOBJ, void *obj ); +extern void *GDI_GetObjPtr( HGDIOBJ, WORD ); +extern void GDI_ReleaseObj( HGDIOBJ ); extern void GDI_CheckNotLock(void); extern BOOL GDI_hdc_using_object(HGDIOBJ obj, HDC hdc); extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc); diff --git a/include/gdi.h b/include/gdi.h index 487e78c..a5ad7f4 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -28,51 +28,8 @@ #include <wine/wingdi16.h> #include <math.h> - /* GDI objects magic numbers */ -#define FIRST_MAGIC 0x4f47 -#define PEN_MAGIC 0x4f47 -#define BRUSH_MAGIC 0x4f48 -#define FONT_MAGIC 0x4f49 -#define PALETTE_MAGIC 0x4f4a -#define BITMAP_MAGIC 0x4f4b -#define REGION_MAGIC 0x4f4c -#define DC_MAGIC 0x4f4d -#define DISABLED_DC_MAGIC 0x4f4e -#define META_DC_MAGIC 0x4f4f -#define METAFILE_MAGIC 0x4f50 -#define METAFILE_DC_MAGIC 0x4f51 -#define ENHMETAFILE_MAGIC 0x4f52 -#define ENHMETAFILE_DC_MAGIC 0x4f53 -#define MEMORY_DC_MAGIC 0x4f54 -#define EXT_PEN_MAGIC 0x4f55 -#define LAST_MAGIC 0x4f55 - -#define MAGIC_DONTCARE 0xffff - -/* GDI constants for making objects private/system (naming undoc. !) */ -#define OBJECT_PRIVATE 0x2000 -#define OBJECT_NOSYSTEM 0x8000 - -#define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM)) - -struct gdi_obj_funcs; -struct hdc_list; - -typedef struct tagGDIOBJHDR -{ - WORD wMagic; - DWORD dwCount; - const struct gdi_obj_funcs *funcs; - struct hdc_list *hdcs; -} GDIOBJHDR; - #define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */ - /* GDI local heap */ - -extern void *GDI_GetObjPtr( HGDIOBJ, WORD ); -extern void GDI_ReleaseObj( HGDIOBJ ); - /* GetGlyphOutline */ #define WINE_GGO_GRAY16_BITMAP 0x7f
1
0
0
0
Alexandre Julliard : winex11.drv: Store the palette mapping in an X context instead of the GDI object.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 5e7afb8c3bda9cff32d698220d9511b1e90892de URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e7afb8c3bda9cff32d698220…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:38:43 2006 +0100 winex11.drv: Store the palette mapping in an X context instead of the GDI object. --- dlls/winex11.drv/palette.c | 59 +++++++++++++++++++++++++------------ dlls/winex11.drv/winex11.drv.spec | 1 + 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index 026b28c..7ccfed7 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -20,11 +20,12 @@ #include "config.h" +#include <stdarg.h> #include <stdlib.h> #include <string.h> -#include "gdi.h" #include "windef.h" +#include "winbase.h" #include "winreg.h" #include "x11drv.h" #include "wine/debug.h" @@ -48,6 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); *
http://premium.microsoft.com/msdn/library/techart/f30/f34/f40/d4d/sa942.htm
*/ +#define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */ + #define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */ #define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */ @@ -81,6 +84,8 @@ static int palette_size; static int X11DRV_PALETTE_firstFree = 0; static unsigned char X11DRV_PALETTE_freeList[256]; +static XContext palette_context; /* X context to associate a color mapping to a palette */ + /**********************************************************************/ /* Map an EGA index (0..15) to a pixel value in the system color space. */ @@ -114,14 +119,11 @@ static int X11DRV_PALETTE_LookupSystemXP */ static int *palette_get_mapping( HPALETTE hpal ) { - int *mapping = NULL; - PALETTEOBJ *ptr; + int *mapping; - if ((ptr = GDI_GetObjPtr( hpal, PALETTE_MAGIC ))) - { - mapping = ptr->mapping; - GDI_ReleaseObj( hpal ); - } + wine_tsx11_lock(); + if (XFindContext( gdi_display, (XID)hpal, palette_context, (char **)&mapping )) mapping = NULL; + wine_tsx11_unlock(); return mapping; } @@ -129,18 +131,11 @@ static int *palette_get_mapping( HPALETT /*********************************************************************** * palette_set_mapping */ -static int *palette_set_mapping( HPALETTE hpal, int *mapping ) +static void palette_set_mapping( HPALETTE hpal, int *mapping ) { - int *old_mapping = NULL; - PALETTEOBJ *ptr; - - if ((ptr = GDI_GetObjPtr( hpal, PALETTE_MAGIC ))) - { - old_mapping = ptr->mapping; - ptr->mapping = mapping; - GDI_ReleaseObj( hpal ); - } - return old_mapping; + wine_tsx11_lock(); + XSaveContext( gdi_display, (XID)hpal, palette_context, (char *)mapping ); + wine_tsx11_unlock(); } @@ -153,10 +148,14 @@ int X11DRV_PALETTE_Init(void) { int mask, white, black; int monoPlane; + int *mapping; PALETTEENTRY sys_pal_template[NB_RESERVED_COLORS]; TRACE("initializing palette manager...\n"); + wine_tsx11_lock(); + palette_context = XUniqueContext(); + wine_tsx11_unlock(); white = WhitePixel( gdi_display, DefaultScreen(gdi_display) ); black = BlackPixel( gdi_display, DefaultScreen(gdi_display) ); monoPlane = 1; @@ -244,6 +243,9 @@ int X11DRV_PALETTE_Init(void) GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, sys_pal_template ); + if ((mapping = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int) * NB_RESERVED_COLORS ))) + palette_set_mapping( GetStockObject(DEFAULT_PALETTE), mapping ); + if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) { palette_size = 0; @@ -1195,6 +1197,25 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVI return iRemapped; } + +/*********************************************************************** + * UnrealizePalette (X11DRV.@) + */ +BOOL X11DRV_UnrealizePalette( HPALETTE hpal ) +{ + int *mapping = palette_get_mapping( hpal ); + + if (mapping) + { + wine_tsx11_lock(); + XDeleteContext( gdi_display, (XID)hpal, palette_context ); + wine_tsx11_unlock(); + HeapFree( GetProcessHeap(), 0, mapping ); + } + return TRUE; +} + + /*********************************************************************** * GetSystemPaletteEntries (X11DRV.@) */ diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec index e6dc141..92756a6 100644 --- a/dlls/winex11.drv/winex11.drv.spec +++ b/dlls/winex11.drv/winex11.drv.spec @@ -59,6 +59,7 @@ @ cdecl SetTextColor(ptr long) X11DRV_SetTextColor @ cdecl StretchBlt(ptr long long long long ptr long long long long long) X11DRV_StretchBlt @ cdecl SwapBuffers(ptr) X11DRV_SwapBuffers +@ cdecl UnrealizePalette(long) X11DRV_UnrealizePalette # USER driver
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the palette mapping handling and leave it up to the driver.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: bb51f96907fc3c6eb7691aa8eaf650b9e71e61fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb51f96907fc3c6eb7691aa8e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:38:11 2006 +0100 gdi32: Get rid of the palette mapping handling and leave it up to the driver. --- dlls/gdi32/driver.c | 1 + dlls/gdi32/enhmfdrv/init.c | 1 + dlls/gdi32/gdi_private.h | 1 + dlls/gdi32/mfdrv/init.c | 1 + dlls/gdi32/palette.c | 82 ++++++++++++++++---------------------------- include/gdi.h | 9 ----- 6 files changed, 34 insertions(+), 61 deletions(-) diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index f5ff9af..f08141c 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -193,6 +193,7 @@ static struct graphics_driver *create_dr GET_FUNC(StrokeAndFillPath); GET_FUNC(StrokePath); GET_FUNC(SwapBuffers); + GET_FUNC(UnrealizePalette); GET_FUNC(WidenPath); /* OpenGL32 */ diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 119bf76..1191c72 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -152,6 +152,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */ EMFDRV_StrokePath, /* pStrokePath */ NULL, /* pSwapBuffers */ + NULL, /* pUnrealizePalette */ EMFDRV_WidenPath /* pWidenPath */ }; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 0d3f1d0..31130a6 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -181,6 +181,7 @@ typedef struct tagDC_FUNCS BOOL (*pStrokeAndFillPath)(PHYSDEV); BOOL (*pStrokePath)(PHYSDEV); BOOL (*pSwapBuffers)(PHYSDEV); + BOOL (*pUnrealizePalette)(HPALETTE); BOOL (*pWidenPath)(PHYSDEV); /* OpenGL32 */ diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 82fe4ce..ab3ec3e 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -152,6 +152,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */ MFDRV_StrokePath, /* pStrokePath */ NULL, /* pSwapBuffers */ + NULL, /* pUnrealizePalette */ MFDRV_WidenPath /* pWidenPath */ }; diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index c136656..98d6a69 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -39,6 +39,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); +typedef struct tagPALETTEOBJ +{ + GDIOBJHDR header; + const DC_FUNCTIONS *funcs; /* DC function table */ + LOGPALETTE logpalette; /* _MUST_ be the last field */ +} PALETTEOBJ; + static INT PALETTE_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ); static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj ); static BOOL PALETTE_DeleteObject( HGDIOBJ handle, void *obj ); @@ -62,7 +69,6 @@ static UINT SystemPaletteUse = SYSPAL_ST static HPALETTE hPrimaryPalette = 0; /* used for WM_PALETTECHANGED */ static HPALETTE hLastRealizedPalette = 0; /* UnrealizeObject() needs it */ -static const DC_FUNCTIONS *pLastRealizedDC; static const PALETTEENTRY sys_pal_template[NB_RESERVED_COLORS] = { @@ -106,7 +112,6 @@ HPALETTE PALETTE_Init(void) { HPALETTE hpalette; LOGPALETTE * palPtr; - PALETTEOBJ* palObj; /* create default palette (20 system colors) */ @@ -119,14 +124,6 @@ HPALETTE PALETTE_Init(void) memcpy( palPtr->palPalEntry, sys_pal_template, sizeof(sys_pal_template) ); hpalette = CreatePalette( palPtr ); HeapFree( GetProcessHeap(), 0, palPtr ); - - palObj = (PALETTEOBJ*) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); - if (palObj) - { - if (!(palObj->mapping = HeapAlloc( GetProcessHeap(), 0, sizeof(int) * NB_RESERVED_COLORS ))) - ERR("Cannot create palette mapping -- out of memory!\n"); - GDI_ReleaseObj( hpalette ); - } return hpalette; } @@ -156,7 +153,7 @@ HPALETTE WINAPI CreatePalette( PALETTE_MAGIC, (HGDIOBJ *)&hpalette, &palette_funcs ))) return 0; memcpy( &palettePtr->logpalette, palette, size ); - palettePtr->mapping = NULL; + palettePtr->funcs = NULL; GDI_ReleaseObj( hpalette ); TRACE(" returning %p\n", hpalette); @@ -368,7 +365,6 @@ BOOL WINAPI ResizePalette( PALETTEOBJ * palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC ); UINT cPrevEnt, prevVer; int prevsize, size = sizeof(LOGPALETTE) + (cEntries - 1) * sizeof(PALETTEENTRY); - int* mapping = NULL; TRACE("hpal = %p, prev = %i, new = %i\n", hPal, palPtr ? palPtr->logpalette.palNumEntries : -1, cEntries ); @@ -378,28 +374,12 @@ BOOL WINAPI ResizePalette( prevsize = sizeof(LOGPALETTE) + (cPrevEnt - 1) * sizeof(PALETTEENTRY) + sizeof(int*) + sizeof(GDIOBJHDR); size += sizeof(int*) + sizeof(GDIOBJHDR); - mapping = palPtr->mapping; if (!(palPtr = GDI_ReallocObject( size, hPal, palPtr ))) return FALSE; - if( mapping ) - { - int *newMap = HeapReAlloc(GetProcessHeap(), 0, mapping, cEntries * sizeof(int) ); - if(newMap == NULL) - { - ERR("Cannot resize mapping -- out of memory!\n"); - GDI_ReleaseObj( hPal ); - return FALSE; - } - palPtr->mapping = newMap; - } + PALETTE_UnrealizeObject( hPal, palPtr ); - if( cEntries > cPrevEnt ) - { - if( mapping ) - memset(palPtr->mapping + cPrevEnt, 0, (cEntries - cPrevEnt)*sizeof(int)); - memset( (BYTE*)palPtr + prevsize, 0, size - prevsize ); - } + if( cEntries > cPrevEnt ) memset( (BYTE*)palPtr + prevsize, 0, size - prevsize ); palPtr->logpalette.palNumEntries = cEntries; palPtr->logpalette.palVersion = prevVer; GDI_ReleaseObj( hPal ); @@ -458,14 +438,10 @@ BOOL WINAPI AnimatePalette( TRACE("Not animating entry %d -- not PC_RESERVED\n", StartIndex); } } - - GDI_ReleaseObj( hPal ); - - TRACE("pLastRealizedDC %p -- pLastRealizedDC->pRealizePalette %p\n", - pLastRealizedDC, pLastRealizedDC ? pLastRealizedDC->pRealizePalette : 0); + if (palPtr->funcs && palPtr->funcs->pRealizePalette) + palPtr->funcs->pRealizePalette( NULL, hPal, hPal == hPrimaryPalette ); - if (pLastRealizedDC && pLastRealizedDC->pRealizePalette) - pLastRealizedDC->pRealizePalette( NULL, hPal, hPal == hPrimaryPalette ); + GDI_ReleaseObj( hPal ); } return TRUE; } @@ -678,14 +654,17 @@ static BOOL PALETTE_UnrealizeObject( HGD { PALETTEOBJ *palette = obj; - HeapFree( GetProcessHeap(), 0, palette->mapping ); - palette->mapping = NULL; + if (palette->funcs) + { + if (palette->funcs->pUnrealizePalette) + palette->funcs->pUnrealizePalette( handle ); + palette->funcs = NULL; + } if (hLastRealizedPalette == handle) { TRACE("unrealizing palette %p\n", handle); hLastRealizedPalette = 0; - pLastRealizedDC = NULL; } return TRUE; } @@ -696,15 +675,7 @@ static BOOL PALETTE_UnrealizeObject( HGD */ static BOOL PALETTE_DeleteObject( HGDIOBJ handle, void *obj ) { - PALETTEOBJ *palette = obj; - - HeapFree( GetProcessHeap(), 0, palette->mapping ); - if (hLastRealizedPalette == handle) - { - TRACE("unrealizing palette %p\n", handle); - hLastRealizedPalette = 0; - pLastRealizedDC = NULL; - } + PALETTE_UnrealizeObject( handle, obj ); return GDI_FreeObject( handle, obj ); } @@ -758,10 +729,17 @@ UINT WINAPI GDIRealizePalette( HDC hdc ) else if(dc->hPalette != hLastRealizedPalette ) { if (dc->funcs->pRealizePalette) - realized = dc->funcs->pRealizePalette( dc->physDev, dc->hPalette, - (dc->hPalette == hPrimaryPalette) ); + { + PALETTEOBJ *palPtr = GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC ); + if (palPtr) + { + realized = dc->funcs->pRealizePalette( dc->physDev, dc->hPalette, + (dc->hPalette == hPrimaryPalette) ); + palPtr->funcs = dc->funcs; + GDI_ReleaseObj( dc->hPalette ); + } + } hLastRealizedPalette = dc->hPalette; - pLastRealizedDC = dc->funcs; } else TRACE(" skipping (hLastRealizedPalette = %p)\n", hLastRealizedPalette); diff --git a/include/gdi.h b/include/gdi.h index 49b231f..487e78c 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -66,17 +66,8 @@ typedef struct tagGDIOBJHDR struct hdc_list *hdcs; } GDIOBJHDR; -/* palette object */ - #define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */ -typedef struct tagPALETTEOBJ -{ - GDIOBJHDR header; - int *mapping; - LOGPALETTE logpalette; /* _MUST_ be the last field */ -} PALETTEOBJ; - /* GDI local heap */ extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
1
0
0
0
Alexandre Julliard : winex11.drv: Abstract accesses to the palette color mapping.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 719b7068a95659baff94598b561aa730c64537bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=719b7068a95659baff94598b5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:36:34 2006 +0100 winex11.drv: Abstract accesses to the palette color mapping. --- dlls/winex11.drv/palette.c | 143 ++++++++++++++++++++----------------------- 1 files changed, 67 insertions(+), 76 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=719b7068a95659baff945…
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
80
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
Results per page:
10
25
50
100
200