tag.c
changeset 939 a1ac5930ba2f
parent 926 6f9cf0cfe278
child 941 8c93b982f22e
equal deleted inserted replaced
938:c73a49ccfa29 939:a1ac5930ba2f
   108 	for(i = 0; i < ntags; i++)
   108 	for(i = 0; i < ntags; i++)
   109 		sel->tags[i] = arg == NULL;
   109 		sel->tags[i] = arg == NULL;
   110 	i = arg ? atoi(arg) : 0;
   110 	i = arg ? atoi(arg) : 0;
   111 	if(i >= 0 && i < ntags)
   111 	if(i >= 0 && i < ntags)
   112 		sel->tags[i] = True;
   112 		sel->tags[i] = True;
   113 	lt->arrange();
   113 	lt->arrange(NULL);
   114 }
   114 }
   115 
   115 
   116 void
   116 void
   117 toggletag(const char *arg) {
   117 toggletag(const char *arg) {
   118 	int i, j;
   118 	int i, j;
   122 	i = arg ? atoi(arg) : 0;
   122 	i = arg ? atoi(arg) : 0;
   123 	sel->tags[i] = !sel->tags[i];
   123 	sel->tags[i] = !sel->tags[i];
   124 	for(j = 0; j < ntags && !sel->tags[j]; j++);
   124 	for(j = 0; j < ntags && !sel->tags[j]; j++);
   125 	if(j == ntags)
   125 	if(j == ntags)
   126 		sel->tags[i] = True;
   126 		sel->tags[i] = True;
   127 	lt->arrange();
   127 	lt->arrange(NULL);
   128 }
   128 }
   129 
   129 
   130 void
   130 void
   131 toggleview(const char *arg) {
   131 toggleview(const char *arg) {
   132 	int i, j;
   132 	int i, j;
   134 	i = arg ? atoi(arg) : 0;
   134 	i = arg ? atoi(arg) : 0;
   135 	seltag[i] = !seltag[i];
   135 	seltag[i] = !seltag[i];
   136 	for(j = 0; j < ntags && !seltag[j]; j++);
   136 	for(j = 0; j < ntags && !seltag[j]; j++);
   137 	if(j == ntags)
   137 	if(j == ntags)
   138 		seltag[i] = True; /* cannot toggle last view */
   138 		seltag[i] = True; /* cannot toggle last view */
   139 	lt->arrange();
   139 	lt->arrange(NULL);
   140 }
   140 }
   141 
   141 
   142 void
   142 void
   143 view(const char *arg) {
   143 view(const char *arg) {
   144 	int i;
   144 	int i;
   146 	for(i = 0; i < ntags; i++)
   146 	for(i = 0; i < ntags; i++)
   147 		seltag[i] = arg == NULL;
   147 		seltag[i] = arg == NULL;
   148 	i = arg ? atoi(arg) : 0;
   148 	i = arg ? atoi(arg) : 0;
   149 	if(i >= 0 && i < ntags)
   149 	if(i >= 0 && i < ntags)
   150 		seltag[i] = True;
   150 		seltag[i] = True;
   151 	lt->arrange();
   151 	lt->arrange(NULL);
   152 }
   152 }