animate/legacy/
text.rs

1// Scriptable
2use crate::{Actor, Animatable, Container, InternalColor, InternalRect, TextBuffer};
3use glib::{
4    object as gobject,
5    object::{Cast, IsA, ObjectExt},
6    signal::{connect_raw, SignalHandlerId},
7    translate::*,
8    GString, StaticType, Value,
9};
10use std::boxed::Box as Box_;
11use std::{fmt, mem, mem::transmute};
12
13// TODO: implements atk::ImplementorIface, Scriptable
14glib_wrapper! {
15    pub struct Text(Object<ffi::ClutterText, ffi::ClutterTextClass, TextClass>) @extends Actor, gobject::InitiallyUnowned, @implements Animatable, Container;
16
17    match fn {
18        get_type => || ffi::clutter_text_get_type(),
19    }
20}
21
22impl Text {
23    /// Creates a new `Text` actor. This actor can be used to
24    /// display and edit text.
25    ///
26    /// # Returns
27    ///
28    /// the newly created `Text` actor
29    pub fn new() -> Text {
30        unsafe { Actor::from_glib_none(ffi::clutter_text_new()).unsafe_cast() }
31    }
32
33    /// Creates a new `Text` actor, using `font_name` as the font
34    /// description; `text` will be used to set the contents of the actor;
35    /// and `color` will be used as the color to render `text`.
36    ///
37    /// This function is equivalent to calling `Text::new`,
38    /// `TextExt::set_font_name`, `TextExt::set_text` and
39    /// `TextExt::set_color`.
40    /// ## `font_name`
41    /// a string with a font description
42    /// ## `text`
43    /// the contents of the actor
44    /// ## `color`
45    /// the color to be used to render `text`
46    ///
47    /// # Returns
48    ///
49    /// the newly created `Text` actor
50    pub fn new_full(font_name: &str, text: &str, color: &InternalColor) -> Text {
51        unsafe {
52            Actor::from_glib_none(ffi::clutter_text_new_full(
53                font_name.to_glib_none().0,
54                text.to_glib_none().0,
55                color.to_glib_none().0,
56            ))
57            .unsafe_cast()
58        }
59    }
60
61    pub fn with_buffer<P: IsA<TextBuffer>>(buffer: &P) -> Text {
62        unsafe {
63            Actor::from_glib_none(ffi::clutter_text_new_with_buffer(
64                buffer.as_ref().to_glib_none().0,
65            ))
66            .unsafe_cast()
67        }
68    }
69
70    pub fn with_text(font_name: Option<&str>, text: &str) -> Text {
71        unsafe {
72            Actor::from_glib_none(ffi::clutter_text_new_with_text(
73                font_name.to_glib_none().0,
74                text.to_glib_none().0,
75            ))
76            .unsafe_cast()
77        }
78    }
79}
80
81impl Default for Text {
82    fn default() -> Self {
83        Self::new()
84    }
85}
86
87/// Trait containing all `Text` methods.
88///
89/// # Implementors
90///
91/// [`Text`](struct.Text.html)
92pub trait TextExt: 'static {
93    /// Emits the `Text::activate` signal, if `self` has been set
94    /// as activatable using `TextExt::set_activatable`.
95    ///
96    /// This function can be used to emit the ::activate signal inside
97    /// a `Actor::captured-event` or `Actor::key-press-event`
98    /// signal handlers before the default signal handler for the
99    /// `Text` is invoked.
100    ///
101    /// # Returns
102    ///
103    /// `true` if the ::activate signal has been emitted,
104    ///  and `false` otherwise
105    fn activate(&self) -> bool;
106
107    /// Retrieves the position of the character at the given coordinates.
108    /// ## `x`
109    /// the X coordinate, relative to the actor
110    /// ## `y`
111    /// the Y coordinate, relative to the actor
112    ///
113    /// # Returns
114    ///
115    /// the position of the character
116    fn coords_to_position(&self, x: f32, y: f32) -> i32;
117
118    /// Deletes `n_chars` inside a `Text` actor, starting from the
119    /// current cursor position.
120    ///
121    /// Somewhat awkwardly, the cursor position is decremented by the same
122    /// number of characters you've deleted.
123    /// ## `n_chars`
124    /// the number of characters to delete
125    fn delete_chars(&self, n_chars: u32);
126
127    /// Deletes the currently selected text
128    ///
129    /// This function is only useful in subclasses of `Text`
130    ///
131    /// # Returns
132    ///
133    /// `true` if text was deleted or if the text actor
134    ///  is empty, and `false` otherwise
135    fn delete_selection(&self) -> bool;
136
137    /// Deletes the text inside a `Text` actor between `start_pos`
138    /// and `end_pos`.
139    ///
140    /// The starting and ending positions are expressed in characters,
141    /// not in bytes.
142    /// ## `start_pos`
143    /// starting position
144    /// ## `end_pos`
145    /// ending position
146    fn delete_text(&self, start_pos: isize, end_pos: isize);
147
148    /// Retrieves whether a `Text` is activatable or not.
149    ///
150    /// # Returns
151    ///
152    /// `true` if the actor is activatable
153    fn get_activatable(&self) -> bool;
154
155    /// Gets the attribute list that was set on the `Text` actor
156    /// `TextExt::set_attributes`, if any.
157    ///
158    /// # Returns
159    ///
160    /// the attribute list, or `None` if none was set. The
161    ///  returned value is owned by the `Text` and should not be unreferenced.
162    fn get_attributes(&self) -> Option<pango::AttrList>;
163
164    /// Get the `TextBuffer` object which holds the text for
165    /// this widget.
166    ///
167    /// # Returns
168    ///
169    /// A ``GtkEntryBuffer`` object.
170    fn get_buffer(&self) -> Option<TextBuffer>;
171
172    /// Retrieves the contents of the `Text` actor between
173    /// `start_pos` and `end_pos`, but not including `end_pos`.
174    ///
175    /// The positions are specified in characters, not in bytes.
176    /// ## `start_pos`
177    /// start of text, in characters
178    /// ## `end_pos`
179    /// end of text, in characters
180    ///
181    /// # Returns
182    ///
183    /// a newly allocated string with the contents of
184    ///  the text actor between the specified positions. Use `g_free`
185    ///  to free the resources when done
186    fn get_chars(&self, start_pos: isize, end_pos: isize) -> Option<GString>;
187
188    /// Retrieves the text color as set by `TextExt::set_color`.
189    /// ## `color`
190    /// return location for a `Color`
191    fn get_color(&self) -> InternalColor;
192
193    /// Retrieves the color of the cursor of a `Text` actor.
194    /// ## `color`
195    /// return location for a `Color`
196    fn get_cursor_color(&self) -> InternalColor;
197
198    /// Retrieves the cursor position.
199    ///
200    /// # Returns
201    ///
202    /// the cursor position, in characters
203    fn get_cursor_position(&self) -> i32;
204
205    /// Retrieves the rectangle that contains the cursor.
206    ///
207    /// The coordinates of the rectangle's origin are in actor-relative
208    /// coordinates.
209    /// ## `rect`
210    /// return location of a `Rect`
211    fn get_cursor_rect(&self) -> InternalRect;
212
213    /// Retrieves the size of the cursor of a `Text` actor.
214    ///
215    /// # Returns
216    ///
217    /// the size of the cursor, in pixels
218    fn get_cursor_size(&self) -> u32;
219
220    /// Retrieves whether the cursor of a `Text` actor is visible.
221    ///
222    /// # Returns
223    ///
224    /// `true` if the cursor is visible
225    fn get_cursor_visible(&self) -> bool;
226
227    /// Retrieves whether a `Text` is editable or not.
228    ///
229    /// # Returns
230    ///
231    /// `true` if the actor is editable
232    fn get_editable(&self) -> bool;
233
234    /// Returns the ellipsizing position of a `Text` actor, as
235    /// set by `TextExt::set_ellipsize`.
236    ///
237    /// # Returns
238    ///
239    /// `pango::EllipsizeMode`
240    fn get_ellipsize(&self) -> pango::EllipsizeMode;
241
242    /// Retrieves the `pango::FontDescription` used by `self`
243    ///
244    /// # Returns
245    ///
246    /// a `pango::FontDescription`. The returned value is owned
247    ///  by the `Text` actor and it should not be modified or freed
248    fn get_font_description(&self) -> Option<pango::FontDescription>;
249
250    /// Retrieves the font name as set by `TextExt::set_font_name`.
251    ///
252    /// # Returns
253    ///
254    /// a string containing the font name. The returned
255    ///  string is owned by the `Text` actor and should not be
256    ///  modified or freed
257    fn get_font_name(&self) -> Option<GString>;
258
259    /// Retrieves whether the `Text` actor should justify its contents
260    /// on both margins.
261    ///
262    /// # Returns
263    ///
264    /// `true` if the text should be justified
265    fn get_justify(&self) -> bool;
266
267    /// Retrieves the current `pango::Layout` used by a `Text` actor.
268    ///
269    /// # Returns
270    ///
271    /// a `pango::Layout`. The returned object is owned by
272    ///  the `Text` actor and should not be modified or freed
273    fn get_layout(&self) -> Option<pango::Layout>;
274
275    /// Obtains the coordinates where the `Text` will draw the `pango::Layout`
276    /// representing the text.
277    /// ## `x`
278    /// location to store X offset of layout, or `None`
279    /// ## `y`
280    /// location to store Y offset of layout, or `None`
281    fn get_layout_offsets(&self) -> (i32, i32);
282
283    /// Retrieves the alignment of a `Text`, as set by
284    /// `TextExt::set_line_alignment`.
285    ///
286    /// # Returns
287    ///
288    /// a `pango::Alignment`
289    fn get_line_alignment(&self) -> pango::Alignment;
290
291    /// Retrieves the value set using `TextExt::set_line_wrap`.
292    ///
293    /// # Returns
294    ///
295    /// `true` if the `Text` actor should wrap
296    ///  its contents
297    fn get_line_wrap(&self) -> bool;
298
299    /// Retrieves the line wrap mode used by the `Text` actor.
300    ///
301    /// See text_set_line_wrap_mode ().
302    ///
303    /// # Returns
304    ///
305    /// the wrap mode used by the `Text`
306    fn get_line_wrap_mode(&self) -> pango::WrapMode;
307
308    /// Gets the maximum length of text that can be set into a text actor.
309    ///
310    /// See `TextExt::set_max_length`.
311    ///
312    /// # Returns
313    ///
314    /// the maximum number of characters.
315    fn get_max_length(&self) -> i32;
316
317    /// Retrieves the character to use in place of the actual text
318    /// as set by `TextExt::set_password_char`.
319    ///
320    /// # Returns
321    ///
322    /// a Unicode character or 0 if the password
323    ///  character is not set
324    fn get_password_char(&self) -> char;
325
326    /// Retrieves whether a `Text` is selectable or not.
327    ///
328    /// # Returns
329    ///
330    /// `true` if the actor is selectable
331    fn get_selectable(&self) -> bool;
332
333    /// Retrieves the color of selected text of a `Text` actor.
334    /// ## `color`
335    /// return location for a `Color`
336    fn get_selected_text_color(&self) -> InternalColor;
337
338    /// Retrieves the currently selected text.
339    ///
340    /// # Returns
341    ///
342    /// a newly allocated string containing the currently
343    ///  selected text, or `None`. Use `g_free` to free the returned
344    ///  string.
345    fn get_selection(&self) -> Option<GString>;
346
347    /// Retrieves the other end of the selection of a `Text` actor,
348    /// in characters from the current cursor position.
349    ///
350    /// # Returns
351    ///
352    /// the position of the other end of the selection
353    fn get_selection_bound(&self) -> i32;
354
355    /// Retrieves the color of the selection of a `Text` actor.
356    /// ## `color`
357    /// return location for a `Color`
358    fn get_selection_color(&self) -> InternalColor;
359
360    /// Retrieves whether the `Text` actor is in single line mode.
361    ///
362    /// # Returns
363    ///
364    /// `true` if the `Text` actor is in single line mode
365    fn get_single_line_mode(&self) -> bool;
366
367    /// Retrieves a pointer to the current contents of a `Text`
368    /// actor.
369    ///
370    /// If you need a copy of the contents for manipulating, either
371    /// use `g_strdup` on the returned string, or use:
372    ///
373    ///
374    /// ```text
375    ///    copy = text_get_chars (text, 0, -1);
376    /// ```
377    ///
378    /// Which will return a newly allocated string.
379    ///
380    /// If the `Text` actor is empty, this function will return
381    /// an empty string, and not `None`.
382    ///
383    /// # Returns
384    ///
385    /// the contents of the actor. The returned
386    ///  string is owned by the `Text` actor and should never be modified
387    ///  or freed
388    fn get_text(&self) -> Option<GString>;
389
390    /// Retrieves whether the contents of the `Text` actor should be
391    /// parsed for the Pango text markup.
392    ///
393    /// # Returns
394    ///
395    /// `true` if the contents will be parsed for markup
396    fn get_use_markup(&self) -> bool;
397
398    /// Inserts `text` into a `Actor` at the given position.
399    ///
400    /// If `position` is a negative number, the text will be appended
401    /// at the end of the current contents of the `Text`.
402    ///
403    /// The position is expressed in characters, not in bytes.
404    /// ## `text`
405    /// the text to be inserted
406    /// ## `position`
407    /// the position of the insertion, or -1
408    fn insert_text(&self, text: &str, position: isize);
409
410    /// Inserts `wc` at the current cursor position of a
411    /// `Text` actor.
412    /// ## `wc`
413    /// a Unicode character
414    fn insert_unichar(&self, wc: char);
415
416    /// Retrieves the coordinates of the given `position`.
417    /// ## `position`
418    /// position in characters
419    /// ## `x`
420    /// return location for the X coordinate, or `None`
421    /// ## `y`
422    /// return location for the Y coordinate, or `None`
423    /// ## `line_height`
424    /// return location for the line height, or `None`
425    ///
426    /// # Returns
427    ///
428    /// `true` if the conversion was successful
429    fn position_to_coords(&self, position: i32) -> Option<(f32, f32, f32)>;
430
431    /// Sets whether a `Text` actor should be activatable.
432    ///
433    /// An activatable `Text` actor will emit the `Text::activate`
434    /// signal whenever the 'Enter' (or 'Return') key is pressed; if it is not
435    /// activatable, a new line will be appended to the current content.
436    ///
437    /// An activatable `Text` must also be set as editable using
438    /// `TextExt::set_editable`.
439    /// ## `activatable`
440    /// whether the `Text` actor should be activatable
441    fn set_activatable(&self, activatable: bool);
442
443    /// Sets the attributes list that are going to be applied to the
444    /// `Text` contents.
445    ///
446    /// The `Text` actor will take a reference on the `pango::AttrList`
447    /// passed to this function.
448    /// ## `attrs`
449    /// a `pango::AttrList` or `None` to unset the attributes
450    fn set_attributes(&self, attrs: Option<&pango::AttrList>);
451
452    /// Set the `TextBuffer` object which holds the text for
453    /// this widget.
454    /// ## `buffer`
455    /// a `TextBuffer`
456    fn set_buffer<P: IsA<TextBuffer>>(&self, buffer: &P);
457
458    /// Sets the color of the contents of a `Text` actor.
459    ///
460    /// The overall opacity of the `Text` actor will be the
461    /// result of the alpha value of `color` and the composited
462    /// opacity of the actor itself on the scenegraph, as returned
463    /// by `ActorExt::get_paint_opacity`.
464    /// ## `color`
465    /// a `Color`
466    fn set_color(&self, color: &InternalColor);
467
468    /// Sets the color of the cursor of a `Text` actor.
469    ///
470    /// If `color` is `None`, the cursor color will be the same as the
471    /// text color.
472    /// ## `color`
473    /// the color of the cursor, or `None` to unset it
474    fn set_cursor_color(&self, color: Option<&InternalColor>);
475
476    /// Sets the cursor of a `Text` actor at `position`.
477    ///
478    /// The position is expressed in characters, not in bytes.
479    /// ## `position`
480    /// the new cursor position, in characters
481    fn set_cursor_position(&self, position: i32);
482
483    /// Sets the size of the cursor of a `Text`. The cursor
484    /// will only be visible if the `Text:cursor-visible` property
485    /// is set to `true`.
486    /// ## `size`
487    /// the size of the cursor, in pixels, or -1 to use the
488    ///  default value
489    fn set_cursor_size(&self, size: i32);
490
491    /// Sets whether the cursor of a `Text` actor should be
492    /// visible or not.
493    ///
494    /// The color of the cursor will be the same as the text color
495    /// unless `TextExt::set_cursor_color` has been called.
496    ///
497    /// The size of the cursor can be set using `TextExt::set_cursor_size`.
498    ///
499    /// The position of the cursor can be changed programmatically using
500    /// `TextExt::set_cursor_position`.
501    /// ## `cursor_visible`
502    /// whether the cursor should be visible
503    fn set_cursor_visible(&self, cursor_visible: bool);
504
505    /// Sets whether the `Text` actor should be editable.
506    ///
507    /// An editable `Text` with key focus set using
508    /// `ActorExt::grab_key_focus` or `StageExt::set_key_focus`
509    /// will receive key events and will update its contents accordingly.
510    /// ## `editable`
511    /// whether the `Text` should be editable
512    fn set_editable(&self, editable: bool);
513
514    /// Sets the mode used to ellipsize (add an ellipsis: "...") to the
515    /// text if there is not enough space to render the entire contents
516    /// of a `Text` actor
517    /// ## `mode`
518    /// a `pango::EllipsizeMode`
519    fn set_ellipsize(&self, mode: pango::EllipsizeMode);
520
521    /// Sets `font_desc` as the font description for a `Text`
522    ///
523    /// The `pango::FontDescription` is copied by the `Text` actor
524    /// so you can safely call `pango::FontDescription::free` on it after
525    /// calling this function.
526    /// ## `font_desc`
527    /// a `pango::FontDescription`
528    fn set_font_description(&self, font_desc: &mut pango::FontDescription);
529
530    /// Sets the font used by a `Text`. The `font_name` string
531    /// must either be `None`, which means that the font name from the
532    /// default `Backend` will be used; or be something that can
533    /// be parsed by the `pango::FontDescription::from_string` function,
534    /// like:
535    ///
536    ///
537    /// ```text
538    ///   // Set the font to the system's Sans, 10 points
539    ///   text_set_font_name (text, "Sans 10");
540    ///
541    ///   // Set the font to the system's Serif, 16 pixels
542    ///   text_set_font_name (text, "Serif 16px");
543    ///
544    ///   // Set the font to Helvetica, 10 points
545    ///   text_set_font_name (text, "Helvetica 10");
546    /// ```
547    /// ## `font_name`
548    /// a font name, or `None` to set the default font name
549    fn set_font_name(&self, font_name: Option<&str>);
550
551    /// Sets whether the text of the `Text` actor should be justified
552    /// on both margins. This setting is ignored if it is compiled
553    /// against Pango &lt; 1.18.
554    /// ## `justify`
555    /// whether the text should be justified
556    fn set_justify(&self, justify: bool);
557
558    /// Sets the way that the lines of a wrapped label are aligned with
559    /// respect to each other. This does not affect the overall alignment
560    /// of the label within its allocated or specified width.
561    ///
562    /// To align a `Text` actor you should add it to a container
563    /// that supports alignment, or use the anchor point.
564    /// ## `alignment`
565    /// A `pango::Alignment`
566    fn set_line_alignment(&self, alignment: pango::Alignment);
567
568    /// Sets whether the contents of a `Text` actor should wrap,
569    /// if they don't fit the size assigned to the actor.
570    /// ## `line_wrap`
571    /// whether the contents should wrap
572    fn set_line_wrap(&self, line_wrap: bool);
573
574    /// If line wrapping is enabled (see `TextExt::set_line_wrap`) this
575    /// function controls how the line wrapping is performed. The default is
576    /// `pango::WrapMode::Word` which means wrap on word boundaries.
577    /// ## `wrap_mode`
578    /// the line wrapping mode
579    fn set_line_wrap_mode(&self, wrap_mode: pango::WrapMode);
580
581    /// Sets `markup` as the contents of a `Text`.
582    ///
583    /// This is a convenience function for setting a string containing
584    /// Pango markup, and it is logically equivalent to:
585    ///
586    ///
587    /// ```text
588    ///   /&ast; the order is important &ast;/
589    ///   text_set_text (TEXT (actor), markup);
590    ///   text_set_use_markup (TEXT (actor), true);
591    /// ```
592    /// ## `markup`
593    /// a string containing Pango markup.
594    ///  Passing `None` is the same as passing "" (the empty string)
595    fn set_markup(&self, markup: Option<&str>);
596
597    /// Sets the maximum allowed length of the contents of the actor. If the
598    /// current contents are longer than the given length, then they will be
599    /// truncated to fit.
600    /// ## `max`
601    /// the maximum number of characters allowed in the text actor; 0
602    ///  to disable or -1 to set the length of the current string
603    fn set_max_length(&self, max: i32);
604
605    /// Sets the character to use in place of the actual text in a
606    /// password text actor.
607    ///
608    /// If `wc` is 0 the text will be displayed as it is entered in the
609    /// `Text` actor.
610    /// ## `wc`
611    /// a Unicode character, or 0 to unset the password character
612    fn set_password_char(&self, wc: char);
613
614    /// Sets, or unsets, the pre-edit string. This function is useful
615    /// for input methods to display a string (with eventual specific
616    /// Pango attributes) before it is entered inside the `Text`
617    /// buffer.
618    ///
619    /// The preedit string and attributes are ignored if the `Text`
620    /// actor is not editable.
621    ///
622    /// This function should not be used by applications
623    /// ## `preedit_str`
624    /// the pre-edit string, or `None` to unset it
625    /// ## `preedit_attrs`
626    /// the pre-edit string attributes
627    /// ## `cursor_pos`
628    /// the cursor position for the pre-edit string
629    fn set_preedit_string(
630        &self,
631        preedit_str: Option<&str>,
632        preedit_attrs: Option<&pango::AttrList>,
633        cursor_pos: u32,
634    );
635
636    /// Sets whether a `Text` actor should be selectable.
637    ///
638    /// A selectable `Text` will allow selecting its contents using
639    /// the pointer or the keyboard.
640    /// ## `selectable`
641    /// whether the `Text` actor should be selectable
642    fn set_selectable(&self, selectable: bool);
643
644    /// Sets the selected text color of a `Text` actor.
645    ///
646    /// If `color` is `None`, the selected text color will be the same as the
647    /// selection color, which then falls back to cursor, and then text color.
648    /// ## `color`
649    /// the selected text color, or `None` to unset it
650    fn set_selected_text_color(&self, color: Option<&InternalColor>);
651
652    /// Selects the region of text between `start_pos` and `end_pos`.
653    ///
654    /// This function changes the position of the cursor to match
655    /// `start_pos` and the selection bound to match `end_pos`.
656    /// ## `start_pos`
657    /// start of the selection, in characters
658    /// ## `end_pos`
659    /// end of the selection, in characters
660    fn set_selection(&self, start_pos: isize, end_pos: isize);
661
662    /// Sets the other end of the selection, starting from the current
663    /// cursor position.
664    ///
665    /// If `selection_bound` is -1, the selection unset.
666    /// ## `selection_bound`
667    /// the position of the end of the selection, in characters
668    fn set_selection_bound(&self, selection_bound: i32);
669
670    /// Sets the color of the selection of a `Text` actor.
671    ///
672    /// If `color` is `None`, the selection color will be the same as the
673    /// cursor color, or if no cursor color is set either then it will be
674    /// the same as the text color.
675    /// ## `color`
676    /// the color of the selection, or `None` to unset it
677    fn set_selection_color(&self, color: Option<&InternalColor>);
678
679    /// Sets whether a `Text` actor should be in single line mode
680    /// or not. Only editable `Text`<!-- -->s can be in single line
681    /// mode.
682    ///
683    /// A text actor in single line mode will not wrap text and will clip
684    /// the visible area to the predefined size. The contents of the
685    /// text actor will scroll to display the end of the text if its length
686    /// is bigger than the allocated width.
687    ///
688    /// When setting the single line mode the `Text:activatable`
689    /// property is also set as a side effect. Instead of entering a new
690    /// line character, the text actor will emit the `Text::activate`
691    /// signal.
692    /// ## `single_line`
693    /// whether to enable single line mode
694    fn set_single_line_mode(&self, single_line: bool);
695
696    /// Sets the contents of a `Text` actor.
697    ///
698    /// If the `Text:use-markup` property was set to `true` it
699    /// will be reset to `false` as a side effect. If you want to
700    /// maintain the `Text:use-markup` you should use the
701    /// `TextExt::set_markup` function instead
702    /// ## `text`
703    /// the text to set. Passing `None` is the same
704    ///  as passing "" (the empty string)
705    fn set_text(&self, text: Option<&str>);
706
707    /// Sets whether the contents of the `Text` actor contains markup
708    /// in <link linkend="PangoMarkupFormat">Pango's text markup language`</link>`.
709    ///
710    /// Setting `Text:use-markup` on an editable `Text` will
711    /// not have any effect except hiding the markup.
712    ///
713    /// See also `Text:use-markup`.
714    /// ## `setting`
715    /// `true` if the text should be parsed for markup.
716    fn set_use_markup(&self, setting: bool);
717
718    /// Will be set to `true` if `Text:cursor-color` has been set.
719    fn get_property_cursor_color_set(&self) -> bool;
720
721    /// Will be set to `true` if `Text:selected-text-color` has been set.
722    fn get_property_selected_text_color_set(&self) -> bool;
723
724    /// Will be set to `true` if `Text:selection-color` has been set.
725    fn get_property_selection_color_set(&self) -> bool;
726
727    /// The ::activate signal is emitted each time the actor is 'activated'
728    /// by the user, normally by pressing the 'Enter' key. The signal is
729    /// emitted only if `Text:activatable` is set to `true`.
730    fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
731
732    /// The ::cursor-changed signal is emitted whenever the cursor
733    /// position or size changes.
734    fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
735
736    /// This signal is emitted when text is deleted from the actor by
737    /// the user. It is emitted before `self_` text changes.
738    /// ## `start_pos`
739    /// the starting position
740    /// ## `end_pos`
741    /// the end position
742    fn connect_delete_text<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId;
743
744    fn emit_delete_text(&self, start_pos: i32, end_pos: i32);
745
746    //fn connect_insert_text<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
747
748    /// The ::text-changed signal is emitted after `actor`'s text changes
749    fn connect_text_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
750
751    fn connect_property_activatable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
752
753    fn connect_property_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
754
755    fn connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
756
757    fn connect_property_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
758
759    fn connect_property_cursor_color_notify<F: Fn(&Self) + 'static>(&self, f: F)
760        -> SignalHandlerId;
761
762    fn connect_property_cursor_color_set_notify<F: Fn(&Self) + 'static>(
763        &self,
764        f: F,
765    ) -> SignalHandlerId;
766
767    fn connect_property_cursor_position_notify<F: Fn(&Self) + 'static>(
768        &self,
769        f: F,
770    ) -> SignalHandlerId;
771
772    fn connect_property_cursor_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
773
774    fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
775        &self,
776        f: F,
777    ) -> SignalHandlerId;
778
779    fn connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
780
781    fn connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
782
783    fn connect_property_font_description_notify<F: Fn(&Self) + 'static>(
784        &self,
785        f: F,
786    ) -> SignalHandlerId;
787
788    fn connect_property_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
789
790    fn connect_property_justify_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
791
792    fn connect_property_line_alignment_notify<F: Fn(&Self) + 'static>(
793        &self,
794        f: F,
795    ) -> SignalHandlerId;
796
797    fn connect_property_line_wrap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
798
799    fn connect_property_line_wrap_mode_notify<F: Fn(&Self) + 'static>(
800        &self,
801        f: F,
802    ) -> SignalHandlerId;
803
804    fn connect_property_max_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
805
806    fn connect_property_password_char_notify<F: Fn(&Self) + 'static>(
807        &self,
808        f: F,
809    ) -> SignalHandlerId;
810
811    fn connect_property_selectable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
812
813    fn connect_property_selected_text_color_notify<F: Fn(&Self) + 'static>(
814        &self,
815        f: F,
816    ) -> SignalHandlerId;
817
818    fn connect_property_selected_text_color_set_notify<F: Fn(&Self) + 'static>(
819        &self,
820        f: F,
821    ) -> SignalHandlerId;
822
823    fn connect_property_selection_bound_notify<F: Fn(&Self) + 'static>(
824        &self,
825        f: F,
826    ) -> SignalHandlerId;
827
828    fn connect_property_selection_color_notify<F: Fn(&Self) + 'static>(
829        &self,
830        f: F,
831    ) -> SignalHandlerId;
832
833    fn connect_property_selection_color_set_notify<F: Fn(&Self) + 'static>(
834        &self,
835        f: F,
836    ) -> SignalHandlerId;
837
838    fn connect_property_single_line_mode_notify<F: Fn(&Self) + 'static>(
839        &self,
840        f: F,
841    ) -> SignalHandlerId;
842
843    fn connect_property_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
844
845    fn connect_property_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
846}
847
848impl<O: IsA<Text>> TextExt for O {
849    fn activate(&self) -> bool {
850        unsafe { from_glib(ffi::clutter_text_activate(self.as_ref().to_glib_none().0)) }
851    }
852
853    fn coords_to_position(&self, x: f32, y: f32) -> i32 {
854        unsafe { ffi::clutter_text_coords_to_position(self.as_ref().to_glib_none().0, x, y) }
855    }
856
857    fn delete_chars(&self, n_chars: u32) {
858        unsafe {
859            ffi::clutter_text_delete_chars(self.as_ref().to_glib_none().0, n_chars);
860        }
861    }
862
863    fn delete_selection(&self) -> bool {
864        unsafe {
865            from_glib(ffi::clutter_text_delete_selection(
866                self.as_ref().to_glib_none().0,
867            ))
868        }
869    }
870
871    fn delete_text(&self, start_pos: isize, end_pos: isize) {
872        unsafe {
873            ffi::clutter_text_delete_text(self.as_ref().to_glib_none().0, start_pos, end_pos);
874        }
875    }
876
877    fn get_activatable(&self) -> bool {
878        unsafe {
879            from_glib(ffi::clutter_text_get_activatable(
880                self.as_ref().to_glib_none().0,
881            ))
882        }
883    }
884
885    fn get_attributes(&self) -> Option<pango::AttrList> {
886        unsafe {
887            from_glib_none(ffi::clutter_text_get_attributes(
888                self.as_ref().to_glib_none().0,
889            ))
890        }
891    }
892
893    fn get_buffer(&self) -> Option<TextBuffer> {
894        unsafe { from_glib_none(ffi::clutter_text_get_buffer(self.as_ref().to_glib_none().0)) }
895    }
896
897    fn get_chars(&self, start_pos: isize, end_pos: isize) -> Option<GString> {
898        unsafe {
899            from_glib_full(ffi::clutter_text_get_chars(
900                self.as_ref().to_glib_none().0,
901                start_pos,
902                end_pos,
903            ))
904        }
905    }
906
907    fn get_color(&self) -> InternalColor {
908        unsafe {
909            let mut color = InternalColor::uninitialized();
910            ffi::clutter_text_get_color(self.as_ref().to_glib_none().0, color.to_glib_none_mut().0);
911            color
912        }
913    }
914
915    fn get_cursor_color(&self) -> InternalColor {
916        unsafe {
917            let mut color = InternalColor::uninitialized();
918            ffi::clutter_text_get_cursor_color(
919                self.as_ref().to_glib_none().0,
920                color.to_glib_none_mut().0,
921            );
922            color
923        }
924    }
925
926    fn get_cursor_position(&self) -> i32 {
927        unsafe { ffi::clutter_text_get_cursor_position(self.as_ref().to_glib_none().0) }
928    }
929
930    fn get_cursor_rect(&self) -> InternalRect {
931        unsafe {
932            let mut rect = InternalRect::uninitialized();
933            ffi::clutter_text_get_cursor_rect(
934                self.as_ref().to_glib_none().0,
935                rect.to_glib_none_mut().0,
936            );
937            rect
938        }
939    }
940
941    fn get_cursor_size(&self) -> u32 {
942        unsafe { ffi::clutter_text_get_cursor_size(self.as_ref().to_glib_none().0) }
943    }
944
945    fn get_cursor_visible(&self) -> bool {
946        unsafe {
947            from_glib(ffi::clutter_text_get_cursor_visible(
948                self.as_ref().to_glib_none().0,
949            ))
950        }
951    }
952
953    fn get_editable(&self) -> bool {
954        unsafe {
955            from_glib(ffi::clutter_text_get_editable(
956                self.as_ref().to_glib_none().0,
957            ))
958        }
959    }
960
961    fn get_ellipsize(&self) -> pango::EllipsizeMode {
962        unsafe {
963            from_glib(ffi::clutter_text_get_ellipsize(
964                self.as_ref().to_glib_none().0,
965            ))
966        }
967    }
968
969    fn get_font_description(&self) -> Option<pango::FontDescription> {
970        unsafe {
971            from_glib_full(ffi::clutter_text_get_font_description(
972                self.as_ref().to_glib_none().0,
973            ))
974        }
975    }
976
977    fn get_font_name(&self) -> Option<GString> {
978        unsafe {
979            from_glib_none(ffi::clutter_text_get_font_name(
980                self.as_ref().to_glib_none().0,
981            ))
982        }
983    }
984
985    fn get_justify(&self) -> bool {
986        unsafe {
987            from_glib(ffi::clutter_text_get_justify(
988                self.as_ref().to_glib_none().0,
989            ))
990        }
991    }
992
993    fn get_layout(&self) -> Option<pango::Layout> {
994        unsafe { from_glib_none(ffi::clutter_text_get_layout(self.as_ref().to_glib_none().0)) }
995    }
996
997    fn get_layout_offsets(&self) -> (i32, i32) {
998        unsafe {
999            let mut x = mem::MaybeUninit::uninit();
1000            let mut y = mem::MaybeUninit::uninit();
1001            ffi::clutter_text_get_layout_offsets(
1002                self.as_ref().to_glib_none().0,
1003                x.as_mut_ptr(),
1004                y.as_mut_ptr(),
1005            );
1006            let x = x.assume_init();
1007            let y = y.assume_init();
1008            (x, y)
1009        }
1010    }
1011
1012    fn get_line_alignment(&self) -> pango::Alignment {
1013        unsafe {
1014            from_glib(ffi::clutter_text_get_line_alignment(
1015                self.as_ref().to_glib_none().0,
1016            ))
1017        }
1018    }
1019
1020    fn get_line_wrap(&self) -> bool {
1021        unsafe {
1022            from_glib(ffi::clutter_text_get_line_wrap(
1023                self.as_ref().to_glib_none().0,
1024            ))
1025        }
1026    }
1027
1028    fn get_line_wrap_mode(&self) -> pango::WrapMode {
1029        unsafe {
1030            from_glib(ffi::clutter_text_get_line_wrap_mode(
1031                self.as_ref().to_glib_none().0,
1032            ))
1033        }
1034    }
1035
1036    fn get_max_length(&self) -> i32 {
1037        unsafe { ffi::clutter_text_get_max_length(self.as_ref().to_glib_none().0) }
1038    }
1039
1040    fn get_password_char(&self) -> char {
1041        unsafe {
1042            from_glib(ffi::clutter_text_get_password_char(
1043                self.as_ref().to_glib_none().0,
1044            ))
1045        }
1046    }
1047
1048    fn get_selectable(&self) -> bool {
1049        unsafe {
1050            from_glib(ffi::clutter_text_get_selectable(
1051                self.as_ref().to_glib_none().0,
1052            ))
1053        }
1054    }
1055
1056    fn get_selected_text_color(&self) -> InternalColor {
1057        unsafe {
1058            let mut color = InternalColor::uninitialized();
1059            ffi::clutter_text_get_selected_text_color(
1060                self.as_ref().to_glib_none().0,
1061                color.to_glib_none_mut().0,
1062            );
1063            color
1064        }
1065    }
1066
1067    fn get_selection(&self) -> Option<GString> {
1068        unsafe {
1069            from_glib_full(ffi::clutter_text_get_selection(
1070                self.as_ref().to_glib_none().0,
1071            ))
1072        }
1073    }
1074
1075    fn get_selection_bound(&self) -> i32 {
1076        unsafe { ffi::clutter_text_get_selection_bound(self.as_ref().to_glib_none().0) }
1077    }
1078
1079    fn get_selection_color(&self) -> InternalColor {
1080        unsafe {
1081            let mut color = InternalColor::uninitialized();
1082            ffi::clutter_text_get_selection_color(
1083                self.as_ref().to_glib_none().0,
1084                color.to_glib_none_mut().0,
1085            );
1086            color
1087        }
1088    }
1089
1090    fn get_single_line_mode(&self) -> bool {
1091        unsafe {
1092            from_glib(ffi::clutter_text_get_single_line_mode(
1093                self.as_ref().to_glib_none().0,
1094            ))
1095        }
1096    }
1097
1098    fn get_text(&self) -> Option<GString> {
1099        unsafe { from_glib_none(ffi::clutter_text_get_text(self.as_ref().to_glib_none().0)) }
1100    }
1101
1102    fn get_use_markup(&self) -> bool {
1103        unsafe {
1104            from_glib(ffi::clutter_text_get_use_markup(
1105                self.as_ref().to_glib_none().0,
1106            ))
1107        }
1108    }
1109
1110    fn insert_text(&self, text: &str, position: isize) {
1111        unsafe {
1112            ffi::clutter_text_insert_text(
1113                self.as_ref().to_glib_none().0,
1114                text.to_glib_none().0,
1115                position,
1116            );
1117        }
1118    }
1119
1120    fn insert_unichar(&self, wc: char) {
1121        unsafe {
1122            ffi::clutter_text_insert_unichar(self.as_ref().to_glib_none().0, wc.to_glib());
1123        }
1124    }
1125
1126    fn position_to_coords(&self, position: i32) -> Option<(f32, f32, f32)> {
1127        unsafe {
1128            let mut x = mem::MaybeUninit::uninit();
1129            let mut y = mem::MaybeUninit::uninit();
1130            let mut line_height = mem::MaybeUninit::uninit();
1131            let ret = from_glib(ffi::clutter_text_position_to_coords(
1132                self.as_ref().to_glib_none().0,
1133                position,
1134                x.as_mut_ptr(),
1135                y.as_mut_ptr(),
1136                line_height.as_mut_ptr(),
1137            ));
1138            let x = x.assume_init();
1139            let y = y.assume_init();
1140            let line_height = line_height.assume_init();
1141            if ret {
1142                Some((x, y, line_height))
1143            } else {
1144                None
1145            }
1146        }
1147    }
1148
1149    fn set_activatable(&self, activatable: bool) {
1150        unsafe {
1151            ffi::clutter_text_set_activatable(
1152                self.as_ref().to_glib_none().0,
1153                activatable.to_glib(),
1154            );
1155        }
1156    }
1157
1158    fn set_attributes(&self, attrs: Option<&pango::AttrList>) {
1159        unsafe {
1160            ffi::clutter_text_set_attributes(
1161                self.as_ref().to_glib_none().0,
1162                attrs.to_glib_none().0,
1163            );
1164        }
1165    }
1166
1167    fn set_buffer<P: IsA<TextBuffer>>(&self, buffer: &P) {
1168        unsafe {
1169            ffi::clutter_text_set_buffer(
1170                self.as_ref().to_glib_none().0,
1171                buffer.as_ref().to_glib_none().0,
1172            );
1173        }
1174    }
1175
1176    fn set_color(&self, color: &InternalColor) {
1177        unsafe {
1178            ffi::clutter_text_set_color(self.as_ref().to_glib_none().0, color.to_glib_none().0);
1179        }
1180    }
1181
1182    fn set_cursor_color(&self, color: Option<&InternalColor>) {
1183        unsafe {
1184            ffi::clutter_text_set_cursor_color(
1185                self.as_ref().to_glib_none().0,
1186                color.to_glib_none().0,
1187            );
1188        }
1189    }
1190
1191    fn set_cursor_position(&self, position: i32) {
1192        unsafe {
1193            ffi::clutter_text_set_cursor_position(self.as_ref().to_glib_none().0, position);
1194        }
1195    }
1196
1197    fn set_cursor_size(&self, size: i32) {
1198        unsafe {
1199            ffi::clutter_text_set_cursor_size(self.as_ref().to_glib_none().0, size);
1200        }
1201    }
1202
1203    fn set_cursor_visible(&self, cursor_visible: bool) {
1204        unsafe {
1205            ffi::clutter_text_set_cursor_visible(
1206                self.as_ref().to_glib_none().0,
1207                cursor_visible.to_glib(),
1208            );
1209        }
1210    }
1211
1212    fn set_editable(&self, editable: bool) {
1213        unsafe {
1214            ffi::clutter_text_set_editable(self.as_ref().to_glib_none().0, editable.to_glib());
1215        }
1216    }
1217
1218    fn set_ellipsize(&self, mode: pango::EllipsizeMode) {
1219        unsafe {
1220            ffi::clutter_text_set_ellipsize(self.as_ref().to_glib_none().0, mode.to_glib());
1221        }
1222    }
1223
1224    fn set_font_description(&self, font_desc: &mut pango::FontDescription) {
1225        unsafe {
1226            ffi::clutter_text_set_font_description(
1227                self.as_ref().to_glib_none().0,
1228                font_desc.to_glib_none_mut().0,
1229            );
1230        }
1231    }
1232
1233    fn set_font_name(&self, font_name: Option<&str>) {
1234        unsafe {
1235            ffi::clutter_text_set_font_name(
1236                self.as_ref().to_glib_none().0,
1237                font_name.to_glib_none().0,
1238            );
1239        }
1240    }
1241
1242    fn set_justify(&self, justify: bool) {
1243        unsafe {
1244            ffi::clutter_text_set_justify(self.as_ref().to_glib_none().0, justify.to_glib());
1245        }
1246    }
1247
1248    fn set_line_alignment(&self, alignment: pango::Alignment) {
1249        unsafe {
1250            ffi::clutter_text_set_line_alignment(
1251                self.as_ref().to_glib_none().0,
1252                alignment.to_glib(),
1253            );
1254        }
1255    }
1256
1257    fn set_line_wrap(&self, line_wrap: bool) {
1258        unsafe {
1259            ffi::clutter_text_set_line_wrap(self.as_ref().to_glib_none().0, line_wrap.to_glib());
1260        }
1261    }
1262
1263    fn set_line_wrap_mode(&self, wrap_mode: pango::WrapMode) {
1264        unsafe {
1265            ffi::clutter_text_set_line_wrap_mode(
1266                self.as_ref().to_glib_none().0,
1267                wrap_mode.to_glib(),
1268            );
1269        }
1270    }
1271
1272    fn set_markup(&self, markup: Option<&str>) {
1273        unsafe {
1274            ffi::clutter_text_set_markup(self.as_ref().to_glib_none().0, markup.to_glib_none().0);
1275        }
1276    }
1277
1278    fn set_max_length(&self, max: i32) {
1279        unsafe {
1280            ffi::clutter_text_set_max_length(self.as_ref().to_glib_none().0, max);
1281        }
1282    }
1283
1284    fn set_password_char(&self, wc: char) {
1285        unsafe {
1286            ffi::clutter_text_set_password_char(self.as_ref().to_glib_none().0, wc.to_glib());
1287        }
1288    }
1289
1290    fn set_preedit_string(
1291        &self,
1292        preedit_str: Option<&str>,
1293        preedit_attrs: Option<&pango::AttrList>,
1294        cursor_pos: u32,
1295    ) {
1296        unsafe {
1297            ffi::clutter_text_set_preedit_string(
1298                self.as_ref().to_glib_none().0,
1299                preedit_str.to_glib_none().0,
1300                preedit_attrs.to_glib_none().0,
1301                cursor_pos,
1302            );
1303        }
1304    }
1305
1306    fn set_selectable(&self, selectable: bool) {
1307        unsafe {
1308            ffi::clutter_text_set_selectable(self.as_ref().to_glib_none().0, selectable.to_glib());
1309        }
1310    }
1311
1312    fn set_selected_text_color(&self, color: Option<&InternalColor>) {
1313        unsafe {
1314            ffi::clutter_text_set_selected_text_color(
1315                self.as_ref().to_glib_none().0,
1316                color.to_glib_none().0,
1317            );
1318        }
1319    }
1320
1321    fn set_selection(&self, start_pos: isize, end_pos: isize) {
1322        unsafe {
1323            ffi::clutter_text_set_selection(self.as_ref().to_glib_none().0, start_pos, end_pos);
1324        }
1325    }
1326
1327    fn set_selection_bound(&self, selection_bound: i32) {
1328        unsafe {
1329            ffi::clutter_text_set_selection_bound(self.as_ref().to_glib_none().0, selection_bound);
1330        }
1331    }
1332
1333    fn set_selection_color(&self, color: Option<&InternalColor>) {
1334        unsafe {
1335            ffi::clutter_text_set_selection_color(
1336                self.as_ref().to_glib_none().0,
1337                color.to_glib_none().0,
1338            );
1339        }
1340    }
1341
1342    fn set_single_line_mode(&self, single_line: bool) {
1343        unsafe {
1344            ffi::clutter_text_set_single_line_mode(
1345                self.as_ref().to_glib_none().0,
1346                single_line.to_glib(),
1347            );
1348        }
1349    }
1350
1351    fn set_text(&self, text: Option<&str>) {
1352        unsafe {
1353            ffi::clutter_text_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
1354        }
1355    }
1356
1357    fn set_use_markup(&self, setting: bool) {
1358        unsafe {
1359            ffi::clutter_text_set_use_markup(self.as_ref().to_glib_none().0, setting.to_glib());
1360        }
1361    }
1362
1363    fn get_property_cursor_color_set(&self) -> bool {
1364        unsafe {
1365            let mut value = Value::from_type(<bool as StaticType>::static_type());
1366            gobject_sys::g_object_get_property(
1367                self.to_glib_none().0 as *mut gobject_sys::GObject,
1368                b"cursor-color-set\0".as_ptr() as *const _,
1369                value.to_glib_none_mut().0,
1370            );
1371            value
1372                .get()
1373                .expect("Return Value for property `cursor-color-set` getter")
1374                .unwrap()
1375        }
1376    }
1377
1378    fn get_property_selected_text_color_set(&self) -> bool {
1379        unsafe {
1380            let mut value = Value::from_type(<bool as StaticType>::static_type());
1381            gobject_sys::g_object_get_property(
1382                self.to_glib_none().0 as *mut gobject_sys::GObject,
1383                b"selected-text-color-set\0".as_ptr() as *const _,
1384                value.to_glib_none_mut().0,
1385            );
1386            value
1387                .get()
1388                .expect("Return Value for property `selected-text-color-set` getter")
1389                .unwrap()
1390        }
1391    }
1392
1393    fn get_property_selection_color_set(&self) -> bool {
1394        unsafe {
1395            let mut value = Value::from_type(<bool as StaticType>::static_type());
1396            gobject_sys::g_object_get_property(
1397                self.to_glib_none().0 as *mut gobject_sys::GObject,
1398                b"selection-color-set\0".as_ptr() as *const _,
1399                value.to_glib_none_mut().0,
1400            );
1401            value
1402                .get()
1403                .expect("Return Value for property `selection-color-set` getter")
1404                .unwrap()
1405        }
1406    }
1407
1408    fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1409        unsafe extern "C" fn activate_trampoline<P, F: Fn(&P) + 'static>(
1410            this: *mut ffi::ClutterText,
1411            f: glib_sys::gpointer,
1412        ) where
1413            P: IsA<Text>,
1414        {
1415            let f: &F = &*(f as *const F);
1416            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1417        }
1418        unsafe {
1419            let f: Box_<F> = Box_::new(f);
1420            connect_raw(
1421                self.as_ptr() as *mut _,
1422                b"activate\0".as_ptr() as *const _,
1423                Some(transmute::<_, unsafe extern "C" fn()>(
1424                    activate_trampoline::<Self, F> as *const (),
1425                )),
1426                Box_::into_raw(f),
1427            )
1428        }
1429    }
1430
1431    fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1432        unsafe extern "C" fn cursor_changed_trampoline<P, F: Fn(&P) + 'static>(
1433            this: *mut ffi::ClutterText,
1434            f: glib_sys::gpointer,
1435        ) where
1436            P: IsA<Text>,
1437        {
1438            let f: &F = &*(f as *const F);
1439            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1440        }
1441        unsafe {
1442            let f: Box_<F> = Box_::new(f);
1443            connect_raw(
1444                self.as_ptr() as *mut _,
1445                b"cursor-changed\0".as_ptr() as *const _,
1446                Some(transmute::<_, unsafe extern "C" fn()>(
1447                    cursor_changed_trampoline::<Self, F> as *const (),
1448                )),
1449                Box_::into_raw(f),
1450            )
1451        }
1452    }
1453
1454    fn connect_delete_text<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
1455        unsafe extern "C" fn delete_text_trampoline<P, F: Fn(&P, i32, i32) + 'static>(
1456            this: *mut ffi::ClutterText,
1457            start_pos: libc::c_int,
1458            end_pos: libc::c_int,
1459            f: glib_sys::gpointer,
1460        ) where
1461            P: IsA<Text>,
1462        {
1463            let f: &F = &*(f as *const F);
1464            f(
1465                &Text::from_glib_borrow(this).unsafe_cast_ref(),
1466                start_pos,
1467                end_pos,
1468            )
1469        }
1470        unsafe {
1471            let f: Box_<F> = Box_::new(f);
1472            connect_raw(
1473                self.as_ptr() as *mut _,
1474                b"delete-text\0".as_ptr() as *const _,
1475                Some(transmute::<_, unsafe extern "C" fn()>(
1476                    delete_text_trampoline::<Self, F> as *const (),
1477                )),
1478                Box_::into_raw(f),
1479            )
1480        }
1481    }
1482
1483    fn emit_delete_text(&self, start_pos: i32, end_pos: i32) {
1484        let _ = unsafe {
1485            glib::Object::from_glib_borrow(self.as_ptr() as *mut gobject_sys::GObject)
1486                .emit("delete-text", &[&start_pos, &end_pos])
1487                .unwrap()
1488        };
1489    }
1490
1491    //fn connect_insert_text<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
1492    //    Unimplemented position: *.Pointer
1493    //}
1494
1495    fn connect_text_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1496        unsafe extern "C" fn text_changed_trampoline<P, F: Fn(&P) + 'static>(
1497            this: *mut ffi::ClutterText,
1498            f: glib_sys::gpointer,
1499        ) where
1500            P: IsA<Text>,
1501        {
1502            let f: &F = &*(f as *const F);
1503            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1504        }
1505        unsafe {
1506            let f: Box_<F> = Box_::new(f);
1507            connect_raw(
1508                self.as_ptr() as *mut _,
1509                b"text-changed\0".as_ptr() as *const _,
1510                Some(transmute::<_, unsafe extern "C" fn()>(
1511                    text_changed_trampoline::<Self, F> as *const (),
1512                )),
1513                Box_::into_raw(f),
1514            )
1515        }
1516    }
1517
1518    fn connect_property_activatable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1519        unsafe extern "C" fn notify_activatable_trampoline<P, F: Fn(&P) + 'static>(
1520            this: *mut ffi::ClutterText,
1521            _param_spec: glib_sys::gpointer,
1522            f: glib_sys::gpointer,
1523        ) where
1524            P: IsA<Text>,
1525        {
1526            let f: &F = &*(f as *const F);
1527            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1528        }
1529        unsafe {
1530            let f: Box_<F> = Box_::new(f);
1531            connect_raw(
1532                self.as_ptr() as *mut _,
1533                b"notify::activatable\0".as_ptr() as *const _,
1534                Some(transmute::<_, unsafe extern "C" fn()>(
1535                    notify_activatable_trampoline::<Self, F> as *const (),
1536                )),
1537                Box_::into_raw(f),
1538            )
1539        }
1540    }
1541
1542    fn connect_property_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1543        unsafe extern "C" fn notify_attributes_trampoline<P, F: Fn(&P) + 'static>(
1544            this: *mut ffi::ClutterText,
1545            _param_spec: glib_sys::gpointer,
1546            f: glib_sys::gpointer,
1547        ) where
1548            P: IsA<Text>,
1549        {
1550            let f: &F = &*(f as *const F);
1551            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1552        }
1553        unsafe {
1554            let f: Box_<F> = Box_::new(f);
1555            connect_raw(
1556                self.as_ptr() as *mut _,
1557                b"notify::attributes\0".as_ptr() as *const _,
1558                Some(transmute::<_, unsafe extern "C" fn()>(
1559                    notify_attributes_trampoline::<Self, F> as *const (),
1560                )),
1561                Box_::into_raw(f),
1562            )
1563        }
1564    }
1565
1566    fn connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1567        unsafe extern "C" fn notify_buffer_trampoline<P, F: Fn(&P) + 'static>(
1568            this: *mut ffi::ClutterText,
1569            _param_spec: glib_sys::gpointer,
1570            f: glib_sys::gpointer,
1571        ) where
1572            P: IsA<Text>,
1573        {
1574            let f: &F = &*(f as *const F);
1575            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1576        }
1577        unsafe {
1578            let f: Box_<F> = Box_::new(f);
1579            connect_raw(
1580                self.as_ptr() as *mut _,
1581                b"notify::buffer\0".as_ptr() as *const _,
1582                Some(transmute::<_, unsafe extern "C" fn()>(
1583                    notify_buffer_trampoline::<Self, F> as *const (),
1584                )),
1585                Box_::into_raw(f),
1586            )
1587        }
1588    }
1589
1590    fn connect_property_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1591        unsafe extern "C" fn notify_color_trampoline<P, F: Fn(&P) + 'static>(
1592            this: *mut ffi::ClutterText,
1593            _param_spec: glib_sys::gpointer,
1594            f: glib_sys::gpointer,
1595        ) where
1596            P: IsA<Text>,
1597        {
1598            let f: &F = &*(f as *const F);
1599            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1600        }
1601        unsafe {
1602            let f: Box_<F> = Box_::new(f);
1603            connect_raw(
1604                self.as_ptr() as *mut _,
1605                b"notify::color\0".as_ptr() as *const _,
1606                Some(transmute::<_, unsafe extern "C" fn()>(
1607                    notify_color_trampoline::<Self, F> as *const (),
1608                )),
1609                Box_::into_raw(f),
1610            )
1611        }
1612    }
1613
1614    fn connect_property_cursor_color_notify<F: Fn(&Self) + 'static>(
1615        &self,
1616        f: F,
1617    ) -> SignalHandlerId {
1618        unsafe extern "C" fn notify_cursor_color_trampoline<P, F: Fn(&P) + 'static>(
1619            this: *mut ffi::ClutterText,
1620            _param_spec: glib_sys::gpointer,
1621            f: glib_sys::gpointer,
1622        ) where
1623            P: IsA<Text>,
1624        {
1625            let f: &F = &*(f as *const F);
1626            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1627        }
1628        unsafe {
1629            let f: Box_<F> = Box_::new(f);
1630            connect_raw(
1631                self.as_ptr() as *mut _,
1632                b"notify::cursor-color\0".as_ptr() as *const _,
1633                Some(transmute::<_, unsafe extern "C" fn()>(
1634                    notify_cursor_color_trampoline::<Self, F> as *const (),
1635                )),
1636                Box_::into_raw(f),
1637            )
1638        }
1639    }
1640
1641    fn connect_property_cursor_color_set_notify<F: Fn(&Self) + 'static>(
1642        &self,
1643        f: F,
1644    ) -> SignalHandlerId {
1645        unsafe extern "C" fn notify_cursor_color_set_trampoline<P, F: Fn(&P) + 'static>(
1646            this: *mut ffi::ClutterText,
1647            _param_spec: glib_sys::gpointer,
1648            f: glib_sys::gpointer,
1649        ) where
1650            P: IsA<Text>,
1651        {
1652            let f: &F = &*(f as *const F);
1653            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1654        }
1655        unsafe {
1656            let f: Box_<F> = Box_::new(f);
1657            connect_raw(
1658                self.as_ptr() as *mut _,
1659                b"notify::cursor-color-set\0".as_ptr() as *const _,
1660                Some(transmute::<_, unsafe extern "C" fn()>(
1661                    notify_cursor_color_set_trampoline::<Self, F> as *const (),
1662                )),
1663                Box_::into_raw(f),
1664            )
1665        }
1666    }
1667
1668    fn connect_property_cursor_position_notify<F: Fn(&Self) + 'static>(
1669        &self,
1670        f: F,
1671    ) -> SignalHandlerId {
1672        unsafe extern "C" fn notify_cursor_position_trampoline<P, F: Fn(&P) + 'static>(
1673            this: *mut ffi::ClutterText,
1674            _param_spec: glib_sys::gpointer,
1675            f: glib_sys::gpointer,
1676        ) where
1677            P: IsA<Text>,
1678        {
1679            let f: &F = &*(f as *const F);
1680            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1681        }
1682        unsafe {
1683            let f: Box_<F> = Box_::new(f);
1684            connect_raw(
1685                self.as_ptr() as *mut _,
1686                b"notify::cursor-position\0".as_ptr() as *const _,
1687                Some(transmute::<_, unsafe extern "C" fn()>(
1688                    notify_cursor_position_trampoline::<Self, F> as *const (),
1689                )),
1690                Box_::into_raw(f),
1691            )
1692        }
1693    }
1694
1695    fn connect_property_cursor_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1696        unsafe extern "C" fn notify_cursor_size_trampoline<P, F: Fn(&P) + 'static>(
1697            this: *mut ffi::ClutterText,
1698            _param_spec: glib_sys::gpointer,
1699            f: glib_sys::gpointer,
1700        ) where
1701            P: IsA<Text>,
1702        {
1703            let f: &F = &*(f as *const F);
1704            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1705        }
1706        unsafe {
1707            let f: Box_<F> = Box_::new(f);
1708            connect_raw(
1709                self.as_ptr() as *mut _,
1710                b"notify::cursor-size\0".as_ptr() as *const _,
1711                Some(transmute::<_, unsafe extern "C" fn()>(
1712                    notify_cursor_size_trampoline::<Self, F> as *const (),
1713                )),
1714                Box_::into_raw(f),
1715            )
1716        }
1717    }
1718
1719    fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
1720        &self,
1721        f: F,
1722    ) -> SignalHandlerId {
1723        unsafe extern "C" fn notify_cursor_visible_trampoline<P, F: Fn(&P) + 'static>(
1724            this: *mut ffi::ClutterText,
1725            _param_spec: glib_sys::gpointer,
1726            f: glib_sys::gpointer,
1727        ) where
1728            P: IsA<Text>,
1729        {
1730            let f: &F = &*(f as *const F);
1731            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1732        }
1733        unsafe {
1734            let f: Box_<F> = Box_::new(f);
1735            connect_raw(
1736                self.as_ptr() as *mut _,
1737                b"notify::cursor-visible\0".as_ptr() as *const _,
1738                Some(transmute::<_, unsafe extern "C" fn()>(
1739                    notify_cursor_visible_trampoline::<Self, F> as *const (),
1740                )),
1741                Box_::into_raw(f),
1742            )
1743        }
1744    }
1745
1746    fn connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1747        unsafe extern "C" fn notify_editable_trampoline<P, F: Fn(&P) + 'static>(
1748            this: *mut ffi::ClutterText,
1749            _param_spec: glib_sys::gpointer,
1750            f: glib_sys::gpointer,
1751        ) where
1752            P: IsA<Text>,
1753        {
1754            let f: &F = &*(f as *const F);
1755            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1756        }
1757        unsafe {
1758            let f: Box_<F> = Box_::new(f);
1759            connect_raw(
1760                self.as_ptr() as *mut _,
1761                b"notify::editable\0".as_ptr() as *const _,
1762                Some(transmute::<_, unsafe extern "C" fn()>(
1763                    notify_editable_trampoline::<Self, F> as *const (),
1764                )),
1765                Box_::into_raw(f),
1766            )
1767        }
1768    }
1769
1770    fn connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1771        unsafe extern "C" fn notify_ellipsize_trampoline<P, F: Fn(&P) + 'static>(
1772            this: *mut ffi::ClutterText,
1773            _param_spec: glib_sys::gpointer,
1774            f: glib_sys::gpointer,
1775        ) where
1776            P: IsA<Text>,
1777        {
1778            let f: &F = &*(f as *const F);
1779            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1780        }
1781        unsafe {
1782            let f: Box_<F> = Box_::new(f);
1783            connect_raw(
1784                self.as_ptr() as *mut _,
1785                b"notify::ellipsize\0".as_ptr() as *const _,
1786                Some(transmute::<_, unsafe extern "C" fn()>(
1787                    notify_ellipsize_trampoline::<Self, F> as *const (),
1788                )),
1789                Box_::into_raw(f),
1790            )
1791        }
1792    }
1793
1794    fn connect_property_font_description_notify<F: Fn(&Self) + 'static>(
1795        &self,
1796        f: F,
1797    ) -> SignalHandlerId {
1798        unsafe extern "C" fn notify_font_description_trampoline<P, F: Fn(&P) + 'static>(
1799            this: *mut ffi::ClutterText,
1800            _param_spec: glib_sys::gpointer,
1801            f: glib_sys::gpointer,
1802        ) where
1803            P: IsA<Text>,
1804        {
1805            let f: &F = &*(f as *const F);
1806            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1807        }
1808        unsafe {
1809            let f: Box_<F> = Box_::new(f);
1810            connect_raw(
1811                self.as_ptr() as *mut _,
1812                b"notify::font-description\0".as_ptr() as *const _,
1813                Some(transmute::<_, unsafe extern "C" fn()>(
1814                    notify_font_description_trampoline::<Self, F> as *const (),
1815                )),
1816                Box_::into_raw(f),
1817            )
1818        }
1819    }
1820
1821    fn connect_property_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1822        unsafe extern "C" fn notify_font_name_trampoline<P, F: Fn(&P) + 'static>(
1823            this: *mut ffi::ClutterText,
1824            _param_spec: glib_sys::gpointer,
1825            f: glib_sys::gpointer,
1826        ) where
1827            P: IsA<Text>,
1828        {
1829            let f: &F = &*(f as *const F);
1830            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1831        }
1832        unsafe {
1833            let f: Box_<F> = Box_::new(f);
1834            connect_raw(
1835                self.as_ptr() as *mut _,
1836                b"notify::font-name\0".as_ptr() as *const _,
1837                Some(transmute::<_, unsafe extern "C" fn()>(
1838                    notify_font_name_trampoline::<Self, F> as *const (),
1839                )),
1840                Box_::into_raw(f),
1841            )
1842        }
1843    }
1844
1845    fn connect_property_justify_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1846        unsafe extern "C" fn notify_justify_trampoline<P, F: Fn(&P) + 'static>(
1847            this: *mut ffi::ClutterText,
1848            _param_spec: glib_sys::gpointer,
1849            f: glib_sys::gpointer,
1850        ) where
1851            P: IsA<Text>,
1852        {
1853            let f: &F = &*(f as *const F);
1854            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1855        }
1856        unsafe {
1857            let f: Box_<F> = Box_::new(f);
1858            connect_raw(
1859                self.as_ptr() as *mut _,
1860                b"notify::justify\0".as_ptr() as *const _,
1861                Some(transmute::<_, unsafe extern "C" fn()>(
1862                    notify_justify_trampoline::<Self, F> as *const (),
1863                )),
1864                Box_::into_raw(f),
1865            )
1866        }
1867    }
1868
1869    fn connect_property_line_alignment_notify<F: Fn(&Self) + 'static>(
1870        &self,
1871        f: F,
1872    ) -> SignalHandlerId {
1873        unsafe extern "C" fn notify_line_alignment_trampoline<P, F: Fn(&P) + 'static>(
1874            this: *mut ffi::ClutterText,
1875            _param_spec: glib_sys::gpointer,
1876            f: glib_sys::gpointer,
1877        ) where
1878            P: IsA<Text>,
1879        {
1880            let f: &F = &*(f as *const F);
1881            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1882        }
1883        unsafe {
1884            let f: Box_<F> = Box_::new(f);
1885            connect_raw(
1886                self.as_ptr() as *mut _,
1887                b"notify::line-alignment\0".as_ptr() as *const _,
1888                Some(transmute::<_, unsafe extern "C" fn()>(
1889                    notify_line_alignment_trampoline::<Self, F> as *const (),
1890                )),
1891                Box_::into_raw(f),
1892            )
1893        }
1894    }
1895
1896    fn connect_property_line_wrap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1897        unsafe extern "C" fn notify_line_wrap_trampoline<P, F: Fn(&P) + 'static>(
1898            this: *mut ffi::ClutterText,
1899            _param_spec: glib_sys::gpointer,
1900            f: glib_sys::gpointer,
1901        ) where
1902            P: IsA<Text>,
1903        {
1904            let f: &F = &*(f as *const F);
1905            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1906        }
1907        unsafe {
1908            let f: Box_<F> = Box_::new(f);
1909            connect_raw(
1910                self.as_ptr() as *mut _,
1911                b"notify::line-wrap\0".as_ptr() as *const _,
1912                Some(transmute::<_, unsafe extern "C" fn()>(
1913                    notify_line_wrap_trampoline::<Self, F> as *const (),
1914                )),
1915                Box_::into_raw(f),
1916            )
1917        }
1918    }
1919
1920    fn connect_property_line_wrap_mode_notify<F: Fn(&Self) + 'static>(
1921        &self,
1922        f: F,
1923    ) -> SignalHandlerId {
1924        unsafe extern "C" fn notify_line_wrap_mode_trampoline<P, F: Fn(&P) + 'static>(
1925            this: *mut ffi::ClutterText,
1926            _param_spec: glib_sys::gpointer,
1927            f: glib_sys::gpointer,
1928        ) where
1929            P: IsA<Text>,
1930        {
1931            let f: &F = &*(f as *const F);
1932            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1933        }
1934        unsafe {
1935            let f: Box_<F> = Box_::new(f);
1936            connect_raw(
1937                self.as_ptr() as *mut _,
1938                b"notify::line-wrap-mode\0".as_ptr() as *const _,
1939                Some(transmute::<_, unsafe extern "C" fn()>(
1940                    notify_line_wrap_mode_trampoline::<Self, F> as *const (),
1941                )),
1942                Box_::into_raw(f),
1943            )
1944        }
1945    }
1946
1947    fn connect_property_max_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1948        unsafe extern "C" fn notify_max_length_trampoline<P, F: Fn(&P) + 'static>(
1949            this: *mut ffi::ClutterText,
1950            _param_spec: glib_sys::gpointer,
1951            f: glib_sys::gpointer,
1952        ) where
1953            P: IsA<Text>,
1954        {
1955            let f: &F = &*(f as *const F);
1956            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1957        }
1958        unsafe {
1959            let f: Box_<F> = Box_::new(f);
1960            connect_raw(
1961                self.as_ptr() as *mut _,
1962                b"notify::max-length\0".as_ptr() as *const _,
1963                Some(transmute::<_, unsafe extern "C" fn()>(
1964                    notify_max_length_trampoline::<Self, F> as *const (),
1965                )),
1966                Box_::into_raw(f),
1967            )
1968        }
1969    }
1970
1971    fn connect_property_password_char_notify<F: Fn(&Self) + 'static>(
1972        &self,
1973        f: F,
1974    ) -> SignalHandlerId {
1975        unsafe extern "C" fn notify_password_char_trampoline<P, F: Fn(&P) + 'static>(
1976            this: *mut ffi::ClutterText,
1977            _param_spec: glib_sys::gpointer,
1978            f: glib_sys::gpointer,
1979        ) where
1980            P: IsA<Text>,
1981        {
1982            let f: &F = &*(f as *const F);
1983            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
1984        }
1985        unsafe {
1986            let f: Box_<F> = Box_::new(f);
1987            connect_raw(
1988                self.as_ptr() as *mut _,
1989                b"notify::password-char\0".as_ptr() as *const _,
1990                Some(transmute::<_, unsafe extern "C" fn()>(
1991                    notify_password_char_trampoline::<Self, F> as *const (),
1992                )),
1993                Box_::into_raw(f),
1994            )
1995        }
1996    }
1997
1998    fn connect_property_selectable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1999        unsafe extern "C" fn notify_selectable_trampoline<P, F: Fn(&P) + 'static>(
2000            this: *mut ffi::ClutterText,
2001            _param_spec: glib_sys::gpointer,
2002            f: glib_sys::gpointer,
2003        ) where
2004            P: IsA<Text>,
2005        {
2006            let f: &F = &*(f as *const F);
2007            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2008        }
2009        unsafe {
2010            let f: Box_<F> = Box_::new(f);
2011            connect_raw(
2012                self.as_ptr() as *mut _,
2013                b"notify::selectable\0".as_ptr() as *const _,
2014                Some(transmute::<_, unsafe extern "C" fn()>(
2015                    notify_selectable_trampoline::<Self, F> as *const (),
2016                )),
2017                Box_::into_raw(f),
2018            )
2019        }
2020    }
2021
2022    fn connect_property_selected_text_color_notify<F: Fn(&Self) + 'static>(
2023        &self,
2024        f: F,
2025    ) -> SignalHandlerId {
2026        unsafe extern "C" fn notify_selected_text_color_trampoline<P, F: Fn(&P) + 'static>(
2027            this: *mut ffi::ClutterText,
2028            _param_spec: glib_sys::gpointer,
2029            f: glib_sys::gpointer,
2030        ) where
2031            P: IsA<Text>,
2032        {
2033            let f: &F = &*(f as *const F);
2034            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2035        }
2036        unsafe {
2037            let f: Box_<F> = Box_::new(f);
2038            connect_raw(
2039                self.as_ptr() as *mut _,
2040                b"notify::selected-text-color\0".as_ptr() as *const _,
2041                Some(transmute::<_, unsafe extern "C" fn()>(
2042                    notify_selected_text_color_trampoline::<Self, F> as *const (),
2043                )),
2044                Box_::into_raw(f),
2045            )
2046        }
2047    }
2048
2049    fn connect_property_selected_text_color_set_notify<F: Fn(&Self) + 'static>(
2050        &self,
2051        f: F,
2052    ) -> SignalHandlerId {
2053        unsafe extern "C" fn notify_selected_text_color_set_trampoline<P, F: Fn(&P) + 'static>(
2054            this: *mut ffi::ClutterText,
2055            _param_spec: glib_sys::gpointer,
2056            f: glib_sys::gpointer,
2057        ) where
2058            P: IsA<Text>,
2059        {
2060            let f: &F = &*(f as *const F);
2061            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2062        }
2063        unsafe {
2064            let f: Box_<F> = Box_::new(f);
2065            connect_raw(
2066                self.as_ptr() as *mut _,
2067                b"notify::selected-text-color-set\0".as_ptr() as *const _,
2068                Some(transmute::<_, unsafe extern "C" fn()>(
2069                    notify_selected_text_color_set_trampoline::<Self, F> as *const (),
2070                )),
2071                Box_::into_raw(f),
2072            )
2073        }
2074    }
2075
2076    fn connect_property_selection_bound_notify<F: Fn(&Self) + 'static>(
2077        &self,
2078        f: F,
2079    ) -> SignalHandlerId {
2080        unsafe extern "C" fn notify_selection_bound_trampoline<P, F: Fn(&P) + 'static>(
2081            this: *mut ffi::ClutterText,
2082            _param_spec: glib_sys::gpointer,
2083            f: glib_sys::gpointer,
2084        ) where
2085            P: IsA<Text>,
2086        {
2087            let f: &F = &*(f as *const F);
2088            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2089        }
2090        unsafe {
2091            let f: Box_<F> = Box_::new(f);
2092            connect_raw(
2093                self.as_ptr() as *mut _,
2094                b"notify::selection-bound\0".as_ptr() as *const _,
2095                Some(transmute::<_, unsafe extern "C" fn()>(
2096                    notify_selection_bound_trampoline::<Self, F> as *const (),
2097                )),
2098                Box_::into_raw(f),
2099            )
2100        }
2101    }
2102
2103    fn connect_property_selection_color_notify<F: Fn(&Self) + 'static>(
2104        &self,
2105        f: F,
2106    ) -> SignalHandlerId {
2107        unsafe extern "C" fn notify_selection_color_trampoline<P, F: Fn(&P) + 'static>(
2108            this: *mut ffi::ClutterText,
2109            _param_spec: glib_sys::gpointer,
2110            f: glib_sys::gpointer,
2111        ) where
2112            P: IsA<Text>,
2113        {
2114            let f: &F = &*(f as *const F);
2115            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2116        }
2117        unsafe {
2118            let f: Box_<F> = Box_::new(f);
2119            connect_raw(
2120                self.as_ptr() as *mut _,
2121                b"notify::selection-color\0".as_ptr() as *const _,
2122                Some(transmute::<_, unsafe extern "C" fn()>(
2123                    notify_selection_color_trampoline::<Self, F> as *const (),
2124                )),
2125                Box_::into_raw(f),
2126            )
2127        }
2128    }
2129
2130    fn connect_property_selection_color_set_notify<F: Fn(&Self) + 'static>(
2131        &self,
2132        f: F,
2133    ) -> SignalHandlerId {
2134        unsafe extern "C" fn notify_selection_color_set_trampoline<P, F: Fn(&P) + 'static>(
2135            this: *mut ffi::ClutterText,
2136            _param_spec: glib_sys::gpointer,
2137            f: glib_sys::gpointer,
2138        ) where
2139            P: IsA<Text>,
2140        {
2141            let f: &F = &*(f as *const F);
2142            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2143        }
2144        unsafe {
2145            let f: Box_<F> = Box_::new(f);
2146            connect_raw(
2147                self.as_ptr() as *mut _,
2148                b"notify::selection-color-set\0".as_ptr() as *const _,
2149                Some(transmute::<_, unsafe extern "C" fn()>(
2150                    notify_selection_color_set_trampoline::<Self, F> as *const (),
2151                )),
2152                Box_::into_raw(f),
2153            )
2154        }
2155    }
2156
2157    fn connect_property_single_line_mode_notify<F: Fn(&Self) + 'static>(
2158        &self,
2159        f: F,
2160    ) -> SignalHandlerId {
2161        unsafe extern "C" fn notify_single_line_mode_trampoline<P, F: Fn(&P) + 'static>(
2162            this: *mut ffi::ClutterText,
2163            _param_spec: glib_sys::gpointer,
2164            f: glib_sys::gpointer,
2165        ) where
2166            P: IsA<Text>,
2167        {
2168            let f: &F = &*(f as *const F);
2169            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2170        }
2171        unsafe {
2172            let f: Box_<F> = Box_::new(f);
2173            connect_raw(
2174                self.as_ptr() as *mut _,
2175                b"notify::single-line-mode\0".as_ptr() as *const _,
2176                Some(transmute::<_, unsafe extern "C" fn()>(
2177                    notify_single_line_mode_trampoline::<Self, F> as *const (),
2178                )),
2179                Box_::into_raw(f),
2180            )
2181        }
2182    }
2183
2184    fn connect_property_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2185        unsafe extern "C" fn notify_text_trampoline<P, F: Fn(&P) + 'static>(
2186            this: *mut ffi::ClutterText,
2187            _param_spec: glib_sys::gpointer,
2188            f: glib_sys::gpointer,
2189        ) where
2190            P: IsA<Text>,
2191        {
2192            let f: &F = &*(f as *const F);
2193            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2194        }
2195        unsafe {
2196            let f: Box_<F> = Box_::new(f);
2197            connect_raw(
2198                self.as_ptr() as *mut _,
2199                b"notify::text\0".as_ptr() as *const _,
2200                Some(transmute::<_, unsafe extern "C" fn()>(
2201                    notify_text_trampoline::<Self, F> as *const (),
2202                )),
2203                Box_::into_raw(f),
2204            )
2205        }
2206    }
2207
2208    fn connect_property_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2209        unsafe extern "C" fn notify_use_markup_trampoline<P, F: Fn(&P) + 'static>(
2210            this: *mut ffi::ClutterText,
2211            _param_spec: glib_sys::gpointer,
2212            f: glib_sys::gpointer,
2213        ) where
2214            P: IsA<Text>,
2215        {
2216            let f: &F = &*(f as *const F);
2217            f(&Text::from_glib_borrow(this).unsafe_cast_ref())
2218        }
2219        unsafe {
2220            let f: Box_<F> = Box_::new(f);
2221            connect_raw(
2222                self.as_ptr() as *mut _,
2223                b"notify::use-markup\0".as_ptr() as *const _,
2224                Some(transmute::<_, unsafe extern "C" fn()>(
2225                    notify_use_markup_trampoline::<Self, F> as *const (),
2226                )),
2227                Box_::into_raw(f),
2228            )
2229        }
2230    }
2231}
2232
2233impl fmt::Display for Text {
2234    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2235        write!(f, "Text")
2236    }
2237}