这篇教程C++ strip_color函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strip_color函数的典型用法代码示例。如果您正苦于以下问题:C++ strip_color函数的具体用法?C++ strip_color怎么用?C++ strip_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strip_color函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: fe_tray_set_balloonvoidfe_tray_set_balloon (const char *title, const char *text){#ifndef WIN32#if 0 const char *argv[8]; const char *path; char time[16];#endif WinStatus ws; /* no balloons if the window is focused */ ws = tray_get_window_status (); if ((prefs.hex_away_omit_alerts && hexchat_get_info(ph, "away")) || (prefs.hex_gui_focus_omitalerts && ws == WS_FOCUSED)) return; /* bit 1 of flags means "no balloons unless hidden/iconified" */ if (ws != WS_HIDDEN && prefs.hex_gui_tray_quiet) return; /* FIXME: this should close the current balloon */ if (!text) return;#ifdef USE_LIBNOTIFY NotifyNotification *notification; char *notify_text, *notify_title; if (!notify_is_initted()) notify_init(PACKAGE_NAME); notify_text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP); notify_title = strip_color (title, -1, STRIP_ALL); notification = XC_NOTIFY_NEW (notify_title, notify_text, HEXCHATSHAREDIR "/icons/hicolor/scalable/apps/hexchat.svg", NULL);#if NOTIFY_CHECK_VERSION(0,7,0) notify_notification_set_hint (notification, "desktop-entry", g_variant_new_string ("hexchat"));#endif g_free ((char *)notify_title); g_free ((char *)notify_text); notify_notification_set_timeout (notification, prefs.hex_input_balloon_time*1000); notify_notification_show (notification, NULL); g_object_unref (notification);#endif#endif}
开发者ID:amalmurali47,项目名称:hexchat,代码行数:51,
示例2: libnotify_notify_newstatic gbooleanlibnotify_notify_new (const char *title, const char *text, GtkStatusIcon *icon){ void *noti; if (!nn_mod) { nn_mod = g_module_open ("libnotify", G_MODULE_BIND_LAZY); if (!nn_mod) { nn_mod = g_module_open ("libnotify.so.1", G_MODULE_BIND_LAZY); if (!nn_mod) return FALSE; } if (!g_module_symbol (nn_mod, "notify_init", (gpointer)&nn_init)) goto bad; if (!g_module_symbol (nn_mod, "notify_uninit", (gpointer)&nn_uninit)) goto bad; if (!g_module_symbol (nn_mod, "notify_notification_new_with_status_icon", (gpointer)&nn_new_with_status_icon)) goto bad; if (!g_module_symbol (nn_mod, "notify_notification_new", (gpointer)&nn_new)) goto bad; if (!g_module_symbol (nn_mod, "notify_notification_show", (gpointer)&nn_show)) goto bad; if (!g_module_symbol (nn_mod, "notify_notification_set_timeout", (gpointer)&nn_set_timeout)) goto bad; if (!nn_init (PACKAGE_NAME)) goto bad; } text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP); title = strip_color (title, -1, STRIP_ALL); noti = nn_new (title, text, XCHATSHAREDIR"/pixmaps/xchat.png", NULL); g_free ((char *)title); g_free ((char *)text); nn_set_timeout (noti, prefs.input_balloon_time*1000); nn_show (noti, NULL); g_object_unref (G_OBJECT (noti)); return TRUE;bad: g_module_close (nn_mod); nn_mod = NULL; return FALSE;}
开发者ID:Babl0lka,项目名称:XChat,代码行数:48,
示例3: fe_tray_set_balloonvoidfe_tray_set_balloon(const char *title, const char *text){#ifndef _WIN32 char *stext; WinStatus ws; NotifyNotification *n; /* no balloons if the window is focused */ ws = tray_get_window_status(); if (ws == WS_FOCUSED) return; /* bit 1 of flags means "no balloons unless hidden/iconified" */ if (ws != WS_HIDDEN && (prefs.gui_tray_flags & 2)) return; /* FIXME: this should close the current balloon */ if (!text) return; stext = strip_color(text, -1, STRIP_ALL); n = notify_notification_new(title, stext, NULL); notify_notification_set_icon_from_pixbuf(n, ICON_NORMAL); notify_notification_set_timeout(n, 20000); notify_notification_show(n, NULL); free(stext); g_object_unref(G_OBJECT(n));#endif}
开发者ID:arinity,项目名称:gchat2,代码行数:31,
示例4: is_hilightstatic intis_hilight (char *from, char *text, session *sess, server *serv){ if (alert_match_word (from, prefs.hex_irc_no_hilight)) return 0; text = strip_color (text, -1, STRIP_ALL); if (alert_match_text (text, serv->nick) || alert_match_text (text, prefs.hex_irc_extra_hilight) || alert_match_word (from, prefs.hex_irc_nick_hilight)) { g_free (text); if (sess != current_tab) { sess->nick_said = TRUE; lastact_update (sess); } fe_set_hilight (sess); return 1; } g_free (text); return 0;}
开发者ID:TheWug,项目名称:hexchat,代码行数:25,
示例5: scrollback_loadvoid scrollback_load(session *sess){ int fh; char buf[512 * 4]; char *text; time_t stamp; int lines; if (sess->text_scrollback == SET_DEFAULT) { if (!prefs.text_replay) return; } else { if (sess->text_scrollback != SET_ON) return; } if (scrollback_get_filename(sess, buf, sizeof(buf)) == nullptr) return; fh = open(buf, O_RDONLY | OFLAGS); if (fh == -1) return; lines = 0; while (waitline(fh, buf, sizeof buf, FALSE) != -1) { if (buf[0] == 'T') { if (sizeof(time_t) == 4) stamp = strtoul(buf + 2, nullptr, 10); else stamp = strtoull(buf + 2, nullptr, 10); // just incase time_t is 64 bits text = strchr(buf + 3, ' '); if (text) { text = strip_color(text + 1, -1, STRIP_COLOR); fe_print_text(sess, text, stamp); g_free(text); } lines++; } } sess->scrollwritten = lines; if (lines) { text = ctime(&stamp); text[24] = 0; // get rid of the /n snprintf(buf, sizeof(buf), "/n*/t%s %s/n/n", _("Loaded log from"), text); fe_print_text(sess, buf, 0); //EMIT_SIGNAL(XP_TE_GENMSG, sess, "*", buf, nullptr, nullptr, nullptr, 0); } close(fh);}
开发者ID:wowzaman12,项目名称:libPChat,代码行数:60,
示例6: fe_tray_set_balloonvoidfe_tray_set_balloon (const char *title, const char *text){#ifndef WIN32 const char *argv[8]; const char *path; char time[16]; WinStatus ws; /* no balloons if the window is focused */ ws = tray_get_window_status (); if (ws == WS_FOCUSED) return; /* bit 1 of flags means "no balloons unless hidden/iconified" */ if (ws != WS_HIDDEN && (prefs.gui_tray_flags & 2)) return; /* FIXME: this should close the current balloon */ if (!text) return;#ifdef LIBNOTIFY /* try it via libnotify.so */ if (libnotify_notify_new (title, text, sticon)) return; /* success */#endif /* try it the crude way */ path = g_find_program_in_path ("notify-send"); if (path) { sprintf(time, "%d000",prefs.input_balloon_time); argv[0] = path; argv[1] = "-i"; argv[2] = "gtk-dialog-info"; if (access (XCHATSHAREDIR"/pixmaps/xchat.png", R_OK) == 0) argv[2] = XCHATSHAREDIR"/pixmaps/xchat.png"; argv[3] = "-t"; argv[4] = time; argv[5] = title; text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP); argv[6] = text; argv[7] = NULL; xchat_execv (argv); g_free ((char *)path); g_free ((char *)text); } else { /* show this error only once */ static unsigned char said_it = FALSE; if (!said_it) { said_it = TRUE; fe_message (_("Cannot find 'notify-send' to open balloon alerts./nPlease install libnotify."), FE_MSG_ERROR); } }#endif}
开发者ID:Babl0lka,项目名称:XChat,代码行数:60,
示例7: part_one_client/* part_one_client() * * inputs - pointer to server * - pointer to source client to remove * - char pointer of name of channel to remove from * output - none * side effects - remove ONE client given the channel name */static voidpart_one_client(struct Client *client_p, struct Client *source_p, const char *name, char *reason){ struct Channel *chptr = NULL; struct Membership *ms = NULL; if ((chptr = hash_find_channel(name)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, name); return; } if ((ms = find_channel_link(source_p, chptr)) == NULL) { sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, name); return; } if (MyConnect(source_p) && !IsOper(source_p)) check_spambot_warning(source_p, NULL); /* * Remove user from the old channel (if any) * only allow /part reasons in -m chans */ if(msg_has_colors(reason) && (chptr->mode.mode & MODE_NOCOLOR)) reason = strip_color(reason); if (reason[0] && (!MyConnect(source_p) || ((can_send(chptr, source_p, ms) && (source_p->firsttime + ConfigFileEntry.anti_spam_exit_message_time) < CurrentTime)))) { sendto_server(client_p, chptr, CAP_TS6, NOCAPS, ":%s PART %s :%s", ID(source_p), chptr->chname, reason); sendto_server(client_p, chptr, NOCAPS, CAP_TS6, ":%s PART %s :%s", source_p->name, chptr->chname, reason); sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s!%[email C++ stripspace函数代码示例 C++ stripLineInvisibleChars函数代码示例
|