ReactOS 0.4.15-dev-5666-gc548b97
macro.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
Include dependency graph for macro.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lexret
 

Enumerations

enum  token_types {
  EMPTY , VOID_FUNCTION , BOOL_FUNCTION , INTEGER ,
  STRING , IDENTIFIER
}
 

Functions

BOOL MACRO_ExecuteMacro (struct tagWinHelp *, LPCSTR)
 
int MACRO_Lookup (const char *name, struct lexret *lr)
 
struct tagWinHelpMACRO_CurrentWindow (void)
 
void CALLBACK MACRO_About (void)
 
void CALLBACK MACRO_Annotate (void)
 
void CALLBACK MACRO_BookmarkDefine (void)
 
void CALLBACK MACRO_CopyDialog (void)
 
void CALLBACK MACRO_CreateButton (LPCSTR, LPCSTR, LPCSTR)
 
void CALLBACK MACRO_DisableButton (LPCSTR)
 
void CALLBACK MACRO_Exit (void)
 
void CALLBACK MACRO_FileOpen (void)
 
void CALLBACK MACRO_HelpOn (void)
 
void CALLBACK MACRO_HelpOnTop (void)
 
void CALLBACK MACRO_History (void)
 
void CALLBACK MACRO_JumpContents (LPCSTR, LPCSTR)
 
void CALLBACK MACRO_JumpContext (LPCSTR, LPCSTR, LONG)
 
void CALLBACK MACRO_JumpHash (LPCSTR, LPCSTR, LONG)
 
void CALLBACK MACRO_PopupContext (LPCSTR, LONG)
 
void CALLBACK MACRO_Print (void)
 
void CALLBACK MACRO_PrinterSetup (void)
 
void CALLBACK MACRO_SetContents (LPCSTR, LONG)
 

Variables

struct lexret yylval
 

Enumeration Type Documentation

◆ token_types

Enumerator
EMPTY 
VOID_FUNCTION 
BOOL_FUNCTION 
INTEGER 
STRING 
IDENTIFIER 

Definition at line 44 of file macro.h.

@ EMPTY
Definition: macro.h:44
@ INTEGER
Definition: macro.h:44
@ VOID_FUNCTION
Definition: macro.h:44
@ IDENTIFIER
Definition: macro.h:44
@ STRING
Definition: macro.h:44
@ BOOL_FUNCTION
Definition: macro.h:44

Function Documentation

◆ MACRO_About()

void CALLBACK MACRO_About ( void  )

Definition at line 152 of file macro.c.

153{
154 WCHAR name[256];
156 IMAGE_ICON, 48, 48, LR_SHARED );
159}
#define ARRAY_SIZE(a)
Definition: main.h:24
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
#define NULL
Definition: types.h:112
struct tagWinHelp * MACRO_CurrentWindow(void)
HWND hMainWnd
Definition: magnifier.c:32
static HICON
Definition: imagelist.c:84
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
HINSTANCE hInstance
Definition: precomp.h:43
Definition: name.c:39
#define IDI_WINHELP
Definition: winhelp_res.h:56
#define STID_WINE_HELP
Definition: winhelp_res.h:36
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define LR_SHARED
Definition: winuser.h:1094
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by WINHELP_MainWndProc().

◆ MACRO_Annotate()

void CALLBACK MACRO_Annotate ( void  )

Definition at line 171 of file macro.c.

172{
173 WINE_FIXME("()\n");
174}
#define WINE_FIXME
Definition: debug.h:366

Referenced by WINHELP_MainWndProc().

◆ MACRO_BookmarkDefine()

void CALLBACK MACRO_BookmarkDefine ( void  )

Definition at line 200 of file macro.c.

201{
202 WINE_FIXME("()\n");
203}

Referenced by WINHELP_MainWndProc().

◆ MACRO_CopyDialog()

void CALLBACK MACRO_CopyDialog ( void  )

Definition at line 336 of file macro.c.

337{
338 WINE_FIXME("()\n");
339}

Referenced by WINHELP_MainWndProc().

◆ MACRO_CreateButton()

void CALLBACK MACRO_CreateButton ( LPCSTR  id,
LPCSTR  name,
LPCSTR  macro 
)

Definition at line 73 of file macro.c.

