Mercurial > pidgin.yaz
annotate finch/libgnt/wms/irssi.c @ 17991:386047fb178b
Draw a separator line between the buddylist and the conversation windows.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 02 Jun 2007 06:39:02 +0000 |
parents | 1bccb9641ef3 |
children | 08e93462f189 |
rev | line source |
---|---|
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 /** |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 * 1. Buddylist and conversation windows are borderless and full height of the screen. |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 * 2. Conversation windows will have (full-screen-width - buddylist-width) width |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 * - It's possible to auto-resize the conversation windows when the buddylist |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 * is closed/opened/resized to keep this always true. But resizing the textview |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 * in conversation window is rather costly, especially when there's a lot of text |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 * in the scrollback. So it's not done yet. |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 * 3. All the other windows are always centered. |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 #include <string.h> |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 #include <sys/types.h> |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 #include "gnt.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 #include "gntbox.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 #include "gntmenu.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 #include "gntstyle.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 #include "gntwm.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 #include "gntwindow.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 #include "gntlabel.h" |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 #define TYPE_IRSSI (irssi_get_gtype()) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 typedef struct _Irssi |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 GntWM inherit; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 } Irssi; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 typedef struct _IrssiClass |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 GntWMClass inherit; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 } IrssiClass; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 GType irssi_get_gtype(void); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 void gntwm_init(GntWM **wm); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 static void (*org_new_window)(GntWM *wm, GntWidget *win); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
38 /* This is changed whenever the buddylist is opened/closed or resized. */ |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
39 static int buddylistwidth; |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
40 |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
41 static gboolean |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
42 is_budddylist(GntWidget *win) |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 { |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
44 const char *name = gnt_widget_get_name(win); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
45 if (name && strcmp(name, "buddylist") == 0) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
46 return TRUE; |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
47 return FALSE; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 static void |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 remove_border_set_position_size(GntWM *wm, GntWidget *win, int x, int y, int w, int h) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 gnt_box_set_toplevel(GNT_BOX(win), FALSE); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 GNT_WIDGET_SET_FLAGS(win, GNT_WIDGET_CAN_TAKE_FOCUS); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 gnt_widget_set_position(win, x, y); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 mvwin(win->window, y, x); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 gnt_widget_set_size(win, (w < 0) ? -1 : w + 2, h + 2); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 static void |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 irssi_new_window(GntWM *wm, GntWidget *win) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 const char *name; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 name = gnt_widget_get_name(win); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 if (!name || strcmp(name, "conversation-window")) { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 if (!GNT_IS_MENU(win) && !GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_TRANSIENT)) { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 if ((!name || strcmp(name, "buddylist"))) { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 int w, h, x, y; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 gnt_widget_get_size(win, &w, &h); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 x = (getmaxx(stdscr) - w) / 2; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 y = (getmaxy(stdscr) - h) / 2; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 gnt_widget_set_position(win, x, y); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 mvwin(win->window, y, x); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 } else { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 remove_border_set_position_size(wm, win, 0, 0, -1, getmaxy(stdscr) - 1); |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
78 gnt_widget_get_size(win, &buddylistwidth, NULL); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
79 mvwvline(stdscr, 0, buddylistwidth, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
80 buddylistwidth++; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 org_new_window(wm, win); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 return; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
87 /* The window we have here is a conversation window. */ |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
88 remove_border_set_position_size(wm, win, buddylistwidth, 0, |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
89 getmaxx(stdscr) - buddylistwidth, getmaxy(stdscr) - 1); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
90 org_new_window(wm, win); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
91 } |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
92 |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
93 static void |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
94 irssi_window_resized(GntWM *wm, GntNode *node) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
95 { |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
96 if (!is_budddylist(node->me)) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
97 return; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
99 if (buddylistwidth) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
100 mvwvline(stdscr, 0, buddylistwidth - 1, |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
101 ' ' | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
102 gnt_widget_get_size(node->me, &buddylistwidth, NULL); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
103 mvwvline(stdscr, 0, buddylistwidth, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
104 buddylistwidth++; |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
105 } |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
106 |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
107 static gboolean |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
108 irssi_close_window(GntWM *wm, GntWidget *win) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
109 { |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
110 if (is_budddylist(win)) |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
111 buddylistwidth = 0; |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
112 return FALSE; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 static void |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 irssi_class_init(IrssiClass *klass) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
117 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
118 GntWMClass *pclass = GNT_WM_CLASS(klass); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 org_new_window = pclass->new_window; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 pclass->new_window = irssi_new_window; |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
123 pclass->window_resized = irssi_window_resized; |
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
124 pclass->close_window = irssi_close_window; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
126 gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
127 GNTDEBUG; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 void gntwm_init(GntWM **wm) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 { |
17991
386047fb178b
Draw a separator line between the buddylist and the conversation windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17989
diff
changeset
|
132 buddylistwidth = 0; |
17989
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 *wm = g_object_new(TYPE_IRSSI, NULL); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
135 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
136 GType irssi_get_gtype(void) |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
137 { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
138 static GType type = 0; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
139 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
140 if(type == 0) { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
141 static const GTypeInfo info = { |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
142 sizeof(IrssiClass), |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
143 NULL, /* base_init */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
144 NULL, /* base_finalize */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
145 (GClassInitFunc)irssi_class_init, |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
146 NULL, |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
147 NULL, /* class_data */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
148 sizeof(Irssi), |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
149 0, /* n_preallocs */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
150 NULL, /* instance_init */ |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
151 NULL |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
152 }; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
153 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
154 type = g_type_register_static(GNT_TYPE_WM, |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
155 "GntIrssi", |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
156 &info, 0); |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
157 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
158 |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
159 return type; |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
160 } |
1bccb9641ef3
Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
161 |