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_GTKUTIL_H
21 #define HEXCHAT_GTKUTIL_H
22 
23 #include <gtk/gtk.h>
24 #include "../common/fe.h"
25 
26 typedef void (*filereqcallback) (void *, char *file);
27 
28 void gtkutil_file_req (const char *title, void *callback, void *userdata, char *filter, char *extensions, int flags);
29 void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad);
30 void gtkutil_destroy_on_esc (GtkWidget *win);
31 GtkWidget *gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
32 				 void *userdata, char *labeltext);
33 void gtkutil_label_new (char *text, GtkWidget * box);
34 GtkWidget *gtkutil_entry_new (int max, GtkWidget * box, void *callback,
35 										gpointer userdata);
36 void show_and_unfocus (GtkWidget * wid);
37 void gtkutil_set_icon (GtkWidget *win);
38 GtkWidget *gtkutil_window_new (char *title, char *role, int width, int height, int flags);
39 void gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
40                                 const gchar *str);
41 GtkWidget *gtkutil_treeview_new (GtkWidget *box, GtkTreeModel *model,
42                                  GtkTreeCellDataFunc mapper, ...);
43 gboolean gtkutil_treemodel_string_to_iter (GtkTreeModel *model, gchar *pathstr, GtkTreeIter *iter_ret);
44 gboolean gtkutil_treeview_get_selected_iter (GtkTreeView *view, GtkTreeIter *iter_ret);
45 gboolean gtkutil_treeview_get_selected (GtkTreeView *view, GtkTreeIter *iter_ret, ...);
46 gboolean gtkutil_tray_icon_supported (GtkWindow *window);
47 
48 #if defined (WIN32) || defined (__APPLE__)
49 gboolean gtkutil_find_font (const char *fontname);
50 #endif
51 
52 #endif
53