gtk/auto/builder.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::{Application, ffi};
6use glib::{
7 prelude::*,
8 signal::{SignalHandlerId, connect_raw},
9 translate::*,
10};
11use std::boxed::Box as Box_;
12
13glib::wrapper! {
14 /// A GtkBuilder is an auxiliary object that reads textual descriptions
15 /// of a user interface and instantiates the described objects. To create
16 /// a GtkBuilder from a user interface description, call
17 /// `gtk_builder_new_from_file()`, [`from_resource()`][Self::from_resource()] or
18 /// [`from_string()`][Self::from_string()].
19 ///
20 /// In the (unusual) case that you want to add user interface
21 /// descriptions from multiple sources to the same GtkBuilder you can
22 /// call [`new()`][Self::new()] to get an empty builder and populate it by
23 /// (multiple) calls to `gtk_builder_add_from_file()`,
24 /// [`BuilderExtManual::add_from_resource()`][crate::prelude::BuilderExtManual::add_from_resource()] or [`BuilderExtManual::add_from_string()`][crate::prelude::BuilderExtManual::add_from_string()].
25 ///
26 /// A GtkBuilder holds a reference to all objects that it has constructed
27 /// and drops these references when it is finalized. This finalization can
28 /// cause the destruction of non-widget objects or widgets which are not
29 /// contained in a toplevel window. For toplevel windows constructed by a
30 /// builder, it is the responsibility of the user to call `gtk_widget_destroy()`
31 /// to get rid of them and all the widgets they contain.
32 ///
33 /// The functions `gtk_builder_get_object()` and [`BuilderExt::objects()`][crate::prelude::BuilderExt::objects()]
34 /// can be used to access the widgets in the interface by the names assigned
35 /// to them inside the UI description. Toplevel windows returned by these
36 /// functions will stay around until the user explicitly destroys them
37 /// with `gtk_widget_destroy()`. Other widgets will either be part of a
38 /// larger hierarchy constructed by the builder (in which case you should
39 /// not have to worry about their lifecycle), or without a parent, in which
40 /// case they have to be added to some container to make use of them.
41 /// Non-widget objects need to be reffed with `g_object_ref()` to keep them
42 /// beyond the lifespan of the builder.
43 ///
44 /// The function `gtk_builder_connect_signals()` and variants thereof can be
45 /// used to connect handlers to the named signals in the description.
46 ///
47 /// # GtkBuilder UI Definitions # {`BUILDER`-UI}
48 ///
49 /// GtkBuilder parses textual descriptions of user interfaces which are
50 /// specified in an XML format which can be roughly described by the
51 /// RELAX NG schema below. We refer to these descriptions as “GtkBuilder
52 /// UI definitions” or just “UI definitions” if the context is clear.
53 /// Do not confuse GtkBuilder UI Definitions with
54 /// [GtkUIManager UI Definitions][XML-UI], which are more limited in scope.
55 /// It is common to use `.ui` as the filename extension for files containing
56 /// GtkBuilder UI definitions.
57 ///
58 /// [RELAX NG Compact Syntax](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkbuilder.rnc)
59 ///
60 /// The toplevel element is ``<interface>``. It optionally takes a “domain”
61 /// attribute, which will make the builder look for translated strings
62 /// using `dgettext()` in the domain specified. This can also be done by
63 /// calling [`BuilderExt::set_translation_domain()`][crate::prelude::BuilderExt::set_translation_domain()] on the builder.
64 /// Objects are described by ``<object>`` elements, which can contain
65 /// ``<property>`` elements to set properties, ``<signal>`` elements which
66 /// connect signals to handlers, and ``<child>`` elements, which describe
67 /// child objects (most often widgets inside a container, but also e.g.
68 /// actions in an action group, or columns in a tree model). A ``<child>``
69 /// element contains an ``<object>`` element which describes the child object.
70 /// The target toolkit version(s) are described by ``<requires>`` elements,
71 /// the “lib” attribute specifies the widget library in question (currently
72 /// the only supported value is “gtk+”) and the “version” attribute specifies
73 /// the target version in the form ``<major>`.`<minor>``. The builder will error
74 /// out if the version requirements are not met.
75 ///
76 /// Typically, the specific kind of object represented by an ``<object>``
77 /// element is specified by the “class” attribute. If the type has not
78 /// been loaded yet, GTK+ tries to find the ``get_type()`` function from the
79 /// class name by applying heuristics. This works in most cases, but if
80 /// necessary, it is possible to specify the name of the `get_type()` function
81 /// explictly with the "type-func" attribute. As a special case, GtkBuilder
82 /// allows to use an object that has been constructed by a `GtkUIManager` in
83 /// another part of the UI definition by specifying the id of the `GtkUIManager`
84 /// in the “constructor” attribute and the name of the object in the “id”
85 /// attribute.
86 ///
87 /// Objects may be given a name with the “id” attribute, which allows the
88 /// application to retrieve them from the builder with `gtk_builder_get_object()`.
89 /// An id is also necessary to use the object as property value in other
90 /// parts of the UI definition. GTK+ reserves ids starting and ending
91 /// with `___` (3 underscores) for its own purposes.
92 ///
93 /// Setting properties of objects is pretty straightforward with the
94 /// ``<property>`` element: the “name” attribute specifies the name of the
95 /// property, and the content of the element specifies the value.
96 /// If the “translatable” attribute is set to a true value, GTK+ uses
97 /// `gettext()` (or `dgettext()` if the builder has a translation domain set)
98 /// to find a translation for the value. This happens before the value
99 /// is parsed, so it can be used for properties of any type, but it is
100 /// probably most useful for string properties. It is also possible to
101 /// specify a context to disambiguate short strings, and comments which
102 /// may help the translators.
103 ///
104 /// GtkBuilder can parse textual representations for the most common
105 /// property types: characters, strings, integers, floating-point numbers,
106 /// booleans (strings like “TRUE”, “t”, “yes”, “y”, “1” are interpreted
107 /// as [`true`], strings like “FALSE”, “f”, “no”, “n”, “0” are interpreted
108 /// as [`false`]), enumerations (can be specified by their name, nick or
109 /// integer value), flags (can be specified by their name, nick, integer
110 /// value, optionally combined with “|”, e.g. “GTK_VISIBLE|GTK_REALIZED”)
111 /// and colors (in a format understood by [`gdk::RGBA::parse()`][crate::gdk::RGBA::parse()]).
112 ///
113 /// GVariants can be specified in the format understood by `g_variant_parse()`,
114 /// and pixbufs can be specified as a filename of an image file to load.
115 ///
116 /// Objects can be referred to by their name and by default refer to
117 /// objects declared in the local xml fragment and objects exposed via
118 /// [`BuilderExt::expose_object()`][crate::prelude::BuilderExt::expose_object()]. In general, GtkBuilder allows forward
119 /// references to objects — declared in the local xml; an object doesn’t
120 /// have to be constructed before it can be referred to. The exception
121 /// to this rule is that an object has to be constructed before it can
122 /// be used as the value of a construct-only property.
123 ///
124 /// It is also possible to bind a property value to another object's
125 /// property value using the attributes
126 /// "bind-source" to specify the source object of the binding,
127 /// "bind-property" to specify the source property and optionally
128 /// "bind-flags" to specify the binding flags.
129 /// Internally builder implements this using GBinding objects.
130 /// For more information see [`ObjectExt::bind_property()`][crate::glib::prelude::ObjectExt::bind_property()]
131 ///
132 /// Signal handlers are set up with the ``<signal>`` element. The “name”
133 /// attribute specifies the name of the signal, and the “handler” attribute
134 /// specifies the function to connect to the signal. By default, GTK+ tries
135 /// to find the handler using `g_module_symbol()`, but this can be changed by
136 /// passing a custom `GtkBuilderConnectFunc` to
137 /// [`BuilderExtManual::connect_signals_full()`][crate::prelude::BuilderExtManual::connect_signals_full()]. The remaining attributes, “after”,
138 /// “swapped” and “object”, have the same meaning as the corresponding
139 /// parameters of the `g_signal_connect_object()` or
140 /// `g_signal_connect_data()` functions. A “last_modification_time”
141 /// attribute is also allowed, but it does not have a meaning to the
142 /// builder.
143 ///
144 /// Sometimes it is necessary to refer to widgets which have implicitly
145 /// been constructed by GTK+ as part of a composite widget, to set
146 /// properties on them or to add further children (e.g. the `vbox` of
147 /// a [`Dialog`][crate::Dialog]). This can be achieved by setting the “internal-child”
148 /// property of the ``<child>`` element to a true value. Note that GtkBuilder
149 /// still requires an ``<object>`` element for the internal child, even if it
150 /// has already been constructed.
151 ///
152 /// A number of widgets have different places where a child can be added
153 /// (e.g. tabs vs. page content in notebooks). This can be reflected in
154 /// a UI definition by specifying the “type” attribute on a ``<child>``
155 /// The possible values for the “type” attribute are described in the
156 /// sections describing the widget-specific portions of UI definitions.
157 ///
158 /// # A GtkBuilder UI Definition
159 ///
160 ///
161 ///
162 /// **⚠️ The following code is in xml ⚠️**
163 ///
164 /// ```xml
165 /// <interface>
166 /// <object class="GtkDialog" id="dialog1">
167 /// <child internal-child="vbox">
168 /// <object class="GtkBox" id="vbox1">
169 /// <property name="border-width">10</property>
170 /// <child internal-child="action_area">
171 /// <object class="GtkButtonBox" id="hbuttonbox1">
172 /// <property name="border-width">20</property>
173 /// <child>
174 /// <object class="GtkButton" id="ok_button">
175 /// <property name="label">gtk-ok</property>
176 /// <property name="use-stock">TRUE</property>
177 /// <signal name="clicked" handler="ok_button_clicked"/>
178 /// </object>
179 /// </child>
180 /// </object>
181 /// </child>
182 /// </object>
183 /// </child>
184 /// </object>
185 /// </interface>
186 /// ```
187 ///
188 /// Beyond this general structure, several object classes define their
189 /// own XML DTD fragments for filling in the ANY placeholders in the DTD
190 /// above. Note that a custom element in a ``<child>`` element gets parsed by
191 /// the custom tag handler of the parent object, while a custom element in
192 /// an ``<object>`` element gets parsed by the custom tag handler of the object.
193 ///
194 /// These XML fragments are explained in the documentation of the
195 /// respective objects.
196 ///
197 /// Additionally, since 3.10 a special ``<template>`` tag has been added
198 /// to the format allowing one to define a widget class’s components.
199 /// See the [GtkWidget documentation][composite-templates] for details.
200 ///
201 /// ## Properties
202 ///
203 ///
204 /// #### `translation-domain`
205 /// The translation domain used when translating property values that
206 /// have been marked as translatable in interface descriptions.
207 /// If the translation domain is [`None`], [`Builder`][crate::Builder] uses `gettext()`,
208 /// otherwise `g_dgettext()`.
209 ///
210 /// Readable | Writable
211 ///
212 /// # Implements
213 ///
214 /// [`BuilderExt`][trait@crate::prelude::BuilderExt], [`trait@glib::ObjectExt`], [`BuilderExtManual`][trait@crate::prelude::BuilderExtManual]
215 #[doc(alias = "GtkBuilder")]
216 pub struct Builder(Object<ffi::GtkBuilder, ffi::GtkBuilderClass>);
217
218 match fn {
219 type_ => || ffi::gtk_builder_get_type(),
220 }
221}
222
223impl Builder {
224 pub const NONE: Option<&'static Builder> = None;
225
226 /// Creates a new empty builder object.
227 ///
228 /// This function is only useful if you intend to make multiple calls
229 /// to `gtk_builder_add_from_file()`, [`BuilderExtManual::add_from_resource()`][crate::prelude::BuilderExtManual::add_from_resource()]
230 /// or [`BuilderExtManual::add_from_string()`][crate::prelude::BuilderExtManual::add_from_string()] in order to merge multiple UI
231 /// descriptions into a single builder.
232 ///
233 /// Most users will probably want to use `gtk_builder_new_from_file()`,
234 /// [`from_resource()`][Self::from_resource()] or [`from_string()`][Self::from_string()].
235 ///
236 /// # Returns
237 ///
238 /// a new (empty) [`Builder`][crate::Builder] object
239 #[doc(alias = "gtk_builder_new")]
240 pub fn new() -> Builder {
241 assert_initialized_main_thread!();
242 unsafe { from_glib_full(ffi::gtk_builder_new()) }
243 }
244
245 /// Builds the [GtkBuilder UI definition][BUILDER-UI]
246 /// at `resource_path`.
247 ///
248 /// If there is an error locating the resource or parsing the
249 /// description, then the program will be aborted.
250 /// ## `resource_path`
251 /// a `GResource` resource path
252 ///
253 /// # Returns
254 ///
255 /// a [`Builder`][crate::Builder] containing the described interface
256 #[doc(alias = "gtk_builder_new_from_resource")]
257 #[doc(alias = "new_from_resource")]
258 pub fn from_resource(resource_path: &str) -> Builder {
259 assert_initialized_main_thread!();
260 unsafe {
261 from_glib_full(ffi::gtk_builder_new_from_resource(
262 resource_path.to_glib_none().0,
263 ))
264 }
265 }
266
267 /// Builds the user interface described by `string` (in the
268 /// [GtkBuilder UI definition][BUILDER-UI] format).
269 ///
270 /// If `string` is [`None`]-terminated, then `length` should be -1.
271 /// If `length` is not -1, then it is the length of `string`.
272 ///
273 /// If there is an error parsing `string` then the program will be
274 /// aborted. You should not attempt to parse user interface description
275 /// from untrusted sources.
276 /// ## `string`
277 /// a user interface (XML) description
278 /// ## `length`
279 /// the length of `string`, or -1
280 ///
281 /// # Returns
282 ///
283 /// a [`Builder`][crate::Builder] containing the interface described by `string`
284 #[doc(alias = "gtk_builder_new_from_string")]
285 #[doc(alias = "new_from_string")]
286 pub fn from_string(string: &str) -> Builder {
287 assert_initialized_main_thread!();
288 let length = string.len() as _;
289 unsafe {
290 from_glib_full(ffi::gtk_builder_new_from_string(
291 string.to_glib_none().0,
292 length,
293 ))
294 }
295 }
296}
297
298impl Default for Builder {
299 fn default() -> Self {
300 Self::new()
301 }
302}
303
304/// Trait containing all [`struct@Builder`] methods.
305///
306/// # Implementors
307///
308/// [`Builder`][struct@crate::Builder]
309pub trait BuilderExt: IsA<Builder> + 'static {
310 //#[doc(alias = "gtk_builder_add_callback_symbol")]
311 //fn add_callback_symbol<P: FnOnce() + 'static>(&self, callback_name: &str, callback_symbol: P) {
312 // unsafe { TODO: call ffi:gtk_builder_add_callback_symbol() }
313 //}
314
315 //#[doc(alias = "gtk_builder_add_callback_symbols")]
316 //fn add_callback_symbols<P: FnOnce() + 'static>(&self, first_callback_name: &str, first_callback_symbol: P, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
317 // unsafe { TODO: call ffi:gtk_builder_add_callback_symbols() }
318 //}
319
320 //#[doc(alias = "gtk_builder_connect_signals")]
321 //fn connect_signals(&self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
322 // unsafe { TODO: call ffi:gtk_builder_connect_signals() }
323 //}
324
325 /// Add `object` to the `self` object pool so it can be referenced just like any
326 /// other object built by builder.
327 /// ## `name`
328 /// the name of the object exposed to the builder
329 /// ## `object`
330 /// the object to expose
331 #[doc(alias = "gtk_builder_expose_object")]
332 fn expose_object(&self, name: &str, object: &impl IsA<glib::Object>) {
333 unsafe {
334 ffi::gtk_builder_expose_object(
335 self.as_ref().to_glib_none().0,
336 name.to_glib_none().0,
337 object.as_ref().to_glib_none().0,
338 );
339 }
340 }
341
342 /// Gets the [`Application`][crate::Application] associated with the builder.
343 ///
344 /// The [`Application`][crate::Application] is used for creating action proxies as requested
345 /// from XML that the builder is loading.
346 ///
347 /// By default, the builder uses the default application: the one from
348 /// [`gio::Application::default()`][crate::gio::Application::default()]. If you want to use another application
349 /// for constructing proxies, use [`set_application()`][Self::set_application()].
350 ///
351 /// # Returns
352 ///
353 /// the application being used by the builder,
354 /// or [`None`]
355 #[doc(alias = "gtk_builder_get_application")]
356 #[doc(alias = "get_application")]
357 fn application(&self) -> Option<Application> {
358 unsafe {
359 from_glib_none(ffi::gtk_builder_get_application(
360 self.as_ref().to_glib_none().0,
361 ))
362 }
363 }
364
365 /// Gets all objects that have been constructed by `self`. Note that
366 /// this function does not increment the reference counts of the returned
367 /// objects.
368 ///
369 /// # Returns
370 ///
371 /// a newly-allocated `GSList` containing all the objects
372 /// constructed by the [`Builder`][crate::Builder] instance. It should be freed by
373 /// `g_slist_free()`
374 #[doc(alias = "gtk_builder_get_objects")]
375 #[doc(alias = "get_objects")]
376 fn objects(&self) -> Vec<glib::Object> {
377 unsafe {
378 FromGlibPtrContainer::from_glib_container(ffi::gtk_builder_get_objects(
379 self.as_ref().to_glib_none().0,
380 ))
381 }
382 }
383
384 /// Gets the translation domain of `self`.
385 ///
386 /// # Returns
387 ///
388 /// the translation domain. This string is owned
389 /// by the builder object and must not be modified or freed.
390 #[doc(alias = "gtk_builder_get_translation_domain")]
391 #[doc(alias = "get_translation_domain")]
392 #[doc(alias = "translation-domain")]
393 fn translation_domain(&self) -> Option<glib::GString> {
394 unsafe {
395 from_glib_none(ffi::gtk_builder_get_translation_domain(
396 self.as_ref().to_glib_none().0,
397 ))
398 }
399 }
400
401 /// Looks up a type by name, using the virtual function that
402 /// [`Builder`][crate::Builder] has for that purpose. This is mainly used when
403 /// implementing the [`Buildable`][crate::Buildable] interface on a type.
404 /// ## `type_name`
405 /// type name to lookup
406 ///
407 /// # Returns
408 ///
409 /// the `GType` found for `type_name` or `G_TYPE_INVALID`
410 /// if no type was found
411 #[doc(alias = "gtk_builder_get_type_from_name")]
412 #[doc(alias = "get_type_from_name")]
413 fn type_from_name(&self, type_name: &str) -> glib::types::Type {
414 unsafe {
415 from_glib(ffi::gtk_builder_get_type_from_name(
416 self.as_ref().to_glib_none().0,
417 type_name.to_glib_none().0,
418 ))
419 }
420 }
421
422 //#[doc(alias = "gtk_builder_lookup_callback_symbol")]
423 //fn lookup_callback_symbol(&self, callback_name: &str) -> Option<Box_<dyn Fn() + 'static>> {
424 // unsafe { TODO: call ffi:gtk_builder_lookup_callback_symbol() }
425 //}
426
427 /// Sets the application associated with `self`.
428 ///
429 /// You only need this function if there is more than one [`gio::Application`][crate::gio::Application]
430 /// in your process. `application` cannot be [`None`].
431 /// ## `application`
432 /// a [`Application`][crate::Application]
433 #[doc(alias = "gtk_builder_set_application")]
434 fn set_application(&self, application: &impl IsA<Application>) {
435 unsafe {
436 ffi::gtk_builder_set_application(
437 self.as_ref().to_glib_none().0,
438 application.as_ref().to_glib_none().0,
439 );
440 }
441 }
442
443 /// Sets the translation domain of `self`.
444 /// See [`translation-domain`][struct@crate::Builder#translation-domain].
445 /// ## `domain`
446 /// the translation domain or [`None`]
447 #[doc(alias = "gtk_builder_set_translation_domain")]
448 #[doc(alias = "translation-domain")]
449 fn set_translation_domain(&self, domain: Option<&str>) {
450 unsafe {
451 ffi::gtk_builder_set_translation_domain(
452 self.as_ref().to_glib_none().0,
453 domain.to_glib_none().0,
454 );
455 }
456 }
457
458 /// This function demarshals a value from a string. This function
459 /// calls [`glib::Value::init()`][crate::glib::Value::init()] on the `value` argument, so it need not be
460 /// initialised beforehand.
461 ///
462 /// This function can handle char, uchar, boolean, int, uint, long,
463 /// ulong, enum, flags, float, double, string, `GdkColor`, [`gdk::RGBA`][crate::gdk::RGBA] and
464 /// [`Adjustment`][crate::Adjustment] type values. Support for [`Widget`][crate::Widget] type values is
465 /// still to come.
466 ///
467 /// Upon errors [`false`] will be returned and `error` will be assigned a
468 /// [`glib::Error`][crate::glib::Error] from the `GTK_BUILDER_ERROR` domain.
469 /// ## `pspec`
470 /// the [`glib::ParamSpec`][crate::glib::ParamSpec] for the property
471 /// ## `string`
472 /// the string representation of the value
473 ///
474 /// # Returns
475 ///
476 /// [`true`] on success
477 ///
478 /// ## `value`
479 /// the [`glib::Value`][crate::glib::Value] to store the result in
480 #[doc(alias = "gtk_builder_value_from_string")]
481 fn value_from_string(
482 &self,
483 pspec: impl AsRef<glib::ParamSpec>,
484 string: &str,
485 ) -> Result<glib::Value, glib::Error> {
486 unsafe {
487 let mut value = glib::Value::uninitialized();
488 let mut error = std::ptr::null_mut();
489 let is_ok = ffi::gtk_builder_value_from_string(
490 self.as_ref().to_glib_none().0,
491 pspec.as_ref().to_glib_none().0,
492 string.to_glib_none().0,
493 value.to_glib_none_mut().0,
494 &mut error,
495 );
496 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
497 if error.is_null() {
498 Ok(value)
499 } else {
500 Err(from_glib_full(error))
501 }
502 }
503 }
504
505 /// Like [`value_from_string()`][Self::value_from_string()], this function demarshals
506 /// a value from a string, but takes a `GType` instead of [`glib::ParamSpec`][crate::glib::ParamSpec].
507 /// This function calls [`glib::Value::init()`][crate::glib::Value::init()] on the `value` argument, so it
508 /// need not be initialised beforehand.
509 ///
510 /// Upon errors [`false`] will be returned and `error` will be assigned a
511 /// [`glib::Error`][crate::glib::Error] from the `GTK_BUILDER_ERROR` domain.
512 /// ## `type_`
513 /// the `GType` of the value
514 /// ## `string`
515 /// the string representation of the value
516 ///
517 /// # Returns
518 ///
519 /// [`true`] on success
520 ///
521 /// ## `value`
522 /// the [`glib::Value`][crate::glib::Value] to store the result in
523 #[doc(alias = "gtk_builder_value_from_string_type")]
524 fn value_from_string_type(
525 &self,
526 type_: glib::types::Type,
527 string: &str,
528 ) -> Result<glib::Value, glib::Error> {
529 unsafe {
530 let mut value = glib::Value::uninitialized();
531 let mut error = std::ptr::null_mut();
532 let is_ok = ffi::gtk_builder_value_from_string_type(
533 self.as_ref().to_glib_none().0,
534 type_.into_glib(),
535 string.to_glib_none().0,
536 value.to_glib_none_mut().0,
537 &mut error,
538 );
539 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
540 if error.is_null() {
541 Ok(value)
542 } else {
543 Err(from_glib_full(error))
544 }
545 }
546 }
547
548 #[doc(alias = "translation-domain")]
549 fn connect_translation_domain_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
550 unsafe extern "C" fn notify_translation_domain_trampoline<
551 P: IsA<Builder>,
552 F: Fn(&P) + 'static,
553 >(
554 this: *mut ffi::GtkBuilder,
555 _param_spec: glib::ffi::gpointer,
556 f: glib::ffi::gpointer,
557 ) {
558 unsafe {
559 let f: &F = &*(f as *const F);
560 f(Builder::from_glib_borrow(this).unsafe_cast_ref())
561 }
562 }
563 unsafe {
564 let f: Box_<F> = Box_::new(f);
565 connect_raw(
566 self.as_ptr() as *mut _,
567 c"notify::translation-domain".as_ptr(),
568 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
569 notify_translation_domain_trampoline::<Self, F> as *const (),
570 )),
571 Box_::into_raw(f),
572 )
573 }
574 }
575}
576
577impl<O: IsA<Builder>> BuilderExt for O {}