Thu, 12 Jul 2007 03:17:32 +0000
Crash fixes from Eric Polino.
applied partial changes from 91d02f5707d0f9aa92d5e1c6f19e4bb8127b68b0
through ab74f830abfd9bb3a7345dee6a00c2d51a8119b1
|
18114
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
1 | /** |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
2 | * GNT - The GLib Ncurses Toolkit |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
3 | * |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
4 | * GNT is the legal property of its developers, whose names are too numerous |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
6 | * source distribution. |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
7 | * |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
8 | * This library is free software; you can redistribute it and/or modify |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
11 | * (at your option) any later version. |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
12 | * |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
16 | * GNU General Public License for more details. |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
17 | * |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
21 | */ |
|
adb3cfadc125
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17853
diff
changeset
|
22 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
23 | #define _GNU_SOURCE |
|
17853
b0e5cda11253
Fix libgnt compilation on BSD and solaris. This references #516.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17355
diff
changeset
|
24 | #if defined(__APPLE__) || defined(__unix__) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
25 | #define _XOPEN_SOURCE_EXTENDED |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
26 | #endif |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
27 | |
|
14966
28f21386d822
[gaim-migrate @ 17676]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14962
diff
changeset
|
28 | #include "config.h" |
|
28f21386d822
[gaim-migrate @ 17676]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14962
diff
changeset
|
29 | |
|
15863
7411e672a88b
Re-order includes to fix this compile error:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15839
diff
changeset
|
30 | #include <ctype.h> |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
31 | #include <glib/gprintf.h> |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
32 | #include <gmodule.h> |
|
15863
7411e672a88b
Re-order includes to fix this compile error:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15839
diff
changeset
|
33 | #include <stdlib.h> |
|
7411e672a88b
Re-order includes to fix this compile error:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15839
diff
changeset
|
34 | #include <string.h> |
|
15874
46df7421a1b5
Enable DEBUG_CFLAGS in libgnt and fix up a number of compile warnings and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15863
diff
changeset
|
35 | #include <time.h> |
|
15863
7411e672a88b
Re-order includes to fix this compile error:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15839
diff
changeset
|
36 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
37 | #include "gntwm.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
38 | #include "gntstyle.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
39 | #include "gntmarshal.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
40 | #include "gnt.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
41 | #include "gntbox.h" |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
42 | #include "gntlabel.h" |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
43 | #include "gntmenu.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
44 | #include "gnttextview.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
45 | #include "gnttree.h" |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
46 | #include "gntutils.h" |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
47 | #include "gntwindow.h" |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
48 | |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
49 | #define IDLE_CHECK_INTERVAL 5 /* 5 seconds */ |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
50 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
51 | enum |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
52 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
53 | SIG_NEW_WIN, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
54 | SIG_DECORATE_WIN, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
55 | SIG_CLOSE_WIN, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
56 | SIG_CONFIRM_RESIZE, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
57 | SIG_RESIZED, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
58 | SIG_CONFIRM_MOVE, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
59 | SIG_MOVED, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
60 | SIG_UPDATE_WIN, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
61 | SIG_GIVE_FOCUS, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
62 | SIG_KEY_PRESS, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
63 | SIG_MOUSE_CLICK, |
|
18420
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
64 | SIG_TERMINAL_REFRESH, |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
65 | SIGS |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
66 | }; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
67 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
68 | static guint signals[SIGS] = { 0 }; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
69 | static void gnt_wm_new_window_real(GntWM *wm, GntWidget *widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
70 | static void gnt_wm_win_resized(GntWM *wm, GntNode *node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
71 | static void gnt_wm_win_moved(GntWM *wm, GntNode *node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
72 | static void gnt_wm_give_focus(GntWM *wm, GntWidget *widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
73 | static void update_window_in_list(GntWM *wm, GntWidget *wid); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
74 | static void shift_window(GntWM *wm, GntWidget *widget, int dir); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
75 | static gboolean workspace_next(GntBindable *wm, GList *n); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
76 | static gboolean workspace_prev(GntBindable *wm, GList *n); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
77 | |
|
17094
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
78 | #ifndef NO_WIDECHAR |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
79 | static int widestringwidth(wchar_t *wide); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
80 | #endif |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
81 | |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
82 | static gboolean write_already(gpointer data); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
83 | static int write_timeout; |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
84 | static time_t last_active_time; |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
85 | static gboolean idle_update; |
|
16524
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
86 | static GList *act = NULL; /* list of WS with unseen activitiy */ |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
87 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
88 | static GList * |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
89 | g_list_bring_to_front(GList *list, gpointer data) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
90 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
91 | list = g_list_remove(list, data); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
92 | list = g_list_prepend(list, data); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
93 | return list; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
94 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
95 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
96 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
97 | free_node(gpointer data) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
98 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
99 | GntNode *node = data; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
100 | hide_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
101 | del_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
102 | g_free(node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
103 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
104 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
105 | void |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
106 | gnt_wm_copy_win(GntWidget *widget, GntNode *node) |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
107 | { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
108 | WINDOW *src, *dst; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
109 | int shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
110 | if (!node) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
111 | return; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
112 | src = widget->window; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
113 | dst = node->window; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
114 | shadow = gnt_widget_has_shadow(widget) ? 1 : 0; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
115 | copywin(src, dst, node->scroll, 0, 0, 0, getmaxy(dst) - 1, getmaxx(dst) - 1, 0); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
116 | } |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
117 | |
|
17094
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
118 | /** |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
119 | * The following is a workaround for a bug in most versions of ncursesw. |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
120 | * Read about it in: http://article.gmane.org/gmane.comp.lib.ncurses.bugs/2751 |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
121 | * |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
122 | * In short, if a panel hides one cell of a multi-cell character, then the rest |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
123 | * of the characters in that line get screwed. The workaround here is to erase |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
124 | * any such character preemptively. |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
125 | * |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
126 | * Caveat: If a wide character is erased, and the panel above it is moved enough |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
127 | * to expose the entire character, it is not always redrawn. |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
128 | */ |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
129 | static void |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
130 | work_around_for_ncurses_bug() |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
131 | { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
132 | #ifndef NO_WIDECHAR |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
133 | PANEL *panel = NULL; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
134 | while ((panel = panel_below(panel)) != NULL) { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
135 | int sx, ex, sy, ey, w, y; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
136 | cchar_t ch; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
137 | PANEL *below = panel; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
138 | |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
139 | sx = panel->win->_begx; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
140 | ex = panel->win->_maxx + sx; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
141 | sy = panel->win->_begy; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
142 | ey = panel->win->_maxy + sy; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
143 | |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
144 | while ((below = panel_below(below)) != NULL) { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
145 | if (sy > below->win->_begy + below->win->_maxy || |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
146 | ey < below->win->_begy) |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
147 | continue; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
148 | if (sx > below->win->_begx + below->win->_maxx || |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
149 | ex < below->win->_begx) |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
150 | continue; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
151 | for (y = MAX(sy, below->win->_begy); y <= MIN(ey, below->win->_begy + below->win->_maxy); y++) { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
152 | if (mvwin_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch) != OK) |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
153 | goto right; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
154 | w = widestringwidth(ch.chars); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
155 | if (w > 1 && (ch.attr & 1)) { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
156 | ch.chars[0] = ' '; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
157 | ch.attr &= ~ A_CHARTEXT; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
158 | mvwadd_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
159 | touchline(below->win, y - below->win->_begy, 1); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
160 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
161 | right: |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
162 | if (mvwin_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch) != OK) |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
163 | continue; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
164 | w = widestringwidth(ch.chars); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
165 | if (w > 1 && !(ch.attr & 1)) { |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
166 | ch.chars[0] = ' '; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
167 | ch.attr &= ~ A_CHARTEXT; |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
168 | mvwadd_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
169 | touchline(below->win, y - below->win->_begy, 1); |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
170 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
171 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
172 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
173 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
174 | #endif |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
175 | } |
|
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
176 | |
|
16524
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
177 | static void |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
178 | update_act_msg() |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
179 | { |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
180 | GntWidget *label; |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
181 | GList *iter; |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
182 | static GntWidget *message = NULL; |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
183 | GString *text = g_string_new("act: "); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
184 | if (message) |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
185 | gnt_widget_destroy(message); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
186 | if (g_list_length(act) == 0) |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
187 | return; |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
188 | for (iter = act; iter; iter = iter->next) { |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
189 | GntWS *ws = iter->data; |
| 18133 | 190 | g_string_append_printf(text, "%s, ", gnt_ws_get_name(ws)); |
|
16524
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
191 | } |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
192 | g_string_erase(text, text->len - 2, 2); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
193 | message = gnt_vbox_new(FALSE); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
194 | label = gnt_label_new_with_format(text->str, GNT_TEXT_FLAG_BOLD | GNT_TEXT_FLAG_HIGHLIGHT); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
195 | GNT_WIDGET_UNSET_FLAGS(GNT_BOX(message), GNT_WIDGET_CAN_TAKE_FOCUS); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
196 | GNT_WIDGET_SET_FLAGS(GNT_BOX(message), GNT_WIDGET_TRANSIENT); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
197 | gnt_box_add_widget(GNT_BOX(message), label); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
198 | gnt_widget_set_name(message, "wm-message"); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
199 | gnt_widget_set_position(message, 0, 0); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
200 | gnt_widget_draw(message); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
201 | g_string_free(text, TRUE); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
202 | } |
|
17139
6a6f27caf79e
propagate from branch 'im.pidgin.pidgin' (head 41a52fb8d3b6772f937ad085d9bae4b361898362)
Richard Nelson <wabz@pidgin.im>
diff
changeset
|
203 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
204 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
205 | update_screen(GntWM *wm) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
206 | { |
|
18599
7e31405a2cbb
Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18596
diff
changeset
|
207 | if (wm->mode == GNT_KP_MODE_WAIT_ON_CHILD) |
|
7e31405a2cbb
Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18596
diff
changeset
|
208 | return TRUE; |
|
7e31405a2cbb
Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18596
diff
changeset
|
209 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
210 | if (wm->menu) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
211 | GntMenu *top = wm->menu; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
212 | while (top) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
213 | GntNode *node = g_hash_table_lookup(wm->nodes, top); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
214 | if (node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
215 | top_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
216 | top = top->submenu; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
217 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
218 | } |
|
17094
a728bde379cf
A workaround for an ncurses bug about multi-cell characters and panels.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16584
diff
changeset
|
219 | work_around_for_ncurses_bug(); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
220 | update_panels(); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
221 | doupdate(); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
222 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
223 | } |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
224 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
225 | static gboolean |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
226 | sanitize_position(GntWidget *widget, int *x, int *y) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
227 | { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
228 | int X_MAX = getmaxx(stdscr); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
229 | int Y_MAX = getmaxy(stdscr) - 1; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
230 | int w, h; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
231 | int nx, ny; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
232 | gboolean changed = FALSE; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
233 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
234 | gnt_widget_get_size(widget, &w, &h); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
235 | if (x) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
236 | if (*x + w > X_MAX) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
237 | nx = MAX(0, X_MAX - w); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
238 | if (nx != *x) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
239 | *x = nx; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
240 | changed = TRUE; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
241 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
242 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
243 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
244 | if (y) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
245 | if (*y + h > Y_MAX) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
246 | ny = MAX(0, Y_MAX - h); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
247 | if (ny != *y) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
248 | *y = ny; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
249 | changed = TRUE; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
250 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
251 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
252 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
253 | return changed; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
254 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
255 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
256 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
257 | refresh_node(GntWidget *widget, GntNode *node, gpointer null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
258 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
259 | int x, y, w, h; |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
260 | int nw, nh; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
261 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
262 | int X_MAX = getmaxx(stdscr); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
263 | int Y_MAX = getmaxy(stdscr) - 1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
264 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
265 | gnt_widget_get_position(widget, &x, &y); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
266 | gnt_widget_get_size(widget, &w, &h); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
267 | |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
268 | if (sanitize_position(widget, &x, &y)) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
269 | gnt_screen_move_widget(widget, x, y); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
270 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
271 | nw = MIN(w, X_MAX); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
272 | nh = MIN(h, Y_MAX); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
273 | if (nw != w || nh != h) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
274 | gnt_screen_resize_widget(widget, nw, nh); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
275 | } |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
276 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
277 | static void |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
278 | read_window_positions(GntWM *wm) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
279 | { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
280 | #if GLIB_CHECK_VERSION(2,6,0) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
281 | GKeyFile *gfile = g_key_file_new(); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
282 | char *filename = g_build_filename(g_get_home_dir(), ".gntpositions", NULL); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
283 | GError *error = NULL; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
284 | char **keys; |
|
15219
4d959b4386bb
[gaim-migrate @ 17943]
Mark Doliner <markdoliner@pidgin.im>
parents:
15199
diff
changeset
|
285 | gsize nk; |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
286 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
287 | if (!g_key_file_load_from_file(gfile, filename, G_KEY_FILE_NONE, &error)) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
288 | g_printerr("GntWM: %s\n", error->message); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
289 | g_error_free(error); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
290 | g_free(filename); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
291 | return; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
292 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
293 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
294 | keys = g_key_file_get_keys(gfile, "positions", &nk, &error); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
295 | if (error) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
296 | g_printerr("GntWM: %s\n", error->message); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
297 | g_error_free(error); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
298 | error = NULL; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
299 | } else { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
300 | while (nk--) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
301 | char *title = keys[nk]; |
|
15219
4d959b4386bb
[gaim-migrate @ 17943]
Mark Doliner <markdoliner@pidgin.im>
parents:
15199
diff
changeset
|
302 | gsize l; |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
303 | char **coords = g_key_file_get_string_list(gfile, "positions", title, &l, NULL); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
304 | if (l == 2) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
305 | int x = atoi(coords[0]); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
306 | int y = atoi(coords[1]); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
307 | GntPosition *p = g_new0(GntPosition, 1); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
308 | p->x = x; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
309 | p->y = y; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
310 | g_hash_table_replace(wm->positions, g_strdup(title + 1), p); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
311 | } else { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
312 | g_printerr("GntWM: Invalid number of arguments for positioing a window.\n"); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
313 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
314 | g_strfreev(coords); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
315 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
316 | g_strfreev(keys); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
317 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
318 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
319 | g_free(filename); |
| 16025 | 320 | g_key_file_free(gfile); |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
321 | #endif |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
322 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
323 | |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
324 | static gboolean check_idle(gpointer n) |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
325 | { |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
326 | if (idle_update) { |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
327 | time(&last_active_time); |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
328 | idle_update = FALSE; |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
329 | } |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
330 | return TRUE; |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
331 | } |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
332 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
333 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
334 | gnt_wm_init(GTypeInstance *instance, gpointer class) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
335 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
336 | GntWM *wm = GNT_WM(instance); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
337 | wm->workspaces = NULL; |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
338 | wm->name_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
339 | wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
340 | gnt_style_read_workspaces(wm); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
341 | if (wm->workspaces == NULL) { |
|
18137
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
342 | wm->cws = gnt_ws_new("default"); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
343 | gnt_wm_add_workspace(wm, wm->cws); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
344 | } else { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
345 | wm->cws = wm->workspaces->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
346 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
347 | wm->event_stack = FALSE; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
348 | wm->tagged = NULL; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
349 | wm->windows = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
350 | wm->actions = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
351 | wm->nodes = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_node); |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
352 | wm->positions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
353 | if (gnt_style_get_bool(GNT_STYLE_REMPOS, TRUE)) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
354 | read_window_positions(wm); |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
355 | g_timeout_add(IDLE_CHECK_INTERVAL * 1000, check_idle, NULL); |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
356 | time(&last_active_time); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
357 | gnt_wm_switch_workspace(wm, 0); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
358 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
359 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
360 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
361 | switch_window(GntWM *wm, int direction) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
362 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
363 | GntWidget *w = NULL, *wid = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
364 | int pos; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
365 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
366 | if (wm->_list.window || wm->menu) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
367 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
368 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
369 | if (!wm->cws->ordered || !wm->cws->ordered->next) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
370 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
371 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
372 | w = wm->cws->ordered->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
373 | pos = g_list_index(wm->cws->list, w); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
374 | pos += direction; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
375 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
376 | if (pos < 0) |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
377 | wid = g_list_last(wm->cws->list)->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
378 | else if (pos >= g_list_length(wm->cws->list)) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
379 | wid = wm->cws->list->data; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
380 | else if (pos >= 0) |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
381 | wid = g_list_nth_data(wm->cws->list, pos); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
382 | |
|
18567
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
383 | gnt_wm_raise_window(wm, wid); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
384 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
385 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
386 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
387 | window_next(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
388 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
389 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
390 | switch_window(wm, 1); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
391 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
392 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
393 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
394 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
395 | window_prev(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
396 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
397 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
398 | switch_window(wm, -1); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
399 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
400 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
401 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
402 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
403 | switch_window_n(GntBindable *bind, GList *list) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
404 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
405 | GntWM *wm = GNT_WM(bind); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
406 | GList *l; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
407 | int n; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
408 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
409 | if (!wm->cws->ordered) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
410 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
411 | |
|
15272
c6e322c9c9b2
[gaim-migrate @ 18000]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15258
diff
changeset
|
412 | if (list) |
|
c6e322c9c9b2
[gaim-migrate @ 18000]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15258
diff
changeset
|
413 | n = GPOINTER_TO_INT(list->data); |
|
c6e322c9c9b2
[gaim-migrate @ 18000]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15258
diff
changeset
|
414 | else |
|
c6e322c9c9b2
[gaim-migrate @ 18000]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15258
diff
changeset
|
415 | n = 0; |
|
15874
46df7421a1b5
Enable DEBUG_CFLAGS in libgnt and fix up a number of compile warnings and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15863
diff
changeset
|
416 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
417 | if ((l = g_list_nth(wm->cws->list, n)) != NULL) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
418 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
419 | gnt_wm_raise_window(wm, l->data); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
420 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
421 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
422 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
423 | } |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
424 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
425 | static gboolean |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
426 | window_scroll_up(GntBindable *bindable, GList *null) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
427 | { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
428 | GntWM *wm = GNT_WM(bindable); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
429 | GntWidget *window; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
430 | GntNode *node; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
431 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
432 | if (!wm->cws->ordered) |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
433 | return TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
434 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
435 | window = wm->cws->ordered->data; |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
436 | node = g_hash_table_lookup(wm->nodes, window); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
437 | if (!node) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
438 | return TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
439 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
440 | if (node->scroll) { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
441 | node->scroll--; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
442 | gnt_wm_copy_win(window, node); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
443 | update_screen(wm); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
444 | } |
|
15874
46df7421a1b5
Enable DEBUG_CFLAGS in libgnt and fix up a number of compile warnings and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15863
diff
changeset
|
445 | return TRUE; |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
446 | } |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
447 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
448 | static gboolean |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
449 | window_scroll_down(GntBindable *bindable, GList *null) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
450 | { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
451 | GntWM *wm = GNT_WM(bindable); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
452 | GntWidget *window; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
453 | GntNode *node; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
454 | int w, h; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
455 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
456 | if (!wm->cws->ordered) |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
457 | return TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
458 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
459 | window = wm->cws->ordered->data; |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
460 | node = g_hash_table_lookup(wm->nodes, window); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
461 | if (!node) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
462 | return TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
463 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
464 | gnt_widget_get_size(window, &w, &h); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
465 | if (h - node->scroll > getmaxy(node->window)) { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
466 | node->scroll++; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
467 | gnt_wm_copy_win(window, node); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
468 | update_screen(wm); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
469 | } |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
470 | return TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
471 | } |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
472 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
473 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
474 | window_close(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
475 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
476 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
477 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
478 | if (wm->_list.window) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
479 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
480 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
481 | if (wm->cws->ordered) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
482 | gnt_widget_destroy(wm->cws->ordered->data); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
483 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
484 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
485 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
486 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
487 | |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
488 | static gboolean |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
489 | help_for_widget(GntBindable *bindable, GList *null) |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
490 | { |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
491 | GntWM *wm = GNT_WM(bindable); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
492 | GntWidget *widget, *tree, *win, *active; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
493 | char *title; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
494 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
495 | if (!wm->cws->ordered) |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
496 | return TRUE; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
497 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
498 | widget = wm->cws->ordered->data; |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
499 | if (!GNT_IS_BOX(widget)) |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
500 | return TRUE; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
501 | active = GNT_BOX(widget)->active; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
502 | |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
503 | tree = gnt_widget_bindings_view(active); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
504 | win = gnt_window_new(); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
505 | title = g_strdup_printf("Bindings for %s", g_type_name(G_OBJECT_TYPE(active))); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
506 | gnt_box_set_title(GNT_BOX(win), title); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
507 | if (tree) |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
508 | gnt_box_add_widget(GNT_BOX(win), tree); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
509 | else |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
510 | gnt_box_add_widget(GNT_BOX(win), gnt_label_new("This widget has no customizable bindings.")); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
511 | |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
512 | gnt_widget_show(win); |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
513 | |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
514 | return TRUE; |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
515 | } |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
516 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
517 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
518 | destroy__list(GntWidget *widget, GntWM *wm) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
519 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
520 | wm->_list.window = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
521 | wm->_list.tree = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
522 | wm->windows = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
523 | wm->actions = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
524 | update_screen(wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
525 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
526 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
527 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
528 | setup__list(GntWM *wm) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
529 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
530 | GntWidget *tree, *win; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
531 | win = wm->_list.window = gnt_box_new(FALSE, FALSE); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
532 | gnt_box_set_toplevel(GNT_BOX(win), TRUE); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
533 | gnt_box_set_pad(GNT_BOX(win), 0); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
534 | GNT_WIDGET_SET_FLAGS(win, GNT_WIDGET_TRANSIENT); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
535 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
536 | tree = wm->_list.tree = gnt_tree_new(); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
537 | gnt_box_add_widget(GNT_BOX(win), tree); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
538 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
539 | g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(destroy__list), wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
540 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
541 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
542 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
543 | window_list_activate(GntTree *tree, GntWM *wm) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
544 | { |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
545 | GntBindable *sel = gnt_tree_get_selection_data(GNT_TREE(tree)); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
546 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
547 | gnt_widget_destroy(wm->_list.window); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
548 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
549 | if (!sel) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
550 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
551 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
552 | if (GNT_IS_WS(sel)) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
553 | gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, sel)); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
554 | } else { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
555 | gnt_wm_raise_window(wm, GNT_WIDGET(sel)); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
556 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
557 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
558 | |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
559 | static void |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
560 | populate_window_list(GntWM *wm, gboolean workspace) |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
561 | { |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
562 | GList *iter; |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
563 | GntTree *tree = GNT_TREE(wm->windows->tree); |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
564 | if (!workspace) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
565 | for (iter = wm->cws->list; iter; iter = iter->next) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
566 | GntBox *box = GNT_BOX(iter->data); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
567 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
568 | gnt_tree_add_row_last(tree, box, |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
569 | gnt_tree_create_row(tree, box->title), NULL); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
570 | update_window_in_list(wm, GNT_WIDGET(box)); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
571 | } |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
572 | } else { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
573 | GList *ws = wm->workspaces; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
574 | for (; ws; ws = ws->next) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
575 | gnt_tree_add_row_last(tree, ws->data, |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
576 | gnt_tree_create_row(tree, gnt_ws_get_name(GNT_WS(ws->data))), NULL); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
577 | for (iter = GNT_WS(ws->data)->list; iter; iter = iter->next) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
578 | GntBox *box = GNT_BOX(iter->data); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
579 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
580 | gnt_tree_add_row_last(tree, box, |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
581 | gnt_tree_create_row(tree, box->title), ws->data); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
582 | update_window_in_list(wm, GNT_WIDGET(box)); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
583 | } |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
584 | } |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
585 | } |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
586 | } |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
587 | |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
588 | static gboolean |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
589 | window_list_key_pressed(GntWidget *widget, const char *text, GntWM *wm) |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
590 | { |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
591 | if (text[1] == 0 && wm->cws->ordered) { |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
592 | GntBindable *sel = gnt_tree_get_selection_data(GNT_TREE(widget)); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
593 | switch (text[0]) { |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
594 | case '-': |
|
16189
eec6c18f2abf
These bindings are easier for changing window order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16188
diff
changeset
|
595 | case ',': |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
596 | if (GNT_IS_WS(sel)) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
597 | /* reorder the workspace. */ |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
598 | } else |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
599 | shift_window(wm, GNT_WIDGET(sel), -1); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
600 | break; |
|
16189
eec6c18f2abf
These bindings are easier for changing window order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16188
diff
changeset
|
601 | case '=': |
|
eec6c18f2abf
These bindings are easier for changing window order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16188
diff
changeset
|
602 | case '.': |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
603 | if (GNT_IS_WS(sel)) { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
604 | /* reorder the workspace. */ |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
605 | } else |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
606 | shift_window(wm, GNT_WIDGET(sel), 1); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
607 | break; |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
608 | default: |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
609 | return FALSE; |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
610 | } |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
611 | gnt_tree_remove_all(GNT_TREE(widget)); |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
612 | populate_window_list(wm, GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "workspace"))); |
|
15714
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
613 | gnt_tree_set_selected(GNT_TREE(widget), sel); |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
614 | return TRUE; |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
615 | } |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
616 | return FALSE; |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
617 | } |
|
59a1acdd2c7b
Allow reordering windows from the window list. I find it much easier and faster.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15272
diff
changeset
|
618 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
619 | static void |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
620 | list_of_windows(GntWM *wm, gboolean workspace) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
621 | { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
622 | GntWidget *tree, *win; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
623 | setup__list(wm); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
624 | wm->windows = &wm->_list; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
625 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
626 | win = wm->windows->window; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
627 | tree = wm->windows->tree; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
628 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
629 | gnt_box_set_title(GNT_BOX(win), workspace ? "Workspace List" : "Window List"); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
630 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
631 | populate_window_list(wm, workspace); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
632 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
633 | if (wm->cws->ordered) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
634 | gnt_tree_set_selected(GNT_TREE(tree), wm->cws->ordered->data); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
635 | else if (workspace) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
636 | gnt_tree_set_selected(GNT_TREE(tree), wm->cws); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
637 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
638 | g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), wm); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
639 | g_signal_connect(G_OBJECT(tree), "key_pressed", G_CALLBACK(window_list_key_pressed), wm); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
640 | g_object_set_data(G_OBJECT(tree), "workspace", GINT_TO_POINTER(workspace)); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
641 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
642 | gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
643 | gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
644 | gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
645 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
646 | gnt_widget_show(win); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
647 | } |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
648 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
649 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
650 | window_list(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
651 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
652 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
653 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
654 | if (wm->_list.window || wm->menu) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
655 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
656 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
657 | if (!wm->cws->ordered) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
658 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
659 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
660 | list_of_windows(wm, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
661 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
662 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
663 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
664 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
665 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
666 | dump_screen(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
667 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
668 | int x, y; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
669 | chtype old = 0, now = 0; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
670 | FILE *file = fopen("dump.html", "w"); |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
671 | struct { |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
672 | char ascii; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
673 | char *unicode; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
674 | } unis[] = { |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
675 | {'q', "─"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
676 | {'t', "├"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
677 | {'u', "┤"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
678 | {'x', "│"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
679 | {'-', "↑"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
680 | {'.', "↓"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
681 | {'l', "┌"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
682 | {'k', "┐"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
683 | {'m', "└"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
684 | {'j', "┘"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
685 | {'a', "▒"}, |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
686 | {'\0', NULL} |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
687 | }; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
688 | |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
689 | fprintf(file, "<head>\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n</head>\n<body>\n"); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
690 | fprintf(file, "<pre>"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
691 | for (y = 0; y < getmaxy(stdscr); y++) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
692 | for (x = 0; x < getmaxx(stdscr); x++) { |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
693 | char ch[2] = {0, 0}, *print; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
694 | #ifdef NO_WIDECHAR |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
695 | now = mvwinch(curscr, y, x); |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
696 | ch[0] = now & A_CHARTEXT; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
697 | now ^= ch[0]; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
698 | #else |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
699 | cchar_t wch; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
700 | char unicode[12]; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
701 | mvwin_wch(curscr, y, x, &wch); |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
702 | now = wch.attr; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
703 | ch[0] = (char)(wch.chars[0] & 0xff); |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
704 | #endif |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
705 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
706 | #define CHECK(attr, start, end) \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
707 | do \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
708 | { \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
709 | if (now & attr) \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
710 | { \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
711 | if (!(old & attr)) \ |
|
15258
ca95e4c752e8
[gaim-migrate @ 17985]
Mark Doliner <markdoliner@pidgin.im>
parents:
15219
diff
changeset
|
712 | fprintf(file, "%s", start); \ |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
713 | } \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
714 | else if (old & attr) \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
715 | { \ |
|
15258
ca95e4c752e8
[gaim-migrate @ 17985]
Mark Doliner <markdoliner@pidgin.im>
parents:
15219
diff
changeset
|
716 | fprintf(file, "%s", end); \ |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
717 | } \ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
718 | } while (0) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
719 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
720 | CHECK(A_BOLD, "<b>", "</b>"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
721 | CHECK(A_UNDERLINE, "<u>", "</u>"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
722 | CHECK(A_BLINK, "<blink>", "</blink>"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
723 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
724 | if ((now & A_COLOR) != (old & A_COLOR) || |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
725 | (now & A_REVERSE) != (old & A_REVERSE)) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
726 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
727 | int ret; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
728 | short fgp, bgp, r, g, b; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
729 | struct |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
730 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
731 | int r, g, b; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
732 | } fg, bg; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
733 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
734 | ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
735 | if (fgp == -1) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
736 | fgp = COLOR_BLACK; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
737 | if (bgp == -1) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
738 | bgp = COLOR_WHITE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
739 | if (now & A_REVERSE) |
|
17230
1442df274a24
Fix a compiler warning by using a temporary variable for swapping.
Richard Laager <rlaager@pidgin.im>
parents:
17181
diff
changeset
|
740 | { |
|
1442df274a24
Fix a compiler warning by using a temporary variable for swapping.
Richard Laager <rlaager@pidgin.im>
parents:
17181
diff
changeset
|
741 | short tmp = fgp; |
|
1442df274a24
Fix a compiler warning by using a temporary variable for swapping.
Richard Laager <rlaager@pidgin.im>
parents:
17181
diff
changeset
|
742 | fgp = bgp; |
|
1442df274a24
Fix a compiler warning by using a temporary variable for swapping.
Richard Laager <rlaager@pidgin.im>
parents:
17181
diff
changeset
|
743 | bgp = tmp; |
|
1442df274a24
Fix a compiler warning by using a temporary variable for swapping.
Richard Laager <rlaager@pidgin.im>
parents:
17181
diff
changeset
|
744 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
745 | ret = color_content(fgp, &r, &g, &b); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
746 | fg.r = r; fg.b = b; fg.g = g; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
747 | ret = color_content(bgp, &r, &g, &b); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
748 | bg.r = r; bg.b = b; bg.g = g; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
749 | #define ADJUST(x) (x = x * 255 / 1000) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
750 | ADJUST(fg.r); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
751 | ADJUST(fg.g); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
752 | ADJUST(fg.b); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
753 | ADJUST(bg.r); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
754 | ADJUST(bg.b); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
755 | ADJUST(bg.g); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
756 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
757 | if (x) fprintf(file, "</span>"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
758 | fprintf(file, "<span style=\"background:#%02x%02x%02x;color:#%02x%02x%02x\">", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
759 | bg.r, bg.g, bg.b, fg.r, fg.g, fg.b); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
760 | } |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
761 | print = ch; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
762 | #ifndef NO_WIDECHAR |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
763 | if (wch.chars[0] > 255) { |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
764 | snprintf(unicode, sizeof(unicode), "&#x%x;", wch.chars[0]); |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
765 | print = unicode; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
766 | } |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
767 | #endif |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
768 | if (now & A_ALTCHARSET) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
769 | { |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
770 | int u; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
771 | for (u = 0; unis[u].ascii; u++) { |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
772 | if (ch[0] == unis[u].ascii) { |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
773 | print = unis[u].unicode; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
774 | break; |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
775 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
776 | } |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
777 | if (!unis[u].ascii) |
|
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
778 | print = " "; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
779 | } |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
780 | if (ch[0] == '&') |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
781 | fprintf(file, "&"); |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
782 | else if (ch[0] == '<') |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
783 | fprintf(file, "<"); |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
784 | else if (ch[0] == '>') |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
785 | fprintf(file, ">"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
786 | else |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
787 | fprintf(file, "%s", print); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
788 | old = now; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
789 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
790 | fprintf(file, "</span>\n"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
791 | old = 0; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
792 | } |
|
17181
cc871788e3f8
Generate nicer HTML dumps.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17094
diff
changeset
|
793 | fprintf(file, "</pre>\n</body>"); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
794 | fclose(file); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
795 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
796 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
797 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
798 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
799 | shift_window(GntWM *wm, GntWidget *widget, int dir) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
800 | { |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
801 | GList *all = wm->cws->list; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
802 | GList *list = g_list_find(all, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
803 | int length, pos; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
804 | if (!list) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
805 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
806 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
807 | length = g_list_length(all); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
808 | pos = g_list_position(all, list); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
809 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
810 | pos += dir; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
811 | if (dir > 0) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
812 | pos++; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
813 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
814 | if (pos < 0) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
815 | pos = length; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
816 | else if (pos > length) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
817 | pos = 0; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
818 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
819 | all = g_list_insert(all, widget, pos); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
820 | all = g_list_delete_link(all, list); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
821 | wm->cws->list = all; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
822 | gnt_ws_draw_taskbar(wm->cws, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
823 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
824 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
825 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
826 | shift_left(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
827 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
828 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
829 | if (wm->_list.window) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
830 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
831 | |
|
18756
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
832 | if(!wm->cws->ordered) |
|
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
833 | return FALSE; |
|
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
834 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
835 | shift_window(wm, wm->cws->ordered->data, -1); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
836 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
837 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
838 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
839 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
840 | shift_right(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
841 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
842 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
843 | if (wm->_list.window) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
844 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
845 | |
|
18756
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
846 | if(!wm->cws->ordered) |
|
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
847 | return FALSE; |
|
5498c1e29cca
Crash fixes from Eric Polino.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18638
diff
changeset
|
848 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
849 | shift_window(wm, wm->cws->ordered->data, 1); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
850 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
851 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
852 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
853 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
854 | action_list_activate(GntTree *tree, GntWM *wm) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
855 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
856 | GntAction *action = gnt_tree_get_selection_data(tree); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
857 | action->callback(); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
858 | gnt_widget_destroy(wm->_list.window); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
859 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
860 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
861 | static int |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
862 | compare_action(gconstpointer p1, gconstpointer p2) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
863 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
864 | const GntAction *a1 = p1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
865 | const GntAction *a2 = p2; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
866 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
867 | return g_utf8_collate(a1->label, a2->label); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
868 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
869 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
870 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
871 | list_actions(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
872 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
873 | GntWidget *tree, *win; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
874 | GList *iter; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
875 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
876 | if (wm->_list.window || wm->menu) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
877 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
878 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
879 | if (wm->acts == NULL) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
880 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
881 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
882 | setup__list(wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
883 | wm->actions = &wm->_list; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
884 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
885 | win = wm->actions->window; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
886 | tree = wm->actions->tree; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
887 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
888 | gnt_box_set_title(GNT_BOX(win), "Actions"); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
889 | GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
890 | /* XXX: Do we really want this? */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
891 | gnt_tree_set_compare_func(GNT_TREE(tree), compare_action); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
892 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
893 | for (iter = wm->acts; iter; iter = iter->next) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
894 | GntAction *action = iter->data; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
895 | gnt_tree_add_row_last(GNT_TREE(tree), action, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
896 | gnt_tree_create_row(GNT_TREE(tree), action->label), NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
897 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
898 | g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(action_list_activate), wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
899 | gnt_widget_set_size(tree, 0, g_list_length(wm->acts)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
900 | gnt_widget_set_position(win, 0, getmaxy(stdscr) - 3 - g_list_length(wm->acts)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
901 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
902 | gnt_widget_show(win); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
903 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
904 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
905 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
906 | #ifndef NO_WIDECHAR |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
907 | static int |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
908 | widestringwidth(wchar_t *wide) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
909 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
910 | int len, ret; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
911 | char *string; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
912 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
913 | len = wcstombs(NULL, wide, 0) + 1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
914 | string = g_new0(char, len); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
915 | wcstombs(string, wide, len); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
916 | ret = gnt_util_onscreen_width(string, NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
917 | g_free(string); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
918 | return ret; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
919 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
920 | #endif |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
921 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
922 | /* Returns the onscreen width of the character at the position */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
923 | static int |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
924 | reverse_char(WINDOW *d, int y, int x, gboolean set) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
925 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
926 | #define DECIDE(ch) (set ? ((ch) | A_REVERSE) : ((ch) & ~A_REVERSE)) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
927 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
928 | #ifdef NO_WIDECHAR |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
929 | chtype ch; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
930 | ch = mvwinch(d, y, x); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
931 | mvwaddch(d, y, x, DECIDE(ch)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
932 | return 1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
933 | #else |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
934 | cchar_t ch; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
935 | int wc = 1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
936 | if (mvwin_wch(d, y, x, &ch) == OK) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
937 | wc = widestringwidth(ch.chars); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
938 | ch.attr = DECIDE(ch.attr); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
939 | ch.attr &= WA_ATTRIBUTES; /* XXX: This is a workaround for a bug */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
940 | mvwadd_wch(d, y, x, &ch); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
941 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
942 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
943 | return wc; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
944 | #endif |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
945 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
946 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
947 | static void |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
948 | window_reverse(GntWidget *win, gboolean set, GntWM *wm) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
949 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
950 | int i; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
951 | int w, h; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
952 | WINDOW *d; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
953 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
954 | if (GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_NO_BORDER)) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
955 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
956 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
957 | d = win->window; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
958 | gnt_widget_get_size(win, &w, &h); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
959 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
960 | if (gnt_widget_has_shadow(win)) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
961 | --w; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
962 | --h; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
963 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
964 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
965 | /* the top and bottom */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
966 | for (i = 0; i < w; i += reverse_char(d, 0, i, set)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
967 | for (i = 0; i < w; i += reverse_char(d, h-1, i, set)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
968 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
969 | /* the left and right */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
970 | for (i = 0; i < h; i += reverse_char(d, i, 0, set)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
971 | for (i = 0; i < h; i += reverse_char(d, i, w-1, set)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
972 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
973 | gnt_wm_copy_win(win, g_hash_table_lookup(wm->nodes, win)); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
974 | update_screen(wm); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
975 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
976 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
977 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
978 | start_move(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
979 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
980 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
981 | if (wm->_list.window || wm->menu) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
982 | return TRUE; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
983 | if (!wm->cws->ordered) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
984 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
985 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
986 | wm->mode = GNT_KP_MODE_MOVE; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
987 | window_reverse(GNT_WIDGET(wm->cws->ordered->data), TRUE, wm); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
988 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
989 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
990 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
991 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
992 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
993 | start_resize(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
994 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
995 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
996 | if (wm->_list.window || wm->menu) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
997 | return TRUE; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
998 | if (!wm->cws->ordered) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
999 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1000 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1001 | wm->mode = GNT_KP_MODE_RESIZE; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1002 | window_reverse(GNT_WIDGET(wm->cws->ordered->data), TRUE, wm); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1003 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1004 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1005 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1006 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1007 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1008 | wm_quit(GntBindable *bindable, GList *list) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1009 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1010 | GntWM *wm = GNT_WM(bindable); |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1011 | if (write_timeout) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1012 | write_already(wm); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1013 | g_main_loop_quit(wm->loop); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1014 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1015 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1016 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1017 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1018 | return_true(GntWM *wm, GntWidget *w, int *a, int *b) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1019 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1020 | return TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1021 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1022 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1023 | static gboolean |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1024 | refresh_screen(GntBindable *bindable, GList *null) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1025 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1026 | GntWM *wm = GNT_WM(bindable); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1027 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1028 | endwin(); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1029 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1030 | g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL); |
|
18420
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1031 | refresh(); |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1032 | g_signal_emit(wm, signals[SIG_TERMINAL_REFRESH], 0); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1033 | update_screen(wm); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1034 | gnt_ws_draw_taskbar(wm->cws, TRUE); |
|
18139
6f8ce11e928a
This got lost from a merge I think. This refixes #532.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18137
diff
changeset
|
1035 | curs_set(0); /* endwin resets the cursor to normal */ |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1036 | |
|
18600
4645484d0776
The key has been processed. Return TRUE.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18599
diff
changeset
|
1037 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1038 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1039 | |
|
16584
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1040 | static gboolean |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1041 | toggle_clipboard(GntBindable *bindable, GList *n) |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1042 | { |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1043 | static GntWidget *clip; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1044 | gchar *text; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1045 | int maxx, maxy; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1046 | if (clip) { |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1047 | gnt_widget_destroy(clip); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1048 | clip = NULL; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1049 | return TRUE; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1050 | } |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1051 | getmaxyx(stdscr, maxy, maxx); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1052 | text = gnt_get_clipboard_string(); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1053 | clip = gnt_hwindow_new(FALSE); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1054 | GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1055 | GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1056 | gnt_box_set_pad(GNT_BOX(clip), 0); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1057 | gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1058 | gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text)); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1059 | gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1060 | gnt_widget_set_position(clip, 0, 0); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1061 | gnt_widget_draw(clip); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1062 | g_free(text); |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1063 | return TRUE; |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1064 | } |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1065 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1066 | static void remove_tag(gpointer wid, gpointer wim) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1067 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1068 | GntWM *wm = GNT_WM(wim); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1069 | GntWidget *w = GNT_WIDGET(wid); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1070 | wm->tagged = g_list_remove(wm->tagged, w); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1071 | mvwhline(w->window, 0, 1, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), 3); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1072 | gnt_widget_draw(w); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1073 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1074 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1075 | static gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1076 | tag_widget(GntBindable *b, GList *params) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1077 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1078 | GntWM *wm = GNT_WM(b); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1079 | GntWidget *widget; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1080 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1081 | if (!wm->cws->ordered) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1082 | return FALSE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1083 | widget = wm->cws->ordered->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1084 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1085 | if (g_list_find(wm->tagged, widget)) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1086 | remove_tag(widget, wm); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1087 | return TRUE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1088 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1089 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1090 | wm->tagged = g_list_prepend(wm->tagged, widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1091 | wbkgdset(widget->window, ' ' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1092 | mvwprintw(widget->window, 0, 1, "[T]"); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1093 | gnt_widget_draw(widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1094 | return TRUE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1095 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1096 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1097 | static void |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1098 | widget_move_ws(gpointer wid, gpointer w) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1099 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1100 | GntWM *wm = GNT_WM(w); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1101 | gnt_wm_widget_move_workspace(wm, wm->cws, GNT_WIDGET(wid)); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1102 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1103 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1104 | static gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1105 | place_tagged(GntBindable *b, GList *params) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1106 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1107 | GntWM *wm = GNT_WM(b); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1108 | g_list_foreach(wm->tagged, widget_move_ws, wm); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1109 | g_list_foreach(wm->tagged, remove_tag, wm); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1110 | g_list_free(wm->tagged); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1111 | wm->tagged = NULL; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1112 | return TRUE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1113 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1114 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1115 | static gboolean |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1116 | workspace_list(GntBindable *b, GList *params) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1117 | { |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1118 | GntWM *wm = GNT_WM(b); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1119 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1120 | if (wm->_list.window || wm->menu) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1121 | return TRUE; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1122 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1123 | list_of_windows(wm, TRUE); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1124 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1125 | return TRUE; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1126 | } |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1127 | |
|
18137
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1128 | static gboolean |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1129 | workspace_new(GntBindable *bindable, GList *null) |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1130 | { |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1131 | GntWM *wm = GNT_WM(bindable); |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1132 | GntWS *ws = gnt_ws_new(NULL); |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1133 | gnt_wm_add_workspace(wm, ws); |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1134 | gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1135 | return TRUE; |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1136 | } |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1137 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1138 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1139 | gnt_wm_class_init(GntWMClass *klass) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1140 | { |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1141 | int i; |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1142 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1143 | klass->new_window = gnt_wm_new_window_real; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1144 | klass->decorate_window = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1145 | klass->close_window = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1146 | klass->window_resize_confirm = return_true; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1147 | klass->window_resized = gnt_wm_win_resized; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1148 | klass->window_move_confirm = return_true; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1149 | klass->window_moved = gnt_wm_win_moved; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1150 | klass->window_update = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1151 | klass->key_pressed = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1152 | klass->mouse_clicked = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1153 | klass->give_focus = gnt_wm_give_focus; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1154 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1155 | signals[SIG_NEW_WIN] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1156 | g_signal_new("new_win", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1157 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1158 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1159 | G_STRUCT_OFFSET(GntWMClass, new_window), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1160 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1161 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1162 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1163 | signals[SIG_DECORATE_WIN] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1164 | g_signal_new("decorate_win", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1165 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1166 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1167 | G_STRUCT_OFFSET(GntWMClass, decorate_window), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1168 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1169 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1170 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1171 | signals[SIG_CLOSE_WIN] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1172 | g_signal_new("close_win", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1173 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1174 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1175 | G_STRUCT_OFFSET(GntWMClass, close_window), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1176 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1177 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1178 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1179 | signals[SIG_CONFIRM_RESIZE] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1180 | g_signal_new("confirm_resize", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1181 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1182 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1183 | G_STRUCT_OFFSET(GntWMClass, window_resize_confirm), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1184 | gnt_boolean_handled_accumulator, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1185 | gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1186 | G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1187 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1188 | signals[SIG_CONFIRM_MOVE] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1189 | g_signal_new("confirm_move", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1190 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1191 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1192 | G_STRUCT_OFFSET(GntWMClass, window_move_confirm), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1193 | gnt_boolean_handled_accumulator, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1194 | gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1195 | G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1196 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1197 | signals[SIG_RESIZED] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1198 | g_signal_new("window_resized", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1199 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1200 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1201 | G_STRUCT_OFFSET(GntWMClass, window_resized), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1202 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1203 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1204 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1205 | signals[SIG_MOVED] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1206 | g_signal_new("window_moved", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1207 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1208 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1209 | G_STRUCT_OFFSET(GntWMClass, window_moved), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1210 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1211 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1212 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1213 | signals[SIG_UPDATE_WIN] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1214 | g_signal_new("window_update", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1215 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1216 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1217 | G_STRUCT_OFFSET(GntWMClass, window_update), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1218 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1219 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1220 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1221 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1222 | signals[SIG_GIVE_FOCUS] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1223 | g_signal_new("give_focus", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1224 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1225 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1226 | G_STRUCT_OFFSET(GntWMClass, give_focus), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1227 | NULL, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1228 | g_cclosure_marshal_VOID__POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1229 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1230 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1231 | signals[SIG_MOUSE_CLICK] = |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1232 | g_signal_new("mouse_clicked", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1233 | G_TYPE_FROM_CLASS(klass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1234 | G_SIGNAL_RUN_LAST, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1235 | G_STRUCT_OFFSET(GntWMClass, mouse_clicked), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1236 | gnt_boolean_handled_accumulator, NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1237 | gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1238 | G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1239 | |
|
18420
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1240 | signals[SIG_TERMINAL_REFRESH] = |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1241 | g_signal_new("terminal-refresh", |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1242 | G_TYPE_FROM_CLASS(klass), |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1243 | G_SIGNAL_RUN_LAST, |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1244 | G_STRUCT_OFFSET(GntWMClass, terminal_refresh), |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1245 | NULL, NULL, |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1246 | g_cclosure_marshal_VOID__VOID, |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1247 | G_TYPE_NONE, 0); |
|
fd3ec9457e27
Add a callback that gets triggered by SIGWINCH.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18308
diff
changeset
|
1248 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1249 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-next", window_next, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1250 | "\033" "n", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1251 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-prev", window_prev, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1252 | "\033" "p", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1253 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-close", window_close, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1254 | "\033" "c", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1255 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-list", window_list, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1256 | "\033" "w", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1257 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "dump-screen", dump_screen, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1258 | "\033" "d", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1259 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-left", shift_left, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1260 | "\033" ",", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1261 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-right", shift_right, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1262 | "\033" ".", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1263 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "action-list", list_actions, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1264 | "\033" "a", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1265 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "start-move", start_move, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1266 | "\033" "m", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1267 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "start-resize", start_resize, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1268 | "\033" "r", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1269 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "wm-quit", wm_quit, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1270 | "\033" "q", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1271 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "refresh-screen", refresh_screen, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1272 | "\033" "l", NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1273 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "switch-window-n", switch_window_n, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1274 | NULL, NULL); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1275 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-scroll-down", window_scroll_down, |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1276 | "\033" GNT_KEY_CTRL_J, NULL); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1277 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-scroll-up", window_scroll_up, |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1278 | "\033" GNT_KEY_CTRL_K, NULL); |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
1279 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "help-for-widget", help_for_widget, |
|
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
1280 | "\033" "/", NULL); |
|
18137
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1281 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-new", workspace_new, |
|
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1282 | GNT_KEY_F9, NULL); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1283 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-next", workspace_next, |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1284 | "\033" ">", NULL); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1285 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-prev", workspace_prev, |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1286 | "\033" "<", NULL); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1287 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-tag", tag_widget, |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1288 | "\033" "t", NULL); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1289 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "place-tagged", place_tagged, |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1290 | "\033" "T", NULL); |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1291 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-list", workspace_list, |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1292 | "\033" "s", NULL); |
|
16584
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1293 | gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-clipboard", |
|
4da6c97082c9
Move the toggle-clipboard operation to the default wm.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16356
diff
changeset
|
1294 | toggle_clipboard, "\033" "C", NULL); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1295 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1296 | gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1297 | |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1298 | /* Make sure Alt+x are detected properly. */ |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1299 | for (i = '0'; i <= '9'; i++) { |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1300 | char str[] = "\033X"; |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1301 | str[1] = i; |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1302 | gnt_keys_add_combination(str); |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1303 | } |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1304 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1305 | GNTDEBUG; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1306 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1307 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1308 | /****************************************************************************** |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1309 | * GntWM API |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1310 | *****************************************************************************/ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1311 | GType |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1312 | gnt_wm_get_gtype(void) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1313 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1314 | static GType type = 0; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1315 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1316 | if(type == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1317 | static const GTypeInfo info = { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1318 | sizeof(GntWMClass), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1319 | NULL, /* base_init */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1320 | NULL, /* base_finalize */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1321 | (GClassInitFunc)gnt_wm_class_init, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1322 | NULL, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1323 | NULL, /* class_data */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1324 | sizeof(GntWM), |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1325 | 0, /* n_preallocs */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1326 | gnt_wm_init, /* instance_init */ |
|
15874
46df7421a1b5
Enable DEBUG_CFLAGS in libgnt and fix up a number of compile warnings and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15863
diff
changeset
|
1327 | NULL /* value_table */ |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1328 | }; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1329 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1330 | type = g_type_register_static(GNT_TYPE_BINDABLE, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1331 | "GntWM", |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1332 | &info, 0); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1333 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1334 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1335 | return type; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1336 | } |
|
18137
a8c54ed05eee
F9 to create a new workspace.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18133
diff
changeset
|
1337 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1338 | void |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1339 | gnt_wm_add_workspace(GntWM *wm, GntWS *ws) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1340 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1341 | wm->workspaces = g_list_append(wm->workspaces, ws); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1342 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1343 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1344 | gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1345 | gnt_wm_switch_workspace(GntWM *wm, gint n) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1346 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1347 | GntWS *s = g_list_nth_data(wm->workspaces, n); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1348 | if (!s) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1349 | return FALSE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1350 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1351 | if (wm->_list.window) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1352 | gnt_widget_destroy(wm->_list.window); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1353 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1354 | gnt_ws_hide(wm->cws, wm->nodes); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1355 | wm->cws = s; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1356 | gnt_ws_show(wm->cws, wm->nodes); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1357 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1358 | gnt_ws_draw_taskbar(wm->cws, TRUE); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1359 | update_screen(wm); |
|
16524
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1360 | if (wm->cws->ordered) { |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1361 | gnt_wm_raise_window(wm, wm->cws->ordered->data); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1362 | } |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1363 | |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1364 | if (act && g_list_find(act, wm->cws)) { |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1365 | act = g_list_remove(act, wm->cws); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1366 | update_act_msg(); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1367 | } |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1368 | return TRUE; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1369 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1370 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1371 | gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1372 | gnt_wm_switch_workspace_prev(GntWM *wm) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1373 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1374 | int n = g_list_index(wm->workspaces, wm->cws); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1375 | return gnt_wm_switch_workspace(wm, --n); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1376 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1377 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1378 | gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1379 | gnt_wm_switch_workspace_next(GntWM *wm) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1380 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1381 | int n = g_list_index(wm->workspaces, wm->cws); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1382 | return gnt_wm_switch_workspace(wm, ++n); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1383 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1384 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1385 | static gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1386 | workspace_next(GntBindable *wm, GList *n) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1387 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1388 | return gnt_wm_switch_workspace_next(GNT_WM(wm)); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1389 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1390 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1391 | static gboolean |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1392 | workspace_prev(GntBindable *wm, GList *n) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1393 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1394 | return gnt_wm_switch_workspace_prev(GNT_WM(wm)); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1395 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1396 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1397 | void |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1398 | gnt_wm_widget_move_workspace(GntWM *wm, GntWS *neww, GntWidget *widget) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1399 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1400 | GntWS *oldw = gnt_wm_widget_find_workspace(wm, widget); |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1401 | GntNode *node; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1402 | if (!oldw || oldw == neww) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1403 | return; |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1404 | node = g_hash_table_lookup(wm->nodes, widget); |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1405 | if (node && node->ws == neww) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1406 | return; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1407 | |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1408 | if (node) |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1409 | node->ws = neww; |
|
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1410 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1411 | gnt_ws_remove_widget(oldw, widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1412 | gnt_ws_add_widget(neww, widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1413 | if (neww == wm->cws) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1414 | gnt_ws_widget_show(widget, wm->nodes); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1415 | } else { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1416 | gnt_ws_widget_hide(widget, wm->nodes); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1417 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1418 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1419 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1420 | static gint widget_in_workspace(gconstpointer workspace, gconstpointer wid) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1421 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1422 | GntWS *s = (GntWS *)workspace; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1423 | if (s->list && g_list_find(s->list, wid)) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1424 | return 0; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1425 | return 1; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1426 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1427 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1428 | GntWS *gnt_wm_widget_find_workspace(GntWM *wm, GntWidget *widget) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1429 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1430 | GList *l = g_list_find_custom(wm->workspaces, widget, widget_in_workspace); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1431 | if (l) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1432 | return l->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1433 | return NULL; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1434 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1435 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1436 | static void free_workspaces(gpointer data, gpointer n) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1437 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1438 | GntWS *s = data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1439 | g_free(s->name); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1440 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1441 | |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1442 | void gnt_wm_set_workspaces(GntWM *wm, GList *workspaces) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1443 | { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1444 | g_list_foreach(wm->workspaces, free_workspaces, NULL); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1445 | wm->workspaces = workspaces; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1446 | gnt_wm_switch_workspace(wm, 0); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1447 | } |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1448 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1449 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1450 | update_window_in_list(GntWM *wm, GntWidget *wid) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1451 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1452 | GntTextFormatFlags flag = 0; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1453 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1454 | if (wm->windows == NULL) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1455 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1456 | |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1457 | if (wm->cws->ordered && wid == wm->cws->ordered->data) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1458 | flag |= GNT_TEXT_FLAG_DIM; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1459 | else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1460 | flag |= GNT_TEXT_FLAG_BOLD; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1461 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1462 | gnt_tree_set_row_flags(GNT_TREE(wm->windows->tree), wid, flag); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1463 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1464 | |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1465 | static gboolean |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1466 | match_title(gpointer title, gpointer n, gpointer wid_title) |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1467 | { |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1468 | /* XXX: do any regex magic here. */ |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1469 | if (g_strrstr((gchar *)wid_title, (gchar *)title)) |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1470 | return TRUE; |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1471 | return FALSE; |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1472 | } |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1473 | |
|
18279
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1474 | #if !GLIB_CHECK_VERSION(2,4,0) |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1475 | struct |
|
18279
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1476 | { |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1477 | gpointer data; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1478 | gpointer value; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1479 | } table_find_data; |
|
18279
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1480 | |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1481 | static void |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1482 | table_find_helper(gpointer key, gpointer value, gpointer data) |
|
18279
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1483 | { |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1484 | GHRFunc func = data; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1485 | if (func(key, value, table_find_data.data)) |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1486 | table_find_data.value = value; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1487 | } |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1488 | |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1489 | static gpointer |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1490 | g_hash_table_find(GHashTable * table, GHRFunc func, gpointer data) |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1491 | { |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1492 | table_find_data.data = data; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1493 | table_find_data.value = NULL; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1494 | g_hash_table_foreach(table, table_find_helper, func); |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1495 | return table_find_data.value; |
|
18279
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1496 | } |
|
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1497 | #endif |
|
d6e07df7a58e
g_hash_table_find is glib 2.4
Richard Nelson <wabz@pidgin.im>
parents:
18170
diff
changeset
|
1498 | |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1499 | static GntWS * |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1500 | new_widget_find_workspace(GntWM *wm, GntWidget *widget) |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1501 | { |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1502 | GntWS *ret = NULL; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1503 | const gchar *name, *title; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1504 | title = GNT_BOX(widget)->title; |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1505 | if (title) |
|
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1506 | ret = g_hash_table_find(wm->title_places, match_title, (gpointer)title); |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1507 | if (ret) |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1508 | return ret; |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1509 | name = gnt_widget_get_name(widget); |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1510 | if (name) |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1511 | ret = g_hash_table_find(wm->name_places, match_title, (gpointer)name); |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1512 | return ret ? ret : wm->cws; |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1513 | } |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1514 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1515 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1516 | gnt_wm_new_window_real(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1517 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1518 | GntNode *node; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1519 | gboolean transient = FALSE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1520 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1521 | if (widget->window == NULL) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1522 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1523 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1524 | node = g_new0(GntNode, 1); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1525 | node->me = widget; |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1526 | node->scroll = 0; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1527 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1528 | g_hash_table_replace(wm->nodes, widget, node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1529 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1530 | refresh_node(widget, node, NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1531 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1532 | transient = !!GNT_WIDGET_IS_FLAG_SET(node->me, GNT_WIDGET_TRANSIENT); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1533 | |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1534 | #if 1 |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1535 | { |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1536 | int x, y, w, h, maxx, maxy; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1537 | gboolean shadow = TRUE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1538 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1539 | if (!gnt_widget_has_shadow(widget)) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1540 | shadow = FALSE; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1541 | x = widget->priv.x; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1542 | y = widget->priv.y; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1543 | w = widget->priv.width; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1544 | h = widget->priv.height; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1545 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1546 | getmaxyx(stdscr, maxy, maxx); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1547 | maxy -= 1; /* room for the taskbar */ |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1548 | maxy -= shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1549 | maxx -= shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1550 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1551 | x = MAX(0, x); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1552 | y = MAX(0, y); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1553 | if (x + w >= maxx) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1554 | x = MAX(0, maxx - w); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1555 | if (y + h >= maxy) |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1556 | y = MAX(0, maxy - h); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1557 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1558 | w = MIN(w, maxx); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1559 | h = MIN(h, maxy); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1560 | node->window = newwin(h + shadow, w + shadow, y, x); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1561 | gnt_wm_copy_win(widget, node); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1562 | } |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1563 | #endif |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1564 | |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1565 | node->panel = new_panel(node->window); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1566 | set_panel_userptr(node->panel, node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1567 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1568 | if (!transient) { |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1569 | GntWS *ws = wm->cws; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1570 | if (node->me != wm->_list.window) { |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1571 | if (GNT_IS_BOX(widget)) { |
|
18308
3424730fd9e5
Plucked revision from finchfeat to allow partial matching for window-titles
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18279
diff
changeset
|
1572 | ws = new_widget_find_workspace(wm, widget); |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1573 | } |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1574 | node->ws = ws; |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1575 | ws->list = g_list_append(ws->list, widget); |
|
18596
02e5ec52243c
Some more focus fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18567
diff
changeset
|
1576 | ws->ordered = g_list_append(ws->ordered, widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1577 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1578 | |
|
18567
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1579 | if (wm->event_stack || node->me == wm->_list.window || |
|
18596
02e5ec52243c
Some more focus fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18567
diff
changeset
|
1580 | node->me == ws->ordered->data) { |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1581 | gnt_wm_raise_window(wm, node->me); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1582 | } else { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1583 | bottom_panel(node->panel); /* New windows should not grab focus */ |
|
18170
477cfc0d7254
Notify a window on startup if it didn't get the focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18139
diff
changeset
|
1584 | gnt_widget_set_focus(node->me, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1585 | gnt_widget_set_urgent(node->me); |
|
16525
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1586 | if (wm->cws != ws) |
|
6e207d99ffd9
New windows can be placed on specific workspaces. They can be specified by the window name (e.g. conversation-window), or a substring in the window title. Title takes precedence.
Richard Nelson <wabz@pidgin.im>
parents:
16524
diff
changeset
|
1587 | gnt_ws_widget_hide(widget, wm->nodes); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1588 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1589 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1590 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1591 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1592 | void gnt_wm_new_window(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1593 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1594 | while (widget->parent) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1595 | widget = widget->parent; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1596 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1597 | if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_INVISIBLE) || |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1598 | g_hash_table_lookup(wm->nodes, widget)) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1599 | update_screen(wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1600 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1601 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1602 | |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1603 | if (GNT_IS_BOX(widget)) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1604 | const char *title = GNT_BOX(widget)->title; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1605 | GntPosition *p = NULL; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1606 | if (title && (p = g_hash_table_lookup(wm->positions, title)) != NULL) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1607 | sanitize_position(widget, &p->x, &p->y); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1608 | gnt_widget_set_position(widget, p->x, p->y); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1609 | mvwin(widget->window, p->y, p->x); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1610 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1611 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1612 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1613 | g_signal_emit(wm, signals[SIG_NEW_WIN], 0, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1614 | g_signal_emit(wm, signals[SIG_DECORATE_WIN], 0, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1615 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1616 | if (wm->windows && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1617 | if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && wm->_list.window != widget |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1618 | && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1619 | gnt_tree_add_row_last(GNT_TREE(wm->windows->tree), widget, |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1620 | gnt_tree_create_row(GNT_TREE(wm->windows->tree), GNT_BOX(widget)->title), |
|
16523
d774ca89d340
Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16519
diff
changeset
|
1621 | g_object_get_data(G_OBJECT(wm->windows->tree), "workspace") ? wm->cws : NULL); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1622 | update_window_in_list(wm, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1623 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1624 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1625 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1626 | update_screen(wm); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1627 | gnt_ws_draw_taskbar(wm->cws, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1628 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1629 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1630 | void gnt_wm_window_decorate(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1631 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1632 | g_signal_emit(wm, signals[SIG_DECORATE_WIN], 0, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1633 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1634 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1635 | void gnt_wm_window_close(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1636 | { |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1637 | GntWS *s; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1638 | GntNode *node; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1639 | int pos; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1640 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1641 | s = gnt_wm_widget_find_workspace(wm, widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1642 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1643 | if ((node = g_hash_table_lookup(wm->nodes, widget)) == NULL) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1644 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1645 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1646 | g_signal_emit(wm, signals[SIG_CLOSE_WIN], 0, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1647 | g_hash_table_remove(wm->nodes, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1648 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1649 | if (wm->windows) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1650 | gnt_tree_remove(GNT_TREE(wm->windows->tree), widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1651 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1652 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1653 | if (s) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1654 | pos = g_list_index(s->list, widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1655 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1656 | if (pos != -1) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1657 | s->list = g_list_remove(s->list, widget); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1658 | s->ordered = g_list_remove(s->ordered, widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1659 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1660 | if (s->ordered && wm->cws == s) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1661 | gnt_wm_raise_window(wm, s->ordered->data); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1662 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1663 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1664 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1665 | update_screen(wm); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1666 | gnt_ws_draw_taskbar(wm->cws, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1667 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1668 | |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1669 | time_t gnt_wm_get_idle_time() |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1670 | { |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1671 | return time(NULL) - last_active_time; |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1672 | } |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1673 | |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1674 | gboolean gnt_wm_process_input(GntWM *wm, const char *keys) |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1675 | { |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1676 | gboolean ret = FALSE; |
|
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1677 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1678 | keys = gnt_bindable_remap_keys(GNT_BINDABLE(wm), keys); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1679 | |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1680 | idle_update = TRUE; |
|
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1681 | |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
1682 | if (gnt_bindable_perform_action_key(GNT_BINDABLE(wm), keys)) { |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1683 | return TRUE; |
|
16188
2c7ee371f005
alt-/ to get a list of keybindings for the focused widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16056
diff
changeset
|
1684 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1685 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1686 | /* Do some manual checking */ |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1687 | if (wm->cws->ordered && wm->mode != GNT_KP_MODE_NORMAL) { |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1688 | int xmin = 0, ymin = 0, xmax = getmaxx(stdscr), ymax = getmaxy(stdscr) - 1; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1689 | int x, y, w, h; |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1690 | GntWidget *widget = GNT_WIDGET(wm->cws->ordered->data); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1691 | int ox, oy, ow, oh; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1692 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1693 | gnt_widget_get_position(widget, &x, &y); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1694 | gnt_widget_get_size(widget, &w, &h); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1695 | ox = x; oy = y; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1696 | ow = w; oh = h; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1697 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1698 | if (wm->mode == GNT_KP_MODE_MOVE) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1699 | if (strcmp(keys, GNT_KEY_LEFT) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1700 | if (x > xmin) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1701 | x--; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1702 | } else if (strcmp(keys, GNT_KEY_RIGHT) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1703 | if (x + w < xmax) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1704 | x++; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1705 | } else if (strcmp(keys, GNT_KEY_UP) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1706 | if (y > ymin) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1707 | y--; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1708 | } else if (strcmp(keys, GNT_KEY_DOWN) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1709 | if (y + h < ymax) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1710 | y++; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1711 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1712 | if (ox != x || oy != y) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1713 | gnt_screen_move_widget(widget, x, y); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1714 | window_reverse(widget, TRUE, wm); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1715 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1716 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1717 | } else if (wm->mode == GNT_KP_MODE_RESIZE) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1718 | if (strcmp(keys, GNT_KEY_LEFT) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1719 | w--; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1720 | } else if (strcmp(keys, GNT_KEY_RIGHT) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1721 | if (x + w < xmax) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1722 | w++; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1723 | } else if (strcmp(keys, GNT_KEY_UP) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1724 | h--; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1725 | } else if (strcmp(keys, GNT_KEY_DOWN) == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1726 | if (y + h < ymax) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1727 | h++; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1728 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1729 | if (oh != h || ow != w) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1730 | gnt_screen_resize_widget(widget, w, h); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1731 | window_reverse(widget, TRUE, wm); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1732 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1733 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1734 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1735 | if (strcmp(keys, "\r") == 0 || strcmp(keys, "\033") == 0) { |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1736 | window_reverse(widget, FALSE, wm); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1737 | wm->mode = GNT_KP_MODE_NORMAL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1738 | } |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1739 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1740 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1741 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1742 | /* Escape to close the window-list or action-list window */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1743 | if (strcmp(keys, "\033") == 0) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1744 | if (wm->_list.window) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1745 | gnt_widget_destroy(wm->_list.window); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1746 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1747 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1748 | } else if (keys[0] == '\033' && isdigit(keys[1]) && keys[2] == '\0') { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1749 | /* Alt+x for quick switch */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1750 | int n = *(keys + 1) - '0'; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1751 | GList *list = NULL; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1752 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1753 | if (n == 0) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1754 | n = 10; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1755 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1756 | list = g_list_append(list, GINT_TO_POINTER(n - 1)); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1757 | switch_window_n(GNT_BINDABLE(wm), list); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1758 | g_list_free(list); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1759 | return TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1760 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1761 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1762 | if (wm->menu) |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1763 | ret = gnt_widget_key_pressed(GNT_WIDGET(wm->menu), keys); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1764 | else if (wm->_list.window) |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1765 | ret = gnt_widget_key_pressed(wm->_list.window, keys); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1766 | else if (wm->cws->ordered) |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1767 | ret = gnt_widget_key_pressed(GNT_WIDGET(wm->cws->ordered->data), keys); |
|
15839
e2b7b5f4f9aa
Change a bit how the keystrokes are processed. When a lot of keystrokes come in at the same time, the shortest key-combination is processed first. This should make typing fast over a very slow connection work properly.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15838
diff
changeset
|
1768 | return ret; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1769 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1770 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1771 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1772 | gnt_wm_win_resized(GntWM *wm, GntNode *node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1773 | { |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1774 | /*refresh_node(node->me, node, NULL);*/ |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1775 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1776 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1777 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1778 | gnt_wm_win_moved(GntWM *wm, GntNode *node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1779 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1780 | refresh_node(node->me, node, NULL); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1781 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1782 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1783 | void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1784 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1785 | gboolean ret = TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1786 | GntNode *node; |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1787 | int shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1788 | int maxx, maxy; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1789 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1790 | while (widget->parent) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1791 | widget = widget->parent; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1792 | node = g_hash_table_lookup(wm->nodes, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1793 | if (!node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1794 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1795 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1796 | g_signal_emit(wm, signals[SIG_CONFIRM_RESIZE], 0, widget, &width, &height, &ret); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1797 | if (!ret) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1798 | return; /* resize is not permitted */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1799 | hide_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1800 | gnt_widget_set_size(widget, width, height); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1801 | gnt_widget_draw(widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1802 | |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1803 | shadow = gnt_widget_has_shadow(widget) ? 1 : 0; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1804 | maxx = getmaxx(stdscr) - shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1805 | maxy = getmaxy(stdscr) - 1 - shadow; |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1806 | height = MIN(height, maxy); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1807 | width = MIN(width, maxx); |
|
16039
463477dade33
More fixes for resizing when shadow is turned on.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16025
diff
changeset
|
1808 | wresize(node->window, height, width); |
|
15804
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1809 | replace_panel(node->panel, node->window); |
|
a06705e0130e
Better handle large windows that don't fit into the screen (eg. the preference
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15802
diff
changeset
|
1810 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1811 | g_signal_emit(wm, signals[SIG_RESIZED], 0, node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1812 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1813 | show_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1814 | update_screen(wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1815 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1816 | |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1817 | static void |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1818 | write_gdi(gpointer key, gpointer value, gpointer data) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1819 | { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1820 | GntPosition *p = value; |
|
15874
46df7421a1b5
Enable DEBUG_CFLAGS in libgnt and fix up a number of compile warnings and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15863
diff
changeset
|
1821 | fprintf(data, ".%s = %d;%d\n", (char *)key, p->x, p->y); |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1822 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1823 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1824 | static gboolean |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1825 | write_already(gpointer data) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1826 | { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1827 | GntWM *wm = data; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1828 | FILE *file; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1829 | char *filename; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1830 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1831 | filename = g_build_filename(g_get_home_dir(), ".gntpositions", NULL); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1832 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1833 | file = fopen(filename, "wb"); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1834 | if (file == NULL) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1835 | g_printerr("GntWM: error opening file to save positions\n"); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1836 | } else { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1837 | fprintf(file, "[positions]\n"); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1838 | g_hash_table_foreach(wm->positions, write_gdi, file); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1839 | fclose(file); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1840 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1841 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1842 | g_free(filename); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1843 | g_source_remove(write_timeout); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1844 | write_timeout = 0; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1845 | return FALSE; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1846 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1847 | |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1848 | static void |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1849 | write_positions_to_file(GntWM *wm) |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1850 | { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1851 | if (write_timeout) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1852 | g_source_remove(write_timeout); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1853 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1854 | write_timeout = g_timeout_add(10000, write_already, wm); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1855 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1856 | |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1857 | void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1858 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1859 | gboolean ret = TRUE; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1860 | GntNode *node; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1861 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1862 | while (widget->parent) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1863 | widget = widget->parent; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1864 | node = g_hash_table_lookup(wm->nodes, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1865 | if (!node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1866 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1867 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1868 | g_signal_emit(wm, signals[SIG_CONFIRM_MOVE], 0, widget, &x, &y, &ret); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1869 | if (!ret) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1870 | return; /* resize is not permitted */ |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1871 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1872 | gnt_widget_set_position(widget, x, y); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1873 | move_panel(node->panel, y, x); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1874 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1875 | g_signal_emit(wm, signals[SIG_MOVED], 0, node); |
|
16056
211c0f245156
Don't remember the position of transient windows
Richard Nelson <wabz@pidgin.im>
parents:
16039
diff
changeset
|
1876 | if (gnt_style_get_bool(GNT_STYLE_REMPOS, TRUE) && GNT_IS_BOX(widget) && |
|
211c0f245156
Don't remember the position of transient windows
Richard Nelson <wabz@pidgin.im>
parents:
16039
diff
changeset
|
1877 | !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { |
|
15129
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1878 | const char *title = GNT_BOX(widget)->title; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1879 | if (title) { |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1880 | GntPosition *p = g_new0(GntPosition, 1); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1881 | GntWidget *wid = node->me; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1882 | p->x = wid->priv.x; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1883 | p->y = wid->priv.y; |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1884 | g_hash_table_replace(wm->positions, g_strdup(title), p); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1885 | write_positions_to_file(wm); |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1886 | } |
|
4722d1cf7938
[gaim-migrate @ 17851]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15020
diff
changeset
|
1887 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1888 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1889 | update_screen(wm); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1890 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1891 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1892 | static void |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1893 | gnt_wm_give_focus(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1894 | { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1895 | GntNode *node = g_hash_table_lookup(wm->nodes, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1896 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1897 | if (!node) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1898 | return; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1899 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1900 | if (widget != wm->_list.window && !GNT_IS_MENU(widget) && |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1901 | wm->cws->ordered->data != widget) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1902 | GntWidget *w = wm->cws->ordered->data; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1903 | wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1904 | gnt_widget_set_focus(w, FALSE); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1905 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1906 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1907 | gnt_widget_set_focus(widget, TRUE); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1908 | GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_URGENT); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1909 | gnt_widget_draw(widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1910 | top_panel(node->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1911 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1912 | if (wm->_list.window) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1913 | GntNode *nd = g_hash_table_lookup(wm->nodes, wm->_list.window); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1914 | top_panel(nd->panel); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1915 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1916 | update_screen(wm); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1917 | gnt_ws_draw_taskbar(wm->cws, FALSE); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1918 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1919 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1920 | void gnt_wm_update_window(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1921 | { |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1922 | GntNode *node = NULL; |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1923 | GntWS *ws; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1924 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1925 | while (widget->parent) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1926 | widget = widget->parent; |
|
18638
cf86c3ae160f
Some extra checks to avoid weird crashes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18600
diff
changeset
|
1927 | if (!GNT_IS_MENU(widget)) { |
|
cf86c3ae160f
Some extra checks to avoid weird crashes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18600
diff
changeset
|
1928 | if (!GNT_IS_BOX(widget)) |
|
cf86c3ae160f
Some extra checks to avoid weird crashes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18600
diff
changeset
|
1929 | return; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1930 | gnt_box_sync_children(GNT_BOX(widget)); |
|
18638
cf86c3ae160f
Some extra checks to avoid weird crashes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18600
diff
changeset
|
1931 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1932 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1933 | ws = gnt_wm_widget_find_workspace(wm, widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1934 | node = g_hash_table_lookup(wm->nodes, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1935 | if (node == NULL) { |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1936 | gnt_wm_new_window(wm, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1937 | } else |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1938 | g_signal_emit(wm, signals[SIG_UPDATE_WIN], 0, node); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1939 | |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1940 | if (ws == wm->cws || GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1941 | gnt_wm_copy_win(widget, node); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1942 | update_screen(wm); |
|
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1943 | gnt_ws_draw_taskbar(wm->cws, FALSE); |
|
18638
cf86c3ae160f
Some extra checks to avoid weird crashes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18600
diff
changeset
|
1944 | } else if (ws && ws != wm->cws && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_URGENT)) { |
|
16524
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1945 | if (!act || (act && !g_list_find(act, ws))) |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1946 | act = g_list_prepend(act, ws); |
|
1f114ebacb0d
Show an activity message when a window in the non-current workspace is flagged urgent
Richard Nelson <wabz@pidgin.im>
parents:
16523
diff
changeset
|
1947 | update_act_msg(); |
|
16519
9458657f5b99
Initial workspace support. refs #51
Richard Nelson <wabz@pidgin.im>
parents:
16356
diff
changeset
|
1948 | } |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1949 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1950 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1951 | gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1952 | { |
|
15838
45289a1439b2
Get rid of some minor C99isms
Mark Doliner <markdoliner@pidgin.im>
parents:
15804
diff
changeset
|
1953 | gboolean ret = TRUE; |
|
15802
1e124a68997e
gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
15714
diff
changeset
|
1954 | idle_update = TRUE; |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1955 | g_signal_emit(wm, signals[SIG_MOUSE_CLICK], 0, event, x, y, widget, &ret); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1956 | return ret; |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1957 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1958 | |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1959 | void gnt_wm_raise_window(GntWM *wm, GntWidget *widget) |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1960 | { |
| 18133 | 1961 | GntWS *ws = gnt_wm_widget_find_workspace(wm, widget); |
| 1962 | if (wm->cws != ws) | |
| 1963 | gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); | |
|
18567
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1964 | if (widget != wm->cws->ordered->data) { |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1965 | GntWidget *wid = wm->cws->ordered->data; |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1966 | wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget); |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1967 | gnt_widget_set_focus(wid, FALSE); |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1968 | gnt_widget_draw(wid); |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1969 | } |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1970 | gnt_widget_set_focus(widget, TRUE); |
|
8dd8eae7a1aa
Fix some focus issues.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18420
diff
changeset
|
1971 | gnt_widget_draw(widget); |
|
14962
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1972 | g_signal_emit(wm, signals[SIG_GIVE_FOCUS], 0, widget); |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1973 | } |
|
abfaa2e03ac7
[gaim-migrate @ 17672]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1974 | |
|
16356
13cc89b3ab7c
Dialogs opened resulting from a mouse-click should fain focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16189
diff
changeset
|
1975 | void gnt_wm_set_event_stack(GntWM *wm, gboolean set) |
|
13cc89b3ab7c
Dialogs opened resulting from a mouse-click should fain focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16189
diff
changeset
|
1976 | { |
|
13cc89b3ab7c
Dialogs opened resulting from a mouse-click should fain focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16189
diff
changeset
|
1977 | wm->event_stack = set; |
|
13cc89b3ab7c
Dialogs opened resulting from a mouse-click should fain focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16189
diff
changeset
|
1978 | } |
|
13cc89b3ab7c
Dialogs opened resulting from a mouse-click should fain focus.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16189
diff
changeset
|
1979 |