74{
77 LONG size;
78 LPSTR ptr;
79
80 WINE_TRACE("(%s, %s, %s)\n", debugstr_a(id), debugstr_a(name), debugstr_a(macro));
81
82 size = sizeof(WINHELP_BUTTON) + strlen(id) + strlen(name) + strlen(macro) + 3;
83
85 if (!button) return;
86
87 button->next = 0;
88 button->hWnd = 0;
89
90 ptr = (char*)button + sizeof(WINHELP_BUTTON);
91
92 strcpy(ptr, id);
93 button->lpszID = ptr;
94 ptr += strlen(id) + 1;
95
96 strcpy(ptr, name);
97 button->lpszName = ptr;
98 ptr += strlen(name) + 1;
99
100 strcpy(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
109}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
void WINHELP_LayoutMainWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:433
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
#define debugstr_a
Definition: kernel32.h:31
static real win[4][36]
static PVOID ptr
Definition: dispmode.c:27
DWORD button
Definition: button.c:166
long LONG
Definition: pedump.c:60
#define WINE_TRACE
Definition: debug.h:354
#define max(a, b)
Definition: svc.c:63
struct tagHelpButton WINHELP_BUTTON
#define WH_FIRST_BUTTON
Definition: winhelp.h:190
char * LPSTR
Definition: xmlstorage.h:182

Referenced by MACRO_BrowseButtons(), and WINHELP_CreateHelpWindow().

◆ MACRO_CurrentWindow()

◆ MACRO_DisableButton()

void CALLBACK MACRO_DisableButton ( LPCSTR  id)

Definition at line 116 of file macro.c.

117{
119
120 WINE_TRACE("(%s)\n", debugstr_a(id));
121
123 if (!*b) {WINE_FIXME("Couldn't find button %s\n", debugstr_a(id)); return;}
124
125 EnableWindow((*b)->hWnd, FALSE);
126}
#define FALSE
Definition: types.h:117
static WINHELP_BUTTON ** MACRO_LookupButton(WINHELP_WINDOW *win, LPCSTR name)
Definition: macro.c:59
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)

Referenced by MACRO_BrowseButtons(), and WINHELP_CreateHelpWindow().

◆ MACRO_ExecuteMacro()

◆ MACRO_Exit()

void CALLBACK MACRO_Exit ( void  )

Definition at line 392 of file macro.c.

393{
394 WINE_TRACE("()\n");
395
396 while (Globals.win_list)
398}
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:523

Referenced by WINHELP_DeleteWindow(), WINHELP_HandleCommand(), and WINHELP_MainWndProc().

◆ MACRO_FileOpen()

void CALLBACK MACRO_FileOpen ( void  )

Definition at line 421 of file macro.c.

422{
423 char szFile[MAX_PATH];
424
426 {
427 MACRO_JumpContents(szFile, "main");
428 }
429}
BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len)
Definition: winhelp.c:145
#define MAX_PATH
Definition: compat.h:34
void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
Definition: macro.c:140

Referenced by WINHELP_MainWndProc().

◆ MACRO_HelpOn()

void CALLBACK MACRO_HelpOn ( void  )

Definition at line 474 of file macro.c.

475{
477 LPCSTR file = NULL;
478
479 WINE_TRACE("()\n");
480 if (win && win->page && win->page->file)
481 file = win->page->file->help_on_file;
482
483 if (!file)
484 file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp";
485
487}
Definition: fci.c:127
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by WINHELP_HandleCommand(), and WINHELP_MainWndProc().

◆ MACRO_HelpOnTop()

void CALLBACK MACRO_HelpOnTop ( void  )

Definition at line 489 of file macro.c.

