From ace28857b70d8a8fe97cdf29f937614eb13de781 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 17 May 2016 22:11:17 +0200 Subject: Enable g-ir-scanner to scan ScintillaObject signals Currently, the ScintillaObject signals can't be used from python code via gobject-introspection. This is because g-ir-scanner does not properly scan the signals. For signals, there is the additional requirement that parameters have are registered GTypes. For the sci-notify signal, this can be accomplished by boxing SCNotification. In addition, g-ir-scanner also runs on Scintilla.h where it picks up additional structs. test/gi/ is updated accordingly. The test python script is enhanced to showcase the signals (some fixes to the makefile are included as well). --- include/Scintilla.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/Scintilla.h') diff --git a/include/Scintilla.h b/include/Scintilla.h index c985cea77..99bc6e7b1 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -1121,6 +1121,13 @@ struct Sci_RangeToFormat { #define RangeToFormat Sci_RangeToFormat +#ifndef __cplusplus +/* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This + * is not required in C++ code and actually seems to break ScintillaEditPy */ +typedef struct Sci_NotifyHeader Sci_NotifyHeader; +typedef struct SCNotification SCNotification; +#endif + struct Sci_NotifyHeader { /* Compatible with Windows NMHDR. * hwndFrom is really an environment specific window handle or pointer @@ -1133,7 +1140,7 @@ struct Sci_NotifyHeader { #define NotifyHeader Sci_NotifyHeader struct SCNotification { - struct Sci_NotifyHeader nmhdr; + Sci_NotifyHeader nmhdr; Sci_Position position; /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ -- cgit v1.2.3