[Xcb] porting Xft and pango to XCB

Josh Triplett josh at freedesktop.org
Fri Oct 27 03:32:14 PDT 2006


Yang JianJun wrote:
> On 10/27/06, Josh Triplett <josh at freedesktop.org> wrote:
>> Yang JianJun wrote:
>>>         I have ported libXft and Pango to XCB backend, It works well
>> now.
>>> For some reasons I picked Pango-1.8 which use Xft for rendering instead
>> of
>>> cairo. I removed pangox backend in pango, just use pangoxft which build
>>> directly on the lates XCB.
>>>         The default backend of libXft is X11 ,the configure option is
>>> "--enable-xcb" if you want to use the XCB backend.The same as xft, pango
>>> also use "--enable-xcb" to enable pangoxft to build on XCB. In addition,
>>> some Xlib functions in Xft have not ported yet,includes XGetDefault and
>>> XRenderQuerySubpixelOrder. I just hard-code the default values.
>>>         All my work is available from
>>> http://svn.sourceforge.net/viewvc/gtk-xcb/. Have a look at that and let
>> me
>>> know if you have more questions.
>>>         Any suggestion is welcome, thanks!
>> Wow.  Thanks for working on this!
>>
>> I took a look at your Xft port, and tried to get it working on my
>> system.  I
>> ran into a few issues:
>>
>> * When I try to build libXft, I hit a compilation error:
>>
>> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/freetype2
>> -I/tmp/xcb-util-inst/include -Wall -Wpointer-arith -Wstrict-prototypes
>> -Wmissing-prototypes -Wmissing-declarations -Wnested-externs
>> -fno-strict-aliasing -I../include/xcb/Xft -g -O2 -MT xftdpy-xcb.lo -MD -MP
>> -MF .deps/xftdpy-xcb.Tpo -c xftdpy-xcb.c  -fPIC -DPIC -o .libs/xftdpy-
>> xcb.o
>> xftdpy-xcb.c: In function '_XftDisplayInfoGet':
>> xftdpy-xcb.c:152: error: 'XCB_PICT_FORMAT_TYPE' undeclared (first use in
>> this function)
>> xftdpy-xcb.c:152: error: (Each undeclared identifier is reported only once
>> xftdpy-xcb.c:152: error: for each function it appears in.)
>> xftdpy-xcb.c:152: error: 'XCB_PICT_FORMAT_DEPTH' undeclared (first use in
>> this function)
>> xftdpy-xcb.c:153: error: 'XCB_PICT_FORMAT_RED_MASK' undeclared (first use
>> in this function)
>> xftdpy-xcb.c:153: error: 'XCB_PICT_FORMAT_GREEN_MASK' undeclared (first
>> use in this function)
>> xftdpy-xcb.c:154: error: 'XCB_PICT_FORMAT_BLUE_MASK' undeclared (first use
>> in this function)
>> xftdpy-xcb.c:154: error: 'XCB_PICT_FORMAT_ALPHA_MASK' undeclared (first
>> use in this function)
>>
>> * I think libpixman has actually become deprecated, though I don't know
>> the
>>   suggested replacement offhand.  (Possibly this got folded into cairo.)
> 
> 
> No,these errors have nothing to do with libpixman, just because your
> xcb-util library is a little old. xcb-util has update for "Rename
> enumerations to coding standard", you should get the latest xcb-util.
> XCB_PICT_FORMAT_* now defines in xcb_renderutil.h. Can you run it then?

I did indeed have an older xcb-util checkout; good catch.  I updated to a
current checkout, and your libXft now builds with --enable-xcb.  However,
when I attempt to run programs against it, it either segfaults or hangs.

I noticed a few warnings while building; looking into them, some relate to
variables initialized by the commented-out calls to XGetDefault, but I also
noticed this one, in _XftDisplayInfoGet from line 141 of xftdpy-xcb.c onward:

    if (info->hasRender)
    {
                        int major, minor;

                        ver_rep = xcb_render_query_version_reply (dpy,xcb_render_query_version (dpy,major, minor),NULL);
                        major = ver_rep->major_version;
                        minor = ver_rep->minor_version;

                        if (major < 0 || (major == 0 && minor <= 2))
                            info->use_free_glyphs = FcFalse;

This code passes the uninitialized local variables major and minor to
xcb_render_query_version as the client-supported major and minor Render
version, before using them to hold the negotiated version.

Also, the point about libpixman deprecation didn't relate to the error
messages.

- Josh Triplett

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061027/85ffa049/signature-0001.pgp


More information about the Xcb mailing list