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)  

gntmain.c
Go to the documentation of this file.
1 
23 #define _GNU_SOURCE
24 #if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
25 #define _XOPEN_SOURCE_EXTENDED
26 #endif
27 
28 #include "config.h"
29 
30 #include <gmodule.h>
31 
32 #include <sys/types.h>
33 #include <sys/wait.h>
34 
35 #include "gntinternal.h"
36 #undef GNT_LOG_DOMAIN
37 #define GNT_LOG_DOMAIN "Main"
38 
39 #include "gnt.h"
40 #include "gntbox.h"
41 #include "gntbutton.h"
42 #include "gntcolors.h"
43 #include "gntclipboard.h"
44 #include "gntkeys.h"
45 #include "gntlabel.h"
46 #include "gntmenu.h"
47 #include "gntstyle.h"
48 #include "gnttree.h"
49 #include "gntutils.h"
50 #include "gntwindow.h"
51 #include "gntwm.h"
52 
53 #include <panel.h>
54 
55 #include <stdio.h>
56 #include <stdlib.h>
57 #include <locale.h>
58 #include <unistd.h>
59 #include <signal.h>
60 #include <string.h>
61 #include <ctype.h>
62 #include <errno.h>
63 
71 static GIOChannel *channel = NULL;
72 static guint channel_read_callback = 0;
73 static guint channel_error_callback = 0;
74 
75 static gboolean ascii_only;
76 static gboolean mouse_enabled;
77 
78 static void setup_io(void);
79 
80 static gboolean refresh_screen(void);
81 
82 static GntWM *wm;
84 
86 
87 #define HOLDING_ESCAPE (escape_stuff.timer != 0)
88 
89 static struct {
90  int timer;
91 } escape_stuff;
92 
93 static gboolean
95 {
96  gnt_wm_process_input(wm, "\033");
97  escape_stuff.timer = 0;
98  return FALSE;
99 }
100 
111 static gboolean
112 detect_mouse_action(const char *buffer)
113 {
114  int x, y;
115  static enum {
116  MOUSE_NONE,
117  MOUSE_LEFT,
118  MOUSE_RIGHT,
119  MOUSE_MIDDLE
120  } button = MOUSE_NONE;
121  static GntWidget *remember = NULL;
122  static int offset = 0;
123  GntMouseEvent event;
124  GntWidget *widget = NULL;
125  PANEL *p = NULL;
126 
127  if (!wm->cws->ordered || buffer[0] != 27)
128  return FALSE;
129 
130  buffer++;
131  if (strlen(buffer) < 5)
132  return FALSE;
133 
134  x = buffer[3];
135  y = buffer[4];
136  if (x < 0) x += 256;
137  if (y < 0) y += 256;
138  x -= 33;
139  y -= 33;
140 
141  while ((p = panel_below(p)) != NULL) {
142  const GntNode *node = panel_userptr(p);
143  GntWidget *wid;
144  if (!node)
145  continue;
146  wid = node->me;
147  if (x >= wid->priv.x && x < wid->priv.x + wid->priv.width) {
148  if (y >= wid->priv.y && y < wid->priv.y + wid->priv.height) {
149  widget = wid;
150  break;
151  }
152  }
153  }
154 
155  if (strncmp(buffer, "[M ", 3) == 0) {
156  /* left button down */
157  /* Bring the window you clicked on to front */
158  /* If you click on the topbar, then you can drag to move the window */
159  event = GNT_LEFT_MOUSE_DOWN;
160  } else if (strncmp(buffer, "[M\"", 3) == 0) {
161  /* right button down */
162  event = GNT_RIGHT_MOUSE_DOWN;
163  } else if (strncmp(buffer, "[M!", 3) == 0) {
164  /* middle button down */
165  event = GNT_MIDDLE_MOUSE_DOWN;
166  } else if (strncmp(buffer, "[M`", 3) == 0) {
167  /* wheel up*/
168  event = GNT_MOUSE_SCROLL_UP;
169  } else if (strncmp(buffer, "[Ma", 3) == 0) {
170  /* wheel down */
171  event = GNT_MOUSE_SCROLL_DOWN;
172  } else if (strncmp(buffer, "[M#", 3) == 0) {
173  /* button up */
174  event = GNT_MOUSE_UP;
175  } else
176  return FALSE;
177 
178  if (widget && gnt_wm_process_click(wm, event, x, y, widget))
179  return TRUE;
180 
181  if (event == GNT_LEFT_MOUSE_DOWN && widget && widget != wm->_list.window &&
183  if (widget != wm->cws->ordered->data) {
185  }
186  if (y == widget->priv.y) {
187  offset = x - widget->priv.x;
188  remember = widget;
189  button = MOUSE_LEFT;
190  }
191  } else if (event == GNT_MOUSE_UP) {
192  if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) {
193  /* Clicked on the taskbar */
194  int n = g_list_length(wm->cws->list);
195  if (n) {
196  int width = getmaxx(stdscr) / n;
197  gnt_bindable_perform_action_named(GNT_BINDABLE(wm), "switch-window-n", x/width, NULL);
198  }
199  } else if (button == MOUSE_LEFT && remember) {
200  x -= offset;
201  if (x < 0) x = 0;
202  if (y < 0) y = 0;
203  gnt_screen_move_widget(remember, x, y);
204  }
205  button = MOUSE_NONE;
206  remember = NULL;
207  offset = 0;
208  }
209 
210  if (widget)
211  gnt_widget_clicked(widget, event, x, y);
212  return TRUE;
213 }
214 
215 static gboolean
216 io_invoke_error(GIOChannel *source, GIOCondition cond, gpointer data)
217 {
218  int id = GPOINTER_TO_INT(data);
219  g_source_remove(id);
220  g_io_channel_unref(source);
221 
222  channel = NULL;
223  setup_io();
224  return TRUE;
225 }
226 
227 static gboolean
228 io_invoke(GIOChannel *source, GIOCondition cond, gpointer null)
229 {
230  char keys[256];
231  gssize rd;
232  char *k;
233  char *cvrt = NULL;
234 
236  return FALSE;
237 
238  rd = read(STDIN_FILENO, keys + HOLDING_ESCAPE, sizeof(keys) - 1 - HOLDING_ESCAPE);
239  if (rd < 0)
240  {
241  int ch = getch(); /* This should return ERR, but let's see what it really returns */
242  endwin();
243  printf("ERROR: %s\n", strerror(errno));
244  printf("File descriptor is: %d\n\nGIOChannel is: %p\ngetch() = %d\n", STDIN_FILENO, source, ch);
245  raise(SIGABRT);
246  }
247  else if (rd == 0)
248  {
249  endwin();
250  printf("EOF\n");
251  raise(SIGABRT);
252  }
253 
254  rd += HOLDING_ESCAPE;
255  if (HOLDING_ESCAPE) {
256  keys[0] = '\033';
257  g_source_remove(escape_stuff.timer);
258  escape_stuff.timer = 0;
259  }
260  keys[rd] = 0;
262 
263  cvrt = g_locale_to_utf8(keys, rd, (gsize*)&rd, NULL, NULL);
264  k = cvrt ? cvrt : keys;
266  goto end;
267 
268 #if 0
269  /* I am not sure what's happening here. If this actually does something,
270  * then this needs to go in gnt_keys_refine. */
271  if (*k < 0) { /* Alt not sending ESC* */
272  *(k + 1) = 128 - *k;
273  *k = 27;
274  *(k + 2) = 0;
275  rd++;
276  }
277 #endif
278 
279  while (rd) {
280  char back;
281  int p;
282 
283  if (k[0] == '\033' && rd == 1) {
284  escape_stuff.timer = g_timeout_add(250, escape_timeout, NULL);
285  break;
286  }
287 
288  gnt_keys_refine(k);
289  p = MAX(1, gnt_keys_find_combination(k));
290  back = k[p];
291  k[p] = '\0';
292  gnt_wm_process_input(wm, k); /* XXX: */
293  k[p] = back;
294  rd -= p;
295  k += p;
296  }
297 end:
298  if (wm)
300  g_free(cvrt);
301  return TRUE;
302 }
303 
304 static void
306 {
307  int result;
308  channel = g_io_channel_unix_new(STDIN_FILENO);
309  g_io_channel_set_close_on_unref(channel, TRUE);
310 
311 #if 0
312  g_io_channel_set_encoding(channel, NULL, NULL);
313  g_io_channel_set_buffered(channel, FALSE);
314  g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL );
315 #endif
316 
317  channel_read_callback = result = g_io_add_watch_full(channel, G_PRIORITY_HIGH,
318  (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
319  io_invoke, NULL, NULL);
320 
321  channel_error_callback = g_io_add_watch_full(channel, G_PRIORITY_HIGH,
322  (G_IO_NVAL),
323  io_invoke_error, GINT_TO_POINTER(result), NULL);
324 
325  g_io_channel_unref(channel); /* Apparently this caused crashes for some people.
326  But irssi does this, so I am going to assume the
327  crashes were caused by some other stuff. */
328 
329  gnt_warning("setting up IO (%d)", channel_read_callback);
330 }
331 
332 static gboolean
334 {
336  return FALSE;
337 }
338 
339 /* Xerox */
340 static void
342 {
343  int status;
344  pid_t pid;
345 
346  do {
347  pid = waitpid(-1, &status, WNOHANG);
348  } while (pid != 0 && pid != (pid_t)-1);
349 
350  if ((pid == (pid_t) - 1) && (errno != ECHILD)) {
351  char errmsg[BUFSIZ];
352  g_snprintf(errmsg, BUFSIZ, "Warning: waitpid() returned %d", pid);
353  perror(errmsg);
354  }
355 }
356 
357 static void
358 exit_confirmed(gpointer null)
359 {
361 }
362 
363 static void
365 {
366  *win = NULL;
367 }
368 
369 static void
371 {
372  static GntWidget *win = NULL;
373  GntWidget *bbox, *button;
374 
375  if (wm->menu) {
376  do {
378  if (wm->menu)
379  wm->menu = wm->menu->parentmenu;
380  } while (wm->menu);
381  }
382 
383  if (win)
384  goto raise;
385 
386  win = gnt_vwindow_new(FALSE);
387  gnt_box_add_widget(GNT_BOX(win), gnt_label_new("Are you sure you want to quit?"));
388  gnt_box_set_title(GNT_BOX(win), "Quit?");
390  g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(exit_win_close), &win);
391 
392  bbox = gnt_hbox_new(FALSE);
393  gnt_box_add_widget(GNT_BOX(win), bbox);
394 
395  button = gnt_button_new("Quit");
396  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(exit_confirmed), NULL);
397  gnt_box_add_widget(GNT_BOX(bbox), button);
398 
399  button = gnt_button_new("Cancel");
400  g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), win);
401  gnt_box_add_widget(GNT_BOX(bbox), button);
402 
403  gnt_widget_show(win);
404 raise:
405  gnt_wm_raise_window(wm, win);
406 }
407 
408 #ifdef SIGWINCH
409 static void (*org_winch_handler)(int);
410 static void (*org_winch_handler_sa)(int, siginfo_t *, void *);
411 #endif
412 
413 static void
414 sighandler(int sig, siginfo_t *info, void *data)
415 {
416  switch (sig) {
417 #ifdef SIGWINCH
418  case SIGWINCH:
419  erase();
420  g_idle_add((GSourceFunc)refresh_screen, NULL);
421  if (org_winch_handler)
422  org_winch_handler(sig);
423  if (org_winch_handler_sa)
424  org_winch_handler_sa(sig, info, data);
425  break;
426 #endif
427  case SIGCHLD:
428  clean_pid();
429  break;
430  case SIGINT:
431  ask_before_exit();
432  break;
433  }
434 }
435 
436 static void
437 init_wm(void)
438 {
439  const char *name = gnt_style_get(GNT_STYLE_WM);
440  gpointer handle;
441 
442  if (name && *name) {
443  handle = g_module_open(name, G_MODULE_BIND_LAZY);
444  if (handle) {
445  gboolean (*init)(GntWM **);
446  if (g_module_symbol(handle, "gntwm_init", (gpointer)&init)) {
447  init(&wm);
448  }
449  }
450  }
451  if (wm == NULL)
452  wm = g_object_new(GNT_TYPE_WM, NULL);
453 }
454 
455 void gnt_init()
456 {
457  char *filename;
458  const char *locale;
459  struct sigaction act;
460 #ifdef SIGWINCH
461  struct sigaction oact;
462 #endif
463 
464  if (channel)
465  return;
466 
467  locale = setlocale(LC_ALL, "");
468 
469  setup_io();
470 
471 #ifdef NO_WIDECHAR
472  ascii_only = TRUE;
473 #else
474  if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) {
475  ascii_only = FALSE;
476  } else {
477  ascii_only = TRUE;
479  }
480 #endif
481 
482  initscr();
483  typeahead(-1);
484  noecho();
485  curs_set(0);
486 
487  gnt_init_keys();
488  gnt_init_styles();
489 
490  filename = g_build_filename(g_get_home_dir(), ".gntrc", NULL);
492  g_free(filename);
493 
494  gnt_init_colors();
495 
496  wbkgdset(stdscr, '\0' | gnt_color_pair(GNT_COLOR_NORMAL));
497  refresh();
498 
499 #ifdef ALL_MOUSE_EVENTS
501  mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL);
502 #endif
503 
504  wbkgdset(stdscr, '\0' | gnt_color_pair(GNT_COLOR_NORMAL));
505  werase(stdscr);
506  wrefresh(stdscr);
507 
508  act.sa_sigaction = sighandler;
509  sigemptyset(&act.sa_mask);
510  act.sa_flags = SA_SIGINFO;
511 
512 #ifdef SIGWINCH
513  org_winch_handler = NULL;
514  org_winch_handler_sa = NULL;
515  sigaction(SIGWINCH, &act, &oact);
516  if (oact.sa_flags & SA_SIGINFO)
517  {
518  org_winch_handler_sa = oact.sa_sigaction;
519  }
520  else if (oact.sa_handler != SIG_DFL && oact.sa_handler != SIG_IGN)
521  {
522  org_winch_handler = oact.sa_handler;
523  }
524 #endif
525  sigaction(SIGCHLD, &act, NULL);
526  sigaction(SIGINT, &act, NULL);
527  signal(SIGPIPE, SIG_IGN);
528 
529 #if !GLIB_CHECK_VERSION(2, 36, 0)
530  /* GLib type system is automaticaly initialized since 2.36. */
531  g_type_init();
532 #endif
533 
534  init_wm();
535 
536  clipboard = g_object_new(GNT_TYPE_CLIPBOARD, NULL);
537 }
538 
539 void gnt_main()
540 {
541  wm->loop = g_main_loop_new(NULL, FALSE);
542  g_main_loop_run(wm->loop);
543 }
544 
545 /*********************************
546  * Stuff for 'window management' *
547  *********************************/
548 
550 {
551  if (wm->event_stack)
553  else
555 }
556 
558 {
560 }
561 
563 {
564  if (wm)
566 }
567 
569 {
571 }
572 
574 {
575  GntWidget *w;
576  if (!widget)
577  return FALSE;
578 
579  if (GNT_IS_MENU(widget))
580  return TRUE;
581 
582  w = widget;
583 
584  while (widget->parent)
585  widget = widget->parent;
586 
587  if (widget == wm->_list.window)
588  return TRUE;
589  if (wm->cws->ordered && wm->cws->ordered->data == widget) {
590  if (GNT_IS_BOX(widget) &&
591  (GNT_BOX(widget)->active == w || widget == w))
592  return TRUE;
593  }
594  return FALSE;
595 }
596 
598 {
599  while (widget->parent)
600  widget = widget->parent;
601 
602  if (wm->cws->ordered && wm->cws->ordered->data == widget)
603  return;
604 
606 
608 }
609 
610 void gnt_quit()
611 {
612  /* Prevent io_invoke() from being called after wm is destroyed */
613  g_source_remove(channel_error_callback);
614  g_source_remove(channel_read_callback);
615 
618 
619  g_object_unref(G_OBJECT(wm));
620  wm = NULL;
621 
622  update_panels();
623  doupdate();
626  endwin();
627 }
628 
629 gboolean gnt_ascii_only()
630 {
631  return ascii_only;
632 }
633 
634 void gnt_screen_resize_widget(GntWidget *widget, int width, int height)
635 {
636  gnt_wm_resize_window(wm, widget, width, height);
637 }
638 
639 void gnt_screen_move_widget(GntWidget *widget, int x, int y)
640 {
641  gnt_wm_move_window(wm, widget, x, y);
642 }
643 
644 void gnt_screen_rename_widget(GntWidget *widget, const char *text)
645 {
649 }
650 
651 void gnt_register_action(const char *label, void (*callback)(void))
652 {
653  GntAction *action = g_new0(GntAction, 1);
654  action->label = g_strdup(label);
655  action->callback = callback;
656 
657  wm->acts = g_list_append(wm->acts, action);
658 }
659 
660 static void
661 reset_menu(GntWidget *widget, gpointer null)
662 {
663  wm->menu = NULL;
664 }
665 
666 gboolean gnt_screen_menu_show(gpointer newmenu)
667 {
668  if (wm->menu) {
669  /* For now, if a menu is being displayed, then another menu
670  * can NOT take over. */
671  return FALSE;
672  }
673 
674  wm->menu = newmenu;
677 
678  g_signal_connect(G_OBJECT(wm->menu), "hide", G_CALLBACK(reset_menu), NULL);
679  g_signal_connect(G_OBJECT(wm->menu), "destroy", G_CALLBACK(reset_menu), NULL);
680 
681  return TRUE;
682 }
683 
684 void gnt_set_clipboard_string(const gchar *string)
685 {
687 }
688 
690 {
691  return clipboard;
692 }
693 
695 {
697 }
698 
699 #if GLIB_CHECK_VERSION(2,4,0)
700 typedef struct
701 {
702  void (*callback)(int status, gpointer data);
703  gpointer data;
704 } ChildProcess;
705 
706 static void
707 reap_child(GPid pid, gint status, gpointer data)
708 {
709  ChildProcess *cp = data;
710  if (cp->callback) {
711  cp->callback(status, cp->data);
712  }
713  g_free(cp);
714  clean_pid();
716  endwin();
717  setup_io();
718  refresh();
719  refresh_screen();
720 }
721 #endif
722 
723 gboolean gnt_giveup_console(const char *wd, char **argv, char **envp,
724  gint *stin, gint *stout, gint *sterr,
725  void (*callback)(int status, gpointer data), gpointer data)
726 {
727 #if GLIB_CHECK_VERSION(2,4,0)
728  GPid pid = 0;
729  ChildProcess *cp = NULL;
730 
731  if (!g_spawn_async_with_pipes(wd, argv, envp,
732  G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
733  (GSpawnChildSetupFunc)endwin, NULL,
734  &pid, stin, stout, sterr, NULL))
735  return FALSE;
736 
737  cp = g_new0(ChildProcess, 1);
738  cp->callback = callback;
739  cp->data = data;
740  g_source_remove(channel_read_callback);
742  g_child_watch_add(pid, reap_child, cp);
743 
744  return TRUE;
745 #else
746  return FALSE;
747 #endif
748 }
749 
750 gboolean gnt_is_refugee()
751 {
752 #if GLIB_CHECK_VERSION(2,4,0)
753  return (wm && wm->mode == GNT_KP_MODE_WAIT_ON_CHILD);
754 #else
755  return FALSE;
756 #endif
757 }
758 
759 const char *C_(const char *x)
760 {
761  static char *c = NULL;
763  GError *error = NULL;
764  g_free(c);
765  c = g_locale_from_utf8(x, -1, NULL, NULL, &error);
766  if (c == NULL || error) {
767  char *store = c;
768  c = NULL;
769  gnt_warning("Error: %s\n", error ? error->message : "(unknown)");
770  g_error_free(error);
771  error = NULL;
772  g_free(c);
773  c = store;
774  }
775  return c ? c : x;
776  } else
777  return x;
778 }
779 
read
#define read(fd, buf, buflen)
Definition: libc_interface.h:112
info
static PurplePluginInfo info
Definition: gntclipboard.c:147
name
char * name
Definition: gntbindable.c:47
gnt_ascii_only
gboolean gnt_ascii_only()
Definition: gntmain.c:628
_GntWidgetPriv::width
int width
Definition: gntwidget.h:91
mouse_enabled
static gboolean mouse_enabled
Definition: gntmain.c:76
STDIN_FILENO
#define STDIN_FILENO
Definition: sysdep.h:142
dbus-analyze-signals.signal
signal
Definition: dbus-analyze-signals.py:29
GNT_RIGHT_MOUSE_DOWN
Definition: gntwidget.h:75
gnt_wm_process_click
gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget)
Definition: gntwm.c:2277
_GntAction::label
const char * label
Definition: gntwm.h:75
strerror
char * strerror()
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
_GntWM::mode
GntKeyPressMode mode
Definition: gntwm.h:117
gntbox.h
gnt_screen_update
void gnt_screen_update(GntWidget *widget)
Definition: gntmain.c:567
gnt_style_get
const char * gnt_style_get(GntStyle style)
Definition: gntstyle.c:46
gnt_clipboard_get_string
gchar * gnt_clipboard_get_string(GntClipboard *clipboard)
Definition: gntclipboard.c:58
init_wm
static void init_wm(void)
Definition: gntmain.c:437
_GntWidgetPriv::x
int x
Definition: gntwidget.h:90
gnt_register_action
void gnt_register_action(const char *label, void(*callback)(void))
Definition: gntmain.c:650
_GntNode
Definition: gntwm.h:52
status
static PurpleStatusPrimitive status
Definition: gtkdocklet.c:53
gnt_label_new
GntWidget * gnt_label_new(const char *text)
Definition: gntlabel.c:186
widget
GtkWidget * widget
Definition: pidgintooltip.c:38
GNT_IS_MENU
#define GNT_IS_MENU(obj)
Definition: gntmenu.h:37
_GntWidget
Definition: gntwidget.h:98
gnt.h
gntclipboard.h
_GntAction
Definition: gntwm.h:73
window
GntWidget * window
Definition: gntcertmgr.c:45
GNT_LEFT_MOUSE_DOWN
Definition: gntwidget.h:74
gnt_bindable_perform_action_named
gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name,...)
Definition: gntbindable.c:310
_GntWS::ordered
GList * ordered
Definition: gntws.h:47
gntutils.h
gnt_widget_has_focus
gboolean gnt_widget_has_focus(GntWidget *widget)
Definition: gntmain.c:572
gnt_init_styles
void gnt_init_styles()
Definition: gntstyle.c:442
gntkeys.h
gnt_wm_move_window
void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y)
Definition: gntwm.c:2183
gnt_keys_find_combination
int gnt_keys_find_combination(const char *path)
Definition: gntkeys.c:271
GNT_BOX
#define GNT_BOX(obj)
Definition: gntbox.h:34
gnt_box_add_widget
void gnt_box_add_widget(GntBox *b, GntWidget *widget)
Definition: gntbox.c:674
gnt_screen_menu_show
gboolean gnt_screen_menu_show(gpointer newmenu)
Definition: gntmain.c:665
gntmenu.h
gnt_button_new
GntWidget * gnt_button_new(const char *text)
Definition: gntbutton.c:170
gnt_wm_set_event_stack
void gnt_wm_set_event_stack(GntWM *wm, gboolean set)
Definition: gntwm.c:2301
handle
static PurplePlugin * handle
Definition: nss-prefs.c:61
gnt_main
void gnt_main()
Definition: gntmain.c:539
setup_io
static void setup_io(void)
Definition: gntmain.c:305
gnt_need_conversation_to_locale
int gnt_need_conversation_to_locale
Definition: gntmain.c:85
GNT_WIDGET_IS_FLAG_SET
#define GNT_WIDGET_IS_FLAG_SET(obj, flags)
Definition: gntwidget.h:46
GNT_ALIGN_MID
Definition: gntbox.h:49
GNT_WIDGET_INVISIBLE
Definition: gntwidget.h:66
gnt_keys_refine
void gnt_keys_refine(char *text)
Definition: gntkeys.c:158
keys
char * keys
Definition: gntbindable.c:45
gntinternal.h
HOLDING_ESCAPE
#define HOLDING_ESCAPE
Definition: gntmain.c:87
gnt_init_colors
void gnt_init_colors()
Definition: gntcolors.c:75
channel_read_callback
static guint channel_read_callback
Definition: gntmain.c:72
escape_stuff
static struct @26 escape_stuff
gntlabel.h
data
gpointer data
Definition: gntwm.c:1781
_GntWM::cws
GntWS * cws
Definition: gntwm.h:87
_GntWM::loop
GMainLoop * loop
Definition: gntwm.h:83
gnt_warning
#define gnt_warning
Definition: gntinternal.h:32
gnt_giveup_console
gboolean gnt_giveup_console(const char *wd, char **argv, char **envp, gint *stin, gint *stout, gint *sterr, void(*callback)(int status, gpointer data), gpointer data)
Definition: gntmain.c:722
NULL
#define NULL
Definition: getopt1.c:52
_GntMenu::parentmenu
GntMenu * parentmenu
Definition: gntmenu.h:73
clean_pid
static void clean_pid(void)
Definition: gntmain.c:341
GNT_MOUSE_SCROLL_DOWN
Definition: gntwidget.h:79
GNT_WIDGET_UNSET_FLAGS
#define GNT_WIDGET_UNSET_FLAGS(obj, flags)
Definition: gntwidget.h:45
GNT_WIDGET_TRANSIENT
Definition: gntwidget.h:67
GNT_COLOR_NORMAL
Definition: gntcolors.h:37
gnt_screen_occupy
void gnt_screen_occupy(GntWidget *widget)
Definition: gntmain.c:556
sighandler
static void sighandler(int sig, siginfo_t *info, void *data)
Definition: gntmain.c:414
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
GNT_TYPE_WM
#define GNT_TYPE_WM
Definition: gntwm.h:37
GNT_STYLE_MOUSE
Definition: gntstyle.h:34
gnt_window_present
void gnt_window_present(GntWidget *window)
Definition: gntmain.c:548
gnt_wm_update_window
void gnt_wm_update_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:2246
gntbutton.h
gntcolors.h
GNT_WIDGET
#define GNT_WIDGET(obj)
Definition: gntwidget.h:37
gnt_style_read_configure_file
void gnt_style_read_configure_file(const char *filename)
Definition: gntstyle.c:424
exit_confirmed
static void exit_confirmed(gpointer null)
Definition: gntmain.c:358
TRUE
#define TRUE
Definition: protobuf-c.c:56
GNT_STYLE_WM
Definition: gntstyle.h:35
GNT_KP_MODE_NORMAL
Definition: gntwm.h:46
FALSE
#define FALSE
Definition: protobuf-c.c:57
gntwm.h
gnt_wm_resize_window
void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height)
Definition: gntwm.c:2111
GNT_KP_MODE_WAIT_ON_CHILD
Definition: gntwm.h:49
io_invoke
static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null)
Definition: gntmain.c:228
timer
int timer
Definition: gntmain.c:90
gnt_clipboard_set_string
void gnt_clipboard_set_string(GntClipboard *clipboard, const gchar *string)
Definition: gntclipboard.c:50
gnt_uninit_colors
void gnt_uninit_colors()
Definition: gntcolors.c:139
gnt_box_set_title
void gnt_box_set_title(GntBox *b, const char *title)
Definition: gntbox.c:680
gnt_screen_move_widget
void gnt_screen_move_widget(GntWidget *widget, int x, int y)
Definition: gntmain.c:638
clipboard
static GntClipboard * clipboard
Definition: gntmain.c:83
text
static char * text[]
Definition: zephyr_err.c:10
_GntWM::acts
GList * acts
Definition: gntwm.h:100
_GntWS::list
GList * list
Definition: gntws.h:46
GNT_MIDDLE_MOUSE_DOWN
Definition: gntwidget.h:76
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
gnt_set_clipboard_string
void gnt_set_clipboard_string(const gchar *string)
Definition: gntmain.c:683
GNT_TYPE_CLIPBOARD
#define GNT_TYPE_CLIPBOARD
Definition: gntclipboard.h:34
GNT_WIDGET_URGENT
Definition: gntwidget.h:63
GNT_MOUSE_SCROLL_UP
Definition: gntwidget.h:78
gntstyle.h
gnt_screen_rename_widget
void gnt_screen_rename_widget(GntWidget *widget, const char *text)
Definition: gntmain.c:643
gnt_get_clipboard
GntClipboard * gnt_get_clipboard()
Definition: gntmain.c:688
refresh_screen
static gboolean refresh_screen(void)
Definition: gntmain.c:333
C_
const char * C_(const char *x)
Definition: gntmain.c:758
gnt_get_clipboard_string
gchar * gnt_get_clipboard_string()
Definition: gntmain.c:693
gnt_color_pair
int gnt_color_pair(int pair)
Definition: gntcolors.c:298
gnt_init_keys
void gnt_init_keys()
Definition: gntkeys.c:41
_GntWidgetPriv::y
int y
Definition: gntwidget.h:90
gnt_widget_destroy
void gnt_widget_destroy(GntWidget *obj)
Definition: gntwidget.c:312
GNT_IS_BOX
#define GNT_IS_BOX(obj)
Definition: gntbox.h:36
gnt_widget_draw
void gnt_widget_draw(GntWidget *widget)
Definition: gntwidget.c:335
_GntClipboard
Definition: gntclipboard.h:44
channel_error_callback
static guint channel_error_callback
Definition: gntmain.c:73
ask_before_exit
static void ask_before_exit(void)
Definition: gntmain.c:370
reset_menu
static void reset_menu(GntWidget *widget, gpointer null)
Definition: gntmain.c:660
gnt_init
void gnt_init()
Definition: gntmain.c:455
GNT_MOUSE_UP
Definition: gntwidget.h:77
act
static GList * act
Definition: gntwm.c:111
_GntAction::callback
void(* callback)(void)
Definition: gntwm.h:76
ascii_only
static gboolean ascii_only
Definition: gntmain.c:75
error
const char * error
Definition: auth_scram.c:51
channel
static GIOChannel * channel
Definition: gntmain.c:71
gnt_hbox_new
#define gnt_hbox_new(homo)
Definition: gntbox.h:97
gnt_screen_resize_widget
void gnt_screen_resize_widget(GntWidget *widget, int width, int height)
Definition: gntmain.c:633
gnt_wm_raise_window
void gnt_wm_raise_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:2285
config.h
gnt_widget_hide
void gnt_widget_hide(GntWidget *widget)
Definition: gntwidget.c:425
_GntWM
Definition: gntwm.h:79
gnt_quit
void gnt_quit()
Definition: gntmain.c:609
gnt_widget_clicked
gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
Definition: gntwidget.c:409
io_invoke_error
static gboolean io_invoke_error(GIOChannel *source, GIOCondition cond, gpointer data)
Definition: gntmain.c:216
gnt_vwindow_new
#define gnt_vwindow_new(homo)
Definition: gntwindow.h:81
gnt_screen_release
void gnt_screen_release(GntWidget *widget)
Definition: gntmain.c:561
_GntWM::window
GntWidget * window
Definition: gntwm.h:90
gnt_style_get_bool
gboolean gnt_style_get_bool(GntStyle style, gboolean def)
Definition: gntstyle.c:102
dbus-buddyicons-example.node
node
Definition: dbus-buddyicons-example.py:32
gnt_widget_set_urgent
void gnt_widget_set_urgent(GntWidget *widget)
Definition: gntmain.c:596
GNT_BINDABLE
#define GNT_BINDABLE(obj)
Definition: gntbindable.h:36
exit_win_close
static void exit_win_close(GntWidget *w, GntWidget **win)
Definition: gntmain.c:364
gnttree.h
_GntWM::_list
struct _GntWM::@39 _list
detect_mouse_action
static gboolean detect_mouse_action(const char *buffer)
Definition: gntmain.c:112
_GntWidgetPriv::height
int height
Definition: gntwidget.h:91
_GntWidget::priv
GntWidgetPriv priv
Definition: gntwidget.h:104
gnt_is_refugee
gboolean gnt_is_refugee()
Definition: gntmain.c:749
gntwindow.h
_GntWM::menu
GntMenu * menu
Definition: gntwm.h:108
escape_timeout
static gboolean escape_timeout(gpointer data)
Definition: gntmain.c:94
gnt_wm_new_window
void gnt_wm_new_window(GntWM *wm, GntWidget *widget)
Definition: gntwm.c:1896
gnt_box_set_alignment
void gnt_box_set_alignment(GntBox *box, GntAlignment alignment)
Definition: gntbox.c:775
gnt_uninit_styles
void gnt_uninit_styles()
Definition: gntstyle.c:453