aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2014-03-01 11:04:03 +0100
committerChristoph Lohmann <20h@r-36.net>2014-03-01 11:04:03 +0100
commit1584956a60f7739e46c5a0cd0e0e8295aa26071c (patch)
tree6e0a8e4825133abca1312e02935ce04815a8d5e6
parentd2ec39f0ef4b9d7f291aeba548a56144fce8a42f (diff)
downloadst-patched-1584956a60f7739e46c5a0cd0e0e8295aa26071c.tar.bz2
st-patched-1584956a60f7739e46c5a0cd0e0e8295aa26071c.tar.xz
st-patched-1584956a60f7739e46c5a0cd0e0e8295aa26071c.zip
Style cleanup.
Add some note about the main reason why st is still that big.
-rw-r--r--st.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/st.c b/st.c
index 9371b62..c16e45d 100644
--- a/st.c
+++ b/st.c
@@ -3091,6 +3091,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3091 if(base.fg == defaultfg) 3091 if(base.fg == defaultfg)
3092 base.fg = defaultunderline; 3092 base.fg = defaultunderline;
3093 } 3093 }
3094
3094 if(IS_TRUECOL(base.fg)) { 3095 if(IS_TRUECOL(base.fg)) {
3095 colfg.alpha = 0xffff; 3096 colfg.alpha = 0xffff;
3096 colfg.red = TRUERED(base.fg); 3097 colfg.red = TRUERED(base.fg);
@@ -3113,8 +3114,6 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3113 bg = &dc.col[base.bg]; 3114 bg = &dc.col[base.bg];
3114 } 3115 }
3115 3116
3116
3117
3118 if(base.mode & ATTR_BOLD) { 3117 if(base.mode & ATTR_BOLD) {
3119 if(BETWEEN(base.fg, 0, 7)) { 3118 if(BETWEEN(base.fg, 0, 7)) {
3120 /* basic system colors */ 3119 /* basic system colors */
@@ -3144,7 +3143,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3144 colfg.green = ~fg->color.green; 3143 colfg.green = ~fg->color.green;
3145 colfg.blue = ~fg->color.blue; 3144 colfg.blue = ~fg->color.blue;
3146 colfg.alpha = fg->color.alpha; 3145 colfg.alpha = fg->color.alpha;
3147 XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg); 3146 XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg,
3147 &revfg);
3148 fg = &revfg; 3148 fg = &revfg;
3149 } 3149 }
3150 3150
@@ -3155,7 +3155,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3155 colbg.green = ~bg->color.green; 3155 colbg.green = ~bg->color.green;
3156 colbg.blue = ~bg->color.blue; 3156 colbg.blue = ~bg->color.blue;
3157 colbg.alpha = bg->color.alpha; 3157 colbg.alpha = bg->color.alpha;
3158 XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &revbg); 3158 XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg,
3159 &revbg);
3159 bg = &revbg; 3160 bg = &revbg;
3160 } 3161 }
3161 } 3162 }
@@ -3235,7 +3236,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3235 u8fblen += u8cblen; 3236 u8fblen += u8cblen;
3236 } 3237 }
3237 if(doesexist) { 3238 if(doesexist) {
3238 if (oneatatime) 3239 if(oneatatime)
3239 continue; 3240 continue;
3240 break; 3241 break;
3241 } 3242 }
@@ -3258,6 +3259,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3258 * Nothing was found in the cache. Now use 3259 * Nothing was found in the cache. Now use
3259 * some dozen of Fontconfig calls to get the 3260 * some dozen of Fontconfig calls to get the
3260 * font for one single character. 3261 * font for one single character.
3262 *
3263 * Xft and fontconfig are design failures.
3261 */ 3264 */
3262 fcpattern = FcPatternDuplicate(font->pattern); 3265 fcpattern = FcPatternDuplicate(font->pattern);
3263 fccharset = FcCharSetCreate(); 3266 fccharset = FcCharSetCreate();
@@ -3302,6 +3305,12 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3302 } 3305 }
3303 3306
3304 /* 3307 /*
3308 * This is how the loop above actually should be. Why does the
3309 * application have to care about font details?
3310 *
3311 * I have to repeat: Xft and Fontconfig are design failures.
3312 */
3313 /*
3305 XftDrawStringUtf8(xw.draw, fg, font->set, winx, 3314 XftDrawStringUtf8(xw.draw, fg, font->set, winx,
3306 winy + font->ascent, (FcChar8 *)s, bytelen); 3315 winy + font->ascent, (FcChar8 *)s, bytelen);
3307 */ 3316 */