File: GtkFileChooser.xs

package info (click to toggle)
libgtk2-perl 2:1.2499-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,668 kB
  • ctags: 594
  • sloc: perl: 22,100; ansic: 122; makefile: 17
file content (227 lines) | stat: -rw-r--r-- 6,778 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/*
 * Copyright (c) 2003-2005 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

MODULE = Gtk2::FileChooser PACKAGE = Gtk2::FileChooser PREFIX = gtk_file_chooser_

=for enum GtkFileChooserAction
=cut

=for enum GtkFileChooserError
=cut

## Configuration
##
void gtk_file_chooser_set_action (GtkFileChooser *chooser, GtkFileChooserAction action);

GtkFileChooserAction gtk_file_chooser_get_action (GtkFileChooser *chooser);

void gtk_file_chooser_set_local_only (GtkFileChooser *chooser, gboolean files_only);

gboolean gtk_file_chooser_get_local_only (GtkFileChooser *chooser);

void gtk_file_chooser_set_select_multiple (GtkFileChooser *chooser, gboolean select_multiple);

gboolean gtk_file_chooser_get_select_multiple (GtkFileChooser *chooser);

## Filename manipulation
##
void gtk_file_chooser_set_current_name (GtkFileChooser *chooser, const gchar *name);

gchar_own * gtk_file_chooser_get_filename (GtkFileChooser *chooser);

gboolean gtk_file_chooser_set_filename (GtkFileChooser *chooser, const char *filename);

gboolean gtk_file_chooser_select_filename (GtkFileChooser *chooser, const char *filename);

void gtk_file_chooser_unselect_filename (GtkFileChooser *chooser, const char *filename);

void gtk_file_chooser_select_all (GtkFileChooser *chooser);

void gtk_file_chooser_unselect_all (GtkFileChooser *chooser);

void gtk_file_chooser_get_filenames (GtkFileChooser *chooser);
    PREINIT:
	GSList * names, * i;
    PPCODE:
	names = gtk_file_chooser_get_filenames (chooser);
	for (i = names ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (names);

gboolean gtk_file_chooser_set_current_folder (GtkFileChooser *chooser, const gchar *filename);

gchar_own *gtk_file_chooser_get_current_folder (GtkFileChooser *chooser);



## URI manipulation
##
gchar_own * gtk_file_chooser_get_uri (GtkFileChooser *chooser);

gboolean gtk_file_chooser_set_uri (GtkFileChooser *chooser, const char *uri);

gboolean gtk_file_chooser_select_uri (GtkFileChooser *chooser, const char *uri);

void gtk_file_chooser_unselect_uri (GtkFileChooser *chooser, const char *uri);

void gtk_file_chooser_get_uris (GtkFileChooser *chooser);
    PREINIT:
	GSList * uris, * i;
    PPCODE:
	uris = gtk_file_chooser_get_uris (chooser);
	for (i = uris ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (uris);



gboolean gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser, const gchar *uri);

gchar_own *gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser);



## Preview widget
##

void gtk_file_chooser_set_preview_widget (GtkFileChooser *chooser, GtkWidget *preview_widget);

GtkWidget *gtk_file_chooser_get_preview_widget (GtkFileChooser *chooser);

void gtk_file_chooser_set_preview_widget_active (GtkFileChooser *chooser, gboolean active);

gboolean gtk_file_chooser_get_preview_widget_active (GtkFileChooser *chooser);



## char *gtk_file_chooser_get_preview_filename (GtkFileChooser *file_chooser);
GPerlFilename_own gtk_file_chooser_get_preview_filename (GtkFileChooser *file_chooser);
    CODE:
	RETVAL = gtk_file_chooser_get_preview_filename (file_chooser);
	if (!RETVAL)
		XSRETURN_UNDEF;
    OUTPUT:
	RETVAL

## char *gtk_file_chooser_get_preview_uri (GtkFileChooser *file_chooser);
gchar_own *gtk_file_chooser_get_preview_uri (GtkFileChooser *file_chooser);
    CODE:
	RETVAL = gtk_file_chooser_get_preview_uri (file_chooser);
	if (!RETVAL)
		XSRETURN_UNDEF;
    OUTPUT:
	RETVAL

void gtk_file_chooser_set_use_preview_label (GtkFileChooser *chooser, gboolean use_label);

gboolean gtk_file_chooser_get_use_preview_label (GtkFileChooser *chooser);


## Extra widget
##
void gtk_file_chooser_set_extra_widget (GtkFileChooser *chooser, GtkWidget *extra_widget);

GtkWidget *gtk_file_chooser_get_extra_widget (GtkFileChooser *chooser);

## List of user selectable filters
##
void gtk_file_chooser_add_filter (GtkFileChooser *chooser, GtkFileFilter *filter);

void gtk_file_chooser_remove_filter (GtkFileChooser *chooser, GtkFileFilter *filter);

void gtk_file_chooser_list_filters (GtkFileChooser *chooser);
    PREINIT:
	GSList * filters, * i;
    PPCODE:
	filters = gtk_file_chooser_list_filters (chooser);
	for (i = filters ; i != NULL ; i = i->next)
		XPUSHs (sv_2mortal (newSVGtkFileFilter (i->data)));
	g_slist_free (filters);

## Current filter
##
void gtk_file_chooser_set_filter (GtkFileChooser *chooser, GtkFileFilter *filter);

GtkFileFilter *gtk_file_chooser_get_filter (GtkFileChooser *chooser);

## Per-application shortcut folders

=for apidoc __gerror__
=cut
void
gtk_file_chooser_add_shortcut_folder (GtkFileChooser *chooser, const char *folder);
    ALIAS:
	add_shortcut_folder        = 0
	remove_shortcut_folder     = 1
	add_shortcut_folder_uri    = 2
	remove_shortcut_folder_uri = 3
    PREINIT:
	GError * error = NULL;
	gboolean ret = FALSE;
    CODE:
	switch (ix) {
	    case 0: ret = gtk_file_chooser_add_shortcut_folder (chooser, folder, &error); break;
	    case 1: ret = gtk_file_chooser_remove_shortcut_folder (chooser, folder, &error); break;
	    case 2: ret = gtk_file_chooser_add_shortcut_folder_uri (chooser, folder, &error); break;
	    case 3: ret = gtk_file_chooser_remove_shortcut_folder_uri (chooser, folder, &error); break;
	    default:
		g_assert_not_reached ();
	}
	if (!ret)
		gperl_croak_gerror (NULL, error);

## GSList *gtk_file_chooser_list_shortcut_folders (GtkFileChooser *chooser);
## GSList *gtk_file_chooser_list_shortcut_folder_uris (GtkFileChooser *chooser);

void gtk_file_chooser_list_shortcut_folders (GtkFileChooser *chooser);
    ALIAS:
	list_shortcut_folders     = 0
	list_shortcut_folder_uris = 1
    PREINIT:
	GSList * slist, * i;
    PPCODE:
	if (ix == 0)
		slist = gtk_file_chooser_list_shortcut_folders (chooser);
	else
		slist = gtk_file_chooser_list_shortcut_folder_uris (chooser);
	for (i = slist ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (slist);

#if GTK_CHECK_VERSION (2, 6, 0)

void gtk_file_chooser_set_show_hidden (GtkFileChooser *chooser, gboolean show_hidden)

gboolean gtk_file_chooser_get_show_hidden (GtkFileChooser *chooser)

#endif

#if GTK_CHECK_VERSION (2, 8, 0)

void gtk_file_chooser_set_do_overwrite_confirmation (GtkFileChooser *chooser, gboolean do_overwrite_confirmation);

gboolean gtk_file_chooser_get_do_overwrite_confirmation (GtkFileChooser *chooser);

#endif

#if GTK_CHECK_VERSION (2, 18, 0)

void gtk_file_chooser_set_create_folders (GtkFileChooser *chooser, gboolean create_folders);

gboolean gtk_file_chooser_get_create_folders (GtkFileChooser *chooser);

#endif