I'm trying to implement a window manager like vim does but in-browser with JavaScript. I got pretty much what I wanted working with jquery layout, but how I should manage my windows still elude me..
I can start with a single "window" and a empty buffer like vim does, then split it vertically or horizontally to get a split view of two or more buffers (or even a split view of the same buffer, just like vim) .. and this split one of the resulting window again to get 3 "windows".
Now my problem is that I have to remember the state of those windows and how they were split .. how can I know if it was one horizontal and two vertical split? Or vice versa ..
I just can't find any data structure that would fit what I need. I can express it with pseudo code though .. For example the previous example could be expressed either as [1|[2+3]] or [[1+2]|[3]] where "[]" means a window group, "|" means a vertical split and "+" means an horizontal split.
I just can't find where to start.. or how to express it programatically