Make acpi compile with Visual C++
[reactos.git] / reactos / base / applications / 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #define SIZEOF(a) (sizeof(a)/sizeof((a)[0]))
23
24 #include "notepad_res.h"
25
26 #define EDIT_STYLE_WRAP (WS_CHILD | WS_VISIBLE | WS_VSCROLL \
27 | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL)
28 #define EDIT_STYLE (EDIT_STYLE_WRAP | WS_HSCROLL | ES_AUTOHSCROLL)
29 #define EDIT_EXSTYLE (WS_EX_CLIENTEDGE)
30
31 #define MAX_STRING_LEN 255
32
33 #define ENCODING_ANSI 0
34 #define ENCODING_UNICODE 1
35 #define ENCODING_UNICODE_BE 2
36 #define ENCODING_UTF8 3
37
38 #define EOLN_CRLF 0
39 #define EOLN_LF 1
40 #define EOLN_CR 2
41
42 typedef struct
43 {
44 HINSTANCE hInstance;
45 HWND hMainWnd;
46 HWND hFindReplaceDlg;
47 HWND hEdit;
48 HWND hStatusBar;
49 HFONT hFont; /* Font used by the edit control */
50 LOGFONT lfFont;
51 BOOL bWrapLongLines;
52 BOOL bShowStatusBar;
53 TCHAR szFindText[MAX_PATH];
54 TCHAR szReplaceText[MAX_PATH];
55 TCHAR szFileName[MAX_PATH];
56 TCHAR szFileTitle[MAX_PATH];
57 TCHAR szFilter[2 * MAX_STRING_LEN + 100];
58 TCHAR szMarginTop[MAX_PATH];
59 TCHAR szMarginBottom[MAX_PATH];
60 TCHAR szMarginLeft[MAX_PATH];
61 TCHAR szMarginRight[MAX_PATH];
62 TCHAR szHeader[MAX_PATH];
63 TCHAR szFooter[MAX_PATH];
64 TCHAR szStatusBarLine[MAX_PATH];
65 TCHAR szStatusBarCol[MAX_PATH];
66 int iEncoding;
67 int iEoln;
68
69 FINDREPLACE find;
70 WNDPROC EditProc;
71 RECT main_rect;
72 } NOTEPAD_GLOBALS;
73
74 extern NOTEPAD_GLOBALS Globals;
75
76 VOID SetFileName(LPCTSTR szFileName);
77
78 /* from text.c */
79 BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding, int *piEoln);
80 BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, int iEncoding, int iEoln);
81
82 /* from settings.c */
83 void LoadSettings(void);
84 void SaveSettings(void);
85
86 /* from main.c */
87 BOOL NOTEPAD_FindNext(FINDREPLACE *, BOOL , BOOL );
88 VOID NOTEPAD_EnableSearchMenu(VOID);