Discussion:
How retrieve DirectPointer? especially in Linux
Andrzej Borucki
2013-09-27 07:26:32 UTC
Permalink
I am programming now under Windows, but want write portable software.
First way of calling Scintilla functions is SendMessage (works only with
Windows?)
In Pascal it will:
Result := Windows.SendMessage(Self.Handle, AMessage, WParam, LParam)
second way (only way in non Wndows?) is using DirectFunction and
DirectPointer:
Result := FDirectFunction(FDirectPointer, AMessage, WParam, LParam);
In DScintilla project in Delhpi is :

procedure TDScintillaCustom.WMCreate(var AMessage: TWMCreate);
begin
inherited;
FDirectFunction := TDScintillaFunction(Windows.SendMessage(
WindowHandle, SCI_GETDIRECTFUNCTION, 0, 0));
FDirectPointer := Pointer(Windows.SendMessage(
WindowHandle, SCI_GETDIRECTPOINTER, 0, 0));
end;

retrieve function and pointer by SendMessage. But in Linux how to do?
Scintilla.dll has two entries:
Scintilla_DirectFunction
***@16
in .so probably will be the same
I can get function by GetProcAddress but can't get address of pointer.
How program Scintilla in Linux?
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Colomban Wendling
2013-09-27 09:13:39 UTC
Permalink
Post by Andrzej Borucki
I am programming now under Windows, but want write portable software.
First way of calling Scintilla functions is SendMessage (works only with
Windows?)
[...]
retrieve function and pointer by SendMessage. But in Linux how to do?
Scintilla_DirectFunction
in .so probably will be the same
I can get function by GetProcAddress but can't get address of pointer.
How program Scintilla in Linux?
You use the backend-specific function, which for the GTK+ backend is
scintilla_send_message() (found in ScintillaWidget.h).

http://www.scintilla.org/ScintillaDoc.html#GTK

and you can still use DirectFunction if you wish, though it has no
advantage (but maybe using more similar code on different platforms if
you use different backends on different platforms):

http://www.scintilla.org/ScintillaDoc.html#DirectAccess


Regards,
Colomban
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Andrzej Borucki
2013-09-27 12:24:37 UTC
Permalink
Thanks,
I need some lib for GTK+?
In ScintillaGTK.cxx is body of: scintilla_send_message()
sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage,
uptr_t wParam, sptr_t lParam) {
ScintillaGTK *psci = reinterpret_cast<ScintillaGTK *>(sci->pscin);
return psci->WndProc(iMessage, wParam, lParam);
}
Is possible to use it with FreePascal or I must write C++ wrapper .so ?

W dniu pi±tek, 27 wrze¶nia 2013 11:13:39 UTC+2 u¿ytkownik Colomban Wendling
Post by Colomban Wendling
You use the backend-specific function, which for the GTK+ backend is
scintilla_send_message() (found in ScintillaWidget.h).
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-27 22:03:58 UTC
Permalink
Post by Andrzej Borucki
I need some lib for GTK+?
On Linux, you will need to choose a GUI toolkit. Since you want to use Free Pascal, it should be one that supports that language well. Scintilla has bindings for (at least) GTK+, Qt, wxWidgets, Tk, and Fox. The GUI toolkit will have a major effect on development so choose carefully.
Post by Andrzej Borucki
Is possible to use it with FreePascal or I must write C++ wrapper .so ?
Scintilla's API is designed to be used from C so that calling code does not have to be written in C++. Its likely that Free Pascal can call C functions well enough to use the 4 functions exposed by the Scintilla GTK+ library. Scintilla is normally built for GTK+ as a static library (scintilla.a) instead of a shared library.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...