ole32: Fix some leaks (coverity).
[wine] / programs / notepad / main.h
1 /*
2  *  Notepad (notepad.h)
3  *
4  *  Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
5  *  Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
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
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #define ARRAY_SIZE(a) sizeof(a)/sizeof((a)[0])
23
24 #include "notepad_res.h"
25
26 #define MAX_STRING_LEN      255
27
28 /* Values are indexes of the items in the Encoding combobox. */
29 typedef enum
30 {
31     ENCODING_AUTO    = -1,
32     ENCODING_ANSI    =  0,
33     ENCODING_UTF16LE =  1,
34     ENCODING_UTF16BE =  2,
35     ENCODING_UTF8    =  3
36 } ENCODING;
37
38 #define MIN_ENCODING   0
39 #define MAX_ENCODING   3
40
41 typedef struct
42 {
43   HANDLE   hInstance;
44   HWND     hMainWnd;
45   HWND     hFindReplaceDlg;
46   HWND     hEdit;
47   HFONT    hFont; /* Font used by the edit control */
48   LOGFONTW lfFont;
49   BOOL     bWrapLongLines;
50   WCHAR    szFindText[MAX_PATH];
51   WCHAR    szReplaceText[MAX_PATH];
52   WCHAR    szFileName[MAX_PATH];
53   WCHAR    szFileTitle[MAX_PATH];
54   ENCODING encFile;
55   WCHAR    szFilter[2 * MAX_STRING_LEN + 100];
56   ENCODING encOfnCombo;  /* Encoding selected in IDC_OFN_ENCCOMBO */
57   BOOL     bOfnIsOpenDialog;
58   INT      iMarginTop;
59   INT      iMarginBottom;
60   INT      iMarginLeft;
61   INT      iMarginRight;
62   WCHAR    szHeader[MAX_PATH];
63   WCHAR    szFooter[MAX_PATH];
64
65   FINDREPLACEW find;
66   FINDREPLACEW lastFind;
67   HGLOBAL hDevMode; /* printer mode */
68   HGLOBAL hDevNames; /* printer names */
69 } NOTEPAD_GLOBALS;
70
71 extern NOTEPAD_GLOBALS Globals;
72
73 VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc);
74 void NOTEPAD_DoFind(FINDREPLACEW *fr);
75 DWORD get_dpi(void);