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
|
|
|
|
|
2007-10-09 08:53:25 +00:00
|
|
|
#define SIZEOF(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
|
|
|
|
|
2005-09-12 17:10:00 +00:00
|
|
|
#define ENCODING_ANSI 0
|
|
|
|
#define ENCODING_UNICODE 1
|
|
|
|
#define ENCODING_UNICODE_BE 2
|
|
|
|
#define ENCODING_UTF8 3
|
|
|
|
|
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
|
|
|
|
{
|
2006-12-22 21:49:18 +00:00
|
|
|
HINSTANCE hInstance;
|
|
|
|
HWND hMainWnd;
|
|
|
|
HWND hFindReplaceDlg;
|
|
|
|
HWND hEdit;
|
|
|
|
HWND hStatusBar;
|
|
|
|
HFONT hFont; /* Font used by the edit control */
|
2010-10-06 22:11:12 +00:00
|
|
|
HMENU hMenu;
|
2006-12-22 21:49:18 +00:00
|
|
|
LOGFONT lfFont;
|
|
|
|
BOOL bWrapLongLines;
|
|
|
|
BOOL bShowStatusBar;
|
2007-10-09 08:53:25 +00:00
|
|
|
TCHAR szFindText[MAX_PATH];
|
|
|
|
TCHAR szReplaceText[MAX_PATH];
|
|
|
|
TCHAR szFileName[MAX_PATH];
|
|
|
|
TCHAR szFileTitle[MAX_PATH];
|
|
|
|
TCHAR szFilter[2 * MAX_STRING_LEN + 100];
|
|
|
|
TCHAR szMarginTop[MAX_PATH];
|
|
|
|
TCHAR szMarginBottom[MAX_PATH];
|
|
|
|
TCHAR szMarginLeft[MAX_PATH];
|
|
|
|
TCHAR szMarginRight[MAX_PATH];
|
|
|
|
TCHAR szHeader[MAX_PATH];
|
|
|
|
TCHAR szFooter[MAX_PATH];
|
2008-11-03 21:23:57 +00:00
|
|
|
TCHAR szStatusBarLineCol[MAX_PATH];
|
2006-12-22 21:49:18 +00:00
|
|
|
int iEncoding;
|
|
|
|
int iEoln;
|
2004-12-15 05:07:53 +00:00
|
|
|
|
|
|
|
FINDREPLACE find;
|
2008-01-30 08:49:48 +00:00
|
|
|
WNDPROC EditProc;
|
2008-01-30 09:25:54 +00:00
|
|
|
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 */
|
|
|
|
BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding, int *piEoln);
|
|
|
|
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, int iEncoding, int iEoln);
|
|
|
|
|
2005-09-30 02:53:34 +00:00
|
|
|
/* from settings.c */
|
|
|
|
void LoadSettings(void);
|
|
|
|
void SaveSettings(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);
|