How rizonesoft/notepad3 works
Project type and purpose
• Notepad3 is a native Windows desktop text editor built in C/C++, leveraging the Scintilla editing component for syntax highlighting.
• It integrates multiple third-party libraries (Oniguruma for regex, UCHARDET for encoding detection, TinyExpr for inline math), plugins (minipath file browser, grepWinNP3 search tool), and supports localization via language DLLs.
File structure for components
Top-level modules:
• src/ : Core Notepad3 application code (UI, menu, file I/O, settings)
• scintilla/ : Scintilla editing engine (document model, rendering, lexing APIs)
• lexilla/ : High-level lexer library supplying language lexers to Scintilla
• src/crypto, src/uthash, src/uchardet, src/tinyexpr* : Native static libraries for encryption, hash tables, encoding detection, expression evaluation
• grepWinNP3/ : Standalone search/replace utility invoked externally
• minipath/ : File-browser plugin launched from Notepad3
• language/ & grepWinNP3/sktoolslib_mod/ : Localization and shared UI helper code
• np3encrypt/ : Command-line encryption tool for batch file processing
• np3portableapp/ : PortableApps wrapper packaging Notepad3 and its plugins
Behaviors and interactions described in the README
• Notepad3.exe launches, loads settings (Notepad3.ini), initializes Scintilla control, registers lexers via Lexilla/Scintilla APIs.
• On file open, it uses encoding detection (UCHARDET, SimpleIni config) and optional AES-256 crypto.
• Search in files spawns grepWinNP3.exe; Browse spawns minipath.exe.
• Language DLLs are loaded on demand for UI strings.
• Settings and UI actions map to core editing operations or external tool invocations.
Components and relationships
A. Main Application Layer (Notepad3.exe)
• UI Layer: Win32 dialogs, menus, toolbars (src/*.c, *.cpp UI files)
• Core Controller: handles commands, settings, file I/O
• Scintilla Control: embedded editing component
B. Editor Engine & Lexers
• Scintilla Core (scintilla/src*, win32)
• Lexilla library for lexers (lexilla/include, lexers)
C. Services and Helpers
• Encoding Detection Service: UCHARDET (src/uchardet)
• Regex Engine: Oniguruma (Build/Docs/crypto/oniguruma)
• Crypto Module: Rijndael AES (src/crypto) & external np3encrypt
• Expression Evaluator: TinyExpr / TinyExprCPP (src/tinyexpr*)
• Hashing/Data Structures: UTHash (src/uthash)
D. External Tools & Plugins
• grepWinNP3.exe (grepWinNP3/) invoked for “Search in Files”
• minipath.exe (minipath/) invoked for “Browse”
• PortableApps wrapper (np3portableapp/)
E. Localization
• Language DLLs (language/np3_XX_XX/*.vcxproj) loaded for UI strings
F. Configuration & Resources
• Notepad3.ini (settings file)
• Themes (Build/Themes, themes/)
Architectural patterns and design principles
• Layered modular architecture: UI → Controller → Engine → Services
• Dependency injection of lexers and services via static linking
• Externalization of heavy tasks (search, file browsing) into separate executables
• Localization via DLLs for language switching at runtime
• Plugins and wrappers decoupled from core via command-line interfaces
Essential elements
• Arrowheads showing data flow and invocation direction
• Notes on protocols (Win32 APIs, command-line arguments)