Christian Grasser e38a0f2ec9 Update to scintilla 5.5.5 & Lexilla 5.4.3
Release 5.5.5 (https://www.scintilla.org/scintilla555.zip)

    Released 25 February 2025.
    Remember selection with undo and redo. Controlled with SCI_SETUNDOSELECTIONHISTORY. Feature #1273, Bug #1479, Bug #1224.
    Serialize selection type and ranges with SCI_GETSELECTIONSERIALIZED and SCI_SETSELECTIONSERIALIZED.
    For Win32, update Direct2D and DirectWrite interfaces used to 1.1 and add a lower-level approach to calling DirectWrite 1.1 by specifying SC_TECHNOLOGY_DIRECT_WRITE_1. Since Windows Vista does not support these API versions, Scintilla o longer supports DirectWrite on Windows Vista and will fall back to using GDI.
    Fix segmentation of long lexemes to avoid breaking before modifiers like accents that must be drawn with their base letters. For wrapping, try to break lines without separating letters from modifiers.
    For GTK on Windows, replace reverse arrow cursor with hand as reverse arrow was small in scaled modes. Bug #2460.
    Fix bug on Qt where double-click stopped working when Scintilla instance had been running for weeks.

Release 5.4.3 (https://www.scintilla.org/lexilla543.zip)

    Released 25 February 2025.
    C++: Fix evaluation of != in preprocessor condition. Issue #299.
    Modula-3: Allow digits in uppercase identifiers. Issue #297.
    Pascal: Fix asm style extending past end. Issue #295.
    Python: Fix detection of attributes and decorators. Issue #294, Pull request #302.
    Ruby: Implement substyles for identifiers SCE_RB_IDENTIFIER.
    Ruby: Recognize name as SCE_RB_DEFNAME in def when `::` used as well as `.`. Issue #300.

Close #16235
2025-03-12 16:09:49 +01:00

58 lines
1.5 KiB
C++

// Scintilla source code edit control
/** @file WinTypes.h
** Implement safe release of COM objects and access to functions in DLLs.
** Header contains all implementation - there is no .cxx file.
**/
// Copyright 2020-2021 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef WINTYPES_H
#define WINTYPES_H
namespace Scintilla::Internal {
// Release an IUnknown* and set to nullptr.
// While IUnknown::Release must be noexcept, it isn't marked as such so produces
// warnings which are avoided by the catch.
template <class T>
inline void ReleaseUnknown(T *&ppUnknown) noexcept {
if (ppUnknown) {
try {
ppUnknown->Release();
} catch (...) {
// Never occurs
}
ppUnknown = nullptr;
}
}
struct UnknownReleaser {
// Called by unique_ptr to destroy/free the resource
template <class T>
void operator()(T *pUnknown) noexcept {
try {
pUnknown->Release();
} catch (...) {
// IUnknown::Release must not throw, ignore if it does.
}
}
};
/// Find a function in a DLL and convert to a function pointer.
/// This avoids undefined and conditionally defined behaviour.
template<typename T>
inline T DLLFunction(HMODULE hModule, LPCSTR lpProcName) noexcept {
if (!hModule) {
return nullptr;
}
FARPROC function = ::GetProcAddress(hModule, lpProcName);
static_assert(sizeof(T) == sizeof(function));
T fp {};
memcpy(&fp, &function, sizeof(T));
return fp;
}
}
#endif