[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: How does libXt do resource type comparison?
From:       Thomas Dickey <dickey () his ! com>
Date:       2022-05-30 22:54:35
Message-ID: 20220530225435.GA31511 () prl-debianold-64 ! jexium-island ! net
[Download RAW message or body]


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@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@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic