annotate finch/libgnt/gntws.c @ 22786:95308e1b47d1

ctrl-x to open context menus. F11 was such a poor choice for this.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 02 May 2008 16:06:03 +0000
parents bec28e60aff6
children a18f421696dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
1 #include <gmodule.h>
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
2
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
3 #include "gntbox.h"
16731
3c3fc1432a01 Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents: 16471
diff changeset
4 #include "gntwidget.h"
3c3fc1432a01 Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents: 16471
diff changeset
5 #include "gntwindow.h"
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
6 #include "gntwm.h"
16731
3c3fc1432a01 Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents: 16471
diff changeset
7 #include "gntws.h"
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
8
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
9 static void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
10 widget_hide(gpointer data, gpointer nodes)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
11 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
12 GntWidget *widget = GNT_WIDGET(data);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
13 GntNode *node = g_hash_table_lookup(nodes, widget);
16731
3c3fc1432a01 Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents: 16471
diff changeset
14 if (GNT_IS_WINDOW(widget))
3c3fc1432a01 Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents: 16471
diff changeset
15 gnt_window_workspace_hiding(GNT_WINDOW(widget));
22746
bec28e60aff6 Fix a possible crash when creating a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21250
diff changeset
16 if (node)
bec28e60aff6 Fix a possible crash when creating a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21250
diff changeset
17 hide_panel(node->panel);
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
18 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
19
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
20 static void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
21 widget_show(gpointer data, gpointer nodes)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
22 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
23 GntNode *node = g_hash_table_lookup(nodes, data);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
24 GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(data), GNT_WIDGET_INVISIBLE);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
25 if (node) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
26 show_panel(node->panel);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
27 gnt_wm_copy_win(GNT_WIDGET(data), node);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
28 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
29 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
30
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
31 void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
32 gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
33 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
34 static WINDOW *taskbar = NULL;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
35 GList *iter;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
36 int n, width = 0;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
37 int i;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
38
18421
e16d097c5739 Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18416
diff changeset
39 if (gnt_is_refugee())
e16d097c5739 Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18416
diff changeset
40 return;
e16d097c5739 Allow executing another application (eg. PAGER) that will use the same
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18416
diff changeset
41
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
42 if (taskbar == NULL) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
43 taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
44 } else if (reposition) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
45 int Y_MAX = getmaxy(stdscr) - 1;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
46 mvwin(taskbar, Y_MAX, 0);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
47 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
48
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18421
diff changeset
49 wbkgdset(taskbar, '\0' | gnt_color_pair(GNT_COLOR_NORMAL));
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
50 werase(taskbar);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
51
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
52 n = g_list_length(ws->list);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
53 if (n)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
54 width = getmaxx(stdscr) / n;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
55
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
56 for (i = 0, iter = ws->list; iter; iter = iter->next, i++) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
57 GntWidget *w = iter->data;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
58 int color;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
59 const char *title;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
60
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
61 if (w == ws->ordered->data) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
62 /* This is the current window in focus */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
63 color = GNT_COLOR_TITLE;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
64 } else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
65 /* This is a window with the URGENT hint set */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
66 color = GNT_COLOR_URGENT;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
67 } else {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
68 color = GNT_COLOR_NORMAL;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
69 }
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18421
diff changeset
70 wbkgdset(taskbar, '\0' | gnt_color_pair(color));
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
71 if (iter->next)
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18421
diff changeset
72 mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), width);
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
73 else
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18421
diff changeset
74 mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), getmaxx(stdscr) - width * i);
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
75 title = GNT_BOX(w)->title;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
76 mvwprintw(taskbar, 0, width * i, "%s", title ? title : "<gnt>");
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
77 if (i)
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18421
diff changeset
78 mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | gnt_color_pair(GNT_COLOR_NORMAL));
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
79 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
80 wrefresh(taskbar);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
81 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
82
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
83 static void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
84 gnt_ws_init(GTypeInstance *instance, gpointer class)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
85 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
86 GntWS *ws = GNT_WS(instance);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
87 ws->list = NULL;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
88 ws->ordered = NULL;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
89 ws->name = NULL;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
90 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
91
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
92 void gnt_ws_add_widget(GntWS *ws, GntWidget* wid)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
93 {
18223
5023ad94ebc9 Notify a window when it loses focus because another window was moved to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18075
diff changeset
94 GntWidget *oldfocus;
5023ad94ebc9 Notify a window when it loses focus because another window was moved to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18075
diff changeset
95 oldfocus = ws->ordered ? ws->ordered->data : NULL;
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
96 ws->list = g_list_append(ws->list, wid);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
97 ws->ordered = g_list_prepend(ws->ordered, wid);
18223
5023ad94ebc9 Notify a window when it loses focus because another window was moved to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18075
diff changeset
98 if (oldfocus)
5023ad94ebc9 Notify a window when it loses focus because another window was moved to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18075
diff changeset
99 gnt_widget_set_focus(oldfocus, FALSE);
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
100 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
101
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
102 void gnt_ws_remove_widget(GntWS *ws, GntWidget* wid)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
103 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
104 ws->list = g_list_remove(ws->list, wid);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
105 ws->ordered = g_list_remove(ws->ordered, wid);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
106 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
107
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
108 void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
109 gnt_ws_set_name(GntWS *ws, const gchar *name)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
110 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
111 g_free(ws->name);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
112 ws->name = g_strdup(name);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
113 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
114
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
115 void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
116 gnt_ws_hide(GntWS *ws, GHashTable *nodes)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
117 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
118 g_list_foreach(ws->ordered, widget_hide, nodes);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
119 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
120
18416
93c5c785a811 Fix some focus issues.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18223
diff changeset
121 void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes)
93c5c785a811 Fix some focus issues.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18223
diff changeset
122 {
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
123 widget_hide(widget, nodes);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
124 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
125
18416
93c5c785a811 Fix some focus issues.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18223
diff changeset
126 void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes)
93c5c785a811 Fix some focus issues.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18223
diff changeset
127 {
16415
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
128 widget_show(widget, nodes);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
129 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
130
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
131 void
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
132 gnt_ws_show(GntWS *ws, GHashTable *nodes)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
133 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
134 GList *l;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
135 for (l = g_list_last(ws->ordered); l; l = g_list_previous(l))
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
136 widget_show(l->data, nodes);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
137 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
138
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
139 GType
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
140 gnt_ws_get_gtype(void)
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
141 {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
142 static GType type = 0;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
143
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
144 if(type == 0) {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
145 static const GTypeInfo info = {
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
146 sizeof(GntWSClass),
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
147 NULL, /* base_init */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
148 NULL, /* base_finalize */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
149 NULL,
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
150 /*(GClassInitFunc)gnt_ws_class_init,*/
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
151 NULL,
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
152 NULL, /* class_data */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
153 sizeof(GntWS),
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
154 0, /* n_preallocs */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
155 gnt_ws_init, /* instance_init */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
156 NULL /* value_table */
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
157 };
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
158
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
159 type = g_type_register_static(GNT_TYPE_BINDABLE,
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
160 "GntWS",
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
161 &info, 0);
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
162 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
163
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
164 return type;
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
165 }
97802d3f3f1f Forgot these...
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
166
18075
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
167 GntWS *gnt_ws_new(const char *name)
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
168 {
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
169 GntWS *ws = GNT_WS(g_object_new(GNT_TYPE_WS, NULL));
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
170 ws->name = g_strdup(name ? name : "(noname)");
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
171 return ws;
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
172 }
34e011c8ed2b F9 to create a new workspace.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16731
diff changeset
173
16471
596c970076df Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16415
diff changeset
174 const char * gnt_ws_get_name(GntWS *ws)
596c970076df Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16415
diff changeset
175 {
596c970076df Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16415
diff changeset
176 return ws->name;
596c970076df Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16415
diff changeset
177 }
596c970076df Alt+s to see the list of workspaces and windows.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16415
diff changeset
178