ReactOS  0.4.12-dev-18-gf469aca
main.h
Go to the documentation of this file.
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #pragma once
23 
24 #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
25 
26 #include "notepad_res.h"
27 
28 #define EDIT_STYLE_WRAP (WS_CHILD | WS_VSCROLL \
29  | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL)
30 #define EDIT_STYLE (EDIT_STYLE_WRAP | WS_HSCROLL | ES_AUTOHSCROLL)
31 
32 #define EDIT_CLASS _T("EDIT")
33 
34 #define MAX_STRING_LEN 255
35 
36 /* Values are indexes of the items in the Encoding combobox. */
37 typedef enum
38 {
44 } ENCODING;
45 // #define ENCODING_ANSI 0
46 #define ENCODING_UNICODE 1
47 #define ENCODING_UNICODE_BE 2
48 // #define ENCODING_UTF8 3
49 
50 // #define MIN_ENCODING 0
51 // #define MAX_ENCODING 3
52 
53 #define EOLN_CRLF 0
54 #define EOLN_LF 1
55 #define EOLN_CR 2
56 
57 typedef struct
58 {
64  HFONT hFont; /* Font used by the edit control */
71  TCHAR szFindText[MAX_PATH];
72  TCHAR szReplaceText[MAX_PATH];
73  TCHAR szFileName[MAX_PATH];
74  TCHAR szFileTitle[MAX_PATH];
77  TCHAR szHeader[MAX_PATH];
78  TCHAR szFooter[MAX_PATH];
79  TCHAR szStatusBarLineCol[MAX_PATH];
80 
82  int iEoln;
83 
88 
90 
91 VOID SetFileName(LPCTSTR szFileName);
92 
93 /* from text.c */
94 BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile, int *piEoln);
95 BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, int iEoln);
96 
97 /* from settings.c */
100 
101 /* from main.c */
HWND hFindReplaceDlg
Definition: main.h:61
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
RECT lMargins
Definition: main.h:76
LPCWSTR pszText
Definition: msvc.h:103
void NOTEPAD_LoadSettingsFromRegistry(void)
Definition: settings.c:114
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HGLOBAL hDevNames
Definition: main.h:67
WNDPROC EditProc
Definition: main.h:85
HGLOBAL hDevMode
Definition: main.h:66
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, int iEoln)
Definition: text.c:319
ENCODING
Definition: main.h:37
int iEoln
Definition: main.h:82
HINSTANCE hInstance
Definition: main.h:59
BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile, int *piEoln)
Definition: text.c:51
HMENU hMenu
Definition: main.h:65
VOID SetFileName(LPCTSTR szFileName)
Definition: main.c:46
NOTEPAD_GLOBALS Globals
Definition: clipbrd.c:13
BOOL bShowStatusBar
Definition: main.h:70
LPTSTR szFilter
Definition: mplay32.c:24
HFONT hFont
Definition: main.h:64
VOID NOTEPAD_EnableSearchMenu(VOID)
RECT main_rect
Definition: main.h:86
char TCHAR
Definition: xmlstorage.h:189
HWND hStatusBar
Definition: main.h:63
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ HANDLE hFile
Definition: mswsock.h:90
BOOL bWrapLongLines
Definition: main.h:69
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
ENCODING
Definition: more.c:155
LOGFONT lfFont
Definition: main.h:68
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
ENCODING encFile
Definition: main.h:81
void NOTEPAD_SaveSettingsToRegistry(void)
Definition: settings.c:227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hEdit
Definition: main.h:62
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HWND hMainWnd
Definition: main.h:60
BOOL NOTEPAD_FindNext(FINDREPLACE *, BOOL, BOOL)
Definition: main.c:138
FINDREPLACE find
Definition: main.h:84
#define MAX_STRING_LEN
Definition: main.h:34