/* $XConsortium: StringNext.dat /main/4 1995/07/17 10:25:13 drk $ */ /* * @OPENGROUP_COPYRIGHT@ * COPYRIGHT NOTICE * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc. * Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for * the full copyright text. * * This software is subject to an open license. It may only be * used on, with or for operating systems which are themselves open * source systems. You must contact The Open Group for a license * allowing distribution and sublicensing of this software on, with, * or for operating systems which are not Open Source programs. * * See http://www.opengroup.org/openmotif/license for full * details of the license agreement. Any use, reproduction, or * distribution of the program constitutes recipient's acceptance of * this agreement. * * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS * PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY * WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY * OR FITNESS FOR A PARTICULAR PURPOSE * * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT * NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE * EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * */ /* * HISTORY */ @) This test checks that the XmString functions which parse a given XmString, return the components or segments of the XmString in the expected order along with the expected values. #) An XmString is created by concatenating a number of XmString components. The functions, XmStringPeekNextTriple() and XmStringGetNextTriple() are called to retrieve each of the components from the XmString. Messages should be printed to stdout listing the XmStringComponentType returned and whether the comparison test between the values expected and the actual values returned by the function passed or failed. Verify that all the comparison tests passed. C) #) The same XmString is parsed again. This time, the functions XmStringPeekNextComponent() and XmStringGetNextComponent() are called to return the next component type. Messages should be printed to stdout listing the XmStringComponentType returned and whether the comparison test between the values expected and the actual values returned by the function passed or failed. Verify that all the comparison tests passed. C) #) An XmString is created by concatenating a number of XmString segments. The function XmStringGetNextSegment() is then called to retrieve each of the segments. Messages should be printed to stdout indicating whether the comparison between the segment information expected and the actual segment information returned by the function passed or failed. Verify that all the comparison tests passed. C) #) An XmString is created with the following XmString components and their values, where appropriate, listed in parentheses. !) XmSTRING_COMPONENT_LAYOUT_PUSH ( XmLEFT_TO_RIGHT ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" ) XmSTRING_COMPONENT_TAG ( XmSTRING_ISO8859-1 ) XmSTRING_COMPONENT_TAB XmSTRING_COMPONENT_DIRECTION ( XmSTRING_DIRECTION_L_TO_R ) XmSTRING_COMPONENT_TEXT ( "Hello World" ) XmSTRING_COMPONENT_RENDITION_END ( "render_tag2" ) XmSTRING_COMPONENT_RENDITION_END ( "render_tag1" ) XmSTRING_COMPONENT_LAYOUT_POP XmSTRING_COMPONENT_SEPARATOR #) The text "Hello World" should be rendered with the following attributes: !) Foreground Color: red Font: 9x15 Tab: 1 inch ( from the left margin ) #) The XmString component types will be printed to stdout in the order in which they have been retreived from the XmString. Verify that the component types returned conform to the following order: !) [ [ XmSTRING_COMPONENT_LAYOUT_PUSH ] [ XmSTRING_COMPONENT_RENDITION_BEGIN ]* [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ] [ XmSTRING_COMPONENT_TAB ]* [ XmSTRING_COMPONENT_DIRECTION ] [ XmSTRING_COMPONENT_TEXT | XmSTRING_COMPONENT_LOCALE_TEXT | XmSTRING_COMPONENT_WIDECHAR_TEXT ] [ XmSTRING_COMPONENT_RENDITION_END ]* [ XmSTRING_COMPONENT_LAYOUT_POP ] [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END C) #) An XmString is created with the following XmString components and their values, where appropriate, listed in parentheses. !) XmSTRING_COMPONENT_LAYOUT_PUSH ( XmLEFT_TO_RIGHT ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" ) XmSTRING_COMPONENT_TAB XmSTRING_COMPONENT_DIRECTION ( XmSTRING_DIRECTION_R_TO_L ) XmSTRING_COMPONENT_LOCALE_TEXT ( "Hello World" ) XmSTRING_COMPONENT_DIRECTION ( XmSTRING_DIRECTION_L_TO_R ) XmSTRING_COMPONENT_RENDITION_END ( "render_tag2" ) XmSTRING_COMPONENT_LAYOUT_POP XmSTRING_COMPONENT_SEPARATOR XmSTRING_COMPONENT_RENDITION_END ( "render_tag1" ) #) The text "dlroW olleH" should be rendered with the following attributes: !) Foreground Color: black Font: fixed Tab: 1.0 inch ( from the left margin ) #) The XmString component types will be printed to stdout in the order in which they have been retreived from the XmString. Verify that the component types returned conform to the following order: !) [ [ XmSTRING_COMPONENT_LAYOUT_PUSH ] [ XmSTRING_COMPONENT_RENDITION_BEGIN ]* [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ] [ XmSTRING_COMPONENT_TAB ]* [ XmSTRING_COMPONENT_DIRECTION ] [ XmSTRING_COMPONENT_TEXT | XmSTRING_COMPONENT_LOCALE_TEXT | XmSTRING_COMPONENT_WIDECHAR_TEXT ] [ XmSTRING_COMPONENT_RENDITION_END ]* [ XmSTRING_COMPONENT_LAYOUT_POP ] [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END C) #) An XmString is created with the following XmString components and their values, where appropriate, listed in parentheses. !) XmSTRING_COMPONENT_LAYOUT_PUSH ( XmRIGHT_TO_LEFT ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" ) XmSTRING_COMPONENT_DIRECTION ( XmSTRING_DIRECTION_R_TO_L ) XmSTRING_COMPONENT_WIDECHAR_TEXT ( "Hi " ) XmSTRING_COMPONENT_RENDITION_END ( "render_tag2" ) XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" ) XmSTRING_COMPONENT_TAB XmSTRING_COMPONENT_DIRECTION ( XmSTRING_DIRECTION_L_TO_R ) XmSTRING_COMPONENT_TEXT ( "World" ) XmSTRING_COMPONENT_RENDITION_END ( "render_tag1" ) XmSTRING_COMPONENT_LAYOUT_POP #) The text " World iH" should be rendered with the following attributes: !) "World" Foreground Color: black Font: fixed Tab: 1 inch ( from the right side of the word "iH" ) !) "iH" Foreground Color: red Font: 9x15 Tab: None #) The XmString component types will be printed to stdout in the order in which they have been retreived from the XmString. Verify that the component types returned conform to the following order: !) [ [ XmSTRING_COMPONENT_LAYOUT_PUSH ] [ XmSTRING_COMPONENT_RENDITION_BEGIN ]* [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ] [ XmSTRING_COMPONENT_TAB ]* [ XmSTRING_COMPONENT_DIRECTION ] [ XmSTRING_COMPONENT_TEXT | XmSTRING_COMPONENT_LOCALE_TEXT | XmSTRING_COMPONENT_WIDECHAR_TEXT ] [ XmSTRING_COMPONENT_RENDITION_END ]* [ XmSTRING_COMPONENT_LAYOUT_POP ] [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END C) E)