Exemplo n.º 1
0
/*
 * Process any new messages we have waiting in the message queue.
 */
static gboolean owl_process_messages_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) {
  int newmsgs=0;
  int followlast = owl_global_should_followlast(&g);
  owl_message *m;

  /* Grab incoming messages. */
  while (owl_global_messagequeue_pending(&g)) {
    m = owl_global_messagequeue_popmsg(&g);
    if (owl_process_message(m))
      newmsgs = 1;
  }

  if (newmsgs) {
    /* follow the last message if we're supposed to */
    if (followlast)
      owl_function_lastmsg_noredisplay();

    /* do the newmsgproc thing */
    owl_function_do_newmsgproc();

    /* redisplay if necessary */
    /* this should be optimized to not run if the new messages won't be displayed */
    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
  }
  return TRUE;
}
Exemplo n.º 2
0
Arquivo: owl.c Projeto: dxiao/barnowl
/*
 * Process any new messages we have waiting in the message queue.
 * Returns 1 if any messages were added to the message list, and 0 otherwise.
 */
int owl_process_messages(owl_ps_action *d, void *p)
{
  int newmsgs=0;
  int followlast = owl_global_should_followlast(&g);
  owl_message *m;

  /* Grab incoming messages. */
  while (owl_global_messagequeue_pending(&g)) {
    m = owl_global_messagequeue_popmsg(&g);
    if (owl_process_message(m))
      newmsgs = 1;
  }

  if (newmsgs) {
    /* follow the last message if we're supposed to */
    if (followlast)
      owl_function_lastmsg_noredisplay();

    /* do the newmsgproc thing */
    owl_function_do_newmsgproc();

    /* redisplay if necessary */
    /* this should be optimized to not run if the new messages won't be displayed */
    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
  }
  return newmsgs;
}
Exemplo n.º 3
0
int owl_popwin_close(owl_popwin *pw)
{
  delwin(pw->popwin);
  delwin(pw->borderwin);
  pw->active=0;
  owl_global_set_needrefresh(&g);
  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
  owl_function_full_redisplay(&g);
  return(0);
}
Exemplo n.º 4
0
int owl_variable_colorztext_set(owl_variable *v, bool newval)
{
  int ret = owl_variable_bool_set_default(v, newval);
  /* flush the format cache so that we see the update, but only if we're done initializing BarnOwl */
  if (owl_global_get_msglist(&g) != NULL)
    owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
  if (owl_global_get_mainwin(&g) != NULL) {
    owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
  }
  return ret;
}
Exemplo n.º 5
0
void owl_global_set_search_re(owl_global *g, const owl_regex *re) {
  if (owl_regex_is_set(&g->search_re)) {
    owl_regex_cleanup(&g->search_re);
    owl_regex_init(&g->search_re);
  }
  if (re != NULL)
    owl_regex_copy(re, &g->search_re);
  /* TODO: Emit a signal so we don't depend on the viewwin and mainwin */
  if (owl_global_get_viewwin(g))
    owl_viewwin_dirty(owl_global_get_viewwin(g));
  owl_mainwin_redisplay(owl_global_get_mainwin(g));
}
Exemplo n.º 6
0
void owl_global_set_rightshift(owl_global *g, int i) {
  g->rightshift = i;
  owl_mainwin_redisplay(owl_global_get_mainwin(g));
}