2013-03-31 21:44:48 +02:00
|
|
|
/* HexChat
|
|
|
|
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
|
|
* Copyright (C) 2009-2013 Berke Viktor.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2013-06-22 01:13:36 +02:00
|
|
|
#include <time.h>
|
2011-02-24 04:14:30 +01:00
|
|
|
#include "textenums.h"
|
|
|
|
|
2012-10-25 01:33:23 +02:00
|
|
|
#ifndef HEXCHAT_TEXT_H
|
|
|
|
#define HEXCHAT_TEXT_H
|
2011-02-24 04:14:30 +01:00
|
|
|
|
2013-06-22 01:13:36 +02:00
|
|
|
/* timestamp is non-zero if we are using server-time */
|
|
|
|
#define EMIT_SIGNAL_TIMESTAMP(i, sess, a, b, c, d, e, timestamp) \
|
|
|
|
text_emit(i, sess, a, b, c, d, timestamp)
|
|
|
|
#define EMIT_SIGNAL(i, sess, a, b, c, d, e) \
|
|
|
|
text_emit(i, sess, a, b, c, d, 0)
|
2011-02-24 04:14:30 +01:00
|
|
|
|
|
|
|
struct text_event
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
char * const *help;
|
|
|
|
int num_args;
|
|
|
|
char *def;
|
|
|
|
};
|
|
|
|
|
|
|
|
void scrollback_close (session *sess);
|
|
|
|
void scrollback_load (session *sess);
|
|
|
|
|
|
|
|
int text_word_check (char *word, int len);
|
|
|
|
void PrintText (session *sess, char *text);
|
2013-06-23 20:53:41 +02:00
|
|
|
void PrintTextTimeStamp (session *sess, char *text, time_t timestamp);
|
2014-07-18 03:25:41 +02:00
|
|
|
void PrintTextf (session *sess, const char *format, ...) G_GNUC_PRINTF (2, 3);
|
|
|
|
void PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...) G_GNUC_PRINTF (3, 4);
|
2011-02-24 04:14:30 +01:00
|
|
|
void log_close (session *sess);
|
|
|
|
void log_open_or_close (session *sess);
|
|
|
|
void load_text_events (void);
|
|
|
|
void pevent_save (char *fn);
|
|
|
|
int pevt_build_string (const char *input, char **output, int *max_arg);
|
|
|
|
int pevent_load (char *filename);
|
|
|
|
void pevent_make_pntevts (void);
|
2013-03-09 23:57:06 +01:00
|
|
|
int text_color_of (char *name);
|
2013-06-22 01:13:36 +02:00
|
|
|
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
|
|
|
|
time_t timestamp);
|
2013-07-12 02:33:35 +02:00
|
|
|
int text_emit_by_name (char *name, session *sess, time_t timestamp,
|
|
|
|
char *a, char *b, char *c, char *d);
|
2015-01-31 09:52:31 +01:00
|
|
|
gchar *text_convert_invalid (const gchar* text, gssize len, GIConv converter, const gchar *fallback, gsize *len_out);
|
|
|
|
gchar *text_fixup_invalid_utf8 (const gchar* text, gssize len, gsize *len_out);
|
2011-02-24 04:14:30 +01:00
|
|
|
int get_stamp_str (char *fmt, time_t tim, char **ret);
|
2014-12-15 19:25:28 +01:00
|
|
|
void format_event (session *sess, int index, char **args, char *o, gsize sizeofo, unsigned int stripcolor_args);
|
2011-02-24 04:14:30 +01:00
|
|
|
char *text_find_format_string (char *name);
|
2015-01-31 09:52:31 +01:00
|
|
|
|
|
|
|
extern const gchar* unicode_fallback_string;
|
|
|
|
extern const gchar* arbitrary_encoding_fallback_string;
|
|
|
|
|
2013-04-27 23:00:18 +02:00
|
|
|
void sound_play (const char *file, gboolean quiet);
|
2011-02-24 04:14:30 +01:00
|
|
|
void sound_play_event (int i);
|
|
|
|
void sound_beep (session *);
|
|
|
|
void sound_load ();
|
|
|
|
void sound_save ();
|
|
|
|
|
|
|
|
#endif
|