Enable loading legacy and external lexers
Remove unused DynamicLibraryImpl that was previously used for loading external lexers. This is now all done by LexillaAccess.
This commit is contained in:
parent
a968b375e1
commit
a72108c657
2 changed files with 26 additions and 35 deletions
|
|
@ -3427,41 +3427,6 @@ void Menu::Show(Point pt, Window &w) {
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class DynamicLibraryImpl : public DynamicLibrary {
|
||||
public:
|
||||
explicit DynamicLibraryImpl(const char *modulePath)
|
||||
: m_dynlib(wxString::FromUTF8(modulePath), wxDL_LAZY) {
|
||||
}
|
||||
|
||||
// Use GetSymbol to get a pointer to the relevant function.
|
||||
virtual Function FindFunction(const char *name) override {
|
||||
if (m_dynlib.IsLoaded()) {
|
||||
bool status;
|
||||
void* fn_address = m_dynlib.GetSymbol(wxString::FromUTF8(name),
|
||||
&status);
|
||||
if(status)
|
||||
return fn_address;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual bool IsValid() override {
|
||||
return m_dynlib.IsLoaded();
|
||||
}
|
||||
|
||||
private:
|
||||
wxDynamicLibrary m_dynlib;
|
||||
};
|
||||
|
||||
DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
|
||||
return static_cast<DynamicLibrary *>( new DynamicLibraryImpl(modulePath) );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ColourDesired Platform::Chrome() {
|
||||
wxColour c;
|
||||
c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@
|
|||
#include "wx/stc/private.h"
|
||||
#include "PlatWX.h"
|
||||
|
||||
#include "Lexilla.h"
|
||||
#include "LexillaAccess.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "wx/msw/private.h" // GetHwndOf()
|
||||
#endif
|
||||
|
|
@ -796,6 +799,29 @@ sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam)
|
|||
return stc->wxControl::MSWWindowProc(iMessage, wParam, lParam);
|
||||
#endif
|
||||
|
||||
case SCI_SETLEXER:
|
||||
{
|
||||
int lexLanguage = static_cast<int>(wParam);
|
||||
const char* name = LexerNameFromID(lexLanguage);
|
||||
ILexer5* pLexer = name ? CreateLexer(name) : nullptr;
|
||||
stc->SetILexer(pLexer);
|
||||
break;
|
||||
}
|
||||
|
||||
case SCI_SETLEXERLANGUAGE:
|
||||
{
|
||||
const char* name = ConstCharPtrFromSPtr(lParam);
|
||||
ILexer5* pLexer = name ? CreateLexer(name) : nullptr;
|
||||
stc->SetILexer(pLexer);
|
||||
break;
|
||||
}
|
||||
|
||||
case SCI_LOADLEXERLIBRARY:
|
||||
{
|
||||
Lexilla::Load(ConstCharPtrFromSPtr(lParam));
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return ScintillaBase::WndProc(iMessage, wParam, lParam);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue