| ofs | hex dump | ascii |
|---|
| 0000 | 56 69 6d 9f 55 6e 44 6f e5 00 03 80 1a fc 88 a0 40 b2 05 79 96 8e 44 b5 de e9 87 eb d3 ca 80 d9 | Vim.UnDo........@..y..D......... |
| 0020 | f0 e5 c2 aa ed ee 87 7e 87 b6 74 00 00 02 65 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 01 00 | .......~..t...e................. |
| 0040 | 00 00 02 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00 02 00 00 00 00 69 a1 10 e7 04 01 00 00 00 | .......................i........ |
| 0060 | 01 00 5f d0 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 0c 00 00 00 00 | .._............................. |
| 0080 | 00 00 00 00 ff ff ff ff 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0100 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0120 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0140 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 01e0 | 00 00 00 00 00 00 69 a1 10 e5 04 01 00 00 00 00 00 f5 18 00 00 00 0b 00 00 00 0d 00 00 02 81 00 | ......i......................... |
| 0200 | 00 00 01 00 00 00 00 f5 18 00 00 00 0c 00 00 00 0d 00 00 02 81 00 00 00 00 f5 18 00 00 00 0b 00 | ................................ |
| 0220 | 00 00 0d 00 00 02 80 00 00 00 00 35 81 f5 18 00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 | ...........5.................... |
| 0240 | 00 00 00 01 00 00 00 00 00 00 00 e4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 | ................................ |
| 0260 | 00 00 00 f5 18 00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 | ................................ |
| 0280 | 00 e4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 35 81 5f d0 00 00 00 | .........................5._.... |
| 02a0 | 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 0c 00 00 00 10 00 00 00 00 ff ff ff | ................................ |
| 02c0 | ff 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 02e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0300 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0320 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0340 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0360 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0380 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 03a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 03c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 03e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0400 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 69 | ...............................i |
| 0420 | a1 10 e6 04 01 00 00 00 01 00 f5 18 00 00 00 01 00 00 02 65 00 00 02 81 00 00 02 7f 00 00 00 12 | ...................e............ |
| 0440 | 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 00 00 00 13 23 69 6e 63 6c 75 64 65 20 3c | #include.<stdio.h>....#include.< |
| 0460 | 73 74 64 6c 69 62 2e 68 3e 00 00 00 13 23 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67 2e 68 3e | stdlib.h>....#include.<string.h> |
| 0480 | 00 00 00 15 23 69 6e 63 6c 75 64 65 20 3c 58 31 31 2f 58 6c 69 62 2e 68 3e 00 00 00 18 23 69 6e | ....#include.<X11/Xlib.h>....#in |
| 04a0 | 63 6c 75 64 65 20 3c 58 31 31 2f 58 66 74 2f 58 66 74 2e 68 3e 00 00 00 00 00 00 00 10 23 69 6e | clude.<X11/Xft/Xft.h>........#in |
| 04c0 | 63 6c 75 64 65 20 22 64 72 77 2e 68 22 00 00 00 11 23 69 6e 63 6c 75 64 65 20 22 75 74 69 6c 2e | clude."drw.h"....#include."util. |
| 04e0 | 68 22 00 00 00 00 00 00 00 1a 23 64 65 66 69 6e 65 20 55 54 46 5f 49 4e 56 41 4c 49 44 20 30 78 | h"........#define.UTF_INVALID.0x |
| 0500 | 46 46 46 44 00 00 00 11 23 64 65 66 69 6e 65 20 55 54 46 5f 53 49 5a 20 34 00 00 00 00 00 00 00 | FFFD....#define.UTF_SIZ.4....... |
| 0520 | 0a 73 74 61 74 69 63 20 69 6e 74 00 00 00 2f 75 74 66 38 64 65 63 6f 64 65 28 63 6f 6e 73 74 20 | .static.int.../utf8decode(const. |
| 0540 | 63 68 61 72 20 2a 73 5f 69 6e 2c 20 6c 6f 6e 67 20 2a 75 2c 20 69 6e 74 20 2a 65 72 72 29 00 00 | char.*s_in,.long.*u,.int.*err).. |
| 0560 | 00 01 7b 00 00 00 26 09 73 74 61 74 69 63 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 | ..{...&.static.const.unsigned.ch |
| 0580 | 61 72 20 6c 65 6e 73 5b 5d 20 3d 20 7b 00 00 00 3d 09 09 2f 2a 20 30 58 58 58 58 20 2a 2f 20 31 | ar.lens[].=.{...=../*.0XXXX.*/.1 |
| 05a0 | 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 20 | ,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,. |
| 05c0 | 31 2c 20 31 2c 20 31 2c 20 31 2c 20 31 2c 00 00 00 34 09 09 2f 2a 20 31 30 58 58 58 20 2a 2f 20 | 1,.1,.1,.1,.1,...4../*.10XXX.*/. |
| 05e0 | 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 20 2f 2a 20 69 6e 76 61 | 0,.0,.0,.0,.0,.0,.0,.0,../*.inva |
| 0600 | 6c 69 64 20 2a 2f 00 00 00 19 09 09 2f 2a 20 31 31 30 58 58 20 2a 2f 20 32 2c 20 32 2c 20 32 2c | lid.*/....../*.110XX.*/.2,.2,.2, |
| 0620 | 20 32 2c 00 00 00 13 09 09 2f 2a 20 31 31 31 30 58 20 2a 2f 20 33 2c 20 33 2c 00 00 00 10 09 09 | .2,....../*.1110X.*/.3,.3,...... |
| 0640 | 2f 2a 20 31 31 31 31 30 20 2a 2f 20 34 2c 00 00 00 1f 09 09 2f 2a 20 31 31 31 31 31 20 2a 2f 20 | /*.11110.*/.4,....../*.11111.*/. |
| 0660 | 30 2c 20 20 2f 2a 20 69 6e 76 61 6c 69 64 20 2a 2f 00 00 00 03 09 7d 3b 00 00 00 48 09 73 74 61 | 0,../*.invalid.*/.....};...H.sta |
| 0680 | 74 69 63 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 6c 65 61 64 69 6e 67 5f | tic.const.unsigned.char.leading_ |
| 06a0 | 6d 61 73 6b 5b 5d 20 3d 20 7b 20 30 78 37 46 2c 20 30 78 31 46 2c 20 30 78 30 46 2c 20 30 78 30 | mask[].=.{.0x7F,.0x1F,.0x0F,.0x0 |
| 06c0 | 37 20 7d 3b 00 00 00 47 09 73 74 61 74 69 63 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 69 | 7.};...G.static.const.unsigned.i |
| 06e0 | 6e 74 20 6f 76 65 72 6c 6f 6e 67 5b 5d 20 3d 20 7b 20 30 78 30 2c 20 30 78 38 30 2c 20 30 78 30 | nt.overlong[].=.{.0x0,.0x80,.0x0 |
| 0700 | 38 30 30 2c 20 30 78 31 30 30 30 30 20 7d 3b 00 00 00 00 00 00 00 36 09 63 6f 6e 73 74 20 75 6e | 800,.0x10000.};.......6.const.un |
| 0720 | 73 69 67 6e 65 64 20 63 68 61 72 20 2a 73 20 3d 20 28 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 | signed.char.*s.=.(const.unsigned |
| 0740 | 20 63 68 61 72 20 2a 29 73 5f 69 6e 3b 00 00 00 19 09 69 6e 74 20 6c 65 6e 20 3d 20 6c 65 6e 73 | .char.*)s_in;.....int.len.=.lens |
| 0760 | 5b 2a 73 20 3e 3e 20 33 5d 3b 00 00 00 12 09 2a 75 20 3d 20 55 54 46 5f 49 4e 56 41 4c 49 44 3b | [*s.>>.3];.....*u.=.UTF_INVALID; |
| 0780 | 00 00 00 0a 09 2a 65 72 72 20 3d 20 31 3b 00 00 00 0e 09 69 66 20 28 6c 65 6e 20 3d 3d 20 30 29 | .....*err.=.1;.....if.(len.==.0) |
| 07a0 | 00 00 00 0b 09 09 72 65 74 75 72 6e 20 31 3b 00 00 00 00 00 00 00 28 09 6c 6f 6e 67 20 63 70 20 | ......return.1;.......(.long.cp. |
| 07c0 | 3d 20 73 5b 30 5d 20 26 20 6c 65 61 64 69 6e 67 5f 6d 61 73 6b 5b 6c 65 6e 20 2d 20 31 5d 3b 00 | =.s[0].&.leading_mask[len.-.1];. |
| 07e0 | 00 00 20 09 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 31 3b 20 69 20 3c 20 6c 65 6e 3b 20 2b 2b 69 | ....for.(int.i.=.1;.i.<.len;.++i |
| 0800 | 29 20 7b 00 00 00 2c 09 09 69 66 20 28 73 5b 69 5d 20 3d 3d 20 27 5c 30 27 20 7c 7c 20 28 73 5b | ).{...,..if.(s[i].==.'\0'.||.(s[ |
| 0820 | 69 5d 20 26 20 30 78 43 30 29 20 21 3d 20 30 78 38 30 29 00 00 00 0c 09 09 09 72 65 74 75 72 6e | i].&.0xC0).!=.0x80).......return |
| 0840 | 20 69 3b 00 00 00 21 09 09 63 70 20 3d 20 28 63 70 20 3c 3c 20 36 29 20 7c 20 28 73 5b 69 5d 20 | .i;...!..cp.=.(cp.<<.6).|.(s[i]. |
| 0860 | 26 20 30 78 33 46 29 3b 00 00 00 02 09 7d 00 00 00 31 09 2f 2a 20 6f 75 74 20 6f 66 20 72 61 6e | &.0x3F);.....}...1./*.out.of.ran |
| 0880 | 67 65 2c 20 73 75 72 72 6f 67 61 74 65 2c 20 6f 76 65 72 6c 6f 6e 67 20 65 6e 63 6f 64 69 6e 67 | ge,.surrogate,.overlong.encoding |
| 08a0 | 20 2a 2f 00 00 00 43 09 69 66 20 28 63 70 20 3e 20 30 78 31 30 46 46 46 46 20 7c 7c 20 28 63 70 | .*/...C.if.(cp.>.0x10FFFF.||.(cp |
| 08c0 | 20 3e 3e 20 31 31 29 20 3d 3d 20 30 78 31 42 20 7c 7c 20 63 70 20 3c 20 6f 76 65 72 6c 6f 6e 67 | .>>.11).==.0x1B.||.cp.<.overlong |
| 08e0 | 5b 6c 65 6e 20 2d 20 31 5d 29 00 00 00 0d 09 09 72 65 74 75 72 6e 20 6c 65 6e 3b 00 00 00 00 00 | [len.-.1])......return.len;..... |
| 0900 | 00 00 0a 09 2a 65 72 72 20 3d 20 30 3b 00 00 00 09 09 2a 75 20 3d 20 63 70 3b 00 00 00 0c 09 72 | ....*err.=.0;.....*u.=.cp;.....r |
| 0920 | 65 74 75 72 6e 20 6c 65 6e 3b 00 00 00 01 7d 00 00 00 00 00 00 00 05 44 72 77 20 2a 00 00 00 51 | eturn.len;....}........Drw.*...Q |
| 0940 | 64 72 77 5f 63 72 65 61 74 65 28 44 69 73 70 6c 61 79 20 2a 64 70 79 2c 20 69 6e 74 20 73 63 72 | drw_create(Display.*dpy,.int.scr |
| 0960 | 65 65 6e 2c 20 57 69 6e 64 6f 77 20 72 6f 6f 74 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 77 | een,.Window.root,.unsigned.int.w |
| 0980 | 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 68 29 00 00 00 01 7b 00 00 00 24 09 44 72 77 20 2a | ,.unsigned.int.h)....{...$.Drw.* |
| 09a0 | 64 72 77 20 3d 20 65 63 61 6c 6c 6f 63 28 31 2c 20 73 69 7a 65 6f 66 28 44 72 77 29 29 3b 00 00 | drw.=.ecalloc(1,.sizeof(Drw));.. |
| 09c0 | 00 00 00 00 00 10 09 64 72 77 2d 3e 64 70 79 20 3d 20 64 70 79 3b 00 00 00 16 09 64 72 77 2d 3e | .......drw->dpy.=.dpy;.....drw-> |
| 09e0 | 73 63 72 65 65 6e 20 3d 20 73 63 72 65 65 6e 3b 00 00 00 12 09 64 72 77 2d 3e 72 6f 6f 74 20 3d | screen.=.screen;.....drw->root.= |
| 0a00 | 20 72 6f 6f 74 3b 00 00 00 0c 09 64 72 77 2d 3e 77 20 3d 20 77 3b 00 00 00 0c 09 64 72 77 2d 3e | .root;.....drw->w.=.w;.....drw-> |
| 0a20 | 68 20 3d 20 68 3b 00 00 00 4b 09 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 20 3d 20 58 43 72 65 61 | h.=.h;...K.drw->drawable.=.XCrea |
| 0a40 | 74 65 50 69 78 6d 61 70 28 64 70 79 2c 20 72 6f 6f 74 2c 20 77 2c 20 68 2c 20 44 65 66 61 75 6c | tePixmap(dpy,.root,.w,.h,.Defaul |
| 0a60 | 74 44 65 70 74 68 28 64 70 79 2c 20 73 63 72 65 65 6e 29 29 3b 00 00 00 29 09 64 72 77 2d 3e 67 | tDepth(dpy,.screen));...).drw->g |
| 0a80 | 63 20 3d 20 58 43 72 65 61 74 65 47 43 28 64 70 79 2c 20 72 6f 6f 74 2c 20 30 2c 20 4e 55 4c 4c | c.=.XCreateGC(dpy,.root,.0,.NULL |
| 0aa0 | 29 3b 00 00 00 44 09 58 53 65 74 4c 69 6e 65 41 74 74 72 69 62 75 74 65 73 28 64 70 79 2c 20 64 | );...D.XSetLineAttributes(dpy,.d |
| 0ac0 | 72 77 2d 3e 67 63 2c 20 31 2c 20 4c 69 6e 65 53 6f 6c 69 64 2c 20 43 61 70 42 75 74 74 2c 20 4a | rw->gc,.1,.LineSolid,.CapButt,.J |
| 0ae0 | 6f 69 6e 4d 69 74 65 72 29 3b 00 00 00 00 00 00 00 0c 09 72 65 74 75 72 6e 20 64 72 77 3b 00 00 | oinMiter);.........return.drw;.. |
| 0b00 | 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 34 64 72 77 5f 72 65 73 69 7a 65 28 44 72 | ..}........void...4drw_resize(Dr |
| 0b20 | 77 20 2a 64 72 77 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 77 2c 20 75 6e 73 69 67 6e 65 64 | w.*drw,.unsigned.int.w,.unsigned |
| 0b40 | 20 69 6e 74 20 68 29 00 00 00 01 7b 00 00 00 0a 09 69 66 20 28 21 64 72 77 29 00 00 00 09 09 09 | .int.h)....{.....if.(!drw)...... |
| 0b60 | 72 65 74 75 72 6e 3b 00 00 00 00 00 00 00 0c 09 64 72 77 2d 3e 77 20 3d 20 77 3b 00 00 00 0c 09 | return;.........drw->w.=.w;..... |
| 0b80 | 64 72 77 2d 3e 68 20 3d 20 68 3b 00 00 00 13 09 69 66 20 28 64 72 77 2d 3e 64 72 61 77 61 62 6c | drw->h.=.h;.....if.(drw->drawabl |
| 0ba0 | 65 29 00 00 00 27 09 09 58 46 72 65 65 50 69 78 6d 61 70 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 | e)...'..XFreePixmap(drw->dpy,.dr |
| 0bc0 | 77 2d 3e 64 72 61 77 61 62 6c 65 29 3b 00 00 00 5f 09 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 20 | w->drawable);..._.drw->drawable. |
| 0be0 | 3d 20 58 43 72 65 61 74 65 50 69 78 6d 61 70 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 72 | =.XCreatePixmap(drw->dpy,.drw->r |
| 0c00 | 6f 6f 74 2c 20 77 2c 20 68 2c 20 44 65 66 61 75 6c 74 44 65 70 74 68 28 64 72 77 2d 3e 64 70 79 | oot,.w,.h,.DefaultDepth(drw->dpy |
| 0c20 | 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 | ,.drw->screen));....}........voi |
| 0c40 | 64 00 00 00 12 64 72 77 5f 66 72 65 65 28 44 72 77 20 2a 64 72 77 29 00 00 00 01 7b 00 00 00 26 | d....drw_free(Drw.*drw)....{...& |
| 0c60 | 09 58 46 72 65 65 50 69 78 6d 61 70 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 77 | .XFreePixmap(drw->dpy,.drw->draw |
| 0c80 | 61 62 6c 65 29 3b 00 00 00 1c 09 58 46 72 65 65 47 43 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 | able);.....XFreeGC(drw->dpy,.drw |
| 0ca0 | 2d 3e 67 63 29 3b 00 00 00 1e 09 64 72 77 5f 66 6f 6e 74 73 65 74 5f 66 72 65 65 28 64 72 77 2d | ->gc);.....drw_fontset_free(drw- |
| 0cc0 | 3e 66 6f 6e 74 73 29 3b 00 00 00 0b 09 66 72 65 65 28 64 72 77 29 3b 00 00 00 01 7d 00 00 00 00 | >fonts);.....free(drw);....}.... |
| 0ce0 | 00 00 00 46 2f 2a 20 54 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 61 6e 20 69 6d 70 6c 65 | ...F/*.This.function.is.an.imple |
| 0d00 | 6d 65 6e 74 61 74 69 6f 6e 20 64 65 74 61 69 6c 2e 20 4c 69 62 72 61 72 79 20 75 73 65 72 73 20 | mentation.detail..Library.users. |
| 0d20 | 73 68 6f 75 6c 64 20 75 73 65 00 00 00 1e 20 2a 20 64 72 77 5f 66 6f 6e 74 73 65 74 5f 63 72 65 | should.use.....*.drw_fontset_cre |
| 0d40 | 61 74 65 20 69 6e 73 74 65 61 64 2e 00 00 00 03 20 2a 2f 00 00 00 0c 73 74 61 74 69 63 20 46 6e | ate.instead......*/....static.Fn |
| 0d60 | 74 20 2a 00 00 00 44 78 66 6f 6e 74 5f 63 72 65 61 74 65 28 44 72 77 20 2a 64 72 77 2c 20 63 6f | t.*...Dxfont_create(Drw.*drw,.co |
| 0d80 | 6e 73 74 20 63 68 61 72 20 2a 66 6f 6e 74 6e 61 6d 65 2c 20 46 63 50 61 74 74 65 72 6e 20 2a 66 | nst.char.*fontname,.FcPattern.*f |
| 0da0 | 6f 6e 74 70 61 74 74 65 72 6e 29 00 00 00 01 7b 00 00 00 0b 09 46 6e 74 20 2a 66 6f 6e 74 3b 00 | ontpattern)....{.....Fnt.*font;. |
| 0dc0 | 00 00 17 09 58 66 74 46 6f 6e 74 20 2a 78 66 6f 6e 74 20 3d 20 4e 55 4c 4c 3b 00 00 00 1b 09 46 | ....XftFont.*xfont.=.NULL;.....F |
| 0de0 | 63 50 61 74 74 65 72 6e 20 2a 70 61 74 74 65 72 6e 20 3d 20 4e 55 4c 4c 3b 00 00 00 00 00 00 00 | cPattern.*pattern.=.NULL;....... |
| 0e00 | 10 09 69 66 20 28 66 6f 6e 74 6e 61 6d 65 29 20 7b 00 00 00 47 09 09 2f 2a 20 55 73 69 6e 67 20 | ..if.(fontname).{...G../*.Using. |
| 0e20 | 74 68 65 20 70 61 74 74 65 72 6e 20 66 6f 75 6e 64 20 61 74 20 66 6f 6e 74 2d 3e 78 66 6f 6e 74 | the.pattern.found.at.font->xfont |
| 0e40 | 2d 3e 70 61 74 74 65 72 6e 20 64 6f 65 73 20 6e 6f 74 20 79 69 65 6c 64 20 74 68 65 00 00 00 3f | ->pattern.does.not.yield.the...? |
| 0e60 | 09 09 20 2a 20 73 61 6d 65 20 73 75 62 73 74 69 74 75 74 69 6f 6e 20 72 65 73 75 6c 74 73 20 61 | ...*.same.substitution.results.a |
| 0e80 | 73 20 75 73 69 6e 67 20 74 68 65 20 70 61 74 74 65 72 6e 20 72 65 74 75 72 6e 65 64 20 62 79 00 | s.using.the.pattern.returned.by. |
| 0ea0 | 00 00 42 09 09 20 2a 20 46 63 4e 61 6d 65 50 61 72 73 65 3b 20 75 73 69 6e 67 20 74 68 65 20 6c | ..B...*.FcNameParse;.using.the.l |
| 0ec0 | 61 74 74 65 72 20 72 65 73 75 6c 74 73 20 69 6e 20 74 68 65 20 64 65 73 69 72 65 64 20 66 61 6c | atter.results.in.the.desired.fal |
| 0ee0 | 6c 62 61 63 6b 00 00 00 43 09 09 20 2a 20 62 65 68 61 76 69 6f 75 72 20 77 68 65 72 65 61 73 20 | lback...C...*.behaviour.whereas. |
| 0f00 | 74 68 65 20 66 6f 72 6d 65 72 20 6a 75 73 74 20 72 65 73 75 6c 74 73 20 69 6e 20 6d 69 73 73 69 | the.former.just.results.in.missi |
| 0f20 | 6e 67 2d 63 68 61 72 61 63 74 65 72 00 00 00 39 09 09 20 2a 20 72 65 63 74 61 6e 67 6c 65 73 20 | ng-character...9...*.rectangles. |
| 0f40 | 62 65 69 6e 67 20 64 72 61 77 6e 2c 20 61 74 20 6c 65 61 73 74 20 77 69 74 68 20 73 6f 6d 65 20 | being.drawn,.at.least.with.some. |
| 0f60 | 66 6f 6e 74 73 2e 20 2a 2f 00 00 00 44 09 09 69 66 20 28 21 28 78 66 6f 6e 74 20 3d 20 58 66 74 | fonts..*/...D..if.(!(xfont.=.Xft |
| 0f80 | 46 6f 6e 74 4f 70 65 6e 4e 61 6d 65 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 | FontOpenName(drw->dpy,.drw->scre |
| 0fa0 | 65 6e 2c 20 66 6f 6e 74 6e 61 6d 65 29 29 29 20 7b 00 00 00 4a 09 09 09 66 70 72 69 6e 74 66 28 | en,.fontname))).{...J...fprintf( |
| 0fc0 | 73 74 64 65 72 72 2c 20 22 65 72 72 6f 72 2c 20 63 61 6e 6e 6f 74 20 6c 6f 61 64 20 66 6f 6e 74 | stderr,."error,.cannot.load.font |
| 0fe0 | 20 66 72 6f 6d 20 6e 61 6d 65 3a 20 27 25 73 27 5c 6e 22 2c 20 66 6f 6e 74 6e 61 6d 65 29 3b 00 | .from.name:.'%s'\n",.fontname);. |
| 1000 | 00 00 0f 09 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c 3b 00 00 00 03 09 09 7d 00 00 00 37 09 09 69 | ......return.NULL;......}...7..i |
| 1020 | 66 20 28 21 28 70 61 74 74 65 72 6e 20 3d 20 46 63 4e 61 6d 65 50 61 72 73 65 28 28 46 63 43 68 | f.(!(pattern.=.FcNameParse((FcCh |
| 1040 | 61 72 38 20 2a 29 20 66 6f 6e 74 6e 61 6d 65 29 29 29 20 7b 00 00 00 51 09 09 09 66 70 72 69 6e | ar8.*).fontname))).{...Q...fprin |
| 1060 | 74 66 28 73 74 64 65 72 72 2c 20 22 65 72 72 6f 72 2c 20 63 61 6e 6e 6f 74 20 70 61 72 73 65 20 | tf(stderr,."error,.cannot.parse. |
| 1080 | 66 6f 6e 74 20 6e 61 6d 65 20 74 6f 20 70 61 74 74 65 72 6e 3a 20 27 25 73 27 5c 6e 22 2c 20 66 | font.name.to.pattern:.'%s'\n",.f |
| 10a0 | 6f 6e 74 6e 61 6d 65 29 3b 00 00 00 21 09 09 09 58 66 74 46 6f 6e 74 43 6c 6f 73 65 28 64 72 77 | ontname);...!...XftFontClose(drw |
| 10c0 | 2d 3e 64 70 79 2c 20 78 66 6f 6e 74 29 3b 00 00 00 0f 09 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c | ->dpy,.xfont);.......return.NULL |
| 10e0 | 3b 00 00 00 03 09 09 7d 00 00 00 1a 09 7d 20 65 6c 73 65 20 69 66 20 28 66 6f 6e 74 70 61 74 74 | ;......}.....}.else.if.(fontpatt |
| 1100 | 65 72 6e 29 20 7b 00 00 00 3d 09 09 69 66 20 28 21 28 78 66 6f 6e 74 20 3d 20 58 66 74 46 6f 6e | ern).{...=..if.(!(xfont.=.XftFon |
| 1120 | 74 4f 70 65 6e 50 61 74 74 65 72 6e 28 64 72 77 2d 3e 64 70 79 2c 20 66 6f 6e 74 70 61 74 74 65 | tOpenPattern(drw->dpy,.fontpatte |
| 1140 | 72 6e 29 29 29 20 7b 00 00 00 3e 09 09 09 66 70 72 69 6e 74 66 28 73 74 64 65 72 72 2c 20 22 65 | rn))).{...>...fprintf(stderr,."e |
| 1160 | 72 72 6f 72 2c 20 63 61 6e 6e 6f 74 20 6c 6f 61 64 20 66 6f 6e 74 20 66 72 6f 6d 20 70 61 74 74 | rror,.cannot.load.font.from.patt |
| 1180 | 65 72 6e 2e 5c 6e 22 29 3b 00 00 00 0f 09 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c 3b 00 00 00 03 | ern.\n");.......return.NULL;.... |
| 11a0 | 09 09 7d 00 00 00 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 1c 09 09 64 69 65 28 22 6e 6f 20 66 6f | ..}.....}.else.{......die("no.fo |
| 11c0 | 6e 74 20 73 70 65 63 69 66 69 65 64 2e 22 29 3b 00 00 00 02 09 7d 00 00 00 00 00 00 00 20 09 66 | nt.specified.");.....}.........f |
| 11e0 | 6f 6e 74 20 3d 20 65 63 61 6c 6c 6f 63 28 31 2c 20 73 69 7a 65 6f 66 28 46 6e 74 29 29 3b 00 00 | ont.=.ecalloc(1,.sizeof(Fnt));.. |
| 1200 | 00 15 09 66 6f 6e 74 2d 3e 78 66 6f 6e 74 20 3d 20 78 66 6f 6e 74 3b 00 00 00 19 09 66 6f 6e 74 | ...font->xfont.=.xfont;.....font |
| 1220 | 2d 3e 70 61 74 74 65 72 6e 20 3d 20 70 61 74 74 65 72 6e 3b 00 00 00 2a 09 66 6f 6e 74 2d 3e 68 | ->pattern.=.pattern;...*.font->h |
| 1240 | 20 3d 20 78 66 6f 6e 74 2d 3e 61 73 63 65 6e 74 20 2b 20 78 66 6f 6e 74 2d 3e 64 65 73 63 65 6e | .=.xfont->ascent.+.xfont->descen |
| 1260 | 74 3b 00 00 00 16 09 66 6f 6e 74 2d 3e 64 70 79 20 3d 20 64 72 77 2d 3e 64 70 79 3b 00 00 00 00 | t;.....font->dpy.=.drw->dpy;.... |
| 1280 | 00 00 00 0d 09 72 65 74 75 72 6e 20 66 6f 6e 74 3b 00 00 00 01 7d 00 00 00 00 00 00 00 0b 73 74 | .....return.font;....}........st |
| 12a0 | 61 74 69 63 20 76 6f 69 64 00 00 00 15 78 66 6f 6e 74 5f 66 72 65 65 28 46 6e 74 20 2a 66 6f 6e | atic.void....xfont_free(Fnt.*fon |
| 12c0 | 74 29 00 00 00 01 7b 00 00 00 0b 09 69 66 20 28 21 66 6f 6e 74 29 00 00 00 09 09 09 72 65 74 75 | t)....{.....if.(!font)......retu |
| 12e0 | 72 6e 3b 00 00 00 13 09 69 66 20 28 66 6f 6e 74 2d 3e 70 61 74 74 65 72 6e 29 00 00 00 22 09 09 | rn;.....if.(font->pattern)...".. |
| 1300 | 46 63 50 61 74 74 65 72 6e 44 65 73 74 72 6f 79 28 66 6f 6e 74 2d 3e 70 61 74 74 65 72 6e 29 3b | FcPatternDestroy(font->pattern); |
| 1320 | 00 00 00 26 09 58 66 74 46 6f 6e 74 43 6c 6f 73 65 28 66 6f 6e 74 2d 3e 64 70 79 2c 20 66 6f 6e | ...&.XftFontClose(font->dpy,.fon |
| 1340 | 74 2d 3e 78 66 6f 6e 74 29 3b 00 00 00 0c 09 66 72 65 65 28 66 6f 6e 74 29 3b 00 00 00 01 7d 00 | t->xfont);.....free(font);....}. |
| 1360 | 00 00 00 00 00 00 04 46 6e 74 2a 00 00 00 43 64 72 77 5f 66 6f 6e 74 73 65 74 5f 63 72 65 61 74 | .......Fnt*...Cdrw_fontset_creat |
| 1380 | 65 28 44 72 77 2a 20 64 72 77 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 66 6f 6e 74 73 5b 5d 2c | e(Drw*.drw,.const.char.*fonts[], |
| 13a0 | 20 73 69 7a 65 5f 74 20 66 6f 6e 74 63 6f 75 6e 74 29 00 00 00 01 7b 00 00 00 17 09 46 6e 74 20 | .size_t.fontcount)....{.....Fnt. |
| 13c0 | 2a 63 75 72 2c 20 2a 72 65 74 20 3d 20 4e 55 4c 4c 3b 00 00 00 0a 09 73 69 7a 65 5f 74 20 69 3b | *cur,.*ret.=.NULL;.....size_t.i; |
| 13e0 | 00 00 00 00 00 00 00 14 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 66 6f 6e 74 73 29 00 00 00 0e | .........if.(!drw.||.!fonts).... |
| 1400 | 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c 3b 00 00 00 00 00 00 00 23 09 66 6f 72 20 28 69 20 3d 20 | ..return.NULL;.......#.for.(i.=. |
| 1420 | 31 3b 20 69 20 3c 3d 20 66 6f 6e 74 63 6f 75 6e 74 3b 20 69 2b 2b 29 20 7b 00 00 00 3e 09 09 69 | 1;.i.<=.fontcount;.i++).{...>..i |
| 1440 | 66 20 28 28 63 75 72 20 3d 20 78 66 6f 6e 74 5f 63 72 65 61 74 65 28 64 72 77 2c 20 66 6f 6e 74 | f.((cur.=.xfont_create(drw,.font |
| 1460 | 73 5b 66 6f 6e 74 63 6f 75 6e 74 20 2d 20 69 5d 2c 20 4e 55 4c 4c 29 29 29 20 7b 00 00 00 13 09 | s[fontcount.-.i],.NULL))).{..... |
| 1480 | 09 09 63 75 72 2d 3e 6e 65 78 74 20 3d 20 72 65 74 3b 00 00 00 0d 09 09 09 72 65 74 20 3d 20 63 | ..cur->next.=.ret;.......ret.=.c |
| 14a0 | 75 72 3b 00 00 00 03 09 09 7d 00 00 00 02 09 7d 00 00 00 1b 09 72 65 74 75 72 6e 20 28 64 72 77 | ur;......}.....}.....return.(drw |
| 14c0 | 2d 3e 66 6f 6e 74 73 20 3d 20 72 65 74 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 | ->fonts.=.ret);....}........void |
| 14e0 | 00 00 00 1b 64 72 77 5f 66 6f 6e 74 73 65 74 5f 66 72 65 65 28 46 6e 74 20 2a 66 6f 6e 74 29 00 | ....drw_fontset_free(Fnt.*font). |
| 1500 | 00 00 01 7b 00 00 00 0c 09 69 66 20 28 66 6f 6e 74 29 20 7b 00 00 00 1f 09 09 64 72 77 5f 66 6f | ...{.....if.(font).{......drw_fo |
| 1520 | 6e 74 73 65 74 5f 66 72 65 65 28 66 6f 6e 74 2d 3e 6e 65 78 74 29 3b 00 00 00 13 09 09 78 66 6f | ntset_free(font->next);......xfo |
| 1540 | 6e 74 5f 66 72 65 65 28 66 6f 6e 74 29 3b 00 00 00 02 09 7d 00 00 00 01 7d 00 00 00 00 00 00 00 | nt_free(font);.....}....}....... |
| 1560 | 04 76 6f 69 64 00 00 00 38 64 72 77 5f 63 6c 72 5f 63 72 65 61 74 65 28 44 72 77 20 2a 64 72 77 | .void...8drw_clr_create(Drw.*drw |
| 1580 | 2c 20 43 6c 72 20 2a 64 65 73 74 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 63 6c 72 6e 61 6d 65 | ,.Clr.*dest,.const.char.*clrname |
| 15a0 | 29 00 00 00 01 7b 00 00 00 1f 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 64 65 73 74 20 7c 7c 20 | )....{.....if.(!drw.||.!dest.||. |
| 15c0 | 21 63 6c 72 6e 61 6d 65 29 00 00 00 09 09 09 72 65 74 75 72 6e 3b 00 00 00 00 00 00 00 47 09 69 | !clrname)......return;.......G.i |
| 15e0 | 66 20 28 21 58 66 74 43 6f 6c 6f 72 41 6c 6c 6f 63 4e 61 6d 65 28 64 72 77 2d 3e 64 70 79 2c 20 | f.(!XftColorAllocName(drw->dpy,. |
| 1600 | 44 65 66 61 75 6c 74 56 69 73 75 61 6c 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 | DefaultVisual(drw->dpy,.drw->scr |
| 1620 | 65 65 6e 29 2c 00 00 00 3f 09 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | een),...?....................... |
| 1640 | 20 44 65 66 61 75 6c 74 43 6f 6c 6f 72 6d 61 70 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e | .DefaultColormap(drw->dpy,.drw-> |
| 1660 | 73 63 72 65 65 6e 29 2c 00 00 00 27 09 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | screen),...'.................... |
| 1680 | 20 20 20 20 63 6c 72 6e 61 6d 65 2c 20 64 65 73 74 29 29 00 00 00 34 09 09 64 69 65 28 22 65 72 | ....clrname,.dest))...4..die("er |
| 16a0 | 72 6f 72 2c 20 63 61 6e 6e 6f 74 20 61 6c 6c 6f 63 61 74 65 20 63 6f 6c 6f 72 20 27 25 73 27 22 | ror,.cannot.allocate.color.'%s'" |
| 16c0 | 2c 20 63 6c 72 6e 61 6d 65 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 1b 2f 2a 20 43 72 65 61 74 | ,.clrname);....}......../*.Creat |
| 16e0 | 65 20 63 6f 6c 6f 72 20 73 63 68 65 6d 65 73 2e 20 2a 2f 00 00 00 05 43 6c 72 20 2a 00 00 00 41 | e.color.schemes..*/....Clr.*...A |
| 1700 | 64 72 77 5f 73 63 6d 5f 63 72 65 61 74 65 28 44 72 77 20 2a 64 72 77 2c 20 63 6f 6e 73 74 20 63 | drw_scm_create(Drw.*drw,.const.c |
| 1720 | 68 61 72 20 2a 63 6c 72 6e 61 6d 65 73 5b 5d 2c 20 73 69 7a 65 5f 74 20 63 6c 72 63 6f 75 6e 74 | har.*clrnames[],.size_t.clrcount |
| 1740 | 29 00 00 00 01 7b 00 00 00 0a 09 73 69 7a 65 5f 74 20 69 3b 00 00 00 0a 09 43 6c 72 20 2a 72 65 | )....{.....size_t.i;.....Clr.*re |
| 1760 | 74 3b 00 00 00 00 00 00 00 2c 09 2f 2a 20 6e 65 65 64 20 61 74 20 6c 65 61 73 74 20 74 77 6f 20 | t;.......,./*.need.at.least.two. |
| 1780 | 63 6f 6c 6f 72 73 20 66 6f 72 20 61 20 73 63 68 65 6d 65 20 2a 2f 00 00 00 52 09 69 66 20 28 21 | colors.for.a.scheme.*/...R.if.(! |
| 17a0 | 64 72 77 20 7c 7c 20 21 63 6c 72 6e 61 6d 65 73 20 7c 7c 20 63 6c 72 63 6f 75 6e 74 20 3c 20 32 | drw.||.!clrnames.||.clrcount.<.2 |
| 17c0 | 20 7c 7c 20 21 28 72 65 74 20 3d 20 65 63 61 6c 6c 6f 63 28 63 6c 72 63 6f 75 6e 74 2c 20 73 69 | .||.!(ret.=.ecalloc(clrcount,.si |
| 17e0 | 7a 65 6f 66 28 43 6c 72 29 29 29 29 00 00 00 0e 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c 3b 00 00 | zeof(Clr))))......return.NULL;.. |
| 1800 | 00 00 00 00 00 1f 09 66 6f 72 20 28 69 20 3d 20 30 3b 20 69 20 3c 20 63 6c 72 63 6f 75 6e 74 3b | .......for.(i.=.0;.i.<.clrcount; |
| 1820 | 20 69 2b 2b 29 00 00 00 2c 09 09 64 72 77 5f 63 6c 72 5f 63 72 65 61 74 65 28 64 72 77 2c 20 26 | .i++)...,..drw_clr_create(drw,.& |
| 1840 | 72 65 74 5b 69 5d 2c 20 63 6c 72 6e 61 6d 65 73 5b 69 5d 29 3b 00 00 00 0c 09 72 65 74 75 72 6e | ret[i],.clrnames[i]);.....return |
| 1860 | 20 72 65 74 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 1e 64 72 77 5f 63 6c | .ret;....}........void....drw_cl |
| 1880 | 72 5f 66 72 65 65 28 44 72 77 20 2a 64 72 77 2c 20 43 6c 72 20 2a 63 29 00 00 00 01 7b 00 00 00 | r_free(Drw.*drw,.Clr.*c)....{... |
| 18a0 | 10 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 63 29 00 00 00 09 09 09 72 65 74 75 72 6e 3b 00 00 | ..if.(!drw.||.!c)......return;.. |
| 18c0 | 00 00 00 00 00 20 09 2f 2a 20 63 20 69 73 20 74 79 70 65 64 65 66 20 58 66 74 43 6f 6c 6f 72 20 | ......./*.c.is.typedef.XftColor. |
| 18e0 | 43 6c 72 20 2a 2f 00 00 00 3d 09 58 66 74 43 6f 6c 6f 72 46 72 65 65 28 64 72 77 2d 3e 64 70 79 | Clr.*/...=.XftColorFree(drw->dpy |
| 1900 | 2c 20 44 65 66 61 75 6c 74 56 69 73 75 61 6c 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 | ,.DefaultVisual(drw->dpy,.drw->s |
| 1920 | 63 72 65 65 6e 29 2c 00 00 00 39 09 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 | creen),...9..............Default |
| 1940 | 43 6f 6c 6f 72 6d 61 70 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 2c | Colormap(drw->dpy,.drw->screen), |
| 1960 | 20 63 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 31 64 72 77 5f 73 63 6d | .c);....}........void...1drw_scm |
| 1980 | 5f 66 72 65 65 28 44 72 77 20 2a 64 72 77 2c 20 43 6c 72 20 2a 73 63 6d 2c 20 73 69 7a 65 5f 74 | _free(Drw.*drw,.Clr.*scm,.size_t |
| 19a0 | 20 63 6c 72 63 6f 75 6e 74 29 00 00 00 01 7b 00 00 00 0a 09 73 69 7a 65 5f 74 20 69 3b 00 00 00 | .clrcount)....{.....size_t.i;... |
| 19c0 | 00 00 00 00 12 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 73 63 6d 29 00 00 00 09 09 09 72 65 74 | ......if.(!drw.||.!scm)......ret |
| 19e0 | 75 72 6e 3b 00 00 00 00 00 00 00 1f 09 66 6f 72 20 28 69 20 3d 20 30 3b 20 69 20 3c 20 63 6c 72 | urn;.........for.(i.=.0;.i.<.clr |
| 1a00 | 63 6f 75 6e 74 3b 20 69 2b 2b 29 00 00 00 1d 09 09 64 72 77 5f 63 6c 72 5f 66 72 65 65 28 64 72 | count;.i++)......drw_clr_free(dr |
| 1a20 | 77 2c 20 26 73 63 6d 5b 69 5d 29 3b 00 00 00 0b 09 66 72 65 65 28 73 63 6d 29 3b 00 00 00 01 7d | w,.&scm[i]);.....free(scm);....} |
| 1a40 | 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 22 64 72 77 5f 73 65 74 66 6f 6e 74 73 65 74 28 44 | ........void..."drw_setfontset(D |
| 1a60 | 72 77 20 2a 64 72 77 2c 20 46 6e 74 20 2a 73 65 74 29 00 00 00 01 7b 00 00 00 09 09 69 66 20 28 | rw.*drw,.Fnt.*set)....{.....if.( |
| 1a80 | 64 72 77 29 00 00 00 13 09 09 64 72 77 2d 3e 66 6f 6e 74 73 20 3d 20 73 65 74 3b 00 00 00 01 7d | drw)......drw->fonts.=.set;....} |
| 1aa0 | 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 21 64 72 77 5f 73 65 74 73 63 68 65 6d 65 28 44 72 | ........void...!drw_setscheme(Dr |
| 1ac0 | 77 20 2a 64 72 77 2c 20 43 6c 72 20 2a 73 63 6d 29 00 00 00 01 7b 00 00 00 09 09 69 66 20 28 64 | w.*drw,.Clr.*scm)....{.....if.(d |
| 1ae0 | 72 77 29 00 00 00 14 09 09 64 72 77 2d 3e 73 63 68 65 6d 65 20 3d 20 73 63 6d 3b 00 00 00 01 7d | rw)......drw->scheme.=.scm;....} |
| 1b00 | 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 58 64 72 77 5f 72 65 63 74 28 44 72 77 20 2a 64 72 | ........void...Xdrw_rect(Drw.*dr |
| 1b20 | 77 2c 20 69 6e 74 20 78 2c 20 69 6e 74 20 79 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 77 2c | w,.int.x,.int.y,.unsigned.int.w, |
| 1b40 | 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 68 2c 20 69 6e 74 20 66 69 6c 6c 65 64 2c 20 69 6e 74 | .unsigned.int.h,.int.filled,.int |
| 1b60 | 20 69 6e 76 65 72 74 29 00 00 00 01 7b 00 00 00 1a 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 64 | .invert)....{.....if.(!drw.||.!d |
| 1b80 | 72 77 2d 3e 73 63 68 65 6d 65 29 00 00 00 09 09 09 72 65 74 75 72 6e 3b 00 00 00 61 09 58 53 65 | rw->scheme)......return;...a.XSe |
| 1ba0 | 74 46 6f 72 65 67 72 6f 75 6e 64 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 67 63 2c 20 69 | tForeground(drw->dpy,.drw->gc,.i |
| 1bc0 | 6e 76 65 72 74 20 3f 20 64 72 77 2d 3e 73 63 68 65 6d 65 5b 43 6f 6c 42 67 5d 2e 70 69 78 65 6c | nvert.?.drw->scheme[ColBg].pixel |
| 1be0 | 20 3a 20 64 72 77 2d 3e 73 63 68 65 6d 65 5b 43 6f 6c 46 67 5d 2e 70 69 78 65 6c 29 3b 00 00 00 | .:.drw->scheme[ColFg].pixel);... |
| 1c00 | 0c 09 69 66 20 28 66 69 6c 6c 65 64 29 00 00 00 3f 09 09 58 46 69 6c 6c 52 65 63 74 61 6e 67 6c | ..if.(filled)...?..XFillRectangl |
| 1c20 | 65 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 20 64 72 77 2d 3e | e(drw->dpy,.drw->drawable,.drw-> |
| 1c40 | 67 63 2c 20 78 2c 20 79 2c 20 77 2c 20 68 29 3b 00 00 00 05 09 65 6c 73 65 00 00 00 47 09 09 58 | gc,.x,.y,.w,.h);.....else...G..X |
| 1c60 | 44 72 61 77 52 65 63 74 61 6e 67 6c 65 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 | DrawRectangle(drw->dpy,.drw->dra |
| 1c80 | 77 61 62 6c 65 2c 20 64 72 77 2d 3e 67 63 2c 20 78 2c 20 79 2c 20 77 20 2d 20 31 2c 20 68 20 2d | wable,.drw->gc,.x,.y,.w.-.1,.h.- |
| 1ca0 | 20 31 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 03 69 6e 74 00 00 00 71 64 72 77 5f 74 65 78 74 | .1);....}........int...qdrw_text |
| 1cc0 | 28 44 72 77 20 2a 64 72 77 2c 20 69 6e 74 20 78 2c 20 69 6e 74 20 79 2c 20 75 6e 73 69 67 6e 65 | (Drw.*drw,.int.x,.int.y,.unsigne |
| 1ce0 | 64 20 69 6e 74 20 77 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 68 2c 20 75 6e 73 69 67 6e 65 | d.int.w,.unsigned.int.h,.unsigne |
| 1d00 | 64 20 69 6e 74 20 6c 70 61 64 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20 69 6e | d.int.lpad,.const.char.*text,.in |
| 1d20 | 74 20 69 6e 76 65 72 74 29 00 00 00 01 7b 00 00 00 18 09 69 6e 74 20 74 79 2c 20 65 6c 6c 69 70 | t.invert)....{.....int.ty,.ellip |
| 1d40 | 73 69 73 5f 78 20 3d 20 30 3b 00 00 00 43 09 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 74 6d 70 77 | sis_x.=.0;...C.unsigned.int.tmpw |
| 1d60 | 2c 20 65 77 2c 20 65 6c 6c 69 70 73 69 73 5f 77 20 3d 20 30 2c 20 65 6c 6c 69 70 73 69 73 5f 6c | ,.ew,.ellipsis_w.=.0,.ellipsis_l |
| 1d80 | 65 6e 2c 20 68 61 73 68 2c 20 68 30 2c 20 68 31 3b 00 00 00 13 09 58 66 74 44 72 61 77 20 2a 64 | en,.hash,.h0,.h1;.....XftDraw.*d |
| 1da0 | 20 3d 20 4e 55 4c 4c 3b 00 00 00 24 09 46 6e 74 20 2a 75 73 65 64 66 6f 6e 74 2c 20 2a 63 75 72 | .=.NULL;...$.Fnt.*usedfont,.*cur |
| 1dc0 | 66 6f 6e 74 2c 20 2a 6e 65 78 74 66 6f 6e 74 3b 00 00 00 41 09 69 6e 74 20 75 74 66 38 73 74 72 | font,.*nextfont;...A.int.utf8str |
| 1de0 | 6c 65 6e 2c 20 75 74 66 38 63 68 61 72 6c 65 6e 2c 20 75 74 66 38 65 72 72 2c 20 72 65 6e 64 65 | len,.utf8charlen,.utf8err,.rende |
| 1e00 | 72 20 3d 20 78 20 7c 7c 20 79 20 7c 7c 20 77 20 7c 7c 20 68 3b 00 00 00 18 09 6c 6f 6e 67 20 75 | r.=.x.||.y.||.w.||.h;.....long.u |
| 1e20 | 74 66 38 63 6f 64 65 70 6f 69 6e 74 20 3d 20 30 3b 00 00 00 15 09 63 6f 6e 73 74 20 63 68 61 72 | tf8codepoint.=.0;.....const.char |
| 1e40 | 20 2a 75 74 66 38 73 74 72 3b 00 00 00 16 09 46 63 43 68 61 72 53 65 74 20 2a 66 63 63 68 61 72 | .*utf8str;.....FcCharSet.*fcchar |
| 1e60 | 73 65 74 3b 00 00 00 16 09 46 63 50 61 74 74 65 72 6e 20 2a 66 63 70 61 74 74 65 72 6e 3b 00 00 | set;.....FcPattern.*fcpattern;.. |
| 1e80 | 00 12 09 46 63 50 61 74 74 65 72 6e 20 2a 6d 61 74 63 68 3b 00 00 00 12 09 58 66 74 52 65 73 75 | ...FcPattern.*match;.....XftResu |
| 1ea0 | 6c 74 20 72 65 73 75 6c 74 3b 00 00 00 22 09 69 6e 74 20 63 68 61 72 65 78 69 73 74 73 20 3d 20 | lt.result;...".int.charexists.=. |
| 1ec0 | 30 2c 20 6f 76 65 72 66 6c 6f 77 20 3d 20 30 3b 00 00 00 44 09 2f 2a 20 6b 65 65 70 20 74 72 61 | 0,.overflow.=.0;...D./*.keep.tra |
| 1ee0 | 63 6b 20 6f 66 20 61 20 63 6f 75 70 6c 65 20 63 6f 64 65 70 6f 69 6e 74 73 20 66 6f 72 20 77 68 | ck.of.a.couple.codepoints.for.wh |
| 1f00 | 69 63 68 20 77 65 20 68 61 76 65 20 6e 6f 20 6d 61 74 63 68 2e 20 2a 2f 00 00 00 43 09 73 74 61 | ich.we.have.no.match..*/...C.sta |
| 1f20 | 74 69 63 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 6e 6f 6d 61 74 63 68 65 73 5b 31 32 38 5d 2c | tic.unsigned.int.nomatches[128], |
| 1f40 | 20 65 6c 6c 69 70 73 69 73 5f 77 69 64 74 68 2c 20 69 6e 76 61 6c 69 64 5f 77 69 64 74 68 3b 00 | .ellipsis_width,.invalid_width;. |
| 1f60 | 00 00 25 09 73 74 61 74 69 63 20 63 6f 6e 73 74 20 63 68 61 72 20 69 6e 76 61 6c 69 64 5b 5d 20 | ..%.static.const.char.invalid[]. |
| 1f80 | 3d 20 22 ef bf bd 22 3b 00 00 00 00 00 00 00 46 09 69 66 20 28 21 64 72 77 20 7c 7c 20 28 72 65 | =."...";.......F.if.(!drw.||.(re |
| 1fa0 | 6e 64 65 72 20 26 26 20 28 21 64 72 77 2d 3e 73 63 68 65 6d 65 20 7c 7c 20 21 77 29 29 20 7c 7c | nder.&&.(!drw->scheme.||.!w)).|| |
| 1fc0 | 20 21 74 65 78 74 20 7c 7c 20 21 64 72 77 2d 3e 66 6f 6e 74 73 29 00 00 00 0b 09 09 72 65 74 75 | .!text.||.!drw->fonts)......retu |
| 1fe0 | 72 6e 20 30 3b 00 00 00 00 00 00 00 0f 09 69 66 20 28 21 72 65 6e 64 65 72 29 20 7b 00 00 00 20 | rn.0;.........if.(!render).{.... |
| 2000 | 09 09 77 20 3d 20 69 6e 76 65 72 74 20 3f 20 69 6e 76 65 72 74 20 3a 20 7e 69 6e 76 65 72 74 3b | ..w.=.invert.?.invert.:.~invert; |
| 2020 | 00 00 00 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 4f 09 09 58 53 65 74 46 6f 72 65 67 72 6f 75 6e | .....}.else.{...O..XSetForegroun |
| 2040 | 64 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 67 63 2c 20 64 72 77 2d 3e 73 63 68 65 6d 65 | d(drw->dpy,.drw->gc,.drw->scheme |
| 2060 | 5b 69 6e 76 65 72 74 20 3f 20 43 6f 6c 46 67 20 3a 20 43 6f 6c 42 67 5d 2e 70 69 78 65 6c 29 3b | [invert.?.ColFg.:.ColBg].pixel); |
| 2080 | 00 00 00 3f 09 09 58 46 69 6c 6c 52 65 63 74 61 6e 67 6c 65 28 64 72 77 2d 3e 64 70 79 2c 20 64 | ...?..XFillRectangle(drw->dpy,.d |
| 20a0 | 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 20 64 72 77 2d 3e 67 63 2c 20 78 2c 20 79 2c 20 77 2c 20 | rw->drawable,.drw->gc,.x,.y,.w,. |
| 20c0 | 68 29 3b 00 00 00 0f 09 09 69 66 20 28 77 20 3c 20 6c 70 61 64 29 00 00 00 10 09 09 09 72 65 74 | h);......if.(w.<.lpad).......ret |
| 20e0 | 75 72 6e 20 78 20 2b 20 77 3b 00 00 00 2c 09 09 64 20 3d 20 58 66 74 44 72 61 77 43 72 65 61 74 | urn.x.+.w;...,..d.=.XftDrawCreat |
| 2100 | 65 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 00 00 00 39 09 09 | e(drw->dpy,.drw->drawable,...9.. |
| 2120 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 56 69 73 75 61 6c 28 | ..................DefaultVisual( |
| 2140 | 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 2c 00 00 00 3c 09 09 20 20 20 | drw->dpy,.drw->screen),...<..... |
| 2160 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 43 6f 6c 6f 72 6d 61 70 28 64 | ...............DefaultColormap(d |
| 2180 | 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 29 3b 00 00 00 0c 09 09 78 20 2b | rw->dpy,.drw->screen));......x.+ |
| 21a0 | 3d 20 6c 70 61 64 3b 00 00 00 0c 09 09 77 20 2d 3d 20 6c 70 61 64 3b 00 00 00 02 09 7d 00 00 00 | =.lpad;......w.-=.lpad;.....}... |
| 21c0 | 00 00 00 00 17 09 75 73 65 64 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 3b 00 00 00 1f | ......usedfont.=.drw->fonts;.... |
| 21e0 | 09 69 66 20 28 21 65 6c 6c 69 70 73 69 73 5f 77 69 64 74 68 20 26 26 20 72 65 6e 64 65 72 29 00 | .if.(!ellipsis_width.&&.render). |
| 2200 | 00 00 34 09 09 65 6c 6c 69 70 73 69 73 5f 77 69 64 74 68 20 3d 20 64 72 77 5f 66 6f 6e 74 73 65 | ..4..ellipsis_width.=.drw_fontse |
| 2220 | 74 5f 67 65 74 77 69 64 74 68 28 64 72 77 2c 20 22 2e 2e 2e 22 29 3b 00 00 00 1e 09 69 66 20 28 | t_getwidth(drw,."...");.....if.( |
| 2240 | 21 69 6e 76 61 6c 69 64 5f 77 69 64 74 68 20 26 26 20 72 65 6e 64 65 72 29 00 00 00 35 09 09 69 | !invalid_width.&&.render)...5..i |
| 2260 | 6e 76 61 6c 69 64 5f 77 69 64 74 68 20 3d 20 64 72 77 5f 66 6f 6e 74 73 65 74 5f 67 65 74 77 69 | nvalid_width.=.drw_fontset_getwi |
| 2280 | 64 74 68 28 64 72 77 2c 20 69 6e 76 61 6c 69 64 29 3b 00 00 00 0c 09 77 68 69 6c 65 20 28 31 29 | dth(drw,.invalid);.....while.(1) |
| 22a0 | 20 7b 00 00 00 3d 09 09 65 77 20 3d 20 65 6c 6c 69 70 73 69 73 5f 6c 65 6e 20 3d 20 75 74 66 38 | .{...=..ew.=.ellipsis_len.=.utf8 |
| 22c0 | 65 72 72 20 3d 20 75 74 66 38 63 68 61 72 6c 65 6e 20 3d 20 75 74 66 38 73 74 72 6c 65 6e 20 3d | err.=.utf8charlen.=.utf8strlen.= |
| 22e0 | 20 30 3b 00 00 00 11 09 09 75 74 66 38 73 74 72 20 3d 20 74 65 78 74 3b 00 00 00 12 09 09 6e 65 | .0;......utf8str.=.text;......ne |
| 2300 | 78 74 66 6f 6e 74 20 3d 20 4e 55 4c 4c 3b 00 00 00 11 09 09 77 68 69 6c 65 20 28 2a 74 65 78 74 | xtfont.=.NULL;......while.(*text |
| 2320 | 29 20 7b 00 00 00 3c 09 09 09 75 74 66 38 63 68 61 72 6c 65 6e 20 3d 20 75 74 66 38 64 65 63 6f | ).{...<...utf8charlen.=.utf8deco |
| 2340 | 64 65 28 74 65 78 74 2c 20 26 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 2c 20 26 75 74 66 38 65 72 | de(text,.&utf8codepoint,.&utf8er |
| 2360 | 72 29 3b 00 00 00 41 09 09 09 66 6f 72 20 28 63 75 72 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f | r);...A...for.(curfont.=.drw->fo |
| 2380 | 6e 74 73 3b 20 63 75 72 66 6f 6e 74 3b 20 63 75 72 66 6f 6e 74 20 3d 20 63 75 72 66 6f 6e 74 2d | nts;.curfont;.curfont.=.curfont- |
| 23a0 | 3e 6e 65 78 74 29 20 7b 00 00 00 56 09 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 63 68 61 | >next).{...V....charexists.=.cha |
| 23c0 | 72 65 78 69 73 74 73 20 7c 7c 20 58 66 74 43 68 61 72 45 78 69 73 74 73 28 64 72 77 2d 3e 64 70 | rexists.||.XftCharExists(drw->dp |
| 23e0 | 79 2c 20 63 75 72 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 | y,.curfont->xfont,.utf8codepoint |
| 2400 | 29 3b 00 00 00 15 09 09 09 09 69 66 20 28 63 68 61 72 65 78 69 73 74 73 29 20 7b 00 00 00 3f 09 | );........if.(charexists).{...?. |
| 2420 | 09 09 09 09 64 72 77 5f 66 6f 6e 74 5f 67 65 74 65 78 74 73 28 63 75 72 66 6f 6e 74 2c 20 74 65 | ....drw_font_getexts(curfont,.te |
| 2440 | 78 74 2c 20 75 74 66 38 63 68 61 72 6c 65 6e 2c 20 26 74 6d 70 77 2c 20 4e 55 4c 4c 29 3b 00 00 | xt,.utf8charlen,.&tmpw,.NULL);.. |
| 2460 | 00 24 09 09 09 09 09 69 66 20 28 65 77 20 2b 20 65 6c 6c 69 70 73 69 73 5f 77 69 64 74 68 20 3c | .$.....if.(ew.+.ellipsis_width.< |
| 2480 | 3d 20 77 29 20 7b 00 00 00 34 09 09 09 09 09 09 2f 2a 20 6b 65 65 70 20 74 72 61 63 6b 20 77 68 | =.w).{...4....../*.keep.track.wh |
| 24a0 | 65 72 65 20 74 68 65 20 65 6c 6c 69 70 73 69 73 20 73 74 69 6c 6c 20 66 69 74 73 20 2a 2f 00 00 | ere.the.ellipsis.still.fits.*/.. |
| 24c0 | 00 1a 09 09 09 09 09 09 65 6c 6c 69 70 73 69 73 5f 78 20 3d 20 78 20 2b 20 65 77 3b 00 00 00 1a | ........ellipsis_x.=.x.+.ew;.... |
| 24e0 | 09 09 09 09 09 09 65 6c 6c 69 70 73 69 73 5f 77 20 3d 20 77 20 2d 20 65 77 3b 00 00 00 20 09 09 | ......ellipsis_w.=.w.-.ew;...... |
| 2500 | 09 09 09 09 65 6c 6c 69 70 73 69 73 5f 6c 65 6e 20 3d 20 75 74 66 38 73 74 72 6c 65 6e 3b 00 00 | ....ellipsis_len.=.utf8strlen;.. |
| 2520 | 00 06 09 09 09 09 09 7d 00 00 00 00 00 00 00 19 09 09 09 09 09 69 66 20 28 65 77 20 2b 20 74 6d | .......}.............if.(ew.+.tm |
| 2540 | 70 77 20 3e 20 77 29 20 7b 00 00 00 13 09 09 09 09 09 09 6f 76 65 72 66 6c 6f 77 20 3d 20 31 3b | pw.>.w).{..........overflow.=.1; |
| 2560 | 00 00 00 32 09 09 09 09 09 09 2f 2a 20 63 61 6c 6c 65 64 20 66 72 6f 6d 20 64 72 77 5f 66 6f 6e | ...2....../*.called.from.drw_fon |
| 2580 | 74 73 65 74 5f 67 65 74 77 69 64 74 68 5f 63 6c 61 6d 70 28 29 3a 00 00 00 2e 09 09 09 09 09 09 | tset_getwidth_clamp():.......... |
| 25a0 | 20 2a 20 69 74 20 77 61 6e 74 73 20 74 68 65 20 77 69 64 74 68 20 41 46 54 45 52 20 74 68 65 20 | .*.it.wants.the.width.AFTER.the. |
| 25c0 | 6f 76 65 72 66 6c 6f 77 00 00 00 09 09 09 09 09 09 09 20 2a 2f 00 00 00 12 09 09 09 09 09 09 69 | overflow...........*/..........i |
| 25e0 | 66 20 28 21 72 65 6e 64 65 72 29 00 00 00 11 09 09 09 09 09 09 09 78 20 2b 3d 20 74 6d 70 77 3b | f.(!render)...........x.+=.tmpw; |
| 2600 | 00 00 00 0a 09 09 09 09 09 09 65 6c 73 65 00 00 00 21 09 09 09 09 09 09 09 75 74 66 38 73 74 72 | ..........else...!.......utf8str |
| 2620 | 6c 65 6e 20 3d 20 65 6c 6c 69 70 73 69 73 5f 6c 65 6e 3b 00 00 00 26 09 09 09 09 09 7d 20 65 6c | len.=.ellipsis_len;...&.....}.el |
| 2640 | 73 65 20 69 66 20 28 63 75 72 66 6f 6e 74 20 3d 3d 20 75 73 65 64 66 6f 6e 74 29 20 7b 00 00 00 | se.if.(curfont.==.usedfont).{... |
| 2660 | 1a 09 09 09 09 09 09 74 65 78 74 20 2b 3d 20 75 74 66 38 63 68 61 72 6c 65 6e 3b 00 00 00 2e 09 | .......text.+=.utf8charlen;..... |
| 2680 | 09 09 09 09 09 75 74 66 38 73 74 72 6c 65 6e 20 2b 3d 20 75 74 66 38 65 72 72 20 3f 20 30 20 3a | .....utf8strlen.+=.utf8err.?.0.: |
| 26a0 | 20 75 74 66 38 63 68 61 72 6c 65 6e 3b 00 00 00 1f 09 09 09 09 09 09 65 77 20 2b 3d 20 75 74 66 | .utf8charlen;..........ew.+=.utf |
| 26c0 | 38 65 72 72 20 3f 20 30 20 3a 20 74 6d 70 77 3b 00 00 00 0d 09 09 09 09 09 7d 20 65 6c 73 65 20 | 8err.?.0.:.tmpw;.........}.else. |
| 26e0 | 7b 00 00 00 19 09 09 09 09 09 09 6e 65 78 74 66 6f 6e 74 20 3d 20 63 75 72 66 6f 6e 74 3b 00 00 | {..........nextfont.=.curfont;.. |
| 2700 | 00 06 09 09 09 09 09 7d 00 00 00 0b 09 09 09 09 09 62 72 65 61 6b 3b 00 00 00 05 09 09 09 09 7d | .......}.........break;........} |
| 2720 | 00 00 00 04 09 09 09 7d 00 00 00 00 00 00 00 36 09 09 09 69 66 20 28 6f 76 65 72 66 6c 6f 77 20 | .......}.......6...if.(overflow. |
| 2740 | 7c 7c 20 21 63 68 61 72 65 78 69 73 74 73 20 7c 7c 20 6e 65 78 74 66 6f 6e 74 20 7c 7c 20 75 74 | ||.!charexists.||.nextfont.||.ut |
| 2760 | 66 38 65 72 72 29 00 00 00 0a 09 09 09 09 62 72 65 61 6b 3b 00 00 00 07 09 09 09 65 6c 73 65 00 | f8err)........break;.......else. |
| 2780 | 00 00 13 09 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 30 3b 00 00 00 03 09 09 7d 00 00 00 | .......charexists.=.0;......}... |
| 27a0 | 00 00 00 00 13 09 09 69 66 20 28 75 74 66 38 73 74 72 6c 65 6e 29 20 7b 00 00 00 10 09 09 09 69 | .......if.(utf8strlen).{.......i |
| 27c0 | 66 20 28 72 65 6e 64 65 72 29 20 7b 00 00 00 3d 09 09 09 09 74 79 20 3d 20 79 20 2b 20 28 68 20 | f.(render).{...=....ty.=.y.+.(h. |
| 27e0 | 2d 20 75 73 65 64 66 6f 6e 74 2d 3e 68 29 20 2f 20 32 20 2b 20 75 73 65 64 66 6f 6e 74 2d 3e 78 | -.usedfont->h)./.2.+.usedfont->x |
| 2800 | 66 6f 6e 74 2d 3e 61 73 63 65 6e 74 3b 00 00 00 3e 09 09 09 09 58 66 74 44 72 61 77 53 74 72 69 | font->ascent;...>....XftDrawStri |
| 2820 | 6e 67 55 74 66 38 28 64 2c 20 26 64 72 77 2d 3e 73 63 68 65 6d 65 5b 69 6e 76 65 72 74 20 3f 20 | ngUtf8(d,.&drw->scheme[invert.?. |
| 2840 | 43 6f 6c 42 67 20 3a 20 43 6f 6c 46 67 5d 2c 00 00 00 4f 09 09 09 09 20 20 20 20 20 20 20 20 20 | ColBg.:.ColFg],...O............. |
| 2860 | 20 20 20 20 20 20 20 20 20 75 73 65 64 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 78 2c 20 74 79 2c | .........usedfont->xfont,.x,.ty, |
| 2880 | 20 28 58 66 74 43 68 61 72 38 20 2a 29 75 74 66 38 73 74 72 2c 20 75 74 66 38 73 74 72 6c 65 6e | .(XftChar8.*)utf8str,.utf8strlen |
| 28a0 | 29 3b 00 00 00 04 09 09 09 7d 00 00 00 0b 09 09 09 78 20 2b 3d 20 65 77 3b 00 00 00 0b 09 09 09 | );.......}.......x.+=.ew;....... |
| 28c0 | 77 20 2d 3d 20 65 77 3b 00 00 00 03 09 09 7d 00 00 00 32 09 09 69 66 20 28 75 74 66 38 65 72 72 | w.-=.ew;......}...2..if.(utf8err |
| 28e0 | 20 26 26 20 28 21 72 65 6e 64 65 72 20 7c 7c 20 69 6e 76 61 6c 69 64 5f 77 69 64 74 68 20 3c 20 | .&&.(!render.||.invalid_width.<. |
| 2900 | 77 29 29 20 7b 00 00 00 0e 09 09 09 69 66 20 28 72 65 6e 64 65 72 29 00 00 00 32 09 09 09 09 64 | w)).{.......if.(render)...2....d |
| 2920 | 72 77 5f 74 65 78 74 28 64 72 77 2c 20 78 2c 20 79 2c 20 77 2c 20 68 2c 20 30 2c 20 69 6e 76 61 | rw_text(drw,.x,.y,.w,.h,.0,.inva |
| 2940 | 6c 69 64 2c 20 69 6e 76 65 72 74 29 3b 00 00 00 16 09 09 09 78 20 2b 3d 20 69 6e 76 61 6c 69 64 | lid,.invert);.......x.+=.invalid |
| 2960 | 5f 77 69 64 74 68 3b 00 00 00 16 09 09 09 77 20 2d 3d 20 69 6e 76 61 6c 69 64 5f 77 69 64 74 68 | _width;.......w.-=.invalid_width |
| 2980 | 3b 00 00 00 03 09 09 7d 00 00 00 19 09 09 69 66 20 28 72 65 6e 64 65 72 20 26 26 20 6f 76 65 72 | ;......}......if.(render.&&.over |
| 29a0 | 66 6c 6f 77 29 00 00 00 41 09 09 09 64 72 77 5f 74 65 78 74 28 64 72 77 2c 20 65 6c 6c 69 70 73 | flow)...A...drw_text(drw,.ellips |
| 29c0 | 69 73 5f 78 2c 20 79 2c 20 65 6c 6c 69 70 73 69 73 5f 77 2c 20 68 2c 20 30 2c 20 22 2e 2e 2e 22 | is_x,.y,.ellipsis_w,.h,.0,."..." |
| 29e0 | 2c 20 69 6e 76 65 72 74 29 3b 00 00 00 00 00 00 00 1b 09 09 69 66 20 28 21 2a 74 65 78 74 20 7c | ,.invert);..........if.(!*text.| |
| 2a00 | 7c 20 6f 76 65 72 66 6c 6f 77 29 20 7b 00 00 00 09 09 09 09 62 72 65 61 6b 3b 00 00 00 18 09 09 | |.overflow).{.......break;...... |
| 2a20 | 7d 20 65 6c 73 65 20 69 66 20 28 6e 65 78 74 66 6f 6e 74 29 20 7b 00 00 00 12 09 09 09 63 68 61 | }.else.if.(nextfont).{.......cha |
| 2a40 | 72 65 78 69 73 74 73 20 3d 20 30 3b 00 00 00 17 09 09 09 75 73 65 64 66 6f 6e 74 20 3d 20 6e 65 | rexists.=.0;.......usedfont.=.ne |
| 2a60 | 78 74 66 6f 6e 74 3b 00 00 00 0a 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 40 09 09 09 2f 2a 20 52 | xtfont;......}.else.{...@.../*.R |
| 2a80 | 65 67 61 72 64 6c 65 73 73 20 6f 66 20 77 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 61 20 66 61 | egardless.of.whether.or.not.a.fa |
| 2aa0 | 6c 6c 62 61 63 6b 20 66 6f 6e 74 20 69 73 20 66 6f 75 6e 64 2c 20 74 68 65 00 00 00 21 09 09 09 | llback.font.is.found,.the...!... |
| 2ac0 | 20 2a 20 63 68 61 72 61 63 74 65 72 20 6d 75 73 74 20 62 65 20 64 72 61 77 6e 2e 20 2a 2f 00 00 | .*.character.must.be.drawn..*/.. |
| 2ae0 | 00 12 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 31 3b 00 00 00 00 00 00 00 26 09 09 09 68 | .....charexists.=.1;.......&...h |
| 2b00 | 61 73 68 20 3d 20 28 75 6e 73 69 67 6e 65 64 20 69 6e 74 29 75 74 66 38 63 6f 64 65 70 6f 69 6e | ash.=.(unsigned.int)utf8codepoin |
| 2b20 | 74 3b 00 00 00 2d 09 09 09 68 61 73 68 20 3d 20 28 28 68 61 73 68 20 3e 3e 20 31 36 29 20 5e 20 | t;...-...hash.=.((hash.>>.16).^. |
| 2b40 | 68 61 73 68 29 20 2a 20 30 78 32 31 46 30 41 41 41 44 3b 00 00 00 2d 09 09 09 68 61 73 68 20 3d | hash).*.0x21F0AAAD;...-...hash.= |
| 2b60 | 20 28 28 68 61 73 68 20 3e 3e 20 31 35 29 20 5e 20 68 61 73 68 29 20 2a 20 30 78 44 33 35 41 32 | .((hash.>>.15).^.hash).*.0xD35A2 |
| 2b80 | 44 39 37 3b 00 00 00 32 09 09 09 68 30 20 3d 20 28 28 68 61 73 68 20 3e 3e 20 31 35 29 20 5e 20 | D97;...2...h0.=.((hash.>>.15).^. |
| 2ba0 | 68 61 73 68 29 20 25 20 4c 45 4e 47 54 48 28 6e 6f 6d 61 74 63 68 65 73 29 3b 00 00 00 29 09 09 | hash).%.LENGTH(nomatches);...).. |
| 2bc0 | 09 68 31 20 3d 20 28 68 61 73 68 20 3e 3e 20 31 37 29 20 25 20 4c 45 4e 47 54 48 28 6e 6f 6d 61 | .h1.=.(hash.>>.17).%.LENGTH(noma |
| 2be0 | 74 63 68 65 73 29 3b 00 00 00 4d 09 09 09 2f 2a 20 61 76 6f 69 64 20 65 78 70 65 6e 73 69 76 65 | tches);...M.../*.avoid.expensive |
| 2c00 | 20 58 66 74 46 6f 6e 74 4d 61 74 63 68 20 63 61 6c 6c 20 77 68 65 6e 20 77 65 20 6b 6e 6f 77 20 | .XftFontMatch.call.when.we.know. |
| 2c20 | 77 65 20 77 6f 6e 27 74 20 66 69 6e 64 20 61 20 6d 61 74 63 68 20 2a 2f 00 00 00 48 09 09 09 69 | we.won't.find.a.match.*/...H...i |
| 2c40 | 66 20 28 6e 6f 6d 61 74 63 68 65 73 5b 68 30 5d 20 3d 3d 20 75 74 66 38 63 6f 64 65 70 6f 69 6e | f.(nomatches[h0].==.utf8codepoin |
| 2c60 | 74 20 7c 7c 20 6e 6f 6d 61 74 63 68 65 73 5b 68 31 5d 20 3d 3d 20 75 74 66 38 63 6f 64 65 70 6f | t.||.nomatches[h1].==.utf8codepo |
| 2c80 | 69 6e 74 29 00 00 00 12 09 09 09 09 67 6f 74 6f 20 6e 6f 5f 6d 61 74 63 68 3b 00 00 00 00 00 00 | int)........goto.no_match;...... |
| 2ca0 | 00 21 09 09 09 66 63 63 68 61 72 73 65 74 20 3d 20 46 63 43 68 61 72 53 65 74 43 72 65 61 74 65 | .!...fccharset.=.FcCharSetCreate |
| 2cc0 | 28 29 3b 00 00 00 2e 09 09 09 46 63 43 68 61 72 53 65 74 41 64 64 43 68 61 72 28 66 63 63 68 61 | ();.......FcCharSetAddChar(fccha |
| 2ce0 | 72 73 65 74 2c 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 29 3b 00 00 00 00 00 00 00 1e 09 09 09 | rset,.utf8codepoint);........... |
| 2d00 | 69 66 20 28 21 64 72 77 2d 3e 66 6f 6e 74 73 2d 3e 70 61 74 74 65 72 6e 29 20 7b 00 00 00 44 09 | if.(!drw->fonts->pattern).{...D. |
| 2d20 | 09 09 09 2f 2a 20 52 65 66 65 72 20 74 6f 20 74 68 65 20 63 6f 6d 6d 65 6e 74 20 69 6e 20 78 66 | .../*.Refer.to.the.comment.in.xf |
| 2d40 | 6f 6e 74 5f 63 72 65 61 74 65 20 66 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e | ont_create.for.more.information. |
| 2d60 | 20 2a 2f 00 00 00 4a 09 09 09 09 64 69 65 28 22 74 68 65 20 66 69 72 73 74 20 66 6f 6e 74 20 69 | .*/...J....die("the.first.font.i |
| 2d80 | 6e 20 74 68 65 20 63 61 63 68 65 20 6d 75 73 74 20 62 65 20 6c 6f 61 64 65 64 20 66 72 6f 6d 20 | n.the.cache.must.be.loaded.from. |
| 2da0 | 61 20 66 6f 6e 74 20 73 74 72 69 6e 67 2e 22 29 3b 00 00 00 04 09 09 09 7d 00 00 00 00 00 00 00 | a.font.string.");.......}....... |
| 2dc0 | 37 09 09 09 66 63 70 61 74 74 65 72 6e 20 3d 20 46 63 50 61 74 74 65 72 6e 44 75 70 6c 69 63 61 | 7...fcpattern.=.FcPatternDuplica |
| 2de0 | 74 65 28 64 72 77 2d 3e 66 6f 6e 74 73 2d 3e 70 61 74 74 65 72 6e 29 3b 00 00 00 39 09 09 09 46 | te(drw->fonts->pattern);...9...F |
| 2e00 | 63 50 61 74 74 65 72 6e 41 64 64 43 68 61 72 53 65 74 28 66 63 70 61 74 74 65 72 6e 2c 20 46 43 | cPatternAddCharSet(fcpattern,.FC |
| 2e20 | 5f 43 48 41 52 53 45 54 2c 20 66 63 63 68 61 72 73 65 74 29 3b 00 00 00 34 09 09 09 46 63 50 61 | _CHARSET,.fccharset);...4...FcPa |
| 2e40 | 74 74 65 72 6e 41 64 64 42 6f 6f 6c 28 66 63 70 61 74 74 65 72 6e 2c 20 46 43 5f 53 43 41 4c 41 | tternAddBool(fcpattern,.FC_SCALA |
| 2e60 | 42 4c 45 2c 20 46 63 54 72 75 65 29 3b 00 00 00 00 00 00 00 37 09 09 09 46 63 43 6f 6e 66 69 67 | BLE,.FcTrue);.......7...FcConfig |
| 2e80 | 53 75 62 73 74 69 74 75 74 65 28 4e 55 4c 4c 2c 20 66 63 70 61 74 74 65 72 6e 2c 20 46 63 4d 61 | Substitute(NULL,.fcpattern,.FcMa |
| 2ea0 | 74 63 68 50 61 74 74 65 72 6e 29 3b 00 00 00 22 09 09 09 46 63 44 65 66 61 75 6c 74 53 75 62 73 | tchPattern);..."...FcDefaultSubs |
| 2ec0 | 74 69 74 75 74 65 28 66 63 70 61 74 74 65 72 6e 29 3b 00 00 00 43 09 09 09 6d 61 74 63 68 20 3d | titute(fcpattern);...C...match.= |
| 2ee0 | 20 58 66 74 46 6f 6e 74 4d 61 74 63 68 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 | .XftFontMatch(drw->dpy,.drw->scr |
| 2f00 | 65 65 6e 2c 20 66 63 70 61 74 74 65 72 6e 2c 20 26 72 65 73 75 6c 74 29 3b 00 00 00 00 00 00 00 | een,.fcpattern,.&result);....... |
| 2f20 | 1f 09 09 09 46 63 43 68 61 72 53 65 74 44 65 73 74 72 6f 79 28 66 63 63 68 61 72 73 65 74 29 3b | ....FcCharSetDestroy(fccharset); |
| 2f40 | 00 00 00 1f 09 09 09 46 63 50 61 74 74 65 72 6e 44 65 73 74 72 6f 79 28 66 63 70 61 74 74 65 72 | .......FcPatternDestroy(fcpatter |
| 2f60 | 6e 29 3b 00 00 00 00 00 00 00 0f 09 09 09 69 66 20 28 6d 61 74 63 68 29 20 7b 00 00 00 2e 09 09 | n);...........if.(match).{...... |
| 2f80 | 09 09 75 73 65 64 66 6f 6e 74 20 3d 20 78 66 6f 6e 74 5f 63 72 65 61 74 65 28 64 72 77 2c 20 4e | ..usedfont.=.xfont_create(drw,.N |
| 2fa0 | 55 4c 4c 2c 20 6d 61 74 63 68 29 3b 00 00 00 4e 09 09 09 09 69 66 20 28 75 73 65 64 66 6f 6e 74 | ULL,.match);...N....if.(usedfont |
| 2fc0 | 20 26 26 20 58 66 74 43 68 61 72 45 78 69 73 74 73 28 64 72 77 2d 3e 64 70 79 2c 20 75 73 65 64 | .&&.XftCharExists(drw->dpy,.used |
| 2fe0 | 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 29 29 20 7b 00 00 | font->xfont,.utf8codepoint)).{.. |
| 3000 | 00 47 09 09 09 09 09 66 6f 72 20 28 63 75 72 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 | .G.....for.(curfont.=.drw->fonts |
| 3020 | 3b 20 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 3b 20 63 75 72 66 6f 6e 74 20 3d 20 63 75 72 66 6f | ;.curfont->next;.curfont.=.curfo |
| 3040 | 6e 74 2d 3e 6e 65 78 74 29 00 00 00 11 09 09 09 09 09 09 3b 20 2f 2a 20 4e 4f 50 20 2a 2f 00 00 | nt->next)..........;./*.NOP.*/.. |
| 3060 | 00 1e 09 09 09 09 09 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 20 3d 20 75 73 65 64 66 6f 6e 74 3b | .......curfont->next.=.usedfont; |
| 3080 | 00 00 00 0c 09 09 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 1a 09 09 09 09 09 78 66 6f 6e 74 5f 66 | ........}.else.{.........xfont_f |
| 30a0 | 72 65 65 28 75 73 65 64 66 6f 6e 74 29 3b 00 00 00 38 09 09 09 09 09 6e 6f 6d 61 74 63 68 65 73 | ree(usedfont);...8.....nomatches |
| 30c0 | 5b 6e 6f 6d 61 74 63 68 65 73 5b 68 30 5d 20 3f 20 68 31 20 3a 20 68 30 5d 20 3d 20 75 74 66 38 | [nomatches[h0].?.h1.:.h0].=.utf8 |
| 30e0 | 63 6f 64 65 70 6f 69 6e 74 3b 00 00 00 09 6e 6f 5f 6d 61 74 63 68 3a 00 00 00 1b 09 09 09 09 09 | codepoint;....no_match:......... |
| 3100 | 75 73 65 64 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 3b 00 00 00 05 09 09 09 09 7d 00 | usedfont.=.drw->fonts;........}. |
| 3120 | 00 00 04 09 09 09 7d 00 00 00 03 09 09 7d 00 00 00 02 09 7d 00 00 00 07 09 69 66 20 28 64 29 00 | ......}......}.....}.....if.(d). |
| 3140 | 00 00 14 09 09 58 66 74 44 72 61 77 44 65 73 74 72 6f 79 28 64 29 3b 00 00 00 00 00 00 00 1d 09 | .....XftDrawDestroy(d);......... |
| 3160 | 72 65 74 75 72 6e 20 78 20 2b 20 28 72 65 6e 64 65 72 20 3f 20 77 20 3a 20 30 29 3b 00 00 00 01 | return.x.+.(render.?.w.:.0);.... |
| 3180 | 7d 00 00 00 00 00 00 00 03 69 6e 74 00 00 00 36 75 74 66 38 6e 65 78 74 63 68 61 72 28 63 6f 6e | }........int...6utf8nextchar(con |
| 31a0 | 73 74 20 63 68 61 72 20 2a 73 74 72 2c 20 69 6e 74 20 6c 65 6e 2c 20 69 6e 74 20 69 2c 20 69 6e | st.char.*str,.int.len,.int.i,.in |
| 31c0 | 74 20 69 6e 63 29 00 00 00 01 7b 00 00 00 07 09 69 6e 74 20 6e 3b 00 00 00 00 00 00 00 31 09 66 | t.inc)....{.....int.n;.......1.f |
| 31e0 | 6f 72 20 28 6e 20 3d 20 69 20 2b 20 69 6e 63 3b 20 6e 20 2b 20 69 6e 63 20 3e 3d 20 30 20 26 26 | or.(n.=.i.+.inc;.n.+.inc.>=.0.&& |
| 3200 | 20 6e 20 2b 20 69 6e 63 20 3c 3d 20 6c 65 6e 00 00 00 28 09 20 20 26 26 20 28 73 74 72 5b 6e 5d | .n.+.inc.<=.len...(...&&.(str[n] |
| 3220 | 20 26 20 30 78 63 30 29 20 3d 3d 20 30 78 38 30 3b 20 6e 20 2b 3d 20 69 6e 63 29 00 00 00 03 09 | .&.0xc0).==.0x80;.n.+=.inc)..... |
| 3240 | 09 3b 00 00 00 0a 09 72 65 74 75 72 6e 20 6e 3b 00 00 00 01 7d 00 00 00 00 00 00 00 03 69 6e 74 | .;.....return.n;....}........int |
| 3260 | 00 00 00 70 64 72 77 5f 74 65 78 74 5f 61 6c 69 67 6e 28 44 72 77 20 2a 64 72 77 2c 20 69 6e 74 | ...pdrw_text_align(Drw.*drw,.int |
| 3280 | 20 78 2c 20 69 6e 74 20 79 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 77 2c 20 75 6e 73 69 67 | .x,.int.y,.unsigned.int.w,.unsig |
| 32a0 | 6e 65 64 20 69 6e 74 20 68 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20 69 6e 74 | ned.int.h,.const.char.*text,.int |
| 32c0 | 20 74 65 78 74 6c 65 6e 2c 20 69 6e 74 20 61 6c 69 67 6e 29 00 00 00 01 7b 00 00 00 08 09 69 6e | .textlen,.int.align)....{.....in |
| 32e0 | 74 20 74 79 3b 00 00 00 11 09 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 65 77 3b 00 00 00 13 09 58 | t.ty;.....unsigned.int.ew;.....X |
| 3300 | 66 74 44 72 61 77 20 2a 64 20 3d 20 4e 55 4c 4c 3b 00 00 00 24 09 46 6e 74 20 2a 75 73 65 64 66 | ftDraw.*d.=.NULL;...$.Fnt.*usedf |
| 3320 | 6f 6e 74 2c 20 2a 63 75 72 66 6f 6e 74 2c 20 2a 6e 65 78 74 66 6f 6e 74 3b 00 00 00 0c 09 73 69 | ont,.*curfont,.*nextfont;.....si |
| 3340 | 7a 65 5f 74 20 6c 65 6e 3b 00 00 00 38 09 69 6e 74 20 75 74 66 38 73 74 72 6c 65 6e 2c 20 75 74 | ze_t.len;...8.int.utf8strlen,.ut |
| 3360 | 66 38 63 68 61 72 6c 65 6e 2c 20 72 65 6e 64 65 72 20 3d 20 78 20 7c 7c 20 79 20 7c 7c 20 77 20 | f8charlen,.render.=.x.||.y.||.w. |
| 3380 | 7c 7c 20 68 3b 00 00 00 18 09 6c 6f 6e 67 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 20 3d 20 30 | ||.h;.....long.utf8codepoint.=.0 |
| 33a0 | 3b 00 00 00 15 09 63 6f 6e 73 74 20 63 68 61 72 20 2a 75 74 66 38 73 74 72 3b 00 00 00 16 09 46 | ;.....const.char.*utf8str;.....F |
| 33c0 | 63 43 68 61 72 53 65 74 20 2a 66 63 63 68 61 72 73 65 74 3b 00 00 00 16 09 46 63 50 61 74 74 65 | cCharSet.*fccharset;.....FcPatte |
| 33e0 | 72 6e 20 2a 66 63 70 61 74 74 65 72 6e 3b 00 00 00 12 09 46 63 50 61 74 74 65 72 6e 20 2a 6d 61 | rn.*fcpattern;.....FcPattern.*ma |
| 3400 | 74 63 68 3b 00 00 00 12 09 58 66 74 52 65 73 75 6c 74 20 72 65 73 75 6c 74 3b 00 00 00 14 09 69 | tch;.....XftResult.result;.....i |
| 3420 | 6e 74 20 63 68 61 72 65 78 69 73 74 73 20 3d 20 30 3b 00 00 00 0a 09 69 6e 74 20 69 2c 20 6e 3b | nt.charexists.=.0;.....int.i,.n; |
| 3440 | 00 00 00 00 00 00 00 4d 09 69 66 20 28 21 64 72 77 20 7c 7c 20 28 72 65 6e 64 65 72 20 26 26 20 | .......M.if.(!drw.||.(render.&&. |
| 3460 | 21 64 72 77 2d 3e 73 63 68 65 6d 65 29 20 7c 7c 20 21 74 65 78 74 20 7c 7c 20 21 64 72 77 2d 3e | !drw->scheme).||.!text.||.!drw-> |
| 3480 | 66 6f 6e 74 73 20 7c 7c 20 74 65 78 74 6c 65 6e 20 3c 3d 20 30 00 00 00 2b 09 20 20 7c 7c 20 28 | fonts.||.textlen.<=.0...+...||.( |
| 34a0 | 61 6c 69 67 6e 20 21 3d 20 41 6c 69 67 6e 4c 20 26 26 20 61 6c 69 67 6e 20 21 3d 20 41 6c 69 67 | align.!=.AlignL.&&.align.!=.Alig |
| 34c0 | 6e 52 29 29 00 00 00 0b 09 09 72 65 74 75 72 6e 20 30 3b 00 00 00 00 00 00 00 0f 09 69 66 20 28 | nR))......return.0;.........if.( |
| 34e0 | 21 72 65 6e 64 65 72 29 20 7b 00 00 00 09 09 09 77 20 3d 20 7e 77 3b 00 00 00 09 09 7d 20 65 6c | !render).{......w.=.~w;.....}.el |
| 3500 | 73 65 20 7b 00 00 00 3e 09 09 58 53 65 74 46 6f 72 65 67 72 6f 75 6e 64 28 64 72 77 2d 3e 64 70 | se.{...>..XSetForeground(drw->dp |
| 3520 | 79 2c 20 64 72 77 2d 3e 67 63 2c 20 64 72 77 2d 3e 73 63 68 65 6d 65 5b 43 6f 6c 42 67 5d 2e 70 | y,.drw->gc,.drw->scheme[ColBg].p |
| 3540 | 69 78 65 6c 29 3b 00 00 00 3f 09 09 58 46 69 6c 6c 52 65 63 74 61 6e 67 6c 65 28 64 72 77 2d 3e | ixel);...?..XFillRectangle(drw-> |
| 3560 | 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 20 64 72 77 2d 3e 67 63 2c 20 78 2c 20 | dpy,.drw->drawable,.drw->gc,.x,. |
| 3580 | 79 2c 20 77 2c 20 68 29 3b 00 00 00 2c 09 09 64 20 3d 20 58 66 74 44 72 61 77 43 72 65 61 74 65 | y,.w,.h);...,..d.=.XftDrawCreate |
| 35a0 | 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 00 00 00 39 09 09 20 | (drw->dpy,.drw->drawable,...9... |
| 35c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 56 69 73 75 61 6c 28 64 | .................DefaultVisual(d |
| 35e0 | 72 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 2c 00 00 00 3c 09 09 20 20 20 20 | rw->dpy,.drw->screen),...<...... |
| 3600 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 43 6f 6c 6f 72 6d 61 70 28 64 72 | ..............DefaultColormap(dr |
| 3620 | 77 2d 3e 64 70 79 2c 20 64 72 77 2d 3e 73 63 72 65 65 6e 29 29 3b 00 00 00 02 09 7d 00 00 00 00 | w->dpy,.drw->screen));.....}.... |
| 3640 | 00 00 00 17 09 75 73 65 64 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 3b 00 00 00 23 09 | .....usedfont.=.drw->fonts;...#. |
| 3660 | 69 20 3d 20 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 20 3f 20 30 20 3a 20 74 65 78 74 6c 65 | i.=.align.==.AlignL.?.0.:.textle |
| 3680 | 6e 3b 00 00 00 21 09 78 20 3d 20 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 20 3f 20 78 20 3a | n;...!.x.=.align.==.AlignL.?.x.: |
| 36a0 | 20 78 20 2b 20 77 3b 00 00 00 0c 09 77 68 69 6c 65 20 28 31 29 20 7b 00 00 00 11 09 09 75 74 66 | .x.+.w;.....while.(1).{......utf |
| 36c0 | 38 73 74 72 6c 65 6e 20 3d 20 30 3b 00 00 00 12 09 09 6e 65 78 74 66 6f 6e 74 20 3d 20 4e 55 4c | 8strlen.=.0;......nextfont.=.NUL |
| 36e0 | 4c 3b 00 00 00 1c 09 09 2f 2a 20 69 66 20 28 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 29 20 | L;....../*.if.(align.==.AlignL). |
| 3700 | 2a 2f 00 00 00 15 09 09 75 74 66 38 73 74 72 20 3d 20 74 65 78 74 20 2b 20 69 3b 00 00 00 00 00 | */......utf8str.=.text.+.i;..... |
| 3720 | 00 00 4a 09 09 77 68 69 6c 65 20 28 28 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 20 26 26 20 | ..J..while.((align.==.AlignL.&&. |
| 3740 | 69 20 3c 20 74 65 78 74 6c 65 6e 29 20 7c 7c 20 28 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 52 | i.<.textlen).||.(align.==.AlignR |
| 3760 | 20 26 26 20 69 20 3e 20 30 29 29 20 7b 00 00 00 19 09 09 09 69 66 20 28 61 6c 69 67 6e 20 3d 3d | .&&.i.>.0)).{.......if.(align.== |
| 3780 | 20 41 6c 69 67 6e 4c 29 20 7b 00 00 00 52 09 09 09 09 75 74 66 38 63 68 61 72 6c 65 6e 20 3d 20 | .AlignL).{...R....utf8charlen.=. |
| 37a0 | 75 74 66 38 64 65 63 6f 64 65 28 74 65 78 74 20 2b 20 69 2c 20 26 75 74 66 38 63 6f 64 65 70 6f | utf8decode(text.+.i,.&utf8codepo |
| 37c0 | 69 6e 74 2c 20 4d 49 4e 28 74 65 78 74 6c 65 6e 20 2d 20 69 2c 20 55 54 46 5f 53 49 5a 29 29 3b | int,.MIN(textlen.-.i,.UTF_SIZ)); |
| 37e0 | 00 00 00 17 09 09 09 09 69 66 20 28 21 75 74 66 38 63 68 61 72 6c 65 6e 29 20 7b 00 00 00 11 09 | ........if.(!utf8charlen).{..... |
| 3800 | 09 09 09 09 74 65 78 74 6c 65 6e 20 3d 20 69 3b 00 00 00 0b 09 09 09 09 09 62 72 65 61 6b 3b 00 | ....textlen.=.i;.........break;. |
| 3820 | 00 00 05 09 09 09 09 7d 00 00 00 0b 09 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 2b 09 09 09 09 6e | .......}.......}.else.{...+....n |
| 3840 | 20 3d 20 75 74 66 38 6e 65 78 74 63 68 61 72 28 74 65 78 74 2c 20 74 65 78 74 6c 65 6e 2c 20 69 | .=.utf8nextchar(text,.textlen,.i |
| 3860 | 2c 20 2d 31 29 3b 00 00 00 52 09 09 09 09 75 74 66 38 63 68 61 72 6c 65 6e 20 3d 20 75 74 66 38 | ,.-1);...R....utf8charlen.=.utf8 |
| 3880 | 64 65 63 6f 64 65 28 74 65 78 74 20 2b 20 6e 2c 20 26 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 2c | decode(text.+.n,.&utf8codepoint, |
| 38a0 | 20 4d 49 4e 28 74 65 78 74 6c 65 6e 20 2d 20 6e 2c 20 55 54 46 5f 53 49 5a 29 29 3b 00 00 00 17 | .MIN(textlen.-.n,.UTF_SIZ));.... |
| 38c0 | 09 09 09 09 69 66 20 28 21 75 74 66 38 63 68 61 72 6c 65 6e 29 20 7b 00 00 00 12 09 09 09 09 09 | ....if.(!utf8charlen).{......... |
| 38e0 | 74 65 78 74 6c 65 6e 20 2d 3d 20 69 3b 00 00 00 0f 09 09 09 09 09 74 65 78 74 20 2b 3d 20 69 3b | textlen.-=.i;.........text.+=.i; |
| 3900 | 00 00 00 0b 09 09 09 09 09 69 20 3d 20 30 3b 00 00 00 0b 09 09 09 09 09 62 72 65 61 6b 3b 00 00 | .........i.=.0;.........break;.. |
| 3920 | 00 05 09 09 09 09 7d 00 00 00 04 09 09 09 7d 00 00 00 41 09 09 09 66 6f 72 20 28 63 75 72 66 6f | ......}.......}...A...for.(curfo |
| 3940 | 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 3b 20 63 75 72 66 6f 6e 74 3b 20 63 75 72 66 6f 6e | nt.=.drw->fonts;.curfont;.curfon |
| 3960 | 74 20 3d 20 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 29 20 7b 00 00 00 56 09 09 09 09 63 68 61 72 | t.=.curfont->next).{...V....char |
| 3980 | 65 78 69 73 74 73 20 3d 20 63 68 61 72 65 78 69 73 74 73 20 7c 7c 20 58 66 74 43 68 61 72 45 78 | exists.=.charexists.||.XftCharEx |
| 39a0 | 69 73 74 73 28 64 72 77 2d 3e 64 70 79 2c 20 63 75 72 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 75 | ists(drw->dpy,.curfont->xfont,.u |
| 39c0 | 74 66 38 63 6f 64 65 70 6f 69 6e 74 29 3b 00 00 00 15 09 09 09 09 69 66 20 28 63 68 61 72 65 78 | tf8codepoint);........if.(charex |
| 39e0 | 69 73 74 73 29 20 7b 00 00 00 1f 09 09 09 09 09 69 66 20 28 63 75 72 66 6f 6e 74 20 3d 3d 20 75 | ists).{.........if.(curfont.==.u |
| 3a00 | 73 65 64 66 6f 6e 74 29 20 7b 00 00 00 20 09 09 09 09 09 09 75 74 66 38 73 74 72 6c 65 6e 20 2b | sedfont).{..........utf8strlen.+ |
| 3a20 | 3d 20 75 74 66 38 63 68 61 72 6c 65 6e 3b 00 00 00 38 09 09 09 09 09 09 69 20 2b 3d 20 61 6c 69 | =.utf8charlen;...8......i.+=.ali |
| 3a40 | 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 20 3f 20 75 74 66 38 63 68 61 72 6c 65 6e 20 3a 20 2d 75 74 | gn.==.AlignL.?.utf8charlen.:.-ut |
| 3a60 | 66 38 63 68 61 72 6c 65 6e 3b 00 00 00 0d 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 19 09 | f8charlen;.........}.else.{..... |
| 3a80 | 09 09 09 09 09 6e 65 78 74 66 6f 6e 74 20 3d 20 63 75 72 66 6f 6e 74 3b 00 00 00 06 09 09 09 09 | .....nextfont.=.curfont;........ |
| 3aa0 | 09 7d 00 00 00 0b 09 09 09 09 09 62 72 65 61 6b 3b 00 00 00 05 09 09 09 09 7d 00 00 00 04 09 09 | .}.........break;........}...... |
| 3ac0 | 09 7d 00 00 00 00 00 00 00 1f 09 09 09 69 66 20 28 21 63 68 61 72 65 78 69 73 74 73 20 7c 7c 20 | .}...........if.(!charexists.||. |
| 3ae0 | 6e 65 78 74 66 6f 6e 74 29 00 00 00 0a 09 09 09 09 62 72 65 61 6b 3b 00 00 00 07 09 09 09 65 6c | nextfont)........break;.......el |
| 3b00 | 73 65 00 00 00 13 09 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 30 3b 00 00 00 03 09 09 7d | se........charexists.=.0;......} |
| 3b20 | 00 00 00 00 00 00 00 16 09 09 69 66 20 28 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 52 29 00 00 | ..........if.(align.==.AlignR).. |
| 3b40 | 00 16 09 09 09 75 74 66 38 73 74 72 20 3d 20 74 65 78 74 20 2b 20 69 3b 00 00 00 00 00 00 00 13 | .....utf8str.=.text.+.i;........ |
| 3b60 | 09 09 69 66 20 28 75 74 66 38 73 74 72 6c 65 6e 29 20 7b 00 00 00 3e 09 09 09 64 72 77 5f 66 6f | ..if.(utf8strlen).{...>...drw_fo |
| 3b80 | 6e 74 5f 67 65 74 65 78 74 73 28 75 73 65 64 66 6f 6e 74 2c 20 75 74 66 38 73 74 72 2c 20 75 74 | nt_getexts(usedfont,.utf8str,.ut |
| 3ba0 | 66 38 73 74 72 6c 65 6e 2c 20 26 65 77 2c 20 4e 55 4c 4c 29 3b 00 00 00 22 09 09 09 2f 2a 20 73 | f8strlen,.&ew,.NULL);...".../*.s |
| 3bc0 | 68 6f 72 74 65 6e 20 74 65 78 74 20 69 66 20 6e 65 63 65 73 73 61 72 79 20 2a 2f 00 00 00 19 09 | horten.text.if.necessary.*/..... |
| 3be0 | 09 09 69 66 20 28 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 29 20 7b 00 00 00 2d 09 09 09 09 | ..if.(align.==.AlignL).{...-.... |
| 3c00 | 66 6f 72 20 28 6c 65 6e 20 3d 20 75 74 66 38 73 74 72 6c 65 6e 3b 20 6c 65 6e 20 26 26 20 65 77 | for.(len.=.utf8strlen;.len.&&.ew |
| 3c20 | 20 3e 20 77 3b 20 29 20 7b 00 00 00 2f 09 09 09 09 09 6c 65 6e 20 3d 20 75 74 66 38 6e 65 78 74 | .>.w;.).{.../.....len.=.utf8next |
| 3c40 | 63 68 61 72 28 75 74 66 38 73 74 72 2c 20 6c 65 6e 2c 20 6c 65 6e 2c 20 2d 31 29 3b 00 00 00 39 | char(utf8str,.len,.len,.-1);...9 |
| 3c60 | 09 09 09 09 09 64 72 77 5f 66 6f 6e 74 5f 67 65 74 65 78 74 73 28 75 73 65 64 66 6f 6e 74 2c 20 | .....drw_font_getexts(usedfont,. |
| 3c80 | 75 74 66 38 73 74 72 2c 20 6c 65 6e 2c 20 26 65 77 2c 20 4e 55 4c 4c 29 3b 00 00 00 05 09 09 09 | utf8str,.len,.&ew,.NULL);....... |
| 3ca0 | 09 7d 00 00 00 0b 09 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 2d 09 09 09 09 66 6f 72 20 28 6c 65 | .}.......}.else.{...-....for.(le |
| 3cc0 | 6e 20 3d 20 75 74 66 38 73 74 72 6c 65 6e 3b 20 6c 65 6e 20 26 26 20 65 77 20 3e 20 77 3b 20 29 | n.=.utf8strlen;.len.&&.ew.>.w;.) |
| 3ce0 | 20 7b 00 00 00 2b 09 09 09 09 09 6e 20 3d 20 75 74 66 38 6e 65 78 74 63 68 61 72 28 75 74 66 38 | .{...+.....n.=.utf8nextchar(utf8 |
| 3d00 | 73 74 72 2c 20 6c 65 6e 2c 20 30 2c 20 2b 31 29 3b 00 00 00 12 09 09 09 09 09 75 74 66 38 73 74 | str,.len,.0,.+1);.........utf8st |
| 3d20 | 72 20 2b 3d 20 6e 3b 00 00 00 0e 09 09 09 09 09 6c 65 6e 20 2d 3d 20 6e 3b 00 00 00 39 09 09 09 | r.+=.n;.........len.-=.n;...9... |
| 3d40 | 09 09 64 72 77 5f 66 6f 6e 74 5f 67 65 74 65 78 74 73 28 75 73 65 64 66 6f 6e 74 2c 20 75 74 66 | ..drw_font_getexts(usedfont,.utf |
| 3d60 | 38 73 74 72 2c 20 6c 65 6e 2c 20 26 65 77 2c 20 4e 55 4c 4c 29 3b 00 00 00 05 09 09 09 09 7d 00 | 8str,.len,.&ew,.NULL);........}. |
| 3d80 | 00 00 04 09 09 09 7d 00 00 00 00 00 00 00 0d 09 09 09 69 66 20 28 6c 65 6e 29 20 7b 00 00 00 11 | ......}...........if.(len).{.... |
| 3da0 | 09 09 09 09 69 66 20 28 72 65 6e 64 65 72 29 20 7b 00 00 00 3e 09 09 09 09 09 74 79 20 3d 20 79 | ....if.(render).{...>.....ty.=.y |
| 3dc0 | 20 2b 20 28 68 20 2d 20 75 73 65 64 66 6f 6e 74 2d 3e 68 29 20 2f 20 32 20 2b 20 75 73 65 64 66 | .+.(h.-.usedfont->h)./.2.+.usedf |
| 3de0 | 6f 6e 74 2d 3e 78 66 6f 6e 74 2d 3e 61 73 63 65 6e 74 3b 00 00 00 2e 09 09 09 09 09 58 66 74 44 | ont->xfont->ascent;.........XftD |
| 3e00 | 72 61 77 53 74 72 69 6e 67 55 74 66 38 28 64 2c 20 26 64 72 77 2d 3e 73 63 68 65 6d 65 5b 43 6f | rawStringUtf8(d,.&drw->scheme[Co |
| 3e20 | 6c 46 67 5d 2c 00 00 00 64 09 09 09 09 09 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | lFg],...d....................... |
| 3e40 | 75 73 65 64 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c | usedfont->xfont,.align.==.AlignL |
| 3e60 | 20 3f 20 78 20 3a 20 78 20 2d 20 65 77 2c 20 74 79 2c 20 28 58 66 74 43 68 61 72 38 20 2a 29 75 | .?.x.:.x.-.ew,.ty,.(XftChar8.*)u |
| 3e80 | 74 66 38 73 74 72 2c 20 6c 65 6e 29 3b 00 00 00 05 09 09 09 09 7d 00 00 00 24 09 09 09 09 78 20 | tf8str,.len);........}...$....x. |
| 3ea0 | 2b 3d 20 61 6c 69 67 6e 20 3d 3d 20 41 6c 69 67 6e 4c 20 3f 20 65 77 20 3a 20 2d 65 77 3b 00 00 | +=.align.==.AlignL.?.ew.:.-ew;.. |
| 3ec0 | 00 0c 09 09 09 09 77 20 2d 3d 20 65 77 3b 00 00 00 04 09 09 09 7d 00 00 00 18 09 09 09 69 66 20 | ......w.-=.ew;.......}.......if. |
| 3ee0 | 28 6c 65 6e 20 3c 20 75 74 66 38 73 74 72 6c 65 6e 29 00 00 00 0a 09 09 09 09 62 72 65 61 6b 3b | (len.<.utf8strlen)........break; |
| 3f00 | 00 00 00 03 09 09 7d 00 00 00 00 00 00 00 49 09 09 69 66 20 28 28 61 6c 69 67 6e 20 3d 3d 20 41 | ......}.......I..if.((align.==.A |
| 3f20 | 6c 69 67 6e 52 20 26 26 20 69 20 3c 3d 20 30 29 20 7c 7c 20 28 61 6c 69 67 6e 20 3d 3d 20 41 6c | lignR.&&.i.<=.0).||.(align.==.Al |
| 3f40 | 69 67 6e 4c 20 26 26 20 69 20 3e 3d 20 74 65 78 74 6c 65 6e 29 29 20 7b 00 00 00 09 09 09 09 62 | ignL.&&.i.>=.textlen)).{.......b |
| 3f60 | 72 65 61 6b 3b 00 00 00 18 09 09 7d 20 65 6c 73 65 20 69 66 20 28 6e 65 78 74 66 6f 6e 74 29 20 | reak;......}.else.if.(nextfont). |
| 3f80 | 7b 00 00 00 12 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 30 3b 00 00 00 17 09 09 09 75 73 | {.......charexists.=.0;.......us |
| 3fa0 | 65 64 66 6f 6e 74 20 3d 20 6e 65 78 74 66 6f 6e 74 3b 00 00 00 0a 09 09 7d 20 65 6c 73 65 20 7b | edfont.=.nextfont;......}.else.{ |
| 3fc0 | 00 00 00 40 09 09 09 2f 2a 20 52 65 67 61 72 64 6c 65 73 73 20 6f 66 20 77 68 65 74 68 65 72 20 | ...@.../*.Regardless.of.whether. |
| 3fe0 | 6f 72 20 6e 6f 74 20 61 20 66 61 6c 6c 62 61 63 6b 20 66 6f 6e 74 20 69 73 20 66 6f 75 6e 64 2c | or.not.a.fallback.font.is.found, |
| 4000 | 20 74 68 65 00 00 00 21 09 09 09 20 2a 20 63 68 61 72 61 63 74 65 72 20 6d 75 73 74 20 62 65 20 | .the...!....*.character.must.be. |
| 4020 | 64 72 61 77 6e 2e 20 2a 2f 00 00 00 12 09 09 09 63 68 61 72 65 78 69 73 74 73 20 3d 20 31 3b 00 | drawn..*/.......charexists.=.1;. |
| 4040 | 00 00 00 00 00 00 21 09 09 09 66 63 63 68 61 72 73 65 74 20 3d 20 46 63 43 68 61 72 53 65 74 43 | ......!...fccharset.=.FcCharSetC |
| 4060 | 72 65 61 74 65 28 29 3b 00 00 00 2e 09 09 09 46 63 43 68 61 72 53 65 74 41 64 64 43 68 61 72 28 | reate();.......FcCharSetAddChar( |
| 4080 | 66 63 63 68 61 72 73 65 74 2c 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 29 3b 00 00 00 00 00 00 | fccharset,.utf8codepoint);...... |
| 40a0 | 00 1e 09 09 09 69 66 20 28 21 64 72 77 2d 3e 66 6f 6e 74 73 2d 3e 70 61 74 74 65 72 6e 29 20 7b | .....if.(!drw->fonts->pattern).{ |
| 40c0 | 00 00 00 44 09 09 09 09 2f 2a 20 52 65 66 65 72 20 74 6f 20 74 68 65 20 63 6f 6d 6d 65 6e 74 20 | ...D..../*.Refer.to.the.comment. |
| 40e0 | 69 6e 20 78 66 6f 6e 74 5f 63 72 65 61 74 65 20 66 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 | in.xfont_create.for.more.informa |
| 4100 | 74 69 6f 6e 2e 20 2a 2f 00 00 00 4a 09 09 09 09 64 69 65 28 22 74 68 65 20 66 69 72 73 74 20 66 | tion..*/...J....die("the.first.f |
| 4120 | 6f 6e 74 20 69 6e 20 74 68 65 20 63 61 63 68 65 20 6d 75 73 74 20 62 65 20 6c 6f 61 64 65 64 20 | ont.in.the.cache.must.be.loaded. |
| 4140 | 66 72 6f 6d 20 61 20 66 6f 6e 74 20 73 74 72 69 6e 67 2e 22 29 3b 00 00 00 04 09 09 09 7d 00 00 | from.a.font.string.");.......}.. |
| 4160 | 00 00 00 00 00 37 09 09 09 66 63 70 61 74 74 65 72 6e 20 3d 20 46 63 50 61 74 74 65 72 6e 44 75 | .....7...fcpattern.=.FcPatternDu |
| 4180 | 70 6c 69 63 61 74 65 28 64 72 77 2d 3e 66 6f 6e 74 73 2d 3e 70 61 74 74 65 72 6e 29 3b 00 00 00 | plicate(drw->fonts->pattern);... |
| 41a0 | 39 09 09 09 46 63 50 61 74 74 65 72 6e 41 64 64 43 68 61 72 53 65 74 28 66 63 70 61 74 74 65 72 | 9...FcPatternAddCharSet(fcpatter |
| 41c0 | 6e 2c 20 46 43 5f 43 48 41 52 53 45 54 2c 20 66 63 63 68 61 72 73 65 74 29 3b 00 00 00 34 09 09 | n,.FC_CHARSET,.fccharset);...4.. |
| 41e0 | 09 46 63 50 61 74 74 65 72 6e 41 64 64 42 6f 6f 6c 28 66 63 70 61 74 74 65 72 6e 2c 20 46 43 5f | .FcPatternAddBool(fcpattern,.FC_ |
| 4200 | 53 43 41 4c 41 42 4c 45 2c 20 46 63 54 72 75 65 29 3b 00 00 00 00 00 00 00 37 09 09 09 46 63 43 | SCALABLE,.FcTrue);.......7...FcC |
| 4220 | 6f 6e 66 69 67 53 75 62 73 74 69 74 75 74 65 28 4e 55 4c 4c 2c 20 66 63 70 61 74 74 65 72 6e 2c | onfigSubstitute(NULL,.fcpattern, |
| 4240 | 20 46 63 4d 61 74 63 68 50 61 74 74 65 72 6e 29 3b 00 00 00 22 09 09 09 46 63 44 65 66 61 75 6c | .FcMatchPattern);..."...FcDefaul |
| 4260 | 74 53 75 62 73 74 69 74 75 74 65 28 66 63 70 61 74 74 65 72 6e 29 3b 00 00 00 43 09 09 09 6d 61 | tSubstitute(fcpattern);...C...ma |
| 4280 | 74 63 68 20 3d 20 58 66 74 46 6f 6e 74 4d 61 74 63 68 28 64 72 77 2d 3e 64 70 79 2c 20 64 72 77 | tch.=.XftFontMatch(drw->dpy,.drw |
| 42a0 | 2d 3e 73 63 72 65 65 6e 2c 20 66 63 70 61 74 74 65 72 6e 2c 20 26 72 65 73 75 6c 74 29 3b 00 00 | ->screen,.fcpattern,.&result);.. |
| 42c0 | 00 00 00 00 00 1f 09 09 09 46 63 43 68 61 72 53 65 74 44 65 73 74 72 6f 79 28 66 63 63 68 61 72 | .........FcCharSetDestroy(fcchar |
| 42e0 | 73 65 74 29 3b 00 00 00 1f 09 09 09 46 63 50 61 74 74 65 72 6e 44 65 73 74 72 6f 79 28 66 63 70 | set);.......FcPatternDestroy(fcp |
| 4300 | 61 74 74 65 72 6e 29 3b 00 00 00 00 00 00 00 0f 09 09 09 69 66 20 28 6d 61 74 63 68 29 20 7b 00 | attern);...........if.(match).{. |
| 4320 | 00 00 2e 09 09 09 09 75 73 65 64 66 6f 6e 74 20 3d 20 78 66 6f 6e 74 5f 63 72 65 61 74 65 28 64 | .......usedfont.=.xfont_create(d |
| 4340 | 72 77 2c 20 4e 55 4c 4c 2c 20 6d 61 74 63 68 29 3b 00 00 00 4e 09 09 09 09 69 66 20 28 75 73 65 | rw,.NULL,.match);...N....if.(use |
| 4360 | 64 66 6f 6e 74 20 26 26 20 58 66 74 43 68 61 72 45 78 69 73 74 73 28 64 72 77 2d 3e 64 70 79 2c | dfont.&&.XftCharExists(drw->dpy, |
| 4380 | 20 75 73 65 64 66 6f 6e 74 2d 3e 78 66 6f 6e 74 2c 20 75 74 66 38 63 6f 64 65 70 6f 69 6e 74 29 | .usedfont->xfont,.utf8codepoint) |
| 43a0 | 29 20 7b 00 00 00 47 09 09 09 09 09 66 6f 72 20 28 63 75 72 66 6f 6e 74 20 3d 20 64 72 77 2d 3e | ).{...G.....for.(curfont.=.drw-> |
| 43c0 | 66 6f 6e 74 73 3b 20 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 3b 20 63 75 72 66 6f 6e 74 20 3d 20 | fonts;.curfont->next;.curfont.=. |
| 43e0 | 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 29 00 00 00 11 09 09 09 09 09 09 3b 20 2f 2a 20 4e 4f 50 | curfont->next)..........;./*.NOP |
| 4400 | 20 2a 2f 00 00 00 1e 09 09 09 09 09 63 75 72 66 6f 6e 74 2d 3e 6e 65 78 74 20 3d 20 75 73 65 64 | .*/.........curfont->next.=.used |
| 4420 | 66 6f 6e 74 3b 00 00 00 0c 09 09 09 09 7d 20 65 6c 73 65 20 7b 00 00 00 1a 09 09 09 09 09 78 66 | font;........}.else.{.........xf |
| 4440 | 6f 6e 74 5f 66 72 65 65 28 75 73 65 64 66 6f 6e 74 29 3b 00 00 00 1b 09 09 09 09 09 75 73 65 64 | ont_free(usedfont);.........used |
| 4460 | 66 6f 6e 74 20 3d 20 64 72 77 2d 3e 66 6f 6e 74 73 3b 00 00 00 05 09 09 09 09 7d 00 00 00 04 09 | font.=.drw->fonts;........}..... |
| 4480 | 09 09 7d 00 00 00 03 09 09 7d 00 00 00 02 09 7d 00 00 00 07 09 69 66 20 28 64 29 00 00 00 14 09 | ..}......}.....}.....if.(d)..... |
| 44a0 | 09 58 66 74 44 72 61 77 44 65 73 74 72 6f 79 28 64 29 3b 00 00 00 00 00 00 00 0a 09 72 65 74 75 | .XftDrawDestroy(d);.........retu |
| 44c0 | 72 6e 20 78 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 4b 64 72 77 5f 6d 61 | rn.x;....}........void...Kdrw_ma |
| 44e0 | 70 28 44 72 77 20 2a 64 72 77 2c 20 57 69 6e 64 6f 77 20 77 69 6e 2c 20 69 6e 74 20 78 2c 20 69 | p(Drw.*drw,.Window.win,.int.x,.i |
| 4500 | 6e 74 20 79 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 77 2c 20 75 6e 73 69 67 6e 65 64 20 69 | nt.y,.unsigned.int.w,.unsigned.i |
| 4520 | 6e 74 20 68 29 00 00 00 01 7b 00 00 00 0a 09 69 66 20 28 21 64 72 77 29 00 00 00 09 09 09 72 65 | nt.h)....{.....if.(!drw)......re |
| 4540 | 74 75 72 6e 3b 00 00 00 00 00 00 00 44 09 58 43 6f 70 79 41 72 65 61 28 64 72 77 2d 3e 64 70 79 | turn;.......D.XCopyArea(drw->dpy |
| 4560 | 2c 20 64 72 77 2d 3e 64 72 61 77 61 62 6c 65 2c 20 77 69 6e 2c 20 64 72 77 2d 3e 67 63 2c 20 78 | ,.drw->drawable,.win,.drw->gc,.x |
| 4580 | 2c 20 79 2c 20 77 2c 20 68 2c 20 78 2c 20 79 29 3b 00 00 00 18 09 58 53 79 6e 63 28 64 72 77 2d | ,.y,.w,.h,.x,.y);.....XSync(drw- |
| 45a0 | 3e 64 70 79 2c 20 46 61 6c 73 65 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 0c 75 6e 73 69 67 6e | >dpy,.False);....}........unsign |
| 45c0 | 65 64 20 69 6e 74 00 00 00 30 64 72 77 5f 66 6f 6e 74 73 65 74 5f 67 65 74 77 69 64 74 68 28 44 | ed.int...0drw_fontset_getwidth(D |
| 45e0 | 72 77 20 2a 64 72 77 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 29 00 00 00 01 7b 00 | rw.*drw,.const.char.*text)....{. |
| 4600 | 00 00 22 09 69 66 20 28 21 64 72 77 20 7c 7c 20 21 64 72 77 2d 3e 66 6f 6e 74 73 20 7c 7c 20 21 | ..".if.(!drw.||.!drw->fonts.||.! |
| 4620 | 74 65 78 74 29 00 00 00 0b 09 09 72 65 74 75 72 6e 20 30 3b 00 00 00 2e 09 72 65 74 75 72 6e 20 | text)......return.0;.....return. |
| 4640 | 64 72 77 5f 74 65 78 74 28 64 72 77 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 74 65 78 | drw_text(drw,.0,.0,.0,.0,.0,.tex |
| 4660 | 74 2c 20 30 29 3b 00 00 00 01 7d 00 00 00 00 00 00 00 0c 75 6e 73 69 67 6e 65 64 20 69 6e 74 00 | t,.0);....}........unsigned.int. |
| 4680 | 00 00 46 64 72 77 5f 66 6f 6e 74 73 65 74 5f 67 65 74 77 69 64 74 68 5f 63 6c 61 6d 70 28 44 72 | ..Fdrw_fontset_getwidth_clamp(Dr |
| 46a0 | 77 20 2a 64 72 77 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20 75 6e 73 69 67 6e | w.*drw,.const.char.*text,.unsign |
| 46c0 | 65 64 20 69 6e 74 20 6e 29 00 00 00 01 7b 00 00 00 16 09 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 | ed.int.n)....{.....unsigned.int. |
| 46e0 | 74 6d 70 20 3d 20 30 3b 00 00 00 24 09 69 66 20 28 64 72 77 20 26 26 20 64 72 77 2d 3e 66 6f 6e | tmp.=.0;...$.if.(drw.&&.drw->fon |
| 4700 | 74 73 20 26 26 20 74 65 78 74 20 26 26 20 6e 29 00 00 00 2e 09 09 74 6d 70 20 3d 20 64 72 77 5f | ts.&&.text.&&.n)......tmp.=.drw_ |
| 4720 | 74 65 78 74 28 64 72 77 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 30 2c 20 74 65 78 74 2c 20 6e | text(drw,.0,.0,.0,.0,.0,.text,.n |
| 4740 | 29 3b 00 00 00 14 09 72 65 74 75 72 6e 20 4d 49 4e 28 6e 2c 20 74 6d 70 29 3b 00 00 00 01 7d 00 | );.....return.MIN(n,.tmp);....}. |
| 4760 | 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 61 64 72 77 5f 66 6f 6e 74 5f 67 65 74 65 78 74 73 28 | .......void...adrw_font_getexts( |
| 4780 | 46 6e 74 20 2a 66 6f 6e 74 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20 75 6e 73 | Fnt.*font,.const.char.*text,.uns |
| 47a0 | 69 67 6e 65 64 20 69 6e 74 20 6c 65 6e 2c 20 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 2a 77 2c 20 | igned.int.len,.unsigned.int.*w,. |
| 47c0 | 75 6e 73 69 67 6e 65 64 20 69 6e 74 20 2a 68 29 00 00 00 01 7b 00 00 00 10 09 58 47 6c 79 70 68 | unsigned.int.*h)....{.....XGlyph |
| 47e0 | 49 6e 66 6f 20 65 78 74 3b 00 00 00 00 00 00 00 14 09 69 66 20 28 21 66 6f 6e 74 20 7c 7c 20 21 | Info.ext;.........if.(!font.||.! |
| 4800 | 74 65 78 74 29 00 00 00 09 09 09 72 65 74 75 72 6e 3b 00 00 00 00 00 00 00 49 09 58 66 74 54 65 | text)......return;.......I.XftTe |
| 4820 | 78 74 45 78 74 65 6e 74 73 55 74 66 38 28 66 6f 6e 74 2d 3e 64 70 79 2c 20 66 6f 6e 74 2d 3e 78 | xtExtentsUtf8(font->dpy,.font->x |
| 4840 | 66 6f 6e 74 2c 20 28 58 66 74 43 68 61 72 38 20 2a 29 74 65 78 74 2c 20 6c 65 6e 2c 20 26 65 78 | font,.(XftChar8.*)text,.len,.&ex |
| 4860 | 74 29 3b 00 00 00 07 09 69 66 20 28 77 29 00 00 00 10 09 09 2a 77 20 3d 20 65 78 74 2e 78 4f 66 | t);.....if.(w)......*w.=.ext.xOf |
| 4880 | 66 3b 00 00 00 07 09 69 66 20 28 68 29 00 00 00 0f 09 09 2a 68 20 3d 20 66 6f 6e 74 2d 3e 68 3b | f;.....if.(h)......*h.=.font->h; |
| 48a0 | 00 00 00 01 7d 00 00 00 00 00 00 00 05 43 75 72 20 2a 00 00 00 23 64 72 77 5f 63 75 72 5f 63 72 | ....}........Cur.*...#drw_cur_cr |
| 48c0 | 65 61 74 65 28 44 72 77 20 2a 64 72 77 2c 20 69 6e 74 20 73 68 61 70 65 29 00 00 00 01 7b 00 00 | eate(Drw.*drw,.int.shape)....{.. |
| 48e0 | 00 0a 09 43 75 72 20 2a 63 75 72 3b 00 00 00 00 00 00 00 2e 09 69 66 20 28 21 64 72 77 20 7c 7c | ...Cur.*cur;.........if.(!drw.|| |
| 4900 | 20 21 28 63 75 72 20 3d 20 65 63 61 6c 6c 6f 63 28 31 2c 20 73 69 7a 65 6f 66 28 43 75 72 29 29 | .!(cur.=.ecalloc(1,.sizeof(Cur)) |
| 4920 | 29 29 00 00 00 0e 09 09 72 65 74 75 72 6e 20 4e 55 4c 4c 3b 00 00 00 00 00 00 00 32 09 63 75 72 | ))......return.NULL;.......2.cur |
| 4940 | 2d 3e 63 75 72 73 6f 72 20 3d 20 58 43 72 65 61 74 65 46 6f 6e 74 43 75 72 73 6f 72 28 64 72 77 | ->cursor.=.XCreateFontCursor(drw |
| 4960 | 2d 3e 64 70 79 2c 20 73 68 61 70 65 29 3b 00 00 00 00 00 00 00 0c 09 72 65 74 75 72 6e 20 63 75 | ->dpy,.shape);.........return.cu |
| 4980 | 72 3b 00 00 00 01 7d 00 00 00 00 00 00 00 04 76 6f 69 64 00 00 00 23 64 72 77 5f 63 75 72 5f 66 | r;....}........void...#drw_cur_f |
| 49a0 | 72 65 65 28 44 72 77 20 2a 64 72 77 2c 20 43 75 72 20 2a 63 75 72 73 6f 72 29 00 00 00 01 7b 00 | ree(Drw.*drw,.Cur.*cursor)....{. |
| 49c0 | 00 00 0d 09 69 66 20 28 21 63 75 72 73 6f 72 29 00 00 00 09 09 09 72 65 74 75 72 6e 3b 00 00 00 | ....if.(!cursor)......return;... |
| 49e0 | 00 00 00 00 27 09 58 46 72 65 65 43 75 72 73 6f 72 28 64 72 77 2d 3e 64 70 79 2c 20 63 75 72 73 | ....'.XFreeCursor(drw->dpy,.curs |
| 4a00 | 6f 72 2d 3e 63 75 72 73 6f 72 29 3b 00 00 00 0e 09 66 72 65 65 28 63 75 72 73 6f 72 29 3b 35 81 | or->cursor);.....free(cursor);5. |
| 4a20 | f5 18 00 00 00 00 01 00 00 00 0a 00 00 00 7e 02 00 00 01 00 00 00 62 02 00 00 02 00 00 00 44 00 | ..............~.......b.......D. |
| 4a40 | 00 00 00 00 00 00 4d 3e 00 00 00 00 00 00 18 44 00 00 00 00 00 00 35 81 e7 aa | ......M>.......D......5... |