main.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Notepad (notepad.h)
  3. *
  4. * Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
  5. * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
  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. #include "notepad_res.h"
  22. #define MAX_STRING_LEN 255
  23. /* Values are indexes of the items in the Encoding combobox. */
  24. typedef enum
  25. {
  26. ENCODING_AUTO = -1,
  27. ENCODING_ANSI = 0,
  28. ENCODING_UTF16LE = 1,
  29. ENCODING_UTF16BE = 2,
  30. ENCODING_UTF8 = 3
  31. } ENCODING;
  32. #define MIN_ENCODING 0
  33. #define MAX_ENCODING 3
  34. typedef struct
  35. {
  36. HANDLE hInstance;
  37. HWND hMainWnd;
  38. HWND hFindReplaceDlg;
  39. HWND hEdit;
  40. HFONT hFont; /* Font used by the edit control */
  41. LOGFONTW lfFont;
  42. BOOL bWrapLongLines;
  43. WCHAR szFindText[MAX_PATH];
  44. WCHAR szReplaceText[MAX_PATH];
  45. WCHAR szFileName[MAX_PATH];
  46. WCHAR szFileTitle[MAX_PATH];
  47. ENCODING encFile;
  48. WCHAR szFilter[2 * MAX_STRING_LEN + 100];
  49. ENCODING encOfnCombo; /* Encoding selected in IDC_OFN_ENCCOMBO */
  50. BOOL bOfnIsOpenDialog;
  51. INT iMarginTop;
  52. INT iMarginBottom;
  53. INT iMarginLeft;
  54. INT iMarginRight;
  55. WCHAR szHeader[MAX_PATH];
  56. WCHAR szFooter[MAX_PATH];
  57. FINDREPLACEW find;
  58. FINDREPLACEW lastFind;
  59. HGLOBAL hDevMode; /* printer mode */
  60. HGLOBAL hDevNames; /* printer names */
  61. } NOTEPAD_GLOBALS;
  62. extern NOTEPAD_GLOBALS Globals;
  63. VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc);
  64. void NOTEPAD_DoFind(FINDREPLACEW *fr);
  65. DWORD get_dpi(void);