Query: xwctextlisttotextproperty
OS: hpux
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
XwcTextListToTextProperty() XwcTextListToTextProperty() Name XwcTextListToTextProperty - convert an internationalized wide-character text list to a text property structure. Synopsis int XwcTextListToTextProperty(display, list, count, style, text_prop_return) Display *display; wchar_t **list; int count; XICCEncodingStyle style; XTextProperty *text_prop_return; Arguments display Specifies the connection to the X server. list Specifies an array of NULL-terminated wide-character strings. count Specifies the number of strings specified. style Specifies the manner in which the property is encoded. text_prop_return Returns the XTextProperty structure. Returns Success on success; The number of unconvertible characters, XLocaleNotSupported, or XNoMemory on failure. Availability Release 5 and later. Description XwcTextListToTextProperty() sets the specified XTextProperty value to a set of null-separated elements representing the concatenation of the specified list of NULL-terminated text strings. A final terminating null is stored at the end of the value field of text_prop_return but is not included in the nitems field. XwcTextListToTextProperty() sets the encoding field of text_prop_return to an Atom (for the specified display), which names the encoding specified by style, and converts the specified text list to this encoding for storage in the value field of text_prop_return. If the style XStringStyle or XCompoundTextStyle is specified, this encoding is STRING or COMPOUND_TEXT, respectively. If the style XTextStyle is speci- fied, this encoding is the encoding of the current locale. If the style XStdICCTextStyle is specified, this encoding is STRING if the text is fully convertible to STRING, otherwise it is COMPOUND_TEXT. If insufficient memory is available for the new value string, XwcTextListToTextProperty() returns XNoMemory. If the current locale is not supported, it returns XLocaleNotSupported. In both of these error cases, it does not set text_prop_return. XmbTextListToTextProperty() will not return XLocaleNotSupported if XSupportsLocale() has returned True for the current locale. To determine if the functions are guaranteed not to return XLocaleNotSupported, use XSupportsLocale(). If the supplied text is not fully convertible to the specified encoding, XwcTextListToTextProperty() returns the number of unconvertible characters. Each unconvertible character is converted to an implementation-defined and encoding-specific default string. If the text is fully convertible, XwcTextListToTextProperty() returns Success. Note that full convertibility to all styles except XStringStyle is guaran- teed. If the supplied text contains bytes that are not valid characters in the encoding of the locale ("invalid codepoints"), the result is undefined. XwcTextListToTextProperty() allocates memory for the value field of the XTextProperty. The client is responsible for freeing this memory by calling XFree(). Structures The XTextProperty structure contains: typedef struct { unsigned char *value; /* property data */ Atom encoding; /* type of property */ int format; /* 8, 16, or 32 */ unsigned long nitems; /* number of items in value */ } XTextProperty; The XICCEncodingStyle type has the following values: typedef enum { XStringStyle, /* STRING */ XCompoundTextStyle, /* COMPOUND_TEXT */ XTextStyle, /* text in owner's encoding (current locale) */ XStdICCTextStyle /* STRING, else COMPOUND_TEXT */ } XICCEncodingStyle; The possible return values of this function are as follows: #define XNoMemory - 1 #define XLocaleNotSupported - 2 #define XConverterNotFound - 3 #define XConverterNotFound - 3 See Also XSetTextProperty(), XStringListToTextProperty(), XDefaultString(), XmbTextListToTextProperty(), XmbTextPropertyToTextList(), XwcTextProper- tyToTextList(), XwcFreeStringList(). Xlib - Text Encoding Conversions XwcTextListToTextProperty()