gtk/auto/cell_editable.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{Buildable, Widget, ffi};
6use glib::{
7 object::ObjectType as _,
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 /// The [`CellEditable`][crate::CellEditable] interface must be implemented for widgets to be usable
16 /// to edit the contents of a [`TreeView`][crate::TreeView] cell. It provides a way to specify how
17 /// temporary widgets should be configured for editing, get the new value, etc.
18 ///
19 /// ## Properties
20 ///
21 ///
22 /// #### `editing-canceled`
23 /// Indicates whether editing on the cell has been canceled.
24 ///
25 /// Readable | Writable
26 /// <details><summary><h4>Widget</h4></summary>
27 ///
28 ///
29 /// #### `app-paintable`
30 /// Readable | Writable
31 ///
32 ///
33 /// #### `can-default`
34 /// Readable | Writable
35 ///
36 ///
37 /// #### `can-focus`
38 /// Readable | Writable
39 ///
40 ///
41 /// #### `composite-child`
42 /// Readable
43 ///
44 ///
45 /// #### `double-buffered`
46 /// Whether the widget is double buffered.
47 ///
48 /// Readable | Writable
49 ///
50 ///
51 /// #### `events`
52 /// Readable | Writable
53 ///
54 ///
55 /// #### `expand`
56 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
57 ///
58 /// Readable | Writable
59 ///
60 ///
61 /// #### `focus-on-click`
62 /// Whether the widget should grab focus when it is clicked with the mouse.
63 ///
64 /// This property is only relevant for widgets that can take focus.
65 ///
66 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
67 /// GtkComboBox) implemented this property individually.
68 ///
69 /// Readable | Writable
70 ///
71 ///
72 /// #### `halign`
73 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
74 ///
75 /// Readable | Writable
76 ///
77 ///
78 /// #### `has-default`
79 /// Readable | Writable
80 ///
81 ///
82 /// #### `has-focus`
83 /// Readable | Writable
84 ///
85 ///
86 /// #### `has-tooltip`
87 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
88 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
89 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
90 /// whether it will provide a tooltip or not.
91 ///
92 /// Note that setting this property to [`true`] for the first time will change
93 /// the event masks of the GdkWindows of this widget to include leave-notify
94 /// and motion-notify events. This cannot and will not be undone when the
95 /// property is set to [`false`] again.
96 ///
97 /// Readable | Writable
98 ///
99 ///
100 /// #### `height-request`
101 /// Readable | Writable
102 ///
103 ///
104 /// #### `hexpand`
105 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
106 ///
107 /// Readable | Writable
108 ///
109 ///
110 /// #### `hexpand-set`
111 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
112 ///
113 /// Readable | Writable
114 ///
115 ///
116 /// #### `is-focus`
117 /// Readable | Writable
118 ///
119 ///
120 /// #### `margin`
121 /// Sets all four sides' margin at once. If read, returns max
122 /// margin on any side.
123 ///
124 /// Readable | Writable
125 ///
126 ///
127 /// #### `margin-bottom`
128 /// Margin on bottom side of widget.
129 ///
130 /// This property adds margin outside of the widget's normal size
131 /// request, the margin will be added in addition to the size from
132 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
133 ///
134 /// Readable | Writable
135 ///
136 ///
137 /// #### `margin-end`
138 /// Margin on end of widget, horizontally. This property supports
139 /// left-to-right and right-to-left text directions.
140 ///
141 /// This property adds margin outside of the widget's normal size
142 /// request, the margin will be added in addition to the size from
143 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
144 ///
145 /// Readable | Writable
146 ///
147 ///
148 /// #### `margin-left`
149 /// Margin on left side of widget.
150 ///
151 /// This property adds margin outside of the widget's normal size
152 /// request, the margin will be added in addition to the size from
153 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
154 ///
155 /// Readable | Writable
156 ///
157 ///
158 /// #### `margin-right`
159 /// Margin on right side of widget.
160 ///
161 /// This property adds margin outside of the widget's normal size
162 /// request, the margin will be added in addition to the size from
163 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
164 ///
165 /// Readable | Writable
166 ///
167 ///
168 /// #### `margin-start`
169 /// Margin on start of widget, horizontally. This property supports
170 /// left-to-right and right-to-left text directions.
171 ///
172 /// This property adds margin outside of the widget's normal size
173 /// request, the margin will be added in addition to the size from
174 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
175 ///
176 /// Readable | Writable
177 ///
178 ///
179 /// #### `margin-top`
180 /// Margin on top side of widget.
181 ///
182 /// This property adds margin outside of the widget's normal size
183 /// request, the margin will be added in addition to the size from
184 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
185 ///
186 /// Readable | Writable
187 ///
188 ///
189 /// #### `name`
190 /// Readable | Writable
191 ///
192 ///
193 /// #### `no-show-all`
194 /// Readable | Writable
195 ///
196 ///
197 /// #### `opacity`
198 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
199 /// more details about window opacity.
200 ///
201 /// Before 3.8 this was only available in GtkWindow
202 ///
203 /// Readable | Writable
204 ///
205 ///
206 /// #### `parent`
207 /// Readable | Writable
208 ///
209 ///
210 /// #### `receives-default`
211 /// Readable | Writable
212 ///
213 ///
214 /// #### `scale-factor`
215 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
216 /// more details about widget scaling.
217 ///
218 /// Readable
219 ///
220 ///
221 /// #### `sensitive`
222 /// Readable | Writable
223 ///
224 ///
225 /// #### `style`
226 /// The style of the widget, which contains information about how it will look (colors, etc).
227 ///
228 /// Readable | Writable
229 ///
230 ///
231 /// #### `tooltip-markup`
232 /// Sets the text of tooltip to be the given string, which is marked up
233 /// with the [Pango text markup language][PangoMarkupFormat].
234 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
235 ///
236 /// This is a convenience property which will take care of getting the
237 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
238 /// will automatically be set to [`true`] and there will be taken care of
239 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
240 ///
241 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
242 /// are set, the last one wins.
243 ///
244 /// Readable | Writable
245 ///
246 ///
247 /// #### `tooltip-text`
248 /// Sets the text of tooltip to be the given string.
249 ///
250 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
251 ///
252 /// This is a convenience property which will take care of getting the
253 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
254 /// will automatically be set to [`true`] and there will be taken care of
255 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
256 ///
257 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
258 /// are set, the last one wins.
259 ///
260 /// Readable | Writable
261 ///
262 ///
263 /// #### `valign`
264 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
265 ///
266 /// Readable | Writable
267 ///
268 ///
269 /// #### `vexpand`
270 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
271 ///
272 /// Readable | Writable
273 ///
274 ///
275 /// #### `vexpand-set`
276 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
277 ///
278 /// Readable | Writable
279 ///
280 ///
281 /// #### `visible`
282 /// Readable | Writable
283 ///
284 ///
285 /// #### `width-request`
286 /// Readable | Writable
287 ///
288 ///
289 /// #### `window`
290 /// The widget's window if it is realized, [`None`] otherwise.
291 ///
292 /// Readable
293 /// </details>
294 ///
295 /// ## Signals
296 ///
297 ///
298 /// #### `editing-done`
299 /// This signal is a sign for the cell renderer to update its
300 /// value from the `cell_editable`.
301 ///
302 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
303 /// emitting this signal when they are done editing, e.g.
304 /// [`Entry`][crate::Entry] emits this signal when the user presses Enter. Typical things to
305 /// do in a handler for ::editing-done are to capture the edited value,
306 /// disconnect the `cell_editable` from signals on the [`CellRenderer`][crate::CellRenderer], etc.
307 ///
308 /// [`CellEditableExt::editing_done()`][crate::prelude::CellEditableExt::editing_done()] is a convenience method
309 /// for emitting [`editing-done`][struct@crate::CellEditable#editing-done].
310 ///
311 ///
312 ///
313 ///
314 /// #### `remove-widget`
315 /// This signal is meant to indicate that the cell is finished
316 /// editing, and the `cell_editable` widget is being removed and may
317 /// subsequently be destroyed.
318 ///
319 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
320 /// emitting this signal when they are done editing. It must
321 /// be emitted after the [`editing-done`][struct@crate::CellEditable#editing-done] signal,
322 /// to give the cell renderer a chance to update the cell's value
323 /// before the widget is removed.
324 ///
325 /// [`CellEditableExt::remove_widget()`][crate::prelude::CellEditableExt::remove_widget()] is a convenience method
326 /// for emitting [`remove-widget`][struct@crate::CellEditable#remove-widget].
327 ///
328 ///
329 /// <details><summary><h4>Widget</h4></summary>
330 ///
331 ///
332 /// #### `accel-closures-changed`
333 ///
334 ///
335 ///
336 /// #### `button-press-event`
337 /// The ::button-press-event signal will be emitted when a button
338 /// (typically from a mouse) is pressed.
339 ///
340 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
341 /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
342 ///
343 /// This signal will be sent to the grab widget if there is one.
344 ///
345 ///
346 ///
347 ///
348 /// #### `button-release-event`
349 /// The ::button-release-event signal will be emitted when a button
350 /// (typically from a mouse) is released.
351 ///
352 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
353 /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
354 ///
355 /// This signal will be sent to the grab widget if there is one.
356 ///
357 ///
358 ///
359 ///
360 /// #### `can-activate-accel`
361 /// Determines whether an accelerator that activates the signal
362 /// identified by `signal_id` can currently be activated.
363 /// This signal is present to allow applications and derived
364 /// widgets to override the default [`Widget`][crate::Widget] handling
365 /// for determining whether an accelerator can be activated.
366 ///
367 ///
368 ///
369 ///
370 /// #### `child-notify`
371 /// The ::child-notify signal is emitted for each
372 /// [child property][child-properties] that has
373 /// changed on an object. The signal's detail holds the property name.
374 ///
375 /// Detailed
376 ///
377 ///
378 /// #### `composited-changed`
379 /// The ::composited-changed signal is emitted when the composited
380 /// status of `widgets` screen changes.
381 /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
382 ///
383 /// Action
384 ///
385 ///
386 /// #### `configure-event`
387 /// The ::configure-event signal will be emitted when the size, position or
388 /// stacking of the `widget`'s window has changed.
389 ///
390 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
391 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
392 /// automatically for all new windows.
393 ///
394 ///
395 ///
396 ///
397 /// #### `damage-event`
398 /// Emitted when a redirected window belonging to `widget` gets drawn into.
399 /// The region/area members of the event shows what area of the redirected
400 /// drawable was drawn into.
401 ///
402 ///
403 ///
404 ///
405 /// #### `delete-event`
406 /// The ::delete-event signal is emitted if a user requests that
407 /// a toplevel window is closed. The default handler for this signal
408 /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
409 /// this signal will cause the window to be hidden instead, so that
410 /// it can later be shown again without reconstructing it.
411 ///
412 ///
413 ///
414 ///
415 /// #### `destroy`
416 /// Signals that all holders of a reference to the widget should release
417 /// the reference that they hold. May result in finalization of the widget
418 /// if all references are released.
419 ///
420 /// This signal is not suitable for saving widget state.
421 ///
422 ///
423 ///
424 ///
425 /// #### `destroy-event`
426 /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
427 /// You rarely get this signal, because most widgets disconnect themselves
428 /// from their window before they destroy it, so no widget owns the
429 /// window at destroy time.
430 ///
431 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
432 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
433 /// automatically for all new windows.
434 ///
435 ///
436 ///
437 ///
438 /// #### `direction-changed`
439 /// The ::direction-changed signal is emitted when the text direction
440 /// of a widget changes.
441 ///
442 ///
443 ///
444 ///
445 /// #### `drag-begin`
446 /// The ::drag-begin signal is emitted on the drag source when a drag is
447 /// started. A typical reason to connect to this signal is to set up a
448 /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
449 ///
450 /// Note that some widgets set up a drag icon in the default handler of
451 /// this signal, so you may have to use `g_signal_connect_after()` to
452 /// override what the default handler did.
453 ///
454 ///
455 ///
456 ///
457 /// #### `drag-data-delete`
458 /// The ::drag-data-delete signal is emitted on the drag source when a drag
459 /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
460 /// handler is responsible for deleting the data that has been dropped. What
461 /// "delete" means depends on the context of the drag operation.
462 ///
463 ///
464 ///
465 ///
466 /// #### `drag-data-get`
467 /// The ::drag-data-get signal is emitted on the drag source when the drop
468 /// site requests the data which is dragged. It is the responsibility of
469 /// the signal handler to fill `data` with the data in the format which
470 /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
471 /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
472 ///
473 ///
474 ///
475 ///
476 /// #### `drag-data-received`
477 /// The ::drag-data-received signal is emitted on the drop site when the
478 /// dragged data has been received. If the data was received in order to
479 /// determine whether the drop will be accepted, the handler is expected
480 /// to call `gdk_drag_status()` and not finish the drag.
481 /// If the data was received in response to a [`drag-drop`][struct@crate::Widget#drag-drop] signal
482 /// (and this is the last target to be received), the handler for this
483 /// signal is expected to process the received data and then call
484 /// `gtk_drag_finish()`, setting the `success` parameter depending on
485 /// whether the data was processed successfully.
486 ///
487 /// Applications must create some means to determine why the signal was emitted
488 /// and therefore whether to call `gdk_drag_status()` or `gtk_drag_finish()`.
489 ///
490 /// The handler may inspect the selected action with
491 /// [`DragContext::selected_action()`][crate::gdk::DragContext::selected_action()] before calling
492 /// `gtk_drag_finish()`, e.g. to implement [`gdk::DragAction::ASK`][crate::gdk::DragAction::ASK] as
493 /// shown in the following example:
494 ///
495 ///
496 /// **⚠️ The following code is in C ⚠️**
497 ///
498 /// ```C
499 /// void
500 /// drag_data_received (GtkWidget *widget,
501 /// GdkDragContext *context,
502 /// gint x,
503 /// gint y,
504 /// GtkSelectionData *data,
505 /// guint info,
506 /// guint time)
507 /// {
508 /// if ((data->length >= 0) && (data->format == 8))
509 /// {
510 /// GdkDragAction action;
511 ///
512 /// // handle data here
513 ///
514 /// action = gdk_drag_context_get_selected_action (context);
515 /// if (action == GDK_ACTION_ASK)
516 /// {
517 /// GtkWidget *dialog;
518 /// gint response;
519 ///
520 /// dialog = gtk_message_dialog_new (NULL,
521 /// GTK_DIALOG_MODAL |
522 /// GTK_DIALOG_DESTROY_WITH_PARENT,
523 /// GTK_MESSAGE_INFO,
524 /// GTK_BUTTONS_YES_NO,
525 /// "Move the data ?\n");
526 /// response = gtk_dialog_run (GTK_DIALOG (dialog));
527 /// gtk_widget_destroy (dialog);
528 ///
529 /// if (response == GTK_RESPONSE_YES)
530 /// action = GDK_ACTION_MOVE;
531 /// else
532 /// action = GDK_ACTION_COPY;
533 /// }
534 ///
535 /// gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
536 /// }
537 /// else
538 /// gtk_drag_finish (context, FALSE, FALSE, time);
539 /// }
540 /// ```
541 ///
542 ///
543 ///
544 ///
545 /// #### `drag-drop`
546 /// The ::drag-drop signal is emitted on the drop site when the user drops
547 /// the data onto the widget. The signal handler must determine whether
548 /// the cursor position is in a drop zone or not. If it is not in a drop
549 /// zone, it returns [`false`] and no further processing is necessary.
550 /// Otherwise, the handler returns [`true`]. In this case, the handler must
551 /// ensure that `gtk_drag_finish()` is called to let the source know that
552 /// the drop is done. The call to `gtk_drag_finish()` can be done either
553 /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
554 /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
555 /// or more of the supported targets.
556 ///
557 ///
558 ///
559 ///
560 /// #### `drag-end`
561 /// The ::drag-end signal is emitted on the drag source when a drag is
562 /// finished. A typical reason to connect to this signal is to undo
563 /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
564 ///
565 ///
566 ///
567 ///
568 /// #### `drag-failed`
569 /// The ::drag-failed signal is emitted on the drag source when a drag has
570 /// failed. The signal handler may hook custom code to handle a failed DnD
571 /// operation based on the type of error, it returns [`true`] is the failure has
572 /// been already handled (not showing the default "drag operation failed"
573 /// animation), otherwise it returns [`false`].
574 ///
575 ///
576 ///
577 ///
578 /// #### `drag-leave`
579 /// The ::drag-leave signal is emitted on the drop site when the cursor
580 /// leaves the widget. A typical reason to connect to this signal is to
581 /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
582 /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
583 ///
584 ///
585 /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
586 /// ::drag-drop signal, for instance to allow cleaning up of a preview item
587 /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
588 ///
589 ///
590 ///
591 ///
592 /// #### `drag-motion`
593 /// The ::drag-motion signal is emitted on the drop site when the user
594 /// moves the cursor over the widget during a drag. The signal handler
595 /// must determine whether the cursor position is in a drop zone or not.
596 /// If it is not in a drop zone, it returns [`false`] and no further processing
597 /// is necessary. Otherwise, the handler returns [`true`]. In this case, the
598 /// handler is responsible for providing the necessary information for
599 /// displaying feedback to the user, by calling `gdk_drag_status()`.
600 ///
601 /// If the decision whether the drop will be accepted or rejected can't be
602 /// made based solely on the cursor position and the type of the data, the
603 /// handler may inspect the dragged data by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] and
604 /// defer the `gdk_drag_status()` call to the [`drag-data-received`][struct@crate::Widget#drag-data-received]
605 /// handler. Note that you must pass [`DestDefaults::DROP`][crate::DestDefaults::DROP],
606 /// [`DestDefaults::MOTION`][crate::DestDefaults::MOTION] or [`DestDefaults::ALL`][crate::DestDefaults::ALL] to [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()]
607 /// when using the drag-motion signal that way.
608 ///
609 /// Also note that there is no drag-enter signal. The drag receiver has to
610 /// keep track of whether he has received any drag-motion signals since the
611 /// last [`drag-leave`][struct@crate::Widget#drag-leave] and if not, treat the drag-motion signal as
612 /// an "enter" signal. Upon an "enter", the handler will typically highlight
613 /// the drop site with [`WidgetExt::drag_highlight()`][crate::prelude::WidgetExt::drag_highlight()].
614 ///
615 ///
616 /// **⚠️ The following code is in C ⚠️**
617 ///
618 /// ```C
619 /// static void
620 /// drag_motion (GtkWidget *widget,
621 /// GdkDragContext *context,
622 /// gint x,
623 /// gint y,
624 /// guint time)
625 /// {
626 /// GdkAtom target;
627 ///
628 /// PrivateData *private_data = GET_PRIVATE_DATA (widget);
629 ///
630 /// if (!private_data->drag_highlight)
631 /// {
632 /// private_data->drag_highlight = 1;
633 /// gtk_drag_highlight (widget);
634 /// }
635 ///
636 /// target = gtk_drag_dest_find_target (widget, context, NULL);
637 /// if (target == GDK_NONE)
638 /// gdk_drag_status (context, 0, time);
639 /// else
640 /// {
641 /// private_data->pending_status
642 /// = gdk_drag_context_get_suggested_action (context);
643 /// gtk_drag_get_data (widget, context, target, time);
644 /// }
645 ///
646 /// return TRUE;
647 /// }
648 ///
649 /// static void
650 /// drag_data_received (GtkWidget *widget,
651 /// GdkDragContext *context,
652 /// gint x,
653 /// gint y,
654 /// GtkSelectionData *selection_data,
655 /// guint info,
656 /// guint time)
657 /// {
658 /// PrivateData *private_data = GET_PRIVATE_DATA (widget);
659 ///
660 /// if (private_data->suggested_action)
661 /// {
662 /// private_data->suggested_action = 0;
663 ///
664 /// // We are getting this data due to a request in drag_motion,
665 /// // rather than due to a request in drag_drop, so we are just
666 /// // supposed to call gdk_drag_status(), not actually paste in
667 /// // the data.
668 ///
669 /// str = gtk_selection_data_get_text (selection_data);
670 /// if (!data_is_acceptable (str))
671 /// gdk_drag_status (context, 0, time);
672 /// else
673 /// gdk_drag_status (context,
674 /// private_data->suggested_action,
675 /// time);
676 /// }
677 /// else
678 /// {
679 /// // accept the drop
680 /// }
681 /// }
682 /// ```
683 ///
684 ///
685 ///
686 ///
687 /// #### `draw`
688 /// This signal is emitted when a widget is supposed to render itself.
689 /// The `widget`'s top left corner must be painted at the origin of
690 /// the passed in context and be sized to the values returned by
691 /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
692 /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
693 ///
694 /// Signal handlers connected to this signal can modify the cairo
695 /// context passed as `cr` in any way they like and don't need to
696 /// restore it. The signal emission takes care of calling `cairo_save()`
697 /// before and `cairo_restore()` after invoking the handler.
698 ///
699 /// The signal handler will get a `cr` with a clip region already set to the
700 /// widget's dirty region, i.e. to the area that needs repainting. Complicated
701 /// widgets that want to avoid redrawing themselves completely can get the full
702 /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
703 /// get a finer-grained representation of the dirty region with
704 /// `cairo_copy_clip_rectangle_list()`.
705 ///
706 ///
707 ///
708 ///
709 /// #### `enter-notify-event`
710 /// The ::enter-notify-event will be emitted when the pointer enters
711 /// the `widget`'s window.
712 ///
713 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
714 /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
715 ///
716 /// This signal will be sent to the grab widget if there is one.
717 ///
718 ///
719 ///
720 ///
721 /// #### `event`
722 /// The GTK+ main loop will emit three signals for each GDK event delivered
723 /// to a widget: one generic ::event signal, another, more specific,
724 /// signal that matches the type of event delivered (e.g.
725 /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
726 /// [`event-after`][struct@crate::Widget#event-after] signal.
727 ///
728 ///
729 ///
730 ///
731 /// #### `event-after`
732 /// After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
733 /// the second more specific signal, ::event-after will be emitted
734 /// regardless of the previous two signals handlers return values.
735 ///
736 ///
737 ///
738 ///
739 /// #### `focus`
740 ///
741 ///
742 ///
743 /// #### `focus-in-event`
744 /// The ::focus-in-event signal will be emitted when the keyboard focus
745 /// enters the `widget`'s window.
746 ///
747 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
748 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
749 ///
750 ///
751 ///
752 ///
753 /// #### `focus-out-event`
754 /// The ::focus-out-event signal will be emitted when the keyboard focus
755 /// leaves the `widget`'s window.
756 ///
757 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
758 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
759 ///
760 ///
761 ///
762 ///
763 /// #### `grab-broken-event`
764 /// Emitted when a pointer or keyboard grab on a window belonging
765 /// to `widget` gets broken.
766 ///
767 /// On X11, this happens when the grab window becomes unviewable
768 /// (i.e. it or one of its ancestors is unmapped), or if the same
769 /// application grabs the pointer or keyboard again.
770 ///
771 ///
772 ///
773 ///
774 /// #### `grab-focus`
775 /// Action
776 ///
777 ///
778 /// #### `grab-notify`
779 /// The ::grab-notify signal is emitted when a widget becomes
780 /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
781 /// another widget, or when it becomes unshadowed due to a grab
782 /// being removed.
783 ///
784 /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
785 /// grab widget in the grab stack of its window group is not
786 /// its ancestor.
787 ///
788 ///
789 ///
790 ///
791 /// #### `hide`
792 /// The ::hide signal is emitted when `widget` is hidden, for example with
793 /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
794 ///
795 ///
796 ///
797 ///
798 /// #### `hierarchy-changed`
799 /// The ::hierarchy-changed signal is emitted when the
800 /// anchored state of a widget changes. A widget is
801 /// “anchored” when its toplevel
802 /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
803 /// a widget changes from un-anchored to anchored or vice-versa.
804 ///
805 ///
806 ///
807 ///
808 /// #### `key-press-event`
809 /// The ::key-press-event signal is emitted when a key is pressed. The signal
810 /// emission will reoccur at the key-repeat rate when the key is kept pressed.
811 ///
812 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
813 /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
814 ///
815 /// This signal will be sent to the grab widget if there is one.
816 ///
817 ///
818 ///
819 ///
820 /// #### `key-release-event`
821 /// The ::key-release-event signal is emitted when a key is released.
822 ///
823 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
824 /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
825 ///
826 /// This signal will be sent to the grab widget if there is one.
827 ///
828 ///
829 ///
830 ///
831 /// #### `keynav-failed`
832 /// Gets emitted if keyboard navigation fails.
833 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
834 ///
835 ///
836 ///
837 ///
838 /// #### `leave-notify-event`
839 /// The ::leave-notify-event will be emitted when the pointer leaves
840 /// the `widget`'s window.
841 ///
842 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
843 /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
844 ///
845 /// This signal will be sent to the grab widget if there is one.
846 ///
847 ///
848 ///
849 ///
850 /// #### `map`
851 /// The ::map signal is emitted when `widget` is going to be mapped, that is
852 /// when the widget is visible (which is controlled with
853 /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
854 /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
855 /// be emitted.
856 ///
857 /// The ::map signal can be used to determine whether a widget will be drawn,
858 /// for instance it can resume an animation that was stopped during the
859 /// emission of [`unmap`][struct@crate::Widget#unmap].
860 ///
861 ///
862 ///
863 ///
864 /// #### `map-event`
865 /// The ::map-event signal will be emitted when the `widget`'s window is
866 /// mapped. A window is mapped when it becomes visible on the screen.
867 ///
868 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
869 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
870 /// automatically for all new windows.
871 ///
872 ///
873 ///
874 ///
875 /// #### `mnemonic-activate`
876 /// The default handler for this signal activates `widget` if `group_cycling`
877 /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
878 ///
879 ///
880 ///
881 ///
882 /// #### `motion-notify-event`
883 /// The ::motion-notify-event signal is emitted when the pointer moves
884 /// over the widget's [`gdk::Window`][crate::gdk::Window].
885 ///
886 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
887 /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
888 ///
889 /// This signal will be sent to the grab widget if there is one.
890 ///
891 ///
892 ///
893 ///
894 /// #### `move-focus`
895 /// Action
896 ///
897 ///
898 /// #### `parent-set`
899 /// The ::parent-set signal is emitted when a new parent
900 /// has been set on a widget.
901 ///
902 ///
903 ///
904 ///
905 /// #### `popup-menu`
906 /// This signal gets emitted whenever a widget should pop up a context
907 /// menu. This usually happens through the standard key binding mechanism;
908 /// by pressing a certain key while a widget is focused, the user can cause
909 /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
910 /// a menu with clipboard commands. See the
911 /// [Popup Menu Migration Checklist][checklist-popup-menu]
912 /// for an example of how to use this signal.
913 ///
914 /// Action
915 ///
916 ///
917 /// #### `property-notify-event`
918 /// The ::property-notify-event signal will be emitted when a property on
919 /// the `widget`'s window has been changed or deleted.
920 ///
921 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
922 /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
923 ///
924 ///
925 ///
926 ///
927 /// #### `proximity-in-event`
928 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
929 /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
930 ///
931 /// This signal will be sent to the grab widget if there is one.
932 ///
933 ///
934 ///
935 ///
936 /// #### `proximity-out-event`
937 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
938 /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
939 ///
940 /// This signal will be sent to the grab widget if there is one.
941 ///
942 ///
943 ///
944 ///
945 /// #### `query-tooltip`
946 /// Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
947 /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
948 /// focus in keyboard mode.
949 ///
950 /// Using the given coordinates, the signal handler should determine
951 /// whether a tooltip should be shown for `widget`. If this is the case
952 /// [`true`] should be returned, [`false`] otherwise. Note that if
953 /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
954 /// should not be used.
955 ///
956 /// The signal handler is free to manipulate `tooltip` with the therefore
957 /// destined function calls.
958 ///
959 ///
960 ///
961 ///
962 /// #### `realize`
963 /// The ::realize signal is emitted when `widget` is associated with a
964 /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
965 /// widget has been mapped (that is, it is going to be drawn).
966 ///
967 ///
968 ///
969 ///
970 /// #### `screen-changed`
971 /// The ::screen-changed signal gets emitted when the
972 /// screen of a widget has changed.
973 ///
974 ///
975 ///
976 ///
977 /// #### `scroll-event`
978 /// The ::scroll-event signal is emitted when a button in the 4 to 7
979 /// range is pressed. Wheel mice are usually configured to generate
980 /// button press events for buttons 4 and 5 when the wheel is turned.
981 ///
982 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
983 /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
984 ///
985 /// This signal will be sent to the grab widget if there is one.
986 ///
987 ///
988 ///
989 ///
990 /// #### `selection-clear-event`
991 /// The ::selection-clear-event signal will be emitted when the
992 /// the `widget`'s window has lost ownership of a selection.
993 ///
994 ///
995 ///
996 ///
997 /// #### `selection-get`
998 ///
999 ///
1000 ///
1001 /// #### `selection-notify-event`
1002 ///
1003 ///
1004 ///
1005 /// #### `selection-received`
1006 ///
1007 ///
1008 ///
1009 /// #### `selection-request-event`
1010 /// The ::selection-request-event signal will be emitted when
1011 /// another client requests ownership of the selection owned by
1012 /// the `widget`'s window.
1013 ///
1014 ///
1015 ///
1016 ///
1017 /// #### `show`
1018 /// The ::show signal is emitted when `widget` is shown, for example with
1019 /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
1020 ///
1021 ///
1022 ///
1023 ///
1024 /// #### `show-help`
1025 /// Action
1026 ///
1027 ///
1028 /// #### `size-allocate`
1029 ///
1030 ///
1031 ///
1032 /// #### `state-changed`
1033 /// The ::state-changed signal is emitted when the widget state changes.
1034 /// See `gtk_widget_get_state()`.
1035 ///
1036 ///
1037 ///
1038 ///
1039 /// #### `state-flags-changed`
1040 /// The ::state-flags-changed signal is emitted when the widget state
1041 /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
1042 ///
1043 ///
1044 ///
1045 ///
1046 /// #### `style-set`
1047 /// The ::style-set signal is emitted when a new style has been set
1048 /// on a widget. Note that style-modifying functions like
1049 /// `gtk_widget_modify_base()` also cause this signal to be emitted.
1050 ///
1051 /// Note that this signal is emitted for changes to the deprecated
1052 /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
1053 /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
1054 ///
1055 ///
1056 ///
1057 ///
1058 /// #### `style-updated`
1059 /// The ::style-updated signal is a convenience signal that is emitted when the
1060 /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
1061 /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
1062 ///
1063 /// Note that style-modifying functions like `gtk_widget_override_color()` also
1064 /// cause this signal to be emitted.
1065 ///
1066 ///
1067 ///
1068 ///
1069 /// #### `touch-event`
1070 ///
1071 ///
1072 ///
1073 /// #### `unmap`
1074 /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
1075 /// means that either it or any of its parents up to the toplevel widget have
1076 /// been set as hidden.
1077 ///
1078 /// As ::unmap indicates that a widget will not be shown any longer, it can be
1079 /// used to, for example, stop an animation on the widget.
1080 ///
1081 ///
1082 ///
1083 ///
1084 /// #### `unmap-event`
1085 /// The ::unmap-event signal will be emitted when the `widget`'s window is
1086 /// unmapped. A window is unmapped when it becomes invisible on the screen.
1087 ///
1088 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1089 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1090 /// automatically for all new windows.
1091 ///
1092 ///
1093 ///
1094 ///
1095 /// #### `unrealize`
1096 /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
1097 /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
1098 /// called or the widget has been unmapped (that is, it is going to be
1099 /// hidden).
1100 ///
1101 ///
1102 ///
1103 ///
1104 /// #### `visibility-notify-event`
1105 /// The ::visibility-notify-event will be emitted when the `widget`'s
1106 /// window is obscured or unobscured.
1107 ///
1108 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1109 /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
1110 ///
1111 ///
1112 ///
1113 ///
1114 /// #### `window-state-event`
1115 /// The ::window-state-event will be emitted when the state of the
1116 /// toplevel window associated to the `widget` changes.
1117 ///
1118 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
1119 /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
1120 /// this mask automatically for all new windows.
1121 ///
1122 ///
1123 /// </details>
1124 ///
1125 /// # Implements
1126 ///
1127 /// [`CellEditableExt`][trait@crate::prelude::CellEditableExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
1128 #[doc(alias = "GtkCellEditable")]
1129 pub struct CellEditable(Interface<ffi::GtkCellEditable, ffi::GtkCellEditableIface>) @requires Widget, Buildable;
1130
1131 match fn {
1132 type_ => || ffi::gtk_cell_editable_get_type(),
1133 }
1134}
1135
1136impl CellEditable {
1137 pub const NONE: Option<&'static CellEditable> = None;
1138}
1139
1140/// Trait containing all [`struct@CellEditable`] methods.
1141///
1142/// # Implementors
1143///
1144/// [`AppChooserButton`][struct@crate::AppChooserButton], [`CellEditable`][struct@crate::CellEditable], [`ComboBoxText`][struct@crate::ComboBoxText], [`ComboBox`][struct@crate::ComboBox], [`Entry`][struct@crate::Entry], [`SearchEntry`][struct@crate::SearchEntry], [`SpinButton`][struct@crate::SpinButton]
1145pub trait CellEditableExt: IsA<CellEditable> + 'static {
1146 /// Emits the [`editing-done`][struct@crate::CellEditable#editing-done] signal.
1147 #[doc(alias = "gtk_cell_editable_editing_done")]
1148 fn editing_done(&self) {
1149 unsafe {
1150 ffi::gtk_cell_editable_editing_done(self.as_ref().to_glib_none().0);
1151 }
1152 }
1153
1154 /// Emits the [`remove-widget`][struct@crate::CellEditable#remove-widget] signal.
1155 #[doc(alias = "gtk_cell_editable_remove_widget")]
1156 fn remove_widget(&self) {
1157 unsafe {
1158 ffi::gtk_cell_editable_remove_widget(self.as_ref().to_glib_none().0);
1159 }
1160 }
1161
1162 /// Begins editing on a `self`.
1163 ///
1164 /// The [`CellRenderer`][crate::CellRenderer] for the cell creates and returns a [`CellEditable`][crate::CellEditable] from
1165 /// [`CellRendererExt::start_editing()`][crate::prelude::CellRendererExt::start_editing()], configured for the [`CellRenderer`][crate::CellRenderer] type.
1166 ///
1167 /// [`start_editing()`][Self::start_editing()] can then set up `self` suitably for
1168 /// editing a cell, e.g. making the Esc key emit [`editing-done`][struct@crate::CellEditable#editing-done].
1169 ///
1170 /// Note that the `self` is created on-demand for the current edit; its
1171 /// lifetime is temporary and does not persist across other edits and/or cells.
1172 /// ## `event`
1173 /// The `GdkEvent` that began the editing process, or
1174 /// [`None`] if editing was initiated programmatically
1175 #[doc(alias = "gtk_cell_editable_start_editing")]
1176 fn start_editing(&self, event: Option<&gdk::Event>) {
1177 unsafe {
1178 ffi::gtk_cell_editable_start_editing(
1179 self.as_ref().to_glib_none().0,
1180 mut_override(event.to_glib_none().0),
1181 );
1182 }
1183 }
1184
1185 /// Indicates whether editing on the cell has been canceled.
1186 #[doc(alias = "editing-canceled")]
1187 fn is_editing_canceled(&self) -> bool {
1188 ObjectExt::property(self.as_ref(), "editing-canceled")
1189 }
1190
1191 /// Indicates whether editing on the cell has been canceled.
1192 #[doc(alias = "editing-canceled")]
1193 fn set_editing_canceled(&self, editing_canceled: bool) {
1194 ObjectExt::set_property(self.as_ref(), "editing-canceled", editing_canceled)
1195 }
1196
1197 /// This signal is a sign for the cell renderer to update its
1198 /// value from the `cell_editable`.
1199 ///
1200 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
1201 /// emitting this signal when they are done editing, e.g.
1202 /// [`Entry`][crate::Entry] emits this signal when the user presses Enter. Typical things to
1203 /// do in a handler for ::editing-done are to capture the edited value,
1204 /// disconnect the `cell_editable` from signals on the [`CellRenderer`][crate::CellRenderer], etc.
1205 ///
1206 /// [`editing_done()`][Self::editing_done()] is a convenience method
1207 /// for emitting [`editing-done`][struct@crate::CellEditable#editing-done].
1208 #[doc(alias = "editing-done")]
1209 fn connect_editing_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1210 unsafe extern "C" fn editing_done_trampoline<P: IsA<CellEditable>, F: Fn(&P) + 'static>(
1211 this: *mut ffi::GtkCellEditable,
1212 f: glib::ffi::gpointer,
1213 ) {
1214 unsafe {
1215 let f: &F = &*(f as *const F);
1216 f(CellEditable::from_glib_borrow(this).unsafe_cast_ref())
1217 }
1218 }
1219 unsafe {
1220 let f: Box_<F> = Box_::new(f);
1221 connect_raw(
1222 self.as_ptr() as *mut _,
1223 c"editing-done".as_ptr(),
1224 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1225 editing_done_trampoline::<Self, F> as *const (),
1226 )),
1227 Box_::into_raw(f),
1228 )
1229 }
1230 }
1231
1232 /// This signal is meant to indicate that the cell is finished
1233 /// editing, and the `cell_editable` widget is being removed and may
1234 /// subsequently be destroyed.
1235 ///
1236 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
1237 /// emitting this signal when they are done editing. It must
1238 /// be emitted after the [`editing-done`][struct@crate::CellEditable#editing-done] signal,
1239 /// to give the cell renderer a chance to update the cell's value
1240 /// before the widget is removed.
1241 ///
1242 /// [`remove_widget()`][Self::remove_widget()] is a convenience method
1243 /// for emitting [`remove-widget`][struct@crate::CellEditable#remove-widget].
1244 #[doc(alias = "remove-widget")]
1245 fn connect_remove_widget<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1246 unsafe extern "C" fn remove_widget_trampoline<P: IsA<CellEditable>, F: Fn(&P) + 'static>(
1247 this: *mut ffi::GtkCellEditable,
1248 f: glib::ffi::gpointer,
1249 ) {
1250 unsafe {
1251 let f: &F = &*(f as *const F);
1252 f(CellEditable::from_glib_borrow(this).unsafe_cast_ref())
1253 }
1254 }
1255 unsafe {
1256 let f: Box_<F> = Box_::new(f);
1257 connect_raw(
1258 self.as_ptr() as *mut _,
1259 c"remove-widget".as_ptr(),
1260 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1261 remove_widget_trampoline::<Self, F> as *const (),
1262 )),
1263 Box_::into_raw(f),
1264 )
1265 }
1266 }
1267
1268 #[doc(alias = "editing-canceled")]
1269 fn connect_editing_canceled_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1270 unsafe extern "C" fn notify_editing_canceled_trampoline<
1271 P: IsA<CellEditable>,
1272 F: Fn(&P) + 'static,
1273 >(
1274 this: *mut ffi::GtkCellEditable,
1275 _param_spec: glib::ffi::gpointer,
1276 f: glib::ffi::gpointer,
1277 ) {
1278 unsafe {
1279 let f: &F = &*(f as *const F);
1280 f(CellEditable::from_glib_borrow(this).unsafe_cast_ref())
1281 }
1282 }
1283 unsafe {
1284 let f: Box_<F> = Box_::new(f);
1285 connect_raw(
1286 self.as_ptr() as *mut _,
1287 c"notify::editing-canceled".as_ptr(),
1288 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1289 notify_editing_canceled_trampoline::<Self, F> as *const (),
1290 )),
1291 Box_::into_raw(f),
1292 )
1293 }
1294 }
1295}
1296
1297impl<O: IsA<CellEditable>> CellEditableExt for O {}