floats: implement floating windows

Co-Author: Dongdong Zhou <dzhou121@gmail.com>
This commit is contained in:
Björn Linse
2017-04-26 15:28:10 +02:00
parent 018e0d5a19
commit 9a1675b065
30 changed files with 4068 additions and 219 deletions

View File

@@ -958,6 +958,35 @@ struct matchitem {
int conceal_char; ///< cchar for Conceal highlighting
};
typedef enum {
kFloatAnchorEast = 1,
kFloatAnchorSouth = 2,
kFloatAnchorNW = 0,
kFloatAnchorNE = 1,
kFloatAnchorSW = 2,
kFloatAnchorSE = 3,
} FloatAnchor;
typedef enum {
kFloatRelativeEditor = 0,
kFloatRelativeWindow = 1,
kFloatRelativeCursor = 2,
} FloatRelative;
typedef struct {
Window window;
double row, col;
FloatAnchor anchor;
FloatRelative relative;
bool external;
bool focusable;
} FloatConfig;
#define FLOAT_CONFIG_INIT ((FloatConfig){ .row = 0, .col = 0, .anchor = 0, \
.relative = 0, .external = false, \
.focusable = true })
/*
* Structure which contains all information that belongs to a window
*
@@ -1221,6 +1250,8 @@ struct window_S {
ScreenGrid w_grid; // the grid specific to the window
bool w_pos_changed; // true if window position changed
bool w_floating; ///< whether the window is floating
FloatConfig w_float_config;
/*
* w_fraction is the fractional row of the cursor within the window, from