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
April 2008
----- 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
4 participants
1278 discussions
Start a n
N
ew thread
Eric Pouech : winhelp: Store reference to the popup (if any) as a WINHELP_WINDOW pointer.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 6cd9b1a31385388c03bac6a6bb588f495bc64fac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6cd9b1a31385388c03bac6a6b…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:01:14 2008 +0200 winhelp: Store reference to the popup (if any) as a WINHELP_WINDOW pointer. --- programs/winhelp/winhelp.c | 34 ++++++++++++++++++++++------------ programs/winhelp/winhelp.h | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 797bbae..22424cb 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -56,7 +56,7 @@ static void WINHELP_DeleteButtons(WINHELP_WINDOW*); static void WINHELP_SetupText(HWND hWnd, ULONG relative); static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM); -WINHELP_GLOBALS Globals = {3, NULL, NULL, TRUE, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}}; +WINHELP_GLOBALS Globals = {3, NULL, TRUE, NULL, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}}; #define CTL_ID_BUTTON 0x700 #define CTL_ID_TEXT 0x701 @@ -593,7 +593,9 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe WINHELP_RememberPage(win, wpage); } - if (!bPopup) + if (bPopup) + Globals.active_popup = win; + else Globals.active_win = win; /* Initialize default pushbuttons */ @@ -649,7 +651,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe } WINHELP_LayoutMainWindow(win); - if (bPopup) Globals.hPopupWnd = win->hMainWnd; ShowWindow(win->hMainWnd, nCmdShow); UpdateWindow(win->hMainWnd); @@ -736,9 +737,9 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, break; } break; - case WM_DESTROY: - if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); - break; +/* EPP case WM_DESTROY: */ +/* EPP if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); */ +/* EPP break; */ case WM_COPYDATA: return WINHELP_HandleCommand((HWND)wParam, lParam); @@ -789,7 +790,6 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, { BOOL bExit; win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0; bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); WINHELP_DeleteWindow(win); @@ -1172,8 +1172,12 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, case WM_LBUTTONDOWN: win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hPopupWnd = Globals.hPopupWnd; - Globals.hPopupWnd = 0; + if (Globals.active_popup) + { + hPopupWnd = Globals.active_popup->hMainWnd; + Globals.active_popup = NULL; + } + else hPopupWnd = NULL; part = WINHELP_IsOverLink(win, wParam, lParam); if (part) @@ -1739,7 +1743,9 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize) */ static void WINHELP_CheckPopup(UINT msg) { - if (!Globals.hPopupWnd) return; + HWND hPopup; + + if (!Globals.active_popup) return; switch (msg) { @@ -1750,8 +1756,9 @@ static void WINHELP_CheckPopup(UINT msg) case WM_NCLBUTTONDOWN: case WM_NCMBUTTONDOWN: case WM_NCRBUTTONDOWN: - DestroyWindow(Globals.hPopupWnd); - Globals.hPopupWnd = 0; + hPopup = Globals.active_popup->hMainWnd; + Globals.active_popup = NULL; + DestroyWindow(hPopup); } } @@ -1834,6 +1841,9 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) SetActiveWindow(Globals.win_list->hMainWnd); } + if (win == Globals.active_popup) + Globals.active_popup = NULL; + WINHELP_DeleteButtons(win); if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h index a8f211e..b3ebac1 100644 --- a/programs/winhelp/winhelp.h +++ b/programs/winhelp/winhelp.h @@ -166,9 +166,9 @@ typedef struct { UINT wVersion; HANDLE hInstance; - HWND hPopupWnd; BOOL isBook; WINHELP_WINDOW* active_win; + WINHELP_WINDOW* active_popup; WINHELP_WINDOW* win_list; WNDPROC button_proc; WINHELP_DLL* dlls;
1
0
0
0
Eric Pouech : winhelp: Simplify most of the helpers dealing with window creation.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 3f1b62f2f76f0c516f0e9e8c239cc57708711950 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f1b62f2f76f0c516f0e9e8c2…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:01:08 2008 +0200 winhelp: Simplify most of the helpers dealing with window creation. --- programs/winhelp/hlpfile.c | 5 ++- programs/winhelp/macro.c | 25 +++++++---------- programs/winhelp/winhelp.c | 63 +++++++++++-------------------------------- programs/winhelp/winhelp.h | 5 +-- 4 files changed, 32 insertions(+), 66 deletions(-) diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c index 30c678d..c20bead 100644 --- a/programs/winhelp/hlpfile.c +++ b/programs/winhelp/hlpfile.c @@ -148,13 +148,14 @@ static int comp_PageByHash(void *p, const void *key, /*********************************************************************** * - * HLPFILE_HlpFilePageByHash + * HLPFILE_PageByHash */ HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative) { BYTE *ptr; - if (!hlpfile) return 0; + if (!hlpfile) return NULL; + if (!lHash) return HLPFILE_Contents(hlpfile, relative); WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, lHash); diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 3681933..66eac0f 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -506,10 +506,7 @@ void CALLBACK MACRO_FileOpen(void) if (WINHELP_GetOpenFileName(szFile, MAX_PATH)) { - HLPFILE* hlpfile = WINHELP_LookupHelpFile(szFile); - - WINHELP_CreateHelpWindowByHash(hlpfile, 0, - WINHELP_GetWindowInfo(hlpfile, "main"), SW_SHOWNORMAL); + MACRO_JumpContents(szFile, "main"); } } @@ -628,10 +625,10 @@ void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) HLPFILE* hlpfile; WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_CreateHelpWindowByHash(hlpfile, 0, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, 0, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) @@ -641,9 +638,9 @@ void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); hlpfile = WINHELP_LookupHelpFile(lpszPath); /* Some madness: what user calls 'context', hlpfile calls 'map' */ - WINHELP_CreateHelpWindowByMap(hlpfile, context, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) @@ -652,9 +649,9 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) WINE_TRACE("(\"%s\", \"%s\", %u)\n", lpszPath, lpszWindow, lHash); hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_CreateHelpWindowByHash(hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } void CALLBACK MACRO_JumpHelpOn(void) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 4981748..797bbae 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -304,8 +304,8 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) if (!hlpfile) return 0; } else hlpfile = NULL; - WINHELP_CreateHelpWindowByHash(hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, wndname), show); + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, wndname), show); /* Message loop */ while (GetMessage(&msg, 0, 0, 0)) @@ -657,49 +657,17 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe return TRUE; } -/*********************************************************************** - * - * WINHELP_CreateHelpWindowByHash - */ -BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash, - HLPFILE_WINDOWINFO* wi, int nCmdShow) -{ - WINHELP_WNDPAGE wpage; - - wpage.page = NULL; - if (hlpfile) - wpage.page = lHash ? HLPFILE_PageByHash(hlpfile, lHash, &wpage.relative) : - HLPFILE_Contents(hlpfile, &wpage.relative); - if (wpage.page) wpage.page->file->wRefCount++; - wpage.wininfo = wi; - return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); -} - -/*********************************************************************** - * - * WINHELP_CreateHelpWindowByMap - */ -BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap, - HLPFILE_WINDOWINFO* wi, int nCmdShow) -{ - WINHELP_WNDPAGE wpage; - - wpage.page = HLPFILE_PageByMap(hlpfile, lMap, &wpage.relative); - if (wpage.page) wpage.page->file->wRefCount++; - wpage.wininfo = wi; - return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); -} - -/*********************************************************************** - * - * WINHELP_CreateHelpWindowByOffset +/****************************************************************** + * WINHELP_OpenHelpWindow + * Main function to search for a page and display it in a window */ -BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE* hlpfile, LONG lOffset, - HLPFILE_WINDOWINFO* wi, int nCmdShow) +BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*lookup)(HLPFILE*, LONG, ULONG*), + HLPFILE* hlpfile, LONG val, HLPFILE_WINDOWINFO* wi, + int nCmdShow) { WINHELP_WNDPAGE wpage; - wpage.page = HLPFILE_PageByOffset(hlpfile, lOffset, &wpage.relative); + wpage.page = lookup(hlpfile, val, &wpage.relative); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); @@ -1229,14 +1197,14 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, WINE_WARN("link to window %d/%d\n", part->link->window, hlpfile->numWindows); break; } - WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, wi, - SW_NORMAL); + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, part->link->lHash, + wi, SW_NORMAL); break; case hlp_link_popup: hlpfile = WINHELP_LookupHelpFile(part->link->lpszString); - if (hlpfile) WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, - WINHELP_GetPopupWindowInfo(hlpfile, hWnd, &mouse), - SW_NORMAL); + if (hlpfile) WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, part->link->lHash, + WINHELP_GetPopupWindowInfo(hlpfile, hWnd, &mouse), + SW_NORMAL); break; case hlp_link_macro: MACRO_ExecuteMacro(part->link->lpszString); @@ -2074,7 +2042,8 @@ BOOL WINHELP_CreateIndexWindow(void) { ret -= 2; WINE_TRACE("got %d as an offset\n", ret); - WINHELP_CreateHelpWindowByOffset(hlpfile, ret, Globals.active_win->info, SW_NORMAL); + WINHELP_OpenHelpWindow(HLPFILE_PageByOffset, hlpfile, ret, + Globals.active_win->info, SW_NORMAL); } return TRUE; } diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h index f8ff0c6..a8f211e 100644 --- a/programs/winhelp/winhelp.h +++ b/programs/winhelp/winhelp.h @@ -178,10 +178,9 @@ typedef struct extern WINHELP_GLOBALS Globals; extern FARPROC Callbacks[]; -BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL); +BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*), + HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_CreateIndexWindow(void); void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
1
0
0
0
Eric Pouech : winhelp: Also store the relative offsets of a page in the history and back information sets .
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 857d0e063c9c82c0bf9fcf21fd5df59506fbb9e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=857d0e063c9c82c0bf9fcf21f…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:01:02 2008 +0200 winhelp: Also store the relative offsets of a page in the history and back information sets. --- programs/winhelp/winhelp.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 60362d0..4981748 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -485,11 +485,11 @@ void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win) } -static void WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page) +static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) { unsigned num; - if (!Globals.history.index || Globals.history.set[0].page != page) + if (!Globals.history.index || Globals.history.set[0].page != wpage->page) { num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]); /* we're full, remove latest entry */ @@ -500,10 +500,9 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page) } memmove(&Globals.history.set[1], &Globals.history.set[0], Globals.history.index * sizeof(Globals.history.set[0])); - Globals.history.set[0].page = page; - Globals.history.set[0].wininfo = win->info; + Globals.history.set[0] = *wpage; Globals.history.index++; - page->file->wRefCount++; + wpage->page->file->wRefCount++; } if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE); @@ -516,9 +515,8 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page) (num - 1) * sizeof(win->back.set[0])); win->back.index--; } - win->back.set[win->back.index].page = page; - win->back.set[win->back.index++].wininfo = win->info; - page->file->wRefCount++; + win->back.set[win->back.index++] = *wpage; + wpage->page->file->wRefCount++; } /*********************************************************************** @@ -592,7 +590,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe if (!bPopup && wpage->page && remember) { - WINHELP_RememberPage(win, wpage->page); + WINHELP_RememberPage(win, wpage); } if (!bPopup)
1
0
0
0
Eric Pouech : winhelp: Added ability to locate information within a page ( and to store it inside WNDPAGE).
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: a4480365d7a5892990214a230a8c7147599e4274 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a4480365d7a5892990214a230…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:56 2008 +0200 winhelp: Added ability to locate information within a page (and to store it inside WNDPAGE). --- programs/winhelp/hlpfile.c | 35 ++++++++++++++++++----------------- programs/winhelp/hlpfile.h | 8 ++++---- programs/winhelp/macro.c | 9 +++++---- programs/winhelp/winhelp.c | 17 +++++++++-------- programs/winhelp/winhelp.h | 1 + 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c index 92a22df..30c678d 100644 --- a/programs/winhelp/hlpfile.c +++ b/programs/winhelp/hlpfile.c @@ -96,21 +96,12 @@ static HLPFILE_PAGE *HLPFILE_PageByNumber(HLPFILE* hlpfile, UINT wNum) return page; } -/* FIXME: - * this finds the page containing the offset. The offset can either - * refer to the top of the page (offset == page->offset), or - * to some paragraph inside the page... - * As of today, we only return the page... we should also return - * a paragraph, and then, while opening a new page, compute the - * y-offset of the paragraph to be shown and scroll the window - * accordingly - */ /****************************************************************** * HLPFILE_PageByOffset * * */ -HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset) +HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset, ULONG* relative) { HLPFILE_PAGE* page; HLPFILE_PAGE* found; @@ -125,7 +116,10 @@ HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset) for (found = NULL, page = hlpfile->first_page; page; page = page->next) { if (page->offset <= offset && (!found || found->offset < page->offset)) + { + *relative = offset - page->offset; found = page; + } } if (!found) WINE_ERR("Page of offset %u not found in file %s\n", @@ -156,7 +150,7 @@ static int comp_PageByHash(void *p, const void *key, * * HLPFILE_HlpFilePageByHash */ -HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash) +HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative) { BYTE *ptr; @@ -166,7 +160,10 @@ HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash) /* For win 3.0 files hash values are really page numbers */ if (hlpfile->version <= 16) + { + *relative = 0; return HLPFILE_PageByNumber(hlpfile, lHash); + } ptr = HLPFILE_BPTreeSearch(hlpfile->Context, LongToPtr(lHash), comp_PageByHash); if (!ptr) @@ -175,14 +172,14 @@ HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash) return NULL; } - return HLPFILE_PageByOffset(hlpfile, GET_UINT(ptr, 4)); + return HLPFILE_PageByOffset(hlpfile, GET_UINT(ptr, 4), relative); } /*********************************************************************** * * HLPFILE_PageByMap */ -HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap) +HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative) { unsigned int i; @@ -193,7 +190,7 @@ HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap) for (i = 0; i < hlpfile->wMapLen; i++) { if (hlpfile->Map[i].lMap == lMap) - return HLPFILE_PageByOffset(hlpfile, hlpfile->Map[i].offset); + return HLPFILE_PageByOffset(hlpfile, hlpfile->Map[i].offset, relative); } WINE_ERR("Page of Map %x not found in file %s\n", lMap, hlpfile->lpszPath); @@ -204,14 +201,18 @@ HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap) * * HLPFILE_Contents */ -HLPFILE_PAGE* HLPFILE_Contents(HLPFILE *hlpfile) +HLPFILE_PAGE* HLPFILE_Contents(HLPFILE *hlpfile, ULONG* relative) { HLPFILE_PAGE* page = NULL; if (!hlpfile) return NULL; - page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start); - if (!page) page = hlpfile->first_page; + page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start, relative); + if (!page) + { + page = hlpfile->first_page; + *relative = 0; + } return page; } diff --git a/programs/winhelp/hlpfile.h b/programs/winhelp/hlpfile.h index 739ad38..548a6e2 100644 --- a/programs/winhelp/hlpfile.h +++ b/programs/winhelp/hlpfile.h @@ -188,10 +188,10 @@ typedef int (*HLPFILE_BPTreeCompare)(void *p, const void *key, typedef void (*HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie); HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath); -HLPFILE_PAGE* HLPFILE_Contents(HLPFILE* hlpfile); -HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash); -HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap); -HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset); +HLPFILE_PAGE* HLPFILE_Contents(HLPFILE* hlpfile, ULONG* relative); +HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative); +HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative); +HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset, ULONG* relative); LONG HLPFILE_Hash(LPCSTR lpszContext); void HLPFILE_FreeLink(HLPFILE_LINK* link); void HLPFILE_FreeHlpFile(HLPFILE*); diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 2c38b01..3681933 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -246,15 +246,16 @@ void CALLBACK MACRO_BookmarkMore(void) void CALLBACK MACRO_BrowseButtons(void) { HLPFILE_PAGE* page = Globals.active_win->page; + ULONG relative; WINE_TRACE("()\n"); MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); - if (!HLPFILE_PageByOffset(page->file, page->browse_bwd)) + if (!HLPFILE_PageByOffset(page->file, page->browse_bwd, &relative)) MACRO_DisableButton("BTN_PREV"); - if (!HLPFILE_PageByOffset(page->file, page->browse_fwd)) + if (!HLPFILE_PageByOffset(page->file, page->browse_fwd, &relative)) MACRO_DisableButton("BTN_NEXT"); } @@ -718,7 +719,7 @@ void CALLBACK MACRO_Next(void) WINE_TRACE("()\n"); wp.page = Globals.active_win->page; - wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd); + wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd, &wp.relative); if (wp.page) { wp.page->file->wRefCount++; @@ -758,7 +759,7 @@ void CALLBACK MACRO_Prev(void) WINE_TRACE("()\n"); wp.page = Globals.active_win->page; - wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd); + wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd, &wp.relative); if (wp.page) { wp.page->file->wRefCount++; diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index bb9ea75..60362d0 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -53,7 +53,7 @@ static void WINHELP_InitFonts(HWND hWnd); static void WINHELP_DeleteLines(WINHELP_WINDOW*); static void WINHELP_DeleteWindow(WINHELP_WINDOW*); static void WINHELP_DeleteButtons(WINHELP_WINDOW*); -static void WINHELP_SetupText(HWND hWnd); +static void WINHELP_SetupText(HWND hWnd, ULONG relative); static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM); WINHELP_GLOBALS Globals = {3, NULL, NULL, TRUE, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}}; @@ -560,7 +560,8 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe win->page = wpage->page; win->info = wpage->wininfo; - WINHELP_SetupText(GetDlgItem(win->hMainWnd, CTL_ID_TEXT)); + WINHELP_SetupText(GetDlgItem(win->hMainWnd, CTL_ID_TEXT), wpage->relative); + InvalidateRect(win->hMainWnd, NULL, TRUE); if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE); break; @@ -669,8 +670,8 @@ BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash, wpage.page = NULL; if (hlpfile) - wpage.page = lHash ? HLPFILE_PageByHash(hlpfile, lHash) : - HLPFILE_Contents(hlpfile); + wpage.page = lHash ? HLPFILE_PageByHash(hlpfile, lHash, &wpage.relative) : + HLPFILE_Contents(hlpfile, &wpage.relative); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); @@ -685,7 +686,7 @@ BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap, { WINHELP_WNDPAGE wpage; - wpage.page = HLPFILE_PageByMap(hlpfile, lMap); + wpage.page = HLPFILE_PageByMap(hlpfile, lMap, &wpage.relative); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); @@ -700,7 +701,7 @@ BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE* hlpfile, LONG lOffset, { WINHELP_WNDPAGE wpage; - wpage.page = HLPFILE_PageByOffset(hlpfile, lOffset); + wpage.page = HLPFILE_PageByOffset(hlpfile, lOffset, &wpage.relative); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); @@ -1022,7 +1023,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, case WM_WINDOWPOSCHANGED: winpos = (WINDOWPOS*) lParam; - if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd); + if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd, 0); break; case WM_MOUSEWHEEL: @@ -1359,7 +1360,7 @@ static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam * * SetupText */ -static void WINHELP_SetupText(HWND hWnd) +static void WINHELP_SetupText(HWND hWnd, ULONG relative) { HDC hDc = GetDC(hWnd); RECT rect; diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h index af75261..f8ff0c6 100644 --- a/programs/winhelp/winhelp.h +++ b/programs/winhelp/winhelp.h @@ -95,6 +95,7 @@ typedef struct { HLPFILE_PAGE* page; HLPFILE_WINDOWINFO* wininfo; + ULONG relative; } WINHELP_WNDPAGE; typedef struct tagPageSet
1
0
0
0
Eric Pouech : winhelp: Simplified message box handling.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: c631bb0b56fb7c4bd780d0fe4e8a265dfa4e5c22 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c631bb0b56fb7c4bd780d0fe4…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:44 2008 +0200 winhelp: Simplified message box handling. --- programs/winhelp/winhelp.c | 24 ++++-------------------- programs/winhelp/winhelp.h | 1 - 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 0801cd6..303811f 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -759,7 +759,8 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, if (button) MACRO_ExecuteMacro(button->lpszMacro); else if (!HIWORD(wParam)) - WINHELP_MessageBoxIDS(STID_NOT_IMPLEMENTED, 0x121, MB_OK); + MessageBox(0, MAKEINTRESOURCE(STID_NOT_IMPLEMENTED), + MAKEINTRESOURCE(STID_WHERROR), MB_OK); break; } break; @@ -1913,34 +1914,17 @@ static void WINHELP_InitFonts(HWND hWnd) /*********************************************************************** * - * WINHELP_MessageBoxIDS - */ -INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type) -{ - CHAR text[MAX_STRING_LEN]; - CHAR title[MAX_STRING_LEN]; - - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - LoadString(Globals.hInstance, ids_title, title, sizeof(title)); - - return MessageBox(0, text, title, type); -} - -/*********************************************************************** - * - * MAIN_MessageBoxIDS_s + * WINHELP_MessageBoxIDS_s */ INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) { CHAR text[MAX_STRING_LEN]; - CHAR title[MAX_STRING_LEN]; CHAR newtext[MAX_STRING_LEN + MAX_PATH]; LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - LoadString(Globals.hInstance, ids_title, title, sizeof(title)); wsprintf(newtext, text, str); - return MessageBox(0, newtext, title, type); + return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); } /****************************************************************** diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h index 81ce74e..af75261 100644 --- a/programs/winhelp/winhelp.h +++ b/programs/winhelp/winhelp.h @@ -184,7 +184,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL); BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_CreateIndexWindow(void); void WINHELP_DeleteBackSet(WINHELP_WINDOW*); -INT WINHELP_MessageBoxIDS(UINT, UINT, WORD); INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
1
0
0
0
Eric Pouech : winhelp: Enable/Disable prev/next buttons if there's a prev/ next page.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 3ae5ad8ede5e71b19df8d86e0555cf800019334c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ae5ad8ede5e71b19df8d86e0…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:38 2008 +0200 winhelp: Enable/Disable prev/next buttons if there's a prev/next page. --- programs/winhelp/macro.c | 7 +++++++ programs/winhelp/winhelp.c | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 2ff1ad2..2c38b01 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -245,10 +245,17 @@ void CALLBACK MACRO_BookmarkMore(void) void CALLBACK MACRO_BrowseButtons(void) { + HLPFILE_PAGE* page = Globals.active_win->page; + WINE_TRACE("()\n"); MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); + + if (!HLPFILE_PageByOffset(page->file, page->browse_bwd)) + MACRO_DisableButton("BTN_PREV"); + if (!HLPFILE_PageByOffset(page->file, page->browse_fwd)) + MACRO_DisableButton("BTN_NEXT"); } void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 13507d9..0801cd6 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -614,17 +614,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe MACRO_CreateButton("BTN_TOPICS", buffer, "Finder()"); } - /* Initialize file specific pushbuttons */ - if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page) - { - HLPFILE_MACRO *macro; - for (macro = wpage->page->file->first_macro; macro; macro = macro->next) - MACRO_ExecuteMacro(macro->lpszMacro); - - for (macro = wpage->page->first_macro; macro; macro = macro->next) - MACRO_ExecuteMacro(macro->lpszMacro); - } - if (!bReUsed) { win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME, @@ -644,6 +633,17 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, win); } + /* Initialize file specific pushbuttons */ + if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page) + { + HLPFILE_MACRO *macro; + for (macro = wpage->page->file->first_macro; macro; macro = macro->next) + MACRO_ExecuteMacro(macro->lpszMacro); + + for (macro = wpage->page->first_macro; macro; macro = macro->next) + MACRO_ExecuteMacro(macro->lpszMacro); + } + WINHELP_LayoutMainWindow(win); if (bPopup) Globals.hPopupWnd = win->hMainWnd;
1
0
0
0
Eric Pouech : winhelp: Fixed JumpId and JumpKeyword with correct signature and implementation.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 7ae1bb28fec6cf6098cd1927ffdc9e6e854c088d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7ae1bb28fec6cf6098cd1927f…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:32 2008 +0200 winhelp: Fixed JumpId and JumpKeyword with correct signature and implementation. --- programs/winhelp/macro.c | 31 ++++++++++++++++++++++++------- programs/winhelp/macro.h | 2 +- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 85b19ce..2ff1ad2 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -110,7 +110,7 @@ static struct MacroDesc MACRO_Builtins[] = { {"JumpContext", "JC", 0, "SSU", (FARPROC)MACRO_JumpContext}, {"JumpHash", "JH", 0, "SSU", (FARPROC)MACRO_JumpHash}, {"JumpHelpOn", NULL, 0, "", (FARPROC)MACRO_JumpHelpOn}, - {"JumpID", "JI", 0, "SSS", (FARPROC)MACRO_JumpID}, + {"JumpID", "JI", 0, "SS", (FARPROC)MACRO_JumpID}, {"JumpKeyword", "JK", 0, "SSS", (FARPROC)MACRO_JumpKeyword}, {"KLink", "KL", 0, "SUSS", (FARPROC)MACRO_KLink}, {"Menu", "MU", 0, "", (FARPROC)MACRO_Menu}, @@ -654,15 +654,32 @@ void CALLBACK MACRO_JumpHelpOn(void) WINE_FIXME("()\n"); } -/* FIXME: those two macros are wrong - * they should only contain 2 strings, path & window are coded as path>window - */ -void CALLBACK MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id) +void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id) { - WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, topic_id); - MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id)); + LPSTR ptr; + + WINE_TRACE("(\"%s\", \"%s\")\n", lpszPathWindow, topic_id); + if ((ptr = strchr(lpszPathWindow, '>')) != NULL) + { + LPSTR tmp; + size_t sz = ptr - lpszPathWindow; + + tmp = HeapAlloc(GetProcessHeap(), 0, sz + 1); + if (tmp) + { + memcpy(tmp, lpszPathWindow, sz); + tmp[sz] = '\0'; + MACRO_JumpHash(tmp, ptr + 1, HLPFILE_Hash(topic_id)); + HeapFree(GetProcessHeap(), 0, tmp); + } + } + else + MACRO_JumpHash(lpszPathWindow, NULL, HLPFILE_Hash(topic_id)); } +/* FIXME: this macros is wrong + * it should only contain 2 strings, path & window are coded as path>window + */ void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) { WINE_FIXME("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); diff --git a/programs/winhelp/macro.h b/programs/winhelp/macro.h index b8f736b..ee1fd69 100644 --- a/programs/winhelp/macro.h +++ b/programs/winhelp/macro.h @@ -98,7 +98,7 @@ void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); void CALLBACK MACRO_JumpHelpOn(void); -void CALLBACK MACRO_JumpID(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_JumpID(LPCSTR, LPCSTR); void CALLBACK MACRO_JumpKeyword(LPCSTR, LPCSTR, LPCSTR); void CALLBACK MACRO_KLink(LPCSTR, LONG, LPCSTR, LPCSTR); void CALLBACK MACRO_Menu(void);
1
0
0
0
Eric Pouech : winhelp: Replaced an erroneous FIXME by a TRACE in MACRO_DisableButton().
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 951926e6e548c0b60018ea6d5bbcc66de57496e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=951926e6e548c0b60018ea6d5…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:26 2008 +0200 winhelp: Replaced an erroneous FIXME by a TRACE in MACRO_DisableButton(). --- programs/winhelp/macro.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index d43ec9f..85b19ce 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -418,7 +418,7 @@ void CALLBACK MACRO_DisableButton(LPCSTR id) { WINHELP_BUTTON** b; - WINE_FIXME("(\"%s\")\n", id); + WINE_TRACE("(\"%s\")\n", id); b = MACRO_LookupButton(Globals.active_win, id); if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;}
1
0
0
0
Eric Pouech : winhelp: Don' t add a page to the history when using the back button.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 4a89d2910496304d9365ade2a30f684eb4b3e50f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a89d2910496304d9365ade2a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:20 2008 +0200 winhelp: Don't add a page to the history when using the back button. --- programs/winhelp/macro.c | 6 +++--- programs/winhelp/winhelp.c | 19 +++++++++---------- programs/winhelp/winhelp.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 877d33f..d43ec9f 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -221,7 +221,7 @@ void CALLBACK MACRO_Back(void) WINE_TRACE("()\n"); if (win && win->back.index >= 2) - WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW); + WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW, FALSE); } void CALLBACK MACRO_BackFlush(void) @@ -699,7 +699,7 @@ void CALLBACK MACRO_Next(void) { wp.page->file->wRefCount++; wp.wininfo = Globals.active_win->info; - WINHELP_CreateHelpWindow(&wp, SW_NORMAL); + WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE); } } @@ -739,7 +739,7 @@ void CALLBACK MACRO_Prev(void) { wp.page->file->wRefCount++; wp.wininfo = Globals.active_win->info; - WINHELP_CreateHelpWindow(&wp, SW_NORMAL); + WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE); } } diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index ee7925f..13507d9 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -485,12 +485,10 @@ void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win) } -static void WINHELP_AddHistory(WINHELP_WINDOW* win, HLPFILE_PAGE* page) +static void WINHELP_RememberPage(WINHELP_WINDOW* win, HLPFILE_PAGE* page) { unsigned num; - /* FIXME: when using back, we shouldn't update the history... */ - /* add to history only if different from top of history */ if (!Globals.history.index || Globals.history.set[0].page != page) { num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]); @@ -527,7 +525,7 @@ static void WINHELP_AddHistory(WINHELP_WINDOW* win, HLPFILE_PAGE* page) * * WINHELP_CreateHelpWindow */ -BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow) +BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remember) { WINHELP_WINDOW* win = NULL; BOOL bPrimary, bPopup, bReUsed = FALSE; @@ -590,9 +588,9 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow) win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW); win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND); - if (!bPopup && wpage->page) + if (!bPopup && wpage->page && remember) { - WINHELP_AddHistory(win, wpage->page); + WINHELP_RememberPage(win, wpage->page); } if (!bPopup) @@ -609,6 +607,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow) MACRO_CreateButton("BTN_SEARCH", buffer, "Search()"); LoadString(Globals.hInstance, STID_BACK, buffer, sizeof(buffer)); MACRO_CreateButton("BTN_BACK", buffer, "Back()"); + if (win->back.index <= 1) MACRO_DisableButton("BTN_BACK"); LoadString(Globals.hInstance, STID_HISTORY, buffer, sizeof(buffer)); MACRO_CreateButton("BTN_HISTORY", buffer, "History()"); LoadString(Globals.hInstance, STID_TOPICS, buffer, sizeof(buffer)); @@ -669,7 +668,7 @@ BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash, HLPFILE_Contents(hlpfile); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; - return WINHELP_CreateHelpWindow(&wpage, nCmdShow); + return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); } /*********************************************************************** @@ -684,7 +683,7 @@ BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap, wpage.page = HLPFILE_PageByMap(hlpfile, lMap); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; - return WINHELP_CreateHelpWindow(&wpage, nCmdShow); + return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); } /*********************************************************************** @@ -699,7 +698,7 @@ BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE* hlpfile, LONG lOffset, wpage.page = HLPFILE_PageByOffset(hlpfile, lOffset); if (wpage.page) wpage.page->file->wRefCount++; wpage.wininfo = wi; - return WINHELP_CreateHelpWindow(&wpage, nCmdShow); + return WINHELP_CreateHelpWindow(&wpage, nCmdShow, TRUE); } /*********************************************************************** @@ -1293,7 +1292,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara GetTextMetrics(hDc, &tm); i = HIWORD(lParam) / tm.tmHeight; if (i < Globals.history.index) - WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW); + WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW, TRUE); ReleaseDC(hWnd, hDc); break; case WM_PAINT: diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h index f1f67d2..81ce74e 100644 --- a/programs/winhelp/winhelp.h +++ b/programs/winhelp/winhelp.h @@ -180,7 +180,7 @@ extern FARPROC Callbacks[]; BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int); +BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL); BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_CreateIndexWindow(void); void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
1
0
0
0
Eric Pouech : winhelp: Properly display the page title.
by Alexandre Julliard
23 Apr '08
23 Apr '08
Module: wine Branch: master Commit: 07cf778b2bed2c2dbbfb9408b556850f1d40876b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=07cf778b2bed2c2dbbfb9408b…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Apr 22 22:00:14 2008 +0200 winhelp: Properly display the page title. --- programs/winhelp/winhelp.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index a33c470..ee7925f 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -112,6 +112,12 @@ BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) return GetOpenFileName(&openfilename); } +static char* WINHELP_GetCaption(WINHELP_WNDPAGE* wpage) +{ + if (wpage->wininfo->caption[0]) return wpage->wininfo->caption; + return wpage->page->file->lpszTitle; +} + /*********************************************************************** * * WINHELP_LookupHelpFile @@ -540,7 +546,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow) { WINHELP_DeleteButtons(win); bReUsed = TRUE; - SetWindowText(win->hMainWnd, wpage->wininfo->caption); + SetWindowText(win->hMainWnd, WINHELP_GetCaption(wpage)); if (wpage->wininfo->origin.x != CW_USEDEFAULT && wpage->wininfo->origin.y != CW_USEDEFAULT) SetWindowPos(win->hMainWnd, HWND_TOP, @@ -623,7 +629,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow) if (!bReUsed) { win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME, - wpage->wininfo->caption, + WINHELP_GetCaption(wpage), bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style, wpage->wininfo->origin.x, wpage->wininfo->origin.y, wpage->wininfo->size.cx, wpage->wininfo->size.cy,
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
128
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Results per page:
10
25
50
100
200