зеркало из https://github.com/github/putty.git
f750a18587
We're going to have to use Cairo in the GTK3 port, because that's all GTK3 supports; but we still need old-style GDK for GTK1 support, and also for performance reasons in GTK2 (see below). Hence, this change completely restructures GTK PuTTY's drawing code so that there's a central 'drawing context' structure which contains a type code indicating GDK or Cairo, and then either some GDK gubbins or some Cairo gubbins as appropriate; all actual drawing is abstracted through a set of routines which test the type code in that structure and do one thing or another. And because the type code is tested at run time, both sets of drawing primitives can be compiled in at once, and where possible, they will be. X server-side bitmap fonts are still supported in the Cairo world, but because Cairo drawing is entirely client-side, they have to work by cheekily downloading each glyph bitmap from the server when it's first needed, and building up a client-side cache of 'cairo_surface_t's containing the bitmaps with which we then draw on the window. This technique works, but it's rather slow; hence, even in GTK2, we keep the GDK drawing back end compiled in, and switch over to it when the main selected font is a bitmap one. One visible effect of the new Cairo routines is in the double-width and double-height text you can get by sending ESC # 3, ESC # 4 and ESC # 6 escape sequences. In GDK, that's always been done by a really horrible process of manually scaling the bitmap, server-side, column by column and row by row, causing each pixel to be exactly doubled or quadrupled. But in Cairo, we can just set a transformation matrix, and then that takes effect _before_ the scalable fonts are rendered - so the results are visibly nicer, and use all the available resolution. (Sadly, if you're using a server-side bitmap font as your primary one, then the GDK backend will be selected for all drawing in the terminal as a whole - so in that situation, even fallback characters absent from the primary font and rendered by Pango will get the old GDK scaling treatment. It's only if your main font is scalable, so that the Cairo backend is selected, that DW/DH characters will come out looking nice.) |
||
---|---|---|
.. | ||
configure | ||
gtkask.c | ||
gtkcfg.c | ||
gtkcols.c | ||
gtkcols.h | ||
gtkcompat.h | ||
gtkdlg.c | ||
gtkfont.c | ||
gtkfont.h | ||
gtkwin.c | ||
unix.h | ||
ux_x11.c | ||
uxagentc.c | ||
uxcfg.c | ||
uxcons.c | ||
uxgen.c | ||
uxgss.c | ||
uxmisc.c | ||
uxnet.c | ||
uxnoise.c | ||
uxpeer.c | ||
uxpgnt.c | ||
uxplink.c | ||
uxprint.c | ||
uxproxy.c | ||
uxpterm.c | ||
uxpty.c | ||
uxputty.c | ||
uxsel.c | ||
uxser.c | ||
uxsftp.c | ||
uxshare.c | ||
uxsignal.c | ||
uxstore.c | ||
uxucs.c | ||
xkeysym.c | ||
xpmptcfg.c | ||
xpmpterm.c | ||
xpmpucfg.c | ||
xpmputty.c |