annotate finch/libgnt/wms/irssi.c @ 17989:1bccb9641ef3

Add a new WM, irssi. Put the wm's in $(libdir)/gnt instead of in /finch. The features of the irssi WM include: 1. Buddylist and conversation windows are borderless and full height of the screen. 2. Conversation windows will have (full-screen-width - buddylist-width) width - It's possible to auto-resize the conversation windows when the buddylist is closed/opened/resized to keep this always true. But resizing the textview in conversation window is rather costly, especially when there's a lot of text in the scrollback. So it's not done yet. 3. All the other windows are always centered.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 02 Jun 2007 03:49:53 +0000
parents
children 386047fb178b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
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
38 static GntWidget *
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
39 find_widget(GntWM *wm, const char *wname)
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
40 {
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
41 const GList *iter = wm->list;
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
42 for (; iter; iter = iter->next) {
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 GntWidget *widget = iter->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
44 const char *name = gnt_widget_get_name(widget);
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
45 if (name && strcmp(name, wname) == 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
46 return widget;
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
47 }
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 return 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
50 }
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
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 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
53 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
54 {
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 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
56 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
57
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_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
59 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
60 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
61 }
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
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 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
64 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
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 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
67 int bw;
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 GntWidget *blist;
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
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 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
71 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
72 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
73 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
74 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
75 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
76 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
77 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
78 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
79 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
80 } 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
81 remove_border_set_position_size(wm, win, 0, 0, -1, getmaxy(stdscr) - 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
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 }
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 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
85 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
86 }
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
87
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
88 blist = find_widget(wm, "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
89 if (blist) {
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
90 gnt_widget_get_size(blist, &bw, 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
91 bw++;
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
92 } 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
93 bw = 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
94 }
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
95
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
96 /* The window we have here is a 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
97 remove_border_set_position_size(wm, win, bw, 0, getmaxx(stdscr) - bw, getmaxy(stdscr) - 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
98 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
99 }
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
100
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
101 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
102 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
103 {
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
104 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
105
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
106 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
107
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
108 pclass->new_window = irssi_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
109
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
110 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
111 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
112 }
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 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
115 {
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 *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
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
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 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
120 {
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 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
122
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
123 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
124 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
125 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
126 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
127 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
128 (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
129 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
130 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
131 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
132 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
133 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
134 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
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
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 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
138 "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
139 &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
140 }
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
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 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
143 }
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