atk/auto/table.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::{Object, 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 ATK interface implemented for UI components which contain tabular or row/column information.
16 ///
17 /// [`Table`][crate::Table] should be implemented by components which present
18 /// elements ordered via rows and columns. It may also be used to
19 /// present tree-structured information if the nodes of the trees can
20 /// be said to contain multiple "columns". Individual elements of an
21 /// [`Table`][crate::Table] are typically referred to as "cells". Those cells should
22 /// implement the interface [`TableCell`][crate::TableCell], but `Atk` doesn't require
23 /// them to be direct children of the current [`Table`][crate::Table]. They can be
24 /// grand-children, grand-grand-children etc. [`Table`][crate::Table] provides the
25 /// API needed to get a individual cell based on the row and column
26 /// numbers.
27 ///
28 /// Children of [`Table`][crate::Table] are frequently "lightweight" objects, that
29 /// is, they may not have backing widgets in the host UI toolkit. They
30 /// are therefore often transient.
31 ///
32 /// Since tables are often very complex, [`Table`][crate::Table] includes provision
33 /// for offering simplified summary information, as well as row and
34 /// column headers and captions. Headers and captions are `AtkObjects`
35 /// which may implement other interfaces ([`Text`][crate::Text], [`Image`][crate::Image], etc.) as
36 /// appropriate. [`Table`][crate::Table] summaries may themselves be (simplified)
37 /// `AtkTables`, etc.
38 ///
39 /// Note for implementors: in the past, [`Table`][crate::Table] required that all the
40 /// cells should be direct children of [`Table`][crate::Table], and provided some
41 /// index based methods to request the cells. The practice showed that
42 /// that forcing made [`Table`][crate::Table] implementation complex, and hard to
43 /// expose other kind of children, like rows or captions. Right now,
44 /// index-based methods are deprecated.
45 ///
46 /// ## Signals
47 ///
48 ///
49 /// #### `column-deleted`
50 /// The "column-deleted" signal is emitted by an object which
51 /// implements the AtkTable interface when a column is deleted.
52 ///
53 ///
54 ///
55 ///
56 /// #### `column-inserted`
57 /// The "column-inserted" signal is emitted by an object which
58 /// implements the AtkTable interface when a column is inserted.
59 ///
60 ///
61 ///
62 ///
63 /// #### `column-reordered`
64 /// The "column-reordered" signal is emitted by an object which
65 /// implements the AtkTable interface when the columns are
66 /// reordered.
67 ///
68 ///
69 ///
70 ///
71 /// #### `model-changed`
72 /// The "model-changed" signal is emitted by an object which
73 /// implements the AtkTable interface when the model displayed by
74 /// the table changes.
75 ///
76 ///
77 ///
78 ///
79 /// #### `row-deleted`
80 /// The "row-deleted" signal is emitted by an object which
81 /// implements the AtkTable interface when a row is deleted.
82 ///
83 ///
84 ///
85 ///
86 /// #### `row-inserted`
87 /// The "row-inserted" signal is emitted by an object which
88 /// implements the AtkTable interface when a row is inserted.
89 ///
90 ///
91 ///
92 ///
93 /// #### `row-reordered`
94 /// The "row-reordered" signal is emitted by an object which
95 /// implements the AtkTable interface when the rows are
96 /// reordered.
97 ///
98 ///
99 ///
100 /// # Implements
101 ///
102 /// [`TableExt`][trait@crate::prelude::TableExt], [`TableExtManual`][trait@crate::prelude::TableExtManual]
103 #[doc(alias = "AtkTable")]
104 pub struct Table(Interface<ffi::AtkTable, ffi::AtkTableIface>);
105
106 match fn {
107 type_ => || ffi::atk_table_get_type(),
108 }
109}
110
111impl Table {
112 pub const NONE: Option<&'static Table> = None;
113}
114
115/// Trait containing all [`struct@Table`] methods.
116///
117/// # Implementors
118///
119/// [`NoOpObject`][struct@crate::NoOpObject], [`Table`][struct@crate::Table]
120pub trait TableExt: IsA<Table> + 'static {
121 /// Adds the specified `column` to the selection.
122 /// ## `column`
123 /// a `gint` representing a column in `self`
124 ///
125 /// # Returns
126 ///
127 /// a gboolean representing if the column was successfully added to
128 /// the selection, or 0 if value does not implement this interface.
129 #[doc(alias = "atk_table_add_column_selection")]
130 fn add_column_selection(&self, column: i32) -> bool {
131 unsafe {
132 from_glib(ffi::atk_table_add_column_selection(
133 self.as_ref().to_glib_none().0,
134 column,
135 ))
136 }
137 }
138
139 /// Adds the specified `row` to the selection.
140 /// ## `row`
141 /// a `gint` representing a row in `self`
142 ///
143 /// # Returns
144 ///
145 /// a gboolean representing if row was successfully added to selection,
146 /// or 0 if value does not implement this interface.
147 #[doc(alias = "atk_table_add_row_selection")]
148 fn add_row_selection(&self, row: i32) -> bool {
149 unsafe {
150 from_glib(ffi::atk_table_add_row_selection(
151 self.as_ref().to_glib_none().0,
152 row,
153 ))
154 }
155 }
156
157 /// Gets the caption for the `self`.
158 ///
159 /// # Returns
160 ///
161 /// a AtkObject* representing the
162 /// table caption, or [`None`] if value does not implement this interface.
163 #[doc(alias = "atk_table_get_caption")]
164 #[doc(alias = "get_caption")]
165 fn caption(&self) -> Option<Object> {
166 unsafe { from_glib_none(ffi::atk_table_get_caption(self.as_ref().to_glib_none().0)) }
167 }
168
169 /// Gets a `gint` representing the column at the specified `index_`.
170 ///
171 /// # Deprecated
172 ///
173 /// Since 2.12.
174 /// ## `index_`
175 /// a `gint` representing an index in `self`
176 ///
177 /// # Returns
178 ///
179 /// a gint representing the column at the specified index,
180 /// or -1 if the table does not implement this method.
181 #[doc(alias = "atk_table_get_column_at_index")]
182 #[doc(alias = "get_column_at_index")]
183 fn column_at_index(&self, index_: i32) -> i32 {
184 unsafe { ffi::atk_table_get_column_at_index(self.as_ref().to_glib_none().0, index_) }
185 }
186
187 /// Gets the description text of the specified `column` in the table
188 /// ## `column`
189 /// a `gint` representing a column in `self`
190 ///
191 /// # Returns
192 ///
193 /// a gchar* representing the column description, or [`None`]
194 /// if value does not implement this interface.
195 #[doc(alias = "atk_table_get_column_description")]
196 #[doc(alias = "get_column_description")]
197 fn column_description(&self, column: i32) -> Option<glib::GString> {
198 unsafe {
199 from_glib_none(ffi::atk_table_get_column_description(
200 self.as_ref().to_glib_none().0,
201 column,
202 ))
203 }
204 }
205
206 /// Gets the number of columns occupied by the accessible object
207 /// at the specified `row` and `column` in the `self`.
208 /// ## `row`
209 /// a `gint` representing a row in `self`
210 /// ## `column`
211 /// a `gint` representing a column in `self`
212 ///
213 /// # Returns
214 ///
215 /// a gint representing the column extent at specified position, or 0
216 /// if value does not implement this interface.
217 #[doc(alias = "atk_table_get_column_extent_at")]
218 #[doc(alias = "get_column_extent_at")]
219 fn column_extent_at(&self, row: i32, column: i32) -> i32 {
220 unsafe { ffi::atk_table_get_column_extent_at(self.as_ref().to_glib_none().0, row, column) }
221 }
222
223 /// Gets the column header of a specified column in an accessible table.
224 /// ## `column`
225 /// a `gint` representing a column in the table
226 ///
227 /// # Returns
228 ///
229 /// a AtkObject* representing the
230 /// specified column header, or [`None`] if value does not implement this
231 /// interface.
232 #[doc(alias = "atk_table_get_column_header")]
233 #[doc(alias = "get_column_header")]
234 fn column_header(&self, column: i32) -> Option<Object> {
235 unsafe {
236 from_glib_none(ffi::atk_table_get_column_header(
237 self.as_ref().to_glib_none().0,
238 column,
239 ))
240 }
241 }
242
243 /// Gets a `gint` representing the index at the specified `row` and
244 /// `column`.
245 ///
246 /// # Deprecated
247 ///
248 /// Since 2.12. Use [`ref_at()`][Self::ref_at()] in order to get the
249 /// accessible that represents the cell at (`row`, `column`)
250 /// ## `row`
251 /// a `gint` representing a row in `self`
252 /// ## `column`
253 /// a `gint` representing a column in `self`
254 ///
255 /// # Returns
256 ///
257 /// a `gint` representing the index at specified position.
258 /// The value -1 is returned if the object at row,column is not a child
259 /// of table or table does not implement this interface.
260 #[doc(alias = "atk_table_get_index_at")]
261 #[doc(alias = "get_index_at")]
262 fn index_at(&self, row: i32, column: i32) -> i32 {
263 unsafe { ffi::atk_table_get_index_at(self.as_ref().to_glib_none().0, row, column) }
264 }
265
266 /// Gets the number of columns in the table.
267 ///
268 /// # Returns
269 ///
270 /// a gint representing the number of columns, or 0
271 /// if value does not implement this interface.
272 #[doc(alias = "atk_table_get_n_columns")]
273 #[doc(alias = "get_n_columns")]
274 fn n_columns(&self) -> i32 {
275 unsafe { ffi::atk_table_get_n_columns(self.as_ref().to_glib_none().0) }
276 }
277
278 /// Gets the number of rows in the table.
279 ///
280 /// # Returns
281 ///
282 /// a gint representing the number of rows, or 0
283 /// if value does not implement this interface.
284 #[doc(alias = "atk_table_get_n_rows")]
285 #[doc(alias = "get_n_rows")]
286 fn n_rows(&self) -> i32 {
287 unsafe { ffi::atk_table_get_n_rows(self.as_ref().to_glib_none().0) }
288 }
289
290 /// Gets a `gint` representing the row at the specified `index_`.
291 ///
292 /// # Deprecated
293 ///
294 /// since 2.12.
295 /// ## `index_`
296 /// a `gint` representing an index in `self`
297 ///
298 /// # Returns
299 ///
300 /// a gint representing the row at the specified index,
301 /// or -1 if the table does not implement this method.
302 #[doc(alias = "atk_table_get_row_at_index")]
303 #[doc(alias = "get_row_at_index")]
304 fn row_at_index(&self, index_: i32) -> i32 {
305 unsafe { ffi::atk_table_get_row_at_index(self.as_ref().to_glib_none().0, index_) }
306 }
307
308 /// Gets the description text of the specified row in the table
309 /// ## `row`
310 /// a `gint` representing a row in `self`
311 ///
312 /// # Returns
313 ///
314 /// a gchar* representing the row description, or
315 /// [`None`] if value does not implement this interface.
316 #[doc(alias = "atk_table_get_row_description")]
317 #[doc(alias = "get_row_description")]
318 fn row_description(&self, row: i32) -> Option<glib::GString> {
319 unsafe {
320 from_glib_none(ffi::atk_table_get_row_description(
321 self.as_ref().to_glib_none().0,
322 row,
323 ))
324 }
325 }
326
327 /// Gets the number of rows occupied by the accessible object
328 /// at a specified `row` and `column` in the `self`.
329 /// ## `row`
330 /// a `gint` representing a row in `self`
331 /// ## `column`
332 /// a `gint` representing a column in `self`
333 ///
334 /// # Returns
335 ///
336 /// a gint representing the row extent at specified position, or 0
337 /// if value does not implement this interface.
338 #[doc(alias = "atk_table_get_row_extent_at")]
339 #[doc(alias = "get_row_extent_at")]
340 fn row_extent_at(&self, row: i32, column: i32) -> i32 {
341 unsafe { ffi::atk_table_get_row_extent_at(self.as_ref().to_glib_none().0, row, column) }
342 }
343
344 /// Gets the row header of a specified row in an accessible table.
345 /// ## `row`
346 /// a `gint` representing a row in the table
347 ///
348 /// # Returns
349 ///
350 /// a AtkObject* representing the
351 /// specified row header, or [`None`] if value does not implement this
352 /// interface.
353 #[doc(alias = "atk_table_get_row_header")]
354 #[doc(alias = "get_row_header")]
355 fn row_header(&self, row: i32) -> Option<Object> {
356 unsafe {
357 from_glib_none(ffi::atk_table_get_row_header(
358 self.as_ref().to_glib_none().0,
359 row,
360 ))
361 }
362 }
363
364 /// Gets the summary description of the table.
365 ///
366 /// # Returns
367 ///
368 /// a AtkObject* representing a summary description
369 /// of the table, or zero if value does not implement this interface.
370 #[doc(alias = "atk_table_get_summary")]
371 #[doc(alias = "get_summary")]
372 fn summary(&self) -> Option<Object> {
373 unsafe { from_glib_full(ffi::atk_table_get_summary(self.as_ref().to_glib_none().0)) }
374 }
375
376 /// Gets a boolean value indicating whether the specified `column`
377 /// is selected
378 /// ## `column`
379 /// a `gint` representing a column in `self`
380 ///
381 /// # Returns
382 ///
383 /// a gboolean representing if the column is selected, or 0
384 /// if value does not implement this interface.
385 #[doc(alias = "atk_table_is_column_selected")]
386 fn is_column_selected(&self, column: i32) -> bool {
387 unsafe {
388 from_glib(ffi::atk_table_is_column_selected(
389 self.as_ref().to_glib_none().0,
390 column,
391 ))
392 }
393 }
394
395 /// Gets a boolean value indicating whether the specified `row`
396 /// is selected
397 /// ## `row`
398 /// a `gint` representing a row in `self`
399 ///
400 /// # Returns
401 ///
402 /// a gboolean representing if the row is selected, or 0
403 /// if value does not implement this interface.
404 #[doc(alias = "atk_table_is_row_selected")]
405 fn is_row_selected(&self, row: i32) -> bool {
406 unsafe {
407 from_glib(ffi::atk_table_is_row_selected(
408 self.as_ref().to_glib_none().0,
409 row,
410 ))
411 }
412 }
413
414 /// Gets a boolean value indicating whether the accessible object
415 /// at the specified `row` and `column` is selected
416 /// ## `row`
417 /// a `gint` representing a row in `self`
418 /// ## `column`
419 /// a `gint` representing a column in `self`
420 ///
421 /// # Returns
422 ///
423 /// a gboolean representing if the cell is selected, or 0
424 /// if value does not implement this interface.
425 #[doc(alias = "atk_table_is_selected")]
426 fn is_selected(&self, row: i32, column: i32) -> bool {
427 unsafe {
428 from_glib(ffi::atk_table_is_selected(
429 self.as_ref().to_glib_none().0,
430 row,
431 column,
432 ))
433 }
434 }
435
436 /// Get a reference to the table cell at `row`, `column`. This cell
437 /// should implement the interface [`TableCell`][crate::TableCell]
438 /// ## `row`
439 /// a `gint` representing a row in `self`
440 /// ## `column`
441 /// a `gint` representing a column in `self`
442 ///
443 /// # Returns
444 ///
445 /// an [`Object`][crate::Object] representing the referred
446 /// to accessible
447 #[doc(alias = "atk_table_ref_at")]
448 fn ref_at(&self, row: i32, column: i32) -> Option<Object> {
449 unsafe {
450 from_glib_full(ffi::atk_table_ref_at(
451 self.as_ref().to_glib_none().0,
452 row,
453 column,
454 ))
455 }
456 }
457
458 /// Adds the specified `column` to the selection.
459 /// ## `column`
460 /// a `gint` representing a column in `self`
461 ///
462 /// # Returns
463 ///
464 /// a gboolean representing if the column was successfully removed from
465 /// the selection, or 0 if value does not implement this interface.
466 #[doc(alias = "atk_table_remove_column_selection")]
467 fn remove_column_selection(&self, column: i32) -> bool {
468 unsafe {
469 from_glib(ffi::atk_table_remove_column_selection(
470 self.as_ref().to_glib_none().0,
471 column,
472 ))
473 }
474 }
475
476 /// Removes the specified `row` from the selection.
477 /// ## `row`
478 /// a `gint` representing a row in `self`
479 ///
480 /// # Returns
481 ///
482 /// a gboolean representing if the row was successfully removed from
483 /// the selection, or 0 if value does not implement this interface.
484 #[doc(alias = "atk_table_remove_row_selection")]
485 fn remove_row_selection(&self, row: i32) -> bool {
486 unsafe {
487 from_glib(ffi::atk_table_remove_row_selection(
488 self.as_ref().to_glib_none().0,
489 row,
490 ))
491 }
492 }
493
494 /// Sets the caption for the table.
495 /// ## `caption`
496 /// a [`Object`][crate::Object] representing the caption to set for `self`
497 #[doc(alias = "atk_table_set_caption")]
498 fn set_caption(&self, caption: &impl IsA<Object>) {
499 unsafe {
500 ffi::atk_table_set_caption(
501 self.as_ref().to_glib_none().0,
502 caption.as_ref().to_glib_none().0,
503 );
504 }
505 }
506
507 /// Sets the description text for the specified `column` of the `self`.
508 /// ## `column`
509 /// a `gint` representing a column in `self`
510 /// ## `description`
511 /// a `gchar` representing the description text
512 /// to set for the specified `column` of the `self`
513 #[doc(alias = "atk_table_set_column_description")]
514 fn set_column_description(&self, column: i32, description: &str) {
515 unsafe {
516 ffi::atk_table_set_column_description(
517 self.as_ref().to_glib_none().0,
518 column,
519 description.to_glib_none().0,
520 );
521 }
522 }
523
524 /// Sets the specified column header to `header`.
525 /// ## `column`
526 /// a `gint` representing a column in `self`
527 /// ## `header`
528 /// an [`Table`][crate::Table]
529 #[doc(alias = "atk_table_set_column_header")]
530 fn set_column_header(&self, column: i32, header: &impl IsA<Object>) {
531 unsafe {
532 ffi::atk_table_set_column_header(
533 self.as_ref().to_glib_none().0,
534 column,
535 header.as_ref().to_glib_none().0,
536 );
537 }
538 }
539
540 /// Sets the description text for the specified `row` of `self`.
541 /// ## `row`
542 /// a `gint` representing a row in `self`
543 /// ## `description`
544 /// a `gchar` representing the description text
545 /// to set for the specified `row` of `self`
546 #[doc(alias = "atk_table_set_row_description")]
547 fn set_row_description(&self, row: i32, description: &str) {
548 unsafe {
549 ffi::atk_table_set_row_description(
550 self.as_ref().to_glib_none().0,
551 row,
552 description.to_glib_none().0,
553 );
554 }
555 }
556
557 /// Sets the specified row header to `header`.
558 /// ## `row`
559 /// a `gint` representing a row in `self`
560 /// ## `header`
561 /// an [`Table`][crate::Table]
562 #[doc(alias = "atk_table_set_row_header")]
563 fn set_row_header(&self, row: i32, header: &impl IsA<Object>) {
564 unsafe {
565 ffi::atk_table_set_row_header(
566 self.as_ref().to_glib_none().0,
567 row,
568 header.as_ref().to_glib_none().0,
569 );
570 }
571 }
572
573 /// Sets the summary description of the table.
574 /// ## `accessible`
575 /// an [`Object`][crate::Object] representing the summary description
576 /// to set for `self`
577 #[doc(alias = "atk_table_set_summary")]
578 fn set_summary(&self, accessible: &impl IsA<Object>) {
579 unsafe {
580 ffi::atk_table_set_summary(
581 self.as_ref().to_glib_none().0,
582 accessible.as_ref().to_glib_none().0,
583 );
584 }
585 }
586
587 /// The "column-deleted" signal is emitted by an object which
588 /// implements the AtkTable interface when a column is deleted.
589 /// ## `arg1`
590 /// The index of the first column deleted.
591 /// ## `arg2`
592 /// The number of columns deleted.
593 #[doc(alias = "column-deleted")]
594 fn connect_column_deleted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
595 unsafe extern "C" fn column_deleted_trampoline<
596 P: IsA<Table>,
597 F: Fn(&P, i32, i32) + 'static,
598 >(
599 this: *mut ffi::AtkTable,
600 arg1: std::ffi::c_int,
601 arg2: std::ffi::c_int,
602 f: glib::ffi::gpointer,
603 ) {
604 unsafe {
605 let f: &F = &*(f as *const F);
606 f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
607 }
608 }
609 unsafe {
610 let f: Box_<F> = Box_::new(f);
611 connect_raw(
612 self.as_ptr() as *mut _,
613 c"column-deleted".as_ptr(),
614 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
615 column_deleted_trampoline::<Self, F> as *const (),
616 )),
617 Box_::into_raw(f),
618 )
619 }
620 }
621
622 /// The "column-inserted" signal is emitted by an object which
623 /// implements the AtkTable interface when a column is inserted.
624 /// ## `arg1`
625 /// The index of the column inserted.
626 /// ## `arg2`
627 /// The number of colums inserted.
628 #[doc(alias = "column-inserted")]
629 fn connect_column_inserted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
630 unsafe extern "C" fn column_inserted_trampoline<
631 P: IsA<Table>,
632 F: Fn(&P, i32, i32) + 'static,
633 >(
634 this: *mut ffi::AtkTable,
635 arg1: std::ffi::c_int,
636 arg2: std::ffi::c_int,
637 f: glib::ffi::gpointer,
638 ) {
639 unsafe {
640 let f: &F = &*(f as *const F);
641 f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
642 }
643 }
644 unsafe {
645 let f: Box_<F> = Box_::new(f);
646 connect_raw(
647 self.as_ptr() as *mut _,
648 c"column-inserted".as_ptr(),
649 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
650 column_inserted_trampoline::<Self, F> as *const (),
651 )),
652 Box_::into_raw(f),
653 )
654 }
655 }
656
657 /// The "column-reordered" signal is emitted by an object which
658 /// implements the AtkTable interface when the columns are
659 /// reordered.
660 #[doc(alias = "column-reordered")]
661 fn connect_column_reordered<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
662 unsafe extern "C" fn column_reordered_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
663 this: *mut ffi::AtkTable,
664 f: glib::ffi::gpointer,
665 ) {
666 unsafe {
667 let f: &F = &*(f as *const F);
668 f(Table::from_glib_borrow(this).unsafe_cast_ref())
669 }
670 }
671 unsafe {
672 let f: Box_<F> = Box_::new(f);
673 connect_raw(
674 self.as_ptr() as *mut _,
675 c"column-reordered".as_ptr(),
676 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
677 column_reordered_trampoline::<Self, F> as *const (),
678 )),
679 Box_::into_raw(f),
680 )
681 }
682 }
683
684 /// The "model-changed" signal is emitted by an object which
685 /// implements the AtkTable interface when the model displayed by
686 /// the table changes.
687 #[doc(alias = "model-changed")]
688 fn connect_model_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
689 unsafe extern "C" fn model_changed_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
690 this: *mut ffi::AtkTable,
691 f: glib::ffi::gpointer,
692 ) {
693 unsafe {
694 let f: &F = &*(f as *const F);
695 f(Table::from_glib_borrow(this).unsafe_cast_ref())
696 }
697 }
698 unsafe {
699 let f: Box_<F> = Box_::new(f);
700 connect_raw(
701 self.as_ptr() as *mut _,
702 c"model-changed".as_ptr(),
703 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
704 model_changed_trampoline::<Self, F> as *const (),
705 )),
706 Box_::into_raw(f),
707 )
708 }
709 }
710
711 /// The "row-deleted" signal is emitted by an object which
712 /// implements the AtkTable interface when a row is deleted.
713 /// ## `arg1`
714 /// The index of the first row deleted.
715 /// ## `arg2`
716 /// The number of rows deleted.
717 #[doc(alias = "row-deleted")]
718 fn connect_row_deleted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
719 unsafe extern "C" fn row_deleted_trampoline<
720 P: IsA<Table>,
721 F: Fn(&P, i32, i32) + 'static,
722 >(
723 this: *mut ffi::AtkTable,
724 arg1: std::ffi::c_int,
725 arg2: std::ffi::c_int,
726 f: glib::ffi::gpointer,
727 ) {
728 unsafe {
729 let f: &F = &*(f as *const F);
730 f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
731 }
732 }
733 unsafe {
734 let f: Box_<F> = Box_::new(f);
735 connect_raw(
736 self.as_ptr() as *mut _,
737 c"row-deleted".as_ptr(),
738 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
739 row_deleted_trampoline::<Self, F> as *const (),
740 )),
741 Box_::into_raw(f),
742 )
743 }
744 }
745
746 /// The "row-inserted" signal is emitted by an object which
747 /// implements the AtkTable interface when a row is inserted.
748 /// ## `arg1`
749 /// The index of the first row inserted.
750 /// ## `arg2`
751 /// The number of rows inserted.
752 #[doc(alias = "row-inserted")]
753 fn connect_row_inserted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
754 unsafe extern "C" fn row_inserted_trampoline<
755 P: IsA<Table>,
756 F: Fn(&P, i32, i32) + 'static,
757 >(
758 this: *mut ffi::AtkTable,
759 arg1: std::ffi::c_int,
760 arg2: std::ffi::c_int,
761 f: glib::ffi::gpointer,
762 ) {
763 unsafe {
764 let f: &F = &*(f as *const F);
765 f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
766 }
767 }
768 unsafe {
769 let f: Box_<F> = Box_::new(f);
770 connect_raw(
771 self.as_ptr() as *mut _,
772 c"row-inserted".as_ptr(),
773 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
774 row_inserted_trampoline::<Self, F> as *const (),
775 )),
776 Box_::into_raw(f),
777 )
778 }
779 }
780
781 /// The "row-reordered" signal is emitted by an object which
782 /// implements the AtkTable interface when the rows are
783 /// reordered.
784 #[doc(alias = "row-reordered")]
785 fn connect_row_reordered<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
786 unsafe extern "C" fn row_reordered_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
787 this: *mut ffi::AtkTable,
788 f: glib::ffi::gpointer,
789 ) {
790 unsafe {
791 let f: &F = &*(f as *const F);
792 f(Table::from_glib_borrow(this).unsafe_cast_ref())
793 }
794 }
795 unsafe {
796 let f: Box_<F> = Box_::new(f);
797 connect_raw(
798 self.as_ptr() as *mut _,
799 c"row-reordered".as_ptr(),
800 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
801 row_reordered_trampoline::<Self, F> as *const (),
802 )),
803 Box_::into_raw(f),
804 )
805 }
806 }
807}
808
809impl<O: IsA<Table>> TableExt for O {}