Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Help Viewer |
| 3 | * |
| 4 | * Copyright 1996 Ulrich Schmid |
Eric Pouech | 448fed2 | 2008-07-12 10:37:01 +0200 | [diff] [blame] | 5 | * Copyright 2002, 2008 Eric Pouech |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
Jonathan Ernst | 360a3f9 | 2006-05-18 14:49:52 +0200 | [diff] [blame] | 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Mike McCormack | 002e143 | 2006-01-18 14:23:11 +0100 | [diff] [blame] | 22 | #define WIN32_LEAN_AND_MEAN |
| 23 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 24 | #include <stdio.h> |
| 25 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 26 | #include "windows.h" |
| 27 | #include "commdlg.h" |
Eric Pouech | d18d251 | 2010-06-09 21:22:22 +0200 | [diff] [blame] | 28 | #include "shellapi.h" |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 29 | #include "winhelp.h" |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 30 | |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 31 | #include "wine/debug.h" |
| 32 | |
| 33 | WINE_DEFAULT_DEBUG_CHANNEL(winhelp); |
| 34 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 35 | /**************************************************/ |
| 36 | /* Macro table */ |
| 37 | /**************************************************/ |
| 38 | struct MacroDesc { |
Mike McCormack | ae51135 | 2005-06-02 15:11:32 +0000 | [diff] [blame] | 39 | const char* name; |
| 40 | const char* alias; |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 41 | BOOL isBool; |
Mike McCormack | ae51135 | 2005-06-02 15:11:32 +0000 | [diff] [blame] | 42 | const char* arguments; |
Alexandre Julliard | 15751f2 | 2009-10-07 13:40:00 +0200 | [diff] [blame] | 43 | void *fn; |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 46 | static struct MacroDesc*MACRO_Loaded /* = NULL */; |
| 47 | static unsigned MACRO_NumLoaded /* = 0 */; |
| 48 | |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 49 | /******* helper functions *******/ |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 50 | |
Francois Gouget | e7f8aa7 | 2009-05-13 10:28:45 +0200 | [diff] [blame] | 51 | static char* StrDup(const char* str) |
| 52 | { |
| 53 | char* dst; |
| 54 | dst=HeapAlloc(GetProcessHeap(),0,strlen(str)+1); |
| 55 | strcpy(dst, str); |
| 56 | return dst; |
| 57 | } |
| 58 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 59 | static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name) |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 60 | { |
| 61 | WINHELP_BUTTON** b; |
| 62 | |
| 63 | for (b = &win->first_button; *b; b = &(*b)->next) |
| 64 | if (!lstrcmpi(name, (*b)->lpszID)) break; |
| 65 | return b; |
| 66 | } |
| 67 | |
Eric Pouech | d18d251 | 2010-06-09 21:22:22 +0200 | [diff] [blame] | 68 | /******* some forward declarations *******/ |
| 69 | static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id); |
| 70 | |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 71 | /******* real macro implementation *******/ |
| 72 | |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 73 | void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) |
| 74 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 75 | WINHELP_WINDOW *win = MACRO_CurrentWindow(); |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 76 | WINHELP_BUTTON *button, **b; |
| 77 | LONG size; |
| 78 | LPSTR ptr; |
| 79 | |
| 80 | WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); |
| 81 | |
| 82 | size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; |
| 83 | |
| 84 | button = HeapAlloc(GetProcessHeap(), 0, size); |
| 85 | if (!button) return; |
| 86 | |
| 87 | button->next = 0; |
| 88 | button->hWnd = 0; |
| 89 | |
| 90 | ptr = (char*)button + sizeof(WINHELP_BUTTON); |
| 91 | |
| 92 | lstrcpy(ptr, id); |
| 93 | button->lpszID = ptr; |
| 94 | ptr += lstrlen(id) + 1; |
| 95 | |
| 96 | lstrcpy(ptr, name); |
| 97 | button->lpszName = ptr; |
| 98 | ptr += lstrlen(name) + 1; |
| 99 | |
| 100 | lstrcpy(ptr, macro); |
| 101 | button->lpszMacro = ptr; |
| 102 | |
| 103 | button->wParam = WH_FIRST_BUTTON; |
| 104 | for (b = &win->first_button; *b; b = &(*b)->next) |
| 105 | button->wParam = max(button->wParam, (*b)->wParam + 1); |
| 106 | *b = button; |
| 107 | |
| 108 | WINHELP_LayoutMainWindow(win); |
| 109 | } |
| 110 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 111 | static void CALLBACK MACRO_DestroyButton(LPCSTR str) |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 112 | { |
| 113 | WINE_FIXME("(\"%s\")\n", str); |
| 114 | } |
| 115 | |
| 116 | void CALLBACK MACRO_DisableButton(LPCSTR id) |
| 117 | { |
| 118 | WINHELP_BUTTON** b; |
| 119 | |
| 120 | WINE_TRACE("(\"%s\")\n", id); |
| 121 | |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 122 | b = MACRO_LookupButton(MACRO_CurrentWindow(), id); |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 123 | if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} |
| 124 | |
| 125 | EnableWindow((*b)->hWnd, FALSE); |
| 126 | } |
| 127 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 128 | static void CALLBACK MACRO_EnableButton(LPCSTR id) |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 129 | { |
| 130 | WINHELP_BUTTON** b; |
| 131 | |
| 132 | WINE_TRACE("(\"%s\")\n", id); |
| 133 | |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 134 | b = MACRO_LookupButton(MACRO_CurrentWindow(), id); |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 135 | if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} |
| 136 | |
| 137 | EnableWindow((*b)->hWnd, TRUE); |
| 138 | } |
| 139 | |
| 140 | void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) |
| 141 | { |
| 142 | HLPFILE* hlpfile; |
| 143 | |
| 144 | WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); |
| 145 | if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) |
| 146 | WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, 0, |
| 147 | WINHELP_GetWindowInfo(hlpfile, lpszWindow), |
| 148 | SW_NORMAL); |
| 149 | } |
| 150 | |
| 151 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 152 | void CALLBACK MACRO_About(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 153 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 154 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 155 | } |
| 156 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 157 | static void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 158 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 159 | WINE_FIXME("(%u, %u, \"%s\")\n", u1, u2, str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 160 | } |
| 161 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 162 | static void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 163 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 164 | WINE_FIXME("(\"%s\", %u, \"%s\")\n", str1, u, str2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 165 | } |
| 166 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 167 | void CALLBACK MACRO_Annotate(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 168 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 169 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 170 | } |
| 171 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 172 | static void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 173 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 174 | WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 175 | } |
| 176 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 177 | static void CALLBACK MACRO_Back(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 178 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 179 | WINHELP_WINDOW* win = MACRO_CurrentWindow(); |
Eric Pouech | 2b855de | 2002-11-20 19:46:18 +0000 | [diff] [blame] | 180 | |
| 181 | WINE_TRACE("()\n"); |
| 182 | |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 183 | if (win && win->back.index >= 2) |
Eric Pouech | 4a89d29 | 2008-04-22 22:00:20 +0200 | [diff] [blame] | 184 | WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW, FALSE); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 185 | } |
| 186 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 187 | static void CALLBACK MACRO_BackFlush(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 188 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 189 | WINHELP_WINDOW* win = MACRO_CurrentWindow(); |
Eric Pouech | 2b855de | 2002-11-20 19:46:18 +0000 | [diff] [blame] | 190 | |
| 191 | WINE_TRACE("()\n"); |
| 192 | |
Eric Pouech | ccd7535 | 2008-04-22 21:59:57 +0200 | [diff] [blame] | 193 | if (win) WINHELP_DeleteBackSet(win); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 194 | } |
| 195 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 196 | void CALLBACK MACRO_BookmarkDefine(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 197 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 198 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 199 | } |
| 200 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 201 | static void CALLBACK MACRO_BookmarkMore(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 202 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 203 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 206 | static void CALLBACK MACRO_BrowseButtons(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 207 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 208 | HLPFILE_PAGE* page = MACRO_CurrentWindow()->page; |
Eric Pouech | a448036 | 2008-04-22 22:00:56 +0200 | [diff] [blame] | 209 | ULONG relative; |
Eric Pouech | 3ae5ad8 | 2008-04-22 22:00:38 +0200 | [diff] [blame] | 210 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 211 | WINE_TRACE("()\n"); |
| 212 | |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 213 | MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); |
| 214 | MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); |
Eric Pouech | 3ae5ad8 | 2008-04-22 22:00:38 +0200 | [diff] [blame] | 215 | |
Eric Pouech | a448036 | 2008-04-22 22:00:56 +0200 | [diff] [blame] | 216 | if (!HLPFILE_PageByOffset(page->file, page->browse_bwd, &relative)) |
Eric Pouech | 3ae5ad8 | 2008-04-22 22:00:38 +0200 | [diff] [blame] | 217 | MACRO_DisableButton("BTN_PREV"); |
Eric Pouech | a448036 | 2008-04-22 22:00:56 +0200 | [diff] [blame] | 218 | if (!HLPFILE_PageByOffset(page->file, page->browse_fwd, &relative)) |
Eric Pouech | 3ae5ad8 | 2008-04-22 22:00:38 +0200 | [diff] [blame] | 219 | MACRO_DisableButton("BTN_NEXT"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 220 | } |
| 221 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 222 | static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 223 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 224 | WINHELP_WINDOW* win = MACRO_CurrentWindow(); |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 225 | WINHELP_BUTTON* button; |
| 226 | WINHELP_BUTTON** b; |
| 227 | LONG size; |
| 228 | LPSTR ptr; |
| 229 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 230 | WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); |
| 231 | |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 232 | b = MACRO_LookupButton(win, id); |
| 233 | if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} |
| 234 | |
Jon Griffiths | cea5e75 | 2004-09-27 20:07:03 +0000 | [diff] [blame] | 235 | size = sizeof(WINHELP_BUTTON) + lstrlen(id) + |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 236 | lstrlen((*b)->lpszName) + lstrlen(macro) + 3; |
| 237 | |
| 238 | button = HeapAlloc(GetProcessHeap(), 0, size); |
| 239 | if (!button) return; |
| 240 | |
| 241 | button->next = (*b)->next; |
| 242 | button->hWnd = (*b)->hWnd; |
| 243 | button->wParam = (*b)->wParam; |
| 244 | |
| 245 | ptr = (char*)button + sizeof(WINHELP_BUTTON); |
| 246 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 247 | lstrcpy(ptr, id); |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 248 | button->lpszID = ptr; |
| 249 | ptr += lstrlen(id) + 1; |
| 250 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 251 | lstrcpy(ptr, (*b)->lpszName); |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 252 | button->lpszName = ptr; |
| 253 | ptr += lstrlen((*b)->lpszName) + 1; |
| 254 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 255 | lstrcpy(ptr, macro); |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 256 | button->lpszMacro = ptr; |
| 257 | |
| 258 | *b = button; |
| 259 | |
Eric Pouech | d58ab51 | 2008-04-18 21:33:51 +0200 | [diff] [blame] | 260 | WINHELP_LayoutMainWindow(win); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 261 | } |
| 262 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 263 | static void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 264 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 265 | WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); |
| 266 | |
Eric Pouech | 1cf1b5e | 2002-10-21 18:20:23 +0000 | [diff] [blame] | 267 | MACRO_ChangeButtonBinding(id, macro); |
| 268 | MACRO_EnableButton(id); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 269 | } |
| 270 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 271 | static void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 272 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 273 | WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 276 | static void CALLBACK MACRO_CheckItem(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 277 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 278 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 279 | } |
| 280 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 281 | static void CALLBACK MACRO_CloseSecondarys(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 282 | { |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 283 | WINHELP_WINDOW *win; |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 284 | WINHELP_WINDOW *next; |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 285 | |
| 286 | WINE_TRACE("()\n"); |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 287 | for (win = Globals.win_list; win; win = next) |
| 288 | { |
| 289 | next = win->next; |
Eric Pouech | e3beef0 | 2009-05-30 14:26:58 +0200 | [diff] [blame] | 290 | if (lstrcmpi(win->info->name, "main")) |
Eric Pouech | 82ffc04 | 2009-05-30 14:27:04 +0200 | [diff] [blame] | 291 | WINHELP_ReleaseWindow(win); |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 292 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 293 | } |
| 294 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 295 | static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 296 | { |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 297 | WINHELP_WINDOW *win; |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 298 | WINHELP_WINDOW *next; |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 299 | |
| 300 | WINE_TRACE("(\"%s\")\n", lpszWindow); |
| 301 | |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 302 | if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 303 | |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 304 | for (win = Globals.win_list; win; win = next) |
| 305 | { |
| 306 | next = win->next; |
Eric Pouech | e3beef0 | 2009-05-30 14:26:58 +0200 | [diff] [blame] | 307 | if (!lstrcmpi(win->info->name, lpszWindow)) |
Eric Pouech | 82ffc04 | 2009-05-30 14:27:04 +0200 | [diff] [blame] | 308 | WINHELP_ReleaseWindow(win); |
Eric Pouech | 3b07c85 | 2010-06-12 21:55:05 +0200 | [diff] [blame] | 309 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 310 | } |
| 311 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 312 | static void CALLBACK MACRO_Compare(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 313 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 314 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 315 | } |
| 316 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 317 | static void CALLBACK MACRO_Contents(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 318 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 319 | HLPFILE_PAGE* page = MACRO_CurrentWindow()->page; |
| 320 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 321 | WINE_TRACE("()\n"); |
| 322 | |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 323 | if (page) |
| 324 | MACRO_JumpContents(page->file->lpszPath, NULL); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 325 | } |
| 326 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 327 | static void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 328 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 329 | WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 330 | } |
| 331 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 332 | void CALLBACK MACRO_CopyDialog(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 333 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 334 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 335 | } |
| 336 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 337 | static void CALLBACK MACRO_CopyTopic(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 338 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 339 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 340 | } |
| 341 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 342 | static void CALLBACK MACRO_DeleteItem(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 343 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 344 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 345 | } |
| 346 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 347 | static void CALLBACK MACRO_DeleteMark(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 348 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 349 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 350 | } |
| 351 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 352 | static void CALLBACK MACRO_DisableItem(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 353 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 354 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 355 | } |
| 356 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 357 | static void CALLBACK MACRO_EnableItem(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 358 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 359 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 360 | } |
| 361 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 362 | static void CALLBACK MACRO_EndMPrint(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 363 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 364 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 365 | } |
| 366 | |
Eric Pouech | d18d251 | 2010-06-09 21:22:22 +0200 | [diff] [blame] | 367 | static void CALLBACK MACRO_ExecFile(LPCSTR pgm, LPCSTR args, LONG cmd_show, LPCSTR topic) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 368 | { |
Eric Pouech | d18d251 | 2010-06-09 21:22:22 +0200 | [diff] [blame] | 369 | HINSTANCE ret; |
| 370 | |
| 371 | WINE_TRACE("(%s, %s, %u, %s)\n", |
| 372 | wine_dbgstr_a(pgm), wine_dbgstr_a(args), cmd_show, wine_dbgstr_a(topic)); |
| 373 | |
| 374 | ret = ShellExecuteA(Globals.active_win ? Globals.active_win->hMainWnd : NULL, "open", |
| 375 | pgm, args, ".", cmd_show); |
| 376 | if ((DWORD_PTR)ret < 32) |
| 377 | { |
| 378 | WINE_WARN("Failed with %p\n", ret); |
| 379 | if (topic) MACRO_JumpID(NULL, topic); |
| 380 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 381 | } |
| 382 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 383 | static void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 384 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 385 | WINE_FIXME("(\"%s\", %u)\n", str, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 386 | } |
| 387 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 388 | void CALLBACK MACRO_Exit(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 389 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 390 | WINE_TRACE("()\n"); |
| 391 | |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 392 | while (Globals.win_list) |
Eric Pouech | 82ffc04 | 2009-05-30 14:27:04 +0200 | [diff] [blame] | 393 | WINHELP_ReleaseWindow(Globals.win_list); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 394 | } |
| 395 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 396 | static void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 397 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 398 | WINE_FIXME("(\"%s\", %u)\n", str, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 399 | } |
| 400 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 401 | static void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 402 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 403 | WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, str4, u1, u2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 404 | } |
| 405 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 406 | static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 407 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 408 | WINE_FIXME("(\"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, u1, u2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 409 | } |
| 410 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 411 | static BOOL CALLBACK MACRO_FileExist(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 412 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 413 | WINE_TRACE("(\"%s\")\n", str); |
Rolf Kalbermatter | 76f13de | 2003-10-16 19:12:49 +0000 | [diff] [blame] | 414 | return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 415 | } |
| 416 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 417 | void CALLBACK MACRO_FileOpen(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 418 | { |
Kirill K. Smirnov | 4f2819f | 2006-11-06 15:07:01 +0300 | [diff] [blame] | 419 | char szFile[MAX_PATH]; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 420 | |
Kirill K. Smirnov | 4f2819f | 2006-11-06 15:07:01 +0300 | [diff] [blame] | 421 | if (WINHELP_GetOpenFileName(szFile, MAX_PATH)) |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 422 | { |
Eric Pouech | 3f1b62f | 2008-04-22 22:01:08 +0200 | [diff] [blame] | 423 | MACRO_JumpContents(szFile, "main"); |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 424 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 425 | } |
| 426 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 427 | static void CALLBACK MACRO_Find(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 428 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 429 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 430 | } |
| 431 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 432 | static void CALLBACK MACRO_Finder(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 433 | { |
Eric Pouech | 841720e | 2008-07-05 21:33:19 +0200 | [diff] [blame] | 434 | WINHELP_CreateIndexWindow(FALSE); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 435 | } |
| 436 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 437 | static void CALLBACK MACRO_FloatingMenu(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 438 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 439 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 440 | } |
| 441 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 442 | static void CALLBACK MACRO_Flush(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 443 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 444 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 445 | } |
| 446 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 447 | static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 448 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 449 | WINHELP_WINDOW *win; |
| 450 | |
| 451 | WINE_TRACE("(\"%s\")\n", lpszWindow); |
| 452 | |
| 453 | if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; |
| 454 | |
| 455 | for (win = Globals.win_list; win; win = win->next) |
Eric Pouech | e3beef0 | 2009-05-30 14:26:58 +0200 | [diff] [blame] | 456 | if (!lstrcmpi(win->info->name, lpszWindow)) |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 457 | SetFocus(win->hMainWnd); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 458 | } |
| 459 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 460 | static void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 461 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 462 | WINE_FIXME("(\"%s\", %x, %x)\n", str, w, l); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 463 | } |
| 464 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 465 | static void CALLBACK MACRO_GotoMark(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 466 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 467 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 468 | } |
| 469 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 470 | void CALLBACK MACRO_HelpOn(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 471 | { |
Owen Rudge | b4f2c55 | 2009-07-22 00:48:28 -0300 | [diff] [blame] | 472 | WINHELP_WINDOW *win = MACRO_CurrentWindow(); |
| 473 | LPCSTR file = NULL; |
Eric Pouech | 448fed2 | 2008-07-12 10:37:01 +0200 | [diff] [blame] | 474 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 475 | WINE_TRACE("()\n"); |
Owen Rudge | b4f2c55 | 2009-07-22 00:48:28 -0300 | [diff] [blame] | 476 | if (win && win->page && win->page->file) |
| 477 | file = win->page->file->help_on_file; |
| 478 | |
Eric Pouech | 448fed2 | 2008-07-12 10:37:01 +0200 | [diff] [blame] | 479 | if (!file) |
| 480 | file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp"; |
| 481 | |
| 482 | MACRO_JumpContents(file, NULL); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 483 | } |
| 484 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 485 | void CALLBACK MACRO_HelpOnTop(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 486 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 487 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 488 | } |
| 489 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 490 | void CALLBACK MACRO_History(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 491 | { |
Eric Pouech | 2b855de | 2002-11-20 19:46:18 +0000 | [diff] [blame] | 492 | WINE_TRACE("()\n"); |
| 493 | |
| 494 | if (Globals.active_win && !Globals.active_win->hHistoryWnd) |
| 495 | { |
| 496 | HWND hWnd = CreateWindow(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, |
| 497 | 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win); |
| 498 | ShowWindow(hWnd, SW_NORMAL); |
| 499 | } |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 500 | } |
| 501 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 502 | static void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t) |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 503 | { |
Eric Pouech | 042bbf9 | 2009-05-30 14:26:33 +0200 | [diff] [blame] | 504 | if (b) MACRO_ExecuteMacro(MACRO_CurrentWindow(), t); |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 505 | } |
| 506 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 507 | static void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f) |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 508 | { |
Eric Pouech | 042bbf9 | 2009-05-30 14:26:33 +0200 | [diff] [blame] | 509 | if (b) MACRO_ExecuteMacro(MACRO_CurrentWindow(), t); |
| 510 | else MACRO_ExecuteMacro(MACRO_CurrentWindow(), f); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 511 | } |
| 512 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 513 | static BOOL CALLBACK MACRO_InitMPrint(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 514 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 515 | WINE_FIXME("()\n"); |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 516 | return FALSE; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 517 | } |
| 518 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 519 | static void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 520 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 521 | WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u)\n", str1, str2, str3, str4, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 522 | } |
| 523 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 524 | static void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 525 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 526 | WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 527 | } |
| 528 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 529 | static BOOL CALLBACK MACRO_IsBook(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 530 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 531 | WINE_TRACE("()\n"); |
| 532 | return Globals.isBook; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 533 | } |
| 534 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 535 | static BOOL CALLBACK MACRO_IsMark(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 536 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 537 | WINE_FIXME("(\"%s\")\n", str); |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 538 | return FALSE; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 539 | } |
| 540 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 541 | static BOOL CALLBACK MACRO_IsNotMark(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 542 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 543 | WINE_FIXME("(\"%s\")\n", str); |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 544 | return TRUE; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 545 | } |
| 546 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 547 | void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 548 | { |
Kirill K Smirnov | 8e0bc11 | 2006-10-26 13:21:44 +0400 | [diff] [blame] | 549 | HLPFILE* hlpfile; |
| 550 | |
Francois Gouget | dc6731e | 2006-11-02 19:58:32 +0100 | [diff] [blame] | 551 | WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); |
Kirill K Smirnov | 8e0bc11 | 2006-10-26 13:21:44 +0400 | [diff] [blame] | 552 | hlpfile = WINHELP_LookupHelpFile(lpszPath); |
| 553 | /* Some madness: what user calls 'context', hlpfile calls 'map' */ |
Eric Pouech | 3f1b62f | 2008-04-22 22:01:08 +0200 | [diff] [blame] | 554 | WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, |
| 555 | WINHELP_GetWindowInfo(hlpfile, lpszWindow), |
| 556 | SW_NORMAL); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 557 | } |
| 558 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 559 | void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 560 | { |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 561 | HLPFILE* hlpfile; |
| 562 | |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 563 | WINE_TRACE("(\"%s\", \"%s\", %u)\n", lpszPath, lpszWindow, lHash); |
Eric Pouech | aba7b3d | 2009-05-30 14:26:46 +0200 | [diff] [blame] | 564 | if (!lpszPath || !lpszPath[0]) |
| 565 | hlpfile = MACRO_CurrentWindow()->page->file; |
| 566 | else |
| 567 | hlpfile = WINHELP_LookupHelpFile(lpszPath); |
Eric Pouech | 3f1b62f | 2008-04-22 22:01:08 +0200 | [diff] [blame] | 568 | WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, |
| 569 | WINHELP_GetWindowInfo(hlpfile, lpszWindow), |
| 570 | SW_NORMAL); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 571 | } |
| 572 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 573 | static void CALLBACK MACRO_JumpHelpOn(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 574 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 575 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 576 | } |
| 577 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 578 | static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 579 | { |
Eric Pouech | 7ae1bb2 | 2008-04-22 22:00:32 +0200 | [diff] [blame] | 580 | LPSTR ptr; |
| 581 | |
| 582 | WINE_TRACE("(\"%s\", \"%s\")\n", lpszPathWindow, topic_id); |
| 583 | if ((ptr = strchr(lpszPathWindow, '>')) != NULL) |
| 584 | { |
| 585 | LPSTR tmp; |
Eric Pouech | 2d20a1a | 2010-06-12 21:54:59 +0200 | [diff] [blame] | 586 | size_t sz; |
Eric Pouech | 7ae1bb2 | 2008-04-22 22:00:32 +0200 | [diff] [blame] | 587 | |
Eric Pouech | 2d20a1a | 2010-06-12 21:54:59 +0200 | [diff] [blame] | 588 | tmp = HeapAlloc(GetProcessHeap(), 0, strlen(lpszPathWindow) + 1); |
Eric Pouech | 7ae1bb2 | 2008-04-22 22:00:32 +0200 | [diff] [blame] | 589 | if (tmp) |
| 590 | { |
Eric Pouech | 2d20a1a | 2010-06-12 21:54:59 +0200 | [diff] [blame] | 591 | strcpy(tmp, lpszPathWindow); |
| 592 | tmp[ptr - lpszPathWindow] = '\0'; |
| 593 | ptr += tmp - lpszPathWindow; /* ptr now points to '>' in tmp buffer */ |
| 594 | /* in some cases, we have a trailing space that we need to get rid of */ |
| 595 | /* FIXME: check if it has to be done in lexer rather than here */ |
| 596 | for (sz = strlen(ptr + 1); sz >= 1 && ptr[sz] == ' '; sz--) ptr[sz] = '\0'; |
Eric Pouech | 7ae1bb2 | 2008-04-22 22:00:32 +0200 | [diff] [blame] | 597 | MACRO_JumpHash(tmp, ptr + 1, HLPFILE_Hash(topic_id)); |
| 598 | HeapFree(GetProcessHeap(), 0, tmp); |
| 599 | } |
| 600 | } |
| 601 | else |
| 602 | MACRO_JumpHash(lpszPathWindow, NULL, HLPFILE_Hash(topic_id)); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 603 | } |
| 604 | |
Eric Pouech | 7ae1bb2 | 2008-04-22 22:00:32 +0200 | [diff] [blame] | 605 | /* FIXME: this macros is wrong |
| 606 | * it should only contain 2 strings, path & window are coded as path>window |
| 607 | */ |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 608 | static void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 609 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 610 | WINE_FIXME("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 611 | } |
| 612 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 613 | static void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 614 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 615 | WINE_FIXME("(\"%s\", %u, \"%s\", \"%s\")\n", str1, u, str2, str3); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 616 | } |
| 617 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 618 | static void CALLBACK MACRO_Menu(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 619 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 620 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 621 | } |
| 622 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 623 | static void CALLBACK MACRO_MPrintHash(LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 624 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 625 | WINE_FIXME("(%u)\n", u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 626 | } |
| 627 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 628 | static void CALLBACK MACRO_MPrintID(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 629 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 630 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 631 | } |
| 632 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 633 | static void CALLBACK MACRO_Next(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 634 | { |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 635 | WINHELP_WNDPAGE wp; |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 636 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 637 | WINE_TRACE("()\n"); |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 638 | wp.page = MACRO_CurrentWindow()->page; |
Eric Pouech | a448036 | 2008-04-22 22:00:56 +0200 | [diff] [blame] | 639 | wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd, &wp.relative); |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 640 | if (wp.page) |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 641 | { |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 642 | wp.page->file->wRefCount++; |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 643 | wp.wininfo = MACRO_CurrentWindow()->info; |
Eric Pouech | 4a89d29 | 2008-04-22 22:00:20 +0200 | [diff] [blame] | 644 | WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE); |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 645 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 646 | } |
| 647 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 648 | static void CALLBACK MACRO_NoShow(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 649 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 650 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 651 | } |
| 652 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 653 | void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 654 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 655 | WINE_FIXME("(\"%s\", %u)\n", str, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 656 | } |
| 657 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 658 | static void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 659 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 660 | WINE_FIXME("(\"%s\", %u)\n", str, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 661 | } |
| 662 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 663 | static void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 664 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 665 | WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 666 | } |
| 667 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 668 | static void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 669 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 670 | WINE_FIXME("(%i, %i, %u, %u, %u, \"%s\")\n", i1, i2, u1, u2, u3, str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 671 | } |
| 672 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 673 | static void CALLBACK MACRO_Prev(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 674 | { |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 675 | WINHELP_WNDPAGE wp; |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 676 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 677 | WINE_TRACE("()\n"); |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 678 | wp.page = MACRO_CurrentWindow()->page; |
Eric Pouech | a448036 | 2008-04-22 22:00:56 +0200 | [diff] [blame] | 679 | wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd, &wp.relative); |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 680 | if (wp.page) |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 681 | { |
Eric Pouech | 6d40dbe | 2008-04-22 21:59:38 +0200 | [diff] [blame] | 682 | wp.page->file->wRefCount++; |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 683 | wp.wininfo = MACRO_CurrentWindow()->info; |
Eric Pouech | 4a89d29 | 2008-04-22 22:00:20 +0200 | [diff] [blame] | 684 | WINHELP_CreateHelpWindow(&wp, SW_NORMAL, TRUE); |
Eric Pouech | 7d75cfe | 2002-11-18 19:48:11 +0000 | [diff] [blame] | 685 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 686 | } |
| 687 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 688 | void CALLBACK MACRO_Print(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 689 | { |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 690 | PRINTDLG printer; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 691 | |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 692 | WINE_TRACE("()\n"); |
| 693 | |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 694 | printer.lStructSize = sizeof(printer); |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 695 | printer.hwndOwner = MACRO_CurrentWindow()->hMainWnd; |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 696 | printer.hInstance = Globals.hInstance; |
| 697 | printer.hDevMode = 0; |
| 698 | printer.hDevNames = 0; |
| 699 | printer.hDC = 0; |
| 700 | printer.Flags = 0; |
| 701 | printer.nFromPage = 0; |
| 702 | printer.nToPage = 0; |
| 703 | printer.nMinPage = 0; |
| 704 | printer.nMaxPage = 0; |
| 705 | printer.nCopies = 0; |
| 706 | printer.lCustData = 0; |
| 707 | printer.lpfnPrintHook = 0; |
| 708 | printer.lpfnSetupHook = 0; |
| 709 | printer.lpPrintTemplateName = 0; |
| 710 | printer.lpSetupTemplateName = 0; |
| 711 | printer.hPrintTemplate = 0; |
| 712 | printer.hSetupTemplate = 0; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 713 | |
Alexandre Julliard | 27b790b | 2000-06-08 04:58:18 +0000 | [diff] [blame] | 714 | if (PrintDlgA(&printer)) { |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 715 | WINE_FIXME("Print()\n"); |
| 716 | } |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 717 | } |
| 718 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 719 | void CALLBACK MACRO_PrinterSetup(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 720 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 721 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 722 | } |
| 723 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 724 | static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 725 | { |
Alexandre Julliard | 15751f2 | 2009-10-07 13:40:00 +0200 | [diff] [blame] | 726 | void *fn = NULL; |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 727 | int size; |
| 728 | WINHELP_DLL* dll; |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 729 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 730 | WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", dll_name, proc, args); |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 731 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 732 | /* FIXME: are the registered DLLs global or linked to the current file ??? |
| 733 | * We assume globals (as we did for macros, but is this really the case ???) |
| 734 | */ |
| 735 | for (dll = Globals.dlls; dll; dll = dll->next) |
| 736 | { |
| 737 | if (!strcmp(dll->name, dll_name)) break; |
| 738 | } |
| 739 | if (!dll) |
| 740 | { |
| 741 | HANDLE hLib = LoadLibrary(dll_name); |
| 742 | |
| 743 | /* FIXME: the library will not be unloaded until exit of program |
| 744 | * We don't send the DW_TERM message |
| 745 | */ |
| 746 | WINE_TRACE("Loading %s\n", dll_name); |
| 747 | /* FIXME: should look in the directory where current hlpfile |
| 748 | * is loaded from |
| 749 | */ |
| 750 | if (hLib == NULL) |
| 751 | { |
| 752 | /* FIXME: internationalisation for error messages */ |
| 753 | WINE_FIXME("Cannot find dll %s\n", dll_name); |
| 754 | } |
| 755 | else if ((dll = HeapAlloc(GetProcessHeap(), 0, sizeof(*dll)))) |
| 756 | { |
| 757 | dll->hLib = hLib; |
Francois Gouget | e7f8aa7 | 2009-05-13 10:28:45 +0200 | [diff] [blame] | 758 | dll->name = StrDup(dll_name); /* FIXME: never freed */ |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 759 | dll->next = Globals.dlls; |
| 760 | Globals.dlls = dll; |
| 761 | dll->handler = (WINHELP_LDLLHandler)GetProcAddress(dll->hLib, "LDLLHandler"); |
| 762 | dll->class = dll->handler ? (dll->handler)(DW_WHATMSG, 0, 0) : DC_NOMSG; |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 763 | WINE_TRACE("Got class %x for DLL %s\n", dll->class, dll_name); |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 764 | if (dll->class & DC_INITTERM) dll->handler(DW_INIT, 0, 0); |
Alexandre Julliard | e2d22db | 2009-10-07 13:31:32 +0200 | [diff] [blame] | 765 | if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (LONG_PTR)&Callbacks, 0); |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 766 | } |
| 767 | else WINE_WARN("OOM\n"); |
| 768 | } |
| 769 | if (dll && !(fn = GetProcAddress(dll->hLib, proc))) |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 770 | { |
| 771 | /* FIXME: internationalisation for error messages */ |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 772 | WINE_FIXME("Cannot find proc %s in dll %s\n", dll_name, proc); |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 773 | } |
| 774 | |
Dimitrie O. Paun | 921df71 | 2003-10-11 05:25:31 +0000 | [diff] [blame] | 775 | size = ++MACRO_NumLoaded * sizeof(struct MacroDesc); |
| 776 | if (!MACRO_Loaded) MACRO_Loaded = HeapAlloc(GetProcessHeap(), 0, size); |
| 777 | else MACRO_Loaded = HeapReAlloc(GetProcessHeap(), 0, MACRO_Loaded, size); |
Francois Gouget | e7f8aa7 | 2009-05-13 10:28:45 +0200 | [diff] [blame] | 778 | MACRO_Loaded[MACRO_NumLoaded - 1].name = StrDup(proc); /* FIXME: never freed */ |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 779 | MACRO_Loaded[MACRO_NumLoaded - 1].alias = NULL; |
| 780 | MACRO_Loaded[MACRO_NumLoaded - 1].isBool = 0; |
Francois Gouget | e7f8aa7 | 2009-05-13 10:28:45 +0200 | [diff] [blame] | 781 | MACRO_Loaded[MACRO_NumLoaded - 1].arguments = StrDup(args); /* FIXME: never freed */ |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 782 | MACRO_Loaded[MACRO_NumLoaded - 1].fn = fn; |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 783 | WINE_TRACE("Added %s(%s) at %p\n", proc, args, fn); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 784 | } |
| 785 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 786 | static void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 787 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 788 | WINE_FIXME("(%u, %u)\n", u1, u2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 789 | } |
| 790 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 791 | static void CALLBACK MACRO_ResetMenu(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 792 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 793 | WINE_FIXME("()\n"); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 794 | } |
| 795 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 796 | static void CALLBACK MACRO_SaveMark(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 797 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 798 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 799 | } |
| 800 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 801 | static void CALLBACK MACRO_Search(void) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 802 | { |
Eric Pouech | 841720e | 2008-07-05 21:33:19 +0200 | [diff] [blame] | 803 | WINHELP_CreateIndexWindow(TRUE); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 804 | } |
| 805 | |
Eric Pouech | dff8de6 | 2004-12-13 21:06:46 +0000 | [diff] [blame] | 806 | void CALLBACK MACRO_SetContents(LPCSTR str, LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 807 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 808 | WINE_FIXME("(\"%s\", %u)\n", str, u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 809 | } |
| 810 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 811 | static void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 812 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 813 | HLPFILE_PAGE* page = MACRO_CurrentWindow()->page; |
| 814 | |
Eric Pouech | 448fed2 | 2008-07-12 10:37:01 +0200 | [diff] [blame] | 815 | WINE_TRACE("(\"%s\")\n", str); |
| 816 | |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 817 | HeapFree(GetProcessHeap(), 0, page->file->help_on_file); |
| 818 | page->file->help_on_file = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); |
| 819 | if (page->file->help_on_file) |
| 820 | strcpy(page->file->help_on_file, str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 821 | } |
| 822 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 823 | static void CALLBACK MACRO_SetPopupColor(LONG r, LONG g, LONG b) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 824 | { |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 825 | HLPFILE_PAGE* page = MACRO_CurrentWindow()->page; |
| 826 | |
Eric Pouech | 7d0b6bd | 2008-07-12 10:37:08 +0200 | [diff] [blame] | 827 | WINE_TRACE("(%x, %x, %x)\n", r, g, b); |
Eric Pouech | 29f865c | 2009-05-30 14:26:39 +0200 | [diff] [blame] | 828 | page->file->has_popup_color = TRUE; |
| 829 | page->file->popup_color = RGB(r, g, b); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 830 | } |
| 831 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 832 | static void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 833 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 834 | WINE_FIXME("(\"%s\", \"%s\", %u, %u, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 835 | } |
| 836 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 837 | static void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 838 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 839 | WINE_FIXME("(\"%s\", \"%s\", %x, %x, \"%s\")\n", str1, str2, w, l, str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 840 | } |
| 841 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 842 | static void CALLBACK MACRO_TCard(LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 843 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 844 | WINE_FIXME("(%u)\n", u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 845 | } |
| 846 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 847 | static void CALLBACK MACRO_Test(LONG u) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 848 | { |
Michael Stefaniuc | 3dbe715 | 2006-10-02 23:20:26 +0200 | [diff] [blame] | 849 | WINE_FIXME("(%u)\n", u); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 850 | } |
| 851 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 852 | static BOOL CALLBACK MACRO_TestALink(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 853 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 854 | WINE_FIXME("(\"%s\")\n", str); |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 855 | return FALSE; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 856 | } |
| 857 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 858 | static BOOL CALLBACK MACRO_TestKLink(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 859 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 860 | WINE_FIXME("(\"%s\")\n", str); |
Eric Pouech | 7579287 | 2002-07-16 01:46:29 +0000 | [diff] [blame] | 861 | return FALSE; |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 862 | } |
| 863 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 864 | static void CALLBACK MACRO_UncheckItem(LPCSTR str) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 865 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 866 | WINE_FIXME("(\"%s\")\n", str); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 867 | } |
| 868 | |
Francois Gouget | 4967984 | 2009-01-08 14:16:50 +0100 | [diff] [blame] | 869 | static void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 870 | { |
Eric Pouech | 81b7b91 | 2002-11-15 01:34:57 +0000 | [diff] [blame] | 871 | WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); |
Alexandre Julliard | 1285c2f | 1996-05-06 16:06:24 +0000 | [diff] [blame] | 872 | } |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 873 | |
| 874 | |
| 875 | /**************************************************/ |
| 876 | /* Macro table */ |
| 877 | /**************************************************/ |
| 878 | |
| 879 | /* types: |
| 880 | * U: 32 bit unsigned int |
| 881 | * I: 32 bit signed int |
| 882 | * S: string |
| 883 | * v: unknown (32 bit entity) |
| 884 | */ |
| 885 | |
| 886 | static struct MacroDesc MACRO_Builtins[] = { |
Alexandre Julliard | 15751f2 | 2009-10-07 13:40:00 +0200 | [diff] [blame] | 887 | {"About", NULL, 0, "", MACRO_About}, |
| 888 | {"AddAccelerator", "AA", 0, "UUS", MACRO_AddAccelerator}, |
| 889 | {"ALink", "AL", 0, "SUS", MACRO_ALink}, |
| 890 | {"Annotate", NULL, 0, "", MACRO_Annotate}, |
| 891 | {"AppendItem", NULL, 0, "SSSS", MACRO_AppendItem}, |
| 892 | {"Back", NULL, 0, "", MACRO_Back}, |
| 893 | {"BackFlush", "BF", 0, "", MACRO_BackFlush}, |
| 894 | {"BookmarkDefine", NULL, 0, "", MACRO_BookmarkDefine}, |
| 895 | {"BookmarkMore", NULL, 0, "", MACRO_BookmarkMore}, |
| 896 | {"BrowseButtons", NULL, 0, "", MACRO_BrowseButtons}, |
| 897 | {"ChangeButtonBinding", "CBB",0, "SS", MACRO_ChangeButtonBinding}, |
| 898 | {"ChangeEnable", "CE", 0, "SS", MACRO_ChangeEnable}, |
| 899 | {"ChangeItemBinding", "CIB",0, "SS", MACRO_ChangeItemBinding}, |
| 900 | {"CheckItem", "CI", 0, "S", MACRO_CheckItem}, |
| 901 | {"CloseSecondarys", "CS", 0, "", MACRO_CloseSecondarys}, |
| 902 | {"CloseWindow", "CW", 0, "S", MACRO_CloseWindow}, |
| 903 | {"Compare", NULL, 0, "S", MACRO_Compare}, |
| 904 | {"Contents", NULL, 0, "", MACRO_Contents}, |
| 905 | {"ControlPanel", NULL, 0, "SSU", MACRO_ControlPanel}, |
| 906 | {"CopyDialog", NULL, 0, "", MACRO_CopyDialog}, |
| 907 | {"CopyTopic", "CT", 0, "", MACRO_CopyTopic}, |
| 908 | {"CreateButton", "CB", 0, "SSS", MACRO_CreateButton}, |
| 909 | {"DeleteItem", NULL, 0, "S", MACRO_DeleteItem}, |
| 910 | {"DeleteMark", NULL, 0, "S", MACRO_DeleteMark}, |
| 911 | {"DestroyButton", NULL, 0, "S", MACRO_DestroyButton}, |
| 912 | {"DisableButton", "DB", 0, "S", MACRO_DisableButton}, |
| 913 | {"DisableItem", "DI", 0, "S", MACRO_DisableItem}, |
| 914 | {"EnableButton", "EB", 0, "S", MACRO_EnableButton}, |
| 915 | {"EnableItem", "EI", 0, "S", MACRO_EnableItem}, |
| 916 | {"EndMPrint", NULL, 0, "", MACRO_EndMPrint}, |
| 917 | {"ExecFile", "EF", 0, "SSUS", MACRO_ExecFile}, |
| 918 | {"ExecProgram", "EP", 0, "SU", MACRO_ExecProgram}, |
| 919 | {"Exit", NULL, 0, "", MACRO_Exit}, |
| 920 | {"ExtAbleItem", NULL, 0, "SU", MACRO_ExtAbleItem}, |
| 921 | {"ExtInsertItem", NULL, 0, "SSSSUU", MACRO_ExtInsertItem}, |
| 922 | {"ExtInsertMenu", NULL, 0, "SSSUU", MACRO_ExtInsertMenu}, |
| 923 | {"FileExist", "FE", 1, "S", MACRO_FileExist}, |
| 924 | {"FileOpen", "FO", 0, "", MACRO_FileOpen}, |
| 925 | {"Find", NULL, 0, "", MACRO_Find}, |
| 926 | {"Finder", "FD", 0, "", MACRO_Finder}, |
| 927 | {"FloatingMenu", NULL, 0, "", MACRO_FloatingMenu}, |
| 928 | {"Flush", "FH", 0, "", MACRO_Flush}, |
| 929 | {"FocusWindow", NULL, 0, "S", MACRO_FocusWindow}, |
| 930 | {"Generate", NULL, 0, "SUU", MACRO_Generate}, |
| 931 | {"GotoMark", NULL, 0, "S", MACRO_GotoMark}, |
| 932 | {"HelpOn", NULL, 0, "", MACRO_HelpOn}, |
| 933 | {"HelpOnTop", NULL, 0, "", MACRO_HelpOnTop}, |
| 934 | {"History", NULL, 0, "", MACRO_History}, |
| 935 | {"InitMPrint", NULL, 1, "", MACRO_InitMPrint}, |
| 936 | {"InsertItem", NULL, 0, "SSSSU", MACRO_InsertItem}, |
| 937 | {"InsertMenu", NULL, 0, "SSU", MACRO_InsertMenu}, |
| 938 | {"IfThen", "IF", 0, "BS", MACRO_IfThen}, |
| 939 | {"IfThenElse", "IE", 0, "BSS", MACRO_IfThenElse}, |
| 940 | {"IsBook", NULL, 1, "", MACRO_IsBook}, |
| 941 | {"IsMark", NULL, 1, "S", MACRO_IsMark}, |
| 942 | {"IsNotMark", "NM", 1, "S", MACRO_IsNotMark}, |
| 943 | {"JumpContents", NULL, 0, "SS", MACRO_JumpContents}, |
| 944 | {"JumpContext", "JC", 0, "SSU", MACRO_JumpContext}, |
| 945 | {"JumpHash", "JH", 0, "SSU", MACRO_JumpHash}, |
| 946 | {"JumpHelpOn", NULL, 0, "", MACRO_JumpHelpOn}, |
| 947 | {"JumpID", "JI", 0, "SS", MACRO_JumpID}, |
| 948 | {"JumpKeyword", "JK", 0, "SSS", MACRO_JumpKeyword}, |
| 949 | {"KLink", "KL", 0, "SUSS", MACRO_KLink}, |
| 950 | {"Menu", "MU", 0, "", MACRO_Menu}, |
| 951 | {"MPrintHash", NULL, 0, "U", MACRO_MPrintHash}, |
| 952 | {"MPrintID", NULL, 0, "S", MACRO_MPrintID}, |
| 953 | {"Next", NULL, 0, "", MACRO_Next}, |
| 954 | {"NoShow", "NS", 0, "", MACRO_NoShow}, |
| 955 | {"PopupContext", "PC", 0, "SU", MACRO_PopupContext}, |
| 956 | {"PopupHash", NULL, 0, "SU", MACRO_PopupHash}, |
| 957 | {"PopupId", "PI", 0, "SS", MACRO_PopupId}, |
| 958 | {"PositionWindow", "PW", 0, "IIUUUS", MACRO_PositionWindow}, |
| 959 | {"Prev", NULL, 0, "", MACRO_Prev}, |
| 960 | {"Print", NULL, 0, "", MACRO_Print}, |
| 961 | {"PrinterSetup", NULL, 0, "", MACRO_PrinterSetup}, |
| 962 | {"RegisterRoutine", "RR", 0, "SSS", MACRO_RegisterRoutine}, |
| 963 | {"RemoveAccelerator", "RA", 0, "UU", MACRO_RemoveAccelerator}, |
| 964 | {"ResetMenu", NULL, 0, "", MACRO_ResetMenu}, |
| 965 | {"SaveMark", NULL, 0, "S", MACRO_SaveMark}, |
| 966 | {"Search", NULL, 0, "", MACRO_Search}, |
| 967 | {"SetContents", NULL, 0, "SU", MACRO_SetContents}, |
| 968 | {"SetHelpOnFile", NULL, 0, "S", MACRO_SetHelpOnFile}, |
| 969 | {"SetPopupColor", "SPC",0, "UUU", MACRO_SetPopupColor}, |
| 970 | {"ShellExecute", "SE", 0, "SSUUSS", MACRO_ShellExecute}, |
| 971 | {"ShortCut", "SH", 0, "SSUUS", MACRO_ShortCut}, |
| 972 | {"TCard", NULL, 0, "U", MACRO_TCard}, |
| 973 | {"Test", NULL, 0, "U", MACRO_Test}, |
| 974 | {"TestALink", NULL, 1, "S", MACRO_TestALink}, |
| 975 | {"TestKLink", NULL, 1, "S", MACRO_TestKLink}, |
| 976 | {"UncheckItem", "UI", 0, "S", MACRO_UncheckItem}, |
| 977 | {"UpdateWindow", "UW", 0, "SS", MACRO_UpdateWindow}, |
Francois Gouget | ef35bfd | 2009-01-08 14:16:40 +0100 | [diff] [blame] | 978 | {NULL, NULL, 0, NULL, NULL} |
| 979 | }; |
| 980 | |
| 981 | static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len) |
| 982 | { |
| 983 | struct MacroDesc* md; |
| 984 | |
| 985 | for (md = start; md->name && len != 0; md++, len--) |
| 986 | { |
| 987 | if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0)) |
| 988 | { |
| 989 | lr->proto = md->arguments; |
| 990 | lr->function = md->fn; |
| 991 | return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION; |
| 992 | } |
| 993 | } |
| 994 | return EMPTY; |
| 995 | } |
| 996 | |
| 997 | int MACRO_Lookup(const char* name, struct lexret* lr) |
| 998 | { |
| 999 | int ret; |
| 1000 | |
| 1001 | if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY) |
| 1002 | return ret; |
| 1003 | if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY) |
| 1004 | return ret; |
| 1005 | |
| 1006 | lr->string = name; |
| 1007 | return IDENTIFIER; |
| 1008 | } |