4 * Copyright 1996 Ulrich Schmid
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
30 void MACRO_About(void)
32 WINE_FIXME("About()\n");
35 void MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str)
37 WINE_FIXME("AddAccelerator(%lu, %lu, \"%s\")\n", u1, u2, str);
40 void MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2)
42 WINE_FIXME("ALink(\"%s\", %lu, \"%s\")\n", str1, u, str2);
45 void MACRO_Annotate(void)
47 WINE_FIXME("Annotate()\n");
50 void MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4)
52 WINE_FIXME("AppendItem(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4);
57 WINE_FIXME("Back()\n");
60 void MACRO_BackFlush(void)
62 WINE_FIXME("BackFlush()\n");
65 void MACRO_BookmarkDefine(void)
67 WINE_FIXME("BookmarkDefine()\n");
70 void MACRO_BookmarkMore(void)
72 WINE_FIXME("BookmarkMore()\n");
75 void MACRO_BrowseButtons(void)
77 MACRO_CreateButton("BTN_PREV", "&<<", "Prev()");
78 MACRO_CreateButton("BTN_NEXT", "&>>", "Next()");
81 void MACRO_ChangeButtonBinding(LPCSTR str1, LPCSTR str2)
83 WINE_FIXME("ChangeButtonBinding(\"%s\", \"%s\")\n", str1, str2);
86 void MACRO_ChangeEnable(LPCSTR str1, LPCSTR str2)
88 WINE_FIXME("ChangeEnable(\"%s\", \"%s\")\n", str1, str2);
91 void MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2)
93 WINE_FIXME("ChangeItemBinding(\"%s\", \"%s\")\n", str1, str2);
96 void MACRO_CheckItem(LPCSTR str)
98 WINE_FIXME("CheckItem(\"%s\")\n", str);
101 void MACRO_CloseSecondarys(void)
104 for (win = Globals.win_list; win; win = win->next)
105 if (win->lpszName && lstrcmpi(win->lpszName, "main"))
106 DestroyWindow(win->hMainWnd);
109 void MACRO_CloseWindow(LPCSTR lpszWindow)
112 if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
114 for (win = Globals.win_list; win; win = win->next)
115 if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow))
116 DestroyWindow(win->hMainWnd);
119 void MACRO_Compare(LPCSTR str)
121 WINE_FIXME("Compare(\"%s\")\n", str);
124 void MACRO_Contents(void)
126 if (Globals.active_win->page)
127 MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL);
130 void MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u)
132 WINE_FIXME("ControlPanel(\"%s\", \"%s\", %lu)\n", str1, str2, u);
135 void MACRO_CopyDialog(void)
137 WINE_FIXME("CopyDialog()\n");
140 void MACRO_CopyTopic(void)
142 WINE_FIXME("CopyTopic()\n");
145 void MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
147 WINHELP_WINDOW *win = Globals.active_win;
148 WINHELP_BUTTON *button, **b;
152 size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3;
154 button = HeapAlloc(GetProcessHeap(), 0, size);
160 ptr = (char*)button + sizeof(WINHELP_BUTTON);
162 lstrcpy(ptr, (LPSTR) id);
163 button->lpszID = ptr;
164 ptr += lstrlen(id) + 1;
166 lstrcpy(ptr, (LPSTR) name);
167 button->lpszName = ptr;
168 ptr += lstrlen(name) + 1;
170 lstrcpy(ptr, (LPSTR) macro);
171 button->lpszMacro = ptr;
173 button->wParam = WH_FIRST_BUTTON;
174 for (b = &win->first_button; *b; b = &(*b)->next)
175 button->wParam = max(button->wParam, (*b)->wParam + 1);
178 SendMessage(win->hMainWnd, WM_USER, 0, 0);
181 void MACRO_DeleteItem(LPCSTR str)
183 WINE_FIXME("DeleteItem(\"%s\")\n", str);
186 void MACRO_DeleteMark(LPCSTR str)
188 WINE_FIXME("DeleteMark(\"%s\")\n", str);
191 void MACRO_DestroyButton(LPCSTR str)
193 WINE_FIXME("DestroyButton(\"%s\")\n", str);
196 void MACRO_DisableButton(LPCSTR str)
198 WINE_FIXME("DisableButton(\"%s\")\n", str);
201 void MACRO_DisableItem(LPCSTR str)
203 WINE_FIXME("DisableItem(\"%s\")\n", str);
206 void MACRO_EnableButton(LPCSTR str)
208 WINE_FIXME("EnableButton(\"%s\")\n", str);
211 void MACRO_EnableItem(LPCSTR str)
213 WINE_FIXME("EnableItem(\"%s\")\n", str);
216 void MACRO_EndMPrint(void)
218 WINE_FIXME("EndMPrint()\n");
221 void MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3)
223 WINE_FIXME("ExecFile(\"%s\", \"%s\", %lu, \"%s\")\n", str1, str2, u, str3);
226 void MACRO_ExecProgram(LPCSTR str, LONG u)
228 WINE_FIXME("ExecProgram(\"%s\", %lu)\n", str, u);
231 void MACRO_Exit(void)
233 while (Globals.win_list)
234 DestroyWindow(Globals.win_list->hMainWnd);
237 void MACRO_ExtAbleItem(LPCSTR str, LONG u)
239 WINE_FIXME("ExtAbleItem(\"%s\", %lu)\n", str, u);
242 void MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2)
244 WINE_FIXME("ExtInsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, str4, u1, u2);
247 void MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2)
249 WINE_FIXME("ExtInsertMenu(\"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, u1, u2);
252 BOOL MACRO_FileExist(LPCSTR str)
254 WINE_FIXME("FileExist(\"%s\")\n", str);
258 void MACRO_FileOpen(void)
260 OPENFILENAME openfilename;
261 CHAR szPath[MAX_PATHNAME_LEN];
262 CHAR szDir[MAX_PATHNAME_LEN];
263 CHAR szzFilter[2 * MAX_STRING_LEN + 100];
266 LoadString(Globals.hInstance, 0X12B, p, MAX_STRING_LEN);
270 LoadString(Globals.hInstance, 0x12A, p, MAX_STRING_LEN);
276 GetCurrentDirectory(sizeof(szDir), szDir);
280 openfilename.lStructSize = 0;
281 openfilename.hwndOwner = Globals.active_win->hMainWnd;
282 openfilename.hInstance = Globals.hInstance;
283 openfilename.lpstrFilter = szzFilter;
284 openfilename.lpstrCustomFilter = 0;
285 openfilename.nMaxCustFilter = 0;
286 openfilename.nFilterIndex = 1;
287 openfilename.lpstrFile = szPath;
288 openfilename.nMaxFile = sizeof(szPath);
289 openfilename.lpstrFileTitle = 0;
290 openfilename.nMaxFileTitle = 0;
291 openfilename.lpstrInitialDir = szDir;
292 openfilename.lpstrTitle = 0;
293 openfilename.Flags = 0;
294 openfilename.nFileOffset = 0;
295 openfilename.nFileExtension = 0;
296 openfilename.lpstrDefExt = 0;
297 openfilename.lCustData = 0;
298 openfilename.lpfnHook = 0;
299 openfilename.lpTemplateName = 0;
301 if (GetOpenFileName(&openfilename))
302 WINHELP_CreateHelpWindowByHash(szPath, 0, "main", FALSE, 0, NULL, SW_SHOWNORMAL);
305 void MACRO_Find(void)
307 WINE_FIXME("Find()\n");
310 void MACRO_Finder(void)
312 WINE_FIXME("Finder()\n");
315 void MACRO_FloatingMenu(void)
317 WINE_FIXME("FloatingMenu()\n");
320 void MACRO_Flush(void)
322 WINE_FIXME("Flush()\n");
325 void MACRO_FocusWindow(LPCSTR str)
327 WINE_FIXME("FocusWindow(\"%s\")\n", str);
330 void MACRO_Generate(LPCSTR str, WPARAM w, LPARAM l)
332 WINE_FIXME("Generate(\"%s\", %x, %lx)\n", str, w, l);
335 void MACRO_GotoMark(LPCSTR str)
337 WINE_FIXME("GotoMark(\"%s\")\n", str);
340 void MACRO_HelpOn(void)
342 MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL);
345 void MACRO_HelpOnTop(void)
347 WINE_FIXME("HelpOnTop()\n");
350 void MACRO_History(void)
352 WINE_FIXME("History()\n");
355 BOOL MACRO_InitMPrint(void)
357 WINE_FIXME("InitMPrint()\n");
361 void MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u)
363 WINE_FIXME("InsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu)\n", str1, str2, str3, str4, u);
366 void MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u)
368 WINE_FIXME("InsertMenu(\"%s\", \"%s\", %lu)\n", str1, str2, u);
371 BOOL MACRO_IsBook(void)
373 WINE_FIXME("IsBook()\n");
377 BOOL MACRO_IsMark(LPCSTR str)
379 WINE_FIXME("IsMark(\"%s\")\n", str);
383 BOOL MACRO_IsNotMark(LPCSTR str)
385 WINE_FIXME("IsNotMark(\"%s\")\n", str);
389 void MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
391 WINHELP_CreateHelpWindowByHash(lpszPath, 0, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
394 void MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
396 WINE_FIXME("JumpContext(\"%s\", \"%s\", %lu)\n", lpszPath, lpszWindow, context);
399 void MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
401 WINHELP_CreateHelpWindowByHash(lpszPath, lHash, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
404 void MACRO_JumpHelpOn(void)
406 WINE_FIXME("JumpHelpOn()\n");
409 void MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id)
411 MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id));
414 void MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword)
416 WINE_FIXME("JumpKeyword(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword);
419 void MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3)
421 WINE_FIXME("KLink(\"%s\", %lu, \"%s\", \"%s\")\n", str1, u, str2, str3);
424 void MACRO_Menu(void)
426 WINE_FIXME("Menu()\n");
429 void MACRO_MPrintHash(LONG u)
431 WINE_FIXME("MPrintHash(%lu)\n", u);
434 void MACRO_MPrintID(LPCSTR str)
436 WINE_FIXME("MPrintID(\"%s\")\n", str);
439 void MACRO_Next(void)
441 if (Globals.active_win->page->next)
442 WINHELP_CreateHelpWindowByPage(Globals.active_win->page->next, "main", FALSE, 0, NULL, SW_NORMAL);
445 void MACRO_NoShow(void)
447 WINE_FIXME("NoShow()\n");
450 void MACRO_PopupContext(LPCSTR str, LONG u)
452 WINE_FIXME("PopupContext(\"%s\", %lu)\n", str, u);
455 void MACRO_PopupHash(LPCSTR str, LONG u)
457 WINE_FIXME("PopupHash(\"%s\", %lu)\n", str, u);
460 void MACRO_PopupId(LPCSTR str1, LPCSTR str2)
462 WINE_FIXME("PopupId(\"%s\", \"%s\")\n", str1, str2);
465 void MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str)
467 WINE_FIXME("PositionWindow(%li, %li, %lu, %lu, %lu, \"%s\")\n", i1, i2, u1, u2, u3, str);
470 void MACRO_Prev(void)
472 if (Globals.active_win->page->prev)
473 WINHELP_CreateHelpWindowByPage(Globals.active_win->page->prev, "main", FALSE, 0, NULL, SW_NORMAL);
476 void MACRO_Print(void)
480 printer.lStructSize = sizeof(printer);
481 printer.hwndOwner = Globals.active_win->hMainWnd;
482 printer.hInstance = Globals.hInstance;
483 printer.hDevMode = 0;
484 printer.hDevNames = 0;
487 printer.nFromPage = 0;
489 printer.nMinPage = 0;
490 printer.nMaxPage = 0;
492 printer.lCustData = 0;
493 printer.lpfnPrintHook = 0;
494 printer.lpfnSetupHook = 0;
495 printer.lpPrintTemplateName = 0;
496 printer.lpSetupTemplateName = 0;
497 printer.hPrintTemplate = 0;
498 printer.hSetupTemplate = 0;
500 if (PrintDlgA(&printer)) {
501 WINE_FIXME("Print()\n");
505 void MACRO_PrinterSetup(void)
507 WINE_FIXME("PrinterSetup()\n");
510 void MACRO_RegisterRoutine(LPCSTR str1, LPCSTR str2, LPCSTR str3)
512 WINE_FIXME("RegisterRoutine(\"%s\", \"%s\", \"%s\")\n", str1, str2, str3);
515 void MACRO_RemoveAccelerator(LONG u1, LONG u2)
517 WINE_FIXME("RemoveAccelerator(%lu, %lu)\n", u1, u2);
520 void MACRO_ResetMenu(void)
522 WINE_FIXME("ResetMenu()\n");
525 void MACRO_SaveMark(LPCSTR str)
527 WINE_FIXME("SaveMark(\"%s\")\n", str);
530 void MACRO_Search(void)
532 WINE_FIXME("Search()\n");
535 void MACRO_SetContents(LPCSTR str, LONG u)
537 WINE_FIXME("SetContents(\"%s\", %lu)\n", str, u);
540 void MACRO_SetHelpOnFile(LPCSTR str)
542 WINE_FIXME("SetHelpOnFile(\"%s\")\n", str);
545 void MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3)
547 WINE_FIXME("SetPopupColor(%lu, %lu, %lu)\n", u1, u2, u3);
550 void MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4)
552 WINE_FIXME("ShellExecute(\"%s\", \"%s\", %lu, %lu, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4);
555 void MACRO_ShortCut(LPCSTR str1, LPCSTR str2, WPARAM w, LPARAM l, LPCSTR str)
557 WINE_FIXME("ShortCut(\"%s\", \"%s\", %x, %lx, \"%s\")\n", str1, str2, w, l, str);
560 void MACRO_TCard(LONG u)
562 WINE_FIXME("TCard(%lu)\n", u);
565 void MACRO_Test(LONG u)
567 WINE_FIXME("Test(%lu)\n", u);
570 BOOL MACRO_TestALink(LPCSTR str)
572 WINE_FIXME("TestALink(\"%s\")\n", str);
576 BOOL MACRO_TestKLink(LPCSTR str)
578 WINE_FIXME("TestKLink(\"%s\")\n", str);
582 void MACRO_UncheckItem(LPCSTR str)
584 WINE_FIXME("UncheckItem(\"%s\")\n", str);
587 void MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2)
589 WINE_FIXME("UpdateWindow(\"%s\", \"%s\")\n", str1, str2);