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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files.gtk (https://github.com/gtk-rs/gir-files)
// from gir-files.xfce
// DO NOT EDIT
use crateffi;
use *;
/// Creates the shared thumbnail path for the file that corresponds to the given `uri`
/// and `size`. No checks are made regarding the existence of the thumbnail.
///
/// It is the duty of the caller to free the returned string.
/// ## `uri`
/// the uri of the file whose shared thumbnail we want to find.
/// ## `size`
/// the thumbnail size (e.g. normal, large).
///
/// # Returns
///
/// a string with the thumbnail path or NULL if the `uri` could not be converted to
/// a local filename.
//#[doc(alias = "xfce_g_file_create_checksum")]
//pub fn g_file_create_checksum(file: /*Ignored*/&gio::File, cancellable: /*Ignored*/Option<&gio::Cancellable>) -> Result<Option<glib::GString>, glib::Error> {
// unsafe { TODO: call ffi:xfce_g_file_create_checksum() }
//}
//#[doc(alias = "xfce_g_file_is_trusted")]
//pub fn g_file_is_trusted(file: /*Ignored*/&gio::File, cancellable: /*Ignored*/Option<&gio::Cancellable>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:xfce_g_file_is_trusted() }
//}
//#[doc(alias = "xfce_g_file_metadata_is_supported")]
//pub fn g_file_metadata_is_supported(file: /*Ignored*/&gio::File) -> bool {
// unsafe { TODO: call ffi:xfce_g_file_metadata_is_supported() }
//}
//#[doc(alias = "xfce_g_file_set_trusted")]
//pub fn g_file_set_trusted(file: /*Ignored*/&gio::File, is_trusted: bool, cancellable: /*Ignored*/Option<&gio::Cancellable>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:xfce_g_file_set_trusted() }
//}
//#[doc(alias = "xfce_g_string_append_quoted")]
//pub fn g_string_append_quoted(string: /*Ignored*/&mut glib::String, unquoted: &str) {
// unsafe { TODO: call ffi:xfce_g_string_append_quoted() }
//}
/// Similar to [`file_localized()`][crate::file_localized()], but works on directory instead of
/// a file.
/// ## `directory`
/// directory name to check for a localized variant.
///
/// # Returns
///
/// path of the localized directory name or copy of `directory` if
/// no such directory exists. Returned string should be freed using
/// `g_free()`.
/// Similar to `xfce_get_file_localized_r`, but works on directory instead
/// of regular file.
/// ## `buffer`
/// destination buffer to store the localized filename to.
/// ## `length`
/// size of `buffer` in bytes.
/// ## `directory`
/// name of directory to check for localized variant of.
///
/// # Returns
///
/// pointer to `buffer` or [`None`] on error.
/// Checks if theres a version of `filename` which is localized to the current
/// locale. This is done by appending the full locale name to `filename`, separated
/// by a '.'. If theres no file of that name, it retries using the full locale
/// name without the encoding (if any), then without the qualifier (if any) and
/// at last the base locale is tried. If all of those fails, a copy of `filename`
/// is returned.
/// ## `filename`
/// name of a file to look for a localized version.
///
/// # Returns
///
/// path of the localized file or copy of `filename` if no such
/// file exists. Returned string should be freed using `g_free()`.
/// Similar in functionality to [`file_localized()`][crate::file_localized()], but stores the
/// result in `buffer` instead of allocating a new buffer.
/// ## `buffer`
/// destination buffer to store the localized filename to.
/// ## `length`
/// size of `buffer` in bytes.
/// ## `filename`
/// name of a file to look for a localized version.
///
/// # Returns
///
/// pointer to `buffer` or [`None`] on error.
/// Similar to `g_get_home_dir()` in functionality but will never return NULL.
/// While `g_get_home_dir()` may return NULL under certain circumstances, this
/// function is garantied to never ever return NULL, but always return a
/// valid character pointer with the absolute path to the user's home directory.
///
/// The returned string is owned by libxfce4util and must not be freed by
/// the caller.
///
/// # Returns
///
/// the path to the current user's home directory.
//#[doc(alias = "xfce_get_homefile_r")]
//#[doc(alias = "get_homefile_r")]
//pub fn homefile_r(buffer: &str, format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> glib::GString {
// unsafe { TODO: call ffi:xfce_get_homefile_r() }
//}
//#[doc(alias = "xfce_get_license_text")]
//#[doc(alias = "get_license_text")]
//pub fn license_text(license_type: /*Ignored*/LicenseTextType) -> glib::GString {
// unsafe { TODO: call ffi:xfce_get_license_text() }
//}
//#[doc(alias = "xfce_get_path_localized")]
//#[doc(alias = "get_path_localized")]
//pub fn path_localized(dst: &str, size: usize, paths: &str, filename: &str, test: /*Ignored*/glib::FileTest) -> glib::GString {
// unsafe { TODO: call ffi:xfce_get_path_localized() }
//}
/// Safe way to retrieve the path to the user's ".xfce4" directory. The path
/// to the current user's ".xfce4" directory is either taken from the
/// environment variable XFCE4HOME if defined, or if unset, is gained by
/// concatenating the path to the user's home directory and the ".xfce4".
/// That says, it will, by default, return the path "$HOME/.xfce4", where
/// $HOME is replaced with the absolute path to the user's home directory.
///
/// The returned string is managed by libxfce4util and must not be freed by
/// the caller.
///
/// # Returns
///
/// the path to the current user's ".xfce4" directory.
//#[doc(alias = "xfce_get_userfile_r")]
//#[doc(alias = "get_userfile_r")]
//pub fn userfile_r(buffer: &str, format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> glib::GString {
// unsafe { TODO: call ffi:xfce_get_userfile_r() }
//}
/// Portable way to query the hostname of the node running the process. This
/// function does not ever return [`None`], but always returns a string containing
/// the current node's hostname.
///
/// # Returns
///
/// the current node's hostname. The string has to be freed
/// by the caller using `g_free()`.
/// The locale is of the general form LANG_COUNTRY.ENCODING @ MODIFIER, where
/// each of COUNTRY, ENCODING and MODIFIER can be absent.
///
/// The match is done by actually removing the rightmost element one by one. This
/// is not entirely according to the freedesktop.org specification, but much easier.
/// Will probably be fixed in the future.
/// ## `locale1`
/// the current locale value as returned by setlocale(LC_MESSAGES,[`None`]).
/// ## `locale2`
/// the locale value to match against.
///
/// # Returns
///
/// an integer value indicating the level of matching, where
/// the constant `XFCE_LOCALE_FULL_MATCH` indicates a full match
/// and `XFCE_LOCALE_NO_MATCH` means no match. Every other value
/// indicates a partial match, the higher the value, the better
/// the match. You should not rely on any specific value besides
/// the constants `XFCE_LOCALE_FULL_MATCH` and `XFCE_LOCALE_NO_MATCH`,
/// since the range of returned values may change in the future.
/// Creates the specified directory `whole_path`, but unlike the `mkdir()`
/// function from the standard C library, if any of the parent directories
/// of the `whole_path` do not exists, they are created as well.
///
/// If the directory specified by `whole_path` already exists, this function
/// performs no operation and simply returns [`true`].
/// ## `whole_path`
/// path to the directory to create.
/// ## `mode`
/// file permissions to use for the newly created directories.
///
/// # Returns
///
/// [`true`] on success, else [`false`].
/// Initializes the POSIX signal handler system. Must be called
/// before setting any POSIX signal handlers.
///
/// # Returns
///
/// [`true`] on success, [`false`] on failure, in which case
/// `error` will be set.
/// Restores the default handler for `signal`.
/// ## `signal`
/// A POSIX signal id number.
/// Sets `handler` to be called whenever `signal` is caught by the
/// application. The `user_data` parameter will be passed as an argument
/// to `handler`.
/// ## `signal`
/// A POSIX signal id number.
/// ## `handler`
/// A callback function.
///
/// # Returns
///
/// [`true`] on success, [`false`] otherwise, in which case
/// `error` will be set.
/// Frees all memory associated with the POSIX signal handling system
/// and restores all default signal handlers.
//#[doc(alias = "xfce_resource_dirs")]
//pub fn resource_dirs(type_: /*Ignored*/ResourceType) -> Vec<glib::GString> {
// unsafe { TODO: call ffi:xfce_resource_dirs() }
//}
//#[doc(alias = "xfce_resource_lookup")]
//pub fn resource_lookup(type_: /*Ignored*/ResourceType, filename: &str) -> glib::GString {
// unsafe { TODO: call ffi:xfce_resource_lookup() }
//}
//#[doc(alias = "xfce_resource_lookup_all")]
//pub fn resource_lookup_all(type_: /*Ignored*/ResourceType, filename: &str) -> Vec<glib::GString> {
// unsafe { TODO: call ffi:xfce_resource_lookup_all() }
//}
//#[doc(alias = "xfce_resource_match")]
//pub fn resource_match(type_: /*Ignored*/ResourceType, pattern: &str, unique: bool) -> Vec<glib::GString> {
// unsafe { TODO: call ffi:xfce_resource_match() }
//}
//#[doc(alias = "xfce_resource_match_custom")]
//pub fn resource_match_custom<P: FnMut(&str, &str) -> bool>(type_: /*Ignored*/ResourceType, unique: bool, func: P) -> Vec<glib::GString> {
// unsafe { TODO: call ffi:xfce_resource_match_custom() }
//}
//#[doc(alias = "xfce_resource_pop_path")]
//pub fn resource_pop_path(type_: /*Ignored*/ResourceType) {
// unsafe { TODO: call ffi:xfce_resource_pop_path() }
//}
//#[doc(alias = "xfce_resource_push_path")]
//pub fn resource_push_path(type_: /*Ignored*/ResourceType, path: &str) {
// unsafe { TODO: call ffi:xfce_resource_push_path() }
//}
//#[doc(alias = "xfce_resource_save_location")]
//pub fn resource_save_location(type_: /*Ignored*/ResourceType, relpath: &str, create: bool) -> glib::GString {
// unsafe { TODO: call ffi:xfce_resource_save_location() }
//}
/// Searches `str` for occurances of `pattern` and replaces each
/// such occurance with `replacement`. Returns a newly allocated
/// copy of `str` on which the given replacement were performed.
/// The caller is responsible to free the returned string using
/// `g_free()` when no longer needed.
///
/// Note that `pattern` and `replacement` don't need to be of the
/// same size. If `replacement` is [`None`], the pattern will be
/// removed from the string.
///
/// Note for future Xfce developers: Deprecate this function when
/// `g_string_replace()` is available. (Added since Glib >= 2.68)
/// ## `str`
/// the input string.
/// ## `pattern`
/// a search pattern in `str`.
/// ## `replacement`
/// replacement string for `pattern`.
///
/// # Returns
///
///
/// a newly allocated copy of `str` where all occurrences of
/// `pattern` are replaced with `replacement`. Or [`None`] if
/// `str` is [`None`].
/// Sets up the translations for `package`.
/// ## `package`
/// the package name.
/// ## `localedir`
/// the `package`<!---->s locale directory.
/// ## `encoding`
/// the encoding to use the `package`<!---->s translations
/// or [`None`] to use "UTF-8".
/// Unescapes sequences in `value` according to Freedesktop.org Desktop Entry Specification.
/// ## `value`
/// Value string to replace escape sequences.
///
/// # Returns
///
/// [`None`] on error, else the string, which should be freed using `g_free()` when
/// no longer needed.
/// Removes all control characters from `str` up to `end` or up to
/// `max_len` characters (note that characters does not mean bytes with
/// UTF-8), where both `str` and `max_len` may not be given.
///
/// Control characters are replaced in `str` by whitespaces, no new string
/// will be allocated. The operation is done in-place.
/// ## `str`
/// target string.
/// ## `max_len`
/// max characters to check or -1 for no character limit.
/// ## `end`
/// pointer to the endpoint in `str` or [`None`] for no endpoint.
///
/// # Returns
///
/// pointer to `str` or [`None`] on error.
/// Duplicates the `src` string up to `max_len` characters
/// (note that characters does not mean bytes with UTF-8).
///
/// The caller is responsible to free the returned string
/// using `g_free()` when no longer needed.
/// ## `src`
/// target string.
/// ## `max_len`
/// max characters to duplicate or -1 for no character limit.
///
/// # Returns
///
/// pointer to the newly allocated string.
/// Queries the version string of the installed Xfce desktop environment.
///
/// # Returns
///
/// the overall version information of the installed Xfce desktop.