clutter/auto/
text.rs

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