static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg) { WI_ITEM_REC *item; int data_level; if (dest->window == active_win || (dest->level & hide_level)) return; if (dest->level & hilight_level) { data_level = DATA_LEVEL_HILIGHT+dest->hilight_priority; } else { data_level = (dest->level & msg_level) ? DATA_LEVEL_MSG : DATA_LEVEL_TEXT; } if (hide_targets != NULL && (dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) { /* check for both target and tag/target */ if (strarray_find_dest(hide_targets, dest)) return; } if (dest->target != NULL) { item = window_item_find(dest->server, dest->target); if (item != NULL) { window_item_activity(item, data_level, dest->hilight_color); } } window_activity(dest->window, data_level, dest->hilight_color); }
static void sig_dehilight_window(WINDOW_REC *window) { GSList *tmp; g_return_if_fail(window != NULL); if (window->data_level != 0) { window_activity(window, 0, NULL); for (tmp = window->items; tmp != NULL; tmp = tmp->next) window_item_activity(tmp->data, 0, NULL); } }
/** * current_prompt() * * Get the current prompt, locale-recoded. * * @return Static buffer pointer, non-NULL, locale-encoded. */ const /*locale*/ char *current_prompt(void) { static gchar *buf = NULL; session_t *s; char *tmp, *act, *sid; char *format, *format_act; if (no_prompt) return ""; s = session_current; sid = s ? (s->alias?s->alias:s->uid) : ""; if (window_current->id > 1) { format = "rl_prompt_query"; format_act = "rl_prompt_query_act"; } else if (s && (s && s->status == EKG_STATUS_INVISIBLE)) { format = "rl_prompt_invisible"; format_act = "rl_prompt_invisible_act"; } else if (s && (s->status < EKG_STATUS_AVAIL)) { format = "rl_prompt_away"; format_act = "rl_prompt_away_act"; } else { format = "rl_prompt"; format_act = "rl_prompt_act"; } act = window_activity(); if (act) tmp = format_string(format_find(format_act), sid, ekg_itoa(window_current->id), act, window_current->target); else tmp = format_string(format_find(format), sid, ekg_itoa(window_current->id), window_current->target); g_free(buf); buf = ekg_recode_to_locale(tmp); g_free(tmp); g_free(act); return buf; }
static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg) { WI_ITEM_REC *item; char *tagtarget; int data_level; if (dest->window == active_win || (dest->level & hide_level)) return; if (dest->level & hilight_level) { data_level = DATA_LEVEL_HILIGHT+dest->hilight_priority; } else { data_level = (dest->level & msg_level) ? DATA_LEVEL_MSG : DATA_LEVEL_TEXT; } if ((dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) { /* check for both target and tag/target */ if (hide_target_activity(data_level, dest->target)) return; tagtarget = dest->server_tag == NULL ? NULL : g_strdup_printf("%s/%s", dest->server_tag, dest->target); if (hide_target_activity(data_level, tagtarget)) { g_free(tagtarget); return; } g_free(tagtarget); } if (dest->target != NULL) { item = window_item_find(dest->server, dest->target); if (item != NULL) { window_item_activity(item, data_level, dest->hilight_color); } } window_activity(dest->window, data_level, dest->hilight_color); }