XmbTextListToTextProperty()XmbTextListToTextProperty()NameXmbTextListToTextProperty – convert an internationalized multi-byte
text list to a text property structure.
Synopsis
int XmbTextListToTextProperty(display, list, count, style,
text_prop_return)
Display *display;
char **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 multi-byte 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. XNoMemory or XLocaleNotSupported on failure.
Availability
Release 5 and later.
DescriptionXmbTextListToTextProperty() 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.
XmbTextListToTextProperty() sets the encoding field of text_prop_return
to an Atom (for the specified display), which names the encoding speci‐
fied 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
specified, 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, Xmb‐
TextListToTextProperty() 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.
If the supplied text is not fully convertible to the specified encod‐
ing, XmbTextListToTextProperty() returns the number of unconvertible
characters. Each unconvertible character is converted to an implemen‐
tation-defined and encoding-specific default string. If the text is
fully convertible, XmbTextListToTextProperty() returns Success. Note
that full convertibility to all styles except XStringStyle is guaran‐
teed. If the supplied text contains bytes that are not valid charac‐
ters in the encoding of the locale ("invalid codepoints"), the result
is undefined.
XmbTextListToTextProperty() 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 items; /* number of items in value */
} XTextProperty;
The XICCEncodingStyle structure contains:
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
See AlsoXSetTextProperty(), XStringListToTextProperty(), XwcTextListToTextProp‐
erty(), XmbTextPropertyToTextList(), XwcTextPropertyToTextList(),
XwcFreeStringList(), XDefaultString().
Xlib - Text Encoding Conversions XmbTextListToTextProperty()