1994689c1Smrg<sect1 id="TextSrc_Object">
2994689c1Smrg<title>TextSrc Object</title>
3994689c1Smrg<literallayout class="monospaced">
4994689c1SmrgApplication Header file &lt;X11/Xaw/TextSrc.h&gt;
5994689c1SmrgClass Header file       &lt;X11/Xaw/TextSrcP.h&gt;
6994689c1SmrgClass                   textSrcObjectClass
7994689c1SmrgClass Name              TextSrc
8994689c1SmrgSuperclass              Object
9994689c1Smrg</literallayout>
10994689c1Smrg
11994689c1Smrg<para>
12994689c1Smrg<!-- .LP -->
13994689c1SmrgThe TextSrc object is the root object for all text sources.  Any new text
14994689c1Smrgsource objects should be subclasses of the TextSrc Object.  The
15994689c1SmrgTextSrc Class contains all methods the Text widget expects a text
16994689c1Smrgsource to export.
17994689c1Smrg</para>
18994689c1Smrg
19994689c1Smrg<para>
20994689c1Smrg<!-- .LP -->
21994689c1SmrgSince all text sources will have some resources in common the
22994689c1SmrgTextSrc defines a few new resources.
23994689c1Smrg</para>
24994689c1Smrg
25421c997bSmrg<sect2 id='TextSource::Resources'>
26994689c1Smrg<title>Resources</title>
27994689c1Smrg<para>
28994689c1SmrgWhen creating an TextSrc object instance, the following resources are
29994689c1Smrgretrieved from the argument list or from the resource database:
30994689c1Smrg</para>
31994689c1Smrg
32994689c1Smrg<informaltable>
33994689c1Smrg  <tgroup cols='5' align='center'>
34994689c1Smrg  <colspec colname='c1'/>
35994689c1Smrg  <colspec colname='c2'/>
36994689c1Smrg  <colspec colname='c3'/>
37994689c1Smrg  <colspec colname='c4'/>
38994689c1Smrg  <colspec colname='c5'/>
39994689c1Smrg  <thead>
40994689c1Smrg    <row>
41994689c1Smrg      <entry>Name</entry>
42994689c1Smrg      <entry>Class</entry>
43994689c1Smrg      <entry>Type</entry>
44994689c1Smrg      <entry>Notes</entry>
45994689c1Smrg      <entry>Default Value</entry>
46994689c1Smrg    </row>
47994689c1Smrg  </thead>
48994689c1Smrg  <tbody>
49994689c1Smrg    <row>
50994689c1Smrg      <entry>destroyCallback</entry>
51994689c1Smrg      <entry>Callback</entry>
52994689c1Smrg      <entry>XtCallbackList</entry>
53994689c1Smrg      <entry></entry>
54994689c1Smrg      <entry>NULL</entry>
55994689c1Smrg    </row>
56994689c1Smrg    <row>
57994689c1Smrg      <entry>editType</entry>
58994689c1Smrg      <entry>EditType</entry>
59994689c1Smrg      <entry>EditMode</entry>
60994689c1Smrg      <entry></entry>
61994689c1Smrg      <entry>NULL</entry>
62994689c1Smrg    </row>
63994689c1Smrg  </tbody>
64994689c1Smrg  </tgroup>
65994689c1Smrg</informaltable>
66994689c1Smrg</sect2>
67994689c1Smrg
68994689c1Smrg<sect2 id="Subclassing_the_TextSrc">
69994689c1Smrg<title>Subclassing the TextSrc</title>
70994689c1Smrg<para>
71994689c1SmrgThe only purpose of the TextSrc Object is to be subclassed.  It contains
72994689c1Smrgthe minimum set of class methods that all text sources must have.  All
73994689c1Smrgclass methods of the TextSrc must be defined, as the Text widget uses
74994689c1Smrgthem all.  While all may be inherited, the direct descendant of TextSrc
75994689c1Smrg<function>must</function> specify some of them as TextSrc does not contain enough
76994689c1Smrginformation to be a valid text source by itself.  Do not try to use the
77994689c1SmrgTextSrc as a valid source for the Text widget; it is not intended to be
78994689c1Smrgused as a source by itself and bad things will probably happen.
79994689c1Smrg</para>
80994689c1Smrg
81994689c1Smrg<informaltable>
82994689c1Smrg  <tgroup cols='4' align='center'>
83994689c1Smrg  <colspec colname='c1'/>
84994689c1Smrg  <colspec colname='c2'/>
85994689c1Smrg  <colspec colname='c3'/>
86994689c1Smrg  <colspec colname='c4'/>
87994689c1Smrg  <thead>
88994689c1Smrg    <row>
89994689c1Smrg      <entry>Function</entry>
90994689c1Smrg      <entry>Inherit with</entry>
91994689c1Smrg      <entry>Public Interface</entry>
92994689c1Smrg      <entry>must specify</entry>
93994689c1Smrg    </row>
94994689c1Smrg  </thead>
95994689c1Smrg  <tbody>
96994689c1Smrg    <row>
97994689c1Smrg      <entry>Read</entry>
98994689c1Smrg      <entry>XtInheritRead</entry>
99994689c1Smrg      <entry>XawTextSourceRead</entry>
100994689c1Smrg      <entry>yes</entry>
101994689c1Smrg    </row>
102994689c1Smrg    <row>
103994689c1Smrg      <entry>Replace</entry>
104994689c1Smrg      <entry>XtInheritReplace</entry>
105994689c1Smrg      <entry>XawTextSourceReplace</entry>
106994689c1Smrg      <entry>no</entry>
107994689c1Smrg    </row>
108994689c1Smrg    <row>
109994689c1Smrg      <entry>Scan</entry>
110994689c1Smrg      <entry>XtInheritScan</entry>
111994689c1Smrg      <entry>XawTextSourceScan</entry>
112994689c1Smrg      <entry>yes</entry>
113994689c1Smrg    </row>
114994689c1Smrg    <row>
115994689c1Smrg      <entry>Search</entry>
116994689c1Smrg      <entry>XtInheritSearch</entry>
117994689c1Smrg      <entry>XawTextSourceSearch</entry>
118994689c1Smrg      <entry>no</entry>
119994689c1Smrg    </row>
120994689c1Smrg    <row>
121994689c1Smrg      <entry>SetSelection</entry>
122994689c1Smrg      <entry>XtInheritSetSelection</entry>
123994689c1Smrg      <entry>XawTextSourceSetSelection</entry>
124994689c1Smrg      <entry>no</entry>
125994689c1Smrg    </row>
126994689c1Smrg    <row>
127994689c1Smrg      <entry>ConvertSelection</entry>
128994689c1Smrg      <entry>XtInheritConvertSelection</entry>
129994689c1Smrg      <entry>XawTextSourceConvertSelection</entry>
130994689c1Smrg      <entry>no</entry>
131994689c1Smrg    </row>
132994689c1Smrg  </tbody>
133994689c1Smrg  </tgroup>
134994689c1Smrg</informaltable>
135994689c1Smrg
136421c997bSmrg<sect3 id='Reading_Text'>
137994689c1Smrg<title>Reading Text.</title>
138994689c1Smrg<para>
139994689c1Smrg<!-- .LP -->
140421c997bSmrgTo read the text in a text source use the <xref linkend='Read' xrefstyle='select: title'/> function:
1415ec34c4cSmrg<indexterm significance="preferred"><primary>TextSrc object</primary><secondary>Read</secondary></indexterm>
142994689c1Smrg</para>
143421c997bSmrg<funcsynopsis id='Read'>
144994689c1Smrg<funcprototype>
145994689c1Smrg  <funcdef>XawTextPosition<function> Read</function></funcdef>
146994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
147994689c1Smrg  <paramdef>XawTextPosition<parameter> pos</parameter></paramdef>
148994689c1Smrg  <paramdef>XawTextBlock<parameter> *text_return</parameter></paramdef>
149994689c1Smrg  <paramdef>int<parameter> length</parameter></paramdef>
150994689c1Smrg</funcprototype>
151994689c1Smrg</funcsynopsis>
152994689c1Smrg
153994689c1Smrg<!-- .FN -->
154994689c1Smrg<variablelist>
155994689c1Smrg  <varlistentry>
156994689c1Smrg    <term>
157994689c1Smrg      <emphasis remap='I'>w</emphasis>
158994689c1Smrg    </term>
159994689c1Smrg    <listitem>
160994689c1Smrg      <para>
161994689c1SmrgSpecifies the TextSrc object.
162994689c1Smrg      </para>
163994689c1Smrg    </listitem>
164994689c1Smrg  </varlistentry>
165994689c1Smrg  <varlistentry>
166994689c1Smrg    <term>
167994689c1Smrg      <emphasis remap='I'>pos</emphasis>
168994689c1Smrg    </term>
169994689c1Smrg    <listitem>
170994689c1Smrg      <para>
171994689c1SmrgSpecifies the position of the first character to be read from the text buffer.
172994689c1Smrg      </para>
173994689c1Smrg    </listitem>
174994689c1Smrg  </varlistentry>
175994689c1Smrg  <varlistentry>
176994689c1Smrg    <term><emphasis remap='I'>text</emphasis></term>
177994689c1Smrg    <listitem>
178994689c1Smrg      <para>
179994689c1SmrgReturns the text read from the source.
180994689c1Smrg      </para>
181994689c1Smrg    </listitem>
182994689c1Smrg  </varlistentry>
183994689c1Smrg  <varlistentry>
184994689c1Smrg    <term>
185994689c1Smrg      <emphasis remap='I'>length</emphasis>
186994689c1Smrg    </term>
187994689c1Smrg    <listitem>
188994689c1Smrg      <para>
189994689c1SmrgSpecifies the maximum number of characters the TextSrc should
190994689c1Smrgreturn to the application in <emphasis remap='I'>text_return</emphasis>.
191994689c1Smrg      </para>
192994689c1Smrg    </listitem>
193994689c1Smrg  </varlistentry>
194994689c1Smrg</variablelist>
195994689c1Smrg
196994689c1Smrg<para>
197994689c1SmrgThis function returns the text position immediately after the
198994689c1Smrgcharacters read from the
199994689c1Smrgtext buffer.  The function is not required to read <emphasis remap='I'>length</emphasis>
200994689c1Smrgcharacters if that many characters are in the file, it may break at
201994689c1Smrgany point that is convenient to the internal structure of the
202421c997bSmrgsource.  It may take several calls to <xref linkend='Read' xrefstyle='select: title'/> before the desired
203994689c1Smrgportion of the text buffer is fully retrieved.
204994689c1Smrg</para>
205994689c1Smrg</sect3>
206994689c1Smrg
207421c997bSmrg<sect3 id='TextSource::Replacing_Text'>
208994689c1Smrg<title>Replacing Text.</title>
209994689c1Smrg<para>
210421c997bSmrgTo replace or edit the text in a text buffer use the <xref linkend='Replace' xrefstyle='select: title'/> function:
211994689c1Smrg</para>
212994689c1Smrg
213421c997bSmrg<funcsynopsis id='Replace'>
214994689c1Smrg<funcprototype>
215994689c1Smrg  <funcdef>XawTextPosition<function> Replace</function></funcdef>
216994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
217994689c1Smrg  <paramdef>XawTextPositionstart,<parameter> end</parameter></paramdef>
218994689c1Smrg  <paramdef>XawTextBlock<parameter> *text</parameter></paramdef>
219994689c1Smrg</funcprototype>
220994689c1Smrg</funcsynopsis>
221994689c1Smrg
222994689c1Smrg<variablelist>
223994689c1Smrg  <varlistentry>
224994689c1Smrg    <term><emphasis remap='I'>w</emphasis></term>
225994689c1Smrg    <listitem>
226994689c1Smrg      <para>
227994689c1SmrgSpecifies the TextSrc object.
228994689c1Smrg      </para>
229994689c1Smrg    </listitem>
230994689c1Smrg  </varlistentry>
231994689c1Smrg  <varlistentry>
232994689c1Smrg    <term><emphasis remap='I'>start</emphasis></term>
233994689c1Smrg    <listitem>
234994689c1Smrg      <para>
235994689c1SmrgSpecifies the position of the first character to be removed from the text
236994689c1Smrgbuffer.  This is also the location to begin inserting the new text.
237994689c1Smrg      </para>
238994689c1Smrg    </listitem>
239994689c1Smrg  </varlistentry>
240994689c1Smrg  <varlistentry>
241994689c1Smrg    <term><emphasis remap='I'>end</emphasis></term>
242994689c1Smrg    <listitem>
243994689c1Smrg      <para>
244994689c1SmrgSpecifies the position immediately after the last character to be
245994689c1Smrgremoved from the text buffer.
246994689c1Smrg      </para>
247994689c1Smrg    </listitem>
248994689c1Smrg  </varlistentry>
249994689c1Smrg  <varlistentry>
250994689c1Smrg    <term><emphasis remap='I'>text</emphasis></term>
251994689c1Smrg    <listitem>
252994689c1Smrg      <para>
253994689c1SmrgSpecifies the text to be added to the text source.
254994689c1Smrg      </para>
255994689c1Smrg    </listitem>
256994689c1Smrg  </varlistentry>
257994689c1Smrg</variablelist>
258994689c1Smrg
259994689c1Smrg<para>
260994689c1SmrgThis function can return any of the following values:
261994689c1Smrg</para>
262994689c1Smrg
263994689c1Smrg<variablelist>
264994689c1Smrg  <varlistentry>
265994689c1Smrg    <term><function>XawEditDone</function></term>
266994689c1Smrg    <listitem>
267994689c1Smrg      <para>
268994689c1SmrgThe text replacement was successful.
269994689c1Smrg      </para>
270994689c1Smrg    </listitem>
271994689c1Smrg  </varlistentry>
272994689c1Smrg  <varlistentry>
273994689c1Smrg    <term><function>XawPositionError</function></term>
274994689c1Smrg    <listitem>
275994689c1Smrg      <para>
2765ec34c4cSmrg<indexterm><primary>XawPositionError</primary></indexterm>
277994689c1SmrgThe edit mode is <function>XawtextAppend</function> and <function>start</function> is not the last
278994689c1Smrgcharacter of the source.
279994689c1Smrg      </para>
280994689c1Smrg    </listitem>
281994689c1Smrg  </varlistentry>
282994689c1Smrg  <varlistentry>
283994689c1Smrg    <term><function>XawEditError</function></term>
284994689c1Smrg    <listitem>
285994689c1Smrg      <para>
2865ec34c4cSmrg<indexterm><primary>XawEditError</primary></indexterm>
287994689c1SmrgEither the Source was read-only or the range to be deleted is larger
288994689c1Smrgthan the length of the Source.
289994689c1Smrg      </para>
290994689c1Smrg    </listitem>
291994689c1Smrg  </varlistentry>
292994689c1Smrg</variablelist>
293994689c1Smrg
294994689c1Smrg<para>
295994689c1Smrg<!-- .LP -->
296421c997bSmrgThe <xref linkend='Replace' xrefstyle='select: title'/> arguments <function>start</function> and <function>end</function> represent the
297994689c1Smrgtext source character positions for the existing text that is to be
298994689c1Smrgreplaced by the text in the text block.  The characters from
299994689c1Smrg<emphasis remap='I'>start</emphasis> up to but not including <emphasis remap='I'>end</emphasis> are deleted, and the
300994689c1Smrgbuffer specified by the text block is inserted in their
301994689c1Smrgplace.  If <emphasis remap='I'>start</emphasis> and <emphasis remap='I'>end</emphasis> are equal, no text is deleted and
302994689c1Smrgthe new text is inserted after <emphasis remap='I'>start</emphasis>.
303994689c1Smrg</para>
304994689c1Smrg</sect3>
305994689c1Smrg
306994689c1Smrg<sect3 id="Scanning_the_TextSrc">
307994689c1Smrg<title>Scanning the TextSrc</title>
308994689c1Smrg<para>
309994689c1SmrgTo search the text source for one of the predefined boundary types use
310421c997bSmrgthe <xref linkend='Scan' xrefstyle='select: title'/> function:
311994689c1Smrg</para>
312994689c1Smrg
313421c997bSmrg<funcsynopsis id='Scan'>
314994689c1Smrg<funcprototype>
315994689c1Smrg  <funcdef>XawTextPosition<function> Scan</function></funcdef>
316994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
317994689c1Smrg  <paramdef>XawTextPosition<parameter> position</parameter></paramdef>
318994689c1Smrg  <paramdef>XawTextScanType<parameter> type</parameter></paramdef>
319994689c1Smrg  <paramdef>XawTextScanDirection<parameter> dir</parameter></paramdef>
320994689c1Smrg  <paramdef>int<parameter> count</parameter></paramdef>
321994689c1Smrg  <paramdef>Boolean<parameter> include</parameter></paramdef>
322994689c1Smrg</funcprototype>
323994689c1Smrg</funcsynopsis>
324994689c1Smrg
325994689c1Smrg
326994689c1Smrg<variablelist>
327994689c1Smrg  <varlistentry>
328994689c1Smrg    <term><emphasis remap='I'>w</emphasis></term>
329994689c1Smrg    <listitem>
330994689c1Smrg      <para>
331994689c1SmrgSpecifies the TextSrc object.
332994689c1Smrg      </para>
333994689c1Smrg    </listitem>
334994689c1Smrg  </varlistentry>
335994689c1Smrg  <varlistentry>
336994689c1Smrg    <term><emphasis remap='I'>position</emphasis></term>
337994689c1Smrg    <listitem>
338994689c1Smrg      <para>
339994689c1SmrgSpecifies the position to begin scanning the source.
340994689c1Smrg      </para>
341994689c1Smrg    </listitem>
342994689c1Smrg  </varlistentry>
343994689c1Smrg  <varlistentry>
344994689c1Smrg    <term><emphasis remap='I'>type</emphasis></term>
345994689c1Smrg    <listitem>
346994689c1Smrg      <para>
347994689c1SmrgSpecifies the type of boundary to scan for, may be one of:
348994689c1Smrg<function>XawstPosition</function>, <function>XawstWhiteSpace</function>, <function>XawstEOL</function>,
349994689c1Smrg<function>XawstParagraph</function>, <function>XawstAll</function>.  The exact meaning of these
350994689c1Smrgboundaries is left up to the individual text source.
351994689c1Smrg      </para>
352994689c1Smrg    </listitem>
353994689c1Smrg  </varlistentry>
354994689c1Smrg  <varlistentry>
355994689c1Smrg    <term><emphasis remap='I'>dir</emphasis></term>
356994689c1Smrg    <listitem>
357994689c1Smrg      <para>
358994689c1SmrgSpecifies the direction to scan, may be either <function>XawsdLeft</function> to search
3595ec34c4cSmrg<indexterm><primary>XawsdLeft</primary></indexterm>
360994689c1Smrgbackward, or <function>XawsdRight</function> to search forward.
3615ec34c4cSmrg<indexterm><primary>XawsdRight</primary></indexterm>
362994689c1Smrg      </para>
363994689c1Smrg    </listitem>
364994689c1Smrg  </varlistentry>
365994689c1Smrg  <varlistentry>
366994689c1Smrg    <term><emphasis remap='I'>count</emphasis></term>
367994689c1Smrg    <listitem>
368994689c1Smrg      <para>
369994689c1SmrgSpecifies the number of boundaries to scan for.
370994689c1Smrg      </para>
371994689c1Smrg    </listitem>
372994689c1Smrg  </varlistentry>
373994689c1Smrg  <varlistentry>
374994689c1Smrg    <term><emphasis remap='I'>include</emphasis></term>
375994689c1Smrg    <listitem>
376994689c1Smrg      <para>
377994689c1SmrgSpecifies whether the boundary itself should be included in the scan.
378994689c1Smrg      </para>
379994689c1Smrg    </listitem>
380994689c1Smrg  </varlistentry>
381994689c1Smrg</variablelist>
382994689c1Smrg
383994689c1Smrg<para>
384994689c1Smrg<!-- .LP -->
385421c997bSmrgThe <xref linkend='Scan' xrefstyle='select: title'/> function returns the position in the text source of the desired
386994689c1Smrgboundary.  It is expected to return a valid address for
387994689c1Smrgall calls made to it, thus if a particular request is made that would take
388994689c1Smrgthe text widget beyond the end of the source it must return the
389994689c1Smrgposition of that end.
390994689c1Smrg</para>
391994689c1Smrg</sect3>
392994689c1Smrg
393994689c1Smrg<sect3 id="Searching_through_a_TextSrc">
394994689c1Smrg<title>Searching through a TextSrc</title>
395994689c1Smrg<para>
396421c997bSmrgTo search for a particular string use the <xref linkend='Search' xrefstyle='select: title'/> function.
397994689c1Smrg</para>
398994689c1Smrg
399421c997bSmrg<funcsynopsis id='Search'>
400994689c1Smrg<funcprototype>
401994689c1Smrg  <funcdef>XawTextPosition<function> Search</function></funcdef>
402994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
403994689c1Smrg  <paramdef>XawTextPosition<parameter> position</parameter></paramdef>
404994689c1Smrg  <paramdef>XawTextScanDirection<parameter> dir</parameter></paramdef>
405994689c1Smrg  <paramdef>XawTextBlock<parameter> *text</parameter></paramdef>
406994689c1Smrg</funcprototype>
407994689c1Smrg</funcsynopsis>
408994689c1Smrg
409994689c1Smrg<variablelist>
410994689c1Smrg  <varlistentry>
411994689c1Smrg    <term><emphasis remap='I'>w</emphasis></term>
412994689c1Smrg    <listitem>
413994689c1Smrg      <para>
414994689c1SmrgSpecifies the TextSrc object.
415994689c1Smrg      </para>
416994689c1Smrg    </listitem>
417994689c1Smrg  </varlistentry>
418994689c1Smrg  <varlistentry>
419994689c1Smrg    <term><emphasis remap='I'>position</emphasis></term>
420994689c1Smrg    <listitem>
421994689c1Smrg      <para>
422994689c1SmrgSpecifies the position to begin the search.
423994689c1Smrg      </para>
424994689c1Smrg    </listitem>
425994689c1Smrg  </varlistentry>
426994689c1Smrg  <varlistentry>
427994689c1Smrg    <term><emphasis remap='I'>dir</emphasis></term>
428994689c1Smrg    <listitem>
429994689c1Smrg      <para>
430994689c1SmrgSpecifies the direction to search, may be either <function>XawsdLeft</function> to search
4315ec34c4cSmrg<indexterm><primary>XawsdLeft</primary></indexterm>
432994689c1Smrgbackward, or <function>XawsdRight</function> to search forward.
4335ec34c4cSmrg<indexterm><primary>XawsdRight</primary></indexterm>
434994689c1Smrg      </para>
435994689c1Smrg    </listitem>
436994689c1Smrg  </varlistentry>
437994689c1Smrg  <varlistentry>
438994689c1Smrg    <term><emphasis remap='I'>text</emphasis></term>
439994689c1Smrg    <listitem>
440994689c1Smrg      <para>
441994689c1SmrgSpecifies a text block containing the text to search for.
442994689c1Smrg      </para>
443994689c1Smrg    </listitem>
444994689c1Smrg  </varlistentry>
445994689c1Smrg</variablelist>
446994689c1Smrg
447994689c1Smrg<para>
448994689c1SmrgThis function will search through the text buffer attempting to find a
449994689c1Smrgmatch for the string in the text block.  If a match is found in the
450994689c1Smrgdirection specified, then the character location of the first character
451994689c1Smrgin the string is returned.  If no text was found then
452994689c1Smrg<function>XawTextSearchError</function> is returned.
453994689c1Smrg</para>
454994689c1Smrg
455994689c1Smrg</sect3>
456994689c1Smrg
457994689c1Smrg<sect3 id="Text_Selections">
458994689c1Smrg<title>Text Selections</title>
459994689c1Smrg
460994689c1Smrg<para>
461994689c1Smrg<!-- .LP -->
462994689c1SmrgWhile many selection types are handled by the Text widget, text sources
463994689c1Smrgmay have selection types unknown to the Text widget.  When a selection
464994689c1Smrgconversion is requested by the X server the Text widget will first call
465994689c1Smrgthe <function>ConvertSelection</function> function, to attempt the selection
466994689c1Smrgconversion.
467994689c1Smrg</para>
468994689c1Smrg
469421c997bSmrg<funcsynopsis id='ConvertSelections'>
470994689c1Smrg<funcprototype>
471994689c1Smrg  <funcdef>Boolean<function> ConvertSelections</function></funcdef>
472994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
473994689c1Smrg  <paramdef>Atom*selection,*target,<parameter> *type</parameter></paramdef>
474994689c1Smrg  <paramdef>caddr_t<parameter> *value_return</parameter></paramdef>
475994689c1Smrg  <paramdef>unsignedlong<parameter> *length_return</parameter></paramdef>
476994689c1Smrg  <paramdef>int<parameter> *format_return</parameter></paramdef>
477994689c1Smrg</funcprototype>
478994689c1Smrg</funcsynopsis>
479994689c1Smrg
480994689c1Smrg<variablelist>
481994689c1Smrg  <varlistentry>
482994689c1Smrg    <term>
483994689c1Smrg      <emphasis remap='I'>w</emphasis>
484994689c1Smrg    </term>
485994689c1Smrg    <listitem>
486994689c1Smrg      <para>
487994689c1SmrgSpecifies the TextSrc object.
488994689c1Smrg      </para>
489994689c1Smrg    </listitem>
490994689c1Smrg  </varlistentry>
491994689c1Smrg  <varlistentry>
492994689c1Smrg    <term>
493994689c1Smrg      <emphasis remap='I'>selection</emphasis>
494994689c1Smrg    </term>
495994689c1Smrg    <listitem>
496994689c1Smrg      <para>
497994689c1SmrgSpecifies the type of selection that was requested (e.g. <function>PRIMARY</function>).
498994689c1Smrg      </para>
499994689c1Smrg    </listitem>
500994689c1Smrg  </varlistentry>
501994689c1Smrg  <varlistentry>
502994689c1Smrg    <term>
503994689c1Smrg      <emphasis remap='I'>target</emphasis>
504994689c1Smrg    </term>
505994689c1Smrg    <listitem>
506994689c1Smrg      <para>
507994689c1SmrgSpecifies the type of the selection that has been requested, which
508994689c1Smrgindicates the desired information about the selection (e.g. Filename,
509994689c1SmrgText, Window).
510994689c1Smrg      </para>
511994689c1Smrg    </listitem>
512994689c1Smrg  </varlistentry>
513994689c1Smrg  <varlistentry>
514994689c1Smrg    <term>
515994689c1Smrg      <emphasis remap='I'>type</emphasis>
516994689c1Smrg    </term>
517994689c1Smrg    <listitem>
518994689c1Smrg      <para>
519994689c1SmrgSpecifies a pointer to the atom into which the property type of the converted
520994689c1Smrgvalue of the selection is to be stored.  For instance, either file
521994689c1Smrgname or text might have property type <function>XA_STRING</function>.
522994689c1Smrg      </para>
523994689c1Smrg    </listitem>
524994689c1Smrg  </varlistentry>
525994689c1Smrg  <varlistentry>
526994689c1Smrg    <term>
527994689c1Smrg      <emphasis remap='I'>value_return</emphasis>
528994689c1Smrg    </term>
529994689c1Smrg    <listitem>
530994689c1Smrg      <para>
531994689c1SmrgReturns a pointer into which a pointer to the converted value of the
532994689c1Smrgselection
533994689c1Smrgis to be stored.  The selection owner is responsible for allocating
534994689c1Smrgthis storage.  The memory is considered owned by the toolkit, and is
535994689c1Smrgfreed by XtFree when the Intrinsics selection mechanism is done with it.
536994689c1Smrg      </para>
537994689c1Smrg    </listitem>
538994689c1Smrg  </varlistentry>
539994689c1Smrg  <varlistentry>
540994689c1Smrg    <term>
541994689c1Smrg      <emphasis remap='I'>length_return</emphasis>
542994689c1Smrg    </term>
543994689c1Smrg    <listitem>
544994689c1Smrg      <para>
545994689c1SmrgReturns a pointer into which the number of elements in value is to be stored.
546994689c1SmrgThe size of each element is determined by <emphasis remap='I'>format</emphasis>.
547994689c1Smrg      </para>
548994689c1Smrg    </listitem>
549994689c1Smrg  </varlistentry>
550994689c1Smrg  <varlistentry>
551994689c1Smrg    <term>
552994689c1Smrg      <emphasis remap='I'>format_return</emphasis>
553994689c1Smrg    </term>
554994689c1Smrg    <listitem>
555994689c1Smrg      <para>
556994689c1SmrgReturns a pointer into which the size in bits of the data elements of the
557994689c1Smrgselection value is to be stored.
558994689c1Smrg      </para>
559994689c1Smrg    </listitem>
560994689c1Smrg  </varlistentry>
561994689c1Smrg</variablelist>
562994689c1Smrg
563994689c1Smrg<para>
564994689c1SmrgIf this function returns <function>True</function> then the Text widget will assume
565994689c1Smrgthat the source has taken care of converting the selection, Otherwise the
566994689c1SmrgText widget will attempt to convert the selection itself.
567994689c1Smrg</para>
568994689c1Smrg
569994689c1Smrg<para>
570994689c1SmrgIf the source needs to know when the text selection is modified it
571421c997bSmrgshould define a <xref linkend='SetSelection' xrefstyle='select: title'/> procedure:
572994689c1Smrg</para>
573994689c1Smrg
574421c997bSmrg<funcsynopsis id='SetSelection'>
575994689c1Smrg<funcprototype>
576994689c1Smrg  <funcdef>void<function> SetSelection</function></funcdef>
577994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
578994689c1Smrg  <paramdef>XawTextPositionstart,<parameter> end</parameter></paramdef>
579994689c1Smrg  <paramdef>Atom<parameter> selection</parameter></paramdef>
580994689c1Smrg</funcprototype>
581994689c1Smrg</funcsynopsis>
582994689c1Smrg
583994689c1Smrg<variablelist>
584994689c1Smrg  <varlistentry>
585994689c1Smrg    <term><emphasis remap='I'>w</emphasis></term>
586994689c1Smrg    <listitem>
587994689c1Smrg      <para>
588994689c1SmrgSpecifies the TextSrc object.
589994689c1Smrg      </para>
590994689c1Smrg    </listitem>
591994689c1Smrg  </varlistentry>
592994689c1Smrg  <varlistentry>
593994689c1Smrg    <term><emphasis remap='I'>start</emphasis></term>
594994689c1Smrg    <listitem>
595994689c1Smrg      <para>
596994689c1SmrgSpecifies the character position of the beginning of the new text selection.
597994689c1Smrg      </para>
598994689c1Smrg    </listitem>
599994689c1Smrg  </varlistentry>
600994689c1Smrg  <varlistentry>
601994689c1Smrg    <term><emphasis remap='I'>end</emphasis></term>
602994689c1Smrg    <listitem>
603994689c1Smrg      <para>
604994689c1SmrgSpecifies the character position of the end of the new text selection.
605994689c1Smrg      </para>
606994689c1Smrg    </listitem>
607994689c1Smrg  </varlistentry>
608994689c1Smrg  <varlistentry>
609994689c1Smrg    <term><emphasis remap='I'>selection</emphasis></term>
610994689c1Smrg    <listitem>
611994689c1Smrg      <para>
612994689c1SmrgSpecifies the type of selection that was requested (e.g. <function>PRIMARY</function>).
613994689c1Smrg      </para>
614994689c1Smrg    </listitem>
615994689c1Smrg  </varlistentry>
616994689c1Smrg</variablelist>
617994689c1Smrg
618994689c1Smrg</sect3>
619994689c1Smrg</sect2>
620994689c1Smrg</sect1>
621