soc.2008.finch: 6e1a62aa: Make the window_reverse() function plubl...
queueram at soc.pidgin.im
queueram at soc.pidgin.im
Mon Sep 27 14:05:42 EDT 2010
----------------------------------------------------------------------
Revision: 6e1a62aa36297645b5635b55326bd8ce64221abc
Parent: 1601c2451c449fe30fbcf967f29e4206928e7332
Author: queueram at soc.pidgin.im
Date: 09/27/10 13:03:46
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/6e1a62aa36297645b5635b55326bd8ce64221abc
Changelog:
Make the window_reverse() function plublic so window managers can make use
of it.
Changes against parent 1601c2451c449fe30fbcf967f29e4206928e7332
patched finch/libgnt/gntwm.c
patched finch/libgnt/gntwm.h
-------------- next part --------------
============================================================
--- finch/libgnt/gntwm.h 98eed7e0a99391a3453fa13d6919a88319231c26
+++ finch/libgnt/gntwm.h 08b703aa5aec7e5d865ecdef888caab820f21f89
@@ -255,6 +255,14 @@ void gnt_wm_window_decorate(GntWM *wm, G
void gnt_wm_window_decorate(GntWM *wm, GntWidget *widget);
/**
+ * Reverse the border decoration around a window
+ * @param wm The window-manager.
+ * @param win The window to reverse
+ * @param set Whether to reverse or not
+ */
+void gnt_wm_window_reverse(GntWM *wm, GntWidget *win, gboolean set);
+
+/**
* Close a window.
* @param wm The window-manager.
* @param widget The window to close.
============================================================
--- finch/libgnt/gntwm.c 9f3d1e7f2885e42a70c8508be08af31b1b2d6723
+++ finch/libgnt/gntwm.c 56852f23fd1901efd879cc30c4ad8269861fc116
@@ -1024,41 +1024,11 @@ static void
}
static void
-window_reverse(GntWidget *win, gboolean set, GntWM *wm)
-{
- int i;
- int w, h;
- WINDOW *d;
-
- if (GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_NO_BORDER))
- return;
-
- d = win->window;
- gnt_widget_get_size(win, &w, &h);
-
- if (gnt_widget_has_shadow(win)) {
- --w;
- --h;
- }
-
- /* the top and bottom */
- for (i = 0; i < w; i += reverse_char(d, 0, i, set));
- for (i = 0; i < w; i += reverse_char(d, h-1, i, set));
-
- /* the left and right */
- for (i = 0; i < h; i += reverse_char(d, i, 0, set));
- for (i = 0; i < h; i += reverse_char(d, i, w-1, set));
-
- gnt_wm_copy_win(win, g_hash_table_lookup(wm->nodes, win));
- update_screen(wm);
-}
-
-static void
ensure_normal_mode(GntWM *wm)
{
if (wm->mode != GNT_KP_MODE_NORMAL) {
if (wm->cws->ordered)
- window_reverse(wm->cws->ordered->data, FALSE, wm);
+ gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), FALSE);
wm->mode = GNT_KP_MODE_NORMAL;
}
}
@@ -1073,7 +1043,7 @@ start_move(GntBindable *bindable, GList
return TRUE;
wm->mode = GNT_KP_MODE_MOVE;
- window_reverse(GNT_WIDGET(wm->cws->ordered->data), TRUE, wm);
+ gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), TRUE);
return TRUE;
}
@@ -1088,7 +1058,7 @@ start_resize(GntBindable *bindable, GLis
return TRUE;
wm->mode = GNT_KP_MODE_RESIZE;
- window_reverse(GNT_WIDGET(wm->cws->ordered->data), TRUE, wm);
+ gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), TRUE);
return TRUE;
}
@@ -1907,6 +1877,35 @@ void gnt_wm_window_decorate(GntWM *wm, G
g_signal_emit(wm, signals[SIG_DECORATE_WIN], 0, widget);
}
+void gnt_wm_window_reverse(GntWM *wm, GntWidget *win, gboolean set)
+{
+ int i;
+ int w, h;
+ WINDOW *d;
+
+ if (GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_NO_BORDER))
+ return;
+
+ d = win->window;
+ gnt_widget_get_size(win, &w, &h);
+
+ if (gnt_widget_has_shadow(win)) {
+ --w;
+ --h;
+ }
+
+ /* the top and bottom */
+ for (i = 0; i < w; i += reverse_char(d, 0, i, set));
+ for (i = 0; i < w; i += reverse_char(d, h-1, i, set));
+
+ /* the left and right */
+ for (i = 0; i < h; i += reverse_char(d, i, 0, set));
+ for (i = 0; i < h; i += reverse_char(d, i, w-1, set));
+
+ gnt_wm_copy_win(win, g_hash_table_lookup(wm->nodes, win));
+ update_screen(wm);
+}
+
void gnt_wm_window_close(GntWM *wm, GntWidget *widget)
{
GntWS *s;
@@ -1992,7 +1991,7 @@ gboolean gnt_wm_process_input(GntWM *wm,
}
if (ox != x || oy != y) {
gnt_screen_move_widget(widget, x, y);
- window_reverse(widget, TRUE, wm);
+ gnt_wm_window_reverse(wm, widget, TRUE);
return TRUE;
}
} else if (wm->mode == GNT_KP_MODE_RESIZE) {
@@ -2009,12 +2008,12 @@ gboolean gnt_wm_process_input(GntWM *wm,
}
if (oh != h || ow != w) {
gnt_screen_resize_widget(widget, w, h);
- window_reverse(widget, TRUE, wm);
+ gnt_wm_window_reverse(wm, widget, TRUE);
return TRUE;
}
}
if (strcmp(keys, "\r") == 0 || strcmp(keys, "\033") == 0) {
- window_reverse(widget, FALSE, wm);
+ gnt_wm_window_reverse(wm, widget, FALSE);
wm->mode = GNT_KP_MODE_NORMAL;
}
return TRUE;
More information about the Commits
mailing list