/usr/share/scite/SciTEDirector.html is in scite 3.7.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | <?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
SciTE Director Interface
</title>
<style type="text/css">
table {
border: 1px solid black;
border-collapse: collapse;
}
td {
border: 1px solid black;
padding: 1px 5px 1px 5px;
}
.S0 {
color: #808080;
}
.S1 {
font-family: Comic Sans MS;
color: #007F00;
font-size: 9pt;
}
.S2 {
font-family: Comic Sans MS;
color: #007F00;
font-size: 9pt;
}
.S3 {
font-family: Comic Sans MS;
color: #3F703F;
font-size: 9pt;
}
.S4 {
color: #007F7F;
}
.S5 {
font-weight: bold;
color: #00007F;
}
.S6 {
color: #7F007F;
}
.S7 {
color: #7F007F;
}
.S8 {
color: #804080;
}
.S9 {
color: #7F7F00;
}
.S10 {
font-weight: bold;
color: #000000;
}
.S12 {
font-family: Courier New;
color: #000000;
background: #E0C0E0;
font-size: 10pt;
}
.S13 {
font-family: Courier New;
color: #007F00;
background: #E0FFE0;
font-size: 10pt;
}
.S14 {
font-family: Courier New;
color: #3F7F3F;
background: #E0F0FF;
font-size: 10pt;
}
.S15 {
font-family: Comic Sans MS;
color: #3F703F;
font-size: 9pt;
}
SPAN {
font-family: Verdana;
font-size: 10pt;
}
.example {
color: #00A000;
font-weight: bold;
}
DIV.example {
background: #F7FCF7;
border: 1px solid #C0D7C0;
margin: 0.3em 3em;
padding: 0.3em 0.6em;
font-size: 80%;
}
DIV.highlighted {
background: #F7FCF7;
border: 1px solid #C0D7C0;
margin: 0.3em 3em;
padding: 0.3em 0.6em;
font-size: 80%;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
SciTE Director Interface</font></a>
</td>
</tr>
</table>
<h3>
Purpose.
</h3>
<p>Software development does not occur only at the single file level handled by SciTE.
A developer will generally work on a group of related files together in the context of one
project. Project manager functionality could be added to SciTE as it has to other editors
but this would impose a particular view of how projects are to be managed including the
format of project files. Instead, SciTE has an interface that can be used by project
managers or similar applications to control SciTE. Any application that controls SciTE is
referred to as a "Director".</p>
<p>The current Director interface only works on Windows. In the future, it should be
possible to replace the low level interface and so make this interface available on other
platforms.</p>
<p>There is currently one director application,
<a href="http://llt.chez-alice.fr/">Filerx</a>, available.</p>
<p>This interface is implemented on top of the
<a href="SciTEExtension.html">SciTE Extension Interface</a>, in the
file scite\win32\DirectorExtension.cxx.</p>
<h3>
Direct connection, broadcasting and explicit return addresses.
</h3>
<p>One application at a time is <i>the director</i> of SciTE,
controlling SciTE as it wishes. To support other communications techniques
applications may broadcast to all active director interfaces. When doing so,
each message should contain an explicit return address where replies to the
broadcast message will be sent.
</p>
<h3>
Low level interface on Windows.
</h3>
<p>The Windows WM_COPYDATA message is used to transfer data between
SciTE and a Director. The messages are sent between windows created by the two
applications. SciTE uses a window that has no other purpose than to receive these
messages.
The lpData and cbData fields of the COPYDATASTRUCT
are used to transfer a string between the two processes, with cbData holding the length
of the string pointed to by lpData. The string does not have to be terminated with '\0'.
The dwData should be 0.</p>
<p>Before messages can be sent from one application to the other, the window handle
of the window to receive the message must be found. This is normally transferred when
starting the other application as a command line parameter. Either application may
start the other. SciTE makes its window handle available in the WindowID
property and accepts a director.hwnd property as the window handle to which it
sends data.</p>
<p>As an example of communicating the window handle, to install Filerx in the Tools
menu of SciTE these properties could be used:</p>
<div class="example">
command.name.0.*=Project Editor<br/>
command.0.*="C:\os\scite\bin\filerx.exe" "$(FileDir)" "$(WindowID)"<br/>
command.subsystem.0.*=2
</div>
<p>In the opposite direction, Filerx can start up SciTE with a command line that
specifies its window handle as well as the file it wants edited:</p>
<div class="example">
SciTE -director.hwnd=937846 c:\os\scite\src\SciTEBase.cxx
</div>
<p>Once one application has the window handle of the other application, it should send
its window handle to the other application using an identity message as described later.
Then both sides are able to send messages.</p>
<p>To broadcast a message on Windows, the set of active director
interfaces can be found by broadcasting the "SciTEDirectorInterface"
message and seeing which windows reply with the same value as that message.
Example broadcast code:</p>
<div class="highlighted">
<SPAN class=S0></SPAN><SPAN class=S5>unsigned</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>RegisterWindowMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S0></SPAN><SPAN class=S6>"SciTEDirectorInterface"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S11>HWND</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>w</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetWindow</SPAN><SPAN class=S10>(::</SPAN><SPAN class=S11>GetDesktopWindow</SPAN><SPAN class=S10>(),</SPAN><SPAN class=S0></SPAN><SPAN class=S11>GW_CHILD</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>while</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S11>DWORD</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>res</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S2>// Need time out to avoid hung applications</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>SendMessageTimeout</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S11>SMTO_NORMAL</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>1000</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>&</SPAN><SPAN class=S11>res</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>res</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>==</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>static_cast</SPAN><SPAN class=S10><</SPAN><SPAN class=S11>DWORD</SPAN><SPAN class=S10>>(</SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>))</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S2>// Replied with same SDI code so should</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S2>// understand SDI's version of WM_COPYDATA</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>SendMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S11>WM_COPYDATA</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>UINT</SPAN><SPAN class=S10>)</SPAN><SPAN class=S11>m_hWnd</SPAN><SPAN class=S10>,(</SPAN><SPAN class=S5>long</SPAN><SPAN class=S10>)&</SPAN><SPAN class=S11>cds</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S11>w</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetWindow</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>GW_HWNDNEXT</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN>
</div>
<p>To advertise that a top level window supports the Director interface:</p>
<div class="highlighted">
<SPAN class=S0></SPAN><SPAN class=S11>LRESULT</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>PASCAL</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>DirectorExtension_WndProc</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>HWND</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>hWnd</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> <BR>
</SPAN><SPAN class=S11>UINT</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>WPARAM</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>wParam</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>LPARAM</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>lParam</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>unsigned</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>RegisterWindowMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S6>"SciTEDirectorInterface"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>==</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>DefWindowProc</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>hWnd</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>wParam</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0></SPAN><SPAN class=S11>lParam</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN><BR>
</div>
<h3>
Low level interface on GTK+.
</h3>
<p>This is not yet implemented.
The proposed design uses an input fifo for each application supporting the director
interface located in /tmp with a name using a pattern such as
"/tmp/SciTE<PID>.director".
This allows enumerating all active director interfaces and also opening
a specific interface when the fifo name has been communicated through some
other means such as a command line argument or an identity: command.</p>
<h3>
High level interface.
</h3>
<p>Messages use C style escapes to represent control characters and
ensure that only visible characters are transmitted apart from the use
of '\n' to separate messages.</p>
<p>The string transmitted by the low level interface contains an optional
return address surrounded by ':' characters, an action, a ':' character and
an optional argument. The argument is often a file path. The ':' must be present even if there
is no argument. For example, SciTE understands the message</p>
<div class="example">
open:c:\\os\\scintilla\\include\\Scintilla.iface
</div>
<p>as a command to open the file "c:\os\scintilla\include\Scintilla.iface" just as if the user
had performed this operation.</p>
<p>If the first character of the message is a ':' then up to the next ':' is a return
address, so SciTE will reply to the message</p>
<div class="example">
:73658:askfilename:
</div>
<p>by sending the filename being edited to the return address 73658
rather than to its director.</p>
<h4>The actions understood by SciTE are:</h4>
<table border="1">
<tr>
<td>askfilename:</td>
<td>Return the name of the file being edited.</td>
</tr>
<tr>
<td>askproperty:<key></td>
<td>Return the value of a property.</td>
</tr>
<tr>
<td>close:</td>
<td>Close the current file.</td>
</tr>
<tr>
<td>closing:</td>
<td>Director is closing - SciTE closes if it was started by the director.</td>
</tr>
<tr>
<td>currentmacro:<string></td>
<td>Set the current macro to name.</td>
</tr>
<tr>
<td>cwd:</td>
<td>Change the working directory.</td>
</tr>
<tr>
<td>enumproperties:dyn|local|user|base|embed</td>
<td>Enumerate all the properties in the argument set.</td>
</tr>
<tr>
<td>exportashtml:<path></td>
<td>Save the document in HTML format as the indicated file.</td>
</tr>
<tr>
<td>exportasrtf:<path></td>
<td>Save the document in RTF format as the indicated file.</td>
</tr>
<tr>
<td>exportaspdf:<path></td>
<td>Save the document in PDF format as the indicated file.</td>
</tr>
<tr>
<td>exportaslatex:<path></td>
<td>Save the document in LaTeX format as the indicated file.</td>
</tr>
<tr>
<td>exportasxml:<path></td>
<td>Save the document in XML format as the indicated file.</td>
</tr>
<tr>
<td>extender:<command></td>
<td>Call the extension interface with the given command.</td>
</tr>
<tr>
<td>find:<string></td>
<td>Search for a string, select and show it.</td>
</tr>
<tr>
<td>focus:<timeStamp></td>
<td>On GTK+ bring this SciTE window to the front.
The timeStamp is from the window manager and ensures that windows are only
activated because of a user command.
Has no effect on Windows as applications on Windows can only donate focus, not take focus.</td>
</tr>
<tr>
<td>goto:<lineNumber>[,<columnNumber>]</td>
<td>Move caret to a particular line and make it visible.<br>
If there is a column number then select the word at that column number
or move the caret there if no word is present.</td>
</tr>
<tr>
<td>identity:<hwndDirector></td>
<td>Sets the director window handle to which SciTE sends messages.
The argument is in decimal.</td>
</tr>
<tr>
<td>insert:<value></td>
<td>Display the value in the editor pane replacing the selection.</td>
</tr>
<tr>
<td>loadsession:<path></td>
<td>Load a session as given by the indicated file.</td>
</tr>
<tr>
<td>macrocommand:<command></td>
<td>Execute a macro command.
See the SciTE source code for the syntax of the
command argument.</td>
</tr>
<tr>
<td>macroenable:<enable></td>
<td>If enable, display menu commands in SciTE for recording
and playing macros.</td>
</tr>
<tr>
<td>macrolist:<list></td>
<td>Display a list for the user to choose from.</td>
</tr>
<tr>
<td>menucommand:<cmd></td>
<td>Execute a menu command based on numeric ID.</td>
</tr>
<tr>
<td>open:<path></td>
<td>Open the indicated file.</td>
</tr>
<tr>
<td>output:<value></td>
<td>Display the value in the output pane replacing the selection.</td>
</tr>
<tr>
<td>property:<key>=<value></td>
<td>Set a property to a value.</td>
</tr>
<tr>
<td>quit:</td>
<td>Shut down SciTE.</td>
</tr>
<tr>
<td>reloadproperties:</td>
<td>Reload properties from files.</td>
</tr>
<tr>
<td>replaceall:<search>\000<replace></td>
<td>Replace all instances of the search string in the
document with the replace string.</td>
</tr>
<tr>
<td>saveas:<path></td>
<td>Save the document as the indicated file.</td>
</tr>
<tr>
<td>savesession:<path></td>
<td>Save a session as given by the indicated file.</td>
</tr>
</table>
<h4>The actions sent by SciTE are:</h4>
<table border="1">
<tr>
<td>closed:<path></td>
<td>SciTE has closed the indicated file.</td>
</tr>
<tr>
<td>closing:</td>
<td>SciTE is closing.</td>
</tr>
<tr>
<td>dyn|local|user|base|embed:<key>=<value></td>
<td>Set a property in a set to a value.</td>
</tr>
<tr>
<td>filename:<path></td>
<td>The file being edited is path.
This is the reply to the askfilename: command.</td>
</tr>
<tr>
<td>identity:<hwndSciTEReceiving></td>
<td>SciTE indicates to the director the window handle to which it should send
messages. The argument is in decimal.</td>
</tr>
<tr>
<td>macro:getlist</td>
<td>Retrieve the list of available macros which will be
returned by the macrolist command.</td>
</tr>
<tr>
<td>macro:record:<details></td>
<td>Start recording a macro.
See the SciTE source code for the syntax of the
details argument.</td>
</tr>
<tr>
<td>macro:run:<macroName></td>
<td>Run the named macro.</td>
</tr>
<tr>
<td>macro:stoprecord</td>
<td>Stop recording a macro.</td>
</tr>
<tr>
<td>opened:<path></td>
<td>SciTE has opened the indicated file.</td>
</tr>
<tr>
<td>switched:<path></td>
<td>SciTE has switched buffers to the indicated file.</td>
</tr>
<tr>
<td>saved:<path></td>
<td>SciTE has saved the indicated file.</td>
</tr>
</table>
<p>In the future, more actions will be defined. Applications should ignore any
actions that they do not understand.</p>
</body>
</html>
|