summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--doc/de/user/usage.de.xml7
-rw-r--r--doc/en/user/usage.en.xml6
-rw-r--r--doc/fr/user/usage.fr.xml6
-rw-r--r--po/cs.po11
-rw-r--r--po/de.po11
-rw-r--r--po/es.po11
-rw-r--r--po/fr.po22
-rw-r--r--po/hu.po11
-rw-r--r--po/ru.po11
-rw-r--r--po/weechat.pot11
-rw-r--r--src/core/wee-command.c35
-rw-r--r--src/core/wee-config.c14
-rw-r--r--src/core/weechat.c2
-rw-r--r--src/gui/curses/gui-curses-keyboard.c1
-rw-r--r--src/gui/curses/gui-curses-main.c4
-rw-r--r--src/gui/gtk/gui-gtk-main.c4
-rw-r--r--src/gui/gui-buffer.c3
-rw-r--r--src/gui/gui-layout.c192
-rw-r--r--src/gui/gui-layout.h35
-rw-r--r--src/gui/gui-window.c40
-rw-r--r--src/gui/gui-window.h1
22 files changed, 289 insertions, 158 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d2218496..c2de470c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2009-01-31
+ChangeLog - 2009-03-07
Version 0.2.7 (under dev!):
@@ -28,8 +28,10 @@ Version 0.2.7 (under dev!):
option "name_lower_case" (bug #19522)
* alias: fix bug with alias, use current buffer to run commands (bug #22876)
* plugins: add some other plugins: alias, demo, fifo, notify, tcl, xfer
- * api: add hooks: command, timer, file descriptor, connection, print, signal,
- config, completion, modifier, info, infolist
+ * scripts: new scripts: buffers.pl, go.py, iset.pl, jabber.py, launcher.pl,
+ mastermind.pl, weetris.pl
+ * api: add hooks: command, timer, file descriptor, process, connection,
+ print, signal, config, completion, modifier, info, infolist
* api: new plugin API with many new functions: hooks, buffer management and
nicklist, bars, configuration files, network, infos/infolists, lists,
upgrade
@@ -37,6 +39,7 @@ Version 0.2.7 (under dev!):
* gui: add new type of buffer, with free content
* gui: add tags for lines and custom filtering by tags or regex (task #7674)
* gui: add custom bars, with custom items
+ * gui: add key to zoom a window (task #7470)
* gui: add new option scroll_page_percent to choose percent of height to scroll
with page_up and page_down keys (task #8702)
* gui: add number of lines remaining after last line displayed in "-MORE-"
diff --git a/doc/de/user/usage.de.xml b/doc/de/user/usage.de.xml
index 93a79ee06..78b6c77f5 100644
--- a/doc/de/user/usage.de.xml
+++ b/doc/de/user/usage.de.xml
@@ -506,6 +506,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</entry>
</row>
<row>
+ <entry>Alt + Z</entry>
+ <entry>
+ <!-- TRANSLATION NEEDED -->
+ Zoom on current window
+ </entry>
+ </row>
+ <row>
<entry>Alt + =</entry>
<entry>
<!-- TRANSLATION NEEDED -->
diff --git a/doc/en/user/usage.en.xml b/doc/en/user/usage.en.xml
index 4973814e2..31f1d791d 100644
--- a/doc/en/user/usage.en.xml
+++ b/doc/en/user/usage.en.xml
@@ -481,6 +481,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</entry>
</row>
<row>
+ <entry>Alt + Z</entry>
+ <entry>
+ Zoom on current window
+ </entry>
+ </row>
+ <row>
<entry>Alt + =</entry>
<entry>
Toggle filters on/off
diff --git a/doc/fr/user/usage.fr.xml b/doc/fr/user/usage.fr.xml
index a1db51eea..49157b079 100644
--- a/doc/fr/user/usage.fr.xml
+++ b/doc/fr/user/usage.fr.xml
@@ -511,6 +511,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</entry>
</row>
<row>
+ <entry>Alt + Z</entry>
+ <entry>
+ Zoom sur la fenêtre courante
+ </entry>
+ </row>
+ <row>
<entry>Alt + =</entry>
<entry>
Active/désactive les filtres
diff --git a/po/cs.po b/po/cs.po
index d6fd1a036..b2b729d4f 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1165,9 +1165,9 @@ msgstr "spravuje okna"
#, fuzzy
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1190,6 +1190,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1198,7 +1199,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/po/de.po b/po/de.po
index eda0d8215..0fb26f095 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1189,9 +1189,9 @@ msgstr "Fenster verwalten"
#, fuzzy
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1214,6 +1214,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1222,7 +1223,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/po/es.po b/po/es.po
index 0f2ada3ef..ca8826cf6 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1169,9 +1169,9 @@ msgstr "gestión de ventanas"
#, fuzzy
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1194,6 +1194,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1202,7 +1203,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/po/fr.po b/po/fr.po
index a913684e6..0dca10f22 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
-"PO-Revision-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
+"PO-Revision-Date: 2009-03-07 11:17+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -1277,14 +1277,14 @@ msgstr "gestion des fenêtres"
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[ptc] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight]"
+"[ptc] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgid ""
" list: list opened windows (no parameter implies this list)\n"
@@ -1303,6 +1303,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1311,7 +1312,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
@@ -1339,6 +1340,7 @@ msgstr ""
" merge: fusionne la fenêtre avec une autre\n"
" page_up: défilement d'une page vers le haut\n"
" page_down: défilement d'une page vers le bas\n"
+" refresh: redessine l'écran\n"
" scroll: défilement d'un nombre de lignes (+/-N) ou avec du temps: "
"s=secondes, m=minutes, h=heures, d=jours, M=mois, y=année\n"
" scroll_up: défilement de quelques lignes vers le haut\n"
@@ -1347,7 +1349,7 @@ msgstr ""
"scroll_bottom: défilement jusqu'au bas du tampon\n"
"scroll_previous_highlight: défilement jusqu'au highlight précédent\n"
"scroll_next_highlight: défilement jusqu'au highlight suivant\n"
-" refresh: redessine l'écran\n"
+" zoom: zoom sur la fenêtre\n"
"\n"
"Pour splith et splitv, pct est un pourcentage qui représente la taille de la "
"nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. "
diff --git a/po/hu.po b/po/hu.po
index 2a9b28b58..ac1150773 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1204,9 +1204,9 @@ msgstr "ablakok kezelése"
#, fuzzy
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1229,6 +1229,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1237,7 +1238,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/po/ru.po b/po/ru.po
index 59200b320..6763b8cd2 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1200,9 +1200,9 @@ msgstr "управление окнами"
#, fuzzy
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1225,6 +1225,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1233,7 +1234,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/po/weechat.pot b/po/weechat.pot
index 6fa1fbe43..2782be7c0 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2009-03-06 18:11+0100\n"
+"POT-Creation-Date: 2009-03-07 11:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1034,9 +1034,9 @@ msgstr ""
msgid ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
-"[pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up "
-"| scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | "
-"scroll_next_highlight ]"
+"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
+"scroll_up | scroll_down | scroll_top | scroll_bottom | "
+"scroll_previous_highlight | scroll_next_highlight | zoom]"
msgstr ""
msgid ""
@@ -1056,6 +1056,7 @@ msgid ""
"\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+" refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: s=seconds, "
"m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -1064,7 +1065,7 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
-" refresh: refresh screen\n"
+" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
"window, computed with current window as size reference. For example 25 means "
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 45734d590..7c7ac9d60 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -1978,13 +1978,13 @@ command_layout (void *data, struct t_gui_buffer *buffer,
{
if (flag_buffers)
{
- gui_layout_buffer_save ();
+ gui_layout_buffer_save (&gui_layout_buffers, &last_gui_layout_buffer);
gui_chat_printf (NULL,
_("Layout saved for buffers (order of buffers)"));
}
if (flag_windows)
{
- gui_layout_window_save ();
+ gui_layout_window_save (&gui_layout_windows);
gui_chat_printf (NULL,
_("Layout saved for windows (buffer displayed by "
"each window)"));
@@ -1997,9 +1997,9 @@ command_layout (void *data, struct t_gui_buffer *buffer,
if (string_strcasecmp (argv[1], "apply") == 0)
{
if (flag_buffers)
- gui_layout_buffer_apply ();
+ gui_layout_buffer_apply (gui_layout_buffers);
if (flag_windows)
- gui_layout_window_apply ();
+ gui_layout_window_apply (gui_layout_windows, -1);
return WEECHAT_RC_OK;
}
@@ -2009,13 +2009,13 @@ command_layout (void *data, struct t_gui_buffer *buffer,
{
if (flag_buffers)
{
- gui_layout_buffer_reset ();
+ gui_layout_buffer_reset (&gui_layout_buffers, &last_gui_layout_buffer);
gui_chat_printf (NULL,
_("Layout reset for buffers"));
}
if (flag_windows)
{
- gui_layout_window_reset ();
+ gui_layout_window_reset (&gui_layout_windows);
gui_chat_printf (NULL,
_("Layout reset for windows"));
}
@@ -3509,6 +3509,13 @@ command_window (void *data, struct t_gui_buffer *buffer,
gui_window_scroll (gui_current_window, argv[2]);
return WEECHAT_RC_OK;
}
+
+ /* zoom window */
+ if (string_strcasecmp (argv[1], "zoom") == 0)
+ {
+ gui_window_zoom (gui_current_window);
+ return WEECHAT_RC_OK;
+ }
gui_chat_printf (NULL,
_("%sError: unknown option for \"%s\" "
@@ -3849,9 +3856,10 @@ command_init ()
N_("manage windows"),
N_("[list | -1 | +1 | b# | up | down | left | right | "
"splith [pct] | splitv [pct] | resize pct | "
- "merge [all] | page_up | page_down | scroll | scroll_up | "
- "scroll_down | scroll_top | scroll_bottom | "
- "scroll_previous_highlight | scroll_next_highlight ]"),
+ "merge [all] | page_up | page_down | refresh | scroll | "
+ "scroll_up | scroll_down | scroll_top | scroll_bottom | "
+ "scroll_previous_highlight | scroll_next_highlight | "
+ "zoom]"),
N_(" list: list opened windows (no parameter implies this "
"list)\n"
" -1: jump to previous window\n"
@@ -3869,6 +3877,7 @@ command_init ()
"window)\n\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+ " refresh: refresh screen\n"
" scroll: scroll number of lines (+/-N) or with time: "
"s=seconds, m=minutes, h=hours, d=days, M=months, y=years\n"
" scroll_up: scroll a few lines up\n"
@@ -3877,7 +3886,7 @@ command_init ()
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
- " refresh: refresh screen\n\n"
+ " zoom: zoom on window\n\n"
"For splith and splitv, pct is a percentage which "
"represents size of new window, computed with current "
"window as size reference. For example 25 means create a "
@@ -3888,9 +3897,9 @@ command_init ()
" scroll 2 days up: /window scroll -2d\n"
" scroll to beginning of current day: /window scroll -d"),
"list|-1|+1|up|down|left|right|splith|splitv|resize|merge|"
- "page_up|page_down|scroll_up|scroll|scroll_down|scroll_top|"
- "scroll_bottom|scroll_previous_highlight|"
- "scroll_next_highlight|refresh all",
+ "page_up|page_down|refresh|scroll_up|scroll|scroll_down|"
+ "scroll_top|scroll_bottom|scroll_previous_highlight|"
+ "scroll_next_highlight|zoom all",
&command_window, NULL);
}
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 43ccfced1..7d6b727bd 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -415,8 +415,8 @@ config_weechat_reload (void *data, struct t_config_file *config_file)
gui_bar_free_all ();
/* remove layout */
- gui_layout_buffer_reset ();
- gui_layout_window_reset ();
+ gui_layout_buffer_reset (&gui_layout_buffers, &last_gui_layout_buffer);
+ gui_layout_window_reset (&gui_layout_windows);
/* remove all filters */
gui_filter_free_all ();
@@ -748,7 +748,9 @@ config_weechat_layout_read_cb (void *data, struct t_config_file *config_file,
number1 = strtol (argv[2], &error1, 10);
if (error1 && !error1[0])
{
- gui_layout_buffer_add (argv[0], argv[1], number1);
+ gui_layout_buffer_add (&gui_layout_buffers,
+ &last_gui_layout_buffer,
+ argv[0], argv[1], number1);
}
}
string_free_exploded (argv);
@@ -772,8 +774,10 @@ config_weechat_layout_read_cb (void *data, struct t_config_file *config_file,
if (error1 && !error1[0] && error2 && !error2[0]
&& error3 && !error3[0] && error4 && !error4[0])
{
- parent = gui_layout_window_search_by_id (number2);
- gui_layout_window_add (number1,
+ parent = gui_layout_window_search_by_id (gui_layout_windows,
+ number2);
+ gui_layout_window_add (&gui_layout_windows,
+ number1,
parent,
number3,
number4,
diff --git a/src/core/weechat.c b/src/core/weechat.c
index 017ac95ec..6bb1f1af6 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -411,7 +411,7 @@ main (int argc, char *argv[])
plugin_init (weechat_auto_load_plugins, /* init plugin interface(s) */
argc, argv);
command_startup (1); /* command executed after plugins */
- gui_layout_window_apply (); /* apply saved layout for windows */
+ gui_layout_window_apply (gui_layout_windows, -1); /* apply saved layout */
weechat_upgrading = 0;
gui_main_loop (); /* WeeChat main loop */
diff --git a/src/gui/curses/gui-curses-keyboard.c b/src/gui/curses/gui-curses-keyboard.c
index 28a1d64ac..59a88eb58 100644
--- a/src/gui/curses/gui-curses-keyboard.c
+++ b/src/gui/curses/gui-curses-keyboard.c
@@ -138,6 +138,7 @@ gui_keyboard_default_bindings ()
gui_keyboard_bind (NULL, /* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
gui_keyboard_bind (NULL, /* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
gui_keyboard_bind (NULL, /* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
+ gui_keyboard_bind (NULL, /* m-z */ "meta-z", "/window zoom");
gui_keyboard_bind (NULL, /* m-= */ "meta-=", "/filter toggle");
gui_keyboard_bind (NULL, /* m-0 */ "meta-0", "/buffer 10");
gui_keyboard_bind (NULL, /* m-1 */ "meta-1", "/buffer 1");
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index f35769b78..ce6571101 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -358,8 +358,8 @@ gui_main_end (int clean_exit)
free (gui_input_clipboard);
/* delete layout saved */
- gui_layout_window_remove_all ();
- gui_layout_buffer_remove_all ();
+ gui_layout_window_remove_all (&gui_layout_windows);
+ gui_layout_buffer_remove_all (&gui_layout_buffers, &last_gui_layout_buffer);
/* delete all windows */
while (gui_windows)
diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c
index 188c9a619..bc5d2d6b7 100644
--- a/src/gui/gtk/gui-gtk-main.c
+++ b/src/gui/gtk/gui-gtk-main.c
@@ -248,8 +248,8 @@ gui_main_end (int clean_exit)
free(gui_input_clipboard);
/* delete layout saved */
- gui_layout_window_remove_all ();
- gui_layout_buffer_remove_all ();
+ gui_layout_window_remove_all (&gui_layout_windows);
+ gui_layout_buffer_remove_all (&gui_layout_buffers, &last_gui_layout_buffer);
/* delete all windows */
while (gui_windows)
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index a511a1905..6144f6071 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -292,7 +292,8 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->plugin = plugin;
new_buffer->plugin_name_for_upgrade = NULL;
/* number will be set later (when inserting buffer in list) */
- new_buffer->layout_number = gui_layout_buffer_get_number (plugin_get_name (plugin),
+ new_buffer->layout_number = gui_layout_buffer_get_number (gui_layout_buffers,
+ plugin_get_name (plugin),
name);
new_buffer->name = strdup (name);
new_buffer->short_name = strdup (name);
diff --git a/src/gui/gui-layout.c b/src/gui/gui-layout.c
index 8b4fc4f2b..c673b4996 100644
--- a/src/gui/gui-layout.c
+++ b/src/gui/gui-layout.c
@@ -41,7 +41,14 @@ struct t_gui_layout_buffer *last_gui_layout_buffer = NULL;
struct t_gui_layout_window *gui_layout_windows = NULL;
-int internal_id = 0;
+/* used to attribute a unique id for each window in tree */
+int gui_layout_internal_id = 0;
+
+/* internal id of current window, when saving windows layout */
+int gui_layout_internal_id_current_window = 0;
+
+/* pointer to current window, found when applying windows layout */
+struct t_gui_window *gui_layout_ptr_current_window = NULL;
/*
@@ -49,7 +56,9 @@ int internal_id = 0;
*/
void
-gui_layout_buffer_remove (struct t_gui_layout_buffer *layout_buffer)
+gui_layout_buffer_remove (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer,
+ struct t_gui_layout_buffer *layout_buffer)
{
/* free data */
if (layout_buffer->plugin_name)
@@ -62,10 +71,10 @@ gui_layout_buffer_remove (struct t_gui_layout_buffer *layout_buffer)
(layout_buffer->prev_layout)->next_layout = layout_buffer->next_layout;
if (layout_buffer->next_layout)
(layout_buffer->next_layout)->prev_layout = layout_buffer->prev_layout;
- if (gui_layout_buffers == layout_buffer)
- gui_layout_buffers = layout_buffer->next_layout;
- if (last_gui_layout_buffer == layout_buffer)
- last_gui_layout_buffer = layout_buffer->prev_layout;
+ if (*layout_buffers == layout_buffer)
+ *layout_buffers = layout_buffer->next_layout;
+ if (*last_layout_buffer == layout_buffer)
+ *last_layout_buffer = layout_buffer->prev_layout;
free (layout_buffer);
}
@@ -75,11 +84,13 @@ gui_layout_buffer_remove (struct t_gui_layout_buffer *layout_buffer)
*/
void
-gui_layout_buffer_remove_all ()
+gui_layout_buffer_remove_all (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer)
{
- while (gui_layout_buffers)
+ while (*layout_buffers)
{
- gui_layout_buffer_remove (gui_layout_buffers);
+ gui_layout_buffer_remove (layout_buffers, last_layout_buffer,
+ *layout_buffers);
}
}
@@ -88,11 +99,12 @@ gui_layout_buffer_remove_all ()
*/
void
-gui_layout_buffer_reset ()
+gui_layout_buffer_reset (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer)
{
struct t_gui_buffer *ptr_buffer;
- gui_layout_buffer_remove_all ();
+ gui_layout_buffer_remove_all (layout_buffers, last_layout_buffer);
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
@@ -106,7 +118,9 @@ gui_layout_buffer_reset ()
*/
struct t_gui_layout_buffer *
-gui_layout_buffer_add (const char *plugin_name, const char *buffer_name,
+gui_layout_buffer_add (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer,
+ const char *plugin_name, const char *buffer_name,
int number)
{
struct t_gui_layout_buffer *new_layout_buffer;
@@ -120,12 +134,12 @@ gui_layout_buffer_add (const char *plugin_name, const char *buffer_name,
new_layout_buffer->number = number;
/* add layout buffer to list */
- new_layout_buffer->prev_layout = last_gui_layout_buffer;
- if (gui_layout_buffers)
- last_gui_layout_buffer->next_layout = new_layout_buffer;
+ new_layout_buffer->prev_layout = *last_layout_buffer;
+ if (*layout_buffers)
+ (*last_layout_buffer)->next_layout = new_layout_buffer;
else
- gui_layout_buffers = new_layout_buffer;
- last_gui_layout_buffer = new_layout_buffer;
+ *layout_buffers = new_layout_buffer;
+ *last_layout_buffer = new_layout_buffer;
new_layout_buffer->next_layout = NULL;
}
@@ -137,16 +151,21 @@ gui_layout_buffer_add (const char *plugin_name, const char *buffer_name,
*/
void
-gui_layout_buffer_save ()
+gui_layout_buffer_save (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer)
{
struct t_gui_buffer *ptr_buffer;
- gui_layout_buffer_remove_all ();
+ if (!layout_buffers || !last_layout_buffer)
+ return;
+
+ gui_layout_buffer_remove_all (layout_buffers, last_layout_buffer);
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
- gui_layout_buffer_add (plugin_get_name (ptr_buffer->plugin),
+ gui_layout_buffer_add (layout_buffers, last_layout_buffer,
+ plugin_get_name (ptr_buffer->plugin),
ptr_buffer->name,
ptr_buffer->number);
}
@@ -158,11 +177,12 @@ gui_layout_buffer_save ()
*/
int
-gui_layout_buffer_get_number (const char *plugin_name, const char *buffer_name)
+gui_layout_buffer_get_number (struct t_gui_layout_buffer *layout_buffers,
+ const char *plugin_name, const char *buffer_name)
{
struct t_gui_layout_buffer *ptr_layout_buffer;
- for (ptr_layout_buffer = gui_layout_buffers; ptr_layout_buffer;
+ for (ptr_layout_buffer = layout_buffers; ptr_layout_buffer;
ptr_layout_buffer = ptr_layout_buffer->next_layout)
{
if ((string_strcasecmp (ptr_layout_buffer->plugin_name, plugin_name) == 0)
@@ -177,22 +197,23 @@ gui_layout_buffer_get_number (const char *plugin_name, const char *buffer_name)
}
/*
- * gui_layout_buffer_apply: apply current layout for buffers
+ * gui_layout_buffer_apply: apply a layout for buffers
*/
void
-gui_layout_buffer_apply ()
+gui_layout_buffer_apply (struct t_gui_layout_buffer *layout_buffers)
{
struct t_gui_buffer *ptr_buffer;
const char *plugin_name;
- if (gui_layout_buffers)
+ if (layout_buffers)
{
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
plugin_name = plugin_get_name (ptr_buffer->plugin);
- ptr_buffer->layout_number = gui_layout_buffer_get_number (plugin_name,
+ ptr_buffer->layout_number = gui_layout_buffer_get_number (layout_buffers,
+ plugin_name,
ptr_buffer->name);
if ((ptr_buffer->layout_number > 0)
&& (ptr_buffer->layout_number != ptr_buffer->number))
@@ -231,12 +252,12 @@ gui_layout_window_remove (struct t_gui_layout_window *layout_window)
*/
void
-gui_layout_window_remove_all ()
+gui_layout_window_remove_all (struct t_gui_layout_window **layout_windows)
{
- if (gui_layout_windows)
+ if (*layout_windows)
{
- gui_layout_window_remove (gui_layout_windows);
- gui_layout_windows = NULL;
+ gui_layout_window_remove (*layout_windows);
+ *layout_windows = NULL;
}
}
@@ -245,11 +266,11 @@ gui_layout_window_remove_all ()
*/
void
-gui_layout_window_reset ()
+gui_layout_window_reset (struct t_gui_layout_window **layout_windows)
{
struct t_gui_window *ptr_win;
- gui_layout_window_remove_all ();
+ gui_layout_window_remove_all (layout_windows);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
@@ -267,28 +288,32 @@ gui_layout_window_reset ()
}
/*
- * gui_layout_window_search_by_id_tree: search a layout window by internal id
- * in a tree
+ * gui_layout_window_search_by_id: search a layout window by internal id
+ * in a layout
*/
struct t_gui_layout_window *
-gui_layout_window_search_by_id_tree (struct t_gui_layout_window *tree, int id)
+gui_layout_window_search_by_id (struct t_gui_layout_window *layout_windows,
+ int id)
{
struct t_gui_layout_window *res;
- if (tree->internal_id == id)
- return tree;
+ if (!layout_windows)
+ return NULL;
+
+ if (layout_windows->internal_id == id)
+ return layout_windows;
- if (tree->child1)
+ if (layout_windows->child1)
{
- res = gui_layout_window_search_by_id_tree (tree->child1, id);
+ res = gui_layout_window_search_by_id (layout_windows->child1, id);
if (res)
return res;
}
- if (tree->child2)
+ if (layout_windows->child2)
{
- res = gui_layout_window_search_by_id_tree (tree->child2, id);
+ res = gui_layout_window_search_by_id (layout_windows->child2, id);
if (res)
return res;
}
@@ -297,24 +322,12 @@ gui_layout_window_search_by_id_tree (struct t_gui_layout_window *tree, int id)
}
/*
- * gui_layout_window_search_by_id: search a layout window by internal id
- */
-
-struct t_gui_layout_window *
-gui_layout_window_search_by_id (int id)
-{
- if (!gui_layout_windows)
- return NULL;
-
- return gui_layout_window_search_by_id_tree (gui_layout_windows, id);
-}
-
-/*
* gui_layout_window_add: add a window layout
*/
struct t_gui_layout_window *
-gui_layout_window_add (int internal_id,
+gui_layout_window_add (struct t_gui_layout_window **layout_windows,
+ int internal_id,
struct t_gui_layout_window *parent,
int split_pct, int split_horiz,
const char *plugin_name, const char *buffer_name)
@@ -345,7 +358,7 @@ gui_layout_window_add (int internal_id,
else
{
/* no parent? => it's root! */
- gui_layout_windows = new_layout_window;
+ *layout_windows = new_layout_window;
}
}
@@ -357,14 +370,19 @@ gui_layout_window_add (int internal_id,
*/
void
-gui_layout_window_save_tree (struct t_gui_layout_window *parent_layout,
+gui_layout_window_save_tree (struct t_gui_layout_window **layout_windows,
+ struct t_gui_layout_window *parent_layout,
struct t_gui_window_tree *tree)
{
struct t_gui_layout_window *layout_window;
if (tree->window)
{
- layout_window = gui_layout_window_add (internal_id++,
+ if (tree->window == gui_current_window)
+ gui_layout_internal_id_current_window = gui_layout_internal_id;
+
+ layout_window = gui_layout_window_add (layout_windows,
+ gui_layout_internal_id,
parent_layout,
0, 0,
plugin_get_name (tree->window->buffer->plugin),
@@ -372,7 +390,8 @@ gui_layout_window_save_tree (struct t_gui_layout_window *parent_layout,
}
else
{
- layout_window = gui_layout_window_add (internal_id++,
+ layout_window = gui_layout_window_add (layout_windows,
+ gui_layout_internal_id,
parent_layout,
tree->split_pct,
tree->split_horizontal,
@@ -380,24 +399,33 @@ gui_layout_window_save_tree (struct t_gui_layout_window *parent_layout,
NULL);
}
+ gui_layout_internal_id++;
+
if (tree->child1)
- gui_layout_window_save_tree (layout_window, tree->child1);
+ gui_layout_window_save_tree (layout_windows,
+ layout_window, tree->child1);
if (tree->child2)
- gui_layout_window_save_tree (layout_window, tree->child2);
+ gui_layout_window_save_tree (layout_windows,
+ layout_window, tree->child2);
}
/*
* gui_layout_window_save: save current layout for windows
+ * return internal id of current window
*/
-void
-gui_layout_window_save ()
+int
+gui_layout_window_save (struct t_gui_layout_window **layout_windows)
{
- gui_layout_window_remove_all ();
+ gui_layout_window_remove_all (layout_windows);
+
+ gui_layout_internal_id = 1;
+ gui_layout_internal_id_current_window = -1;
- internal_id = 1;
- gui_layout_window_save_tree (NULL, gui_windows_tree);
+ gui_layout_window_save_tree (layout_windows, NULL, gui_windows_tree);
+
+ return gui_layout_internal_id_current_window;
}
/*
@@ -464,7 +492,8 @@ gui_layout_window_check_all_buffers ()
*/
void
-gui_layout_window_apply_tree (struct t_gui_layout_window *layout_window)
+gui_layout_window_apply_tree (struct t_gui_layout_window *layout_window,
+ int internal_id_current_window)
{
struct t_gui_window *new_window, *old_window;
@@ -485,17 +514,22 @@ gui_layout_window_apply_tree (struct t_gui_layout_window *layout_window)
}
if (layout_window->child2)
- gui_layout_window_apply_tree (layout_window->child2);
+ gui_layout_window_apply_tree (layout_window->child2,
+ internal_id_current_window);
if (old_window != gui_current_window)
gui_window_switch (old_window);
if (layout_window->child1)
- gui_layout_window_apply_tree (layout_window->child1);
+ gui_layout_window_apply_tree (layout_window->child1,
+ internal_id_current_window);
}
else
{
/* leaf */
+ if (layout_window->internal_id == internal_id_current_window)
+ gui_layout_ptr_current_window = gui_current_window;
+
gui_window_set_layout_plugin_name (gui_current_window,
layout_window->plugin_name);
gui_window_set_layout_buffer_name (gui_current_window,
@@ -508,21 +542,25 @@ gui_layout_window_apply_tree (struct t_gui_layout_window *layout_window)
*/
void
-gui_layout_window_apply ()
+gui_layout_window_apply (struct t_gui_layout_window *layout_windows,
+ int internal_id_current_window)
{
struct t_gui_window *old_window;
- if (gui_layout_windows)
+ if (layout_windows)
{
gui_window_merge_all (gui_current_window);
old_window = gui_current_window;
+ gui_layout_ptr_current_window = NULL;
- gui_layout_window_apply_tree (gui_layout_windows);
+ gui_layout_window_apply_tree (layout_windows,
+ internal_id_current_window);
gui_layout_window_check_all_buffers ();
- gui_window_switch (old_window);
+ gui_window_switch ((gui_layout_ptr_current_window) ?
+ gui_layout_ptr_current_window : old_window);
}
}
@@ -540,14 +578,14 @@ gui_layout_save_on_exit ()
case CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_NONE:
break;
case CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_BUFFERS:
- gui_layout_buffer_save ();
+ gui_layout_buffer_save (&gui_layout_buffers, &last_gui_layout_buffer);
break;
case CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_WINDOWS:
- gui_layout_window_save ();
+ gui_layout_window_save (&gui_layout_windows);
break;
case CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_ALL:
- gui_layout_buffer_save ();
- gui_layout_window_save ();
+ gui_layout_buffer_save (&gui_layout_buffers, &last_gui_layout_buffer);
+ gui_layout_window_save (&gui_layout_windows);
break;
}
}
diff --git a/src/gui/gui-layout.h b/src/gui/gui-layout.h
index bc09e6601..fe81fe34f 100644
--- a/src/gui/gui-layout.h
+++ b/src/gui/gui-layout.h
@@ -51,32 +51,41 @@ struct t_gui_layout_window
/* layout variables */
extern struct t_gui_layout_buffer *gui_layout_buffers;
-extern struct t_gui_layout_buffer *gui_layout_last_buffer;
+extern struct t_gui_layout_buffer *last_gui_layout_buffer;
extern struct t_gui_layout_window *gui_layout_windows;
/* layout functions */
-extern void gui_layout_buffer_remove_all ();
-extern void gui_layout_buffer_reset ();
-extern struct t_gui_layout_buffer *gui_layout_buffer_add (const char *plugin_name,
+extern void gui_layout_buffer_remove_all (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer);
+extern void gui_layout_buffer_reset (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer);
+extern struct t_gui_layout_buffer *gui_layout_buffer_add (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer,
+ const char *plugin_name,
const char *buffer_name,
int number);
-extern void gui_layout_buffer_save ();
-extern int gui_layout_buffer_get_number (const char *plugin_name,
+extern void gui_layout_buffer_save (struct t_gui_layout_buffer **layout_buffers,
+ struct t_gui_layout_buffer **last_layout_buffer);
+extern int gui_layout_buffer_get_number (struct t_gui_layout_buffer *layout_buffers,
+ const char *plugin_name,
const char *buffer_name);
-extern void gui_layout_buffer_apply ();
+extern void gui_layout_buffer_apply (struct t_gui_layout_buffer *layout_buffers);
-extern void gui_layout_window_remove_all ();
-extern void gui_layout_window_reset ();
-extern struct t_gui_layout_window *gui_layout_window_search_by_id (int id);
-extern struct t_gui_layout_window *gui_layout_window_add (int internal_id,
+extern void gui_layout_window_remove_all (struct t_gui_layout_window **layout_windows);
+extern void gui_layout_window_reset (struct t_gui_layout_window **layout_windows);
+extern struct t_gui_layout_window *gui_layout_window_search_by_id (struct t_gui_layout_window *layout_windows,
+ int id);
+extern struct t_gui_layout_window *gui_layout_window_add (struct t_gui_layout_window **layout_windows,
+ int internal_id,
struct t_gui_layout_window *parent,
int split_pct,
int split_horiz,
const char *plugin_name,
const char *buffer_name);
-extern void gui_layout_window_save ();
-extern void gui_layout_window_apply ();
+extern int gui_layout_window_save (struct t_gui_layout_window **layout_windows);
+extern void gui_layout_window_apply (struct t_gui_layout_window *layout_windows,
+ int internal_id_current_window);
extern void gui_layout_window_check_buffer (struct t_gui_buffer *buffer);
extern void gui_layout_save_on_exit ();
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index e0e6acc65..906a1f3f9 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -48,6 +48,7 @@
#include "gui-filter.h"
#include "gui-input.h"
#include "gui-hotlist.h"
+#include "gui-layout.h"
int gui_init_ok = 0; /* = 1 if GUI is initialized*/
@@ -61,6 +62,11 @@ struct t_gui_window *gui_current_window = NULL; /* current window */
struct t_gui_window_tree *gui_windows_tree = NULL; /* windows tree */
+struct t_gui_layout_window *gui_window_layout_before_zoom = NULL;
+ /* layout before zooming on a window */
+int gui_window_layout_id_current_window = -1;
+ /* current window id before zoom */
+
/*
* gui_window_ask_refresh: set "gui_window_refresh_needed" flag
@@ -911,6 +917,34 @@ gui_window_search_stop (struct t_gui_window *window)
}
/*
+ * gui_window_zoom: zoom window (maximize it or restore layout before previous
+ * zoom)
+ */
+
+void
+gui_window_zoom (struct t_gui_window *window)
+{
+ if (!gui_ok)
+ return;
+
+ if (gui_window_layout_before_zoom)
+ {
+ /* restore layout as it was before zooming a window */
+ gui_layout_window_apply (gui_window_layout_before_zoom,
+ gui_window_layout_id_current_window);
+ gui_layout_window_remove_all (&gui_window_layout_before_zoom);
+ gui_window_layout_id_current_window = -1;
+ }
+ else
+ {
+ /* save layout and zoom on current window */
+ gui_window_layout_id_current_window =
+ gui_layout_window_save (&gui_window_layout_before_zoom);
+ gui_window_merge_all (window);
+ }
+}
+
+/*
* gui_window_add_to_infolist: add a window in an infolist
* return 1 if ok, 0 if error
*/
@@ -972,7 +1006,11 @@ gui_window_print_log ()
struct t_gui_bar_window *ptr_bar_win;
log_printf ("");
- log_printf ("current window = 0x%lx", gui_current_window);
+ log_printf ("gui_windows . . . . . . . . . : 0x%lx", gui_windows);
+ log_printf ("last_gui_window . . . . . . . : 0x%lx", last_gui_window);
+ log_printf ("gui_current window. . . . . . : 0x%lx", gui_current_window);
+ log_printf ("gui_windows_tree. . . . . . . : 0x%lx", gui_windows_tree);
+ log_printf ("gui_window_layout_before_zoom : 0x%lx", gui_window_layout_before_zoom);
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
{
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index fce3221fe..ae81801c7 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -135,6 +135,7 @@ extern void gui_window_search_start (struct t_gui_window *window);
extern void gui_window_search_restart (struct t_gui_window *window);
extern void gui_window_search_stop (struct t_gui_window *window);
extern int gui_window_search_text (struct t_gui_window *window);
+extern void gui_window_zoom (struct t_gui_window *window);
extern int gui_window_add_to_infolist (struct t_infolist *infolist,
struct t_gui_window *window);
extern void gui_window_print_log ();