I don't see the other questions... :-)
It seems obvious, so perhaps I didn't understand the question.
Basically, Scintilla manipulates abstract things like Surface, Font, ListBox. It doesn't
really care how it is actually managed by the target system.
The PlatXxx.cxx is in charge of actually implementing these abstract concepts. That's not
really a proxy, more like a concrete implementation.
That's what will allow you to use Scintilla on your system: you have only to implement
PlatGuiChan.cxx, without changing (in theory) Scintilla code itself.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
> I have got some questions :
> - why do all the implementations i saw use a proxy to provide a new
> interface to the final widget user, is it to completely hide the
> scintilla headers and classes?
All of the internal headers should be hidden with possibly
Scintilla.h, SciLexer.h and maybe a platform specific header like
ScintillaWidget.h (GTK+ specific) visible. A platform may also decide
to create their own headers based on Scintilla.iface to meet their
internal rules.
The object used to interact with a Scintilla instance should be the
appropriate platform type to allow composition with other widgets and
manipulation with the platform API. On Windows, Scintilla is exposed
as a HWND which is the system type of all windows. On GTK+,
ScintillaObject is a subclass (using GTK+'s implementation of object
orientation in C) of GtkWidget.
Neil
The first thing to do is to type into your implementation. There
is a bunch of platform specific set up needed to create an instance
and show it on the screen before any Scintilla API should be called.
For an example on GTK+, have a look at Bait
http://www.scintilla.org/bait.zip
Neil
> 1 : After calling Init(wid) from somewhere, the Surface must represent
> the drawing surface of the given Window?
The surface is compatible with the window rather than for drawing
directly on the window. This is required by some platforms as drawing
has to use resources connected to the window or the screen the window
is on. For GTK+, the important resource is font access with different
font backends chosen in different circumstances. On WIndows, the
window ID is ignored as it is for the other 2 initialisers.
> 2 : ??? Even if from what i understood this will only beused when
> printing, i don't understant what to fo what wid and sid.
The surface ID is copied and will be drawn into. Other graphics
resources such as pens and brushes are created and managed by this
Surface. The window ID is used as in 1.
> 3 : ???
InitPixMap creates a new image object to draw into. It is
compatible with the surface ID and window ID.
Neil