80 lines
1.7 KiB
C
80 lines
1.7 KiB
C
#include <curses.h>
|
|
#include <dirent.h>
|
|
#include "backend.h"
|
|
|
|
extern unsigned int terminal_height;
|
|
extern unsigned int terminal_width;
|
|
extern unsigned long longest_name;
|
|
extern unsigned long file_count;
|
|
|
|
|
|
|
|
|
|
|
|
void window_main(WINDOW *win, unsigned int start_y, unsigned int start_x, char **dir_content){
|
|
|
|
//WINDOW *win = (window_data)window_data.win;
|
|
unsigned int local_width;
|
|
unsigned int local_height;
|
|
unsigned long file_count = 0;
|
|
unsigned long longest_name = 0;
|
|
|
|
//{{{ size & positioning
|
|
wresize(win, terminal_height, terminal_width/3);
|
|
getmaxyx(win, local_height, local_width);
|
|
mvwin(win, start_y, start_x);
|
|
wclear(win);
|
|
//}}}
|
|
|
|
wmove(win, 1, 1);
|
|
|
|
print_dir(win, dir_content);
|
|
|
|
|
|
|
|
box(win,0,0);
|
|
wrefresh(win);
|
|
}
|
|
void window_left(WINDOW *win, unsigned int start_y, unsigned int start_x, char **dir_content){
|
|
|
|
DIR *dir = opendir(".");
|
|
unsigned int local_width;
|
|
unsigned int local_height;
|
|
unsigned long file_count = 0;
|
|
unsigned long longest_name = 0;
|
|
|
|
//{{{ size & positioning
|
|
wresize(win, terminal_height, terminal_width/3);
|
|
getmaxyx(win, local_height, local_width);
|
|
mvwin(win, start_y, start_x);
|
|
wclear(win);
|
|
//}}}
|
|
|
|
wmove(win, 1, 1);
|
|
|
|
print_dir(win, dir_content);
|
|
|
|
|
|
box(win,0,0);
|
|
wrefresh(win);
|
|
}
|
|
void window_right(WINDOW *win, unsigned int start_y, unsigned int start_x, char **dir_content){
|
|
|
|
wmove(win, 0, 0);
|
|
unsigned int local_width;
|
|
unsigned int local_height;
|
|
|
|
//{{{ size & positioning
|
|
wresize(win, terminal_height, terminal_width/3);
|
|
getmaxyx(win, local_height, local_width);
|
|
mvwin(win, start_y, start_x);
|
|
wclear(win);
|
|
//}}}
|
|
|
|
wmove(win, local_height/2, local_width/2);
|
|
wprintw(win, "%d,%d", local_height, local_width);
|
|
|
|
box(win,0,0);
|
|
wrefresh(win);
|
|
}
|