Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
hacking-howto: Update 'data structures' section
- Includes updated bigpicture.png from dump-asy.pl script
- The X11 root window is not a container
- Adds some extra information

bigpicture.png is created by converting the .asy to an .eps with `asy
bigpicture .eps` and then using the following gs command:
gs -dSAFER -dBATCH -dNOPAUSE -dEPSCrop -r600 -sDEVICE=pngalpha -sOutputFile=bigpicture.png bigpicture.eps
  • Loading branch information
orestisfl committed May 6, 2020
1 parent c7b6edf commit cdf5ccb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 26 deletions.
19 changes: 19 additions & 0 deletions docs/bigpicture.asy
@@ -0,0 +1,19 @@
import drawtree;
treeLevelStep = 2cm;
TreeNode n94457831379296 = makeNode("``root'' (splith) []");
TreeNode n94457831380944 = makeNode(n94457831379296, "``\_\_i3'' (output) []");
TreeNode n94457831384048 = makeNode(n94457831380944, "``content'' (splith) []");
TreeNode n94457831387184 = makeNode(n94457831384048, "``\_\_i3\_scratch'' (splith) []");
TreeNode n94457831390576 = makeNode(n94457831379296, "``eDP-1'' (output) []");
TreeNode n94457831393744 = makeNode(n94457831390576, "``topdock'' (dockarea) []");
TreeNode n94457831396992 = makeNode(n94457831390576, "``content'' (splith) []");
TreeNode n94457831628304 = makeNode(n94457831396992, "``1'' (splith) []");
TreeNode n94457831571040 = makeNode(n94457831628304, "``Hacking i3: How To - Mozilla Firefox'' (leaf) []");
TreeNode n94457831246384 = makeNode(n94457831628304, "``vim'' (leaf) []");
TreeNode n94457831461088 = makeNode(n94457831396992, "``Named workspace'' (splith) []");
TreeNode n94457831471424 = makeNode(n94457831461088, "``[Empty]'' (tabbed) []");
TreeNode n94457831570576 = makeNode(n94457831471424, "``contrib/dump-asy.pl --no-gv'' (leaf) [Marks go here]");
TreeNode n94457831645488 = makeNode(n94457831471424, "``ipython'' (leaf) []");
TreeNode n94457831400192 = makeNode(n94457831390576, "``bottomdock'' (dockarea) []");
TreeNode n94457831424848 = makeNode(n94457831400192, "``i3bar for output eDP-1'' (leaf) []");
draw(n94457831379296, (0, 0));
Binary file modified docs/bigpicture.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/bigpicture.xcf
Binary file not shown.
53 changes: 27 additions & 26 deletions docs/hacking-howto
Expand Up @@ -246,37 +246,39 @@ A file containing all X11 atoms which i3 uses. This file will be included
various times (for defining, requesting and receiving the atoms), each time
with a different definition of xmacro().


== Data structures

See +include/data.h+ for documented data structures. The most important ones are
explained here.

See include/data.h for documented data structures. The most important ones are
explained right here.

/////////////////////////////////////////////////////////////////////////////////
// TODO: update image

image:bigpicture.png[The Big Picture]
The following picture is generated by the +contrib/dump-asy.pl+ script.

/////////////////////////////////////////////////////////////////////////////////
image:bigpicture.png["The Big Picture",width=1000,link="bigpicture.png"]

So, the hierarchy is:
The hierarchy is:

. *X11 root window*, the root container
. *Output container* (LVDS1 in this example)
. *Content container* (there are also containers for dock windows)
. *Workspaces* (Workspace 1 in this example, with horizontal orientation)
. *Split container* (vertically split)
. *X11 window containers*
. *Root container*
. *Output containers*: +eDP-1+ in this example and the internal +__i3++ output
. *Content and 2 dockarea containers*
. *Workspaces*: Numbered workspace ``1'' and a ``Named workspace''
. *Split containers*: One horizontal in the first workspace and a tabbed one in
the named one.
. *Leaf containers*: Windows like vim and an i3bar dock.

The data type is +Con+, in all cases.

=== X11 root window
=== Root container

The root container (global variable +croot+) is the up-most ascendant of every i3
container. It can be used to iterate over the whole tree structure. E.g., it is
used to reply to the +GET_WORKSPACES+ request, iterating over it's children to
find all workspaces. This is different from the X11 root window.

The X11 root window is a single window per X11 display (a display is identified
by +:0+ or +:1+ etc.). The root window is what you draw your background image
on. It spans all the available outputs, e.g. +VGA1+ is a specific part of the
root window and +LVDS1+ is a specific part of the root window.
The X11 root window (global variable +root+) is a single window per X11 display
(a display is identified by +:0+ or +:1+ etc.). The root window is what you draw
your background image on. It spans all the available outputs, e.g. +VGA1+ is a
specific part of the root window and +LVDS1+ is a specific part of the root
window.

=== Output container

Expand All @@ -298,8 +300,8 @@ currently on.
=== Content container

Each output has multiple children. Two of them are dock containers which hold
dock clients. The other one is the content container, which holds the actual
content (workspaces) of this output.
the top and bottom dock clients. The other one is the content container, which
holds the actual content (workspaces) of this output.

=== Workspace

Expand All @@ -318,10 +320,9 @@ vertical) and a layout.
Split containers (and X11 window containers, which are a subtype of split
containers) can have different border styles.

=== X11 window container
=== Leaf containers

An X11 window container holds exactly one X11 window. These are the leaf nodes
of the layout tree, they cannot have any children.
A leaf container holds exactly one X11 window. They can't have any children.

== List/queue macros

Expand Down

0 comments on commit cdf5ccb

Please sign in to comment.