summary refs log blame commit diff stats
path: root/src/common/outbound.h
blob: 490a58caba3caec29c04f0168ce1adeaf159772f (plain) (tree)


















                                                                            

                          
 

                    


                                       
                                                                                               
                                                                                                         
                                                     







                                                                                                                                    
                                                                        


                                                       
/* 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
 */

#ifndef HEXCHAT_OUTBOUND_H
#define HEXCHAT_OUTBOUND_H

#include "hexchat.h"

extern const struct commands xc_cmds[];
extern GSList *menu_list;

int auto_insert (char *dest, gsize destlen, unsigned char *src, char *word[], char *word_eol[],
				 char *a, char *c, char *d, char *e, char *h, char *n, char *s, char *u);
char *command_insert_vars (session *sess, char *cmd);
int handle_command (session *sess, char *cmd, int check_spch);
void process_data_init (char *buf, char *cmd, char *word[], char *word_eol[], gboolean handle_quotes, gboolean allow_escape_quotes);
void handle_multiline (session *sess, char *cmd, int history, int nocommand);
void check_special_chars (char *cmd, int do_ascii);
void notc_msg (session *sess);
void server_sendpart (server * serv, char *channel, char *reason);
void server_sendquit (session * sess);
int menu_streq (const char *s1, const char *s2, int def);
session *open_query (server *serv, char *nick, gboolean focus_existing);
gboolean load_perform_file (session *sess, char *file);

