diff options
Diffstat (limited to 'gtk')
| -rw-r--r-- | gtk/PlatGTK.cxx | 36 | ||||
| -rw-r--r-- | gtk/ScintillaGTK.cxx | 4 | ||||
| -rw-r--r-- | gtk/deps.mak | 4 | ||||
| -rw-r--r-- | gtk/makefile | 2 | ||||
| -rw-r--r-- | gtk/scintilla.mak | 4 | 
5 files changed, 47 insertions, 3 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index aa0fb3659..d0778c707 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -9,6 +9,7 @@  #include <stddef.h>  #include <glib.h> +#include <gmodule.h>  #include <gdk/gdk.h>  #include <gtk/gtk.h>  #include <gdk/gdkkeysyms.h> @@ -1918,6 +1919,41 @@ ElapsedTime::ElapsedTime() {  	littleBit = curTime.tv_usec;  } +class DynamicLibraryImpl : public DynamicLibrary { +protected: +	GModule* m; +public: +	DynamicLibraryImpl(const char *modulePath) { +		m = g_module_open(modulePath, G_MODULE_BIND_LAZY); +	} + +	virtual ~DynamicLibraryImpl() { +		if (m != NULL) +			g_module_close(m); +	} + +	// Use g_module_symbol to get a pointer to the relevant function. +	virtual Function *FindFunction(const char *name) { +		if (m != NULL) { +			gpointer fn_address = NULL; +			gboolean status = g_module_symbol(m, name, &fn_address); +			if (status) +				return static_cast<Function*>( fn_address ); +			else +				return NULL; +		} else +			return NULL; +	} + +	virtual bool IsValid() { +		return m != NULL; +	} +}; + +DynamicLibrary *DynamicLibrary::Load(const char *modulePath) { +	return static_cast<DynamicLibrary *>( new DynamicLibraryImpl(modulePath) ); +} +  double ElapsedTime::Duration(bool reset) {  	GTimeVal curTime;  	g_get_current_time(&curTime); diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 7029383a9..d3753b5d2 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -49,7 +49,7 @@  #ifdef SCI_LEXER  #include <glib.h>  #include <gmodule.h> -//#include "ExternalLexer.h" +#include "ExternalLexer.h"  #endif  #if GTK_MAJOR_VERSION < 2 @@ -619,7 +619,7 @@ sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  #ifdef SCI_LEXER  	case SCI_LOADLEXERLIBRARY: -		//LexerManager::GetInstance()->Load(reinterpret_cast<const char*>( wParam )); +		LexerManager::GetInstance()->Load(reinterpret_cast<const char*>( wParam ));  		break;  #endif diff --git a/gtk/deps.mak b/gtk/deps.mak index 8590dd758..1fe47ca31 100644 --- a/gtk/deps.mak +++ b/gtk/deps.mak @@ -27,6 +27,10 @@ Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/Scintilla.h \    ../src/ContractionState.h ../src/SVector.h ../src/CellBuffer.h \
    ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
    ../src/Style.h ../src/ViewStyle.h ../src/Document.h ../src/Editor.h
 +ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \
 + ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
 + ../include/Accessor.h ../src/DocumentAccessor.h ../src/Keywords.h \
 + ../src/ExternalLexer.h
  Indicator.o: ../src/Indicator.cxx ../include/Platform.h \
    ../include/Scintilla.h ../src/Indicator.h
  KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
 diff --git a/gtk/makefile b/gtk/makefile index 2cd2d5262..b8d00556b 100644 --- a/gtk/makefile +++ b/gtk/makefile @@ -65,7 +65,7 @@ deps:  	$(CC) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak  $(COMPLIB): DocumentAccessor.o WindowAccessor.o KeyWords.o StyleContext.o Document.o CallTip.o \ -	ScintillaBase.o ContractionState.o Editor.o PropSet.o PlatGTK.o \ +	ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSet.o PlatGTK.o \  	KeyMap.o LineMarker.o ScintillaGTK.o CellBuffer.o ViewStyle.o \  	RESearch.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o  	$(AR) rc $@ $^ diff --git a/gtk/scintilla.mak b/gtk/scintilla.mak index 33e454c0c..81a01bfd7 100644 --- a/gtk/scintilla.mak +++ b/gtk/scintilla.mak @@ -103,6 +103,7 @@ SOBJS=\  	$(DIR_O)\ContractionState.obj \  	$(DIR_O)\Document.obj \  	$(DIR_O)\Editor.obj \ +	$(DIR_O)\ExternalLexer.obj \  	$(DIR_O)\Indicator.obj \  	$(DIR_O)\KeyMap.obj \  	$(DIR_O)\LineMarker.obj \ @@ -241,6 +242,9 @@ $(DIR_O)\Editor.obj: ..\src\Editor.cxx ..\include\Platform.h ..\include\Scintill   ..\src\CellBuffer.h ..\src\KeyMap.h ..\src\Indicator.h ..\src\LineMarker.h ..\src\Style.h ..\src\ViewStyle.h \   ..\src\Document.h ..\src\Editor.h +$(DIR_O)\ExternalLexer.obj: ..\src\ExternalLexer.cxx ..\include\Platform.h ..\include\Scintilla.h ..\include\SciLexer.h \ + ..\include\PropSet.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\src\Keywords.h ..\src\ExternalLexer.h +  $(DIR_O)\Indicator.obj: ..\src\Indicator.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\Indicator.h  $(DIR_O)\KeyMap.obj: ..\src\KeyMap.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\KeyMap.h  | 