490{
491 static BOOL on_top = FALSE;
493 HWND main_wnd = NULL;
494 HMENU menu;
495
496 for (win = Globals.win_list; win; win = win->next)
497 if (!lstrcmpiA(win->info->name, "main"))
498 main_wnd = win->hMainWnd;
499 if (!main_wnd)
500 {
501 WINE_ERR("could not find the main window!\n");
502 return;
503 }
504 menu = GetMenu(main_wnd);
505
506 on_top = !on_top;
507 if (on_top) {
509 SetWindowPos(main_wnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
510 } else {
512 SetWindowPos(main_wnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
513 }
514}
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WINE_ERR
Definition: debug.h:371
#define MNID_HELP_HELPTOP
Definition: winhelp_res.h:22
#define MF_BYCOMMAND
Definition: winuser.h:202
#define HWND_TOPMOST
Definition: winuser.h:1198
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1234
#define MF_CHECKED
Definition: winuser.h:132
#define SWP_NOSIZE
Definition: winuser.h:1235
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define HWND_NOTOPMOST
Definition: winuser.h:1196
HMENU WINAPI GetMenu(_In_ HWND)

Referenced by WINHELP_MainWndProc().

◆ MACRO_History()

void CALLBACK MACRO_History ( void  )

Definition at line 516 of file macro.c.

517{
518 WINE_TRACE("()\n");
519
520 if (Globals.active_win && !Globals.active_win->hHistoryWnd)
521 {
523 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win);
525 }
526}
HWND hWnd
Definition: settings.c:17
const char HISTORY_WIN_CLASS_NAME[]
Definition: string.c:25
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4305
#define SW_NORMAL
Definition: winuser.h:763

Referenced by WINHELP_MainWndProc().

◆ MACRO_JumpContents()

void CALLBACK MACRO_JumpContents ( LPCSTR  lpszPath,
LPCSTR  lpszWindow 
)

Definition at line 140 of file macro.c.

141{
142 HLPFILE* hlpfile;
143
144 WINE_TRACE("(%s, %s)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow));
145 if ((hlpfile = WINHELP_LookupHelpFile(lpszPath)))
147 WINHELP_GetWindowInfo(hlpfile, lpszWindow),
148 SW_NORMAL);
149}
HLPFILE * WINHELP_LookupHelpFile(LPCSTR lpszFile)
Definition: winhelp.c:211
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE *(*lookup)(HLPFILE *, LONG, ULONG *), HLPFILE *hlpfile, LONG val, HLPFILE_WINDOWINFO *wi, int nCmdShow)
Definition: winhelp.c:878
HLPFILE_WINDOWINFO * WINHELP_GetWindowInfo(HLPFILE *hlpfile, LPCSTR name)
Definition: winhelp.c:253
HLPFILE_PAGE * HLPFILE_PageByHash(HLPFILE *hlpfile, LONG lHash, ULONG *relative)
Definition: hlpfile.c:437

Referenced by MACRO_Contents(), MACRO_FileOpen(), MACRO_HelpOn(), and WINHELP_HandleCommand().

◆ MACRO_JumpContext()

void CALLBACK MACRO_JumpContext ( LPCSTR  lpszPath,
LPCSTR  lpszWindow,
LONG  context 
)

Definition at line 573 of file macro.c.

574{
575 HLPFILE* hlpfile;
576
577 WINE_TRACE("(%s, %s, %d)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow), context);
578 if ((hlpfile = WINHELP_LookupHelpFile(lpszPath)))
579 /* Some madness: what user calls 'context', hlpfile calls 'map' */
581 WINHELP_GetWindowInfo(hlpfile, lpszWindow),
582 SW_NORMAL);
583}
HLPFILE_PAGE * HLPFILE_PageByMap(HLPFILE *hlpfile, LONG lMap, ULONG *relative)
Definition: hlpfile.c:467
Definition: http.c:7252

Referenced by WINHELP_HandleCommand().

◆ MACRO_JumpHash()

void CALLBACK MACRO_JumpHash ( LPCSTR  lpszPath,
LPCSTR  lpszWindow,
LONG  lHash 
)

Definition at line 585 of file macro.c.

586{
587 HLPFILE* hlpfile;
588
589 WINE_TRACE("(%s, %s, %u)\n", debugstr_a(lpszPath), debugstr_a(lpszWindow), lHash);
590 if (!lpszPath || !lpszPath[0])
591 hlpfile = MACRO_CurrentWindow()->page->file;
592 else
593 hlpfile = WINHELP_LookupHelpFile(lpszPath);
594 if (hlpfile)
596 WINHELP_GetWindowInfo(hlpfile, lpszWindow),
597 SW_NORMAL);
598}

Referenced by MACRO_JumpID(), and WINHELP_HandleCommand().

◆ MACRO_Lookup()

int MACRO_Lookup ( const char name,
struct lexret lr 
)

Definition at line 1024 of file macro.c.