#endif
pan class="w"> *search_re; /* Compiled regular expression */ textentry *hintsearch; /* textentry found for last search */ } xtext_buffer; struct _GtkXText { GtkWidget widget; xtext_buffer *buffer; xtext_buffer *orig_buffer; xtext_buffer *selection_buffer; #ifdef USE_SHM XShmSegmentInfo shminfo; #endif GtkAdjustment *adj; GdkPixmap *pixmap; /* 0 = use palette[19] */ GdkDrawable *draw_buf; /* points to ->window */ GdkCursor *hand_cursor; GdkCursor *resize_cursor; int pixel_offset; /* amount of pixels the top line is chopped by */ int last_win_x; int last_win_y; int last_win_h; int last_win_w; int tint_red; int tint_green; int tint_blue; GdkGC *bgc; /* backing pixmap */ GdkGC *fgc; /* text foreground color */ GdkGC *light_gc; /* sep bar */ GdkGC *dark_gc; GdkGC *thin_gc; GdkGC *marker_gc; gulong palette[XTEXT_COLS]; gint io_tag; /* for delayed refresh events */ gint add_io_tag; /* "" when adding new text */ gint scroll_tag; /* marking-scroll timeout */ gulong vc_signal_tag; /* signal handler for "value_changed" adj */ int select_start_adj; /* the adj->value when the selection started */ int select_start_x; int select_start_y; int select_end_x; int select_end_y; int max_lines; int col_fore; int col_back; int depth; /* gdk window depth */ char num[8]; /* for parsing mirc color */ int nc; /* offset into xtext->num */ textentry *hilight_ent; int hilight_start; int hilight_end; guint16 fontwidth[128]; /* each char's width, only the ASCII ones */ #ifdef USE_XFT XftColor color[XTEXT_COLS]; XftColor *xft_fg; XftColor *xft_bg; /* both point into color[20] */ XftDraw *xftdraw; XftFont *font; XftFont *ifont; /* italics */ #else struct pangofont { PangoFontDescription *font; PangoFontDescription *ifont; /* italics */ int ascent; int descent; } *font, pango_font; PangoLayout *layout; #endif int fontsize; int space_width; /* width (pixels) of the space " " character */ int stamp_width; /* width of "[88:88:88]" */ int max_auto_indent; unsigned char scratch_buffer[4096]; void (*error_function) (int type); int (*urlcheck_function) (GtkWidget * xtext, char *word); int jump_out_offset; /* point at which to stop rendering */ int jump_in_offset; /* "" start rendering */ int ts_x; /* ts origin for ->bgc GC */ int ts_y; int clip_x; /* clipping (x directions) */ int clip_x2; /* from x to x2 */ int clip_y; /* clipping (y directions) */ int clip_y2; /* from y to y2 */ /* current text states */ unsigned int bold:1; unsigned int underline:1; unsigned int italics:1; unsigned int hidden:1; /* text parsing states */ unsigned int parsing_backcolor:1; unsigned int parsing_color:1; unsigned int backcolor:1; /* various state information */ unsigned int moving_separator:1; unsigned int word_or_line_select:1; unsigned int button_down:1; unsigned int hilighting:1; unsigned int dont_render:1; unsigned int dont_render2:1; unsigned int cursor_hand:1; unsigned int cursor_resize:1; unsigned int skip_border_fills:1; unsigned int skip_stamp:1; unsigned int mark_stamp:1; /* Cut&Paste with stamps? */ unsigned int force_stamp:1; /* force redrawing it */ unsigned int render_hilights_only:1; unsigned int in_hilight:1; unsigned int un_hilight:1; unsigned int recycle:1; unsigned int avoid_trans:1; unsigned int force_render:1; unsigned int shm:1; unsigned int color_paste:1; /* CTRL was pressed when selection finished */ /* settings/prefs */ unsigned int auto_indent:1; unsigned int thinline:1; unsigned int transparent:1; unsigned int shaded:1; unsigned int marker:1; unsigned int separator:1; unsigned int wordwrap:1; unsigned int overdraw:1; unsigned int ignore_hidden:1; /* rawlog uses this */ }; struct _GtkXTextClass { GtkWidgetClass parent_class; void (*word_click) (GtkXText * xtext, char *word, GdkEventButton * event); }; GtkWidget *gtk_xtext_new (GdkColor palette[], int separator); void gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len); void gtk_xtext_append_indent (xtext_buffer *buf, unsigned char *left_text, int left_len, unsigned char *right_text, int right_len, time_t stamp); int gtk_xtext_set_font (GtkXText *xtext, char *name); void gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap, gboolean trans); void gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[]); void gtk_xtext_clear (xtext_buffer *buf, int lines); void gtk_xtext_save (GtkXText * xtext, int fh); void gtk_xtext_refresh (GtkXText * xtext, int do_trans); int gtk_xtext_lastlog (xtext_buffer *out, xtext_buffer *search_area); textentry *gtk_xtext_search (GtkXText * xtext, const gchar *text, gtk_xtext_search_flags flags, GError **err); void gtk_xtext_reset_marker_pos (GtkXText *xtext); void gtk_xtext_check_marker_visibility(GtkXText *xtext); gboolean gtk_xtext_is_empty (xtext_buffer *buf); typedef void (*GtkXTextForeach) (GtkXText *xtext, unsigned char *text, void *data); void gtk_xtext_foreach (xtext_buffer *buf, GtkXTextForeach func, void *data); void gtk_xtext_set_error_function (GtkXText *xtext, void (*error_function) (int)); void gtk_xtext_set_indent (GtkXText *xtext, gboolean indent); void gtk_xtext_set_max_indent (GtkXText *xtext, int max_auto_indent); void gtk_xtext_set_max_lines (GtkXText *xtext, int max_lines); void gtk_xtext_set_show_marker (GtkXText *xtext, gboolean show_marker); void gtk_xtext_set_show_separator (GtkXText *xtext, gboolean show_separator); void gtk_xtext_set_thin_separator (GtkXText *xtext, gboolean thin_separator); void gtk_xtext_set_time_stamp (xtext_buffer *buf, gboolean timestamp); void gtk_xtext_set_tint (GtkXText *xtext, int tint_red, int tint_green, int tint_blue); void gtk_xtext_set_urlcheck_function (GtkXText *xtext, int (*urlcheck_function) (GtkWidget *, char *)); void gtk_xtext_set_wordwrap (GtkXText *xtext, gboolean word_wrap); xtext_buffer *gtk_xtext_buffer_new (GtkXText *xtext); void gtk_xtext_buffer_free (xtext_buffer *buf); void gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render); void gtk_xtext_copy_selection (GtkXText *xtext); GType gtk_xtext_get_type (void); #endif