2004-12-15 05:07:53 +00:00
|
|
|
/*
|
|
|
|
* Notepad (notepad.h)
|
|
|
|
*
|
|
|
|
* Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
|
|
|
|
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2009-10-27 10:34:16 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-12-15 05:07:53 +00:00
|
|
|
*/
|
|
|
|
|
2014-01-07 17:05:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
2015-03-14 20:00:39 +00:00
|
|
|
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
|
2004-12-15 05:07:53 +00:00
|
|
|
|
|
|
|
#include "notepad_res.h"
|
|
|
|
|
2010-10-06 22:11:12 +00:00
|
|
|
#define EDIT_STYLE_WRAP (WS_CHILD | WS_VSCROLL \
|
2005-09-25 00:35:13 +00:00
|
|
|
| ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL)
|
2005-10-01 00:36:17 +00:00
|
|
|
#define EDIT_STYLE (EDIT_STYLE_WRAP | WS_HSCROLL | ES_AUTOHSCROLL)
|
2010-10-06 22:11:12 +00:00
|
|
|
|
|
|
|
#define EDIT_CLASS _T("EDIT")
|
2005-09-25 00:35:13 +00:00
|
|
|
|
2004-12-15 05:07:53 +00:00
|
|
|
#define MAX_STRING_LEN 255
|
|
|
|
|
2015-03-14 20:00:39 +00:00
|
|
|
/* Values are indexes of the items in the Encoding combobox. */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ENCODING_AUTO = -1,
|
|
|
|
ENCODING_ANSI = 0,
|
|
|
|
ENCODING_UTF16LE = 1,
|
|
|
|
ENCODING_UTF16BE = 2,
|
|
|
|
ENCODING_UTF8 = 3
|
|
|
|
} ENCODING;
|
|
|
|
// #define ENCODING_ANSI 0
|
2015-01-08 13:20:02 +00:00
|
|
|
#define ENCODING_UNICODE 1
|
|
|
|
#define ENCODING_UNICODE_BE 2
|
2015-03-14 20:00:39 +00:00
|
|
|
// #define ENCODING_UTF8 3
|
|
|
|
|
|
|
|
// #define MIN_ENCODING 0
|
|
|
|
// #define MAX_ENCODING 3
|
2005-09-12 17:10:00 +00:00
|
|
|
|
2005-09-24 23:45:05 +00:00
|
|
|
#define EOLN_CRLF 0
|
|
|
|
#define EOLN_LF 1
|
|
|
|
#define EOLN_CR 2
|
|
|
|
|
2004-12-15 05:07:53 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2015-01-08 13:20:02 +00:00
|
|
|
HINSTANCE hInstance;
|
|
|
|
HWND hMainWnd;
|
|
|
|
HWND hFindReplaceDlg;
|
|
|
|
HWND hEdit;
|
|
|
|
HWND hStatusBar;
|
|
|
|
HFONT hFont; /* Font used by the edit control */
|
|
|
|
HMENU hMenu;
|
2015-01-20 12:12:40 +00:00
|
|
|
HGLOBAL hDevMode;
|
|
|
|
HGLOBAL hDevNames;
|
2015-01-08 13:20:02 +00:00
|
|
|
LOGFONT lfFont;
|
|
|
|
BOOL bWrapLongLines;
|
|
|
|
BOOL bShowStatusBar;
|
|
|
|
TCHAR szFindText[MAX_PATH];
|
|
|
|
TCHAR szReplaceText[MAX_PATH];
|
|
|
|
TCHAR szFileName[MAX_PATH];
|
|
|
|
TCHAR szFileTitle[MAX_PATH];
|
|
|
|
TCHAR szFilter[2 * MAX_STRING_LEN + 100];
|
2015-09-14 09:32:57 +00:00
|
|
|
RECT lMargins;
|
2015-01-08 13:20:02 +00:00
|
|
|
TCHAR szHeader[MAX_PATH];
|
|
|
|
TCHAR szFooter[MAX_PATH];
|
|
|
|
TCHAR szStatusBarLineCol[MAX_PATH];
|
2015-03-14 20:00:39 +00:00
|
|
|
|
|
|
|
ENCODING encFile;
|
2015-01-08 13:20:02 +00:00
|
|
|
int iEoln;
|
2004-12-15 05:07:53 +00:00
|
|
|
|
2015-01-08 13:20:02 +00:00
|
|
|
FINDREPLACE find;
|
|
|
|
WNDPROC EditProc;
|
|
|
|
RECT main_rect;
|
2004-12-15 05:07:53 +00:00
|
|
|
} NOTEPAD_GLOBALS;
|
|
|
|
|
|
|
|
extern NOTEPAD_GLOBALS Globals;
|
|
|
|
|
2007-10-09 08:53:25 +00:00
|
|
|
VOID SetFileName(LPCTSTR szFileName);
|
2005-09-24 23:45:05 +00:00
|
|
|
|
|
|
|
/* from text.c */
|
2018-06-29 12:59:16 +00:00
|
|
|
BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile, int *piEoln);
|
|
|
|
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, int iEoln);
|
2005-09-24 23:45:05 +00:00
|
|
|
|
2005-09-30 02:53:34 +00:00
|
|
|
/* from settings.c */
|
2015-03-14 20:00:39 +00:00
|
|
|
void NOTEPAD_LoadSettingsFromRegistry(void);
|
|
|
|
void NOTEPAD_SaveSettingsToRegistry(void);
|
2006-03-29 14:51:37 +00:00
|
|
|
|
|
|
|
/* from main.c */
|
|
|
|
BOOL NOTEPAD_FindNext(FINDREPLACE *, BOOL , BOOL );
|
2008-01-30 17:20:47 +00:00
|
|
|
VOID NOTEPAD_EnableSearchMenu(VOID);
|