pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntwm.c
Go to the documentation of this file.
1 
23 #include "config.h"
24 
25 #ifdef USE_PYTHON
26 #include <Python.h>
27 #endif
28 
29 /* Python.h may define _GNU_SOURCE and _XOPEN_SOURCE_EXTENDED, so protect
30  * these checks with #ifndef/!defined() */
31 #ifndef _GNU_SOURCE
32 #define _GNU_SOURCE
33 #endif
34 
35 #if !defined _XOPEN_SOURCE_EXTENDED && (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__)
36 #define _XOPEN_SOURCE_EXTENDED
37 #endif
38 
39 #include <glib.h>
40 #if GLIB_CHECK_VERSION(2,6,0)
41 # include <glib/gstdio.h>
42 #else
43 # include <sys/types.h>
44 # include <sys/stat.h>
45 # include <fcntl.h>
46 # define g_fopen open
47 #endif
48 #include <ctype.h>
49 #include <gmodule.h>
50 #include <stdlib.h>
51 #include <string.h>
52 #include <time.h>
53 
54 #include "gntinternal.h"
55 #undef GNT_LOG_DOMAIN
56 #define GNT_LOG_DOMAIN "WM"
57 
58 #include "gntwm.h"
59 #include "gntstyle.h"
60 #include "gntmarshal.h"
61 #include "gnt.h"
62 #include "gntbox.h"
63 #include "gntbutton.h"
64 #include "gntentry.h"
65 #include "gntfilesel.h"
66 #include "gntlabel.h"
67 #include "gntmenu.h"
68 #include "gnttextview.h"
69 #include "gnttree.h"
70 #include "gntutils.h"
71 #include "gntwindow.h"
72 
73 #define IDLE_CHECK_INTERVAL 5 /* 5 seconds */
74 
75 enum
76 {
90 };
91 
92 static guint signals[SIGS] = { 0 };
94 static void gnt_wm_win_resized(GntWM *wm, GntNode *node);
95 static void gnt_wm_win_moved(GntWM *wm, GntNode *node);
96 static void gnt_wm_give_focus(GntWM *wm, GntWidget *widget);
97 static void update_window_in_list(GntWM *wm, GntWidget *wid);
98 static void shift_window(GntWM *wm, GntWidget *widget, int dir);
99 static gboolean workspace_next(GntBindable *wm, GList *n);
100 static gboolean workspace_prev(GntBindable *wm, GList *n);
101 
102 #ifndef NO_WIDECHAR
103 static int widestringwidth(wchar_t *wide);
104 #endif
105 
106 static void ensure_normal_mode(GntWM *wm);
107 static gboolean write_already(gpointer data);
108 static int write_timeout;
109 static time_t last_active_time;
110 static gboolean idle_update;
111 static GList *act = NULL; /* list of WS with unseen activitiy */
112 static gboolean ignore_keys = FALSE;
113 #ifdef USE_PYTHON
114 static gboolean started_python = FALSE;
115 #endif
116 
117 static GList *
118 g_list_bring_to_front(GList *list, gpointer data)
119 {
120  list = g_list_remove(list, data);
121  list = g_list_prepend(list, data);
122  return list;
123 }
124 
125 static void
126 free_node(gpointer data)
127 {
128  GntNode *node = data;
129  hide_panel(node->panel);
130  del_panel(node->panel);
131  g_free(node);
132 }
133 
134 void
136 {
137  WINDOW *src, *dst;
138  if (!node)
139  return;
140  src = widget->window;
141  dst = node->window;
142  copywin(src, dst, node->scroll, 0, 0, 0, getmaxy(dst) - 1, getmaxx(dst) - 1, 0);
143 
144  /* Update the hardware cursor */
146  GntWidget *active = GNT_BOX(widget)->active;
147  if (active) {
148  int curx = active->priv.x + getcurx(active->window);
149  int cury = active->priv.y + getcury(active->window);
150  if (wmove(node->window, cury - widget->priv.y, curx - widget->priv.x) != OK)
151  (void)wmove(node->window, 0, 0);
152  }
153  }
154 }
155 
167 static void
169 {
170 #ifndef NO_WIDECHAR
171  PANEL *panel = NULL;
172  while ((panel = panel_below(panel)) != NULL) {
173  int sx, ex, sy, ey, w, y;
174  cchar_t ch;
175  PANEL *below = panel;
176 
177  sx = getbegx(panel->win);
178  ex = getmaxx(panel->win) + sx;
179  sy = getbegy(panel->win);
180  ey = getmaxy(panel->win) + sy;
181 
182  while ((below = panel_below(below)) != NULL) {
183  if (sy > getbegy(below->win) + getmaxy(below->win) ||
184  ey < getbegy(below->win))
185  continue;
186  if (sx > getbegx(below->win) + getmaxx(below->win) ||
187  ex < getbegx(below->win))
188  continue;
189  for (y = MAX(sy, getbegy(below->win)); y <= MIN(ey, getbegy(below->win) + getmaxy(below->win)); y++) {
190  if (mvwin_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch) != OK)
191  goto right;
192  w = widestringwidth(ch.chars);
193  if (w > 1 && (ch.attr & 1)) {
194  ch.chars[0] = ' ';
195  ch.attr &= ~ A_CHARTEXT;
196  mvwadd_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch);
197  touchline(below->win, y - getbegy(below->win), 1);
198  }
199 right:
200  if (mvwin_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch) != OK)
201  continue;
202  w = widestringwidth(ch.chars);
203  if (w > 1 && !(ch.attr & 1)) {
204  ch.chars[0] = ' ';
205  ch.attr &= ~ A_CHARTEXT;
206  mvwadd_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch);
207  touchline(below->win, y - getbegy(below->win), 1);
208  }
209  }
210  }
211  }
212 #endif
213 }
214 
215 static void
217 {
218  GntWidget *label;
219  GList *iter;
220  static GntWidget *message = NULL;
221  GString *text = g_string_new("act: ");
222  if (message)
223  gnt_widget_destroy(message);
224  if (!act)
225  return;
226  for (iter = act; iter; iter = iter->next) {
227  GntWS *ws = iter->data;
228  g_string_append_printf(text, "%s, ", gnt_ws_get_name(ws));
229  }
230  g_string_erase(text, text->len - 2, 2);
231  message = gnt_vbox_new(FALSE);
235  gnt_box_add_widget(GNT_BOX(message), label);
236  gnt_widget_set_name(message, "wm-message");
237  gnt_widget_set_position(message, 0, 0);
238  gnt_widget_draw(message);
239  g_string_free(text, TRUE);
240 }
241 
242 static gboolean
244 {
246  return TRUE;
247 
248  if (wm->menu) {
249  GntMenu *top = wm->menu;
250  while (top) {
251  GntNode *node = g_hash_table_lookup(wm->nodes, top);
252  if (node)
253  top_panel(node->panel);
254  top = top->submenu;
255  }
256  }
258  update_panels();
259  doupdate();
260  return TRUE;
261 }
262 
263 static gboolean
264 sanitize_position(GntWidget *widget, int *x, int *y, gboolean m)
265 {
266  int X_MAX = getmaxx(stdscr);
267  int Y_MAX = getmaxy(stdscr) - 1;
268  int w, h;
269  int nx, ny;
270  gboolean changed = FALSE;
273 
274  gnt_widget_get_size(widget, &w, &h);
275  if (x) {
276  if (m && (flags & GNT_WINDOW_MAXIMIZE_X) && *x != 0) {
277  *x = 0;
278  changed = TRUE;
279  } else if (*x + w > X_MAX) {
280  nx = MAX(0, X_MAX - w);
281  if (nx != *x) {
282  *x = nx;
283  changed = TRUE;
284  }
285  }
286  }
287  if (y) {
288  if (m && (flags & GNT_WINDOW_MAXIMIZE_Y) && *y != 0) {
289  *y = 0;
290  changed = TRUE;
291  } else if (*y + h > Y_MAX) {
292  ny = MAX(0, Y_MAX - h);
293  if (ny != *y) {
294  *y = ny;
295  changed = TRUE;
296  }
297  }
298  }
299  return changed;
300 }
301 
302 static void
304 {
305  int x, y, w, h;
306  int nw, nh;
307 
308  int X_MAX = getmaxx(stdscr);
309  int Y_MAX = getmaxy(stdscr) - 1;
310 
311  GntWindowFlags flags = 0;
312 
313  if (m && GNT_IS_WINDOW(widget)) {
315  }
316 
318  gnt_widget_get_size(widget, &w, &h);
319 
320  if (sanitize_position(widget, &x, &y, !!m))
322 
324  nw = X_MAX;
325  else
326  nw = MIN(w, X_MAX);
327 
329  nh = Y_MAX;
330  else
331  nh = MIN(h, Y_MAX);
332 
333  if (nw != w || nh != h)
335 }
336 
337 static void
339 {
340 #if GLIB_CHECK_VERSION(2,6,0)
341  GKeyFile *gfile = g_key_file_new();
342  char *filename = g_build_filename(g_get_home_dir(), ".gntpositions", NULL);
343  GError *error = NULL;
344  char **keys;
345  gsize nk;
346 
347  if (!g_key_file_load_from_file(gfile, filename, G_KEY_FILE_NONE, &error)) {
348  gnt_warning("%s", error->message);
349  g_error_free(error);
350  g_free(filename);
351  return;
352  }
353 
354  keys = g_key_file_get_keys(gfile, "positions", &nk, &error);
355  if (error) {
356  gnt_warning("%s", error->message);
357  g_error_free(error);
358  error = NULL;
359  } else {
360  while (nk--) {
361  char *title = keys[nk];
362  gsize l;
363  char **coords = g_key_file_get_string_list(gfile, "positions", title, &l, NULL);
364  if (l == 2) {
365  int x = atoi(coords[0]);
366  int y = atoi(coords[1]);
367  GntPosition *p = g_new0(GntPosition, 1);
368  p->x = x;
369  p->y = y;
370  g_hash_table_replace(wm->positions, g_strdup(title + 1), p);
371  } else {
372  gnt_warning("Invalid number of arguments (%" G_GSIZE_FORMAT
373  ") for positioning a window.", l);
374  }
375  g_strfreev(coords);
376  }
377  g_strfreev(keys);
378  }
379 
380  g_free(filename);
381  g_key_file_free(gfile);
382 #endif
383 }
384 
385 static gboolean check_idle(gpointer n)
386 {
387  if (idle_update) {
389  idle_update = FALSE;
390  }
391  return TRUE;
392 }
393 
394 static void
395 gnt_wm_init(GTypeInstance *instance, gpointer class)
396 {
397  GntWM *wm = GNT_WM(instance);
398  wm->workspaces = NULL;
399  wm->name_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
400  wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
402  if (wm->workspaces == NULL) {
403  wm->cws = gnt_ws_new("default");
405  } else {
406  wm->cws = wm->workspaces->data;
407  }
408  wm->event_stack = FALSE;
409  wm->tagged = NULL;
410  wm->windows = NULL;
411  wm->actions = NULL;
412  wm->nodes = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_node);
413  wm->positions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
419 }
420 
421 static void
422 switch_window(GntWM *wm, int direction, gboolean urgent)
423 {
424  GntWidget *w = NULL, *wid = NULL;
425  int pos, orgpos;
426 
427  if (wm->_list.window || wm->menu)
428  return;
429 
430  if (!wm->cws->ordered || !wm->cws->ordered->next)
431  return;
432 
433  if (wm->mode != GNT_KP_MODE_NORMAL) {
435  }
436 
437  w = wm->cws->ordered->data;
438  orgpos = pos = g_list_index(wm->cws->list, w);
439 
440  do {
441  pos += direction;
442 
443  if (pos < 0) {
444  wid = g_list_last(wm->cws->list)->data;
445  pos = g_list_length(wm->cws->list) - 1;
446  } else if ((guint)pos >= g_list_length(wm->cws->list)) {
447  wid = wm->cws->list->data;
448  pos = 0;
449  } else
450  wid = g_list_nth_data(wm->cws->list, pos);
451  } while (urgent && !GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT) && pos != orgpos);
452 
453  gnt_wm_raise_window(wm, wid);
454 }
455 
456 static gboolean
457 window_next(GntBindable *bindable, GList *null)
458 {
459  GntWM *wm = GNT_WM(bindable);
460  switch_window(wm, 1, FALSE);
461  return TRUE;
462 }
463 
464 static gboolean
465 window_prev(GntBindable *bindable, GList *null)
466 {
467  GntWM *wm = GNT_WM(bindable);
468  switch_window(wm, -1, FALSE);
469  return TRUE;
470 }
471 
472 static gboolean
474 {
475  GntWM *wm = GNT_WM(bind);
476  GList *l;
477  int n;
478 
479  if (!wm->cws->ordered)
480  return TRUE;
481 
482  if (list)
483  n = GPOINTER_TO_INT(list->data);
484  else
485  n = 0;
486 
487  if ((l = g_list_nth(wm->cws->list, n)) != NULL)
488  {
489  gnt_wm_raise_window(wm, l->data);
490  }
491 
492  return TRUE;
493 }
494 
495 static gboolean
496 window_scroll_up(GntBindable *bindable, GList *null)
497 {
498  GntWM *wm = GNT_WM(bindable);
499  GntWidget *window;
500  GntNode *node;
501 
502  if (!wm->cws->ordered)
503  return TRUE;
504 
505  window = wm->cws->ordered->data;
506  node = g_hash_table_lookup(wm->nodes, window);
507  if (!node)
508  return TRUE;
509 
510  if (node->scroll) {
511  node->scroll--;
513  update_screen(wm);
514  }
515  return TRUE;
516 }
517 
518 static gboolean
519 window_scroll_down(GntBindable *bindable, GList *null)
520 {
521  GntWM *wm = GNT_WM(bindable);
522  GntWidget *window;
523  GntNode *node;
524  int w, h;
525 
526  if (!wm->cws->ordered)
527  return TRUE;
528 
529  window = wm->cws->ordered->data;
530  node = g_hash_table_lookup(wm->nodes, window);
531  if (!node)
532  return TRUE;
533 
534  gnt_widget_get_size(window, &w, &h);
535  if (h - node->scroll > getmaxy(node->window)) {
536  node->scroll++;
538  update_screen(wm);
539  }
540  return TRUE;
541 }
542 
543 static gboolean
544 window_close(GntBindable *bindable, GList *null)
545 {
546  GntWM *wm = GNT_WM(bindable);
547 
548  if (wm->_list.window)
549  return TRUE;
550 
551  if (wm->cws->ordered) {
552  gnt_widget_destroy(wm->cws->ordered->data);
554  }
555 
556  return TRUE;
557 }
558 
559 static void
561 {
562  wm->_list.window = NULL;
563  wm->_list.tree = NULL;
564  wm->windows = NULL;
565  wm->actions = NULL;
566  update_screen(wm);
567 }
568 
569 static void
571 {
572  GntWidget *tree, *win;
574  win = wm->_list.window = gnt_box_new(FALSE, FALSE);
576  gnt_box_set_pad(GNT_BOX(win), 0);
578 
579  tree = wm->_list.tree = gnt_tree_new();
581 
582  g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(destroy__list), wm);
583 }
584 
585 static void
587 {
589 
591 
592  if (!sel)
593  return;
594 
595  if (GNT_IS_WS(sel)) {
596  gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, sel));
597  } else {
599  }
600 }
601 
602 static void
603 populate_window_list(GntWM *wm, gboolean workspace)
604 {
605  GList *iter;
607  if (!workspace) {
608  for (iter = wm->cws->list; iter; iter = iter->next) {
609  GntBox *box = GNT_BOX(iter->data);
610 
614  }
615  } else {
616  GList *ws = wm->workspaces;
617  for (; ws; ws = ws->next) {
618  gnt_tree_add_row_last(tree, ws->data,
620  for (iter = GNT_WS(ws->data)->list; iter; iter = iter->next) {
621  GntBox *box = GNT_BOX(iter->data);
622 
624  gnt_tree_create_row(tree, box->title), ws->data);
626  }
627  }
628  }
629 }
630 
631 static gboolean
633 {
634  if (text[1] == 0 && wm->cws->ordered) {
636  switch (text[0]) {
637  case '-':
638  case ',':
639  if (GNT_IS_WS(sel)) {
640  /* reorder the workspace. */
641  } else
642  shift_window(wm, GNT_WIDGET(sel), -1);
643  break;
644  case '=':
645  case '.':
646  if (GNT_IS_WS(sel)) {
647  /* reorder the workspace. */
648  } else
649  shift_window(wm, GNT_WIDGET(sel), 1);
650  break;
651  default:
652  return FALSE;
653  }
655  populate_window_list(wm, GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "workspace")));
657  return TRUE;
658  }
659  return FALSE;
660 }
661 
662 static void
663 list_of_windows(GntWM *wm, gboolean workspace)
664 {
665  GntWidget *tree, *win;
666  setup__list(wm);
667  wm->windows = &wm->_list;
668 
669  win = wm->windows->window;
670  tree = wm->windows->tree;
671 
672  gnt_box_set_title(GNT_BOX(win), workspace ? "Workspace List" : "Window List");
673 
674  populate_window_list(wm, workspace);
675 
676  if (wm->cws->ordered)
678  else if (workspace)
680 
681  g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), wm);
682  g_signal_connect(G_OBJECT(tree), "key_pressed", G_CALLBACK(window_list_key_pressed), wm);
683  g_object_set_data(G_OBJECT(tree), "workspace", GINT_TO_POINTER(workspace));
684 
685  gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3);
686  gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2);
687  gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4);
688 
689  gnt_widget_show(win);
690 }
691 
692 static gboolean
693 window_list(GntBindable *bindable, GList *null)
694 {
695  GntWM *wm = GNT_WM(bindable);
696 
697  if (wm->_list.window || wm->menu)
698  return TRUE;
699 
700  if (!wm->cws->ordered)
701  return TRUE;
702 
704 
705  return TRUE;
706 }
707 
708 static void
709 dump_file_save(GntFileSel *fs, const char *path, const char *f, gpointer n)
710 {
711  FILE *file;
712  int x, y;
713  chtype old = 0, now = 0;
714  struct {
715  char ascii;
716  char *unicode;
717  } unis[] = {
718  {'q', "&#x2500;"},
719  {'t', "&#x251c;"},
720  {'u', "&#x2524;"},
721  {'x', "&#x2502;"},
722  {'-', "&#x2191;"},
723  {'.', "&#x2193;"},
724  {'l', "&#x250c;"},
725  {'k', "&#x2510;"},
726  {'m', "&#x2514;"},
727  {'j', "&#x2518;"},
728  {'a', "&#x2592;"},
729  {'n', "&#x253c;"},
730  {'w', "&#x252c;"},
731  {'v', "&#x2534;"},
732  {'\0', NULL}
733  };
734 
736 
737  if ((file = g_fopen(path, "w+")) == NULL) {
738  return;
739  }
740 
741  fprintf(file, "<head>\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n</head>\n<body>\n");
742  fprintf(file, "<pre>");
743  for (y = 0; y < getmaxy(stdscr); y++) {
744  for (x = 0; x < getmaxx(stdscr); x++) {
745  char ch[2] = {0, 0}, *print;
746 #ifdef NO_WIDECHAR
747  now = mvwinch(curscr, y, x);
748  ch[0] = now & A_CHARTEXT;
749  now ^= ch[0];
750 #else
751  cchar_t wch;
752  char unicode[12];
753  mvwin_wch(curscr, y, x, &wch);
754  now = wch.attr;
755  ch[0] = (char)(wch.chars[0] & 0xff);
756 #endif
757 
758 #define CHECK(attr, start, end) \
759  do \
760  { \
761  if (now & attr) \
762  { \
763  if (!(old & attr)) \
764  fprintf(file, "%s", start); \
765  } \
766  else if (old & attr) \
767  { \
768  fprintf(file, "%s", end); \
769  } \
770  } while (0)
771 
772  CHECK(A_BOLD, "<b>", "</b>");
773  CHECK(A_UNDERLINE, "<u>", "</u>");
774  CHECK(A_BLINK, "<blink>", "</blink>");
775 
776  if ((now & A_COLOR) != (old & A_COLOR) ||
777  (now & A_REVERSE) != (old & A_REVERSE))
778  {
779  short fgp, bgp, r, g, b;
780  struct
781  {
782  int r, g, b;
783  } fg, bg;
784 
785  if (pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp) != OK) {
786  fgp = -1;
787  bgp = -1;
788  }
789  if (fgp == -1)
790  fgp = COLOR_BLACK;
791  if (bgp == -1)
792  bgp = COLOR_WHITE;
793  if (now & A_REVERSE)
794  {
795  short tmp = fgp;
796  fgp = bgp;
797  bgp = tmp;
798  }
799  if (color_content(fgp, &r, &g, &b) != OK) {
800  r = g = b = 0;
801  }
802  fg.r = r; fg.b = b; fg.g = g;
803  if (color_content(bgp, &r, &g, &b) != OK) {
804  r = g = b = 255;
805  }
806  bg.r = r; bg.b = b; bg.g = g;
807 #define ADJUST(x) (x = x * 255 / 1000)
808  ADJUST(fg.r);
809  ADJUST(fg.g);
810  ADJUST(fg.b);
811  ADJUST(bg.r);
812  ADJUST(bg.b);
813  ADJUST(bg.g);
814 
815  if (x) fprintf(file, "</span>");
816  fprintf(file, "<span style=\"background:#%02x%02x%02x;color:#%02x%02x%02x\">",
817  bg.r, bg.g, bg.b, fg.r, fg.g, fg.b);
818  }
819  print = ch;
820 #ifndef NO_WIDECHAR
821  if (wch.chars[0] > 255) {
822  snprintf(unicode, sizeof(unicode), "&#x%x;", (unsigned int)wch.chars[0]);
823  print = unicode;
824  }
825 #endif
826  if (now & A_ALTCHARSET)
827  {
828  int u;
829  for (u = 0; unis[u].ascii; u++) {
830  if (ch[0] == unis[u].ascii) {
831  print = unis[u].unicode;
832  break;
833  }
834  }
835  if (!unis[u].ascii)
836  print = " ";
837  }
838  if (ch[0] == '&')
839  fprintf(file, "&amp;");
840  else if (ch[0] == '<')
841  fprintf(file, "&lt;");
842  else if (ch[0] == '>')
843  fprintf(file, "&gt;");
844  else
845  fprintf(file, "%s", print);
846  old = now;
847  }
848  fprintf(file, "</span>\n");
849  old = 0;
850  }
851  fprintf(file, "</pre>\n</body>");
852  fclose(file);
853 }
854 
855 static void
857 {
859 }
860 
861 static gboolean
862 dump_screen(GntBindable *b, GList *null)
863 {
866 
867  g_object_set(G_OBJECT(window), "vertical", TRUE, NULL);
868  gnt_box_add_widget(GNT_BOX(window), gnt_label_new("Please enter the filename to save the screenshot."));
869  gnt_box_set_title(GNT_BOX(window), "Save Screenshot...");
870 
871  gnt_file_sel_set_suggested_filename(sel, "dump.html");
872  g_signal_connect(G_OBJECT(sel), "file_selected", G_CALLBACK(dump_file_save), NULL);
873  g_signal_connect(G_OBJECT(sel->cancel), "activate", G_CALLBACK(dump_file_cancel), sel);
875  return TRUE;
876 }
877 
878 static void
880 {
881  GList *all = wm->cws->list;
882  GList *list = g_list_find(all, widget);
883  int length, pos;
884  if (!list)
885  return;
886 
887  length = g_list_length(all);
888  pos = g_list_position(all, list);
889 
890  pos += dir;
891  if (dir > 0)
892  pos++;
893 
894  if (pos < 0)
895  pos = length;
896  else if (pos > length)
897  pos = 0;
898 
899  all = g_list_insert(all, widget, pos);
900  all = g_list_delete_link(all, list);
901  wm->cws->list = all;
903  if (wm->cws->ordered) {
904  GntWidget *w = wm->cws->ordered->data;
905  GntNode *node = g_hash_table_lookup(wm->nodes, w);
906  top_panel(node->panel);
907  update_panels();
908  doupdate();
909  }
910 }
911 
912 static gboolean
913 shift_left(GntBindable *bindable, GList *null)
914 {
915  GntWM *wm = GNT_WM(bindable);
916  if (wm->_list.window)
917  return TRUE;
918 
919  if(!wm->cws->ordered)
920  return FALSE;
921 
922  shift_window(wm, wm->cws->ordered->data, -1);
923  return TRUE;
924 }
925 
926 static gboolean
927 shift_right(GntBindable *bindable, GList *null)
928 {
929  GntWM *wm = GNT_WM(bindable);
930 
931  if (wm->_list.window)
932  return TRUE;
933 
934  if(!wm->cws->ordered)
935  return FALSE;
936 
937  shift_window(wm, wm->cws->ordered->data, 1);
938  return TRUE;
939 }
940 
941 static void
943 {
945  action->callback();
947 }
948 
949 static int
950 compare_action(gconstpointer p1, gconstpointer p2)
951 {
952  const GntAction *a1 = p1;
953  const GntAction *a2 = p2;
954 
955  return g_utf8_collate(a1->label, a2->label);
956 }
957 
958 static gboolean
959 list_actions(GntBindable *bindable, GList *null)
960 {
961  GntWidget *tree, *win;
962  GList *iter;
963  GntWM *wm = GNT_WM(bindable);
964  int n;
965  if (wm->_list.window || wm->menu)
966  return TRUE;
967 
968  if (wm->acts == NULL)
969  return TRUE;
970 
971  setup__list(wm);
972  wm->actions = &wm->_list;
973 
974  win = wm->actions->window;
975  tree = wm->actions->tree;
976 
977  gnt_box_set_title(GNT_BOX(win), "Actions");
979  /* XXX: Do we really want this? */
981 
982  for (iter = wm->acts; iter; iter = iter->next) {
983  GntAction *action = iter->data;
986  }
987  g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(action_list_activate), wm);
988  n = g_list_length(wm->acts);
989  gnt_widget_set_size(tree, 0, n);
990  gnt_widget_set_position(win, 0, getmaxy(stdscr) - 3 - n);
991 
992  gnt_widget_show(win);
993  return TRUE;
994 }
995 
996 #ifndef NO_WIDECHAR
997 static int
998 widestringwidth(wchar_t *wide)
999 {
1000  int len, ret;
1001  char *string;
1002 
1003  len = wcstombs(NULL, wide, 0) + 1;
1004  string = g_new0(char, len);
1005  wcstombs(string, wide, len);
1006  ret = string ? gnt_util_onscreen_width(string, NULL) : 1;
1007  g_free(string);
1008  return ret;
1009 }
1010 #endif
1011 
1012 /* Returns the onscreen width of the character at the position */
1013 static int
1014 reverse_char(WINDOW *d, int y, int x, gboolean set)
1015 {
1016 #define DECIDE(ch) (set ? ((ch) | A_REVERSE) : ((ch) & ~A_REVERSE))
1017 
1018 #ifdef NO_WIDECHAR
1019  chtype ch;
1020  ch = mvwinch(d, y, x);
1021  mvwaddch(d, y, x, DECIDE(ch));
1022  return 1;
1023 #else
1024  cchar_t ch;
1025  int wc = 1;
1026  if (mvwin_wch(d, y, x, &ch) == OK) {
1027  wc = widestringwidth(ch.chars);
1028  ch.attr = DECIDE(ch.attr);
1029  ch.attr &= WA_ATTRIBUTES; /* XXX: This is a workaround for a bug */
1030  mvwadd_wch(d, y, x, &ch);
1031  }
1032 
1033  return wc;
1034 #endif
1035 }
1036 
1037 static void
1039 {
1040  int i;
1041  int w, h;
1042  WINDOW *d;
1043 
1045  return;
1046 
1047  d = win->window;
1048  gnt_widget_get_size(win, &w, &h);
1049 
1050  if (gnt_widget_has_shadow(win)) {
1051  --w;
1052  --h;
1053  }
1054 
1055  /* the top and bottom */
1056  for (i = 0; i < w; i += reverse_char(d, 0, i, set));
1057  for (i = 0; i < w; i += reverse_char(d, h-1, i, set));
1058 
1059  /* the left and right */
1060  for (i = 0; i < h; i += reverse_char(d, i, 0, set));
1061  for (i = 0; i < h; i += reverse_char(d, i, w-1, set));
1062 
1063  gnt_wm_copy_win(win, g_hash_table_lookup(wm->nodes, win));
1064  update_screen(wm);
1065 }
1066 
1067 static void
1069 {
1070  if (wm->mode != GNT_KP_MODE_NORMAL) {
1071  if (wm->cws->ordered)
1072  window_reverse(wm->cws->ordered->data, FALSE, wm);
1074  }
1075 }
1076 
1077 static gboolean
1078 start_move(GntBindable *bindable, GList *null)
1079 {
1080  GntWM *wm = GNT_WM(bindable);
1081  if (wm->_list.window || wm->menu)
1082  return TRUE;
1083  if (!wm->cws->ordered)
1084  return TRUE;
1085 
1088 
1089  return TRUE;
1090 }
1091 
1092 static gboolean
1093 start_resize(GntBindable *bindable, GList *null)
1094 {
1095  GntWM *wm = GNT_WM(bindable);
1096  if (wm->_list.window || wm->menu)
1097  return TRUE;
1098  if (!wm->cws->ordered)
1099  return TRUE;
1100 
1103 
1104  return TRUE;
1105 }
1106 
1107 static gboolean
1108 wm_quit(GntBindable *bindable, GList *list)
1109 {
1110  GntWM *wm = GNT_WM(bindable);
1111  if (write_timeout)
1112  write_already(wm);
1113  g_main_loop_quit(wm->loop);
1114  return TRUE;
1115 }
1116 
1117 static gboolean
1118 return_true(GntWM *wm, GntWidget *w, int *a, int *b)
1119 {
1120  return TRUE;
1121 }
1122 
1123 static gboolean
1124 refresh_screen(GntBindable *bindable, GList *null)
1125 {
1126  GntWM *wm = GNT_WM(bindable);
1127  GList *iter;
1128 
1129  endwin();
1130  refresh();
1131 
1132  g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, GINT_TO_POINTER(TRUE));
1133  g_signal_emit(wm, signals[SIG_TERMINAL_REFRESH], 0);
1134 
1135  for (iter = g_list_last(wm->cws->ordered); iter; iter = iter->prev) {
1136  GntWidget *w = iter->data;
1137  GntNode *node = g_hash_table_lookup(wm->nodes, w);
1138  top_panel(node->panel);
1139  }
1140 
1142  update_screen(wm);
1143  curs_set(0); /* endwin resets the cursor to normal */
1144 
1145  return TRUE;
1146 }
1147 
1148 static gboolean
1149 toggle_clipboard(GntBindable *bindable, GList *n)
1150 {
1151  static GntWidget *clip;
1152  gchar *text;
1153  if (clip) {
1154  gnt_widget_destroy(clip);
1155  clip = NULL;
1156  return TRUE;
1157  }
1159  clip = gnt_hwindow_new(FALSE);
1162  gnt_box_set_pad(GNT_BOX(clip), 0);
1166  gnt_widget_set_position(clip, 0, 0);
1167  gnt_widget_draw(clip);
1168  g_free(text);
1169  return TRUE;
1170 }
1171 
1172 static void remove_tag(gpointer wid, gpointer wim)
1173 {
1174  GntWM *wm = GNT_WM(wim);
1175  GntWidget *w = GNT_WIDGET(wid);
1176  wm->tagged = g_list_remove(wm->tagged, w);
1177  mvwhline(w->window, 0, 1, ACS_HLINE | gnt_color_pair(GNT_COLOR_NORMAL), 3);
1178  gnt_widget_draw(w);
1179 }
1180 
1181 static gboolean
1183 {
1184  GntWM *wm = GNT_WM(b);
1185  GntWidget *widget;
1186 
1187  if (!wm->cws->ordered)
1188  return FALSE;
1189  widget = wm->cws->ordered->data;
1190 
1191  if (g_list_find(wm->tagged, widget)) {
1192  remove_tag(widget, wm);
1193  return TRUE;
1194  }
1195 
1196  wm->tagged = g_list_prepend(wm->tagged, widget);
1197  wbkgdset(widget->window, ' ' | gnt_color_pair(GNT_COLOR_HIGHLIGHT));
1198  mvwprintw(widget->window, 0, 1, "[T]");
1200  return TRUE;
1201 }
1202 
1203 static void
1204 widget_move_ws(gpointer wid, gpointer w)
1205 {
1206  GntWM *wm = GNT_WM(w);
1208 }
1209 
1210 static gboolean
1212 {
1213  GntWM *wm = GNT_WM(b);
1214  g_list_foreach(wm->tagged, widget_move_ws, wm);
1215  g_list_foreach(wm->tagged, remove_tag, wm);
1216  g_list_free(wm->tagged);
1217  wm->tagged = NULL;
1218  return TRUE;
1219 }
1220 
1221 static gboolean
1223 {
1224  GntWM *wm = GNT_WM(b);
1225 
1226  if (wm->_list.window || wm->menu)
1227  return TRUE;
1228 
1230 
1231  return TRUE;
1232 }
1233 
1234 static gboolean
1235 workspace_new(GntBindable *bindable, GList *null)
1236 {
1237  GntWM *wm = GNT_WM(bindable);
1238  GntWS *ws = gnt_ws_new(NULL);
1239  gnt_wm_add_workspace(wm, ws);
1240  gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
1241  return TRUE;
1242 }
1243 
1244 static gboolean
1245 ignore_keys_start(GntBindable *bindable, GList *n)
1246 {
1247  GntWM *wm = GNT_WM(bindable);
1248 
1249  if(!wm->menu && !wm->_list.window && wm->mode == GNT_KP_MODE_NORMAL){
1250  ignore_keys = TRUE;
1251  return TRUE;
1252  }
1253  return FALSE;
1254 }
1255 
1256 static gboolean
1257 ignore_keys_end(GntBindable *bindable, GList *n)
1258 {
1259  if (ignore_keys) {
1260  ignore_keys = FALSE;
1261  return TRUE;
1262  }
1263  return FALSE;
1264 }
1265 
1266 static gboolean
1267 window_next_urgent(GntBindable *bindable, GList *n)
1268 {
1269  GntWM *wm = GNT_WM(bindable);
1270  switch_window(wm, 1, TRUE);
1271  return TRUE;
1272 }
1273 
1274 static gboolean
1275 window_prev_urgent(GntBindable *bindable, GList *n)
1276 {
1277  GntWM *wm = GNT_WM(bindable);
1278  switch_window(wm, -1, TRUE);
1279  return TRUE;
1280 }
1281 
1282 #ifdef USE_PYTHON
1283 static void
1284 python_script_selected(GntFileSel *fs, const char *path, const char *f, gpointer n)
1285 {
1286  char *dir = g_path_get_dirname(path);
1287  FILE *file = fopen(path, "r");
1288  PyObject *pp = PySys_GetObject("path");
1289 #if PY_MAJOR_VERSION >= 3
1290  PyObject *dirobj = PyUnicode_FromString(dir);
1291 #else
1292  PyObject *dirobj = PyString_FromString(dir);
1293 #endif
1294 
1295  PyList_Insert(pp, 0, dirobj);
1296  Py_DECREF(dirobj);
1297  PyRun_SimpleFile(file, path);
1298  fclose(file);
1299 
1300  if (PyErr_Occurred()) {
1301  PyErr_Print();
1302  }
1303  g_free(dir);
1304 
1306 }
1307 
1308 static gboolean
1309 run_python(GntBindable *bindable, GList *n)
1310 {
1312  GntFileSel *sel = GNT_FILE_SEL(window);
1313 
1314  g_object_set(G_OBJECT(window), "vertical", TRUE, NULL);
1315  gnt_box_add_widget(GNT_BOX(window), gnt_label_new("Please select the python script you want to run."));
1316  gnt_box_set_title(GNT_BOX(window), "Select Python Script...");
1317 
1318  g_signal_connect(G_OBJECT(sel), "file_selected", G_CALLBACK(python_script_selected), NULL);
1319  g_signal_connect_swapped(G_OBJECT(sel->cancel), "activate", G_CALLBACK(gnt_widget_destroy), sel);
1321  return TRUE;
1322 }
1323 #endif /* USE_PYTHON */
1324 
1325 static gboolean
1327 {
1328  gboolean ret = TRUE;
1330 
1331  if (klass->help_window) {
1333  } else {
1334  ret = gnt_bindable_build_help_window(bindable);
1335  }
1336  return ret;
1337 }
1338 
1339 static gboolean
1340 help_for_wm(GntBindable *bindable, GList *null)
1341 {
1342  return help_for_bindable(GNT_WM(bindable),bindable);
1343 }
1344 
1345 static gboolean
1346 help_for_window(GntBindable *bindable, GList *null)
1347 {
1348  GntWM *wm = GNT_WM(bindable);
1349  GntWidget *widget;
1350 
1351  if(!wm->cws->ordered)
1352  return FALSE;
1353 
1354  widget = wm->cws->ordered->data;
1355 
1357 }
1358 
1359 static gboolean
1360 help_for_widget(GntBindable *bindable, GList *null)
1361 {
1362  GntWM *wm = GNT_WM(bindable);
1363  GntWidget *widget;
1364 
1365  if (!wm->cws->ordered)
1366  return TRUE;
1367 
1368  widget = wm->cws->ordered->data;
1369  if (!GNT_IS_BOX(widget))
1370  return TRUE;
1371 
1372  return help_for_bindable(wm, GNT_BINDABLE(GNT_BOX(widget)->active));
1373 }
1374 
1375 static void
1376 accumulate_windows(gpointer window, gpointer node, gpointer p)
1377 {
1378  GList *list = *(GList**)p;
1379  list = g_list_prepend(list, window);
1380  *(GList**)p = list;
1381 }
1382 
1383 static void
1385 {
1386  GntWM *wm = GNT_WM(obj);
1387  GList *list = NULL;
1388  g_hash_table_foreach(wm->nodes, accumulate_windows, &list);
1389  g_list_foreach(list, (GFunc)gnt_widget_destroy, NULL);
1390  g_list_free(list);
1391  g_hash_table_destroy(wm->nodes);
1392  wm->nodes = NULL;
1393 
1394  while (wm->workspaces) {
1395  g_object_unref(wm->workspaces->data);
1396  wm->workspaces = g_list_delete_link(wm->workspaces, wm->workspaces);
1397  }
1398 #ifdef USE_PYTHON
1399  if (started_python) {
1400  Py_Finalize();
1401  started_python = FALSE;
1402  }
1403 #endif
1404 }
1405 
1406 static void
1408 {
1409  int i;
1410  GObjectClass *gclass = G_OBJECT_CLASS(klass);
1411  char key[32];
1412 
1413  gclass->dispose = gnt_wm_destroy;
1414 
1415  klass->new_window = gnt_wm_new_window_real;
1416  klass->decorate_window = NULL;
1417  klass->close_window = NULL;
1418  klass->window_resize_confirm = return_true;
1419  klass->window_resized = gnt_wm_win_resized;
1420  klass->window_move_confirm = return_true;
1421  klass->window_moved = gnt_wm_win_moved;
1422  klass->window_update = NULL;
1423  klass->key_pressed = NULL;
1424  klass->mouse_clicked = NULL;
1425  klass->give_focus = gnt_wm_give_focus;
1426 
1427  signals[SIG_NEW_WIN] =
1428  g_signal_new("new_win",
1429  G_TYPE_FROM_CLASS(klass),
1430  G_SIGNAL_RUN_LAST,
1431  G_STRUCT_OFFSET(GntWMClass, new_window),
1432  NULL, NULL,
1433  g_cclosure_marshal_VOID__POINTER,
1434  G_TYPE_NONE, 1, G_TYPE_POINTER);
1436  g_signal_new("decorate_win",
1437  G_TYPE_FROM_CLASS(klass),
1438  G_SIGNAL_RUN_LAST,
1439  G_STRUCT_OFFSET(GntWMClass, decorate_window),
1440  NULL, NULL,
1441  g_cclosure_marshal_VOID__POINTER,
1442  G_TYPE_NONE, 1, G_TYPE_POINTER);
1444  g_signal_new("close_win",
1445  G_TYPE_FROM_CLASS(klass),
1446  G_SIGNAL_RUN_LAST,
1447  G_STRUCT_OFFSET(GntWMClass, close_window),
1448  NULL, NULL,
1449  g_cclosure_marshal_VOID__POINTER,
1450  G_TYPE_NONE, 1, G_TYPE_POINTER);
1452  g_signal_new("confirm_resize",
1453  G_TYPE_FROM_CLASS(klass),
1454  G_SIGNAL_RUN_LAST,
1455  G_STRUCT_OFFSET(GntWMClass, window_resize_confirm),
1458  G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1459 
1461  g_signal_new("confirm_move",
1462  G_TYPE_FROM_CLASS(klass),
1463  G_SIGNAL_RUN_LAST,
1464  G_STRUCT_OFFSET(GntWMClass, window_move_confirm),
1467  G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1468 
1469  signals[SIG_RESIZED] =
1470  g_signal_new("window_resized",
1471  G_TYPE_FROM_CLASS(klass),
1472  G_SIGNAL_RUN_LAST,
1473  G_STRUCT_OFFSET(GntWMClass, window_resized),
1474  NULL, NULL,
1475  g_cclosure_marshal_VOID__POINTER,
1476  G_TYPE_NONE, 1, G_TYPE_POINTER);
1477  signals[SIG_MOVED] =
1478  g_signal_new("window_moved",
1479  G_TYPE_FROM_CLASS(klass),
1480  G_SIGNAL_RUN_LAST,
1481  G_STRUCT_OFFSET(GntWMClass, window_moved),
1482  NULL, NULL,
1483  g_cclosure_marshal_VOID__POINTER,
1484  G_TYPE_NONE, 1, G_TYPE_POINTER);
1486  g_signal_new("window_update",
1487  G_TYPE_FROM_CLASS(klass),
1488  G_SIGNAL_RUN_LAST,
1489  G_STRUCT_OFFSET(GntWMClass, window_update),
1490  NULL, NULL,
1491  g_cclosure_marshal_VOID__POINTER,
1492  G_TYPE_NONE, 1, G_TYPE_POINTER);
1493 
1495  g_signal_new("give_focus",
1496  G_TYPE_FROM_CLASS(klass),
1497  G_SIGNAL_RUN_LAST,
1498  G_STRUCT_OFFSET(GntWMClass, give_focus),
1499  NULL, NULL,
1500  g_cclosure_marshal_VOID__POINTER,
1501  G_TYPE_NONE, 1, G_TYPE_POINTER);
1502 
1504  g_signal_new("mouse_clicked",
1505  G_TYPE_FROM_CLASS(klass),
1506  G_SIGNAL_RUN_LAST,
1507  G_STRUCT_OFFSET(GntWMClass, mouse_clicked),
1510  G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER);
1511 
1513  g_signal_new("terminal-refresh",
1514  G_TYPE_FROM_CLASS(klass),
1515  G_SIGNAL_RUN_LAST,
1516  G_STRUCT_OFFSET(GntWMClass, terminal_refresh),
1517  NULL, NULL,
1518  g_cclosure_marshal_VOID__VOID,
1519  G_TYPE_NONE, 0);
1520 
1522  "\033" "n", NULL);
1524  "\033" "p", NULL);
1526  "\033" "c", NULL);
1528  "\033" "w", NULL);
1530  "\033" "D", NULL);
1532  "\033" ",", NULL);
1534  "\033" ".", NULL);
1536  "\033" "a", NULL);
1538  "\033" "m", NULL);
1540  "\033" "r", NULL);
1542  "\033" "q", NULL);
1544  "\033" "l", NULL);
1546  NULL, NULL);
1548  "\033" GNT_KEY_CTRL_J, NULL);
1550  "\033" GNT_KEY_CTRL_K, NULL);
1552  "\033" "/", NULL);
1554  GNT_KEY_F9, NULL);
1556  "\033" ">", NULL);
1558  "\033" "<", NULL);
1560  "\033" "t", NULL);
1562  "\033" "T", NULL);
1564  "\033" "s", NULL);
1566  "\033" "C", NULL);
1568  "\033" "\\", NULL);
1570  "\033" "|", NULL);
1572  NULL, NULL);
1574  "\033" GNT_KEY_CTRL_G, NULL);
1576  "\033" "\t", NULL);
1577  snprintf(key, sizeof(key), "\033%s", GNT_KEY_BACK_TAB);
1579  key[1] ? key : NULL, NULL);
1580 #ifdef USE_PYTHON
1581  gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python,
1582  GNT_KEY_F3, NULL);
1583  if (!Py_IsInitialized()) {
1584 #if PY_MAJOR_VERSION >= 3
1585  wchar_t *name;
1586  size_t len;
1587  len = mbstowcs(NULL, "gnt", 0);
1588  name = g_new(wchar_t, len + 1);
1589  mbstowcs(name, "gnt", len + 1);
1590  Py_SetProgramName(name);
1591  g_free(name);
1592 #else
1593  Py_SetProgramName("gnt");
1594 #endif
1595  Py_Initialize();
1596  started_python = TRUE;
1597  }
1598 #endif
1599 
1600  gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));
1601 
1602  /* Make sure Alt+x are detected properly. */
1603  for (i = '0'; i <= '9'; i++) {
1604  char str[] = "\033X";
1605  str[1] = i;
1607  }
1608 
1609  GNTDEBUG;
1610 }
1611 
1612 /******************************************************************************
1613  * GntWM API
1614  *****************************************************************************/
1615 GType
1616 gnt_wm_get_gtype(void)
1617 {
1618  static GType type = 0;
1619 
1620  if(type == 0) {
1621  static const GTypeInfo info = {
1622  sizeof(GntWMClass),
1623  NULL, /* base_init */
1624  NULL, /* base_finalize */
1625  (GClassInitFunc)gnt_wm_class_init,
1626  NULL,
1627  NULL, /* class_data */
1628  sizeof(GntWM),
1629  0, /* n_preallocs */
1630  gnt_wm_init, /* instance_init */
1631  NULL /* value_table */
1632  };
1633 
1634  type = g_type_register_static(GNT_TYPE_BINDABLE,
1635  "GntWM",
1636  &info, 0);
1637  }
1638 
1639  return type;
1640 }
1641 
1642 void
1644 {
1645  wm->workspaces = g_list_append(wm->workspaces, ws);
1646 }
1647 
1648 gboolean
1650 {
1651  GntWS *s = g_list_nth_data(wm->workspaces, n);
1652  if (!s)
1653  return FALSE;
1654 
1655  if (wm->_list.window) {
1657  }
1659  gnt_ws_hide(wm->cws, wm->nodes);
1660  wm->cws = s;
1661  gnt_ws_show(wm->cws, wm->nodes);
1662 
1664  update_screen(wm);
1665  if (wm->cws->ordered) {
1666  gnt_wm_raise_window(wm, wm->cws->ordered->data);
1667  }
1668 
1669  if (act && g_list_find(act, wm->cws)) {
1670  act = g_list_remove(act, wm->cws);
1671  update_act_msg();
1672  }
1673  return TRUE;
1674 }
1675 
1676 gboolean
1678 {
1679  int n = g_list_index(wm->workspaces, wm->cws);
1680  return gnt_wm_switch_workspace(wm, --n);
1681 }
1682 
1683 gboolean
1685 {
1686  int n = g_list_index(wm->workspaces, wm->cws);
1687  return gnt_wm_switch_workspace(wm, ++n);
1688 }
1689 
1690 static gboolean
1691 workspace_next(GntBindable *wm, GList *n)
1692 {
1694 }
1695 
1696 static gboolean
1697 workspace_prev(GntBindable *wm, GList *n)
1698 {
1700 }
1701 
1702 void
1704 {
1706  GntNode *node;
1707  if (!oldw || oldw == neww)
1708  return;
1709  node = g_hash_table_lookup(wm->nodes, widget);
1710  if (node && node->ws == neww)
1711  return;
1712 
1713  if (node)
1714  node->ws = neww;
1715 
1717  gnt_ws_add_widget(neww, widget);
1718  if (neww == wm->cws) {
1720  } else {
1722  }
1723 }
1725 static gint widget_in_workspace(gconstpointer workspace, gconstpointer wid)
1726 {
1727  GntWS *s = (GntWS *)workspace;
1728  if (s->list && g_list_find(s->list, wid))
1729  return 0;
1730  return 1;
1731 }
1734 {
1735  GList *l = g_list_find_custom(wm->workspaces, widget, widget_in_workspace);
1736  if (l)
1737  return l->data;
1738  return NULL;
1739 }
1741 static void free_workspaces(gpointer data, gpointer n)
1742 {
1743  GntWS *s = data;
1744  g_free(s->name);
1745 }
1747 void gnt_wm_set_workspaces(GntWM *wm, GList *workspaces)
1748 {
1749  g_list_foreach(wm->workspaces, free_workspaces, NULL);
1750  wm->workspaces = workspaces;
1752 }
1753 
1754 static void
1756 {
1758 
1759  if (wm->windows == NULL)
1760  return;
1761 
1762  if (wm->cws->ordered && wid == wm->cws->ordered->data)
1766 
1768 }
1769 
1770 static gboolean
1771 match_title(gpointer title, gpointer n, gpointer wid_title)
1772 {
1773  /* XXX: do any regex magic here. */
1774  if (g_strrstr((gchar *)wid_title, (gchar *)title))
1775  return TRUE;
1776  return FALSE;
1777 }
1778 
1779 #if !GLIB_CHECK_VERSION(2,4,0)
1780 struct
1782  gpointer data;
1783  gpointer value;
1784 } table_find_data;
1785 
1786 static void
1787 table_find_helper(gpointer key, gpointer value, gpointer data)
1788 {
1789  GHRFunc func = data;
1790  if (func(key, value, table_find_data.data))
1791  table_find_data.value = value;
1792 }
1793 
1794 static gpointer
1795 g_hash_table_find(GHashTable * table, GHRFunc func, gpointer data)
1796 {
1797  table_find_data.data = data;
1798  table_find_data.value = NULL;
1799  g_hash_table_foreach(table, table_find_helper, func);
1800  return table_find_data.value;
1801 }
1802 #endif
1803 
1804 static GntWS *
1806 {
1807  GntWS *ret = NULL;
1808  const gchar *name, *title;
1809  title = GNT_BOX(widget)->title;
1810  if (title)
1811  ret = g_hash_table_find(wm->title_places, match_title, (gpointer)title);
1812  if (ret)
1813  return ret;
1815  if (name)
1816  ret = g_hash_table_find(wm->name_places, match_title, (gpointer)name);
1817  return ret ? ret : wm->cws;
1818 }
1819 
1820 static void
1822 {
1823  GntNode *node;
1824  gboolean transient = FALSE;
1825 
1826  if (widget->window == NULL)
1827  return;
1828 
1829  node = g_new0(GntNode, 1);
1830  node->me = widget;
1831  node->scroll = 0;
1832 
1833  g_hash_table_replace(wm->nodes, widget, node);
1834 
1835  refresh_node(widget, node, GINT_TO_POINTER(TRUE));
1836 
1837  transient = !!GNT_WIDGET_IS_FLAG_SET(node->me, GNT_WIDGET_TRANSIENT);
1838 
1839 #if 1
1840  {
1841  int x, y, w, h, maxx, maxy;
1842  gboolean shadow = TRUE;
1843 
1845  shadow = FALSE;
1846  x = widget->priv.x;
1847  y = widget->priv.y;
1848  w = widget->priv.width + shadow;
1849  h = widget->priv.height + shadow;
1850 
1851  maxx = getmaxx(stdscr);
1852  maxy = getmaxy(stdscr) - 1; /* room for the taskbar */
1853  maxx = MAX(0, maxx);
1854  maxy = MAX(0, maxy);
1855 
1856  x = MAX(0, x);
1857  y = MAX(0, y);
1858  if (x + w >= maxx)
1859  x = MAX(0, maxx - w);
1860  if (y + h >= maxy)
1861  y = MAX(0, maxy - h);
1862 
1863  w = MIN(w, maxx);
1864  h = MIN(h, maxy);
1865  node->window = newwin(h, w, y, x);
1867  }
1868 #endif
1869 
1870  node->panel = new_panel(node->window);
1871  set_panel_userptr(node->panel, node);
1872 
1873  if (!transient) {
1874  GntWS *ws = wm->cws;
1875  if (node->me != wm->_list.window) {
1876  if (GNT_IS_BOX(widget)) {
1878  }
1879  node->ws = ws;
1880  ws->list = g_list_append(ws->list, widget);
1881  ws->ordered = g_list_append(ws->ordered, widget);
1882  }
1883 
1884  if (wm->event_stack || node->me == wm->_list.window ||
1885  node->me == ws->ordered->data) {
1886  gnt_wm_raise_window(wm, node->me);
1887  } else {
1888  bottom_panel(node->panel); /* New windows should not grab focus */
1891  if (wm->cws != ws)
1893  }
1894  }
1895 }
1898 {
1899  while (widget->parent)
1900  widget = widget->parent;
1901 
1903  g_hash_table_lookup(wm->nodes, widget)) {
1904  update_screen(wm);
1905  return;
1906  }
1907 
1908  if (GNT_IS_BOX(widget)) {
1909  const char *title = GNT_BOX(widget)->title;
1910  GntPosition *p = NULL;
1911  if (title && (p = g_hash_table_lookup(wm->positions, title)) != NULL) {
1912  sanitize_position(widget, &p->x, &p->y, TRUE);
1913  gnt_widget_set_position(widget, p->x, p->y);
1914  mvwin(widget->window, p->y, p->x);
1915  }
1916  }
1917 
1918  g_signal_emit(wm, signals[SIG_NEW_WIN], 0, widget);
1919  g_signal_emit(wm, signals[SIG_DECORATE_WIN], 0, widget);
1920 
1922  if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && wm->_list.window != widget
1926  g_object_get_data(G_OBJECT(wm->windows->tree), "workspace") ? wm->cws : NULL);
1928  }
1929  }
1930 
1932  update_screen(wm);
1933 }
1936 {
1937  g_signal_emit(wm, signals[SIG_DECORATE_WIN], 0, widget);
1938 }
1941 {
1942  GntWS *s;
1943  int pos;
1944  gboolean transient = !!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT);
1945 
1947 
1948  if (g_hash_table_lookup(wm->nodes, widget) == NULL)
1949  return;
1950 
1951  g_signal_emit(wm, signals[SIG_CLOSE_WIN], 0, widget);
1952  g_hash_table_remove(wm->nodes, widget);
1953 
1954  if (wm->windows) {
1956  }
1957 
1958  if (s) {
1959  pos = g_list_index(s->list, widget);
1960 
1961  if (pos != -1) {
1962  s->list = g_list_remove(s->list, widget);
1963  s->ordered = g_list_remove(s->ordered, widget);
1964 
1965  if (s->ordered && wm->cws == s)
1966  gnt_wm_raise_window(wm, s->ordered->data);
1967  }
1968  } else if (transient && wm->cws && wm->cws->ordered) {
1969  gnt_wm_update_window(wm, wm->cws->ordered->data);
1970  }
1971 
1973  update_screen(wm);
1974 }
1976 time_t gnt_wm_get_idle_time()
1977 {
1978  return time(NULL) - last_active_time;
1979 }
1981 gboolean gnt_wm_process_input(GntWM *wm, const char *keys)
1982 {
1983  gboolean ret = FALSE;
1984 
1986 
1987  idle_update = TRUE;
1988  if(ignore_keys){
1989  if(keys && !strcmp(keys, "\033" GNT_KEY_CTRL_G)){
1991  return TRUE;
1992  }
1993  }
1995  }
1996 
1998  return TRUE;
1999  }
2000 
2001  /* Do some manual checking */
2002  if (wm->cws->ordered && wm->mode != GNT_KP_MODE_NORMAL) {
2003  int xmin = 0, ymin = 0, xmax = getmaxx(stdscr), ymax = getmaxy(stdscr) - 1;
2004  int x, y, w, h;
2005  GntWidget *widget = GNT_WIDGET(wm->cws->ordered->data);
2006  int ox, oy, ow, oh;
2007 
2009  gnt_widget_get_size(widget, &w, &h);
2010  ox = x; oy = y;
2011  ow = w; oh = h;
2012 
2013  if (wm->mode == GNT_KP_MODE_MOVE) {
2014  if (strcmp(keys, GNT_KEY_LEFT) == 0) {
2015  if (x > xmin)
2016  x--;
2017  } else if (strcmp(keys, GNT_KEY_RIGHT) == 0) {
2018  if (x + w < xmax)
2019  x++;
2020  } else if (strcmp(keys, GNT_KEY_UP) == 0) {
2021  if (y > ymin)
2022  y--;
2023  } else if (strcmp(keys, GNT_KEY_DOWN) == 0) {
2024  if (y + h < ymax)
2025  y++;
2026  }
2027  if (ox != x || oy != y) {
2030  return TRUE;
2031  }
2032  } else if (wm->mode == GNT_KP_MODE_RESIZE) {
2033  if (strcmp(keys, GNT_KEY_LEFT) == 0) {
2034  w--;
2035  } else if (strcmp(keys, GNT_KEY_RIGHT) == 0) {
2036  if (x + w < xmax)
2037  w++;
2038  } else if (strcmp(keys, GNT_KEY_UP) == 0) {
2039  h--;
2040  } else if (strcmp(keys, GNT_KEY_DOWN) == 0) {
2041  if (y + h < ymax)
2042  h++;
2043  }
2044  if (oh != h || ow != w) {
2047  return TRUE;
2048  }
2049  }
2050  if (strcmp(keys, "\r") == 0 || strcmp(keys, "\033") == 0) {
2053  }
2054  return TRUE;
2055  }
2056 
2057  /* Escape to close the window-list or action-list window */
2058  if (strcmp(keys, "\033") == 0) {
2059  if (wm->_list.window) {
2061  return TRUE;
2062  }
2063  } else if (keys[0] == '\033' && isdigit(keys[1]) && keys[2] == '\0') {
2064  /* Alt+x for quick switch */
2065  int n = *(keys + 1) - '0';
2066  GList *list = NULL;
2067 
2068  if (n == 0)
2069  n = 10;
2070 
2071  list = g_list_append(list, GINT_TO_POINTER(n - 1));
2073  g_list_free(list);
2074  return TRUE;
2075  }
2076 
2077  if (wm->menu)
2079  else if (wm->_list.window)
2081  else if (wm->cws->ordered) {
2082  GntWidget *win = wm->cws->ordered->data;
2083  if (GNT_IS_WINDOW(win)) {
2084  GntMenu *menu = GNT_WINDOW(win)->menu;
2085  if (menu) {
2086  const char *id = gnt_window_get_accel_item(GNT_WINDOW(win), keys);
2087  if (id) {
2088  GntMenuItem *item = gnt_menu_get_item(menu, id);
2089  if (item)
2090  ret = gnt_menuitem_activate(item);
2091  }
2092  }
2093  }
2094  if (!ret)
2095  ret = gnt_widget_key_pressed(win, keys);
2096  }
2097  return ret;
2098 }
2099 
2100 static void
2102 {
2103  /*refresh_node(node->me, node, NULL);*/
2104 }
2105 
2106 static void
2108 {
2109  refresh_node(node->me, node, NULL);
2110 }
2112 void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height)
2113 {
2114  gboolean ret = TRUE;
2115  GntNode *node;
2116  int maxx, maxy;
2117 
2118  while (widget->parent)
2119  widget = widget->parent;
2120  node = g_hash_table_lookup(wm->nodes, widget);
2121  if (!node)
2122  return;
2123 
2124  g_signal_emit(wm, signals[SIG_CONFIRM_RESIZE], 0, widget, &width, &height, &ret);
2125  if (!ret)
2126  return; /* resize is not permitted */
2127  hide_panel(node->panel);
2128  gnt_widget_set_size(widget, width, height);
2130 
2131  maxx = getmaxx(stdscr);
2132  maxy = getmaxy(stdscr) - 1;
2133  height = MIN(height, maxy);
2134  width = MIN(width, maxx);
2135  wresize(node->window, height, width);
2136  replace_panel(node->panel, node->window);
2137 
2138  g_signal_emit(wm, signals[SIG_RESIZED], 0, node);
2139 
2140  show_panel(node->panel);
2141  update_screen(wm);
2142 }
2143 
2144 static void
2145 write_gdi(gpointer key, gpointer value, gpointer data)
2146 {
2147  GntPosition *p = value;
2148  fprintf(data, ".%s = %d;%d\n", (char *)key, p->x, p->y);
2149 }
2150 
2151 static gboolean
2152 write_already(gpointer data)
2153 {
2154  GntWM *wm = data;
2155  FILE *file;
2156  char *filename;
2157 
2158  filename = g_build_filename(g_get_home_dir(), ".gntpositions", NULL);
2159 
2160  file = fopen(filename, "wb");
2161  if (file == NULL) {
2162  gnt_warning("error opening file (%s) to save positions", filename);
2163  } else {
2164  fprintf(file, "[positions]\n");
2165  g_hash_table_foreach(wm->positions, write_gdi, file);
2166  fclose(file);
2167  }
2168 
2169  g_free(filename);
2170  g_source_remove(write_timeout);
2171  write_timeout = 0;
2172  return FALSE;
2173 }
2174 
2175 static void
2177 {
2178  if (write_timeout) {
2179  g_source_remove(write_timeout);
2180  }
2182 }
2184 void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y)
2185 {
2186  gboolean ret = TRUE;
2187  GntNode *node;
2188 
2189  while (widget->parent)
2190  widget = widget->parent;
2191  node = g_hash_table_lookup(wm->nodes, widget);
2192  if (!node)
2193  return;
2194 
2195  g_signal_emit(wm, signals[SIG_CONFIRM_MOVE], 0, widget, &x, &y, &ret);
2196  if (!ret)
2197  return; /* resize is not permitted */
2198 
2200  move_panel(node->panel, y, x);
2201 
2202  g_signal_emit(wm, signals[SIG_MOVED], 0, node);
2205  const char *title = GNT_BOX(widget)->title;
2206  if (title) {
2207  GntPosition *p = g_new0(GntPosition, 1);
2208  GntWidget *wid = node->me;
2209  p->x = wid->priv.x;
2210  p->y = wid->priv.y;
2211  g_hash_table_replace(wm->positions, g_strdup(title), p);
2213  }
2214  }
2215 
2216  update_screen(wm);
2217 }
2218 
2219 static void
2221 {
2222  GntNode *node = g_hash_table_lookup(wm->nodes, widget);
2223 
2224  if (!node)
2225  return;
2226 
2227  if (widget != wm->_list.window && !GNT_IS_MENU(widget) &&
2228  wm->cws->ordered->data != widget) {
2229  GntWidget *w = wm->cws->ordered->data;
2232  }
2233 
2237  top_panel(node->panel);
2238 
2239  if (wm->_list.window) {
2240  GntNode *nd = g_hash_table_lookup(wm->nodes, wm->_list.window);
2241  top_panel(nd->panel);
2242  }
2244  update_screen(wm);
2245 }
2248 {
2249  GntNode *node = NULL;
2250  GntWS *ws;
2251 
2252  while (widget->parent)
2253  widget = widget->parent;
2254  if (!GNT_IS_MENU(widget)) {
2255  if (!GNT_IS_BOX(widget))
2256  return;
2258  }
2259 
2261  node = g_hash_table_lookup(wm->nodes, widget);
2262  if (node == NULL) {
2264  } else
2265  g_signal_emit(wm, signals[SIG_UPDATE_WIN], 0, node);
2266 
2270  update_screen(wm);
2271  } else if (ws && ws != wm->cws && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_URGENT)) {
2272  if (!act || (act && !g_list_find(act, ws)))
2273  act = g_list_prepend(act, ws);
2274  update_act_msg();
2275  }
2276 }
2278 gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget)
2279 {
2280  gboolean ret = TRUE;
2281  idle_update = TRUE;
2282  g_signal_emit(wm, signals[SIG_MOUSE_CLICK], 0, event, x, y, widget, &ret);
2283  return ret;
2284 }
2287 {
2289  if (wm->cws != ws)
2290  gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
2291  if (widget != wm->cws->ordered->data) {
2292  GntWidget *wid = wm->cws->ordered->data;
2295  gnt_widget_draw(wid);
2296  }
2299  g_signal_emit(wm, signals[SIG_GIVE_FOCUS], 0, widget);
2300 }
2302 void gnt_wm_set_event_stack(GntWM *wm, gboolean set)
2303 {
2304  wm->event_stack = set;
2305 }
2306 
2307 
update_window_in_list
static void update_window_in_list(GntWM *wm, GntWidget *wid)
Definition: gntwm.c:1754
gnt_widget_set_size
gboolean gnt_widget_set_size(GntWidget *widget, int width, int height)
Definition: gntwidget.c:515
gnt_menuitem_activate
gboolean gnt_menuitem_activate(GntMenuItem *item)
Definition: gntmenuitem.c:149
gnt_wm_get_idle_time
time_t gnt_wm_get_idle_time()
Definition: gntwm.c:1975
info
static PurplePluginInfo info
Definition: gntclipboard.c:147
GNT_WIDGET_NO_BORDER
Definition: gntwidget.h:59
gnt_wm_class_init
static void gnt_wm_class_init(GntWMClass *klass)
Definition: gntwm.c:1407
name
char * name
Definition: gntbindable.c:47
SIG_UPDATE_WIN
Definition: gntwm.c:84
gnt_get_clipboard_string
gchar * gnt_get_clipboard_string(void)
Definition: gntmain.c:693
_GntBindableClass::help_window
GntBindable * help_window
Definition: gntbindable.h:60
compare_action
static int compare_action(gconstpointer p1, gconstpointer p2)
Definition: gntwm.c:950
table_find_helper
static void table_find_helper(gpointer key, gpointer value, gpointer data)
Definition: gntwm.c:1786
GNT_KEY_LEFT
#define GNT_KEY_LEFT
Definition: gntkeys.h:48
gnt_widget_set_urgent
void gnt_widget_set_urgent(GntWidget *widget)
Definition: gntmain.c:596
GNT_TEXT_FLAG_DIM
Definition: gnttextview.h:74
gnt_ws_hide
void gnt_ws_hide(GntWS *ws, GHashTable *nodes)
Definition: gntws.c:141
gnt_box_set_pad
void gnt_box_set_pad(GntBox *box, int pad)
Definition: gntbox.c:695
list_of_windows
static void list_of_windows(GntWM *wm, gboolean workspace)
Definition: gntwm.c:663
gnt_wm_process_click
gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget)
Definition: gntwm.c:2277
_GntFileSel::cancel
GntWidget * cancel
Definition: gntfilesel.h:60
_GntMenu::submenu
GntMenu * submenu
Definition: gntmenu.h:72
GNT_KEY_BACK_TAB
#define GNT_KEY_BACK_TAB
Definition: gntkeys.h:68
gnt_widget_get_size
void gnt_widget_get_size(GntWidget *wid, int *width, int *height)
Definition: gntwidget.c:464
gnt_widget_key_pressed
gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys)
Definition: gntwidget.c:393
gnt_ws_show
void gnt_ws_show(GntWS *ws, GHashTable *nodes)
Definition: gntws.c:157
_GntAction::label
const char * label
Definition: gntwm.h:75
GntMouseEvent
enum _GntMouseEvent GntMouseEvent
wm
static GntWM * wm
Definition: gntmain.c:82
gnt_widget_show
void gnt_widget_show(GntWidget *widget)
Definition: gntwidget.c:326
help_for_window
static gboolean help_for_window(GntBindable *bindable, GList *null)
Definition: gntwm.c:1346
SIG_TERMINAL_REFRESH
Definition: gntwm.c:88
last_active_time
static time_t last_active_time
Definition: gntwm.c:109
g_list_bring_to_front
static GList * g_list_bring_to_front(GList *list, gpointer data)
Definition: gntwm.c:118
_GntWM::mode
GntKeyPressMode mode
Definition: gntwm.h:117
gntbox.h
window_list_key_pressed
static gboolean window_list_key_pressed(GntWidget *widget, const char *text, GntWM *wm)
Definition: gntwm.c:632
flags
SectionFlags flags
Definition: themeedit-icon.c:97
_GntWidgetPriv::x
int x
Definition: gntwidget.h:90
set
static void set(PurpleDesktopItem *item, const char *key, const char *value)
Definition: desktopitem.c:206
_GntMenu
Definition: gntmenu.h:62
_GntPosition::x
int x
Definition: gntwm.h:66
help_for_widget
static gboolean help_for_widget(GntBindable *bindable, GList *null)
Definition: gntwm.c:1360
GNT_KP_MODE_MOVE
Definition: gntwm.h:48
gnt_ws_widget_hide
void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes)
Definition: gntws.c:146
_GntWM::nodes
GHashTable * nodes
Definition: gntwm.h:96
shift_window
static void shift_window(GntWM *wm, GntWidget *widget, int dir)
Definition: gntwm.c:879
gnt_wm_widget_move_workspace
void gnt_wm_widget_move_workspace(GntWM *wm, GntWS *neww, GntWidget *widget)
Definition: gntwm.c:1702
gnt_wm_win_moved
static void gnt_wm_win_moved(GntWM *wm, GntNode *node)
Definition: gntwm.c:2106
CHECK
#define CHECK(attr, start, end)
file
char * file
Definition: gnttextview.c:855
_GntNode
Definition: gntwm.h:52
gnt_wm_copy_win
void gnt_wm_copy_win(GntWidget *widget, GntNode *node)
Definition: gntwm.c:135
write_already
static gboolean write_already(gpointer data)
Definition: gntwm.c:2151
GNT_IS_WS
#define GNT_IS_WS(obj)
Definition: gntws.h:36
gnt_label_new
GntWidget * gnt_label_new(const char *text)
Definition: gntlabel.c:186
gnt_tree_remove
void gnt_tree_remove(GntTree *tree, gpointer key)
Definition: gnttree.c:1479
SIG_RESIZED
Definition: gntwm.c:81
widget
GtkWidget * widget
Definition: pidgintooltip.c:38
GNT_IS_MENU
#define GNT_IS_MENU(obj)
Definition: gntmenu.h:37
_GntWidget
Definition: gntwidget.h:98
return_true
static gboolean return_true(GntWM *wm, GntWidget *w, int *a, int *b)
Definition: gntwm.c:1118
gnt.h
gnt_tree_set_compare_func
void gnt_tree_set_compare_func(GntTree *tree, GCompareFunc func)
Definition: gnttree.c:1783
gnt_tree_set_selected
void gnt_tree_set_selected(GntTree *tree, void *key)
Definition: gnttree.c:1655
switch_window
static void switch_window(GntWM *wm, int direction, gboolean urgent)
Definition: gntwm.c:422
GNT_WINDOW
#define GNT_WINDOW(obj)
Definition: gntwindow.h:37
_GntAction
Definition: gntwm.h:73
g
short g
Definition: gntcolors.c:44
window
GntWidget * window
Definition: gntcertmgr.c:45
SIG_KEY_PRESS
Definition: gntwm.c:86
ignore_keys
static gboolean ignore_keys
Definition: gntwm.c:112
gnt_ws_remove_widget
void gnt_ws_remove_widget(GntWS *ws, GntWidget *wid)
Definition: gntws.c:127
gnt_tree_new
GntWidget * gnt_tree_new()
Definition: gnttree.c:1194
gnt_vbox_new
#define gnt_vbox_new(homo)
Definition: gntbox.h:96
workspace_new
static gboolean workspace_new(GntBindable *bindable, GList *null)
Definition: gntwm.c:1235
_GntWS::ordered
GList * ordered
Definition: gntws.h:47
GNT_STYLE_REMPOS
Definition: gntstyle.h:36
gntutils.h
gnt_ws_get_name
const char * gnt_ws_get_name(GntWS *ws)
Definition: gntws.c:199
GNT_BINDABLE_GET_CLASS
#define GNT_BINDABLE_GET_CLASS(obj)
Definition: gntbindable.h:40
start_resize
static gboolean start_resize(GntBindable *bindable, GList *null)
Definition: gntwm.c:1093
gnt_bindable_build_help_window
gboolean gnt_bindable_build_help_window(GntBindable *bindable)
Definition: gntbindable.c:461
gnt_wm_window_decorate
void gnt_wm_window_decorate(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1934
gnt_hwindow_new
#define gnt_hwindow_new(homo)
Definition: gntwindow.h:82
populate_window_list
static void populate_window_list(GntWM *wm, gboolean workspace)
Definition: gntwm.c:603
setup__list
static void setup__list(GntWM *wm)
Definition: gntwm.c:570
gnt_wm_move_window
void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y)
Definition: gntwm.c:2183
GNT_BOX
#define GNT_BOX(obj)
Definition: gntbox.h:34
gntentry.h
gnt_widget_has_shadow
gboolean gnt_widget_has_shadow(GntWidget *widget)
Definition: gntwidget.c:648
gnt_box_add_widget
void gnt_box_add_widget(GntBox *b, GntWidget *widget)
Definition: gntbox.c:674
gntmenu.h
gnt_menu_get_item
GntMenuItem * gnt_menu_get_item(GntMenu *menu, const char *id)
Definition: gntmenu.c:507
gnt_wm_set_event_stack
void gnt_wm_set_event_stack(GntWM *wm, gboolean set)
Definition: gntwm.c:2301
_GntWM::tree
GntWidget * tree
Definition: gntwm.h:91
gnt_tree_add_row_last
GntTreeRow * gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent)
Definition: gnttree.c:1420
gnt_bindable_remap_keys
const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text)
Definition: gntbindable.c:289
GNT_WIDGET_IS_FLAG_SET
#define GNT_WIDGET_IS_FLAG_SET(obj, flags)
Definition: gntwidget.h:46
wm_quit
static gboolean wm_quit(GntBindable *bindable, GList *list)
Definition: gntwm.c:1108
_GntWMClass
Definition: gntwm.h:129
GNT_KEY_DOWN
#define GNT_KEY_DOWN
Definition: gntkeys.h:51
GNT_WIDGET_INVISIBLE
Definition: gntwidget.h:66
_GntWS
Definition: gntws.h:42
keys
char * keys
Definition: gntbindable.c:45
toggle_clipboard
static gboolean toggle_clipboard(GntBindable *bindable, GList *n)
Definition: gntwm.c:1149
gnt_keys_add_combination
void gnt_keys_add_combination(const char *path)
Definition: gntkeys.c:244
_GntWM::tagged
GList * tagged
Definition: gntwm.h:86
GNTDEBUG
#define GNTDEBUG
Definition: gntbindable.h:42
_GntTreeRow::data
void * data
Definition: gnttree.c:74
gnt_widget_set_position
void gnt_widget_set_position(GntWidget *wid, int x, int y)
Definition: gntwidget.c:440
_GntWM::title_places
GHashTable * title_places
Definition: gntwm.h:98
gntinternal.h
str
static char str[256]
Definition: util.c:28
g_fopen
#define g_fopen
Definition: gntwm.c:46
gnt_widget_set_name
void gnt_widget_set_name(GntWidget *widget, const char *name)
Definition: gntwidget.c:589
SIG_NEW_WIN
Definition: gntwm.c:77
gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER
void gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data)
Definition: gntmarshal.c:328
bind
#define bind(socket, addr, length)
Definition: libc_interface.h:62
gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER
void gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data)
Definition: gntmarshal.c:371
gntlabel.h
gnt_wm_switch_workspace
gboolean gnt_wm_switch_workspace(GntWM *wm, gint n)
Definition: gntwm.c:1648
klass
GntBindableClass * klass
Definition: gntbindable.c:46
data
gpointer data
Definition: gntwm.c:1781
_GntWM::cws
GntWS * cws
Definition: gntwm.h:87
GNT_TEXT_FLAG_BOLD
Definition: gnttextview.h:71
GNT_KEY_CTRL_G
#define GNT_KEY_CTRL_G
Definition: gntkeys.h:75
help_for_wm
static gboolean help_for_wm(GntBindable *bindable, GList *null)
Definition: gntwm.c:1340
_GntWM::loop
GMainLoop * loop
Definition: gntwm.h:83
gnt_warning
#define gnt_warning
Definition: gntinternal.h:32
dump_file_cancel
static void dump_file_cancel(GntWidget *w, GntFileSel *fs)
Definition: gntwm.c:856
gnt_widget_get_name
const char * gnt_widget_get_name(GntWidget *widget)
Definition: gntwidget.c:595
gntmarshal.h
g_hash_table_find
static gpointer g_hash_table_find(GHashTable *table, GHRFunc func, gpointer data)
Definition: gntwm.c:1794
NULL
#define NULL
Definition: getopt1.c:52
write_positions_to_file
static void write_positions_to_file(GntWM *wm)
Definition: gntwm.c:2175
_GntTree
Definition: gnttree.h:57
gnt_bindable_perform_action_key
gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys)
Definition: gntbindable.c:331
window_prev_urgent
static gboolean window_prev_urgent(GntBindable *bindable, GList *n)
Definition: gntwm.c:1275
_GntBox::title
char * title
Definition: gntbox.h:69
_GntBox
Definition: gntbox.h:56
GNT_WIDGET_UNSET_FLAGS
#define GNT_WIDGET_UNSET_FLAGS(obj, flags)
Definition: gntwidget.h:45
GNT_TREE
#define GNT_TREE(obj)
Definition: gnttree.h:37
gnt_file_sel_set_suggested_filename
void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest)
Definition: gntfilesel.c:729
GNT_WIDGET_TRANSIENT
Definition: gntwidget.h:67
write_gdi
static void write_gdi(gpointer key, gpointer value, gpointer data)
Definition: gntwm.c:2144
workspace_next
static gboolean workspace_next(GntBindable *wm, GList *n)
Definition: gntwm.c:1690
GNT_COLOR_NORMAL
Definition: gntcolors.h:37
widestringwidth
static int widestringwidth(wchar_t *wide)
Definition: gntwm.c:998
DECIDE
#define DECIDE(ch)
gnt_box_set_toplevel
void gnt_box_set_toplevel(GntBox *box, gboolean set)
Definition: gntbox.c:701
_GntNode::panel
PANEL * panel
Definition: gntwm.h:58
help_for_bindable
static gboolean help_for_bindable(GntWM *wm, GntBindable *bindable)
Definition: gntwm.c:1326
gnt_wm_window_close
void gnt_wm_window_close(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1939
GNT_WIDGET_SET_FLAGS
#define GNT_WIDGET_SET_FLAGS(obj, flags)
Definition: gntwidget.h:44
_GntWM::windows
struct _GntWM::@39 * windows
gnt_file_sel_new
GntWidget * gnt_file_sel_new(void)
Definition: gntfilesel.c:691
free_node
static void free_node(gpointer data)
Definition: gntwm.c:126
_GntWM::name_places
GHashTable * name_places
Definition: gntwm.h:97
remove_tag
static void remove_tag(gpointer wid, gpointer wim)
Definition: gntwm.c:1172
list_actions
static gboolean list_actions(GntBindable *bindable, GList *null)
Definition: gntwm.c:959
_GntPosition
Definition: gntwm.h:64
read_window_positions
static void read_window_positions(GntWM *wm)
Definition: gntwm.c:338
gnt_style_read_workspaces
void gnt_style_read_workspaces(GntWM *wm)
Definition: gntstyle.c:180
shift_left
static gboolean shift_left(GntBindable *bindable, GList *null)
Definition: gntwm.c:913
gnt_wm_destroy
static void gnt_wm_destroy(GObject *obj)
Definition: gntwm.c:1384
GNT_WINDOW_MAXIMIZE_X
Definition: gntwindow.h:53
flag
guint64 flag
Definition: family_locate.c:48
r
short r
Definition: gntcolors.c:44
gnt_wm_update_window
void gnt_wm_update_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:2246
window_prev
static gboolean window_prev(GntBindable *bindable, GList *null)
Definition: gntwm.c:465
gntbutton.h
GNT_WIDGET
#define GNT_WIDGET(obj)
Definition: gntwidget.h:37
gnt_ws_new
GntWS * gnt_ws_new(const char *name)
Definition: gntws.c:192
gnt_widget_get_position
void gnt_widget_get_position(GntWidget *wid, int *x, int *y)
Definition: gntwidget.c:449
TRUE
#define TRUE
Definition: protobuf-c.c:56
_GntWS::name
char * name
Definition: gntws.h:45
dbus-analyze-signals.type
string type
Definition: dbus-analyze-signals.py:42
gnttextview.h
GNT_KP_MODE_NORMAL
Definition: gntwm.h:46
snprintf
#define snprintf
Definition: libc_interface.h:136
gnt_box_new
GntWidget * gnt_box_new(gboolean homo, gboolean vert)
Definition: gntbox.c:662
FALSE
#define FALSE
Definition: protobuf-c.c:57
gntwm.h
window_scroll_down
static gboolean window_scroll_down(GntBindable *bindable, GList *null)
Definition: gntwm.c:519
gnt_wm_resize_window
void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height)
Definition: gntwm.c:2111
gnt_screen_resize_widget
void gnt_screen_resize_widget(GntWidget *widget, int width, int height)
Definition: gntmain.c:633
GNT_KP_MODE_WAIT_ON_CHILD
Definition: gntwm.h:49
new_widget_find_workspace
static GntWS * new_widget_find_workspace(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1804
SIG_CONFIRM_MOVE
Definition: gntwm.c:82
gnt_label_new_with_format
GntWidget * gnt_label_new_with_format(const char *text, GntTextFormatFlags flags)
Definition: gntlabel.c:191
GNT_TYPE_BINDABLE
#define GNT_TYPE_BINDABLE
Definition: gntbindable.h:35
workspace_list
static gboolean workspace_list(GntBindable *b, GList *params)
Definition: gntwm.c:1222
gnt_wm_add_workspace
void gnt_wm_add_workspace(GntWM *wm, GntWS *ws)
Definition: gntwm.c:1642
action_list_activate
static void action_list_activate(GntTree *tree, GntWM *wm)
Definition: gntwm.c:942
gnt_ws_add_widget
void gnt_ws_add_widget(GntWS *ws, GntWidget *wid)
Definition: gntws.c:117
gnt_box_set_title
void gnt_box_set_title(GntBox *b, const char *title)
Definition: gntbox.c:680
gnt_window_get_accel_item
const char * gnt_window_get_accel_item(GntWindow *window, const char *key)
Definition: gntwindow.c:208
dump_file_save
static void dump_file_save(GntFileSel *fs, const char *path, const char *f, gpointer n)
Definition: gntwm.c:709
GNT_KEY_CTRL_J
#define GNT_KEY_CTRL_J
Definition: gntkeys.h:78
GNT_KEY_F3
#define GNT_KEY_F3
Definition: gntkeys.h:95
text
static char * text[]
Definition: zephyr_err.c:10
_GntWM::acts
GList * acts
Definition: gntwm.h:100
shift_right
static gboolean shift_right(GntBindable *bindable, GList *null)
Definition: gntwm.c:927
_GntWS::list
GList * list
Definition: gntws.h:46
b
short b
Definition: gntcolors.c:44
GNT_KEY_F9
#define GNT_KEY_F9
Definition: gntkeys.h:101
gnt_wm_process_input
gboolean gnt_wm_process_input(GntWM *wm, const char *keys)
Definition: gntwm.c:1980
_GntWM::event_stack
gboolean event_stack
Definition: gntwm.h:115
label
const char * label
Definition: jabber.c:1321
_GntBindableClass
Definition: gntbindable.h:52
GNT_WIDGET_URGENT
Definition: gntwidget.h:63
sanitize_position
static gboolean sanitize_position(GntWidget *widget, int *x, int *y, gboolean m)
Definition: gntwm.c:264
SIG_MOUSE_CLICK
Definition: gntwm.c:87
gnt_style_read_actions
void gnt_style_read_actions(GType type, GntBindableClass *klass)
Definition: gntstyle.c:217
window_reverse
static void window_reverse(GntWidget *win, gboolean set, GntWM *wm)
Definition: gntwm.c:1038
_GntMenuItem
Definition: gntmenuitem.h:61
update_screen
static gboolean update_screen(GntWM *wm)
Definition: gntwm.c:243
GNT_TEXT_FLAG_HIGHLIGHT
Definition: gnttextview.h:75
gnt_wm_init
static void gnt_wm_init(GTypeInstance *instance, gpointer class)
Definition: gntwm.c:395
gnt_screen_move_widget
void gnt_screen_move_widget(GntWidget *widget, int x, int y)
Definition: gntmain.c:638
gntstyle.h
IDLE_CHECK_INTERVAL
#define IDLE_CHECK_INTERVAL
Definition: gntwm.c:73
GNT_WIDGET_CAN_TAKE_FOCUS
Definition: gntwidget.h:55
GNT_WINDOW_MAXIMIZE_Y
Definition: gntwindow.h:54
gnt_box_sync_children
void gnt_box_sync_children(GntBox *box)
Definition: gntbox.c:716
accumulate_windows
static void accumulate_windows(gpointer window, gpointer node, gpointer p)
Definition: gntwm.c:1376
GNT_COLOR_HIGHLIGHT
Definition: gntcolors.h:38
GntWindowFlags
GntWindowFlags
Definition: gntwindow.h:51
gnt_color_pair
int gnt_color_pair(int pair)
Definition: gntcolors.c:298
gnt_wm_switch_workspace_prev
gboolean gnt_wm_switch_workspace_prev(GntWM *wm)
Definition: gntwm.c:1676
gnt_util_onscreen_width
int gnt_util_onscreen_width(const char *start, const char *end)
Definition: gntutils.c:83
ensure_normal_mode
static void ensure_normal_mode(GntWM *wm)
Definition: gntwm.c:1068
_GntWidgetPriv::y
int y
Definition: gntwidget.h:90
tree
GntWidget * tree
Definition: gntcertmgr.c:46
dump_screen
static gboolean dump_screen(GntBindable *b, GList *null)
Definition: gntwm.c:862
close_window
static void close_window(GtkWidget *w, PidginWindow *win)
Definition: gtkconv.c:8888
gnt_widget_destroy
void gnt_widget_destroy(GntWidget *obj)
Definition: gntwidget.c:312
gnt_widget_set_focus
gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set)
Definition: gntwidget.c:568
GNT_IS_BOX
#define GNT_IS_BOX(obj)
Definition: gntbox.h:36
ignore_keys_start
static gboolean ignore_keys_start(GntBindable *bindable, GList *n)
Definition: gntwm.c:1245
switch_window_n
static gboolean switch_window_n(GntBindable *bind, GList *list)
Definition: gntwm.c:473
gnt_window_get_maximize
GntWindowFlags gnt_window_get_maximize(GntWindow *window)
Definition: gntwindow.c:228
GNT_KP_MODE_RESIZE
Definition: gntwm.h:47
gnt_widget_draw
void gnt_widget_draw(GntWidget *widget)
Definition: gntwidget.c:335
gnt_wm_set_workspaces
void gnt_wm_set_workspaces(GntWM *wm, GList *workspaces)
Definition: gntwm.c:1746
pietray.obj
obj
Definition: pietray.py:29
gnt_tree_set_col_width
void gnt_tree_set_col_width(GntTree *tree, int col, int width)
Definition: gnttree.c:1748
gnt_wm_win_resized
static void gnt_wm_win_resized(GntWM *wm, GntNode *node)
Definition: gntwm.c:2100
GNT_IS_WINDOW
#define GNT_IS_WINDOW(obj)
Definition: gntwindow.h:39
GNT_FILE_SEL
#define GNT_FILE_SEL(obj)
Definition: gntfilesel.h:36
_GntPosition::y
int y
Definition: gntwm.h:67
act
static GList * act
Definition: gntwm.c:111
signals
static guint signals[SIGS]
Definition: gntwm.c:92
_GntAction::callback
void(* callback)(void)
Definition: gntwm.h:76
error
const char * error
Definition: auth_scram.c:51
widget_in_workspace
static gint widget_in_workspace(gconstpointer workspace, gconstpointer wid)
Definition: gntwm.c:1724
window_list_activate
static void window_list_activate(GntTree *tree, GntWM *wm)
Definition: gntwm.c:586
pietray.path
path
Definition: pietray.py:186
g_timeout_add_seconds
#define g_timeout_add_seconds(time, callback, data)
Definition: gnt.h:52
gnt_wm_raise_window
void gnt_wm_raise_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:2285
_GntWM::workspaces
GList * workspaces
Definition: gntwm.h:85
config.h
gnt_bindable_class_register_action
void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger,...)
Definition: gntbindable.c:396
refresh_screen
static gboolean refresh_screen(GntBindable *bindable, GList *null)
Definition: gntwm.c:1124
refresh_node
static void refresh_node(GntWidget *widget, GntNode *node, gpointer m)
Definition: gntwm.c:303
_GntWM
Definition: gntwm.h:79
idle_update
static gboolean idle_update
Definition: gntwm.c:110
table_find_data
struct @38 table_find_data
GntWMClass
struct _GntWMClass GntWMClass
Definition: gntwm.h:127
gnt_wm_new_window_real
static void gnt_wm_new_window_real(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1820
window_close
static gboolean window_close(GntBindable *bindable, GList *null)
Definition: gntwm.c:544
GNT_KEY_UP
#define GNT_KEY_UP
Definition: gntkeys.h:50
gnt_tree_remove_all
void gnt_tree_remove_all(GntTree *tree)
Definition: gnttree.c:1545
_GntWidget::window
WINDOW * window
Definition: gntwidget.h:105
window_list
static gboolean window_list(GntBindable *bindable, GList *null)
Definition: gntwm.c:693
_GntWM::actions
struct _GntWM::@39 * actions
gnt_boolean_handled_accumulator
gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy)
Definition: gntutils.c:174
gnt_wm_give_focus
static void gnt_wm_give_focus(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:2219
_GntBindable
Definition: gntbindable.h:47
params
GList * params
Definition: gntbindable.c:48
GNT_KEY_CTRL_K
#define GNT_KEY_CTRL_K
Definition: gntkeys.h:79
tag_widget
static gboolean tag_widget(GntBindable *b, GList *params)
Definition: gntwm.c:1182
_GntWM::window
GntWidget * window
Definition: gntwm.h:90
start_move
static gboolean start_move(GntBindable *bindable, GList *null)
Definition: gntwm.c:1078
SIGS
Definition: gntwm.c:89
value
gpointer value
Definition: gntwm.c:1782
free_workspaces
static void free_workspaces(gpointer data, gpointer n)
Definition: gntwm.c:1740
SIG_CONFIRM_RESIZE
Definition: gntwm.c:80
GNT_KEY_RIGHT
#define GNT_KEY_RIGHT
Definition: gntkeys.h:49
gnt_style_get_bool
gboolean gnt_style_get_bool(GntStyle style, gboolean def)
Definition: gntstyle.c:102
_GntWM::positions
GHashTable * positions
Definition: gntwm.h:119
gnt_wm_widget_find_workspace
GntWS * gnt_wm_widget_find_workspace(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1732
dbus-buddyicons-example.node
node
Definition: dbus-buddyicons-example.py:32
work_around_for_ncurses_bug
static void work_around_for_ncurses_bug(void)
Definition: gntwm.c:168
gnt_wm_switch_workspace_next
gboolean gnt_wm_switch_workspace_next(GntWM *wm)
Definition: gntwm.c:1683
GntTextFormatFlags
GntTextFormatFlags
Definition: gnttextview.h:68
widget_move_ws
static void widget_move_ws(gpointer wid, gpointer w)
Definition: gntwm.c:1204
GNT_BINDABLE
#define GNT_BINDABLE(obj)
Definition: gntbindable.h:36
ignore_keys_end
static gboolean ignore_keys_end(GntBindable *bindable, GList *n)
Definition: gntwm.c:1257
window_next_urgent
static gboolean window_next_urgent(GntBindable *bindable, GList *n)
Definition: gntwm.c:1267
gnttree.h
check_idle
static gboolean check_idle(gpointer n)
Definition: gntwm.c:385
SIG_CLOSE_WIN
Definition: gntwm.c:79
_GntWM::_list
struct _GntWM::@39 _list
gnt_tree_create_row
GntTreeRow * gnt_tree_create_row(GntTree *tree,...)
Definition: gnttree.c:1728
destroy__list
static void destroy__list(GntWidget *widget, GntWM *wm)
Definition: gntwm.c:560
place_tagged
static gboolean place_tagged(GntBindable *b, GList *params)
Definition: gntwm.c:1211
GNT_WS
#define GNT_WS(obj)
Definition: gntws.h:35
GNT_BINDABLE_CLASS
#define GNT_BINDABLE_CLASS(klass)
Definition: gntbindable.h:37
gnt_wm_get_gtype
GType gnt_wm_get_gtype(void)
Definition: gntwm.c:1615
time
time_t time(void)
SIG_DECORATE_WIN
Definition: gntwm.c:78
_GntWidget::priv
GntWidgetPriv priv
Definition: gntwidget.h:104
match_title
static gboolean match_title(gpointer title, gpointer n, gpointer wid_title)
Definition: gntwm.c:1770
update_act_msg
static void update_act_msg(void)
Definition: gntwm.c:216
gnt_tree_set_row_flags
void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags)
Definition: gnttree.c:1635
gnt_tree_get_selection_data
gpointer gnt_tree_get_selection_data(GntTree *tree)
Definition: gnttree.c:1441
ADJUST
#define ADJUST(x)
gnt_ws_widget_show
void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes)
Definition: gntws.c:151
_GntFileSel
Definition: gntfilesel.h:51
gntwindow.h
_GntWM::menu
GntMenu * menu
Definition: gntwm.h:108
window_next
static gboolean window_next(GntBindable *bindable, GList *null)
Definition: gntwm.c:457
gnt_wm_new_window
void gnt_wm_new_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1896
reverse_char
static int reverse_char(WINDOW *d, int y, int x, gboolean set)
Definition: gntwm.c:1014
GNT_WM
#define GNT_WM(obj)
Definition: gntwm.h:38
workspace_prev
static gboolean workspace_prev(GntBindable *wm, GList *n)
Definition: gntwm.c:1696
SIG_GIVE_FOCUS
Definition: gntwm.c:85
SIG_MOVED
Definition: gntwm.c:83
gntfilesel.h
write_timeout
static int write_timeout
Definition: gntwm.c:108
window_scroll_up
static gboolean window_scroll_up(GntBindable *bindable, GList *null)
Definition: gntwm.c:496
gnt_ws_draw_taskbar
void gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition)
Definition: gntws.c:55
GntWM
struct _GntWM GntWM
Definition: gntwm.h:62