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