Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/programs/notepad/main.h
4387 views
1
/*
2
* Notepad (notepad.h)
3
*
4
* Copyright 1997,98 Marcel Baur <[email protected]>
5
* Copyright 2002 Sylvain Petreolle <[email protected]>
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
#include "notepad_res.h"
23
24
#define MAX_STRING_LEN 255
25
26
/* Values are indexes of the items in the Encoding combobox. */
27
typedef enum
28
{
29
ENCODING_AUTO = -1,
30
ENCODING_ANSI = 0,
31
ENCODING_UTF16LE = 1,
32
ENCODING_UTF16BE = 2,
33
ENCODING_UTF8 = 3
34
} ENCODING;
35
36
#define MIN_ENCODING 0
37
#define MAX_ENCODING 3
38
39
typedef struct
40
{
41
HANDLE hInstance;
42
HWND hMainWnd;
43
HWND hFindReplaceDlg;
44
HWND hEdit;
45
HFONT hFont; /* Font used by the edit control */
46
HWND hStatusBar;
47
BOOL bStatusBar;
48
WCHAR* szStatusString;
49
LOGFONTW lfFont;
50
BOOL bWrapLongLines;
51
WCHAR szFindText[MAX_PATH];
52
WCHAR szReplaceText[MAX_PATH];
53
WCHAR szFileName[MAX_PATH];
54
WCHAR szFileTitle[MAX_PATH];
55
ENCODING encFile;
56
WCHAR szFilter[2 * MAX_STRING_LEN + 100];
57
ENCODING encOfnCombo; /* Encoding selected in IDC_OFN_ENCCOMBO */
58
BOOL bOfnIsOpenDialog;
59
INT iMarginTop;
60
INT iMarginBottom;
61
INT iMarginLeft;
62
INT iMarginRight;
63
WCHAR szHeader[MAX_PATH];
64
WCHAR szFooter[MAX_PATH];
65
INT trackedSel;
66
INT lastLn;
67
INT lastCol;
68
69
FINDREPLACEW find;
70
FINDREPLACEW lastFind;
71
HGLOBAL hDevMode; /* printer mode */
72
HGLOBAL hDevNames; /* printer names */
73
} NOTEPAD_GLOBALS;
74
75
extern NOTEPAD_GLOBALS Globals;
76
77
VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc);
78
void NOTEPAD_DoFind(FINDREPLACEW *fr);
79
void UpdateStatusBar(void);
80
void updateWindowSize(int width, int height);
81
LRESULT CALLBACK EDIT_CallBackProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
82
83