th/window.c

73 lines
1.4 KiB
C

#include <curses.h>
#include <dirent.h>
#include "backend.h"
extern unsigned int terminal_height;
extern unsigned int terminal_width;
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;
//{{{ 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){
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, 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);
}