/*1* Notepad (notepad.h)2*3* Copyright 1997,98 Marcel Baur <[email protected]>4* Copyright 2002 Sylvain Petreolle <[email protected]>5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA19*/2021#include "notepad_res.h"2223#define MAX_STRING_LEN 2552425/* Values are indexes of the items in the Encoding combobox. */26typedef enum27{28ENCODING_AUTO = -1,29ENCODING_ANSI = 0,30ENCODING_UTF16LE = 1,31ENCODING_UTF16BE = 2,32ENCODING_UTF8 = 333} ENCODING;3435#define MIN_ENCODING 036#define MAX_ENCODING 33738typedef struct39{40HANDLE hInstance;41HWND hMainWnd;42HWND hFindReplaceDlg;43HWND hEdit;44HFONT hFont; /* Font used by the edit control */45HWND hStatusBar;46BOOL bStatusBar;47WCHAR* szStatusString;48LOGFONTW lfFont;49BOOL bWrapLongLines;50WCHAR szFindText[MAX_PATH];51WCHAR szReplaceText[MAX_PATH];52WCHAR szFileName[MAX_PATH];53WCHAR szFileTitle[MAX_PATH];54ENCODING encFile;55WCHAR szFilter[2 * MAX_STRING_LEN + 100];56ENCODING encOfnCombo; /* Encoding selected in IDC_OFN_ENCCOMBO */57BOOL bOfnIsOpenDialog;58INT iMarginTop;59INT iMarginBottom;60INT iMarginLeft;61INT iMarginRight;62WCHAR szHeader[MAX_PATH];63WCHAR szFooter[MAX_PATH];64INT trackedSel;65INT lastLn;66INT lastCol;6768FINDREPLACEW find;69FINDREPLACEW lastFind;70HGLOBAL hDevMode; /* printer mode */71HGLOBAL hDevNames; /* printer names */72} NOTEPAD_GLOBALS;7374extern NOTEPAD_GLOBALS Globals;7576VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc);77void NOTEPAD_DoFind(FINDREPLACEW *fr);78void UpdateStatusBar(void);79void updateWindowSize(int width, int height);80LRESULT CALLBACK EDIT_CallBackProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);818283