From 272e57235cd60a2e65ac8258d96a02eb3939b687 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 25 Mar 2011 10:41:05 +0000 Subject: git update until 25 Mar 2011 xserver fontconfig glproto libXau libXft libXmu libfontenc libxcb mesa mkfontscale pixman randrproto xkeyboard-config xtrans xwininfo updated following packages: xproto-7.0.21 xineramaproto-1.2.1 libXt-1.1.1 libxkbfile-1.0.7 libXpm-3.5.9 libXfont-1.4.3 libXaw-1.0.9 bdftopcf-1.0.3 encodings-1.0.4 fixesproto-5.0 font-adobe-100dpi-1.0.3 font-adobe-75dpi-1.0.3 font-adobe-utopia-100dpi-1.0.4 font-adobe-utopia-75dpi-1.0.4 font-adobe-utopia-type1-1.0.4 font-alias-1.0.3 font-arabic-misc-1.0.3 font-bh-100dpi-1.0.3 font-bh-75dpi-1.0.3 font-bh-lucidatypewriter-100dpi-1.0.3 font-bh-lucidatypewriter-75dpi-1.0.3 font-bh-ttf-1.0.3 font-bh-type1-1.0.3 font-bitstream-100dpi-1.0.3 font-bitstream-75dpi-1.0.3 font-bitstream-speedo-1.0.2 font-bitstream-type1-1.0.3 font-cronyx-cyrillic-1.0.3 font-cursor-misc-1.0.3 font-daewoo-misc-1.0.3 font-dec-misc-1.0.3 font-ibm-type1-1.0.3 font-isas-misc-1.0.3 font-jis-misc-1.0.3 font-micro-misc-1.0.3 font-misc-cyrillic-1.0.3 font-misc-ethiopic-1.0.3 font-misc-meltho-1.0.3 font-misc-misc-1.1.2 font-mutt-misc-1.0.3 font-schumacher-misc-1.1.2 font-screen-cyrillic-1.0.4 font-sony-misc-1.0.3 font-sun-misc-1.0.3 font-util-1.2.0 font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4 --- libXaw/specs/AsciiSource.xml | 368 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 libXaw/specs/AsciiSource.xml (limited to 'libXaw/specs/AsciiSource.xml') diff --git a/libXaw/specs/AsciiSource.xml b/libXaw/specs/AsciiSource.xml new file mode 100644 index 000000000..bd51f990a --- /dev/null +++ b/libXaw/specs/AsciiSource.xml @@ -0,0 +1,368 @@ + +Ascii Source Object and Multi Source Object + + + + + + + + + + + + +Application Header file <X11/Xaw/AsciiSrc.h> or <X11/Xaw/MultiSrc.h> + +Class Header file <X11/Xaw/AsciiSrcP.h> or <X11/Xaw/MultiSrcP.h> + +Class asciiSrcObjectClass or multiSrcObjectClass + +Class Name AsciiSrc or MultiSrc + +Superclass TextSource + + + + +The AsciiSrc or MultiSrc object is used by a text widget to read the text from a +file or string in memory. Depending on its international resource, an +AsciiText widget will create one or the other of these when the AsciiText +itself is created. Both types are nearly identical; the following discussion +applies to both, with MultiSrc differences noted only as they occur. + + + +The AsciiSrc understands all Latin1 characters plus Tab +and Carriage Return. \fIThe MultiSrc understands any set of character sets that +the underlying X implementation's internationalization handles.\fP + + + +The AsciiSrc can be either of two types: XawAsciiFile +or XawAsciiString. + + + +AsciiSrc objects of type XawAsciiFile read the text from a file and +store it +into an internal buffer. This buffer may then be modified, provided the +text widget is in the correct edit mode, just as if it were a source of +type XawAsciiString. Unlike R3 and earlier versions of the AsciiSrc, +it is now possible to specify an editable disk source. The file is not +updated, however, until a call to XawAsciiSave is made. When the +source is in this mode the useStringInPlace resource is ignored. + + + +AsciiSrc objects of type XawAsciiString have the text buffer +implemented as a string. +\fIMultiSrc objects of type XawAsciiString have the text buffer +implemented as a wide character string.\fP +The string owner is responsible for allocating and managing storage for the +string. + + + +In the default case for AsciiSrc objects of type XawAsciiString, +the resource useStringInPlace is false, +and the widget owns the string. The initial value of the +string resource, and any update made by the application +programmer to the string resource with XtSetValues, is copied +into memory private to the widget, and managed internally by the widget. +The application writer +does not need to worry about running out of buffer space +(subject to the total memory available to the application). +The performance does not decay linearly as the buffer grows +large, as is necessarily the case when the text buffer is used +in place. The application writer must use XtGetValues to +determine the contents of the text buffer, which will return +a copy of the widget's text buffer as +it existed at the time of the XtGetValues call. This copy +is not affected by subsequent updates to the text buffer, i.e., +it is not updated as the user types input into the text buffer. +This copy is freed upon the next call to XtGetValues to +retrieve the string resource; however, to conserve memory, +there is a convenience routine, XawAsciiSourceFreeString, allowing the +application programmer to direct the widget to free the copy. + + + +When the resource useStringInPlace is true and the AsciiSrc object +is of type XawAsciiString, the application +is the string owner. The widget will take the value +of the string resource as its own text buffer, and the length +resource indicates the buffer size. In this case +the buffer contents change as the user types at the widget; +it is not necessary to call XtGetValues on the string +resource to determine the contents of the buffer-it will +simply return the address of the application's implementation +of the text buffer. + + +Resources + + +When creating an AsciiSrc object instance, the following resources are +retrieved from the argument list or from the resource database: + + + + + + + + + + + + + + Name + Class + Type + Notes + Default Value + + + + + callback + Callback + XtCallbackList + + NULL + + + dataCompression + DataCompression + Boolean + + True + + + destroyCallback + Callback + Callback + + NULL + + + editType + EditType + EditMode + + XawtextRead + + + length + Length + Int + A + length of string + + + pieceSize + PieceSize + Int + + BUFSIZ + + + string + String + String + + NULL + + + type + Type + AsciiType + + XawAsciiString + + + useStringInPlace + UseStringInPlace + Boolean + + False + + + _ + + + + + + + + + + + + + + + + +Convenience Routines + + +The AsciiSrc has a few convenience routines that allow the +application programmer quicker or easier access to some of the +commonly used functionality of the AsciiSrc. + + +Conserving Memory + + +When the AsciiSrc widget is not in useStringInPlace mode +space must be allocated whenever the file is saved, or the string is +requested with a call to XtGetValues. This memory is allocated on the +fly, and remains valid until the next time a string needs to be allocated. +You may save memory by freeing this string as soon as you are done +with it by calling XawAsciiSourceFreeString. + + + void XawAsciiSourceFreeString + Widget w + + + + + + + w + + + +Specifies the AsciiSrc object. + + + + + + + +This function will free the memory that contains the string pointer returned +by XtGetValues. This will normally happen automatically when +the next call to XtGetValues occurs, or when the widget is destroyed. + + + +Saving Files + + +To save the changes made in the current text source into a file use +XawAsciiSave. + + + Boolean XawAsciiSave + Widget w + + + + + + + w + + + +Specifies the AsciiSrc object. + + + + + + + +XawAsciiSave returns True if the save was successful. +It will update the file named in the string resource. +If the buffer has not been changed, no action will be taken. This function +only works on an AsciiSrc of type XawAsciiFile. + + + + +To save the contents of the current text buffer into a named file use +XawAsciiSaveAsFile. + + + Boolean XawAsciiSaveAsFile + Widget w + String name + + + + + + + w + + + +Specifies the AsciiSrc object. + + + + + + name + + + +The name of the file to save the current buffer into. + + + + + + + +This function returns True if the save was successful. +XawAsciiSaveAsFile will work with a buffer of either type +XawAsciiString or type XawAsciiFile. + + + +Seeing if the Source has Changed + + +To find out if the text buffer in an AsciiSrc object has changed +since the last time it was saved with XawAsciiSave or queried + +use XawAsciiSourceChanged. + + + Boolean XawAsciiSourceChanged + Widget w + + + + + + + w + + + +Specifies the AsciiSrc object. + + + + + + + +This function will return True if the source has changed since +the last time it was saved or queried. The internal change flag is +reset whenever the string is queried via XtGetValues or the +buffer is saved via XawAsciiSave. + + + + + -- cgit v1.2.3