Fix build
soc.2013.gobjectification.plugins
2014-04-29, Ankit Vani
* GNT - The GLib Ncurses Toolkit * GNT is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA widget_hide(gpointer data, gpointer nodes) GntWidget *widget = GNT_WIDGET(data); GntNode *node = g_hash_table_lookup(nodes, widget); if (GNT_IS_WINDOW(widget)) gnt_window_workspace_hiding(GNT_WINDOW(widget)); widget_show(gpointer data, gpointer nodes) GntNode *node = g_hash_table_lookup(nodes, data); GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(data), GNT_WIDGET_INVISIBLE); gnt_wm_copy_win(GNT_WIDGET(data), node); gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition) static WINDOW *taskbar = NULL; taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0); int Y_MAX = getmaxy(stdscr) - 1; mvwin(taskbar, Y_MAX, 0); wbkgdset(taskbar, '\0' | gnt_color_pair(GNT_COLOR_NORMAL)); n = g_list_length(ws->list); width = getmaxx(stdscr) / n; for (i = 0, iter = ws->list; iter; iter = iter->next, i++) { GntWidget *w = iter->data; if (w == ws->ordered->data) { /* This is the current window in focus */ } else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) { /* This is a window with the URGENT hint set */ color = GNT_COLOR_URGENT; color = GNT_COLOR_NORMAL; wbkgdset(taskbar, '\0' | gnt_color_pair(color)); mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), width); mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), getmaxx(stdscr) - width * i); title = GNT_BOX(w)->title; mvwprintw(taskbar, 0, width * i, "%s", title ? C_(title) : "<gnt>"); mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | gnt_color_pair(GNT_COLOR_NORMAL)); gnt_ws_init(GTypeInstance *instance, gpointer class) GntWS *ws = GNT_WS(instance); void gnt_ws_add_widget(GntWS *ws, GntWidget* wid) oldfocus = ws->ordered ? ws->ordered->data : NULL; ws->list = g_list_append(ws->list, wid); ws->ordered = g_list_prepend(ws->ordered, wid); gnt_widget_set_focus(oldfocus, FALSE); void gnt_ws_remove_widget(GntWS *ws, GntWidget* wid) ws->list = g_list_remove(ws->list, wid); ws->ordered = g_list_remove(ws->ordered, wid); gnt_ws_set_name(GntWS *ws, const gchar *name) ws->name = g_strdup(name); gnt_ws_hide(GntWS *ws, GHashTable *nodes) g_list_foreach(ws->ordered, widget_hide, nodes); void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes) widget_hide(widget, nodes); void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes) widget_show(widget, nodes); gnt_ws_show(GntWS *ws, GHashTable *nodes) for (l = g_list_last(ws->ordered); l; l = g_list_previous(l)) widget_show(l->data, nodes); static const GTypeInfo info = { NULL, /* base_finalize */ /*(GClassInitFunc)gnt_ws_class_init,*/ gnt_ws_init, /* instance_init */ type = g_type_register_static(GNT_TYPE_BINDABLE, GntWS *gnt_ws_new(const char *name) GntWS *ws = GNT_WS(g_object_new(GNT_TYPE_WS, NULL)); ws->name = g_strdup(name ? name : "(noname)"); const char * gnt_ws_get_name(GntWS *ws)