comparison tag.c @ 573:797e27162b43

fififif
author arg@mig29
date Wed, 22 Nov 2006 16:17:50 +0100
parents a5567a0d3011
children 601842ee4484
comparison
equal deleted inserted replaced
572:427708bf5f36 573:797e27162b43
102 XFree(ch.res_name); 102 XFree(ch.res_name);
103 } 103 }
104 if(!matched) 104 if(!matched)
105 for(i = 0; i < ntags; i++) 105 for(i = 0; i < ntags; i++)
106 c->tags[i] = seltag[i]; 106 c->tags[i] = seltag[i];
107 for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
108 } 107 }
109 108
110 void 109 void
111 tag(Arg *arg) { 110 tag(Arg *arg) {
112 unsigned int i; 111 unsigned int i;
114 if(!sel) 113 if(!sel)
115 return; 114 return;
116 for(i = 0; i < ntags; i++) 115 for(i = 0; i < ntags; i++)
117 sel->tags[i] = False; 116 sel->tags[i] = False;
118 sel->tags[arg->i] = True; 117 sel->tags[arg->i] = True;
119 sel->weight = arg->i;
120 arrange(); 118 arrange();
121 } 119 }
122 120
123 void 121 void
124 toggletag(Arg *arg) { 122 toggletag(Arg *arg) {
128 return; 126 return;
129 sel->tags[arg->i] = !sel->tags[arg->i]; 127 sel->tags[arg->i] = !sel->tags[arg->i];
130 for(i = 0; i < ntags && !sel->tags[i]; i++); 128 for(i = 0; i < ntags && !sel->tags[i]; i++);
131 if(i == ntags) 129 if(i == ntags)
132 sel->tags[arg->i] = True; 130 sel->tags[arg->i] = True;
133 sel->weight = (i == ntags) ? arg->i : i;
134 arrange(); 131 arrange();
135 } 132 }