DirectorExtension

24 views
Skip to first unread message

Bo

unread,
Feb 23, 2009, 2:20:34 PM2/23/09
to scite-interest
HI, guys
I would like to know how can I use the DiretorExtension on linux,
in the tar.gz file there are 2 files : DirectorExtension.cxx and
DirectorExtension.h
need i re-compile my SciTE with these 2 files? any properties to
modify to make this extension working?

and for my director client, how can i send request to scite?
any anwser will be helpful, thinks

Bo

unread,
Feb 23, 2009, 2:20:34 PM2/23/09
to scite-interest

Bo

unread,
Feb 23, 2009, 4:53:55 PM2/23/09
to scite-interest
an other question :
how to get the pid number of scite,
i tried $(current.pid), and it doesnt work

Nicolas Chachereau

unread,
Feb 24, 2009, 8:28:04 AM2/24/09
to scite-i...@googlegroups.com
Hi Bo!

You wrote:
> I would like to know how can I use the DiretorExtension on linux,
> in the tar.gz file there are 2 files : DirectorExtension.cxx and
> DirectorExtension.h
> need i re-compile my SciTE with these 2 files? any properties to
> modify to make this extension working?

You don't need the .tar.gz at all, nor to recompile anything, since
the patch has been committed to SciTE's main branch. Just make sure
that you're using the latest version.

> and for my director client, how can i send request to scite?

The documentation for the Director interface for SciTE's GTK+ version
is lacking, that's for sure. I'll try to explain here. I'll also try
to write the documentation in the next few days.

The communication between SciTE and your program goes in two ways:
1) Your program can send messages to SciTE to ask it to do something
(e.g. open a file). For that you write your command to a pipe (FIFO)
that is in /tmp. Let's call it the "input pipe".
2) Your program can receive messages from SciTE notifying something
(e.g. closing). For that you read from another pipe in /tmp. Let's
call it "output pipe".

Use cases:
a) Your program can start a SciTE instance it wants to control and
specify the pipes. If you want to receive messages from SciTE, you
need to create the output pipe. Then launch SciTE like that:
SciTE -ipc.scite.name=/tmp/in -ipc.director.name=/tmp/out
Where: ipc.scite.name is the filename of the input pipe,
ipc.director.name that of the output pipe.
SciTE takes care of creating the input pipe. You need to create the
other one if you want to use it.

b) You want to start your program from SciTE, and you want it to use
the instance it was launched from. Simply use the property
$(ipc.scite.name). So regarding your other question: you don't need
SciTE's pid, use ipc.scite.name. So you could add a command to your
menu like: command.25.*=myprogram $(ipc.scite.name). It is then your
program's job to use that argument from the command line and to send
messages to the pipe.
If you want to receive notifications from SciTE: your program needs to
create a temporary file, say "x.238" then send the following to the
input pipe:
:x.238:register:
Then wait until SciTE has created the output pipe and written its name
to your temporary file. Either simply sleep for a little time, or
(more robust) poll the file until the name has been written. Of course
you should choose some robust way of creating your temp file as well
(e.g. using something like mktemp).

c) You want your program to use an existing SciTE's instance, but
don't really care which one. Simply look for /tmp/SciTE.*.in and start
writing messages to one of those files. If you want to have an output
pipe, just register it like above, using a temporary file.

Basically, that's it. There are some other possibilities, and I'm not
sure if I was clear enough. Please tell me if that helped you, so I
have a clue how to write the documentation. Ask if you have any other
question. I could send an example shell script if you want (or I might
already have sent it to the mailing list, I need to look for it).

Regards,
Nicolas

Bo

unread,
Feb 24, 2009, 1:41:02 PM2/24/09
to scite-interest
hi Nicolas,
this is really what i've been looking for,
it helps a lot,
think you!!! XD


On 2月24日, 下午2时28分, Nicolas Chachereau <nicolas.chacher...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages