How does libXt do resource type comparison?

Thomas Dickey dickey at his.com
Mon May 30 22:54:35 UTC 2022


On Mon, May 30, 2022 at 04:31:29PM -0400, Chris Sorenson wrote:
> >
> 
> > Today's Topics:
> >
> > 1. How does libXt do resource type comparison? (Lucas de Sena)
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Fri, 27 May 2022 09:46:50 -0300
> > From: Lucas de Sena
> > To: xorg at lists.x.org
> > Subject: How does libXt do resource type comparison?
> > Message-ID:
> > Content-Type: text/plain; charset=us-ascii
> >
> > Hi,
> >
> > I'm using libXt to write some widgets, and I'm using Xt's resource
> > management system to convert string X resources to XftFont objects,
> > by setting converters and destructor functions with the
> > XtSetTypeConverter(3) routine.
> >
> > It seems that Xt can cache converted objects so it does not have to do
> > the same conversion again and again.
> >
> > However, I'm not sure how the resource management system knows whether
> > two conversions from the same from_type to the same to_type have the
> > same value in order to cache the results.
> >
> > For example, I have set a converter from String to XftFont for me to
> > draw text using Xft. How can Xt tells whether a second conversion from
> > the same String to XftFont as a previous conversion has to be cached?
> > Can I set a comparison function?
> >
> 
> Might make more sense to ask this question on the fontconfig mailing list, I'm pretty sure KeithP still reads that list:
> 
> lists.freedesktop.org/mailman/listinfo/fontconfig

maybe not: fontconfig doesn't use Xt.

One could read the source code to understand it.
I think XtDirectConvert is what Lucas is asking about:

https://gitlab.freedesktop.org/xorg/lib/libxt/-/blob/master/src/Convert.c#L644

This would be helpful as well (Xt uses Quarks for resource strings):

https://tronche.com/gui/x/xlib/resource-manager/quarks.html
https://tronche.com/gui/x/xlib/resource-manager/XrmStringToQuark.html

-- 
Thomas E. Dickey <dickey at invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20220530/0bfcdb65/attachment.sig>


More information about the xorg mailing list