1 /* HexChat
2  * Copyright (C) 1998-2010 Peter Zelezny.
3  * Copyright (C) 2009-2013 Berke Viktor.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19 
20 #ifndef HEXCHAT_CHANVIEW_H
21 #define HEXCHAT_CHANVIEW_H
22 
23 typedef struct _chanview chanview;
24 typedef struct _chan chan;
25 
26 chanview *chanview_new (int type, int trunc_len, gboolean sort, gboolean use_icons, GtkStyle *style);
27 void chanview_set_callbacks (chanview *cv,
28 	void (*cb_focus) (chanview *, chan *, int tag, void *userdata),
29 	void (*cb_xbutton) (chanview *, chan *, int tag, void *userdata),
30 	gboolean (*cb_contextmenu) (chanview *, chan *, int tag, void *userdata, GdkEventButton *),
31 	int (*cb_compare) (void *a, void *b));
32 void chanview_set_impl (chanview *cv, int type);
33 chan *chanview_add (chanview *cv, char *name, void *family, void *userdata, gboolean allow_closure, int tag, GdkPixbuf *icon);
34 int chanview_get_size (chanview *cv);
35 GtkWidget *chanview_get_box (chanview *cv);
36 void chanview_move_focus (chanview *cv, gboolean relative, int num);
37 GtkOrientation chanview_get_orientation (chanview *cv);
38 void chanview_set_orientation (chanview *cv, gboolean vertical);
39 
40 int chan_get_tag (chan *ch);
41 void *chan_get_userdata (chan *ch);
42 void chan_focus (chan *ch);
43 void chan_move (chan *ch, int delta);
44 void chan_move_family (chan *ch, int delta);
45 void chan_set_color (chan *ch, PangoAttrList *list);
46 void chan_rename (chan *ch, char *new_name, int trunc_len);
47 gboolean chan_remove (chan *ch, gboolean force);
48 gboolean chan_is_collapsed (chan *ch);
49 chan * chan_get_parent (chan *ch);
50 
51 #define FOCUS_NEW_ALL 1
52 #define FOCUS_NEW_ONLY_ASKED 2
53 #define FOCUS_NEW_NONE 0
54 
55 #endif
56