[Xcb] about XTextProperty

Jamey Sharp jamey at minilop.net
Sat May 14 20:09:04 PDT 2005

On Sat, 2005-05-14 at 07:48 +0200, Vincent Torri wrote:
> On Fri, 13 May 2005, Jamey Sharp wrote:
> > I've finally had a chance to look up the X{Get,Set}TextProperty
> > functions, but I don't understand how they're any improvement on plain
> > GetProperty and ChangeProperty. I assume you've been working with code
> > that uses them; can you explain how they help?
> >
> > I don't think I like any of the functions that convert between
> > TextList/StringList and TextProperty representations, and the wc and mb
> > variants of those look especially ugly to me.
> Well, ecore uses the TextList/StringList functions a lot. Up for now, I've
> succeeded in not using them. GetProperty and ChangeProperty were
> sufficient. But it was particular cases. Nevertheless, I think that I'll
> need the mb variants. I've not seen the code in detail yet, so maybe I'll
> be able to do the same simplifications than for the TextList/StringList
> functions. It would be nice (and faster, in addition).
>  In case I need them, having them implemented somewhere would be
> convenient. But I'll try to avoid them as much as possible.

For the mb and wc variants, I think the iconv-related functions should
be all you need; they're shipped in glibc and should be readily
available on non-glibc platforms as well.

Ideally, ecore and other libraries in the client stack would operate
only on UTF-8. In dealing with X properties, conversion to and from
UTF-8 may sometimes be needed to correctly inter-operate with other X
clients -- but I believe neither wc nor mb APIs will help with that.

You might be able to convince me that shared code to convert between
iconv character set names and X atoms would be useful, though. 

> I agree that their code is really not nice at all. I really don't like the
> way Xlib is written.

Heh. No argument here. :-)


More information about the xcb mailing list