1 /*
2  * Nautilus-Actions
3  * A Nautilus extension which offers configurable context menu actions.
4  *
5  * Copyright (C) 2005 The GNOME Foundation
6  * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7  * Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8  *
9  * Nautilus-Actions is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  * Nautilus-Actions is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Nautilus-Actions; see the file COPYING. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  * Authors:
24  *   Frederic Ruaudel <grumz@grumz.net>
25  *   Rodrigo Moya <rodrigo@gnome-db.org>
26  *   Pierre Wieser <pwieser@trychlos.org>
27  *   ... and many others (see AUTHORS)
28  */
29 
30 #ifndef __BASE_GTK_UTILS_H__
31 #define __BASE_GTK_UTILS_H__
32 
33 /**
34  * SECTION: base-gtk-utils
35  * @title: BaseGtkUtils
36  * @short_description: Gtk helper functions
37  * @include: base-gtk-utils.h
38  */
39 
40 #include "base-window.h"
41 
42 G_BEGIN_DECLS
43 
44 /* window size and position
45  */
46 void       base_gtk_utils_restore_window_position( const BaseWindow *window, const gchar *wsp_name );
47 void       base_gtk_utils_save_window_position   ( const BaseWindow *window, const gchar *wsp_name );
48 
49 /* widget status
50  */
51 void       base_gtk_utils_set_editable( GObject *widget, gboolean editable );
52 
53 void       base_gtk_utils_radio_set_initial_state  ( GtkRadioButton *button,
54 				GCallback toggled_handler, void *user_data,
55 				gboolean editable, gboolean sensitive );
56 
57 void       base_gtk_utils_radio_reset_initial_state( GtkRadioButton *button, GCallback toggled_handler );
58 
59 void       base_gtk_utils_toggle_set_initial_state ( BaseWindow *window,
60 				const gchar *button_name, GCallback toggled_handler,
61 				gboolean active, gboolean editable, gboolean sensitive );
62 
63 void       base_gtk_utils_toggle_reset_initial_state( GtkToggleButton *button );
64 
65 /* image utilities
66  */
67 GdkPixbuf *base_gtk_utils_get_pixbuf( const gchar *name, GtkWidget *widget, GtkIconSize size );
68 void       base_gtk_utils_render( const gchar *name, GtkImage *widget, GtkIconSize size );
69 
70 /* standard dialog boxes
71  */
72 void       base_gtk_utils_select_file( BaseWindow *window,
73 				const gchar *title, const gchar *wsp_name,
74 				GtkWidget *entry, const gchar *entry_name );
75 
76 void       base_gtk_utils_select_file_with_preview( BaseWindow *window,
77 				const gchar *title, const gchar *wsp_name,
78 				GtkWidget *entry, const gchar *entry_name,
79 				GCallback update_preview_cb );
80 
81 void       base_gtk_utils_select_dir( BaseWindow *window,
82 				const gchar *title, const gchar *wsp_name,
83 				GtkWidget *entry, const gchar *entry_name );
84 
85 /* try to dynamically convert a GtkTable to a GtkGrid
86  */
87 void       base_gtk_utils_table_to_grid( BaseWindow *window, const gchar *table_name );
88 
89 G_END_DECLS
90 
91 #endif /* __BASE_GTK_UTILS_H__ */
92