This patch allows 2 things to be done:
* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag
The advantages of the former are clear and simple. Those of the later include:
* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
This makes the screen objects use our existing infrastructure for implementing
classes and objects with lua instead of hand-rolling an own version.
This results in some small API change: Screen objects no longer have an
add_signal() function and instead this function exists on the parent screen
class.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This helps in cases where you have accidentally cloned an entry from
`layouts`.
Previously, no current index would be found and the function would
silently fail.
Signed-off-by: Daniel Hahler <git@thequod.de>
When an area is split in two, for example horizontally, one of the windows
should have height math.floor(previous height / 2) and the other
math.ceil(previous height / 2), to be certain that no gaps are left between the
windows.
For instance, if the first window has height h and the second window has height
math.floor(h / 2), the height of the third window should be math.ceil(h / 2)
instead of the same as for the second window.
So to compute the size of window n + 1 it’s necessary to remember the size of
window n - 1 as well as that of window n.
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since 3fbb5f1535 "luaobject: emit signals on class too" when a signal
is emitted on some object, it will also be emitted on the class. This means that
we don't have to connect our signals via the "new" signal anymore, but can
instead connect to the signal on the class.
(Of course, the signal on the class gets as first argument the object on which
the signal was emitted)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Look at the problem as "in which cases do we add or remove nw or nh?"
rather than "what do we do when k = ...?".
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>