nsxiv5b01c15
Unified file index variable for image & thumbnail mode
+65 −78
4 files changed
- M commands.c +18 −28
- M main.c +22 −26
- M thumbs.c +23 −22
- M thumbs.h +2 −2
| @@ -76,18 +76,17 @@ bool cg_switch_mode(arg_t a) | |||
| 76 | 76 | { | |
| 77 | 77 | if (mode == MODE_IMAGE) { | |
| 78 | 78 | if (tns.thumbs == NULL) | |
| 79 | − | tns_init(&tns, filecnt, &win); | |
| 79 | + | tns_init(&tns, filecnt, &win, &fileidx); | |
| 80 | 80 | img_close(&img, false); | |
| 81 | 81 | reset_timeout(reset_cursor); | |
| 82 | 82 | if (img.ss.on) { | |
| 83 | 83 | img.ss.on = false; | |
| 84 | 84 | reset_timeout(slideshow); | |
| 85 | 85 | } | |
| 86 | − | tns.sel = fileidx; | |
| 87 | 86 | tns.dirty = true; | |
| 88 | 87 | mode = MODE_THUMB; | |
| 89 | 88 | } else { | |
| 90 | − | load_image(tns.sel); | |
| 89 | + | load_image(fileidx); | |
| 91 | 90 | mode = MODE_IMAGE; | |
| 92 | 91 | } | |
| 93 | 92 | return true; | |
| @@ -130,11 +129,9 @@ bool cg_reload_image(arg_t a) | |||
| 130 | 129 | load_image(fileidx); | |
| 131 | 130 | } else { | |
| 132 | 131 | win_set_cursor(&win, CURSOR_WATCH); | |
| 133 | − | if (!tns_load(&tns, tns.sel, &files[tns.sel], true, false)) { | |
| 134 | − | remove_file(tns.sel, false); | |
| 132 | + | if (!tns_load(&tns, fileidx, &files[fileidx], true, false)) { | |
| 133 | + | remove_file(fileidx, false); | |
| 135 | 134 | tns.dirty = true; | |
| 136 | − | if (tns.sel >= tns.cnt) | |
| 137 | − | tns.sel = tns.cnt - 1; | |
| 138 | 135 | } | |
| 139 | 136 | } | |
| 140 | 137 | return true; | |
| @@ -146,11 +143,9 @@ bool cg_remove_image(arg_t a) | |||
| 146 | 143 | remove_file(fileidx, true); | |
| 147 | 144 | load_image(fileidx >= filecnt ? filecnt - 1 : fileidx); | |
| 148 | 145 | return true; | |
| 149 | − | } else if (tns.sel < tns.cnt) { | |
| 150 | − | remove_file(tns.sel, true); | |
| 146 | + | } else if (fileidx < tns.cnt) { | |
| 147 | + | remove_file(fileidx, true); | |
| 151 | 148 | tns.dirty = true; | |
| 152 | − | if (tns.sel >= tns.cnt) | |
| 153 | − | tns.sel = tns.cnt - 1; | |
| 154 | 149 | return true; | |
| 155 | 150 | } else { | |
| 156 | 151 | return false; | |
| @@ -162,8 +157,8 @@ bool cg_first(arg_t a) | |||
| 162 | 157 | if (mode == MODE_IMAGE && fileidx != 0) { | |
| 163 | 158 | load_image(0); | |
| 164 | 159 | return true; | |
| 165 | − | } else if (mode == MODE_THUMB && tns.sel != 0) { | |
| 166 | − | tns.sel = 0; | |
| 160 | + | } else if (mode == MODE_THUMB && fileidx != 0) { | |
| 161 | + | fileidx = 0; | |
| 167 | 162 | tns.dirty = true; | |
| 168 | 163 | return true; | |
| 169 | 164 | } else { | |
| @@ -178,8 +173,8 @@ bool cg_n_or_last(arg_t a) | |||
| 178 | 173 | if (mode == MODE_IMAGE && fileidx != n) { | |
| 179 | 174 | load_image(n); | |
| 180 | 175 | return true; | |
| 181 | − | } else if (mode == MODE_THUMB && tns.sel != n) { | |
| 182 | − | tns.sel = n; | |
| 176 | + | } else if (mode == MODE_THUMB && fileidx != n) { | |
| 177 | + | fileidx = n; | |
| 183 | 178 | tns.dirty = true; | |
| 184 | 179 | return true; | |
| 185 | 180 | } else { | |
| @@ -199,11 +194,9 @@ bool cg_scroll_screen(arg_t a) | |||
| 199 | 194 | ||
| 200 | 195 | bool cg_toggle_image_mark(arg_t a) | |
| 201 | 196 | { | |
| 202 | − | int sel = mode == MODE_IMAGE ? fileidx : tns.sel; | |
| 203 | − | ||
| 204 | − | files[sel].marked = !files[sel].marked; | |
| 197 | + | files[fileidx].marked = !files[fileidx].marked; | |
| 205 | 198 | if (mode == MODE_THUMB) | |
| 206 | − | tns_mark(&tns, sel, files[sel].marked); | |
| 199 | + | tns_mark(&tns, fileidx, files[fileidx].marked); | |
| 207 | 200 | return true; | |
| 208 | 201 | } | |
| 209 | 202 | ||
| @@ -221,26 +214,23 @@ bool cg_reverse_marks(arg_t a) | |||
| 221 | 214 | bool cg_navigate_marked(arg_t a) | |
| 222 | 215 | { | |
| 223 | 216 | long n = (long) a; | |
| 224 | − | int d, i, cnt, sel, new; | |
| 217 | + | int d, i; | |
| 218 | + | int cnt = mode == MODE_IMAGE ? filecnt : tns.cnt, new = fileidx; | |
| 225 | 219 | ||
| 226 | − | if (mode == MODE_IMAGE) | |
| 227 | − | cnt = filecnt, sel = new = fileidx; | |
| 228 | − | else | |
| 229 | − | cnt = tns.cnt, sel = new = tns.sel; | |
| 230 | 220 | if (prefix > 0) | |
| 231 | 221 | n *= prefix; | |
| 232 | 222 | d = n > 0 ? 1 : -1; | |
| 233 | − | for (i = sel + d; n != 0 && i >= 0 && i < cnt; i += d) { | |
| 223 | + | for (i = fileidx + d; n != 0 && i >= 0 && i < cnt; i += d) { | |
| 234 | 224 | if (files[i].marked) { | |
| 235 | 225 | n -= d; | |
| 236 | 226 | new = i; | |
| 237 | 227 | } | |
| 238 | 228 | } | |
| 239 | − | if (new != sel) { | |
| 229 | + | if (new != fileidx) { | |
| 240 | 230 | if (mode == MODE_IMAGE) { | |
| 241 | 231 | load_image(new); | |
| 242 | 232 | } else { | |
| 243 | − | tns.sel = new; | |
| 233 | + | fileidx = new; | |
| 244 | 234 | tns.dirty = true; | |
| 245 | 235 | } | |
| 246 | 236 | return true; | |
| @@ -462,7 +452,7 @@ bool ct_move_sel(arg_t a) | |||
| 462 | 452 | bool ct_reload_all(arg_t a) | |
| 463 | 453 | { | |
| 464 | 454 | tns_free(&tns); | |
| 465 | − | tns_init(&tns, filecnt, &win); | |
| 455 | + | tns_init(&tns, filecnt, &win, &fileidx); | |
| 466 | 456 | return false; | |
| 467 | 457 | } | |
| 468 | 458 | ||
| @@ -184,6 +184,8 @@ void remove_file(int n, bool manual) | |||
| 184 | 184 | filecnt--; | |
| 185 | 185 | if (n < tns.cnt) | |
| 186 | 186 | tns.cnt--; | |
| 187 | + | if (mode == MODE_THUMB && fileidx >= tns.cnt) | |
| 188 | + | fileidx = tns.cnt - 1; | |
| 187 | 189 | if (n < alternate) | |
| 188 | 190 | alternate--; | |
| 189 | 191 | } | |
| @@ -340,7 +342,6 @@ void load_image(int new) | |||
| 340 | 342 | ||
| 341 | 343 | void update_info(void) | |
| 342 | 344 | { | |
| 343 | − | int sel; | |
| 344 | 345 | unsigned int i, fn, fw, n; | |
| 345 | 346 | unsigned int llen = sizeof(win.bar.l), rlen = sizeof(win.bar.r); | |
| 346 | 347 | char *lt = win.bar.l, *rt = win.bar.r, title[TITLE_LEN]; | |
| @@ -348,23 +349,22 @@ void update_info(void) | |||
| 348 | 349 | bool ow_info; | |
| 349 | 350 | ||
| 350 | 351 | for (fw = 0, i = filecnt; i > 0; fw++, i /= 10); | |
| 351 | − | sel = mode == MODE_IMAGE ? fileidx : tns.sel; | |
| 352 | 352 | ||
| 353 | 353 | /* update window title */ | |
| 354 | 354 | if (mode == MODE_THUMB) { | |
| 355 | 355 | win_set_title(&win, "sxiv"); | |
| 356 | 356 | } else { | |
| 357 | − | snprintf(title, sizeof(title), "sxiv - %s", files[sel].name); | |
| 357 | + | snprintf(title, sizeof(title), "sxiv - %s", files[fileidx].name); | |
| 358 | 358 | win_set_title(&win, title); | |
| 359 | 359 | } | |
| 360 | 360 | ||
| 361 | 361 | /* update bar contents */ | |
| 362 | 362 | if (win.bar.h == 0) | |
| 363 | 363 | return; | |
| 364 | − | mark = files[sel].marked ? "* " : ""; | |
| 364 | + | mark = files[fileidx].marked ? "* " : ""; | |
| 365 | 365 | if (mode == MODE_THUMB) { | |
| 366 | 366 | if (tns.loadnext >= filecnt) { | |
| 367 | − | n = snprintf(rt, rlen, "%s%0*d/%d", mark, fw, sel + 1, filecnt); | |
| 367 | + | n = snprintf(rt, rlen, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt); | |
| 368 | 368 | ow_info = true; | |
| 369 | 369 | } else { | |
| 370 | 370 | snprintf(lt, llen, "Loading... %0*d/%d", fw, tns.loadnext, filecnt); | |
| @@ -383,18 +383,18 @@ void update_info(void) | |||
| 383 | 383 | n += snprintf(rt + n, rlen - n, "%0*d/%d | ", | |
| 384 | 384 | fn, img.multi.sel + 1, img.multi.cnt); | |
| 385 | 385 | } | |
| 386 | − | n += snprintf(rt + n, rlen - n, "%0*d/%d", fw, sel + 1, filecnt); | |
| 386 | + | n += snprintf(rt + n, rlen - n, "%0*d/%d", fw, fileidx + 1, filecnt); | |
| 387 | 387 | ow_info = info.cmd == NULL; | |
| 388 | 388 | } | |
| 389 | 389 | if (ow_info) { | |
| 390 | − | fn = strlen(files[sel].name); | |
| 390 | + | fn = strlen(files[fileidx].name); | |
| 391 | 391 | if (fn < llen && | |
| 392 | − | win_textwidth(files[sel].name, fn, true) + | |
| 392 | + | win_textwidth(files[fileidx].name, fn, true) + | |
| 393 | 393 | win_textwidth(rt, n, true) < win.w) | |
| 394 | 394 | { | |
| 395 | − | strncpy(lt, files[sel].name, llen); | |
| 395 | + | strncpy(lt, files[fileidx].name, llen); | |
| 396 | 396 | } else { | |
| 397 | − | strncpy(lt, files[sel].base, llen); | |
| 397 | + | strncpy(lt, files[fileidx].base, llen); | |
| 398 | 398 | } | |
| 399 | 399 | } | |
| 400 | 400 | } | |
| @@ -464,7 +464,7 @@ void clear_resize(void) | |||
| 464 | 464 | void run_key_handler(const char *key, unsigned int mask) | |
| 465 | 465 | { | |
| 466 | 466 | pid_t pid; | |
| 467 | − | int retval, status, n = mode == MODE_IMAGE ? fileidx : tns.sel; | |
| 467 | + | int retval, status; | |
| 468 | 468 | char kstr[32], oldbar[sizeof(win.bar.l)]; | |
| 469 | 469 | bool restore_bar = mode == MODE_IMAGE && info.cmd != NULL; | |
| 470 | 470 | struct stat oldst, newst; | |
| @@ -489,10 +489,10 @@ void run_key_handler(const char *key, unsigned int mask) | |||
| 489 | 489 | strncpy(win.bar.l, "Running key handler...", sizeof(win.bar.l)); | |
| 490 | 490 | win_draw(&win); | |
| 491 | 491 | win_set_cursor(&win, CURSOR_WATCH); | |
| 492 | − | stat(files[n].path, &oldst); | |
| 492 | + | stat(files[fileidx].path, &oldst); | |
| 493 | 493 | ||
| 494 | 494 | if ((pid = fork()) == 0) { | |
| 495 | − | execl(keyhandler.cmd, keyhandler.cmd, kstr, files[n].path, NULL); | |
| 495 | + | execl(keyhandler.cmd, keyhandler.cmd, kstr, files[fileidx].path, NULL); | |
| 496 | 496 | warn("could not exec key handler"); | |
| 497 | 497 | exit(EXIT_FAILURE); | |
| 498 | 498 | } else if (pid < 0) { | |
| @@ -504,7 +504,7 @@ void run_key_handler(const char *key, unsigned int mask) | |||
| 504 | 504 | if (WIFEXITED(status) == 0 || retval != 0) | |
| 505 | 505 | warn("key handler exited with non-zero return value: %d", retval); | |
| 506 | 506 | ||
| 507 | − | if (stat(files[n].path, &newst) == 0 && | |
| 507 | + | if (stat(files[fileidx].path, &newst) == 0 && | |
| 508 | 508 | memcmp(&oldst.st_mtime, &newst.st_mtime, sizeof(oldst.st_mtime)) == 0) | |
| 509 | 509 | { | |
| 510 | 510 | /* file has not changed */ | |
| @@ -518,13 +518,11 @@ void run_key_handler(const char *key, unsigned int mask) | |||
| 518 | 518 | img_close(&img, true); | |
| 519 | 519 | load_image(fileidx); | |
| 520 | 520 | } | |
| 521 | − | if (!tns_load(&tns, n, &files[n], true, mode == MODE_IMAGE) && | |
| 521 | + | if (!tns_load(&tns, fileidx, &files[fileidx], true, mode == MODE_IMAGE) && | |
| 522 | 522 | mode == MODE_THUMB) | |
| 523 | 523 | { | |
| 524 | − | remove_file(tns.sel, false); | |
| 524 | + | remove_file(fileidx, false); | |
| 525 | 525 | tns.dirty = true; | |
| 526 | − | if (tns.sel >= tns.cnt) | |
| 527 | − | tns.sel = tns.cnt - 1; | |
| 528 | 526 | } | |
| 529 | 527 | end: | |
| 530 | 528 | if (restore_bar) | |
| @@ -610,16 +608,16 @@ void on_buttonpress(XButtonEvent *bev) | |||
| 610 | 608 | switch (bev->button) { | |
| 611 | 609 | case Button1: | |
| 612 | 610 | if ((sel = tns_translate(&tns, bev->x, bev->y)) >= 0) { | |
| 613 | − | if (sel != tns.sel) { | |
| 614 | − | tns_highlight(&tns, tns.sel, false); | |
| 611 | + | if (sel != fileidx) { | |
| 612 | + | tns_highlight(&tns, fileidx, false); | |
| 615 | 613 | tns_highlight(&tns, sel, true); | |
| 616 | − | tns.sel = sel; | |
| 614 | + | fileidx = sel; | |
| 617 | 615 | firstclick = bev->time; | |
| 618 | 616 | redraw(); | |
| 619 | 617 | } else if (bev->time - firstclick <= TO_DOUBLE_CLICK) { | |
| 620 | 618 | mode = MODE_IMAGE; | |
| 621 | 619 | set_timeout(reset_cursor, TO_CURSOR_HIDE, true); | |
| 622 | − | load_image(tns.sel); | |
| 620 | + | load_image(fileidx); | |
| 623 | 621 | redraw(); | |
| 624 | 622 | } else { | |
| 625 | 623 | firstclick = bev->time; | |
| @@ -665,8 +663,6 @@ void run(void) | |||
| 665 | 663 | tns.cnt++; | |
| 666 | 664 | } else { | |
| 667 | 665 | remove_file(tns.loadnext, false); | |
| 668 | − | if (tns.sel > 0 && tns.sel >= tns.cnt) | |
| 669 | − | tns.sel--; | |
| 670 | 666 | } | |
| 671 | 667 | while (tns.loadnext < filecnt && tns.thumbs[tns.loadnext].loaded) | |
| 672 | 668 | tns.loadnext++; | |
| @@ -766,7 +762,7 @@ int main(int argc, char **argv) | |||
| 766 | 762 | parse_options(argc, argv); | |
| 767 | 763 | ||
| 768 | 764 | if (options->clean_cache) { | |
| 769 | − | tns_init(&tns, 0, NULL); | |
| 765 | + | tns_init(&tns, 0, NULL, NULL); | |
| 770 | 766 | tns_clean_cache(&tns); | |
| 771 | 767 | exit(EXIT_SUCCESS); | |
| 772 | 768 | } | |
| @@ -859,7 +855,7 @@ int main(int argc, char **argv) | |||
| 859 | 855 | ||
| 860 | 856 | if (options->thumb_mode) { | |
| 861 | 857 | mode = MODE_THUMB; | |
| 862 | − | tns_init(&tns, filecnt, &win); | |
| 858 | + | tns_init(&tns, filecnt, &win, &fileidx); | |
| 863 | 859 | while (!tns_load(&tns, 0, &files[0], false, false)) | |
| 864 | 860 | remove_file(0, false); | |
| 865 | 861 | tns.cnt = 1; | |
| @@ -150,7 +150,7 @@ void tns_clean_cache(tns_t *tns) | |||
| 150 | 150 | } | |
| 151 | 151 | ||
| 152 | 152 | ||
| 153 | − | void tns_init(tns_t *tns, int cnt, win_t *win) | |
| 153 | + | void tns_init(tns_t *tns, int cnt, win_t *win, int *sel) | |
| 154 | 154 | { | |
| 155 | 155 | int len; | |
| 156 | 156 | const char *homedir, *dsuffix = ""; | |
| @@ -165,7 +165,8 @@ void tns_init(tns_t *tns, int cnt, win_t *win) | |||
| 165 | 165 | tns->thumbs = NULL; | |
| 166 | 166 | } | |
| 167 | 167 | tns->cap = cnt; | |
| 168 | − | tns->cnt = tns->loadnext = tns->first = tns->sel = 0; | |
| 168 | + | tns->cnt = tns->loadnext = tns->first = 0; | |
| 169 | + | tns->sel = sel; | |
| 169 | 170 | tns->win = win; | |
| 170 | 171 | tns->dirty = false; | |
| 171 | 172 | ||
| @@ -338,21 +339,21 @@ void tns_check_view(tns_t *tns, bool scrolled) | |||
| 338 | 339 | return; | |
| 339 | 340 | ||
| 340 | 341 | tns->first -= tns->first % tns->cols; | |
| 341 | − | r = tns->sel % tns->cols; | |
| 342 | + | r = *tns->sel % tns->cols; | |
| 342 | 343 | ||
| 343 | 344 | if (scrolled) { | |
| 344 | 345 | /* move selection into visible area */ | |
| 345 | − | if (tns->sel >= tns->first + tns->cols * tns->rows) | |
| 346 | − | tns->sel = tns->first + r + tns->cols * (tns->rows - 1); | |
| 347 | − | else if (tns->sel < tns->first) | |
| 348 | − | tns->sel = tns->first + r; | |
| 346 | + | if (*tns->sel >= tns->first + tns->cols * tns->rows) | |
| 347 | + | *tns->sel = tns->first + r + tns->cols * (tns->rows - 1); | |
| 348 | + | else if (*tns->sel < tns->first) | |
| 349 | + | *tns->sel = tns->first + r; | |
| 349 | 350 | } else { | |
| 350 | 351 | /* scroll to selection */ | |
| 351 | − | if (tns->first + tns->cols * tns->rows <= tns->sel) { | |
| 352 | − | tns->first = tns->sel - r - tns->cols * (tns->rows - 1); | |
| 352 | + | if (tns->first + tns->cols * tns->rows <= *tns->sel) { | |
| 353 | + | tns->first = *tns->sel - r - tns->cols * (tns->rows - 1); | |
| 353 | 354 | tns->dirty = true; | |
| 354 | − | } else if (tns->first > tns->sel) { | |
| 355 | − | tns->first = tns->sel - r; | |
| 355 | + | } else if (tns->first > *tns->sel) { | |
| 356 | + | tns->first = *tns->sel - r; | |
| 356 | 357 | tns->dirty = true; | |
| 357 | 358 | } | |
| 358 | 359 | } | |
| @@ -409,7 +410,7 @@ void tns_render(tns_t *tns) | |||
| 409 | 410 | } | |
| 410 | 411 | } | |
| 411 | 412 | tns->dirty = false; | |
| 412 | − | tns_highlight(tns, tns->sel, true); | |
| 413 | + | tns_highlight(tns, *tns->sel, true); | |
| 413 | 414 | } | |
| 414 | 415 | ||
| 415 | 416 | void tns_mark(tns_t *tns, int n, bool mark) | |
| @@ -423,7 +424,7 @@ void tns_mark(tns_t *tns, int n, bool mark) | |||
| 423 | 424 | win_t *win = tns->win; | |
| 424 | 425 | int x = t->x, y = t->y, w = t->w, h = t->h; | |
| 425 | 426 | ||
| 426 | − | if (mark || n == tns->sel) | |
| 427 | + | if (mark || n == *tns->sel) | |
| 427 | 428 | col = win->selcol; | |
| 428 | 429 | else if (win->fullscreen) | |
| 429 | 430 | col = win->fscol; | |
| @@ -473,33 +474,33 @@ bool tns_move_selection(tns_t *tns, direction_t dir, int cnt) | |||
| 473 | 474 | if (tns == NULL || tns->thumbs == NULL) | |
| 474 | 475 | return false; | |
| 475 | 476 | ||
| 476 | − | old = tns->sel; | |
| 477 | + | old = *tns->sel; | |
| 477 | 478 | cnt = cnt > 1 ? cnt : 1; | |
| 478 | 479 | ||
| 479 | 480 | switch (dir) { | |
| 480 | 481 | case DIR_UP: | |
| 481 | − | tns->sel = MAX(tns->sel - cnt * tns->cols, tns->sel % tns->cols); | |
| 482 | + | *tns->sel = MAX(*tns->sel - cnt * tns->cols, *tns->sel % tns->cols); | |
| 482 | 483 | break; | |
| 483 | 484 | case DIR_DOWN: | |
| 484 | 485 | max = tns->cols * ((tns->cnt - 1) / tns->cols) + | |
| 485 | − | MIN((tns->cnt - 1) % tns->cols, tns->sel % tns->cols); | |
| 486 | − | tns->sel = MIN(tns->sel + cnt * tns->cols, max); | |
| 486 | + | MIN((tns->cnt - 1) % tns->cols, *tns->sel % tns->cols); | |
| 487 | + | *tns->sel = MIN(*tns->sel + cnt * tns->cols, max); | |
| 487 | 488 | break; | |
| 488 | 489 | case DIR_LEFT: | |
| 489 | − | tns->sel = MAX(tns->sel - cnt, 0); | |
| 490 | + | *tns->sel = MAX(*tns->sel - cnt, 0); | |
| 490 | 491 | break; | |
| 491 | 492 | case DIR_RIGHT: | |
| 492 | − | tns->sel = MIN(tns->sel + cnt, tns->cnt - 1); | |
| 493 | + | *tns->sel = MIN(*tns->sel + cnt, tns->cnt - 1); | |
| 493 | 494 | break; | |
| 494 | 495 | } | |
| 495 | 496 | ||
| 496 | − | if (tns->sel != old) { | |
| 497 | + | if (*tns->sel != old) { | |
| 497 | 498 | tns_highlight(tns, old, false); | |
| 498 | 499 | tns_check_view(tns, false); | |
| 499 | 500 | if (!tns->dirty) | |
| 500 | − | tns_highlight(tns, tns->sel, true); | |
| 501 | + | tns_highlight(tns, *tns->sel, true); | |
| 501 | 502 | } | |
| 502 | − | return tns->sel != old; | |
| 503 | + | return *tns->sel != old; | |
| 503 | 504 | } | |
| 504 | 505 | ||
| 505 | 506 | bool tns_scroll(tns_t *tns, direction_t dir, bool screen) | |
| @@ -41,7 +41,7 @@ typedef struct { | |||
| 41 | 41 | int cnt; | |
| 42 | 42 | int loadnext; | |
| 43 | 43 | int first; | |
| 44 | − | int sel; | |
| 44 | + | int *sel; | |
| 45 | 45 | ||
| 46 | 46 | win_t *win; | |
| 47 | 47 | int x; | |
| @@ -54,7 +54,7 @@ typedef struct { | |||
| 54 | 54 | ||
| 55 | 55 | void tns_clean_cache(tns_t*); | |
| 56 | 56 | ||
| 57 | − | void tns_init(tns_t*, int, win_t*); | |
| 57 | + | void tns_init(tns_t*, int, win_t*, int*); | |
| 58 | 58 | void tns_free(tns_t*); | |
| 59 | 59 | ||
| 60 | 60 | bool tns_load(tns_t*, int, const fileinfo_t*, bool, bool); | |