ReactOS
0.4.16-dev-250-g3ecd236
notepad.h
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Notepad
3
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4
* PURPOSE: Providing a Windows-compatible simple text editor for ReactOS
5
* COPYRIGHT: Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
6
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
7
* Copyright 2002 Andriy Palamarchuk
8
* Copyright 2000 Mike McCormack <Mike_McCormack@looksmart.com.au>
9
* Copyright 2020-2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
10
*/
11
12
#pragma once
13
14
#ifndef STRSAFE_NO_DEPRECATE
15
#define STRSAFE_NO_DEPRECATE
16
#endif
17
18
#include <
windef.h
>
19
#include <
winbase.h
>
20
#include <
winuser.h
>
21
#include <
winnls.h
>
22
#include <
wingdi.h
>
23
#include <
shellapi.h
>
24
#include <
commdlg.h
>
25
#include <tchar.h>
26
#include <stdlib.h>
27
#include <
malloc.h
>
28
29
#include "
dialog.h
"
30
#include "
notepad_res.h
"
31
32
#define EDIT_STYLE_WRAP (WS_CHILD | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL)
33
#define EDIT_STYLE (EDIT_STYLE_WRAP | WS_HSCROLL | ES_AUTOHSCROLL)
34
#define EDIT_CLASS _T("EDIT"
)
35
36
#define MAX_STRING_LEN 255
37
38
/* Values are indexes of the items in the Encoding combobox. */
39
typedef
enum
40
{
41
ENCODING_AUTO
= -1,
42
ENCODING_ANSI
= 0,
43
ENCODING_UTF16LE
= 1,
44
ENCODING_UTF16BE
= 2,
45
ENCODING_UTF8
= 3,
46
ENCODING_UTF8BOM
= 4
47
}
ENCODING
;
48
49
#define ENCODING_DEFAULT ENCODING_UTF8
// ENCODING_ANSI
50
51
typedef
enum
52
{
53
EOLN_CRLF
= 0,
/* "\r\n" */
54
EOLN_LF
= 1,
/* "\n" */
55
EOLN_CR
= 2
/* "\r" */
56
}
EOLN
;
/* End of line (NewLine) type */
57
58
typedef
struct
59
{
60
HINSTANCE
hInstance
;
61
HWND
hMainWnd
;
62
HWND
hFindReplaceDlg
;
63
HWND
hEdit
;
64
HWND
hStatusBar
;
65
HFONT
hFont
;
/* Font used by the edit control */
66
HMENU
hMenu
;
67
HGLOBAL
hDevMode
;
68
HGLOBAL
hDevNames
;
69
LOGFONT
lfFont
;
70
BOOL
bWrapLongLines
;
71
BOOL
bShowStatusBar
;
72
TCHAR
szFindText[
MAX_PATH
];
73
TCHAR
szReplaceText[
MAX_PATH
];
74
TCHAR
szFileName[
MAX_PATH
];
75
TCHAR
szFileTitle[
MAX_PATH
];
76
TCHAR
szFilter
[512];
77
RECT
lMargins
;
/* The margin values in 100th millimeters */
78
TCHAR
szHeader[
MAX_PATH
];
79
TCHAR
szFooter[
MAX_PATH
];
80
TCHAR
szStatusBarLineCol[
MAX_PATH
];
81
82
ENCODING
encFile
;
83
EOLN
iEoln
;
84
85
FINDREPLACE
find
;
86
WNDPROC
EditProc
;
87
BOOL
bWasModified
;
88
}
NOTEPAD_GLOBALS
;
89
90
extern
NOTEPAD_GLOBALS
Globals
;
91
92
BOOL
ReadText
(
HANDLE
hFile
,
HLOCAL
*phLocal,
ENCODING
*pencFile,
EOLN
*piEoln);
93
BOOL
WriteText
(
HANDLE
hFile
,
LPCWSTR
pszText,
DWORD
dwTextLen,
ENCODING
encFile,
EOLN
iEoln);
94
95
void
NOTEPAD_LoadSettingsFromRegistry
(
PWINDOWPLACEMENT
pWP);
96
void
NOTEPAD_SaveSettingsToRegistry
(
void
);
97
98
BOOL
NOTEPAD_FindNext
(
FINDREPLACE
*pFindReplace,
BOOL
bReplace,
BOOL
bShowAlert);
99
VOID
NOTEPAD_EnableSearchMenu
(
VOID
);
100
VOID
SetFileName
(
LPCTSTR
szFileName);
NOTEPAD_EnableSearchMenu
VOID NOTEPAD_EnableSearchMenu()
Definition:
main.c:20
commdlg.h
MAX_PATH
#define MAX_PATH
Definition:
compat.h:34
dialog.h
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
malloc.h
HFONT
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HMENU
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition:
ordinal.c:63
ENCODING
ENCODING
Definition:
more.c:493
szFilter
LPTSTR szFilter
Definition:
mplay32.c:30
hFile
_In_ HANDLE hFile
Definition:
mswsock.h:90
NOTEPAD_SaveSettingsToRegistry
void NOTEPAD_SaveSettingsToRegistry(void)
Definition:
settings.c:236
ReadText
BOOL ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
Definition:
text.c:153
NOTEPAD_LoadSettingsFromRegistry
void NOTEPAD_LoadSettingsFromRegistry(PWINDOWPLACEMENT pWP)
Definition:
settings.c:105
ENCODING
ENCODING
Definition:
notepad.h:40
ENCODING_AUTO
@ ENCODING_AUTO
Definition:
notepad.h:41
ENCODING_UTF16BE
@ ENCODING_UTF16BE
Definition:
notepad.h:44
ENCODING_UTF8BOM
@ ENCODING_UTF8BOM
Definition:
notepad.h:46
ENCODING_UTF8
@ ENCODING_UTF8
Definition:
notepad.h:45
ENCODING_UTF16LE
@ ENCODING_UTF16LE
Definition:
notepad.h:43
ENCODING_ANSI
@ ENCODING_ANSI
Definition:
notepad.h:42
WriteText
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, EOLN iEoln)
Definition:
text.c:395
SetFileName
VOID SetFileName(LPCTSTR szFileName)
Definition:
main.c:34
EOLN
EOLN
Definition:
notepad.h:52
EOLN_LF
@ EOLN_LF
Definition:
notepad.h:54
EOLN_CR
@ EOLN_CR
Definition:
notepad.h:55
EOLN_CRLF
@ EOLN_CRLF
Definition:
notepad.h:53
NOTEPAD_FindNext
BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert)
Definition:
main.c:132
Globals
NOTEPAD_GLOBALS Globals
Definition:
clipbrd.c:13
notepad_res.h
shellapi.h
FINDREPLACEA
Definition:
commdlg.h:302
LOGFONTA
Definition:
dimm.idl:41
NOTEPAD_GLOBALS
Definition:
notepad.h:59
NOTEPAD_GLOBALS::hDevNames
HGLOBAL hDevNames
Definition:
notepad.h:68
NOTEPAD_GLOBALS::bWrapLongLines
BOOL bWrapLongLines
Definition:
notepad.h:70
NOTEPAD_GLOBALS::hEdit
HWND hEdit
Definition:
notepad.h:63
NOTEPAD_GLOBALS::bWasModified
BOOL bWasModified
Definition:
notepad.h:87
NOTEPAD_GLOBALS::hFindReplaceDlg
HWND hFindReplaceDlg
Definition:
notepad.h:62
NOTEPAD_GLOBALS::hStatusBar
HWND hStatusBar
Definition:
notepad.h:64
NOTEPAD_GLOBALS::bShowStatusBar
BOOL bShowStatusBar
Definition:
notepad.h:71
NOTEPAD_GLOBALS::encFile
ENCODING encFile
Definition:
notepad.h:82
NOTEPAD_GLOBALS::EditProc
WNDPROC EditProc
Definition:
notepad.h:86
NOTEPAD_GLOBALS::lfFont
LOGFONT lfFont
Definition:
notepad.h:69
NOTEPAD_GLOBALS::hDevMode
HGLOBAL hDevMode
Definition:
notepad.h:67
NOTEPAD_GLOBALS::iEoln
EOLN iEoln
Definition:
notepad.h:83
NOTEPAD_GLOBALS::find
FINDREPLACE find
Definition:
notepad.h:85
NOTEPAD_GLOBALS::hMenu
HMENU hMenu
Definition:
notepad.h:66
NOTEPAD_GLOBALS::hInstance
HINSTANCE hInstance
Definition:
notepad.h:60
NOTEPAD_GLOBALS::lMargins
RECT lMargins
Definition:
notepad.h:77
NOTEPAD_GLOBALS::hFont
HFONT hFont
Definition:
notepad.h:65
NOTEPAD_GLOBALS::hMainWnd
HWND hMainWnd
Definition:
notepad.h:61
_WINDOWPLACEMENT
Definition:
winuser.h:3292
tagRECT
Definition:
windef.h:305
winbase.h
windef.h
wingdi.h
winnls.h
winuser.h
WNDPROC
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition:
winuser.h:2909
TCHAR
char TCHAR
Definition:
xmlstorage.h:189
LPCTSTR
const CHAR * LPCTSTR
Definition:
xmlstorage.h:193
LPCWSTR
const WCHAR * LPCWSTR
Definition:
xmlstorage.h:185
base
applications
notepad
notepad.h
Generated on Thu Nov 7 2024 06:02:15 for ReactOS by
1.9.6