1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from 3 // from gir-files (https://github.com/gtk-rs/gir-files.git) 4 // DO NOT EDIT 5 6 use glib::object::Cast; 7 use glib::object::IsA; 8 use glib::signal::connect_raw; 9 use glib::signal::SignalHandlerId; 10 use glib::translate::*; 11 use glib::StaticType; 12 use glib::ToValue; 13 use std::boxed::Box as Box_; 14 use std::fmt; 15 use std::mem::transmute; 16 17 glib::wrapper! { 18 #[doc(alias = "HdyKeypad")] 19 pub struct Keypad(Object<ffi::HdyKeypad, ffi::HdyKeypadClass>) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; 20 21 match fn { 22 type_ => || ffi::hdy_keypad_get_type(), 23 } 24 } 25 26 impl Keypad { 27 #[doc(alias = "hdy_keypad_new")] new(symbols_visible: bool, letters_visible: bool) -> Keypad28 pub fn new(symbols_visible: bool, letters_visible: bool) -> Keypad { 29 assert_initialized_main_thread!(); 30 unsafe { 31 gtk::Widget::from_glib_none(ffi::hdy_keypad_new( 32 symbols_visible.into_glib(), 33 letters_visible.into_glib(), 34 )) 35 .unsafe_cast() 36 } 37 } 38 39 // rustdoc-stripper-ignore-next 40 /// Creates a new builder-pattern struct instance to construct [`Keypad`] objects. 41 /// 42 /// This method returns an instance of [`KeypadBuilder`] which can be used to create [`Keypad`] objects. builder() -> KeypadBuilder43 pub fn builder() -> KeypadBuilder { 44 KeypadBuilder::default() 45 } 46 } 47 48 #[derive(Clone, Default)] 49 // rustdoc-stripper-ignore-next 50 /// A [builder-pattern] type to construct [`Keypad`] objects. 51 /// 52 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 53 pub struct KeypadBuilder { 54 column_spacing: Option<u32>, 55 end_action: Option<gtk::Widget>, 56 entry: Option<gtk::Entry>, 57 letters_visible: Option<bool>, 58 row_spacing: Option<u32>, 59 start_action: Option<gtk::Widget>, 60 symbols_visible: Option<bool>, 61 border_width: Option<u32>, 62 child: Option<gtk::Widget>, 63 resize_mode: Option<gtk::ResizeMode>, 64 app_paintable: Option<bool>, 65 can_default: Option<bool>, 66 can_focus: Option<bool>, 67 double_buffered: Option<bool>, 68 events: Option<gdk::EventMask>, 69 expand: Option<bool>, 70 focus_on_click: Option<bool>, 71 halign: Option<gtk::Align>, 72 has_default: Option<bool>, 73 has_focus: Option<bool>, 74 has_tooltip: Option<bool>, 75 height_request: Option<i32>, 76 hexpand: Option<bool>, 77 hexpand_set: Option<bool>, 78 is_focus: Option<bool>, 79 margin: Option<i32>, 80 margin_bottom: Option<i32>, 81 margin_end: Option<i32>, 82 margin_left: Option<i32>, 83 margin_right: Option<i32>, 84 margin_start: Option<i32>, 85 margin_top: Option<i32>, 86 name: Option<String>, 87 no_show_all: Option<bool>, 88 opacity: Option<f64>, 89 parent: Option<gtk::Container>, 90 receives_default: Option<bool>, 91 sensitive: Option<bool>, 92 //style: /*Unknown type*/, 93 tooltip_markup: Option<String>, 94 tooltip_text: Option<String>, 95 valign: Option<gtk::Align>, 96 vexpand: Option<bool>, 97 vexpand_set: Option<bool>, 98 visible: Option<bool>, 99 width_request: Option<i32>, 100 } 101 102 impl KeypadBuilder { 103 // rustdoc-stripper-ignore-next 104 /// Create a new [`KeypadBuilder`]. new() -> Self105 pub fn new() -> Self { 106 Self::default() 107 } 108 109 // rustdoc-stripper-ignore-next 110 /// Build the [`Keypad`]. build(self) -> Keypad111 pub fn build(self) -> Keypad { 112 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 113 if let Some(ref column_spacing) = self.column_spacing { 114 properties.push(("column-spacing", column_spacing)); 115 } 116 if let Some(ref end_action) = self.end_action { 117 properties.push(("end-action", end_action)); 118 } 119 if let Some(ref entry) = self.entry { 120 properties.push(("entry", entry)); 121 } 122 if let Some(ref letters_visible) = self.letters_visible { 123 properties.push(("letters-visible", letters_visible)); 124 } 125 if let Some(ref row_spacing) = self.row_spacing { 126 properties.push(("row-spacing", row_spacing)); 127 } 128 if let Some(ref start_action) = self.start_action { 129 properties.push(("start-action", start_action)); 130 } 131 if let Some(ref symbols_visible) = self.symbols_visible { 132 properties.push(("symbols-visible", symbols_visible)); 133 } 134 if let Some(ref border_width) = self.border_width { 135 properties.push(("border-width", border_width)); 136 } 137 if let Some(ref child) = self.child { 138 properties.push(("child", child)); 139 } 140 if let Some(ref resize_mode) = self.resize_mode { 141 properties.push(("resize-mode", resize_mode)); 142 } 143 if let Some(ref app_paintable) = self.app_paintable { 144 properties.push(("app-paintable", app_paintable)); 145 } 146 if let Some(ref can_default) = self.can_default { 147 properties.push(("can-default", can_default)); 148 } 149 if let Some(ref can_focus) = self.can_focus { 150 properties.push(("can-focus", can_focus)); 151 } 152 if let Some(ref double_buffered) = self.double_buffered { 153 properties.push(("double-buffered", double_buffered)); 154 } 155 if let Some(ref events) = self.events { 156 properties.push(("events", events)); 157 } 158 if let Some(ref expand) = self.expand { 159 properties.push(("expand", expand)); 160 } 161 if let Some(ref focus_on_click) = self.focus_on_click { 162 properties.push(("focus-on-click", focus_on_click)); 163 } 164 if let Some(ref halign) = self.halign { 165 properties.push(("halign", halign)); 166 } 167 if let Some(ref has_default) = self.has_default { 168 properties.push(("has-default", has_default)); 169 } 170 if let Some(ref has_focus) = self.has_focus { 171 properties.push(("has-focus", has_focus)); 172 } 173 if let Some(ref has_tooltip) = self.has_tooltip { 174 properties.push(("has-tooltip", has_tooltip)); 175 } 176 if let Some(ref height_request) = self.height_request { 177 properties.push(("height-request", height_request)); 178 } 179 if let Some(ref hexpand) = self.hexpand { 180 properties.push(("hexpand", hexpand)); 181 } 182 if let Some(ref hexpand_set) = self.hexpand_set { 183 properties.push(("hexpand-set", hexpand_set)); 184 } 185 if let Some(ref is_focus) = self.is_focus { 186 properties.push(("is-focus", is_focus)); 187 } 188 if let Some(ref margin) = self.margin { 189 properties.push(("margin", margin)); 190 } 191 if let Some(ref margin_bottom) = self.margin_bottom { 192 properties.push(("margin-bottom", margin_bottom)); 193 } 194 if let Some(ref margin_end) = self.margin_end { 195 properties.push(("margin-end", margin_end)); 196 } 197 if let Some(ref margin_left) = self.margin_left { 198 properties.push(("margin-left", margin_left)); 199 } 200 if let Some(ref margin_right) = self.margin_right { 201 properties.push(("margin-right", margin_right)); 202 } 203 if let Some(ref margin_start) = self.margin_start { 204 properties.push(("margin-start", margin_start)); 205 } 206 if let Some(ref margin_top) = self.margin_top { 207 properties.push(("margin-top", margin_top)); 208 } 209 if let Some(ref name) = self.name { 210 properties.push(("name", name)); 211 } 212 if let Some(ref no_show_all) = self.no_show_all { 213 properties.push(("no-show-all", no_show_all)); 214 } 215 if let Some(ref opacity) = self.opacity { 216 properties.push(("opacity", opacity)); 217 } 218 if let Some(ref parent) = self.parent { 219 properties.push(("parent", parent)); 220 } 221 if let Some(ref receives_default) = self.receives_default { 222 properties.push(("receives-default", receives_default)); 223 } 224 if let Some(ref sensitive) = self.sensitive { 225 properties.push(("sensitive", sensitive)); 226 } 227 if let Some(ref tooltip_markup) = self.tooltip_markup { 228 properties.push(("tooltip-markup", tooltip_markup)); 229 } 230 if let Some(ref tooltip_text) = self.tooltip_text { 231 properties.push(("tooltip-text", tooltip_text)); 232 } 233 if let Some(ref valign) = self.valign { 234 properties.push(("valign", valign)); 235 } 236 if let Some(ref vexpand) = self.vexpand { 237 properties.push(("vexpand", vexpand)); 238 } 239 if let Some(ref vexpand_set) = self.vexpand_set { 240 properties.push(("vexpand-set", vexpand_set)); 241 } 242 if let Some(ref visible) = self.visible { 243 properties.push(("visible", visible)); 244 } 245 if let Some(ref width_request) = self.width_request { 246 properties.push(("width-request", width_request)); 247 } 248 glib::Object::new::<Keypad>(&properties).expect("Failed to create an instance of Keypad") 249 } 250 column_spacing(mut self, column_spacing: u32) -> Self251 pub fn column_spacing(mut self, column_spacing: u32) -> Self { 252 self.column_spacing = Some(column_spacing); 253 self 254 } 255 end_action<P: IsA<gtk::Widget>>(mut self, end_action: &P) -> Self256 pub fn end_action<P: IsA<gtk::Widget>>(mut self, end_action: &P) -> Self { 257 self.end_action = Some(end_action.clone().upcast()); 258 self 259 } 260 entry<P: IsA<gtk::Entry>>(mut self, entry: &P) -> Self261 pub fn entry<P: IsA<gtk::Entry>>(mut self, entry: &P) -> Self { 262 self.entry = Some(entry.clone().upcast()); 263 self 264 } 265 letters_visible(mut self, letters_visible: bool) -> Self266 pub fn letters_visible(mut self, letters_visible: bool) -> Self { 267 self.letters_visible = Some(letters_visible); 268 self 269 } 270 row_spacing(mut self, row_spacing: u32) -> Self271 pub fn row_spacing(mut self, row_spacing: u32) -> Self { 272 self.row_spacing = Some(row_spacing); 273 self 274 } 275 start_action<P: IsA<gtk::Widget>>(mut self, start_action: &P) -> Self276 pub fn start_action<P: IsA<gtk::Widget>>(mut self, start_action: &P) -> Self { 277 self.start_action = Some(start_action.clone().upcast()); 278 self 279 } 280 symbols_visible(mut self, symbols_visible: bool) -> Self281 pub fn symbols_visible(mut self, symbols_visible: bool) -> Self { 282 self.symbols_visible = Some(symbols_visible); 283 self 284 } 285 border_width(mut self, border_width: u32) -> Self286 pub fn border_width(mut self, border_width: u32) -> Self { 287 self.border_width = Some(border_width); 288 self 289 } 290 child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self291 pub fn child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self { 292 self.child = Some(child.clone().upcast()); 293 self 294 } 295 resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self296 pub fn resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self { 297 self.resize_mode = Some(resize_mode); 298 self 299 } 300 app_paintable(mut self, app_paintable: bool) -> Self301 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 302 self.app_paintable = Some(app_paintable); 303 self 304 } 305 can_default(mut self, can_default: bool) -> Self306 pub fn can_default(mut self, can_default: bool) -> Self { 307 self.can_default = Some(can_default); 308 self 309 } 310 can_focus(mut self, can_focus: bool) -> Self311 pub fn can_focus(mut self, can_focus: bool) -> Self { 312 self.can_focus = Some(can_focus); 313 self 314 } 315 double_buffered(mut self, double_buffered: bool) -> Self316 pub fn double_buffered(mut self, double_buffered: bool) -> Self { 317 self.double_buffered = Some(double_buffered); 318 self 319 } 320 events(mut self, events: gdk::EventMask) -> Self321 pub fn events(mut self, events: gdk::EventMask) -> Self { 322 self.events = Some(events); 323 self 324 } 325 expand(mut self, expand: bool) -> Self326 pub fn expand(mut self, expand: bool) -> Self { 327 self.expand = Some(expand); 328 self 329 } 330 focus_on_click(mut self, focus_on_click: bool) -> Self331 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 332 self.focus_on_click = Some(focus_on_click); 333 self 334 } 335 halign(mut self, halign: gtk::Align) -> Self336 pub fn halign(mut self, halign: gtk::Align) -> Self { 337 self.halign = Some(halign); 338 self 339 } 340 has_default(mut self, has_default: bool) -> Self341 pub fn has_default(mut self, has_default: bool) -> Self { 342 self.has_default = Some(has_default); 343 self 344 } 345 has_focus(mut self, has_focus: bool) -> Self346 pub fn has_focus(mut self, has_focus: bool) -> Self { 347 self.has_focus = Some(has_focus); 348 self 349 } 350 has_tooltip(mut self, has_tooltip: bool) -> Self351 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 352 self.has_tooltip = Some(has_tooltip); 353 self 354 } 355 height_request(mut self, height_request: i32) -> Self356 pub fn height_request(mut self, height_request: i32) -> Self { 357 self.height_request = Some(height_request); 358 self 359 } 360 hexpand(mut self, hexpand: bool) -> Self361 pub fn hexpand(mut self, hexpand: bool) -> Self { 362 self.hexpand = Some(hexpand); 363 self 364 } 365 hexpand_set(mut self, hexpand_set: bool) -> Self366 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 367 self.hexpand_set = Some(hexpand_set); 368 self 369 } 370 is_focus(mut self, is_focus: bool) -> Self371 pub fn is_focus(mut self, is_focus: bool) -> Self { 372 self.is_focus = Some(is_focus); 373 self 374 } 375 margin(mut self, margin: i32) -> Self376 pub fn margin(mut self, margin: i32) -> Self { 377 self.margin = Some(margin); 378 self 379 } 380 margin_bottom(mut self, margin_bottom: i32) -> Self381 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 382 self.margin_bottom = Some(margin_bottom); 383 self 384 } 385 margin_end(mut self, margin_end: i32) -> Self386 pub fn margin_end(mut self, margin_end: i32) -> Self { 387 self.margin_end = Some(margin_end); 388 self 389 } 390 margin_left(mut self, margin_left: i32) -> Self391 pub fn margin_left(mut self, margin_left: i32) -> Self { 392 self.margin_left = Some(margin_left); 393 self 394 } 395 margin_right(mut self, margin_right: i32) -> Self396 pub fn margin_right(mut self, margin_right: i32) -> Self { 397 self.margin_right = Some(margin_right); 398 self 399 } 400 margin_start(mut self, margin_start: i32) -> Self401 pub fn margin_start(mut self, margin_start: i32) -> Self { 402 self.margin_start = Some(margin_start); 403 self 404 } 405 margin_top(mut self, margin_top: i32) -> Self406 pub fn margin_top(mut self, margin_top: i32) -> Self { 407 self.margin_top = Some(margin_top); 408 self 409 } 410 name(mut self, name: &str) -> Self411 pub fn name(mut self, name: &str) -> Self { 412 self.name = Some(name.to_string()); 413 self 414 } 415 no_show_all(mut self, no_show_all: bool) -> Self416 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 417 self.no_show_all = Some(no_show_all); 418 self 419 } 420 opacity(mut self, opacity: f64) -> Self421 pub fn opacity(mut self, opacity: f64) -> Self { 422 self.opacity = Some(opacity); 423 self 424 } 425 parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self426 pub fn parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self { 427 self.parent = Some(parent.clone().upcast()); 428 self 429 } 430 receives_default(mut self, receives_default: bool) -> Self431 pub fn receives_default(mut self, receives_default: bool) -> Self { 432 self.receives_default = Some(receives_default); 433 self 434 } 435 sensitive(mut self, sensitive: bool) -> Self436 pub fn sensitive(mut self, sensitive: bool) -> Self { 437 self.sensitive = Some(sensitive); 438 self 439 } 440 tooltip_markup(mut self, tooltip_markup: &str) -> Self441 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 442 self.tooltip_markup = Some(tooltip_markup.to_string()); 443 self 444 } 445 tooltip_text(mut self, tooltip_text: &str) -> Self446 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 447 self.tooltip_text = Some(tooltip_text.to_string()); 448 self 449 } 450 valign(mut self, valign: gtk::Align) -> Self451 pub fn valign(mut self, valign: gtk::Align) -> Self { 452 self.valign = Some(valign); 453 self 454 } 455 vexpand(mut self, vexpand: bool) -> Self456 pub fn vexpand(mut self, vexpand: bool) -> Self { 457 self.vexpand = Some(vexpand); 458 self 459 } 460 vexpand_set(mut self, vexpand_set: bool) -> Self461 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 462 self.vexpand_set = Some(vexpand_set); 463 self 464 } 465 visible(mut self, visible: bool) -> Self466 pub fn visible(mut self, visible: bool) -> Self { 467 self.visible = Some(visible); 468 self 469 } 470 width_request(mut self, width_request: i32) -> Self471 pub fn width_request(mut self, width_request: i32) -> Self { 472 self.width_request = Some(width_request); 473 self 474 } 475 } 476 477 pub const NONE_KEYPAD: Option<&Keypad> = None; 478 479 pub trait KeypadExt: 'static { 480 #[doc(alias = "hdy_keypad_get_column_spacing")] 481 #[doc(alias = "get_column_spacing")] column_spacing(&self) -> u32482 fn column_spacing(&self) -> u32; 483 484 #[doc(alias = "hdy_keypad_get_end_action")] 485 #[doc(alias = "get_end_action")] end_action(&self) -> Option<gtk::Widget>486 fn end_action(&self) -> Option<gtk::Widget>; 487 488 #[doc(alias = "hdy_keypad_get_entry")] 489 #[doc(alias = "get_entry")] entry(&self) -> Option<gtk::Entry>490 fn entry(&self) -> Option<gtk::Entry>; 491 492 #[doc(alias = "hdy_keypad_get_letters_visible")] 493 #[doc(alias = "get_letters_visible")] is_letters_visible(&self) -> bool494 fn is_letters_visible(&self) -> bool; 495 496 #[doc(alias = "hdy_keypad_get_row_spacing")] 497 #[doc(alias = "get_row_spacing")] row_spacing(&self) -> u32498 fn row_spacing(&self) -> u32; 499 500 #[doc(alias = "hdy_keypad_get_start_action")] 501 #[doc(alias = "get_start_action")] start_action(&self) -> Option<gtk::Widget>502 fn start_action(&self) -> Option<gtk::Widget>; 503 504 #[doc(alias = "hdy_keypad_get_symbols_visible")] 505 #[doc(alias = "get_symbols_visible")] is_symbols_visible(&self) -> bool506 fn is_symbols_visible(&self) -> bool; 507 508 #[doc(alias = "hdy_keypad_set_column_spacing")] set_column_spacing(&self, spacing: u32)509 fn set_column_spacing(&self, spacing: u32); 510 511 #[doc(alias = "hdy_keypad_set_end_action")] set_end_action<P: IsA<gtk::Widget>>(&self, end_action: Option<&P>)512 fn set_end_action<P: IsA<gtk::Widget>>(&self, end_action: Option<&P>); 513 514 #[doc(alias = "hdy_keypad_set_entry")] set_entry<P: IsA<gtk::Entry>>(&self, entry: Option<&P>)515 fn set_entry<P: IsA<gtk::Entry>>(&self, entry: Option<&P>); 516 517 #[doc(alias = "hdy_keypad_set_letters_visible")] set_letters_visible(&self, letters_visible: bool)518 fn set_letters_visible(&self, letters_visible: bool); 519 520 #[doc(alias = "hdy_keypad_set_row_spacing")] set_row_spacing(&self, spacing: u32)521 fn set_row_spacing(&self, spacing: u32); 522 523 #[doc(alias = "hdy_keypad_set_start_action")] set_start_action<P: IsA<gtk::Widget>>(&self, start_action: Option<&P>)524 fn set_start_action<P: IsA<gtk::Widget>>(&self, start_action: Option<&P>); 525 526 #[doc(alias = "hdy_keypad_set_symbols_visible")] set_symbols_visible(&self, symbols_visible: bool)527 fn set_symbols_visible(&self, symbols_visible: bool); 528 529 #[doc(alias = "column-spacing")] connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId530 fn connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 531 532 #[doc(alias = "end-action")] connect_end_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId533 fn connect_end_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 534 535 #[doc(alias = "entry")] connect_entry_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId536 fn connect_entry_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 537 538 #[doc(alias = "letters-visible")] connect_letters_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId539 fn connect_letters_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 540 541 #[doc(alias = "row-spacing")] connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId542 fn connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 543 544 #[doc(alias = "start-action")] connect_start_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId545 fn connect_start_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 546 547 #[doc(alias = "symbols-visible")] connect_symbols_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId548 fn connect_symbols_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 549 } 550 551 impl<O: IsA<Keypad>> KeypadExt for O { column_spacing(&self) -> u32552 fn column_spacing(&self) -> u32 { 553 unsafe { ffi::hdy_keypad_get_column_spacing(self.as_ref().to_glib_none().0) } 554 } 555 end_action(&self) -> Option<gtk::Widget>556 fn end_action(&self) -> Option<gtk::Widget> { 557 unsafe { 558 from_glib_none(ffi::hdy_keypad_get_end_action( 559 self.as_ref().to_glib_none().0, 560 )) 561 } 562 } 563 entry(&self) -> Option<gtk::Entry>564 fn entry(&self) -> Option<gtk::Entry> { 565 unsafe { from_glib_none(ffi::hdy_keypad_get_entry(self.as_ref().to_glib_none().0)) } 566 } 567 is_letters_visible(&self) -> bool568 fn is_letters_visible(&self) -> bool { 569 unsafe { 570 from_glib(ffi::hdy_keypad_get_letters_visible( 571 self.as_ref().to_glib_none().0, 572 )) 573 } 574 } 575 row_spacing(&self) -> u32576 fn row_spacing(&self) -> u32 { 577 unsafe { ffi::hdy_keypad_get_row_spacing(self.as_ref().to_glib_none().0) } 578 } 579 start_action(&self) -> Option<gtk::Widget>580 fn start_action(&self) -> Option<gtk::Widget> { 581 unsafe { 582 from_glib_none(ffi::hdy_keypad_get_start_action( 583 self.as_ref().to_glib_none().0, 584 )) 585 } 586 } 587 is_symbols_visible(&self) -> bool588 fn is_symbols_visible(&self) -> bool { 589 unsafe { 590 from_glib(ffi::hdy_keypad_get_symbols_visible( 591 self.as_ref().to_glib_none().0, 592 )) 593 } 594 } 595 set_column_spacing(&self, spacing: u32)596 fn set_column_spacing(&self, spacing: u32) { 597 unsafe { 598 ffi::hdy_keypad_set_column_spacing(self.as_ref().to_glib_none().0, spacing); 599 } 600 } 601 set_end_action<P: IsA<gtk::Widget>>(&self, end_action: Option<&P>)602 fn set_end_action<P: IsA<gtk::Widget>>(&self, end_action: Option<&P>) { 603 unsafe { 604 ffi::hdy_keypad_set_end_action( 605 self.as_ref().to_glib_none().0, 606 end_action.map(|p| p.as_ref()).to_glib_none().0, 607 ); 608 } 609 } 610 set_entry<P: IsA<gtk::Entry>>(&self, entry: Option<&P>)611 fn set_entry<P: IsA<gtk::Entry>>(&self, entry: Option<&P>) { 612 unsafe { 613 ffi::hdy_keypad_set_entry( 614 self.as_ref().to_glib_none().0, 615 entry.map(|p| p.as_ref()).to_glib_none().0, 616 ); 617 } 618 } 619 set_letters_visible(&self, letters_visible: bool)620 fn set_letters_visible(&self, letters_visible: bool) { 621 unsafe { 622 ffi::hdy_keypad_set_letters_visible( 623 self.as_ref().to_glib_none().0, 624 letters_visible.into_glib(), 625 ); 626 } 627 } 628 set_row_spacing(&self, spacing: u32)629 fn set_row_spacing(&self, spacing: u32) { 630 unsafe { 631 ffi::hdy_keypad_set_row_spacing(self.as_ref().to_glib_none().0, spacing); 632 } 633 } 634 set_start_action<P: IsA<gtk::Widget>>(&self, start_action: Option<&P>)635 fn set_start_action<P: IsA<gtk::Widget>>(&self, start_action: Option<&P>) { 636 unsafe { 637 ffi::hdy_keypad_set_start_action( 638 self.as_ref().to_glib_none().0, 639 start_action.map(|p| p.as_ref()).to_glib_none().0, 640 ); 641 } 642 } 643 set_symbols_visible(&self, symbols_visible: bool)644 fn set_symbols_visible(&self, symbols_visible: bool) { 645 unsafe { 646 ffi::hdy_keypad_set_symbols_visible( 647 self.as_ref().to_glib_none().0, 648 symbols_visible.into_glib(), 649 ); 650 } 651 } 652 connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId653 fn connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 654 unsafe extern "C" fn notify_column_spacing_trampoline< 655 P: IsA<Keypad>, 656 F: Fn(&P) + 'static, 657 >( 658 this: *mut ffi::HdyKeypad, 659 _param_spec: glib::ffi::gpointer, 660 f: glib::ffi::gpointer, 661 ) { 662 let f: &F = &*(f as *const F); 663 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 664 } 665 unsafe { 666 let f: Box_<F> = Box_::new(f); 667 connect_raw( 668 self.as_ptr() as *mut _, 669 b"notify::column-spacing\0".as_ptr() as *const _, 670 Some(transmute::<_, unsafe extern "C" fn()>( 671 notify_column_spacing_trampoline::<Self, F> as *const (), 672 )), 673 Box_::into_raw(f), 674 ) 675 } 676 } 677 connect_end_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId678 fn connect_end_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 679 unsafe extern "C" fn notify_end_action_trampoline<P: IsA<Keypad>, F: Fn(&P) + 'static>( 680 this: *mut ffi::HdyKeypad, 681 _param_spec: glib::ffi::gpointer, 682 f: glib::ffi::gpointer, 683 ) { 684 let f: &F = &*(f as *const F); 685 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 686 } 687 unsafe { 688 let f: Box_<F> = Box_::new(f); 689 connect_raw( 690 self.as_ptr() as *mut _, 691 b"notify::end-action\0".as_ptr() as *const _, 692 Some(transmute::<_, unsafe extern "C" fn()>( 693 notify_end_action_trampoline::<Self, F> as *const (), 694 )), 695 Box_::into_raw(f), 696 ) 697 } 698 } 699 connect_entry_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId700 fn connect_entry_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 701 unsafe extern "C" fn notify_entry_trampoline<P: IsA<Keypad>, F: Fn(&P) + 'static>( 702 this: *mut ffi::HdyKeypad, 703 _param_spec: glib::ffi::gpointer, 704 f: glib::ffi::gpointer, 705 ) { 706 let f: &F = &*(f as *const F); 707 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 708 } 709 unsafe { 710 let f: Box_<F> = Box_::new(f); 711 connect_raw( 712 self.as_ptr() as *mut _, 713 b"notify::entry\0".as_ptr() as *const _, 714 Some(transmute::<_, unsafe extern "C" fn()>( 715 notify_entry_trampoline::<Self, F> as *const (), 716 )), 717 Box_::into_raw(f), 718 ) 719 } 720 } 721 connect_letters_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId722 fn connect_letters_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 723 unsafe extern "C" fn notify_letters_visible_trampoline< 724 P: IsA<Keypad>, 725 F: Fn(&P) + 'static, 726 >( 727 this: *mut ffi::HdyKeypad, 728 _param_spec: glib::ffi::gpointer, 729 f: glib::ffi::gpointer, 730 ) { 731 let f: &F = &*(f as *const F); 732 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 733 } 734 unsafe { 735 let f: Box_<F> = Box_::new(f); 736 connect_raw( 737 self.as_ptr() as *mut _, 738 b"notify::letters-visible\0".as_ptr() as *const _, 739 Some(transmute::<_, unsafe extern "C" fn()>( 740 notify_letters_visible_trampoline::<Self, F> as *const (), 741 )), 742 Box_::into_raw(f), 743 ) 744 } 745 } 746 connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId747 fn connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 748 unsafe extern "C" fn notify_row_spacing_trampoline<P: IsA<Keypad>, F: Fn(&P) + 'static>( 749 this: *mut ffi::HdyKeypad, 750 _param_spec: glib::ffi::gpointer, 751 f: glib::ffi::gpointer, 752 ) { 753 let f: &F = &*(f as *const F); 754 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 755 } 756 unsafe { 757 let f: Box_<F> = Box_::new(f); 758 connect_raw( 759 self.as_ptr() as *mut _, 760 b"notify::row-spacing\0".as_ptr() as *const _, 761 Some(transmute::<_, unsafe extern "C" fn()>( 762 notify_row_spacing_trampoline::<Self, F> as *const (), 763 )), 764 Box_::into_raw(f), 765 ) 766 } 767 } 768 connect_start_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId769 fn connect_start_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 770 unsafe extern "C" fn notify_start_action_trampoline<P: IsA<Keypad>, F: Fn(&P) + 'static>( 771 this: *mut ffi::HdyKeypad, 772 _param_spec: glib::ffi::gpointer, 773 f: glib::ffi::gpointer, 774 ) { 775 let f: &F = &*(f as *const F); 776 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 777 } 778 unsafe { 779 let f: Box_<F> = Box_::new(f); 780 connect_raw( 781 self.as_ptr() as *mut _, 782 b"notify::start-action\0".as_ptr() as *const _, 783 Some(transmute::<_, unsafe extern "C" fn()>( 784 notify_start_action_trampoline::<Self, F> as *const (), 785 )), 786 Box_::into_raw(f), 787 ) 788 } 789 } 790 connect_symbols_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId791 fn connect_symbols_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 792 unsafe extern "C" fn notify_symbols_visible_trampoline< 793 P: IsA<Keypad>, 794 F: Fn(&P) + 'static, 795 >( 796 this: *mut ffi::HdyKeypad, 797 _param_spec: glib::ffi::gpointer, 798 f: glib::ffi::gpointer, 799 ) { 800 let f: &F = &*(f as *const F); 801 f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) 802 } 803 unsafe { 804 let f: Box_<F> = Box_::new(f); 805 connect_raw( 806 self.as_ptr() as *mut _, 807 b"notify::symbols-visible\0".as_ptr() as *const _, 808 Some(transmute::<_, unsafe extern "C" fn()>( 809 notify_symbols_visible_trampoline::<Self, F> as *const (), 810 )), 811 Box_::into_raw(f), 812 ) 813 } 814 } 815 } 816 817 impl fmt::Display for Keypad { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result818 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 819 f.write_str("Keypad") 820 } 821 } 822