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
May 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
863 discussions
Start a n
N
ew thread
Alexandre Julliard : user: Moved Get/SetClassLong16 to wnd16.c.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: a9c5fd26129fd1d728cd1703e98daab5399bb659 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a9c5fd26129fd1d728cd170…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 17:08:05 2006 +0200 user: Moved Get/SetClassLong16 to wnd16.c. --- dlls/user/class.c | 117 ----------------------------------------------------- dlls/user/wnd16.c | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 117 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index f1f82cf..5e20cb4 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -53,7 +53,6 @@ typedef struct tagCLASS INT cbClsExtra; /* Class extra bytes */ INT cbWndExtra; /* Window extra bytes */ LPWSTR menuName; /* Default menu name (Unicode followed by ASCII) */ - SEGPTR segMenuName; /* Default menu name as SEGPTR */ HINSTANCE hInstance; /* Module that created the task */ HICON hIcon; /* Default icon */ HICON hIconSm; /* Default small icon */ @@ -149,18 +148,6 @@ static BOOL set_server_info( HWND hwnd, * * Get the class winproc for a given proc type */ -static WNDPROC16 CLASS_GetProc16( CLASS *classPtr ) -{ - if (classPtr->winprocA) return WINPROC_GetProc16( classPtr->winprocA, FALSE ); - else return WINPROC_GetProc16( classPtr->winprocW, TRUE ); -} - - -/*********************************************************************** - * CLASS_GetProc - * - * Get the class winproc for a given proc type - */ static WNDPROC CLASS_GetProc( CLASS *classPtr, BOOL unicode ) { WNDPROC proc = classPtr->winprocA; @@ -177,29 +164,6 @@ static WNDPROC CLASS_GetProc( CLASS *cla /*********************************************************************** - * CLASS_SetProc16 - * - * Set the class winproc for a given proc type. - * Returns the previous window proc. - */ -static void CLASS_SetProc16( CLASS *classPtr, WNDPROC16 newproc ) -{ - WNDPROC proc = WINPROC_AllocProc16( newproc ); - - if (WINPROC_IsUnicode( proc, FALSE )) - { - classPtr->winprocA = 0; - classPtr->winprocW = proc; - } - else - { - classPtr->winprocA = proc; - classPtr->winprocW = 0; - } -} - - -/*********************************************************************** * CLASS_SetProc * * Set the class winproc for a given proc type. @@ -235,20 +199,6 @@ inline static LPSTR CLASS_GetMenuNameA( /*********************************************************************** - * CLASS_GetMenuName16 - * - * Get the menu name as a SEGPTR. - */ -inline static SEGPTR CLASS_GetMenuName16( CLASS *classPtr ) -{ - if (!HIWORD(classPtr->menuName)) return (SEGPTR)classPtr->menuName; - if (!classPtr->segMenuName) - classPtr->segMenuName = MapLS( CLASS_GetMenuNameA(classPtr) ); - return classPtr->segMenuName; -} - - -/*********************************************************************** * CLASS_GetMenuNameW * * Get the menu name as a Unicode string. @@ -266,8 +216,6 @@ inline static LPWSTR CLASS_GetMenuNameW( */ static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name ) { - UnMapLS( classPtr->segMenuName ); - classPtr->segMenuName = 0; if (HIWORD(classPtr->menuName)) HeapFree( GetProcessHeap(), 0, classPtr->menuName ); if (HIWORD(name)) { @@ -288,8 +236,6 @@ static void CLASS_SetMenuNameA( CLASS *c */ static void CLASS_SetMenuNameW( CLASS *classPtr, LPCWSTR name ) { - UnMapLS( classPtr->segMenuName ); - classPtr->segMenuName = 0; if (HIWORD(classPtr->menuName)) HeapFree( GetProcessHeap(), 0, classPtr->menuName ); if (HIWORD(name)) { @@ -318,7 +264,6 @@ static void CLASS_FreeClass( CLASS *clas list_remove( &classPtr->entry ); if (classPtr->hbrBackground > (HBRUSH)(COLOR_GRADIENTINACTIVECAPTION + 1)) DeleteObject( classPtr->hbrBackground ); - UnMapLS( classPtr->segMenuName ); HeapFree( GetProcessHeap(), 0, classPtr->menuName ); HeapFree( GetProcessHeap(), 0, classPtr ); USER_Unlock(); @@ -742,40 +687,6 @@ WORD WINAPI GetClassWord( HWND hwnd, INT /*********************************************************************** - * GetClassLong (USER.131) - */ -LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset ) -{ - CLASS *class; - LONG ret; - HWND hwnd = (HWND)(ULONG_PTR)hwnd16; /* no need for full handle */ - - TRACE("%p %d\n",hwnd, offset); - - switch( offset ) - { - case GCLP_WNDPROC: - if (!(class = get_class_ptr( hwnd, FALSE ))) return 0; - if (class == CLASS_OTHER_PROCESS) break; - ret = (LONG)CLASS_GetProc16( class ); - release_class_ptr( class ); - return ret; - case GCLP_MENUNAME: - if (!(class = get_class_ptr( hwnd, FALSE ))) return 0; - if (class == CLASS_OTHER_PROCESS) break; - ret = (LONG)CLASS_GetMenuName16( class ); - release_class_ptr( class ); - return ret; - default: - return GetClassLongA( hwnd, offset ); - } - FIXME( "offset %d not supported on other process window %p\n", offset, hwnd ); - SetLastError( ERROR_INVALID_HANDLE ); - return 0; -} - - -/*********************************************************************** * GetClassLongW (USER32.@) */ DWORD WINAPI GetClassLongW( HWND hwnd, INT offset ) @@ -955,34 +866,6 @@ WORD WINAPI SetClassWord( HWND hwnd, INT /*********************************************************************** - * SetClassLong (USER.132) - */ -LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval ) -{ - CLASS *class; - LONG retval; - HWND hwnd = (HWND)(ULONG_PTR)hwnd16; /* no need for full handle */ - - TRACE("%p %d %lx\n", hwnd, offset, newval); - - switch(offset) - { - case GCLP_WNDPROC: - if (!(class = get_class_ptr( hwnd, TRUE ))) return 0; - retval = (LONG)CLASS_GetProc16( class ); - CLASS_SetProc16( class, (WNDPROC16)newval ); - release_class_ptr( class ); - return retval; - case GCLP_MENUNAME: - newval = (LONG)MapSL( newval ); - /* fall through */ - default: - return SetClassLongA( hwnd, offset, newval ); - } -} - - -/*********************************************************************** * SetClassLongW (USER32.@) */ DWORD WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval ) diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index 5471f36..727415b 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -661,6 +661,47 @@ WORD WINAPI SetClassWord16( HWND16 hwnd, } +/*********************************************************************** + * GetClassLong (USER.131) + */ +LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset ) +{ + LONG_PTR ret = GetClassLongA( WIN_Handle32(hwnd16), offset ); + + switch( offset ) + { + case GCLP_WNDPROC: + return (LONG_PTR)WINPROC_GetProc16( (WNDPROC)ret, FALSE ); + case GCLP_MENUNAME: + return MapLS( (void *)ret ); /* leak */ + default: + return ret; + } +} + + +/*********************************************************************** + * SetClassLong (USER.132) + */ +LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval ) +{ + switch( offset ) + { + case GCLP_WNDPROC: + { + WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval ); + WNDPROC old_proc = (WNDPROC)SetClassLongA( WIN_Handle32(hwnd16), offset, (LONG_PTR)new_proc ); + return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE ); + } + case GCLP_MENUNAME: + newval = (LONG)MapSL( newval ); + /* fall through */ + default: + return SetClassLongA( WIN_Handle32(hwnd16), offset, newval ); + } +} + + /************************************************************************** * GetWindowWord (USER.133) */
1
0
0
0
Alexandre Julliard : user: Have WINPROC_GetProc16 allocate a new winproc if necessary.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 56220c246bbe86826c540c6508217eb5e6e62697 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=56220c246bbe86826c540c6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 16:55:55 2006 +0200 user: Have WINPROC_GetProc16 allocate a new winproc if necessary. --- dlls/user/class.c | 5 ++-- dlls/user/msg16.c | 2 +- dlls/user/win.c | 4 ++- dlls/user/winproc.c | 64 +++++++++++++++++++++++++++++---------------------- dlls/user/winproc.h | 2 +- dlls/user/wnd16.c | 3 +- 6 files changed, 43 insertions(+), 37 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index e9aec25..f1f82cf 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -151,9 +151,8 @@ static BOOL set_server_info( HWND hwnd, */ static WNDPROC16 CLASS_GetProc16( CLASS *classPtr ) { - WNDPROC proc = classPtr->winprocA; - if (!proc) proc = classPtr->winprocW; - return WINPROC_GetProc16( proc ); + if (classPtr->winprocA) return WINPROC_GetProc16( classPtr->winprocA, FALSE ); + else return WINPROC_GetProc16( classPtr->winprocW, TRUE ); } diff --git a/dlls/user/msg16.c b/dlls/user/msg16.c index db3da01..e61fef3 100644 --- a/dlls/user/msg16.c +++ b/dlls/user/msg16.c @@ -369,7 +369,7 @@ LONG WINAPI DispatchMessage16( const MSG else SetLastError( ERROR_INVALID_WINDOW_HANDLE ); return 0; } - winproc = WINPROC_GetProc16( wndPtr->winproc ); + winproc = WINPROC_GetProc16( wndPtr->winproc, wndPtr->flags & WIN_ISUNICODE ); WIN_ReleasePtr( wndPtr ); SPY_EnterMessage( SPY_DISPATCHMESSAGE16, hwnd, msg->message, msg->wParam, msg->lParam ); diff --git a/dlls/user/win.c b/dlls/user/win.c index 5a785c5..d79cd03 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -2162,7 +2162,7 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd } } retvalue = GetWindowLongA( WIN_Handle32(hwnd), offset ); - if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc16( (WNDPROC)retvalue ); + if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc16( (WNDPROC)retvalue, FALSE ); return retvalue; } @@ -2212,7 +2212,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd { WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval ); WNDPROC old_proc = (WNDPROC)SetWindowLongA( WIN_Handle32(hwnd), offset, (LONG_PTR)new_proc ); - return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc ); + return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE ); } else return SetWindowLongA( WIN_Handle32(hwnd), offset, newval ); } diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c index ba01127..d01f137 100644 --- a/dlls/user/winproc.c +++ b/dlls/user/winproc.c @@ -144,8 +144,8 @@ static inline WINDOWPROC *find_winproc( return NULL; } -/* allocate and initialize a new winproc */ -static inline WINDOWPROC *alloc_winproc(void) +/* initialize a new winproc */ +static inline WINDOWPROC *init_winproc(void) { WINDOWPROC *proc; @@ -217,6 +217,36 @@ static inline WNDPROC proc_to_handle( WI return (WNDPROC)(ULONG_PTR)((proc - winproc_array) | (WINPROC_HANDLE << 16)); } +/* allocate and initialize a new winproc */ +static inline WINDOWPROC *alloc_winproc( WNDPROC func, BOOL unicode ) +{ + WINDOWPROC *proc; + + if (!func) return NULL; + + /* check if the function is already a win proc */ + if ((proc = handle_to_proc( func ))) return proc; + + EnterCriticalSection( &winproc_cs ); + + /* check if we already have a winproc for that function */ + if (!(proc = find_winproc( func, unicode ))) + { + if ((proc = init_winproc())) + { + proc->type = unicode ? WIN_PROC_32W : WIN_PROC_32A; + proc->u.proc32 = func; + TRACE( "allocated %p for %p %c (%d/%d used)\n", + proc_to_handle(proc), func, unicode ? 'W' : 'A', winproc_used, MAX_WINPROCS ); + } + else FIXME( "too many winprocs, cannot allocate one for %p %c\n", func, unicode ? 'W' : 'A' ); + } + else TRACE( "reusing %p for %p %c\n", proc_to_handle(proc), func, unicode ? 'W' : 'A' ); + + LeaveCriticalSection( &winproc_cs ); + return proc; +} + #ifdef __i386__ /* Some window procedures modify register they shouldn't, or are not @@ -456,9 +486,9 @@ static LRESULT WINAPI WINPROC_CallWndPro * * Get a window procedure pointer that can be passed to the Windows program. */ -WNDPROC16 WINPROC_GetProc16( WNDPROC proc ) +WNDPROC16 WINPROC_GetProc16( WNDPROC proc, BOOL unicode ) { - WINDOWPROC *ptr = handle_to_proc( proc ); + WINDOWPROC *ptr = alloc_winproc( proc, unicode ); if (!ptr) return 0; @@ -507,7 +537,7 @@ WNDPROC WINPROC_AllocProc16( WNDPROC16 f /* then check if we already have a winproc for that function */ if (!(proc = find_winproc16( func ))) { - if ((proc = alloc_winproc())) + if ((proc = init_winproc())) { proc->type = WIN_PROC_16; proc->u.proc16 = func; @@ -537,29 +567,7 @@ WNDPROC WINPROC_AllocProc( WNDPROC func, { WINDOWPROC *proc; - if (!func) return NULL; - - /* check if the function is already a win proc */ - if (!(proc = handle_to_proc( func ))) - { - EnterCriticalSection( &winproc_cs ); - - /* then check if we already have a winproc for that function */ - if (!(proc = find_winproc( func, unicode ))) - { - if ((proc = alloc_winproc())) - { - proc->type = unicode ? WIN_PROC_32W : WIN_PROC_32A; - proc->u.proc32 = func; - TRACE( "allocated %p for %p %c (%d/%d used)\n", - proc_to_handle(proc), func, unicode ? 'W' : 'A', winproc_used, MAX_WINPROCS ); - } - else FIXME( "too many winprocs, cannot allocate one for %p %c\n", func, unicode ? 'W' : 'A' ); - } - else TRACE( "reusing %p for %p %c\n", proc_to_handle(proc), func, unicode ? 'W' : 'A' ); - - LeaveCriticalSection( &winproc_cs ); - } + if (!(proc = alloc_winproc( func, unicode ))) return NULL; return proc_to_handle( proc ); } diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h index 58943ba..12b9a25 100644 --- a/dlls/user/winproc.h +++ b/dlls/user/winproc.h @@ -44,7 +44,7 @@ typedef struct struct tagWINDOWPROC; -extern WNDPROC16 WINPROC_GetProc16( WNDPROC proc ); +extern WNDPROC16 WINPROC_GetProc16( WNDPROC proc, BOOL unicode ); extern WNDPROC WINPROC_AllocProc16( WNDPROC16 func ); extern WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode ); extern WNDPROC WINPROC_AllocProc( WNDPROC func, BOOL unicode ); diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index 327c956..5471f36 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -1357,8 +1357,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANC if (ret) { - WNDPROC proc = WINPROC_AllocProc( wc32.lpfnWndProc, FALSE ); - wc->lpfnWndProc = WINPROC_GetProc16( proc ); + wc->lpfnWndProc = WINPROC_GetProc16( wc32.lpfnWndProc, FALSE ); wc->style = wc32.style; wc->cbClsExtra = wc32.cbClsExtra; wc->cbWndExtra = wc32.cbWndExtra;
1
0
0
0
Alexandre Julliard : user: Store the pointer to the winproc in the thunk structure.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 99dc29d926d93084a2c115cb7c9aa6c38647a94e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=99dc29d926d93084a2c115c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 15:50:18 2006 +0200 user: Store the pointer to the winproc in the thunk structure. This allows simplifying the handling of 16-bit thunks. --- dlls/user/user.exe.spec | 3 - dlls/user/winproc.c | 160 +++++++++++++++++++++++++---------------------- 2 files changed, 86 insertions(+), 77 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=99dc29d926d93084a2c…
1
0
0
0
Alexandre Julliard : user: Make the WINDOWPROCTYPE enum private to winproc. c.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: c8ce866a8a64afac8d147e3fb7b00034d1b9bb2a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=c8ce866a8a64afac8d147e3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 13:34:45 2006 +0200 user: Make the WINDOWPROCTYPE enum private to winproc.c. --- dlls/user/class.c | 6 +++--- dlls/user/win.c | 27 +++++++++++---------------- dlls/user/winproc.c | 8 ++++++++ dlls/user/winproc.h | 10 +--------- 4 files changed, 23 insertions(+), 28 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index 6639cab..e9aec25 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -520,9 +520,9 @@ void CLASS_RegisterBuiltinClasses(void) * Add a new window using this class, and set the necessary * information inside the window structure. */ -void CLASS_AddWindow( CLASS *class, WND *win, WINDOWPROCTYPE type ) +void CLASS_AddWindow( CLASS *class, WND *win, BOOL unicode ) { - if (type == WIN_PROC_32W) + if (unicode) { if (!(win->winproc = class->winprocW)) win->winproc = class->winprocA; } @@ -532,7 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND } win->class = class; win->clsStyle = class->style; - if (WINPROC_IsUnicode( win->winproc, (type == WIN_PROC_32W) )) win->flags |= WIN_ISUNICODE; + if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE; } diff --git a/dlls/user/win.c b/dlls/user/win.c index 3b0716a..5a785c5 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -55,7 +55,7 @@ static void *user_handles[NB_USER_HANDLE * Create a window handle with the server. */ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom, - HINSTANCE instance, WINDOWPROCTYPE type ) + HINSTANCE instance, BOOL unicode ) { WORD index; WND *win; @@ -125,7 +125,7 @@ static WND *create_window_handle( HWND p win->flags = 0; win->cbWndExtra = extra_bytes; memset( win->wExtra, 0, extra_bytes ); - CLASS_AddWindow( class, win, type ); + CLASS_AddWindow( class, win, unicode ); return win; } @@ -846,26 +846,21 @@ #undef DUMPED_EX_STYLES * * Implementation of CreateWindowEx(). */ -static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, - WINDOWPROCTYPE type ) +static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, UINT flags ) { INT sw = SW_SHOW; WND *wndPtr; HWND hwnd, parent, owner, top_child = 0; - BOOL unicode = (type == WIN_PROC_32W); + BOOL unicode = (flags & WIN_ISUNICODE) != 0; MDICREATESTRUCTA mdi_cs; TRACE("%s %s ex=%08lx style=%08lx %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n", - (type == WIN_PROC_32W) ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName), - (type == WIN_PROC_32W) ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass), + unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName), + unicode ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass), cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams ); - if(TRACE_ON(win)) dump_window_styles( cs->style, cs->dwExStyle ); - TRACE("winproc type is %d (%s)\n", type, (type == WIN_PROC_16) ? "WIN_PROC_16" : - ((type == WIN_PROC_32A) ? "WIN_PROC_32A" : "WIN_PROC_32W") ); - /* Fix the styles for MDI children */ if (cs->dwExStyle & WS_EX_MDICHILD) { @@ -976,7 +971,7 @@ static HWND WIN_CreateWindowEx( CREATEST /* Create the window structure */ - if (!(wndPtr = create_window_handle( parent, owner, classAtom, cs->hInstance, type ))) + if (!(wndPtr = create_window_handle( parent, owner, classAtom, cs->hInstance, unicode ))) return 0; hwnd = wndPtr->hwndSelf; @@ -995,7 +990,7 @@ static HWND WIN_CreateWindowEx( CREATEST wndPtr->hIcon = 0; wndPtr->hIconSmall = 0; wndPtr->hSysMenu = 0; - if (type != WIN_PROC_16) wndPtr->flags |= WIN_ISWIN32; + wndPtr->flags |= (flags & WIN_ISWIN32); if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 ); @@ -1172,7 +1167,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD ex cs.lpszClass = className; cs.dwExStyle = exStyle; - return HWND_16( WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_16 )); + return HWND_16( WIN_CreateWindowEx( &cs, classAtom, 0 )); } @@ -1225,7 +1220,7 @@ HWND WINAPI CreateWindowExA( DWORD exSty cs.lpszClass = className; cs.dwExStyle = exStyle; - return WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_32A ); + return WIN_CreateWindowEx( &cs, classAtom, WIN_ISWIN32 ); } @@ -1280,7 +1275,7 @@ HWND WINAPI CreateWindowExW( DWORD exSty /* Note: we rely on the fact that CREATESTRUCTA and */ /* CREATESTRUCTW have the same layout. */ - return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_PROC_32W ); + return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_ISWIN32 | WIN_ISUNICODE ); } diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c index 56bc035..5cca892 100644 --- a/dlls/user/winproc.c +++ b/dlls/user/winproc.c @@ -79,6 +79,14 @@ typedef struct tagWINDOWPROC WNDPROC16 proc16; /* 16-bit window proc */ } WINDOWPROC; +typedef enum +{ + WIN_PROC_INVALID, + WIN_PROC_16, + WIN_PROC_32A, + WIN_PROC_32W +} WINDOWPROCTYPE; + #define WINPROC_HANDLE (~0UL >> 16) #define MAX_WINPROCS (0x10000 / sizeof(WINDOWPROC)) diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h index 14240a6..58943ba 100644 --- a/dlls/user/winproc.h +++ b/dlls/user/winproc.h @@ -28,14 +28,6 @@ #include "winbase.h" #include "wine/winbase16.h" #include "winnls.h" -typedef enum -{ - WIN_PROC_INVALID, - WIN_PROC_16, - WIN_PROC_32A, - WIN_PROC_32W -} WINDOWPROCTYPE; - typedef struct { WPARAM16 wParam; @@ -134,7 +126,7 @@ inline static void unmap_str_16_to_32W( struct tagCLASS; /* opaque structure */ struct tagWND; extern void CLASS_RegisterBuiltinClasses(void); -extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, WINDOWPROCTYPE type ); +extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, BOOL unicode ); extern void CLASS_FreeModuleClasses( HMODULE16 hModule ); #endif /* __WINE_WINPROC_H */
1
0
0
0
Alexandre Julliard : user: Replace WINPROC_GetProcType by WINPROC_IsUnicode .
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 4cc498f880b2c91e4e99449c43b5add6db6a0618 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=4cc498f880b2c91e4e99449…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 13:27:21 2006 +0200 user: Replace WINPROC_GetProcType by WINPROC_IsUnicode. --- dlls/user/class.c | 6 +++--- dlls/user/win.c | 2 +- dlls/user/winproc.c | 10 +++++----- dlls/user/winproc.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index 8c2c653..6639cab 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -187,7 +187,7 @@ static void CLASS_SetProc16( CLASS *clas { WNDPROC proc = WINPROC_AllocProc16( newproc ); - if (WINPROC_GetProcType( proc ) == WIN_PROC_32W) + if (WINPROC_IsUnicode( proc, FALSE )) { classPtr->winprocA = 0; classPtr->winprocW = proc; @@ -210,7 +210,7 @@ static void CLASS_SetProc( CLASS *classP { WNDPROC proc = WINPROC_AllocProc( newproc, unicode ); - if (WINPROC_GetProcType( proc ) == WIN_PROC_32W) + if (WINPROC_IsUnicode( proc, unicode )) { classPtr->winprocA = 0; classPtr->winprocW = proc; @@ -532,7 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND } win->class = class; win->clsStyle = class->style; - if (WINPROC_GetProcType( win->winproc ) == WIN_PROC_32W) win->flags |= WIN_ISUNICODE; + if (WINPROC_IsUnicode( win->winproc, (type == WIN_PROC_32W) )) win->flags |= WIN_ISUNICODE; } diff --git a/dlls/user/win.c b/dlls/user/win.c index 8743292..3b0716a 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -1993,7 +1993,7 @@ static LONG_PTR WIN_SetWindowLong( HWND UINT old_flags = wndPtr->flags; retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, unicode ); wndPtr->winproc = WINPROC_AllocProc( (WNDPROC)newval, unicode ); - if (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W) wndPtr->flags |= WIN_ISUNICODE; + if (WINPROC_IsUnicode( wndPtr->winproc, unicode )) wndPtr->flags |= WIN_ISUNICODE; else wndPtr->flags &= ~WIN_ISUNICODE; if (!((old_flags ^ wndPtr->flags) & WIN_ISUNICODE)) { diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c index 62c4dc4..56bc035 100644 --- a/dlls/user/winproc.c +++ b/dlls/user/winproc.c @@ -568,16 +568,16 @@ WNDPROC WINPROC_AllocProc( WNDPROC func, /********************************************************************** - * WINPROC_GetProcType + * WINPROC_IsUnicode * - * Return the window procedure type. + * Return the window procedure type, or the default value if not a winproc handle. */ -WINDOWPROCTYPE WINPROC_GetProcType( WNDPROC proc ) +BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val ) { WINDOWPROC *ptr = handle_to_proc( proc ); - if (!ptr) return WIN_PROC_INVALID; - return ptr->type; + if (!ptr) return def_val; + return (ptr->type == WIN_PROC_32W); } diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h index 974b403..14240a6 100644 --- a/dlls/user/winproc.h +++ b/dlls/user/winproc.h @@ -56,7 +56,7 @@ extern WNDPROC16 WINPROC_GetProc16( WNDP extern WNDPROC WINPROC_AllocProc16( WNDPROC16 func ); extern WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode ); extern WNDPROC WINPROC_AllocProc( WNDPROC func, BOOL unicode ); -extern WINDOWPROCTYPE WINPROC_GetProcType( WNDPROC proc ); +extern BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val ); extern INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam );
1
0
0
0
Alexandre Julliard : user: Replace WINDOWPROCTYPE by a unicode flag in WINPROC_GetProc/AllocProc.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: a9e5e94b0d72a752f87baa029e177a1944f4846a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a9e5e94b0d72a752f87baa0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 13:20:34 2006 +0200 user: Replace WINDOWPROCTYPE by a unicode flag in WINPROC_GetProc/AllocProc. --- dlls/user/class.c | 34 +++++++++++++++++----------------- dlls/user/message.c | 4 ++-- dlls/user/win.c | 27 +++++++++++++-------------- dlls/user/winproc.c | 47 ++++++++++++++++++++++------------------------- dlls/user/winproc.h | 4 ++-- dlls/user/wnd16.c | 2 +- 6 files changed, 57 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=a9e5e94b0d72a752f87…
1
0
0
0
Alexandre Julliard : user: Add a WIN_ISUNICODE flag instead of relying on the winproc type.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: ef7419394972a2fa3d516de77cc4731725880b8e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ef7419394972a2fa3d516de…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 12:55:36 2006 +0200 user: Add a WIN_ISUNICODE flag instead of relying on the winproc type. Also fix the initial value for the server is_unicode flag. --- dlls/user/class.c | 1 + dlls/user/win.c | 15 +++++++++------ include/win.h | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index 1f36562..f823b2f 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -532,6 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND } win->class = class; win->clsStyle = class->style; + if (WINPROC_GetProcType( win->winproc ) == WIN_PROC_32W) win->flags |= WIN_ISUNICODE; } diff --git a/dlls/user/win.c b/dlls/user/win.c index 4732fc6..acff599 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -122,6 +122,7 @@ static WND *create_window_handle( HWND p win->parent = full_parent; win->owner = full_owner; win->dwMagic = WND_MAGIC; + win->flags = 0; win->cbWndExtra = extra_bytes; memset( win->wExtra, 0, extra_bytes ); CLASS_AddWindow( class, win, type ); @@ -988,13 +989,13 @@ static HWND WIN_CreateWindowEx( CREATEST wndPtr->dwExStyle = cs->dwExStyle; wndPtr->wIDmenu = 0; wndPtr->helpContext = 0; - wndPtr->flags = (type == WIN_PROC_16) ? 0 : WIN_ISWIN32; wndPtr->pVScroll = NULL; wndPtr->pHScroll = NULL; wndPtr->userdata = 0; wndPtr->hIcon = 0; wndPtr->hIconSmall = 0; wndPtr->hSysMenu = 0; + if (type != WIN_PROC_16) wndPtr->flags |= WIN_ISWIN32; if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 ); @@ -1032,7 +1033,7 @@ static HWND WIN_CreateWindowEx( CREATEST req->style = wndPtr->dwStyle; req->ex_style = wndPtr->dwExStyle; req->instance = (void *)wndPtr->hInstance; - req->is_unicode = (type == WIN_PROC_32W); + req->is_unicode = (wndPtr->flags & WIN_ISUNICODE) != 0; req->extra_offset = -1; wine_server_call( req ); } @@ -1683,7 +1684,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd ) if (wndPtr != WND_OTHER_PROCESS) { - retvalue = (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W); + retvalue = (wndPtr->flags & WIN_ISUNICODE) != 0; WIN_ReleasePtr( wndPtr ); } else @@ -1990,10 +1991,12 @@ static LONG_PTR WIN_SetWindowLong( HWND } case GWLP_WNDPROC: { - WINDOWPROCTYPE old_type = WINPROC_GetProcType( wndPtr->winproc ); + UINT old_flags = wndPtr->flags; retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, type ); wndPtr->winproc = WINPROC_AllocProc( (WNDPROC)newval, type ); - if (old_type == type) + if (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W) wndPtr->flags |= WIN_ISUNICODE; + else wndPtr->flags &= ~WIN_ISUNICODE; + if (!((old_flags ^ wndPtr->flags) & WIN_ISUNICODE)) { WIN_ReleasePtr( wndPtr ); return retval; @@ -2059,7 +2062,7 @@ static LONG_PTR WIN_SetWindowLong( HWND break; case GWLP_WNDPROC: req->flags = SET_WIN_UNICODE; - req->is_unicode = (type == WIN_PROC_32W); + req->is_unicode = (wndPtr->flags & WIN_ISUNICODE) != 0; break; case GWLP_USERDATA: req->flags = SET_WIN_USERDATA; diff --git a/include/win.h b/include/win.h index 437aecf..f5affc3 100644 --- a/include/win.h +++ b/include/win.h @@ -68,7 +68,8 @@ #define WIN_NCACTIVATED 0x0004 #define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */ #define WIN_ISDIALOG 0x0010 /* Window is a dialog */ #define WIN_ISWIN32 0x0020 /* Understands Win32 messages */ -#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0040 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ +#define WIN_ISUNICODE 0x0040 /* Window is Unicode */ +#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ /* Window functions */ extern WND *WIN_GetPtr( HWND hwnd );
1
0
0
0
Jason Green : wined3d: Further split GLSL & ARB_v/ f_program generation and allow GLSL functions to be called.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: e9927d6ffd9c6865936520453c74e2cd680edc7a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e9927d6ffd9c68659365204…
Author: Jason Green <jave27(a)gmail.com> Date: Tue May 9 22:47:35 2006 -0400 wined3d: Further split GLSL & ARB_v/f_program generation and allow GLSL functions to be called. --- dlls/wined3d/baseshader.c | 83 ++++++++++++++++++++++++++++------------ dlls/wined3d/wined3d_private.h | 7 +++ 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index f1929d6..5c3b143 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -238,6 +238,43 @@ void shader_program_dump_decl_usage( } } +/** Generate the variable & register declarations for the ARB_vertex_program + output target */ +void generate_arb_declarations(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer) { + + IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; + DWORD i; + + for(i = 0; i < This->baseShader.limits.temporary; i++) { + if (This->baseShader.temps_used & (1 << i)) + shader_addline(buffer, "TEMP R%lu;\n", i); + } + + for (i = 0; i < This->baseShader.limits.address; i++) { + if (This->baseShader.textures_used & (1 << i)) + shader_addline(buffer, "ADDRESS A%ld;\n", i); + } + + for(i = 0; i < This->baseShader.limits.texture; i++) { + if (This->baseShader.textures_used & (1 << i)) + shader_addline(buffer,"TEMP T%lu;\n", i); + } + + /* Texture coordinate registers must be pre-loaded */ + for (i = 0; i < This->baseShader.limits.texture; i++) { + if (This->baseShader.textures_used & (1 << i)) + shader_addline(buffer, "MOV T%lu, fragment.texcoord[%lu];\n", i, i); + } +} + +/** Generate the variable & register declarations for the GLSL + output target */ +void generate_glsl_declarations(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer) { + + FIXME("GLSL not fully implemented yet.\n"); + +} + /** Shared code in order to generate the bulk of the shader string. Use the shader_header_fct & shader_footer_fct to add strings that are specific to pixel or vertex functions @@ -267,26 +304,10 @@ void generate_base_shader( */ /* Pre-declare registers */ - for(i = 0; i < This->baseShader.limits.temporary; i++) { - if (This->baseShader.temps_used & (1 << i)) - shader_addline(buffer, "TEMP R%lu;\n", i); - } - - for (i = 0; i < This->baseShader.limits.address; i++) { - if (This->baseShader.textures_used & (1 << i)) - shader_addline(buffer, "ADDRESS A%ld;\n", i); - } - - for(i = 0; i < This->baseShader.limits.texture; i++) { - if (This->baseShader.textures_used & (1 << i)) - shader_addline(buffer,"TEMP T%lu;\n", i); - } - - /* Texture coordinate registers must be pre-loaded */ - for (i = 0; i < This->baseShader.limits.texture; i++) { - if (This->baseShader.textures_used & (1 << i)) - shader_addline(buffer, "MOV T%lu, fragment.texcoord[%lu];\n", i, i); - } + if (USING_GLSL) + generate_glsl_declarations(iface, buffer); + else + generate_arb_declarations(iface, buffer); /* Second pass, process opcodes */ if (NULL != pToken) { @@ -318,15 +339,22 @@ void generate_base_shader( ++pToken; } - /* Unhandled opcode */ - } else if (GLNAME_REQUIRE_GLSL == curOpcode->glname) { + /* Using GLSL & no generator function exists */ + } else if (USING_GLSL && curOpcode->hw_glsl_fct == NULL) { + + FIXME("Token %s is not yet implemented with GLSL\n", curOpcode->name); + pToken += curOpcode->num_params; + + /* Unhandled opcode in ARB */ + } else if ( !USING_GLSL && GLNAME_REQUIRE_GLSL == curOpcode->glname) { FIXME("Token %s requires greater functionality than " "Vertex or Fragment_Program_ARB supports\n", curOpcode->name); pToken += curOpcode->num_params; - /* If a generator function is set, use it */ - } else if (curOpcode->hw_fct != NULL) { + /* If a generator function is set for current shader target, use it */ + } else if ((!USING_GLSL && curOpcode->hw_fct != NULL) || + (USING_GLSL && curOpcode->hw_glsl_fct != NULL)) { SHADER_OPCODE_ARG hw_arg; @@ -341,7 +369,12 @@ void generate_base_shader( hw_arg.src[i-1] = *(pToken + i); } - curOpcode->hw_fct(&hw_arg); + /* Call appropriate function for output target */ + if (USING_GLSL) + curOpcode->hw_glsl_fct(&hw_arg); + else + curOpcode->hw_fct(&hw_arg); + pToken += curOpcode->num_params; } else { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 137cb1a..30cf91c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1201,6 +1201,13 @@ struct SHADER_OPCODE_ARG; typedef void (*shader_fct_t)(); typedef void (*SHADER_HANDLER) (struct SHADER_OPCODE_ARG*); + +/* This must be 0 in the main branch until GLSL is at least mostly implemented. + Also, think about making it a winecfg option to use GLSL (if the card supports it) + or ARB_vertex_program. Ideally, we want to use GLSL if it's available, but until + everything is implemented, we'll probably have better luck with the ARB generation */ +#define USING_GLSL 0 + #define SHADER_PGMSIZE 65535 typedef struct SHADER_BUFFER { char* buffer;
1
0
0
0
Jason Green : wined3d: Modified the opcode tables (and struct) to include a pointer to a GLSL generator function.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 246677ae46aea33fd04a7b4b8ab4cc043abdd404 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=246677ae46aea33fd04a7b4…
Author: Jason Green <jave27(a)gmail.com> Date: Tue May 9 22:43:34 2006 -0400 wined3d: Modified the opcode tables (and struct) to include a pointer to a GLSL generator function. --- dlls/wined3d/pixelshader.c | 168 ++++++++++++++++++++-------------------- dlls/wined3d/vertexshader.c | 114 ++++++++++++++------------- dlls/wined3d/wined3d_private.h | 1 3 files changed, 142 insertions(+), 141 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=246677ae46aea33fd04…
1
0
0
0
Jason Green : wined3d: Use GenerateShader in pixel shaders and remove old function.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 68f75555d3dd213a5af8c1909828868b214e176c URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=68f75555d3dd213a5af8c19…
Author: Jason Green <jave27(a)gmail.com> Date: Tue May 9 22:39:39 2006 -0400 wined3d: Use GenerateShader in pixel shaders and remove old function. --- dlls/wined3d/pixelshader.c | 191 -------------------------------------------- 1 files changed, 1 insertions(+), 190 deletions(-) diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 6e0c126..c63825f 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -1370,195 +1370,6 @@ #if 1 /* if were using the data buffer o #endif } -/* NOTE: A description of how to parse tokens can be found at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/graphics/h…
*/ -inline static VOID IWineD3DPixelShaderImpl_GenerateProgramArbHW(IWineD3DPixelShader *iface, CONST DWORD *pFunction) { - IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)iface; - const DWORD *pToken = pFunction; - const SHADER_OPCODE *curOpcode = NULL; - DWORD i; - SHADER_BUFFER buffer; - - /* Keep bitmaps of used temporary and texture registers */ - DWORD tempsUsed, texUsed; - - /* Initialize current parsing state */ - This->baseShader.parse_state.current_row = 0; - -#if 0 /* FIXME: Use the buffer that is held by the device, this is ok since fixups will be skipped for software shaders - it also requires entering a critical section but cuts down the runtime footprint of wined3d and any memory fragmentation that may occur... */ - if (This->device->fixupVertexBufferSize < SHADER_PGMSIZE) { - HeapFree(GetProcessHeap(), 0, This->fixupVertexBuffer); - This->fixupVertexBuffer = HeapAlloc(GetProcessHeap() , 0, SHADER_PGMSIZE); - This->fixupVertexBufferSize = SHADER_PGMSIZE; - This->fixupVertexBuffer[0] = 0; - } - buffer.buffer = This->device->fixupVertexBuffer; -#else - buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); -#endif - buffer.bsize = 0; - buffer.lineNo = 0; - - /* FIXME: if jumps are used, use GLSL, else use ARB_fragment_program */ - shader_addline(&buffer, "!!ARBfp1.0\n"); - - /* TODO: Think about using a first pass to work out what's required for the second pass. */ - for(i = 0; i < WINED3D_PSHADER_MAX_CONSTANTS; i++) - This->constants[i] = 0; - - /* First pass: figure out which temporary and texture registers are used */ - shader_get_registers_used((IWineD3DBaseShader*) This, pToken); - texUsed = This->baseShader.textures_used; - tempsUsed = This->baseShader.temps_used; - - TRACE("Texture registers used: %#lx, Temp registers used %#lx\n", texUsed, tempsUsed); - - /* TODO: check register usage against GL/Directx limits, and fail if they're exceeded */ - - /* Pre-declare registers */ - for(i = 0; i < This->baseShader.limits.texture; i++) { - if (texUsed & (1 << i)) - shader_addline(&buffer,"TEMP T%lu;\n", i); - } - - for(i = 0; i < This->baseShader.limits.temporary; i++) { - if (tempsUsed & (1 << i)) - shader_addline(&buffer, "TEMP R%lu;\n", i); - } - - /* Necessary for internal operations */ - shader_addline(&buffer, "TEMP TMP;\n"); - shader_addline(&buffer, "TEMP TMP2;\n"); - shader_addline(&buffer, "TEMP TA;\n"); - shader_addline(&buffer, "TEMP TB;\n"); - shader_addline(&buffer, "TEMP TC;\n"); - shader_addline(&buffer, "PARAM coefdiv = { 0.5, 0.25, 0.125, 0.0625 };\n"); - shader_addline(&buffer, "PARAM coefmul = { 2, 4, 8, 16 };\n"); - shader_addline(&buffer, "PARAM one = { 1.0, 1.0, 1.0, 1.0 };\n"); - - /* Texture coordinate registers must be pre-loaded */ - for (i = 0; i < This->baseShader.limits.texture; i++) { - if (texUsed & (1 << i)) - shader_addline(&buffer, "MOV T%lu, fragment.texcoord[%lu];\n", i, i); - } - - /* Second pass, process opcodes */ - if (NULL != pToken) { - while (D3DPS_END() != *pToken) { -#if 0 /* For pixel and vertex shader versions 2_0 and later, bits 24 through 27 specify the size in DWORDs of the instruction */ - if (version >= 2) { - instructionSize = pToken & SIZEBITS >> 27; - } -#endif - - /* Skip version token */ - if (pshader_is_version_token(*pToken)) { - ++pToken; - continue; - } - - /* Skip comment tokens */ - if (pshader_is_comment_token(*pToken)) { - DWORD comment_len = (*pToken & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT; - ++pToken; - TRACE("#%s\n", (char*)pToken); - pToken += comment_len; - continue; - } - - /* Read opcode */ - curOpcode = shader_get_opcode((IWineD3DBaseShader*) This, *pToken); - ++pToken; - - /* Unknown opcode and its parameters */ - if (NULL == curOpcode) { - while (*pToken & 0x80000000) { /* TODO: Think of a sensible name for 0x80000000 */ - FIXME("unrecognized opcode: %08lx\n", *pToken); - ++pToken; - } - - /* Unhandled opcode */ - } else if (GLNAME_REQUIRE_GLSL == curOpcode->glname) { - - FIXME("Token %s requires greater functionality than " - "Fragment_Progarm_ARB supports\n", curOpcode->name); - pToken += curOpcode->num_params; - - /* If a generator function is set, use it */ - } else if (curOpcode->hw_fct != NULL) { - - SHADER_OPCODE_ARG hw_arg; - - hw_arg.shader = (IWineD3DBaseShader*) This; - hw_arg.opcode = curOpcode; - hw_arg.buffer = &buffer; - if (curOpcode->num_params > 0) { - hw_arg.dst = *pToken; - - /* FIXME: this does not account for relative address tokens */ - for (i = 1; i < curOpcode->num_params; i++) - hw_arg.src[i-1] = *(pToken + i); - } - - curOpcode->hw_fct(&hw_arg); - pToken += curOpcode->num_params; - - } else { - - TRACE("Found opcode D3D:%s GL:%s, PARAMS:%d, \n", - curOpcode->name, curOpcode->glname, curOpcode->num_params); - - /* Build opcode for GL vertex_program */ - switch (curOpcode->opcode) { - case D3DSIO_NOP: - break; - - default: - FIXME("Can't handle opcode %s in hwShader\n", curOpcode->name); - pToken += curOpcode->num_params; - } - } - } - /* TODO: What about result.depth? */ - shader_addline(&buffer, "MOV result.color, R0;\n"); - shader_addline(&buffer, "END\n"); - } - - /* finally null terminate the buffer */ - buffer.buffer[buffer.bsize] = 0; - if (GL_SUPPORT(ARB_VERTEX_PROGRAM)) { - /* Create the hw shader */ - - /* The program string sometimes gets too long for a normal TRACE */ - TRACE("Generated program:\n"); - if (TRACE_ON(d3d_shader)) { - fprintf(stderr, "%s\n", buffer.buffer); - } - - /* TODO: change to resource.glObjectHandel or something like that */ - GL_EXTCALL(glGenProgramsARB(1, &This->baseShader.prgId)); - - TRACE("Creating a hw pixel shader, prg=%d\n", This->baseShader.prgId); - GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, This->baseShader.prgId)); - - TRACE("Created hw pixel shader, prg=%d\n", This->baseShader.prgId); - /* Create the program and check for errors */ - GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - buffer.bsize, buffer.buffer)); - - if (glGetError() == GL_INVALID_OPERATION) { - GLint errPos; - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); - FIXME("HW PixelShader Error at position %d: %s\n", - errPos, debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); - This->baseShader.prgId = -1; - } - } -#if 1 /* if were using the data buffer of device then we don't need to free it */ - HeapFree(GetProcessHeap(), 0, buffer.buffer); -#endif -} - inline static void pshader_program_dump_ins_modifiers(const DWORD output) { DWORD shift = (output & D3DSP_DSTSHIFT_MASK) >> D3DSP_DSTSHIFT_SHIFT; @@ -1808,7 +1619,7 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_S if (NULL != pFunction && wined3d_settings.vs_mode == VS_HW) { TRACE("(%p) : Generating hardware program\n", This); #if 1 - IWineD3DPixelShaderImpl_GenerateProgramArbHW(iface, pFunction); + IWineD3DPixelShaderImpl_GenerateShader(iface, pFunction); #endif }
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
87
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
Results per page:
10
25
50
100
200