1025{
1026 int ret;
1027
1028 if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY)
1029 return ret;
1031 return ret;
1032 if (!strcmp(name, "hwndApp"))
1033 {
1035 lr->integer = 0;
1036 for (win = Globals.win_list; win; win = win->next)
1037 {
1038 if (!strcmp(win->info->name, "main"))
1039 {
1040 lr->integer = (LONG_PTR)win->hMainWnd;
1041 break;
1042 }
1043 }
1044 return INTEGER;
1045 }
1046 if (!strcmp(name, "hwndContext"))
1047 {
1048 lr->integer = Globals.active_win ?
1049 (LONG_PTR)Globals.active_win->hMainWnd : 0;
1050 return INTEGER;
1051 }
1052 if (!strcmp(name, "qchPath") || !strcmp(name, "qError") || !strcmp(name, "lTopicNo") ||
1053 !strcmp(name, "hfs") || !strcmp(name, "coForeground") || !strcmp(name, "coBackground"))
1054 {
1055 WINE_FIXME("keyword %s not substituted in macro parsing\n", debugstr_a(name));
1056 return EMPTY;
1057 }
1058
1059 lr->string = name;
1060 return IDENTIFIER;
1061}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static struct MacroDesc MACRO_Builtins[]
Definition: macro.c:913
static int MACRO_DoLookUp(struct MacroDesc *start, const char *name, struct lexret *lr, unsigned len)
Definition: macro.c:1008
static unsigned MACRO_NumLoaded
Definition: macro.c:47
static struct MacroDesc * MACRO_Loaded
Definition: macro.c:46
#define EMPTY(rect)
Definition: text.c:32
LONG integer
Definition: macro.h:32
LPCSTR string
Definition: macro.h:33
#define LONG_PTR
Definition: treelist.c:79
int ret

◆ MACRO_PopupContext()

void CALLBACK MACRO_PopupContext ( LPCSTR  str,
LONG  u 
)

Definition at line 680 of file macro.c.

681{
682 WINE_FIXME("(%s, %u)\n", debugstr_a(str), u);
683}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
const WCHAR * str

Referenced by WINHELP_HandleCommand().

◆ MACRO_Print()

void CALLBACK MACRO_Print ( void  )

Definition at line 715 of file macro.c.

716{
717 PRINTDLGW printer;
718
719 WINE_TRACE("()\n");
720
721 printer.lStructSize = sizeof(printer);
722 printer.hwndOwner = MACRO_CurrentWindow()->hMainWnd;
723 printer.hInstance = Globals.hInstance;
724 printer.hDevMode = 0;
725 printer.hDevNames = 0;
726 printer.hDC = 0;
727 printer.Flags = 0;
728 printer.nFromPage = 0;
729 printer.nToPage = 0;
730 printer.nMinPage = 0;
731 printer.nMaxPage = 0;
732 printer.nCopies = 0;
733 printer.lCustData = 0;
734 printer.lpfnPrintHook = 0;
735 printer.lpfnSetupHook = 0;
736 printer.lpPrintTemplateName = 0;
737 printer.lpSetupTemplateName = 0;
738 printer.hPrintTemplate = 0;
739 printer.hSetupTemplate = 0;
740
741 if (PrintDlgW(&printer)) {
742 WINE_FIXME("Print()\n");
743 }
744}
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
Definition: printdlg.c:2403
HGLOBAL hSetupTemplate
Definition: commdlg.h:504
LPPRINTHOOKPROC lpfnPrintHook
Definition: commdlg.h:499
HGLOBAL hDevMode
Definition: commdlg.h:488
LPSETUPHOOKPROC lpfnSetupHook
Definition: commdlg.h:500
LPCWSTR lpPrintTemplateName
Definition: commdlg.h:501
DWORD Flags
Definition: commdlg.h:491
HWND hwndOwner
Definition: commdlg.h:487
HINSTANCE hInstance
Definition: commdlg.h:497
LPCWSTR lpSetupTemplateName
Definition: commdlg.h:502
WORD nToPage
Definition: commdlg.h:493
HGLOBAL hPrintTemplate
Definition: commdlg.h:503
HGLOBAL hDevNames
Definition: commdlg.h:489
WORD nMaxPage
Definition: commdlg.h:495
WORD nMinPage
Definition: commdlg.h:494
HDC hDC
Definition: commdlg.h:490
DWORD lStructSize
Definition: commdlg.h:486
WORD nCopies
Definition: commdlg.h:496
LPARAM lCustData
Definition: commdlg.h:498
WORD nFromPage
Definition: commdlg.h:492

Referenced by WINHELP_MainWndProc().

◆ MACRO_PrinterSetup()

void CALLBACK MACRO_PrinterSetup ( void  )

Definition at line 746 of file macro.c.

747{
748 WINE_FIXME("()\n");
749}

Referenced by WINHELP_MainWndProc().

◆ MACRO_SetContents()

void CALLBACK MACRO_SetContents ( LPCSTR  str,
LONG  u 
)

Definition at line 833 of file macro.c.

834{
835 WINE_FIXME("(%s, %u)\n", debugstr_a(str), u);
836}

Referenced by WINHELP_HandleCommand().

Variable Documentation

◆ yylval

struct lexret yylval
extern