}
else if (1 == wcp->height_type)
{
- wcp->height = wcp->win->framesize.y - world.wmeta.padsize.y + 1;
+ wcp->height = wcp->win->framesize.y - world.wins.padsize.y + 1;
}
if (0 == wcp->width_type)
{
}
else if (1 == wcp->width_type)
{
- wcp->width = wcp->win->framesize.x - world.wmeta.padsize.x;
+ wcp->width = wcp->win->framesize.x - world.wins.padsize.x;
}
}
uint8_t i = 0;
while (1)
{
- if (id == world.winconf_db.winconfs[i].id)
+ if (id == world.wins.winconfs[i].id)
{
- return &world.winconf_db.winconfs[i];
+ return &world.wins.winconfs[i];
}
i++;
}
uint8_t i = 0;
while (1)
{
- if (win == world.winconf_db.winconfs[i].win)
+ if (win == world.wins.winconfs[i].win)
{
- return &world.winconf_db.winconfs[i];
+ return &world.wins.winconfs[i];
}
i++;
}
-extern uint8_t read_winconf_from_file(char * line, uint32_t linemax, FILE * file)
+extern uint8_t read_winconf_from_file(char * line, uint32_t linemax,
+ FILE * file)
{
char * f_name = "read_winconf_from_file()";
int test = try_fgetc(file, f_name);
winconf.view = 0;
winconf.center.y = 0;
winconf.center.x = 0;
- if (world.winconf_db.ids)
+ if (world.wins.ids)
{
- uint8_t old_ids_size = strlen(world.winconf_db.ids);
+ uint8_t old_ids_size = strlen(world.wins.ids);
char * new_ids = try_malloc(old_ids_size + 1 + 1, f_name);
- sprintf(new_ids, "%s%c", world.winconf_db.ids, winconf.id);
- free(world.winconf_db.ids);
- world.winconf_db.ids = new_ids;
+ sprintf(new_ids, "%s%c", world.wins.ids, winconf.id);
+ free(world.wins.ids);
+ world.wins.ids = new_ids;
uint16_t old_winconfs_size = old_ids_size * sizeof(struct WinConf);
uint16_t new_winconfs_size = old_winconfs_size + sizeof(struct WinConf);
struct WinConf * new_winconfs = try_malloc(new_winconfs_size, f_name);
- memcpy(new_winconfs, world.winconf_db.winconfs, old_winconfs_size);
+ memcpy(new_winconfs, world.wins.winconfs, old_winconfs_size);
new_winconfs[old_ids_size] = winconf;
- free(world.winconf_db.winconfs);
- world.winconf_db.winconfs = new_winconfs;
+ free(world.wins.winconfs);
+ world.wins.winconfs = new_winconfs;
}
else
{
- world.winconf_db.ids = try_malloc(2, f_name);
- sprintf(world.winconf_db.ids, "%c", winconf.id);
- world.winconf_db.winconfs = try_malloc(sizeof(struct WinConf), f_name);
- *world.winconf_db.winconfs = winconf;
+ world.wins.ids = try_malloc(2, f_name);
+ sprintf(world.wins.ids, "%c", winconf.id);
+ world.wins.winconfs = try_malloc(sizeof(struct WinConf), f_name);
+ *world.wins.winconfs = winconf;
}
return 1;
}
-extern void read_order_wins_visible_active(char * line, uint32_t linemax, FILE * file)
+extern void read_order_wins_visible_active(char * line, uint32_t linemax,
+ FILE * file)
{
char * f_name = "read_order_wins_visible_active()";
char win_order[linemax + 1];
try_fgets(win_order, linemax + 1, file, f_name);
- world.winconf_db.order = try_malloc(linemax, f_name);
+ world.wins.order = try_malloc(linemax, f_name);
win_order[strlen(win_order) - 1] = '\0';
- sprintf(world.winconf_db.order, "%s", win_order);
+ sprintf(world.wins.order, "%s", win_order);
int char_or_eof = try_fgetc(file, f_name);
char * err_eof = "fgetc() unexpectedly hitting EOF";
exit_trouble(EOF == char_or_eof, f_name, err_eof);
- world.winconf_db.active = (uint8_t) char_or_eof;
+ world.wins.id_active = (uint8_t) char_or_eof;
exit_trouble(EOF == try_fgetc(file, f_name), f_name, err_eof);
try_fgets(line, linemax + 1, file, f_name);
}
extern void write_order_wins_visible_active(FILE * file, char * delim)
{
char * f_name = "write_order_wins_visible_active()";
- char line[strlen(world.winconf_db.ids) + 2];
- struct Win * w_p = world.wmeta.chain_start;
+ char line[strlen(world.wins.ids) + 2];
+ struct Win * w_p = world.wins.chain_start;
char active = ' ';
uint8_t i;
for (; NULL != w_p; w_p = w_p->next, i++)
{
struct WinConf * wc_p = get_winconf_by_win(w_p);
line[i] = wc_p->id;
- if (w_p == world.wmeta.active)
+ if (w_p == world.wins.win_active)
{
active = wc_p->id;
}
{
free_winconf_data(id);
}
- free(world.winconf_db.ids);
- world.winconf_db.ids = NULL;
- free(world.winconf_db.winconfs);
- world.winconf_db.winconfs = NULL;
- free(world.winconf_db.order);
- world.winconf_db.order = NULL;
+ free(world.wins.ids);
+ world.wins.ids = NULL;
+ free(world.wins.winconfs);
+ world.wins.winconfs = NULL;
+ free(world.wins.order);
+ world.wins.order = NULL;
}
extern void sorted_win_toggle_and_activate()
{
uint8_t i = 0;
- for (; i < strlen(world.winconf_db.order); i++)
+ for (; i < strlen(world.wins.order); i++)
{
- if (NULL == strchr(world.winconf_db.ids, world.winconf_db.order[i]))
+ if (NULL == strchr(world.wins.ids, world.wins.order[i]))
{
continue;
}
- toggle_window(world.winconf_db.order[i]);
- if (world.winconf_db.active == (uint8_t) world.winconf_db.order[i])
+ toggle_window(world.wins.order[i]);
+ if (world.wins.id_active == (uint8_t) world.wins.order[i])
{
- world.wmeta.active = get_win_by_id(world.winconf_db.order[i]);
+ world.wins.win_active = get_win_by_id(world.wins.order[i]);
}
}
}
extern char get_next_winconf_id()
{
static uint8_t i = 0;
- char c = world.winconf_db.ids[i];
+ char c = world.wins.ids[i];
if (0 == c)
{
i = 0;
extern void toggle_window(char id)
{
struct Win * win = get_win_by_id(id);
- if (0 == win->prev && world.wmeta.chain_start != win) /* Win struct is */
+ if (0 == win->prev && world.wins.chain_start != win) /* Win struct is */
{ /* outside chain? */
append_win(win);
}
extern void toggle_winconfig()
{
- struct Win * win = world.wmeta.active;
+ struct Win * win = world.wins.win_active;
struct WinConf * wcp = get_winconf_by_win(win);
if (0 == wcp->view)
{
extern void toggle_win_size_type(char axis)
{
- struct Win * win = world.wmeta.active;
+ struct Win * win = world.wins.win_active;
struct WinConf * wcp = get_winconf_by_win(win);
if ('y' == axis)
{
return;
}
wcp->width_type = ( 0 == wcp->width_type
- && win->framesize.x <= world.wmeta.padsize.x);
+ && win->framesize.x <= world.wins.padsize.x);
set_winconf_geometry(wcp->id);
}
{
if ('+' == dir)
{
- reset_pad_offset(world.wmeta.pad_offset + 1);
+ reset_pad_offset(world.wins.pad_offset + 1);
}
else if ('-' == dir)
{
- reset_pad_offset(world.wmeta.pad_offset - 1);
+ reset_pad_offset(world.wins.pad_offset - 1);
}
}
extern void growshrink_active_window(char change)
{
- if (0 != world.wmeta.active)
+ if (0 != world.wins.win_active)
{
- struct yx_uint16 size = world.wmeta.active->framesize;
+ struct yx_uint16 size = world.wins.win_active->framesize;
if (change == '-')
{
size.y--;
size.x++;
}
resize_active_win(size);
- struct WinConf * wcp = get_winconf_by_win(world.wmeta.active);
+ struct WinConf * wcp = get_winconf_by_win(world.wins.win_active);
if ( 1 == wcp->width_type
- && world.wmeta.active->framesize.x > world.wmeta.padsize.x)
+ && world.wins.win_active->framesize.x > world.wins.padsize.x)
{
wcp->width_type = 0;
}
#include <stdlib.h> /* free() */
#include <string.h> /* strlen(), memcpy(), strnlen() */
#include <ncurses.h> /* chtype, pnoutrefresh(), doupdate(), werase(), erase(),
- * wnoutrefresh(), getmaxx(), getmaxy(), initscr(),
- * noecho(), curs_set(), newpad(), mvwaddch(), mvwaddstr(),
- * wresize()
+ * wnoutrefresh(), getmaxx(), getmaxy(), mvwaddstr(),
+ * mvwaddch(), mvwaddstr(), wresize()
*/
#include "../common/rexit.h" /* for exit_err() */
#include "../common/try_malloc.h" /* for try_malloc() */
#include "../common/yx_uint16.h" /* for struct yx_uint16 */
-#include "cleanup.h" /* for set_cleanup_flag() */
#include "misc.h" /* for center_offset() */
#include "world.h" /* for world global */
{
/* Determine rightmost window column. */
uint32_t lastwcol = 0;
- struct Win * wp = world.wmeta.chain_start;
+ struct Win * wp = world.wins.chain_start;
while (wp != 0)
{
if ((uint32_t) wp->start.x + (uint32_t) wp->framesize.x > lastwcol + 1)
/* Only resize the pad if the rightmost window column has changed. */
char * err_s = "refit_pad() extends virtual screen beyond legal sizes.";
char * err_m = "refit_pad() triggers memory alloc error via wresize().";
- if (getmaxx(world.wmeta.pad) + 1 != lastwcol)
+ if (getmaxx(world.wins.pad) + 1 != lastwcol)
{
uint8_t t = (lastwcol + 2 > UINT16_MAX);
exit_err(t, err_s);
- t = wresize(world.wmeta.pad, getmaxy(world.wmeta.pad), lastwcol + 2);
+ t = wresize(world.wins.pad, getmaxy(world.wins.pad), lastwcol + 2);
exit_err(t, err_m);
}
}
/* Fit w's top left to bottom left of its ->prev if enough space. */
uint16_t w_prev_maxy = w->prev->start.y + w->prev->framesize.y;
if ( w->framesize.x <= w->prev->framesize.x
- && w->framesize.y < world.wmeta.padsize.y - w_prev_maxy)
+ && w->framesize.y < world.wins.padsize.y - w_prev_maxy)
{
w->start.x = w->prev->start.x;
w->start.y = w_prev_maxy + 1;
uint16_t w_thr_bottom = w_thr->start.y + w_thr->framesize.y;
uint16_t free_width = (w_thr->start.x + w_thr->framesize.x)
- (w_test->start.x + w_test->framesize.x);
- if ( w->framesize.y < world.wmeta.padsize.y - w_thr_bottom
+ if ( w->framesize.y < world.wins.padsize.y - w_thr_bottom
&& w->framesize.x < free_width)
{
w->start.x = w_test->start.x + w_test->framesize.x + 1;
}
if ('<' == dir || '>' == dir)
{
- mvwaddch(world.wmeta.pad, start.y + q, start.x + draw_offset, c);
+ mvwaddch(world.wins.pad, start.y + q, start.x + draw_offset, c);
continue;
}
- mvwaddch(world.wmeta.pad, start.y + draw_offset, start.x + q, c);
+ mvwaddch(world.wins.pad, start.y + draw_offset, start.x + q, c);
}
}
{
struct yx_uint16 start;
start.y = 0;
- start.x = world.wmeta.pad_offset;
- scroll_hint(world.wmeta.padsize, dir, dist, "columns", start);
+ start.x = world.wins.pad_offset;
+ scroll_hint(world.wins.padsize, dir, dist, "columns", start);
}
for (x = offset_x; x < w->framesize.x + offset_x && x < size_x; x++)
{
chtype ch = w->winmap[(y * w->winmapsize.x) + x];
- mvwaddch(world.wmeta.pad, w->start.y + (y - offset_y),
- w->start.x + (x - offset_x), ch);
+ mvwaddch(world.wins.pad, w->start.y + (y - offset_y),
+ w->start.x + (x - offset_x), ch);
}
}
free(w->winmap);
uint16_t y, x;
for (y = w->start.y; y <= w->start.y + w->framesize.y; y++)
{
- mvwaddch(world.wmeta.pad, y, w->start.x - 1, '|');
- mvwaddch(world.wmeta.pad, y, w->start.x + w->framesize.x, '|');
+ mvwaddch(world.wins.pad, y, w->start.x - 1, '|');
+ mvwaddch(world.wins.pad, y, w->start.x + w->framesize.x, '|');
}
for (x = w->start.x; x <= w->start.x + w->framesize.x; x++)
{
- mvwaddch(world.wmeta.pad, w->start.y - 1, x, '-');
- mvwaddch(world.wmeta.pad, w->start.y + w->framesize.y, x, '-');
+ mvwaddch(world.wins.pad, w->start.y - 1, x, '-');
+ mvwaddch(world.wins.pad, w->start.y + w->framesize.y, x, '-');
}
/* Draw as much as possible of the title into center of top border line. */
uint16_t length_visible = strnlen(w->title, w->framesize.x - 2);
char title[length_visible + 3];
char decoration = ' ';
- if (w == world.wmeta.active)
+ if (w == world.wins.win_active)
{
decoration = '$';
}
memcpy(title + 1, w->title, length_visible);
title[0] = title[length_visible + 1] = decoration;
title[length_visible + 2] = '\0';
- mvwaddstr(world.wmeta.pad,
+ mvwaddstr(world.wins.pad,
w->start.y - 1, w->start.x + title_offset, title);
}
}
static void draw_wins_bordercorners(struct Win * w)
{
- mvwaddch(world.wmeta.pad, w->start.y - 1, w->start.x - 1, '+');
- mvwaddch(world.wmeta.pad, w->start.y - 1, w->start.x + w->framesize.x,'+');
- mvwaddch(world.wmeta.pad, w->start.y + w->framesize.y, w->start.x - 1,'+');
- mvwaddch(world.wmeta.pad, w->start.y + w->framesize.y,
+ mvwaddch(world.wins.pad, w->start.y - 1, w->start.x - 1, '+');
+ mvwaddch(world.wins.pad, w->start.y - 1, w->start.x + w->framesize.x, '+');
+ mvwaddch(world.wins.pad, w->start.y + w->framesize.y, w->start.x - 1, '+');
+ mvwaddch(world.wins.pad, w->start.y + w->framesize.y,
w->start.x + w->framesize.x, '+');
if (0 != w->next)
{
static void shift_win_forward()
{
- if (world.wmeta.active == world.wmeta.chain_end)
+ if (world.wins.win_active == world.wins.chain_end)
{
- world.wmeta.chain_end = world.wmeta.active->prev;
- world.wmeta.chain_end->next = 0;
- world.wmeta.active->next = world.wmeta.chain_start;
- world.wmeta.active->next->prev = world.wmeta.active;
- world.wmeta.chain_start = world.wmeta.active;
- world.wmeta.chain_start->prev = 0;
+ world.wins.chain_end = world.wins.win_active->prev;
+ world.wins.chain_end->next = 0;
+ world.wins.win_active->next = world.wins.chain_start;
+ world.wins.win_active->next->prev = world.wins.win_active;
+ world.wins.chain_start = world.wins.win_active;
+ world.wins.chain_start->prev = 0;
}
else
{
- struct Win * old_prev = world.wmeta.active->prev;
- struct Win * old_next = world.wmeta.active->next;
- if (world.wmeta.chain_end == world.wmeta.active->next)
+ struct Win * old_prev = world.wins.win_active->prev;
+ struct Win * old_next = world.wins.win_active->next;
+ if (world.wins.chain_end == world.wins.win_active->next)
{
- world.wmeta.chain_end = world.wmeta.active;
- world.wmeta.active->next = 0;
+ world.wins.chain_end = world.wins.win_active;
+ world.wins.win_active->next = 0;
}
else
{
- world.wmeta.active->next = old_next->next;
- world.wmeta.active->next->prev = world.wmeta.active;
+ world.wins.win_active->next = old_next->next;
+ world.wins.win_active->next->prev = world.wins.win_active;
}
- if (world.wmeta.chain_start == world.wmeta.active)
+ if (world.wins.chain_start == world.wins.win_active)
{
- world.wmeta.chain_start = old_next;
+ world.wins.chain_start = old_next;
}
else
{
old_prev->next = old_next;
}
old_next->prev = old_prev;
- old_next->next = world.wmeta.active;
- world.wmeta.active->prev = old_next;
+ old_next->next = world.wins.win_active;
+ world.wins.win_active->prev = old_next;
}
}
static void shift_win_backward()
{
- if (world.wmeta.active == world.wmeta.chain_start)
+ if (world.wins.win_active == world.wins.chain_start)
{
- world.wmeta.chain_start = world.wmeta.active->next;
- world.wmeta.chain_start->prev = 0;
- world.wmeta.active->prev = world.wmeta.chain_end;
- world.wmeta.active->prev->next = world.wmeta.active;
- world.wmeta.chain_end = world.wmeta.active;
- world.wmeta.chain_end->next = 0;
+ world.wins.chain_start = world.wins.win_active->next;
+ world.wins.chain_start->prev = 0;
+ world.wins.win_active->prev = world.wins.chain_end;
+ world.wins.win_active->prev->next = world.wins.win_active;
+ world.wins.chain_end = world.wins.win_active;
+ world.wins.chain_end->next = 0;
}
else
{
- struct Win * old_prev = world.wmeta.active->prev;
- struct Win * old_next = world.wmeta.active->next;
- if (world.wmeta.chain_start == world.wmeta.active->prev)
+ struct Win * old_prev = world.wins.win_active->prev;
+ struct Win * old_next = world.wins.win_active->next;
+ if (world.wins.chain_start == world.wins.win_active->prev)
{
- world.wmeta.chain_start = world.wmeta.active;
- world.wmeta.active->prev = 0;
+ world.wins.chain_start = world.wins.win_active;
+ world.wins.win_active->prev = 0;
}
else
{
- world.wmeta.active->prev = old_prev->prev;
- world.wmeta.active->prev->next = world.wmeta.active;
+ world.wins.win_active->prev = old_prev->prev;
+ world.wins.win_active->prev->next = world.wins.win_active;
}
- if (world.wmeta.chain_end == world.wmeta.active)
+ if (world.wins.chain_end == world.wins.win_active)
{
- world.wmeta.chain_end = old_prev;
+ world.wins.chain_end = old_prev;
}
else
{
old_next->prev = old_prev;
}
old_prev->next = old_next;
- old_prev->prev = world.wmeta.active;
- world.wmeta.active->next = old_prev;
+ old_prev->prev = world.wins.win_active;
+ world.wins.win_active->next = old_prev;
}
}
-extern void init_wmeta_and_ncurses()
-{
- world.wmeta.screen = initscr();
- set_cleanup_flag(CLEANUP_NCURSES);
- noecho();
- curs_set(0);
- world.wmeta.padsize.y = 0;
- world.wmeta.padsize.x = 0;
- world.wmeta.chain_start = 0;
- world.wmeta.chain_end = 0;
- world.wmeta.pad_offset = 0;
- world.wmeta.pad = NULL;
- world.wmeta.active = 0;
-}
-
-
-
extern void make_pad()
{
char * err_s = "make_pad() creates an illegaly large virtual screen.";
char * err_m = "make_pad() triggers memory allocation error via newpad().";
- uint32_t maxy_test = getmaxy(world.wmeta.screen);
- uint32_t maxx_test = getmaxx(world.wmeta.screen);
+ uint32_t maxy_test = getmaxy(world.wins.screen);
+ uint32_t maxx_test = getmaxx(world.wins.screen);
exit_err(maxy_test > UINT16_MAX || maxx_test > UINT16_MAX, err_s);
- world.wmeta.padsize.y = maxy_test;
- world.wmeta.padsize.x = maxx_test;
- world.wmeta.pad = newpad(world.wmeta.padsize.y, 1);
- exit_err(NULL == world.wmeta.pad, err_m);
+ world.wins.padsize.y = maxy_test;
+ world.wins.padsize.x = maxx_test;
+ world.wins.pad = newpad(world.wins.padsize.y, 1);
+ exit_err(NULL == world.wins.pad, err_m);
}
w->draw = func;
w->center.y = 0;
w->center.x = 0;
- w->framesize.y = world.wmeta.padsize.y - 1;
- if (0 < height && height <= world.wmeta.padsize.y - 1)
+ w->framesize.y = world.wins.padsize.y - 1;
+ if (0 < height && height <= world.wins.padsize.y - 1)
{
w->framesize.y = height;
}
- else if (0 > height && world.wmeta.padsize.y + (height - 1) > 0)
+ else if (0 > height && world.wins.padsize.y + (height - 1) > 0)
{
- w->framesize.y = world.wmeta.padsize.y + (height - 1);
+ w->framesize.y = world.wins.padsize.y + (height - 1);
}
- w->framesize.x = world.wmeta.padsize.x;
+ w->framesize.x = world.wins.padsize.x;
if (0 < width)
{
w->framesize.x = width;
}
- else if (0 > width && world.wmeta.padsize.x + width > 0)
+ else if (0 > width && world.wins.padsize.x + width > 0)
{
- w->framesize.x = world.wmeta.padsize.x + width;
+ w->framesize.x = world.wins.padsize.x + width;
}
*wp = w;
}
extern void append_win(struct Win * w)
{
- if (0 != world.wmeta.chain_start)
+ if (0 != world.wins.chain_start)
{
- w->prev = world.wmeta.chain_end;
- world.wmeta.chain_end->next = w;
+ w->prev = world.wins.chain_end;
+ world.wins.chain_end->next = w;
}
else
{
- world.wmeta.active = w;
- world.wmeta.chain_start = w;
+ world.wins.win_active = w;
+ world.wins.chain_start = w;
}
- world.wmeta.chain_end = w;
+ world.wins.chain_end = w;
update_wins(w);
}
extern void suspend_win(struct Win * w)
{
- if (world.wmeta.chain_start != w)
+ if (world.wins.chain_start != w)
{
w->prev->next = w->next;
}
else
{
- world.wmeta.chain_start = w->next;
+ world.wins.chain_start = w->next;
}
uint8_t pad_refitted = 0;
- if (world.wmeta.chain_end != w)
+ if (world.wins.chain_end != w)
{
w->next->prev = w->prev;
- if (world.wmeta.active == w)
+ if (world.wins.win_active == w)
{
- world.wmeta.active = w->next;
+ world.wins.win_active = w->next;
}
update_wins(w->next); /* Positioning of successor windows may be */
pad_refitted = 1; /* affected / need correction. Note that */
} /* update_wins() already refits the pad, */
else /* voiding later need for that. */
{
- world.wmeta.chain_end = w->prev;
- if (world.wmeta.active == w)
+ world.wins.chain_end = w->prev;
+ if (world.wins.win_active == w)
{
- world.wmeta.active = w->prev;
+ world.wins.win_active = w->prev;
}
}
w->prev = 0;
extern void reset_pad_offset(uint16_t new_offset)
{
if (new_offset >= 0
- && (new_offset < world.wmeta.pad_offset
- || new_offset + world.wmeta.padsize.x < getmaxx(world.wmeta.pad)))
+ && (new_offset < world.wins.pad_offset
+ || new_offset + world.wins.padsize.x < getmaxx(world.wins.pad)))
{
- world.wmeta.pad_offset = new_offset;
+ world.wins.pad_offset = new_offset;
}
}
extern void resize_active_win(struct yx_uint16 size)
{
- if (0 != world.wmeta.active
- && size.x > 0 && size.y > 0 && size.y < world.wmeta.padsize.y)
+ if (0 != world.wins.win_active
+ && size.x > 0 && size.y > 0 && size.y < world.wins.padsize.y)
{
- world.wmeta.active->framesize = size;
- update_wins(world.wmeta.active); /* Positioning of following */
+ world.wins.win_active->framesize = size;
+ update_wins(world.wins.win_active); /* Positioning of following */
} /* windows may be affected. */
}
extern void cycle_active_win(char dir)
{
- if (0 != world.wmeta.active)
+ if (0 != world.wins.win_active)
{
if ('f' == dir)
{
- if (world.wmeta.active->next != 0)
+ if (world.wins.win_active->next != 0)
{
- world.wmeta.active = world.wmeta.active->next;
+ world.wins.win_active = world.wins.win_active->next;
}
else
{
- world.wmeta.active = world.wmeta.chain_start;
+ world.wins.win_active = world.wins.chain_start;
}
}
else
{
- if (world.wmeta.active->prev != 0)
+ if (world.wins.win_active->prev != 0)
{
- world.wmeta.active = world.wmeta.active->prev;
+ world.wins.win_active = world.wins.win_active->prev;
}
else
{
- world.wmeta.active = world.wmeta.chain_end;
+ world.wins.win_active = world.wins.chain_end;
}
}
}
extern void shift_active_win(char dir)
{
- if ( 0 == world.wmeta.active /* No shifting with < 2 windows visible. */
- || world.wmeta.chain_start == world.wmeta.chain_end)
+ if ( 0 == world.wins.win_active /* No shifting with <2 windows visible. */
+ || world.wins.chain_start == world.wins.chain_end)
{
return;
}
if ('f' == dir)
{
shift_win_forward();
- update_wins(world.wmeta.chain_start);
+ update_wins(world.wins.chain_start);
return;
}
shift_win_backward();
- update_wins(world.wmeta.chain_start);
+ update_wins(world.wins.chain_start);
}
{
/* Empty everything before filling it a-new. */
erase();
- wnoutrefresh(world.wmeta.screen);
- werase(world.wmeta.pad);
- if (world.wmeta.chain_start)
+ wnoutrefresh(world.wins.screen);
+ werase(world.wins.pad);
+ if (world.wins.chain_start)
{
/* Draw windows' borders first, then windows. */
- draw_wins_borderlines(world.wmeta.chain_start);
- draw_wins_bordercorners(world.wmeta.chain_start);
- draw_wins(world.wmeta.chain_start);
+ draw_wins_borderlines(world.wins.chain_start);
+ draw_wins_bordercorners(world.wins.chain_start);
+ draw_wins(world.wins.chain_start);
/* Draw virtual screen scroll hints. */
- if (world.wmeta.pad_offset > 0)
+ if (world.wins.pad_offset > 0)
{
- padscroll_hint('<', world.wmeta.pad_offset + 1);
+ padscroll_hint('<', world.wins.pad_offset + 1);
}
- uint16_t size_x = getmaxx(world.wmeta.pad);
- uint16_t right_edge = world.wmeta.pad_offset + world.wmeta.padsize.x;
+ uint16_t size_x = getmaxx(world.wins.pad);
+ uint16_t right_edge = world.wins.pad_offset + world.wins.padsize.x;
if (right_edge < size_x - 1)
{
padscroll_hint('>', size_x - right_edge);
}
/* Write pad segment to be shown on physical screen to screen buffer. */
- pnoutrefresh(world.wmeta.pad, 0, world.wmeta.pad_offset, 0, 0,
- world.wmeta.padsize.y, world.wmeta.padsize.x - 1);
+ pnoutrefresh(world.wins.pad, 0, world.wins.pad_offset, 0, 0,
+ world.wins.padsize.y, world.wins.padsize.x - 1);
}
/* Only at the end write accumulated changes to the physical screen. */