1996-05-06 18:06:24 +02:00
|
|
|
/*
|
|
|
|
* Help Viewer
|
|
|
|
*
|
|
|
|
* Copyright 1996 Ulrich Schmid
|
2008-07-12 10:37:01 +02:00
|
|
|
* Copyright 2002, 2008 Eric Pouech
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1996-05-06 18:06:24 +02:00
|
|
|
*/
|
|
|
|
|
2006-01-18 14:23:11 +01:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
1997-01-01 18:29:55 +01:00
|
|
|
#include "windows.h"
|
|
|
|
#include "commdlg.h"
|
2010-06-09 21:22:22 +02:00
|
|
|
#include "shellapi.h"
|
1996-05-06 18:06:24 +02:00
|
|
|
#include "winhelp.h"
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
|
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
/**************************************************/
|
|
|
|
/* Macro table */
|
|
|
|
/**************************************************/
|
|
|
|
struct MacroDesc {
|
2005-06-02 17:11:32 +02:00
|
|
|
const char* name;
|
|
|
|
const char* alias;
|
2002-11-15 02:34:57 +01:00
|
|
|
BOOL isBool;
|
2005-06-02 17:11:32 +02:00
|
|
|
const char* arguments;
|
2009-10-07 13:40:00 +02:00
|
|
|
void *fn;
|
2002-11-15 02:34:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct MacroDesc*MACRO_Loaded /* = NULL */;
|
|
|
|
static unsigned MACRO_NumLoaded /* = 0 */;
|
|
|
|
|
2009-01-08 14:16:40 +01:00
|
|
|
/******* helper functions *******/
|
|
|
|
|
2009-05-13 10:28:45 +02:00
|
|
|
static char* StrDup(const char* str)
|
|
|
|
{
|
|
|
|
char* dst;
|
|
|
|
dst=HeapAlloc(GetProcessHeap(),0,strlen(str)+1);
|
|
|
|
strcpy(dst, str);
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:40 +01:00
|
|
|
static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name)
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
2009-01-08 14:16:40 +01:00
|
|
|
WINHELP_BUTTON** b;
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2009-01-08 14:16:40 +01:00
|
|
|
for (b = &win->first_button; *b; b = &(*b)->next)
|
2012-01-20 12:50:15 +01:00
|
|
|
if (!lstrcmpiA(name, (*b)->lpszID)) break;
|
2009-01-08 14:16:40 +01:00
|
|
|
return b;
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
|
|
|
|
2010-06-09 21:22:22 +02:00
|
|
|
/******* some forward declarations *******/
|
|
|
|
static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id);
|
|
|
|
|
2009-01-08 14:16:40 +01:00
|
|
|
/******* real macro implementation *******/
|
|
|
|
|
|
|
|
void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
WINHELP_WINDOW *win = MACRO_CurrentWindow();
|
2009-01-08 14:16:40 +01:00
|
|
|
WINHELP_BUTTON *button, **b;
|
|
|
|
LONG size;
|
|
|
|
LPSTR ptr;
|
2004-09-27 22:07:03 +02:00
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s, %s)\n", debugstr_a(id), debugstr_a(name), debugstr_a(macro));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
size = sizeof(WINHELP_BUTTON) + strlen(id) + strlen(name) + strlen(macro) + 3;
|
2009-01-08 14:16:40 +01:00
|
|
|
|
|
|
|
button = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
if (!button) return;
|
|
|
|
|
|
|
|
button->next = 0;
|
|
|
|
button->hWnd = 0;
|
|
|
|
|
|
|
|
ptr = (char*)button + sizeof(WINHELP_BUTTON);
|
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, id);
|
2009-01-08 14:16:40 +01:00
|
|
|
button->lpszID = ptr;
|
2012-01-20 12:50:15 +01:00
|
|
|
ptr += strlen(id) + 1;
|
2009-01-08 14:16:40 +01:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, name);
|
2009-01-08 14:16:40 +01:00
|
|
|
button->lpszName = ptr;
|
2012-01-20 12:50:15 +01:00
|
|
|
ptr += strlen(name) + 1;
|
2009-01-08 14:16:40 +01:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, macro);
|
2009-01-08 14:16:40 +01:00
|
|
|
button->lpszMacro = ptr;
|
|
|
|
|
|
|
|
button->wParam = WH_FIRST_BUTTON;
|
|
|
|
for (b = &win->first_button; *b; b = &(*b)->next)
|
|
|
|
button->wParam = max(button->wParam, (*b)->wParam + 1);
|
|
|
|
*b = button;
|
|
|
|
|
|
|
|
WINHELP_LayoutMainWindow(win);
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_DestroyButton(LPCSTR str)
|
2009-01-08 14:16:40 +01:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
2009-01-08 14:16:40 +01:00
|
|
|
}
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2009-01-08 14:16:40 +01:00
|
|
|
void CALLBACK MACRO_DisableButton(LPCSTR id)
|
2002-10-21 20:20:23 +02:00
|
|
|
{
|
|
|
|
WINHELP_BUTTON** b;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(id));
|
2009-01-08 14:16:40 +01:00
|
|
|
|
2009-05-30 14:26:39 +02:00
|
|
|
b = MACRO_LookupButton(MACRO_CurrentWindow(), id);
|
2016-04-21 22:03:57 +02:00
|
|
|
if (!*b) {WINE_FIXME("Couldn't find button %s\n", debugstr_a(id)); return;}
|
2009-01-08 14:16:40 +01:00
|
|
|
|
|
|
|
EnableWindow((*b)->hWnd, FALSE);
|
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_EnableButton(LPCSTR id)
|
2009-01-08 14:16:40 +01:00
|
|
|
{
|
|
|
|
WINHELP_BUTTON** b;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(id));
|
2009-01-08 14:16:40 +01:00
|
|
|
|
2009-05-30 14:26:39 +02:00
|
|
|
b = MACRO_LookupButton(MACRO_CurrentWindow(), id);
|
2016-04-21 22:03:57 +02:00
|
|
|
if (!*b) {WINE_FIXME("Couldn't find button %s\n", debugstr_a(id)); return;}
|
2009-01-08 14:16:40 +01:00
|
|
|
|
|
|
|
EnableWindow((*b)->hWnd, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
|
|
|
|
{
|
|
|
|
HLPFILE* hlpfile;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow));
|
2009-01-08 14:16:40 +01:00
|
|
|
if ((hlpfile = WINHELP_LookupHelpFile(lpszPath)))
|
|
|
|
WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, 0,
|
|
|
|
WINHELP_GetWindowInfo(hlpfile, lpszWindow),
|
|
|
|
SW_NORMAL);
|
2002-10-21 20:20:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_About(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2010-10-15 12:13:13 +02:00
|
|
|
WCHAR name[256];
|
|
|
|
HICON icon = LoadImageW( Globals.hInstance, MAKEINTRESOURCEW(IDI_WINHELP),
|
|
|
|
IMAGE_ICON, 48, 48, LR_SHARED );
|
2018-08-10 12:27:55 +02:00
|
|
|
LoadStringW( Globals.hInstance, STID_WINE_HELP, name, ARRAY_SIZE( name ));
|
2010-10-15 12:13:13 +02:00
|
|
|
ShellAboutW( MACRO_CurrentWindow()->hMainWnd, name, NULL, icon );
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%lu, %lu, %s)\n", u1, u2, debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu, %s)\n", debugstr_a(str1), u, debugstr_a(str2));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_Annotate(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s, %s, %s, %s)\n", debugstr_a(str1), debugstr_a(str2), debugstr_a(str3), debugstr_a(str4));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Back(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
WINHELP_WINDOW* win = MACRO_CurrentWindow();
|
2002-11-20 20:46:18 +01:00
|
|
|
|
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
2008-04-22 21:59:38 +02:00
|
|
|
if (win && win->back.index >= 2)
|
2008-04-22 22:00:20 +02:00
|
|
|
WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW, FALSE);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_BackFlush(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
WINHELP_WINDOW* win = MACRO_CurrentWindow();
|
2002-11-20 20:46:18 +01:00
|
|
|
|
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
2008-04-22 21:59:57 +02:00
|
|
|
if (win) WINHELP_DeleteBackSet(win);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_BookmarkDefine(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_BookmarkMore(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_BrowseButtons(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
HLPFILE_PAGE* page = MACRO_CurrentWindow()->page;
|
2008-04-22 22:00:56 +02:00
|
|
|
ULONG relative;
|
2008-04-22 22:00:38 +02:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
MACRO_CreateButton("BTN_PREV", "&<<", "Prev()");
|
|
|
|
MACRO_CreateButton("BTN_NEXT", "&>>", "Next()");
|
2008-04-22 22:00:38 +02:00
|
|
|
|
2008-04-22 22:00:56 +02:00
|
|
|
if (!HLPFILE_PageByOffset(page->file, page->browse_bwd, &relative))
|
2008-04-22 22:00:38 +02:00
|
|
|
MACRO_DisableButton("BTN_PREV");
|
2008-04-22 22:00:56 +02:00
|
|
|
if (!HLPFILE_PageByOffset(page->file, page->browse_fwd, &relative))
|
2008-04-22 22:00:38 +02:00
|
|
|
MACRO_DisableButton("BTN_NEXT");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
WINHELP_WINDOW* win = MACRO_CurrentWindow();
|
2002-10-21 20:20:23 +02:00
|
|
|
WINHELP_BUTTON* button;
|
|
|
|
WINHELP_BUTTON** b;
|
|
|
|
LONG size;
|
|
|
|
LPSTR ptr;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s)\n", debugstr_a(id), debugstr_a(macro));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2002-10-21 20:20:23 +02:00
|
|
|
b = MACRO_LookupButton(win, id);
|
2016-04-21 22:03:57 +02:00
|
|
|
if (!*b) {WINE_FIXME("Couldn't find button %s\n", debugstr_a(id)); return;}
|
2002-10-21 20:20:23 +02:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
size = sizeof(WINHELP_BUTTON) + strlen(id) +
|
|
|
|
strlen((*b)->lpszName) + strlen(macro) + 3;
|
2002-10-21 20:20:23 +02:00
|
|
|
|
|
|
|
button = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
if (!button) return;
|
|
|
|
|
|
|
|
button->next = (*b)->next;
|
|
|
|
button->hWnd = (*b)->hWnd;
|
|
|
|
button->wParam = (*b)->wParam;
|
|
|
|
|
|
|
|
ptr = (char*)button + sizeof(WINHELP_BUTTON);
|
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, id);
|
2002-10-21 20:20:23 +02:00
|
|
|
button->lpszID = ptr;
|
2012-01-20 12:50:15 +01:00
|
|
|
ptr += strlen(id) + 1;
|
2002-10-21 20:20:23 +02:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, (*b)->lpszName);
|
2002-10-21 20:20:23 +02:00
|
|
|
button->lpszName = ptr;
|
2012-01-20 12:50:15 +01:00
|
|
|
ptr += strlen((*b)->lpszName) + 1;
|
2002-10-21 20:20:23 +02:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
strcpy(ptr, macro);
|
2002-10-21 20:20:23 +02:00
|
|
|
button->lpszMacro = ptr;
|
|
|
|
|
|
|
|
*b = button;
|
|
|
|
|
2008-04-18 21:33:51 +02:00
|
|
|
WINHELP_LayoutMainWindow(win);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s)\n", debugstr_a(id), debugstr_a(macro));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2002-10-21 20:20:23 +02:00
|
|
|
MACRO_ChangeButtonBinding(id, macro);
|
|
|
|
MACRO_EnableButton(id);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s, %s)\n", debugstr_a(str1), debugstr_a(str2));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_CheckItem(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_CloseSecondarys(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
WINHELP_WINDOW *win;
|
2010-06-12 21:55:05 +02:00
|
|
|
WINHELP_WINDOW *next;
|
2002-11-15 02:34:57 +01:00
|
|
|
|
|
|
|
WINE_TRACE("()\n");
|
2010-06-12 21:55:05 +02:00
|
|
|
for (win = Globals.win_list; win; win = next)
|
|
|
|
{
|
|
|
|
next = win->next;
|
2012-01-20 12:50:15 +01:00
|
|
|
if (lstrcmpiA(win->info->name, "main"))
|
2009-05-30 14:27:04 +02:00
|
|
|
WINHELP_ReleaseWindow(win);
|
2010-06-12 21:55:05 +02:00
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
WINHELP_WINDOW *win;
|
2010-06-12 21:55:05 +02:00
|
|
|
WINHELP_WINDOW *next;
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(lpszWindow));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2010-06-12 21:55:05 +02:00
|
|
|
for (win = Globals.win_list; win; win = next)
|
|
|
|
{
|
|
|
|
next = win->next;
|
2012-01-20 12:50:15 +01:00
|
|
|
if (!lstrcmpiA(win->info->name, lpszWindow))
|
2009-05-30 14:27:04 +02:00
|
|
|
WINHELP_ReleaseWindow(win);
|
2010-06-12 21:55:05 +02:00
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Compare(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Contents(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
HLPFILE_PAGE* page = MACRO_CurrentWindow()->page;
|
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
2009-05-30 14:26:39 +02:00
|
|
|
if (page)
|
|
|
|
MACRO_JumpContents(page->file->lpszPath, NULL);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %lu)\n", debugstr_a(str1), debugstr_a(str2), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_CopyDialog(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_CopyTopic(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_DeleteItem(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_DeleteMark(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_DisableItem(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_EnableItem(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_EndMPrint(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2010-06-09 21:22:22 +02:00
|
|
|
static void CALLBACK MACRO_ExecFile(LPCSTR pgm, LPCSTR args, LONG cmd_show, LPCSTR topic)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2010-06-09 21:22:22 +02:00
|
|
|
HINSTANCE ret;
|
|
|
|
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_TRACE("(%s, %s, %lu, %s)\n",
|
2016-04-21 22:03:57 +02:00
|
|
|
debugstr_a(pgm), debugstr_a(args), cmd_show, debugstr_a(topic));
|
2010-06-09 21:22:22 +02:00
|
|
|
|
|
|
|
ret = ShellExecuteA(Globals.active_win ? Globals.active_win->hMainWnd : NULL, "open",
|
|
|
|
pgm, args, ".", cmd_show);
|
|
|
|
if ((DWORD_PTR)ret < 32)
|
|
|
|
{
|
|
|
|
WINE_WARN("Failed with %p\n", ret);
|
|
|
|
if (topic) MACRO_JumpID(NULL, topic);
|
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_Exit(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
while (Globals.win_list)
|
2009-05-30 14:27:04 +02:00
|
|
|
WINHELP_ReleaseWindow(Globals.win_list);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %s, %s, %lu, %lu)\n", debugstr_a(str1), debugstr_a(str2), debugstr_a(str3), debugstr_a(str4), u1, u2);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %s, %lu, %lu)\n", debugstr_a(str1), debugstr_a(str2), debugstr_a(str3), u1, u2);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_FileExist(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(str));
|
2012-01-20 12:50:15 +01:00
|
|
|
return GetFileAttributesA(str) != INVALID_FILE_ATTRIBUTES;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_FileOpen(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2006-11-06 13:07:01 +01:00
|
|
|
char szFile[MAX_PATH];
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2006-11-06 13:07:01 +01:00
|
|
|
if (WINHELP_GetOpenFileName(szFile, MAX_PATH))
|
2002-11-18 20:48:11 +01:00
|
|
|
{
|
2008-04-22 22:01:08 +02:00
|
|
|
MACRO_JumpContents(szFile, "main");
|
2002-11-18 20:48:11 +01:00
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Find(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Finder(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2008-07-05 21:33:19 +02:00
|
|
|
WINHELP_CreateIndexWindow(FALSE);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_FloatingMenu(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Flush(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINHELP_WINDOW *win;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(lpszWindow));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
|
|
|
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
|
|
|
|
|
|
|
|
for (win = Globals.win_list; win; win = win->next)
|
2012-01-20 12:50:15 +01:00
|
|
|
if (!lstrcmpiA(win->info->name, lpszWindow))
|
2002-11-15 02:34:57 +01:00
|
|
|
SetFocus(win->hMainWnd);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lx, %lx)\n", debugstr_a(str), w, l);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_GotoMark(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_HelpOn(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-07-22 05:48:28 +02:00
|
|
|
WINHELP_WINDOW *win = MACRO_CurrentWindow();
|
|
|
|
LPCSTR file = NULL;
|
2008-07-12 10:37:01 +02:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
2009-07-22 05:48:28 +02:00
|
|
|
if (win && win->page && win->page->file)
|
|
|
|
file = win->page->file->help_on_file;
|
|
|
|
|
2008-07-12 10:37:01 +02:00
|
|
|
if (!file)
|
|
|
|
file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp";
|
|
|
|
|
|
|
|
MACRO_JumpContents(file, NULL);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_HelpOnTop(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2011-03-31 12:44:21 +02:00
|
|
|
static BOOL on_top = FALSE;
|
|
|
|
WINHELP_WINDOW *win;
|
|
|
|
HWND main_wnd = NULL;
|
|
|
|
HMENU menu;
|
|
|
|
|
|
|
|
for (win = Globals.win_list; win; win = win->next)
|
2012-01-20 12:50:15 +01:00
|
|
|
if (!lstrcmpiA(win->info->name, "main"))
|
2011-03-31 12:44:21 +02:00
|
|
|
main_wnd = win->hMainWnd;
|
|
|
|
if (!main_wnd)
|
|
|
|
{
|
|
|
|
WINE_ERR("could not find the main window!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
menu = GetMenu(main_wnd);
|
|
|
|
|
|
|
|
on_top = !on_top;
|
|
|
|
if (on_top) {
|
|
|
|
CheckMenuItem(menu, MNID_HELP_HELPTOP, MF_BYCOMMAND|MF_CHECKED);
|
|
|
|
SetWindowPos(main_wnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
} else {
|
|
|
|
CheckMenuItem(menu, MNID_HELP_HELPTOP, MF_BYCOMMAND|MF_UNCHECKED);
|
|
|
|
SetWindowPos(main_wnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_History(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-20 20:46:18 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
|
|
|
if (Globals.active_win && !Globals.active_win->hHistoryWnd)
|
|
|
|
{
|
2012-01-20 12:50:15 +01:00
|
|
|
HWND hWnd = CreateWindowA(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW,
|
2002-11-20 20:46:18 +01:00
|
|
|
0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win);
|
|
|
|
ShowWindow(hWnd, SW_NORMAL);
|
|
|
|
}
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t)
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
2009-05-30 14:26:33 +02:00
|
|
|
if (b) MACRO_ExecuteMacro(MACRO_CurrentWindow(), t);
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f)
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
2009-05-30 14:26:33 +02:00
|
|
|
if (b) MACRO_ExecuteMacro(MACRO_CurrentWindow(), t);
|
|
|
|
else MACRO_ExecuteMacro(MACRO_CurrentWindow(), f);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_InitMPrint(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
2002-07-16 03:46:29 +02:00
|
|
|
return FALSE;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %s, %s, %lu)\n", debugstr_a(str1), debugstr_a(str2), debugstr_a(str3), debugstr_a(str4), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %lu)\n", debugstr_a(str1), debugstr_a(str2), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_IsBook(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
return Globals.isBook;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_IsMark(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
2002-07-16 03:46:29 +02:00
|
|
|
return FALSE;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_IsNotMark(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
2002-07-16 03:46:29 +02:00
|
|
|
return TRUE;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2006-10-26 11:21:44 +02:00
|
|
|
HLPFILE* hlpfile;
|
|
|
|
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_TRACE("(%s, %s, %ld)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow), context);
|
2011-07-31 08:53:34 +02:00
|
|
|
if ((hlpfile = WINHELP_LookupHelpFile(lpszPath)))
|
|
|
|
/* Some madness: what user calls 'context', hlpfile calls 'map' */
|
|
|
|
WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context,
|
|
|
|
WINHELP_GetWindowInfo(hlpfile, lpszWindow),
|
|
|
|
SW_NORMAL);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-18 20:48:11 +01:00
|
|
|
HLPFILE* hlpfile;
|
|
|
|
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_TRACE("(%s, %s, %lu)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow), lHash);
|
2009-05-30 14:26:46 +02:00
|
|
|
if (!lpszPath || !lpszPath[0])
|
|
|
|
hlpfile = MACRO_CurrentWindow()->page->file;
|
|
|
|
else
|
|
|
|
hlpfile = WINHELP_LookupHelpFile(lpszPath);
|
2011-07-31 08:53:34 +02:00
|
|
|
if (hlpfile)
|
|
|
|
WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash,
|
|
|
|
WINHELP_GetWindowInfo(hlpfile, lpszWindow),
|
|
|
|
SW_NORMAL);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_JumpHelpOn(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2008-04-22 22:00:32 +02:00
|
|
|
LPSTR ptr;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s)\n", debugstr_a(lpszPathWindow), debugstr_a(topic_id));
|
2016-05-09 17:56:14 +02:00
|
|
|
if (lpszPathWindow && (ptr = strchr(lpszPathWindow, '>')) != NULL)
|
2008-04-22 22:00:32 +02:00
|
|
|
{
|
|
|
|
LPSTR tmp;
|
2010-06-12 21:54:59 +02:00
|
|
|
size_t sz;
|
2008-04-22 22:00:32 +02:00
|
|
|
|
2010-06-12 21:54:59 +02:00
|
|
|
tmp = HeapAlloc(GetProcessHeap(), 0, strlen(lpszPathWindow) + 1);
|
2008-04-22 22:00:32 +02:00
|
|
|
if (tmp)
|
|
|
|
{
|
2010-06-12 21:54:59 +02:00
|
|
|
strcpy(tmp, lpszPathWindow);
|
|
|
|
tmp[ptr - lpszPathWindow] = '\0';
|
|
|
|
ptr += tmp - lpszPathWindow; /* ptr now points to '>' in tmp buffer */
|
|
|
|
/* in some cases, we have a trailing space that we need to get rid of */
|
|
|
|
/* FIXME: check if it has to be done in lexer rather than here */
|
|
|
|
for (sz = strlen(ptr + 1); sz >= 1 && ptr[sz] == ' '; sz--) ptr[sz] = '\0';
|
2008-04-22 22:00:32 +02:00
|
|
|
MACRO_JumpHash(tmp, ptr + 1, HLPFILE_Hash(topic_id));
|
|
|
|
HeapFree(GetProcessHeap(), 0, tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MACRO_JumpHash(lpszPathWindow, NULL, HLPFILE_Hash(topic_id));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2008-04-22 22:00:32 +02:00
|
|
|
/* FIXME: this macros is wrong
|
|
|
|
* it should only contain 2 strings, path & window are coded as path>window
|
|
|
|
*/
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s, %s, %s)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow), debugstr_a(keyword));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu, %s, %s)\n", debugstr_a(str1), u, debugstr_a(str2), debugstr_a(str3));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Menu(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_MPrintHash(LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%lu)\n", u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_MPrintID(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Next(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2008-04-22 21:59:38 +02:00
|
|
|
WINHELP_WNDPAGE wp;
|
2002-11-18 20:48:11 +01:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
2009-05-30 14:26:39 +02:00
|
|
|
wp.page = MACRO_CurrentWindow()->page;
|
2008-04-22 22:00:56 +02:00
|
|
|
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd, &wp.relative);
|
2008-04-22 21:59:38 +02:00
|
|
|
if (wp.page)
|
2002-11-18 20:48:11 +01:00
|
|
|
{
|
2008-04-22 21:59:38 +02:00
|
|
|
wp.page->file->wRefCount++;
|
2009-05-30 14:26:39 +02:00
|
|
|
wp.wininfo = MACRO_CurrentWindow()->info;
|
2008-04-22 22:00:20 +02:00
|
|
|
WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE);
|
2002-11-18 20:48:11 +01:00
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_NoShow(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s, %s)\n", debugstr_a(str1), debugstr_a(str2));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%li, %li, %lu, %lu, %lu, %s)\n", i1, i2, u1, u2, u3, debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Prev(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2008-04-22 21:59:38 +02:00
|
|
|
WINHELP_WNDPAGE wp;
|
2002-11-18 20:48:11 +01:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
2009-05-30 14:26:39 +02:00
|
|
|
wp.page = MACRO_CurrentWindow()->page;
|
2008-04-22 22:00:56 +02:00
|
|
|
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd, &wp.relative);
|
2008-04-22 21:59:38 +02:00
|
|
|
if (wp.page)
|
2002-11-18 20:48:11 +01:00
|
|
|
{
|
2008-04-22 21:59:38 +02:00
|
|
|
wp.page->file->wRefCount++;
|
2009-05-30 14:26:39 +02:00
|
|
|
wp.wininfo = MACRO_CurrentWindow()->info;
|
2008-04-22 22:00:20 +02:00
|
|
|
WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE);
|
2002-11-18 20:48:11 +01:00
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_Print(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2012-01-20 12:50:15 +01:00
|
|
|
PRINTDLGW printer;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_TRACE("()\n");
|
|
|
|
|
1998-03-29 21:44:57 +02:00
|
|
|
printer.lStructSize = sizeof(printer);
|
2009-05-30 14:26:39 +02:00
|
|
|
printer.hwndOwner = MACRO_CurrentWindow()->hMainWnd;
|
1998-03-29 21:44:57 +02:00
|
|
|
printer.hInstance = Globals.hInstance;
|
|
|
|
printer.hDevMode = 0;
|
|
|
|
printer.hDevNames = 0;
|
|
|
|
printer.hDC = 0;
|
|
|
|
printer.Flags = 0;
|
|
|
|
printer.nFromPage = 0;
|
|
|
|
printer.nToPage = 0;
|
|
|
|
printer.nMinPage = 0;
|
|
|
|
printer.nMaxPage = 0;
|
|
|
|
printer.nCopies = 0;
|
|
|
|
printer.lCustData = 0;
|
|
|
|
printer.lpfnPrintHook = 0;
|
|
|
|
printer.lpfnSetupHook = 0;
|
|
|
|
printer.lpPrintTemplateName = 0;
|
|
|
|
printer.lpSetupTemplateName = 0;
|
|
|
|
printer.hPrintTemplate = 0;
|
|
|
|
printer.hSetupTemplate = 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2012-01-20 12:50:15 +01:00
|
|
|
if (PrintDlgW(&printer)) {
|
2002-07-16 03:46:29 +02:00
|
|
|
WINE_FIXME("Print()\n");
|
|
|
|
}
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_PrinterSetup(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-10-07 13:40:00 +02:00
|
|
|
void *fn = NULL;
|
2004-12-13 22:06:46 +01:00
|
|
|
int size;
|
|
|
|
WINHELP_DLL* dll;
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s, %s, %s)\n", debugstr_a(dll_name), debugstr_a(proc), debugstr_a(args));
|
2002-11-15 02:34:57 +01:00
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
/* FIXME: are the registered DLLs global or linked to the current file ???
|
|
|
|
* We assume globals (as we did for macros, but is this really the case ???)
|
|
|
|
*/
|
|
|
|
for (dll = Globals.dlls; dll; dll = dll->next)
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
2004-12-13 22:06:46 +01:00
|
|
|
if (!strcmp(dll->name, dll_name)) break;
|
|
|
|
}
|
|
|
|
if (!dll)
|
|
|
|
{
|
2012-01-20 12:50:15 +01:00
|
|
|
HANDLE hLib = LoadLibraryA(dll_name);
|
2004-12-13 22:06:46 +01:00
|
|
|
|
|
|
|
/* FIXME: the library will not be unloaded until exit of program
|
|
|
|
* We don't send the DW_TERM message
|
|
|
|
*/
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("Loading %s\n", debugstr_a(dll_name));
|
2004-12-13 22:06:46 +01:00
|
|
|
/* FIXME: should look in the directory where current hlpfile
|
|
|
|
* is loaded from
|
|
|
|
*/
|
|
|
|
if (hLib == NULL)
|
|
|
|
{
|
|
|
|
/* FIXME: internationalisation for error messages */
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("Cannot find dll %s\n", debugstr_a(dll_name));
|
2004-12-13 22:06:46 +01:00
|
|
|
}
|
|
|
|
else if ((dll = HeapAlloc(GetProcessHeap(), 0, sizeof(*dll))))
|
|
|
|
{
|
|
|
|
dll->hLib = hLib;
|
2009-05-13 10:28:45 +02:00
|
|
|
dll->name = StrDup(dll_name); /* FIXME: never freed */
|
2004-12-13 22:06:46 +01:00
|
|
|
dll->next = Globals.dlls;
|
|
|
|
Globals.dlls = dll;
|
|
|
|
dll->handler = (WINHELP_LDLLHandler)GetProcAddress(dll->hLib, "LDLLHandler");
|
|
|
|
dll->class = dll->handler ? (dll->handler)(DW_WHATMSG, 0, 0) : DC_NOMSG;
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_TRACE("Got class %lx for DLL %s\n", dll->class, debugstr_a(dll_name));
|
2004-12-13 22:06:46 +01:00
|
|
|
if (dll->class & DC_INITTERM) dll->handler(DW_INIT, 0, 0);
|
2009-10-07 13:31:32 +02:00
|
|
|
if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (LONG_PTR)&Callbacks, 0);
|
2004-12-13 22:06:46 +01:00
|
|
|
}
|
|
|
|
else WINE_WARN("OOM\n");
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
2004-12-13 22:06:46 +01:00
|
|
|
if (dll && !(fn = GetProcAddress(dll->hLib, proc)))
|
2002-11-15 02:34:57 +01:00
|
|
|
{
|
|
|
|
/* FIXME: internationalisation for error messages */
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("Cannot find proc %s in dll %s\n", debugstr_a(dll_name), debugstr_a(proc));
|
2002-11-15 02:34:57 +01:00
|
|
|
}
|
|
|
|
|
2003-10-11 07:25:31 +02:00
|
|
|
size = ++MACRO_NumLoaded * sizeof(struct MacroDesc);
|
|
|
|
if (!MACRO_Loaded) MACRO_Loaded = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
else MACRO_Loaded = HeapReAlloc(GetProcessHeap(), 0, MACRO_Loaded, size);
|
2009-05-13 10:28:45 +02:00
|
|
|
MACRO_Loaded[MACRO_NumLoaded - 1].name = StrDup(proc); /* FIXME: never freed */
|
2002-11-15 02:34:57 +01:00
|
|
|
MACRO_Loaded[MACRO_NumLoaded - 1].alias = NULL;
|
2014-02-18 10:58:40 +01:00
|
|
|
MACRO_Loaded[MACRO_NumLoaded - 1].isBool = FALSE;
|
2009-05-13 10:28:45 +02:00
|
|
|
MACRO_Loaded[MACRO_NumLoaded - 1].arguments = StrDup(args); /* FIXME: never freed */
|
2002-11-15 02:34:57 +01:00
|
|
|
MACRO_Loaded[MACRO_NumLoaded - 1].fn = fn;
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("Added %s(%s) at %p\n", debugstr_a(proc), debugstr_a(args), fn);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%lu, %lu)\n", u1, u2);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ResetMenu(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-11-15 02:34:57 +01:00
|
|
|
WINE_FIXME("()\n");
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_SaveMark(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Search(void)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2008-07-05 21:33:19 +02:00
|
|
|
WINHELP_CreateIndexWindow(TRUE);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2004-12-13 22:06:46 +01:00
|
|
|
void CALLBACK MACRO_SetContents(LPCSTR str, LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_SetHelpOnFile(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
HLPFILE_PAGE* page = MACRO_CurrentWindow()->page;
|
|
|
|
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_TRACE("(%s)\n", debugstr_a(str));
|
2008-07-12 10:37:01 +02:00
|
|
|
|
2009-05-30 14:26:39 +02:00
|
|
|
HeapFree(GetProcessHeap(), 0, page->file->help_on_file);
|
|
|
|
page->file->help_on_file = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
|
|
|
|
if (page->file->help_on_file)
|
|
|
|
strcpy(page->file->help_on_file, str);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_SetPopupColor(LONG r, LONG g, LONG b)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2009-05-30 14:26:39 +02:00
|
|
|
HLPFILE_PAGE* page = MACRO_CurrentWindow()->page;
|
|
|
|
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_TRACE("(%lx, %lx, %lx)\n", r, g, b);
|
2009-05-30 14:26:39 +02:00
|
|
|
page->file->has_popup_color = TRUE;
|
|
|
|
page->file->popup_color = RGB(r, g, b);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %lu, %lu, %s, %s)\n", debugstr_a(str1), debugstr_a(str2), u1, u2, debugstr_a(str3), debugstr_a(str4));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%s, %s, %lx, %lx, %s)\n", debugstr_a(str1), debugstr_a(str2), w, l, debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_TCard(LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%lu)\n", u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_Test(LONG u)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2022-02-07 08:41:19 +01:00
|
|
|
WINE_FIXME("(%lu)\n", u);
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_TestALink(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
2002-07-16 03:46:29 +02:00
|
|
|
return FALSE;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static BOOL CALLBACK MACRO_TestKLink(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
2002-07-16 03:46:29 +02:00
|
|
|
return FALSE;
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_UncheckItem(LPCSTR str)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s)\n", debugstr_a(str));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 14:16:50 +01:00
|
|
|
static void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2)
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("(%s, %s)\n", debugstr_a(str1), debugstr_a(str2));
|
1996-05-06 18:06:24 +02:00
|
|
|
}
|
2009-01-08 14:16:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**************************************************/
|
|
|
|
/* Macro table */
|
|
|
|
/**************************************************/
|
|
|
|
|
|
|
|
/* types:
|
|
|
|
* U: 32 bit unsigned int
|
|
|
|
* I: 32 bit signed int
|
|
|
|
* S: string
|
|
|
|
* v: unknown (32 bit entity)
|
|
|
|
*/
|
|
|
|
|
|
|
|
static struct MacroDesc MACRO_Builtins[] = {
|
2009-10-07 13:40:00 +02:00
|
|
|
{"About", NULL, 0, "", MACRO_About},
|
|
|
|
{"AddAccelerator", "AA", 0, "UUS", MACRO_AddAccelerator},
|
|
|
|
{"ALink", "AL", 0, "SUS", MACRO_ALink},
|
|
|
|
{"Annotate", NULL, 0, "", MACRO_Annotate},
|
|
|
|
{"AppendItem", NULL, 0, "SSSS", MACRO_AppendItem},
|
|
|
|
{"Back", NULL, 0, "", MACRO_Back},
|
|
|
|
{"BackFlush", "BF", 0, "", MACRO_BackFlush},
|
|
|
|
{"BookmarkDefine", NULL, 0, "", MACRO_BookmarkDefine},
|
|
|
|
{"BookmarkMore", NULL, 0, "", MACRO_BookmarkMore},
|
|
|
|
{"BrowseButtons", NULL, 0, "", MACRO_BrowseButtons},
|
|
|
|
{"ChangeButtonBinding", "CBB",0, "SS", MACRO_ChangeButtonBinding},
|
|
|
|
{"ChangeEnable", "CE", 0, "SS", MACRO_ChangeEnable},
|
|
|
|
{"ChangeItemBinding", "CIB",0, "SS", MACRO_ChangeItemBinding},
|
|
|
|
{"CheckItem", "CI", 0, "S", MACRO_CheckItem},
|
|
|
|
{"CloseSecondarys", "CS", 0, "", MACRO_CloseSecondarys},
|
|
|
|
{"CloseWindow", "CW", 0, "S", MACRO_CloseWindow},
|
|
|
|
{"Compare", NULL, 0, "S", MACRO_Compare},
|
|
|
|
{"Contents", NULL, 0, "", MACRO_Contents},
|
|
|
|
{"ControlPanel", NULL, 0, "SSU", MACRO_ControlPanel},
|
|
|
|
{"CopyDialog", NULL, 0, "", MACRO_CopyDialog},
|
|
|
|
{"CopyTopic", "CT", 0, "", MACRO_CopyTopic},
|
|
|
|
{"CreateButton", "CB", 0, "SSS", MACRO_CreateButton},
|
|
|
|
{"DeleteItem", NULL, 0, "S", MACRO_DeleteItem},
|
|
|
|
{"DeleteMark", NULL, 0, "S", MACRO_DeleteMark},
|
|
|
|
{"DestroyButton", NULL, 0, "S", MACRO_DestroyButton},
|
|
|
|
{"DisableButton", "DB", 0, "S", MACRO_DisableButton},
|
|
|
|
{"DisableItem", "DI", 0, "S", MACRO_DisableItem},
|
|
|
|
{"EnableButton", "EB", 0, "S", MACRO_EnableButton},
|
|
|
|
{"EnableItem", "EI", 0, "S", MACRO_EnableItem},
|
|
|
|
{"EndMPrint", NULL, 0, "", MACRO_EndMPrint},
|
|
|
|
{"ExecFile", "EF", 0, "SSUS", MACRO_ExecFile},
|
|
|
|
{"ExecProgram", "EP", 0, "SU", MACRO_ExecProgram},
|
|
|
|
{"Exit", NULL, 0, "", MACRO_Exit},
|
|
|
|
{"ExtAbleItem", NULL, 0, "SU", MACRO_ExtAbleItem},
|
|
|
|
{"ExtInsertItem", NULL, 0, "SSSSUU", MACRO_ExtInsertItem},
|
|
|
|
{"ExtInsertMenu", NULL, 0, "SSSUU", MACRO_ExtInsertMenu},
|
|
|
|
{"FileExist", "FE", 1, "S", MACRO_FileExist},
|
|
|
|
{"FileOpen", "FO", 0, "", MACRO_FileOpen},
|
|
|
|
{"Find", NULL, 0, "", MACRO_Find},
|
|
|
|
{"Finder", "FD", 0, "", MACRO_Finder},
|
|
|
|
{"FloatingMenu", NULL, 0, "", MACRO_FloatingMenu},
|
|
|
|
{"Flush", "FH", 0, "", MACRO_Flush},
|
|
|
|
{"FocusWindow", NULL, 0, "S", MACRO_FocusWindow},
|
|
|
|
{"Generate", NULL, 0, "SUU", MACRO_Generate},
|
|
|
|
{"GotoMark", NULL, 0, "S", MACRO_GotoMark},
|
|
|
|
{"HelpOn", NULL, 0, "", MACRO_HelpOn},
|
|
|
|
{"HelpOnTop", NULL, 0, "", MACRO_HelpOnTop},
|
|
|
|
{"History", NULL, 0, "", MACRO_History},
|
|
|
|
{"InitMPrint", NULL, 1, "", MACRO_InitMPrint},
|
|
|
|
{"InsertItem", NULL, 0, "SSSSU", MACRO_InsertItem},
|
|
|
|
{"InsertMenu", NULL, 0, "SSU", MACRO_InsertMenu},
|
|
|
|
{"IfThen", "IF", 0, "BS", MACRO_IfThen},
|
|
|
|
{"IfThenElse", "IE", 0, "BSS", MACRO_IfThenElse},
|
|
|
|
{"IsBook", NULL, 1, "", MACRO_IsBook},
|
|
|
|
{"IsMark", NULL, 1, "S", MACRO_IsMark},
|
|
|
|
{"IsNotMark", "NM", 1, "S", MACRO_IsNotMark},
|
|
|
|
{"JumpContents", NULL, 0, "SS", MACRO_JumpContents},
|
|
|
|
{"JumpContext", "JC", 0, "SSU", MACRO_JumpContext},
|
|
|
|
{"JumpHash", "JH", 0, "SSU", MACRO_JumpHash},
|
|
|
|
{"JumpHelpOn", NULL, 0, "", MACRO_JumpHelpOn},
|
|
|
|
{"JumpID", "JI", 0, "SS", MACRO_JumpID},
|
|
|
|
{"JumpKeyword", "JK", 0, "SSS", MACRO_JumpKeyword},
|
|
|
|
{"KLink", "KL", 0, "SUSS", MACRO_KLink},
|
|
|
|
{"Menu", "MU", 0, "", MACRO_Menu},
|
|
|
|
{"MPrintHash", NULL, 0, "U", MACRO_MPrintHash},
|
|
|
|
{"MPrintID", NULL, 0, "S", MACRO_MPrintID},
|
|
|
|
{"Next", NULL, 0, "", MACRO_Next},
|
|
|
|
{"NoShow", "NS", 0, "", MACRO_NoShow},
|
|
|
|
{"PopupContext", "PC", 0, "SU", MACRO_PopupContext},
|
|
|
|
{"PopupHash", NULL, 0, "SU", MACRO_PopupHash},
|
|
|
|
{"PopupId", "PI", 0, "SS", MACRO_PopupId},
|
|
|
|
{"PositionWindow", "PW", 0, "IIUUUS", MACRO_PositionWindow},
|
|
|
|
{"Prev", NULL, 0, "", MACRO_Prev},
|
|
|
|
{"Print", NULL, 0, "", MACRO_Print},
|
|
|
|
{"PrinterSetup", NULL, 0, "", MACRO_PrinterSetup},
|
|
|
|
{"RegisterRoutine", "RR", 0, "SSS", MACRO_RegisterRoutine},
|
|
|
|
{"RemoveAccelerator", "RA", 0, "UU", MACRO_RemoveAccelerator},
|
|
|
|
{"ResetMenu", NULL, 0, "", MACRO_ResetMenu},
|
|
|
|
{"SaveMark", NULL, 0, "S", MACRO_SaveMark},
|
|
|
|
{"Search", NULL, 0, "", MACRO_Search},
|
|
|
|
{"SetContents", NULL, 0, "SU", MACRO_SetContents},
|
|
|
|
{"SetHelpOnFile", NULL, 0, "S", MACRO_SetHelpOnFile},
|
|
|
|
{"SetPopupColor", "SPC",0, "UUU", MACRO_SetPopupColor},
|
|
|
|
{"ShellExecute", "SE", 0, "SSUUSS", MACRO_ShellExecute},
|
|
|
|
{"ShortCut", "SH", 0, "SSUUS", MACRO_ShortCut},
|
|
|
|
{"TCard", NULL, 0, "U", MACRO_TCard},
|
|
|
|
{"Test", NULL, 0, "U", MACRO_Test},
|
|
|
|
{"TestALink", NULL, 1, "S", MACRO_TestALink},
|
|
|
|
{"TestKLink", NULL, 1, "S", MACRO_TestKLink},
|
|
|
|
{"UncheckItem", "UI", 0, "S", MACRO_UncheckItem},
|
|
|
|
{"UpdateWindow", "UW", 0, "SS", MACRO_UpdateWindow},
|
2009-01-08 14:16:40 +01:00
|
|
|
{NULL, NULL, 0, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len)
|
|
|
|
{
|
|
|
|
struct MacroDesc* md;
|
|
|
|
|
|
|
|
for (md = start; md->name && len != 0; md++, len--)
|
|
|
|
{
|
|
|
|
if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0))
|
|
|
|
{
|
|
|
|
lr->proto = md->arguments;
|
|
|
|
lr->function = md->fn;
|
|
|
|
return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return EMPTY;
|
|
|
|
}
|
|
|
|
|
|
|
|
int MACRO_Lookup(const char* name, struct lexret* lr)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY)
|
|
|
|
return ret;
|
|
|
|
if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY)
|
|
|
|
return ret;
|
2012-02-10 21:38:03 +01:00
|
|
|
if (!strcmp(name, "hwndApp"))
|
|
|
|
{
|
|
|
|
WINHELP_WINDOW* win;
|
|
|
|
lr->integer = 0;
|
|
|
|
for (win = Globals.win_list; win; win = win->next)
|
|
|
|
{
|
|
|
|
if (!strcmp(win->info->name, "main"))
|
|
|
|
{
|
|
|
|
lr->integer = (LONG_PTR)win->hMainWnd;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return INTEGER;
|
|
|
|
}
|
|
|
|
if (!strcmp(name, "hwndContext"))
|
|
|
|
{
|
|
|
|
lr->integer = Globals.active_win ?
|
|
|
|
(LONG_PTR)Globals.active_win->hMainWnd : 0;
|
|
|
|
return INTEGER;
|
|
|
|
}
|
|
|
|
if (!strcmp(name, "qchPath") || !strcmp(name, "qError") || !strcmp(name, "lTopicNo") ||
|
|
|
|
!strcmp(name, "hfs") || !strcmp(name, "coForeground") || !strcmp(name, "coBackground"))
|
|
|
|
{
|
2016-04-21 22:03:57 +02:00
|
|
|
WINE_FIXME("keyword %s not substituted in macro parsing\n", debugstr_a(name));
|
2012-02-10 21:38:03 +01:00
|
|
|
return EMPTY;
|
|
|
|
}
|
2009-01-08 14:16:40 +01:00
|
|
|
|
|
|
|
lr->string = name;
|
|
|
|
return IDENTIFIER;
|
|
|
|
}
|