summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--doc/en/weechat_plugin_api.en.txt5
-rw-r--r--doc/fr/weechat_plugin_api.fr.txt5
-rw-r--r--doc/it/weechat_plugin_api.it.txt6
-rw-r--r--src/gui/gui-window.c151
5 files changed, 95 insertions, 75 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d1b4274a..6b3fd33cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,13 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.4.1-dev, 2013-02-10
+v0.4.1-dev, 2013-02-12
Version 0.4.1 (under dev!)
--------------------------
+* core: add signal "window_opened" (task #12464)
* core: fix structures before buffer data when a buffer is closed
* core: fix refresh of line after changes with hdata_update (update flag
"displayed" according to filters)
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt
index 0b53d69ab..e7e38ee1c 100644
--- a/doc/en/weechat_plugin_api.en.txt
+++ b/doc/en/weechat_plugin_api.en.txt
@@ -7951,6 +7951,11 @@ Arguments:
pointer: window |
window closed
+| weechat | window_opened +
+ (_new in version 0.4.1_) |
+ pointer: window |
+ window opened
+
| weechat | window_scrolled |
pointer: window |
scroll in window
diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt
index c50629fe9..7002dbfbc 100644
--- a/doc/fr/weechat_plugin_api.fr.txt
+++ b/doc/fr/weechat_plugin_api.fr.txt
@@ -8064,6 +8064,11 @@ Paramètres :
pointeur : fenêtre |
fenêtre fermée
+| weechat | window_opened +
+ (_nouveau dans la version 0.4.1_) |
+ pointeur : fenêtre |
+ fenêtre ouverte
+
| weechat | window_scrolled |
pointeur : fenêtre |
défilement dans la fenêtre
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 76f58ee40..c76333df0 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -8034,6 +8034,12 @@ Argomenti:
puntatore: finestra |
window closed
+// TRANSLATION MISSING
+| weechat | window_opened +
+ (_novità nella versione 0.4.1_) |
+ puntatore: finestra |
+ window opened
+
| weechat | window_scrolled |
puntatore: finestra |
scroll nella finestra
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index 4cee77ddb..c3aae7d84 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -588,85 +588,88 @@ gui_window_new (struct t_gui_window *parent_window, struct t_gui_buffer *buffer,
ptr_leaf = gui_windows_tree;
}
- if ((new_window = (malloc (sizeof (*new_window)))))
+ new_window = (malloc (sizeof (*new_window)));
+ if (!new_window)
+ return NULL;
+
+ /* create scroll structure */
+ new_window->scroll = malloc (sizeof (*new_window->scroll));
+ if (!new_window->scroll)
{
- /* create scroll structure */
- new_window->scroll = malloc (sizeof (*new_window->scroll));
- if (!new_window->scroll)
- {
- free (new_window);
- return NULL;
- }
+ free (new_window);
+ return NULL;
+ }
- /* create window objects */
- if (!gui_window_objects_init (new_window))
- {
- free (new_window->scroll);
- free (new_window);
- return NULL;
- }
+ /* create window objects */
+ if (!gui_window_objects_init (new_window))
+ {
+ free (new_window->scroll);
+ free (new_window);
+ return NULL;
+ }
- /* number */
- new_window->number = (last_gui_window) ? last_gui_window->number + 1 : 1;
-
- /* position & size */
- new_window->win_x = x;
- new_window->win_y = y;
- new_window->win_width = width;
- new_window->win_height = height;
- new_window->win_width_pct = width_pct;
- new_window->win_height_pct = height_pct;
-
- /* chat window */
- new_window->win_chat_x = 0;
- new_window->win_chat_y = 0;
- new_window->win_chat_width = 0;
- new_window->win_chat_height = 0;
- new_window->win_chat_cursor_x = 0;
- new_window->win_chat_cursor_y = 0;
-
- /* bar windows */
- new_window->bar_windows = NULL;
- new_window->last_bar_window = NULL;
-
- /* refresh */
- new_window->refresh_needed = 0;
-
- /* buffer and layout infos */
- new_window->buffer = buffer;
- new_window->layout_plugin_name = NULL;
- new_window->layout_buffer_name = NULL;
-
- /* scroll */
- gui_window_scroll_init (new_window->scroll, buffer);
-
- /* coordinates */
- new_window->coords_size = 0;
- new_window->coords = NULL;
- new_window->coords_x_message = 0;
-
- /* tree */
- new_window->ptr_tree = ptr_leaf;
- ptr_leaf->window = new_window;
-
- /* add window to windows queue */
- new_window->prev_window = last_gui_window;
- if (gui_windows)
- last_gui_window->next_window = new_window;
- else
- gui_windows = new_window;
- last_gui_window = new_window;
- new_window->next_window = NULL;
+ /* number */
+ new_window->number = (last_gui_window) ? last_gui_window->number + 1 : 1;
+
+ /* position & size */
+ new_window->win_x = x;
+ new_window->win_y = y;
+ new_window->win_width = width;
+ new_window->win_height = height;
+ new_window->win_width_pct = width_pct;
+ new_window->win_height_pct = height_pct;
+
+ /* chat window */
+ new_window->win_chat_x = 0;
+ new_window->win_chat_y = 0;
+ new_window->win_chat_width = 0;
+ new_window->win_chat_height = 0;
+ new_window->win_chat_cursor_x = 0;
+ new_window->win_chat_cursor_y = 0;
+
+ /* bar windows */
+ new_window->bar_windows = NULL;
+ new_window->last_bar_window = NULL;
+
+ /* refresh */
+ new_window->refresh_needed = 0;
+
+ /* buffer and layout infos */
+ new_window->buffer = buffer;
+ new_window->layout_plugin_name = NULL;
+ new_window->layout_buffer_name = NULL;
+
+ /* scroll */
+ gui_window_scroll_init (new_window->scroll, buffer);
+
+ /* coordinates */
+ new_window->coords_size = 0;
+ new_window->coords = NULL;
+ new_window->coords_x_message = 0;
+
+ /* tree */
+ new_window->ptr_tree = ptr_leaf;
+ ptr_leaf->window = new_window;
+
+ /* add window to windows queue */
+ new_window->prev_window = last_gui_window;
+ if (gui_windows)
+ last_gui_window->next_window = new_window;
+ else
+ gui_windows = new_window;
+ last_gui_window = new_window;
+ new_window->next_window = NULL;
- /* create bar windows */
- for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
- {
- if (CONFIG_INTEGER(ptr_bar->options[GUI_BAR_OPTION_TYPE]) != GUI_BAR_TYPE_ROOT)
- gui_bar_window_new (ptr_bar, new_window);
- }
+ /* create bar windows */
+ for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+ {
+ if (CONFIG_INTEGER(ptr_bar->options[GUI_BAR_OPTION_TYPE]) != GUI_BAR_TYPE_ROOT)
+ gui_bar_window_new (ptr_bar, new_window);
}
- else
- return NULL;
+
+ /* send signal */
+ hook_signal_send ("window_opened",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_window);
return new_window;
}