Commit 6d40dbe3 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winhelp: Added the notion of WINHELP_WNDPAGE and use it to move the history to…

winhelp: Added the notion of WINHELP_WNDPAGE and use it to move the history to the global variables.
parent 7a608ea6
......@@ -220,9 +220,8 @@ void CALLBACK MACRO_Back(void)
WINE_TRACE("()\n");
if (win && win->backIndex >= 2)
WINHELP_CreateHelpWindow(win->back[--win->backIndex - 1],
win->info, SW_SHOW);
if (win && win->back.index >= 2)
WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW);
}
void CALLBACK MACRO_BackFlush(void)
......@@ -235,12 +234,12 @@ void CALLBACK MACRO_BackFlush(void)
{
unsigned int i;
for (i = 0; i < win->backIndex; i++)
for (i = 0; i < win->back.index; i++)
{
HLPFILE_FreeHlpFile(win->back[i]->file);
win->back[i] = NULL;
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
win->back.set[i].page = NULL;
}
win->backIndex = 0;
win->back.index = 0;
}
}
......@@ -701,15 +700,16 @@ void CALLBACK MACRO_MPrintID(LPCSTR str)
void CALLBACK MACRO_Next(void)
{
HLPFILE_PAGE* page;
WINHELP_WNDPAGE wp;
WINE_TRACE("()\n");
page = Globals.active_win->page;
page = HLPFILE_PageByOffset(page->file, page->browse_fwd);
if (page)
wp.page = Globals.active_win->page;
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd);
if (wp.page)
{
page->file->wRefCount++;
WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL);
wp.page->file->wRefCount++;
wp.wininfo = Globals.active_win->info;
WINHELP_CreateHelpWindow(&wp, SW_NORMAL);
}
}
......@@ -740,15 +740,16 @@ void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3,
void CALLBACK MACRO_Prev(void)
{
HLPFILE_PAGE* page;
WINHELP_WNDPAGE wp;
WINE_TRACE("()\n");
page = Globals.active_win->page;
page = HLPFILE_PageByOffset(page->file, page->browse_bwd);
if (page)
wp.page = Globals.active_win->page;
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd);
if (wp.page)
{
page->file->wRefCount++;
WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL);
wp.page->file->wRefCount++;
wp.wininfo = Globals.active_win->info;
WINHELP_CreateHelpWindow(&wp, SW_NORMAL);
}
}
......
......@@ -91,6 +91,19 @@ typedef struct tagHelpButton
struct tagHelpButton*next;
} WINHELP_BUTTON;
typedef struct
{
HLPFILE_PAGE* page;
HLPFILE_WINDOWINFO* wininfo;
} WINHELP_WNDPAGE;
typedef struct tagPageSet
{
/* FIXME: for now it's a fixed size */
WINHELP_WNDPAGE set[40];
unsigned index;
} WINHELP_PAGESET;
typedef struct tagWinHelp
{
LPCSTR lpszName;
......@@ -113,11 +126,7 @@ typedef struct tagWinHelp
HLPFILE_WINDOWINFO* info;
/* FIXME: for now it's a fixed size */
HLPFILE_PAGE* history[40];
unsigned histIndex;
HLPFILE_PAGE* back[40];
unsigned backIndex;
WINHELP_PAGESET back;
struct tagWinHelp* next;
} WINHELP_WINDOW;
......@@ -162,6 +171,7 @@ typedef struct
WINHELP_WINDOW* win_list;
WNDPROC button_proc;
WINHELP_DLL* dlls;
WINHELP_PAGESET history;
} WINHELP_GLOBALS;
extern WINHELP_GLOBALS Globals;
......@@ -170,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(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int);
BOOL WINHELP_GetOpenFileName(LPSTR, int);
BOOL WINHELP_CreateIndexWindow(void);
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment