gtk/auto/icon_info.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{IconTheme, StyleContext, ffi};
6use glib::{prelude::*, translate::*};
7use std::{boxed::Box as Box_, pin::Pin};
8
9glib::wrapper! {
10 /// Contains information found when looking up an icon in
11 /// an icon theme.
12 ///
13 /// # Implements
14 ///
15 /// [`trait@glib::ObjectExt`]
16 #[doc(alias = "GtkIconInfo")]
17 pub struct IconInfo(Object<ffi::GtkIconInfo, ffi::GtkIconInfoClass>);
18
19 match fn {
20 type_ => || ffi::gtk_icon_info_get_type(),
21 }
22}
23
24impl IconInfo {
25 /// Creates a [`IconInfo`][crate::IconInfo] for a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf].
26 /// ## `icon_theme`
27 /// a [`IconTheme`][crate::IconTheme]
28 /// ## `pixbuf`
29 /// the pixbuf to wrap in a [`IconInfo`][crate::IconInfo]
30 ///
31 /// # Returns
32 ///
33 /// a [`IconInfo`][crate::IconInfo]
34 #[doc(alias = "gtk_icon_info_new_for_pixbuf")]
35 #[doc(alias = "new_for_pixbuf")]
36 pub fn for_pixbuf(icon_theme: &impl IsA<IconTheme>, pixbuf: &gdk_pixbuf::Pixbuf) -> IconInfo {
37 skip_assert_initialized!();
38 unsafe {
39 from_glib_full(ffi::gtk_icon_info_new_for_pixbuf(
40 icon_theme.as_ref().to_glib_none().0,
41 pixbuf.to_glib_none().0,
42 ))
43 }
44 }
45
46 /// Gets the base scale for the icon. The base scale is a scale
47 /// for the icon that was specified by the icon theme creator.
48 /// For instance an icon drawn for a high-dpi screen with window
49 /// scale 2 for a base size of 32 will be 64 pixels tall and have
50 /// a base scale of 2.
51 ///
52 /// # Returns
53 ///
54 /// the base scale
55 #[doc(alias = "gtk_icon_info_get_base_scale")]
56 #[doc(alias = "get_base_scale")]
57 pub fn base_scale(&self) -> i32 {
58 unsafe { ffi::gtk_icon_info_get_base_scale(self.to_glib_none().0) }
59 }
60
61 /// Gets the base size for the icon. The base size
62 /// is a size for the icon that was specified by
63 /// the icon theme creator. This may be different
64 /// than the actual size of image; an example of
65 /// this is small emblem icons that can be attached
66 /// to a larger icon. These icons will be given
67 /// the same base size as the larger icons to which
68 /// they are attached.
69 ///
70 /// Note that for scaled icons the base size does
71 /// not include the base scale.
72 ///
73 /// # Returns
74 ///
75 /// the base size, or 0, if no base
76 /// size is known for the icon.
77 #[doc(alias = "gtk_icon_info_get_base_size")]
78 #[doc(alias = "get_base_size")]
79 pub fn base_size(&self) -> i32 {
80 unsafe { ffi::gtk_icon_info_get_base_size(self.to_glib_none().0) }
81 }
82
83 /// Gets the filename for the icon. If the [`IconLookupFlags::USE_BUILTIN`][crate::IconLookupFlags::USE_BUILTIN]
84 /// flag was passed to [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()], there may be no
85 /// filename if a builtin icon is returned; in this case, you should
86 /// use `gtk_icon_info_get_builtin_pixbuf()`.
87 ///
88 /// # Returns
89 ///
90 /// the filename for the icon, or [`None`]
91 /// if `gtk_icon_info_get_builtin_pixbuf()` should be used instead.
92 /// The return value is owned by GTK+ and should not be modified
93 /// or freed.
94 #[doc(alias = "gtk_icon_info_get_filename")]
95 #[doc(alias = "get_filename")]
96 pub fn filename(&self) -> Option<std::path::PathBuf> {
97 unsafe { from_glib_none(ffi::gtk_icon_info_get_filename(self.to_glib_none().0)) }
98 }
99
100 /// Checks if the icon is symbolic or not. This currently uses only
101 /// the file name and not the file contents for determining this.
102 /// This behaviour may change in the future.
103 ///
104 /// # Returns
105 ///
106 /// [`true`] if the icon is symbolic, [`false`] otherwise
107 #[doc(alias = "gtk_icon_info_is_symbolic")]
108 pub fn is_symbolic(&self) -> bool {
109 unsafe { from_glib(ffi::gtk_icon_info_is_symbolic(self.to_glib_none().0)) }
110 }
111
112 /// Renders an icon previously looked up in an icon theme using
113 /// [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()]; the size will be based on the size
114 /// passed to [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()]. Note that the resulting
115 /// pixbuf may not be exactly this size; an icon theme may have icons
116 /// that differ slightly from their nominal sizes, and in addition GTK+
117 /// will avoid scaling icons that it considers sufficiently close to the
118 /// requested size or for which the source image would have to be scaled
119 /// up too far. (This maintains sharpness.). This behaviour can be changed
120 /// by passing the [`IconLookupFlags::FORCE_SIZE`][crate::IconLookupFlags::FORCE_SIZE] flag when obtaining
121 /// the [`IconInfo`][crate::IconInfo]. If this flag has been specified, the pixbuf
122 /// returned by this function will be scaled to the exact size.
123 ///
124 /// # Returns
125 ///
126 /// the rendered icon; this may be a newly
127 /// created icon or a new reference to an internal icon, so you must
128 /// not modify the icon. Use `g_object_unref()` to release your reference
129 /// to the icon.
130 #[doc(alias = "gtk_icon_info_load_icon")]
131 pub fn load_icon(&self) -> Result<gdk_pixbuf::Pixbuf, glib::Error> {
132 unsafe {
133 let mut error = std::ptr::null_mut();
134 let ret = ffi::gtk_icon_info_load_icon(self.to_glib_none().0, &mut error);
135 if error.is_null() {
136 Ok(from_glib_full(ret))
137 } else {
138 Err(from_glib_full(error))
139 }
140 }
141 }
142
143 /// Asynchronously load, render and scale an icon previously looked up
144 /// from the icon theme using [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()].
145 ///
146 /// For more details, see [`load_icon()`][Self::load_icon()] which is the synchronous
147 /// version of this call.
148 /// ## `cancellable`
149 /// optional [`gio::Cancellable`][crate::gio::Cancellable] object, [`None`] to ignore
150 /// ## `callback`
151 /// a `GAsyncReadyCallback` to call when the
152 /// request is satisfied
153 #[doc(alias = "gtk_icon_info_load_icon_async")]
154 pub fn load_icon_async<P: FnOnce(Result<gdk_pixbuf::Pixbuf, glib::Error>) + 'static>(
155 &self,
156 cancellable: Option<&impl IsA<gio::Cancellable>>,
157 callback: P,
158 ) {
159 let main_context = glib::MainContext::ref_thread_default();
160 let is_main_context_owner = main_context.is_owner();
161 let has_acquired_main_context = (!is_main_context_owner)
162 .then(|| main_context.acquire().ok())
163 .flatten();
164 assert!(
165 is_main_context_owner || has_acquired_main_context.is_some(),
166 "Async operations only allowed if the thread is owning the MainContext"
167 );
168
169 let user_data: Box_<glib::thread_guard::ThreadGuard<P>> =
170 Box_::new(glib::thread_guard::ThreadGuard::new(callback));
171 unsafe extern "C" fn load_icon_async_trampoline<
172 P: FnOnce(Result<gdk_pixbuf::Pixbuf, glib::Error>) + 'static,
173 >(
174 _source_object: *mut glib::gobject_ffi::GObject,
175 res: *mut gio::ffi::GAsyncResult,
176 user_data: glib::ffi::gpointer,
177 ) {
178 unsafe {
179 let mut error = std::ptr::null_mut();
180 let ret =
181 ffi::gtk_icon_info_load_icon_finish(_source_object as *mut _, res, &mut error);
182 let result = if error.is_null() {
183 Ok(from_glib_full(ret))
184 } else {
185 Err(from_glib_full(error))
186 };
187 let callback: Box_<glib::thread_guard::ThreadGuard<P>> =
188 Box_::from_raw(user_data as *mut _);
189 let callback: P = callback.into_inner();
190 callback(result);
191 }
192 }
193 let callback = load_icon_async_trampoline::<P>;
194 unsafe {
195 ffi::gtk_icon_info_load_icon_async(
196 self.to_glib_none().0,
197 cancellable.map(|p| p.as_ref()).to_glib_none().0,
198 Some(callback),
199 Box_::into_raw(user_data) as *mut _,
200 );
201 }
202 }
203
204 pub fn load_icon_future(
205 &self,
206 ) -> Pin<
207 Box_<dyn std::future::Future<Output = Result<gdk_pixbuf::Pixbuf, glib::Error>> + 'static>,
208 > {
209 Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
210 obj.load_icon_async(Some(cancellable), move |res| {
211 send.resolve(res);
212 });
213 }))
214 }
215
216 /// Renders an icon previously looked up in an icon theme using
217 /// [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()]; the size will be based on the size
218 /// passed to [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()]. Note that the resulting
219 /// surface may not be exactly this size; an icon theme may have icons
220 /// that differ slightly from their nominal sizes, and in addition GTK+
221 /// will avoid scaling icons that it considers sufficiently close to the
222 /// requested size or for which the source image would have to be scaled
223 /// up too far. (This maintains sharpness.). This behaviour can be changed
224 /// by passing the [`IconLookupFlags::FORCE_SIZE`][crate::IconLookupFlags::FORCE_SIZE] flag when obtaining
225 /// the [`IconInfo`][crate::IconInfo]. If this flag has been specified, the pixbuf
226 /// returned by this function will be scaled to the exact size.
227 /// ## `for_window`
228 /// [`gdk::Window`][crate::gdk::Window] to optimize drawing for, or [`None`]
229 ///
230 /// # Returns
231 ///
232 /// the rendered icon; this may be a newly
233 /// created icon or a new reference to an internal icon, so you must
234 /// not modify the icon. Use `cairo_surface_destroy()` to release your
235 /// reference to the icon.
236 #[doc(alias = "gtk_icon_info_load_surface")]
237 pub fn load_surface(
238 &self,
239 for_window: Option<&gdk::Window>,
240 ) -> Result<cairo::Surface, glib::Error> {
241 unsafe {
242 let mut error = std::ptr::null_mut();
243 let ret = ffi::gtk_icon_info_load_surface(
244 self.to_glib_none().0,
245 for_window.to_glib_none().0,
246 &mut error,
247 );
248 if error.is_null() {
249 Ok(from_glib_full(ret))
250 } else {
251 Err(from_glib_full(error))
252 }
253 }
254 }
255
256 /// Loads an icon, modifying it to match the system colours for the foreground,
257 /// success, warning and error colors provided. If the icon is not a symbolic
258 /// one, the function will return the result from [`load_icon()`][Self::load_icon()].
259 ///
260 /// This allows loading symbolic icons that will match the system theme.
261 ///
262 /// Unless you are implementing a widget, you will want to use
263 /// `g_themed_icon_new_with_default_fallbacks()` to load the icon.
264 ///
265 /// As implementation details, the icon loaded needs to be of SVG type,
266 /// contain the “symbolic” term as the last component of the icon name,
267 /// and use the “fg”, “success”, “warning” and “error” CSS styles in the
268 /// SVG file itself.
269 ///
270 /// See the [Symbolic Icons Specification](http://www.freedesktop.org/wiki/SymbolicIcons)
271 /// for more information about symbolic icons.
272 /// ## `fg`
273 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the foreground color of the icon
274 /// ## `success_color`
275 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the warning color
276 /// of the icon or [`None`] to use the default color
277 /// ## `warning_color`
278 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the warning color
279 /// of the icon or [`None`] to use the default color
280 /// ## `error_color`
281 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the error color
282 /// of the icon or [`None`] to use the default color (allow-none)
283 ///
284 /// # Returns
285 ///
286 /// a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf] representing the loaded icon
287 ///
288 /// ## `was_symbolic`
289 /// a `gboolean`, returns whether the
290 /// loaded icon was a symbolic one and whether the `fg` color was
291 /// applied to it.
292 #[doc(alias = "gtk_icon_info_load_symbolic")]
293 pub fn load_symbolic(
294 &self,
295 fg: &gdk::RGBA,
296 success_color: Option<&gdk::RGBA>,
297 warning_color: Option<&gdk::RGBA>,
298 error_color: Option<&gdk::RGBA>,
299 ) -> Result<(gdk_pixbuf::Pixbuf, bool), glib::Error> {
300 unsafe {
301 let mut was_symbolic = std::mem::MaybeUninit::uninit();
302 let mut error = std::ptr::null_mut();
303 let ret = ffi::gtk_icon_info_load_symbolic(
304 self.to_glib_none().0,
305 fg.to_glib_none().0,
306 success_color.to_glib_none().0,
307 warning_color.to_glib_none().0,
308 error_color.to_glib_none().0,
309 was_symbolic.as_mut_ptr(),
310 &mut error,
311 );
312 if error.is_null() {
313 Ok((from_glib_full(ret), from_glib(was_symbolic.assume_init())))
314 } else {
315 Err(from_glib_full(error))
316 }
317 }
318 }
319
320 /// Asynchronously load, render and scale a symbolic icon previously looked up
321 /// from the icon theme using [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()].
322 ///
323 /// For more details, see [`load_symbolic()`][Self::load_symbolic()] which is the synchronous
324 /// version of this call.
325 /// ## `fg`
326 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the foreground color of the icon
327 /// ## `success_color`
328 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the warning color
329 /// of the icon or [`None`] to use the default color
330 /// ## `warning_color`
331 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the warning color
332 /// of the icon or [`None`] to use the default color
333 /// ## `error_color`
334 /// a [`gdk::RGBA`][crate::gdk::RGBA] representing the error color
335 /// of the icon or [`None`] to use the default color (allow-none)
336 /// ## `cancellable`
337 /// optional [`gio::Cancellable`][crate::gio::Cancellable] object,
338 /// [`None`] to ignore
339 /// ## `callback`
340 /// a `GAsyncReadyCallback` to call when the
341 /// request is satisfied
342 #[doc(alias = "gtk_icon_info_load_symbolic_async")]
343 pub fn load_symbolic_async<
344 P: FnOnce(Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>) + 'static,
345 >(
346 &self,
347 fg: &gdk::RGBA,
348 success_color: Option<&gdk::RGBA>,
349 warning_color: Option<&gdk::RGBA>,
350 error_color: Option<&gdk::RGBA>,
351 cancellable: Option<&impl IsA<gio::Cancellable>>,
352 callback: P,
353 ) {
354 let main_context = glib::MainContext::ref_thread_default();
355 let is_main_context_owner = main_context.is_owner();
356 let has_acquired_main_context = (!is_main_context_owner)
357 .then(|| main_context.acquire().ok())
358 .flatten();
359 assert!(
360 is_main_context_owner || has_acquired_main_context.is_some(),
361 "Async operations only allowed if the thread is owning the MainContext"
362 );
363
364 let user_data: Box_<glib::thread_guard::ThreadGuard<P>> =
365 Box_::new(glib::thread_guard::ThreadGuard::new(callback));
366 unsafe extern "C" fn load_symbolic_async_trampoline<
367 P: FnOnce(Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>) + 'static,
368 >(
369 _source_object: *mut glib::gobject_ffi::GObject,
370 res: *mut gio::ffi::GAsyncResult,
371 user_data: glib::ffi::gpointer,
372 ) {
373 unsafe {
374 let mut error = std::ptr::null_mut();
375 let mut was_symbolic = std::mem::MaybeUninit::uninit();
376 let ret = ffi::gtk_icon_info_load_symbolic_finish(
377 _source_object as *mut _,
378 res,
379 was_symbolic.as_mut_ptr(),
380 &mut error,
381 );
382 let result = if error.is_null() {
383 Ok((from_glib_full(ret), from_glib(was_symbolic.assume_init())))
384 } else {
385 Err(from_glib_full(error))
386 };
387 let callback: Box_<glib::thread_guard::ThreadGuard<P>> =
388 Box_::from_raw(user_data as *mut _);
389 let callback: P = callback.into_inner();
390 callback(result);
391 }
392 }
393 let callback = load_symbolic_async_trampoline::<P>;
394 unsafe {
395 ffi::gtk_icon_info_load_symbolic_async(
396 self.to_glib_none().0,
397 fg.to_glib_none().0,
398 success_color.to_glib_none().0,
399 warning_color.to_glib_none().0,
400 error_color.to_glib_none().0,
401 cancellable.map(|p| p.as_ref()).to_glib_none().0,
402 Some(callback),
403 Box_::into_raw(user_data) as *mut _,
404 );
405 }
406 }
407
408 pub fn load_symbolic_future(
409 &self,
410 fg: &gdk::RGBA,
411 success_color: Option<&gdk::RGBA>,
412 warning_color: Option<&gdk::RGBA>,
413 error_color: Option<&gdk::RGBA>,
414 ) -> Pin<
415 Box_<
416 dyn std::future::Future<Output = Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>>
417 + 'static,
418 >,
419 > {
420 let fg = fg.clone();
421 let success_color = success_color.map(ToOwned::to_owned);
422 let warning_color = warning_color.map(ToOwned::to_owned);
423 let error_color = error_color.map(ToOwned::to_owned);
424 Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
425 obj.load_symbolic_async(
426 &fg,
427 success_color.as_ref().map(::std::borrow::Borrow::borrow),
428 warning_color.as_ref().map(::std::borrow::Borrow::borrow),
429 error_color.as_ref().map(::std::borrow::Borrow::borrow),
430 Some(cancellable),
431 move |res| {
432 send.resolve(res);
433 },
434 );
435 }))
436 }
437
438 /// Loads an icon, modifying it to match the system colors for the foreground,
439 /// success, warning and error colors provided. If the icon is not a symbolic
440 /// one, the function will return the result from [`load_icon()`][Self::load_icon()].
441 /// This function uses the regular foreground color and the symbolic colors
442 /// with the names “success_color”, “warning_color” and “error_color” from
443 /// the context.
444 ///
445 /// This allows loading symbolic icons that will match the system theme.
446 ///
447 /// See [`load_symbolic()`][Self::load_symbolic()] for more details.
448 /// ## `context`
449 /// a [`StyleContext`][crate::StyleContext]
450 ///
451 /// # Returns
452 ///
453 /// a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf] representing the loaded icon
454 ///
455 /// ## `was_symbolic`
456 /// a `gboolean`, returns whether the
457 /// loaded icon was a symbolic one and whether the `fg` color was
458 /// applied to it.
459 #[doc(alias = "gtk_icon_info_load_symbolic_for_context")]
460 pub fn load_symbolic_for_context(
461 &self,
462 context: &impl IsA<StyleContext>,
463 ) -> Result<(gdk_pixbuf::Pixbuf, bool), glib::Error> {
464 unsafe {
465 let mut was_symbolic = std::mem::MaybeUninit::uninit();
466 let mut error = std::ptr::null_mut();
467 let ret = ffi::gtk_icon_info_load_symbolic_for_context(
468 self.to_glib_none().0,
469 context.as_ref().to_glib_none().0,
470 was_symbolic.as_mut_ptr(),
471 &mut error,
472 );
473 if error.is_null() {
474 Ok((from_glib_full(ret), from_glib(was_symbolic.assume_init())))
475 } else {
476 Err(from_glib_full(error))
477 }
478 }
479 }
480
481 /// Asynchronously load, render and scale a symbolic icon previously
482 /// looked up from the icon theme using [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()].
483 ///
484 /// For more details, see [`load_symbolic_for_context()`][Self::load_symbolic_for_context()]
485 /// which is the synchronous version of this call.
486 /// ## `context`
487 /// a [`StyleContext`][crate::StyleContext]
488 /// ## `cancellable`
489 /// optional [`gio::Cancellable`][crate::gio::Cancellable] object,
490 /// [`None`] to ignore
491 /// ## `callback`
492 /// a `GAsyncReadyCallback` to call when the
493 /// request is satisfied
494 #[doc(alias = "gtk_icon_info_load_symbolic_for_context_async")]
495 pub fn load_symbolic_for_context_async<
496 P: FnOnce(Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>) + 'static,
497 >(
498 &self,
499 context: &impl IsA<StyleContext>,
500 cancellable: Option<&impl IsA<gio::Cancellable>>,
501 callback: P,
502 ) {
503 let main_context = glib::MainContext::ref_thread_default();
504 let is_main_context_owner = main_context.is_owner();
505 let has_acquired_main_context = (!is_main_context_owner)
506 .then(|| main_context.acquire().ok())
507 .flatten();
508 assert!(
509 is_main_context_owner || has_acquired_main_context.is_some(),
510 "Async operations only allowed if the thread is owning the MainContext"
511 );
512
513 let user_data: Box_<glib::thread_guard::ThreadGuard<P>> =
514 Box_::new(glib::thread_guard::ThreadGuard::new(callback));
515 unsafe extern "C" fn load_symbolic_for_context_async_trampoline<
516 P: FnOnce(Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>) + 'static,
517 >(
518 _source_object: *mut glib::gobject_ffi::GObject,
519 res: *mut gio::ffi::GAsyncResult,
520 user_data: glib::ffi::gpointer,
521 ) {
522 unsafe {
523 let mut error = std::ptr::null_mut();
524 let mut was_symbolic = std::mem::MaybeUninit::uninit();
525 let ret = ffi::gtk_icon_info_load_symbolic_for_context_finish(
526 _source_object as *mut _,
527 res,
528 was_symbolic.as_mut_ptr(),
529 &mut error,
530 );
531 let result = if error.is_null() {
532 Ok((from_glib_full(ret), from_glib(was_symbolic.assume_init())))
533 } else {
534 Err(from_glib_full(error))
535 };
536 let callback: Box_<glib::thread_guard::ThreadGuard<P>> =
537 Box_::from_raw(user_data as *mut _);
538 let callback: P = callback.into_inner();
539 callback(result);
540 }
541 }
542 let callback = load_symbolic_for_context_async_trampoline::<P>;
543 unsafe {
544 ffi::gtk_icon_info_load_symbolic_for_context_async(
545 self.to_glib_none().0,
546 context.as_ref().to_glib_none().0,
547 cancellable.map(|p| p.as_ref()).to_glib_none().0,
548 Some(callback),
549 Box_::into_raw(user_data) as *mut _,
550 );
551 }
552 }
553
554 pub fn load_symbolic_for_context_future(
555 &self,
556 context: &(impl IsA<StyleContext> + Clone + 'static),
557 ) -> Pin<
558 Box_<
559 dyn std::future::Future<Output = Result<(gdk_pixbuf::Pixbuf, bool), glib::Error>>
560 + 'static,
561 >,
562 > {
563 let context = context.clone();
564 Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
565 obj.load_symbolic_for_context_async(&context, Some(cancellable), move |res| {
566 send.resolve(res);
567 });
568 }))
569 }
570}