# io.github.libtmux.WindowLayout.WindowLayout

- **Module:** io.github.libtmux.WindowLayout
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** interface
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/WindowLayout.java#L23
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-windowlayout-windowlayout/

A window's layout as tmux reported it, in whichever of its two forms it used.

tmux writes a layout in its classic checksummed form — {@code c3a4,80x24,0,0,1} — on every
release before 3.8, and as JSON from 3.8, which also names the pane in each cell. The same window
therefore reports a differently shaped string depending on the server, and a caller that parses it
needs to know which it has. This says, so the compiler can carry what used to be a comment:

Either form is an opaque token to hand back to tmux, which {@link Window#applyLayout(WindowLayout)}
does; parsing one is tmux's job, and {@link #value()} is the text for a caller who wants to anyway.

## Example

```java
switch (window.layout()) {
case WindowLayout.Json json -> restorePanes(json.value());
case WindowLayout.Classic classic -> restoreGeometry(classic.value());
}
```

## Members

- `value` (method): The layout exactly as tmux reported it.
- `Classic` (struct): The checksummed form every release writes before 3.8. It carries geometry and no pane ids.
- `Json` (struct): The JSON form tmux writes from 3.8, which names the pane in each cell.
- `of` (method): Which form a reported layout is in.
