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 5 use crate::Actionable; 6 use crate::Align; 7 use crate::Bin; 8 use crate::Buildable; 9 use crate::Button; 10 use crate::Container; 11 use crate::PositionType; 12 use crate::ReliefStyle; 13 use crate::ResizeMode; 14 use crate::Widget; 15 use glib::object::Cast; 16 use glib::object::IsA; 17 use glib::signal::connect_raw; 18 use glib::signal::SignalHandlerId; 19 use glib::translate::*; 20 use glib::StaticType; 21 use glib::ToValue; 22 use std::boxed::Box as Box_; 23 use std::fmt; 24 use std::mem::transmute; 25 26 glib::wrapper! { 27 #[doc(alias = "GtkLockButton")] 28 pub struct LockButton(Object<ffi::GtkLockButton, ffi::GtkLockButtonClass>) @extends Button, Bin, Container, Widget, @implements Buildable, Actionable; 29 30 match fn { 31 type_ => || ffi::gtk_lock_button_get_type(), 32 } 33 } 34 35 impl LockButton { 36 #[doc(alias = "gtk_lock_button_new")] new<P: IsA<gio::Permission>>(permission: Option<&P>) -> LockButton37 pub fn new<P: IsA<gio::Permission>>(permission: Option<&P>) -> LockButton { 38 assert_initialized_main_thread!(); 39 unsafe { 40 Widget::from_glib_none(ffi::gtk_lock_button_new( 41 permission.map(|p| p.as_ref()).to_glib_none().0, 42 )) 43 .unsafe_cast() 44 } 45 } 46 47 // rustdoc-stripper-ignore-next 48 /// Creates a new builder-pattern struct instance to construct [`LockButton`] objects. 49 /// 50 /// This method returns an instance of [`LockButtonBuilder`] which can be used to create [`LockButton`] objects. builder() -> LockButtonBuilder51 pub fn builder() -> LockButtonBuilder { 52 LockButtonBuilder::default() 53 } 54 } 55 56 #[derive(Clone, Default)] 57 // rustdoc-stripper-ignore-next 58 /// A [builder-pattern] type to construct [`LockButton`] objects. 59 /// 60 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 61 pub struct LockButtonBuilder { 62 permission: Option<gio::Permission>, 63 text_lock: Option<String>, 64 text_unlock: Option<String>, 65 tooltip_lock: Option<String>, 66 tooltip_not_authorized: Option<String>, 67 tooltip_unlock: Option<String>, 68 always_show_image: Option<bool>, 69 image: Option<Widget>, 70 image_position: Option<PositionType>, 71 label: Option<String>, 72 relief: Option<ReliefStyle>, 73 use_underline: Option<bool>, 74 border_width: Option<u32>, 75 child: Option<Widget>, 76 resize_mode: Option<ResizeMode>, 77 app_paintable: Option<bool>, 78 can_default: Option<bool>, 79 can_focus: Option<bool>, 80 events: Option<gdk::EventMask>, 81 expand: Option<bool>, 82 #[cfg(any(feature = "v3_20", feature = "dox"))] 83 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] 84 focus_on_click: Option<bool>, 85 halign: Option<Align>, 86 has_default: Option<bool>, 87 has_focus: Option<bool>, 88 has_tooltip: Option<bool>, 89 height_request: Option<i32>, 90 hexpand: Option<bool>, 91 hexpand_set: Option<bool>, 92 is_focus: Option<bool>, 93 margin: Option<i32>, 94 margin_bottom: Option<i32>, 95 margin_end: Option<i32>, 96 margin_start: Option<i32>, 97 margin_top: Option<i32>, 98 name: Option<String>, 99 no_show_all: Option<bool>, 100 opacity: Option<f64>, 101 parent: Option<Container>, 102 receives_default: Option<bool>, 103 sensitive: Option<bool>, 104 tooltip_markup: Option<String>, 105 tooltip_text: Option<String>, 106 valign: Option<Align>, 107 vexpand: Option<bool>, 108 vexpand_set: Option<bool>, 109 visible: Option<bool>, 110 width_request: Option<i32>, 111 action_name: Option<String>, 112 action_target: Option<glib::Variant>, 113 } 114 115 impl LockButtonBuilder { 116 // rustdoc-stripper-ignore-next 117 /// Create a new [`LockButtonBuilder`]. new() -> Self118 pub fn new() -> Self { 119 Self::default() 120 } 121 122 // rustdoc-stripper-ignore-next 123 /// Build the [`LockButton`]. build(self) -> LockButton124 pub fn build(self) -> LockButton { 125 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 126 if let Some(ref permission) = self.permission { 127 properties.push(("permission", permission)); 128 } 129 if let Some(ref text_lock) = self.text_lock { 130 properties.push(("text-lock", text_lock)); 131 } 132 if let Some(ref text_unlock) = self.text_unlock { 133 properties.push(("text-unlock", text_unlock)); 134 } 135 if let Some(ref tooltip_lock) = self.tooltip_lock { 136 properties.push(("tooltip-lock", tooltip_lock)); 137 } 138 if let Some(ref tooltip_not_authorized) = self.tooltip_not_authorized { 139 properties.push(("tooltip-not-authorized", tooltip_not_authorized)); 140 } 141 if let Some(ref tooltip_unlock) = self.tooltip_unlock { 142 properties.push(("tooltip-unlock", tooltip_unlock)); 143 } 144 if let Some(ref always_show_image) = self.always_show_image { 145 properties.push(("always-show-image", always_show_image)); 146 } 147 if let Some(ref image) = self.image { 148 properties.push(("image", image)); 149 } 150 if let Some(ref image_position) = self.image_position { 151 properties.push(("image-position", image_position)); 152 } 153 if let Some(ref label) = self.label { 154 properties.push(("label", label)); 155 } 156 if let Some(ref relief) = self.relief { 157 properties.push(("relief", relief)); 158 } 159 if let Some(ref use_underline) = self.use_underline { 160 properties.push(("use-underline", use_underline)); 161 } 162 if let Some(ref border_width) = self.border_width { 163 properties.push(("border-width", border_width)); 164 } 165 if let Some(ref child) = self.child { 166 properties.push(("child", child)); 167 } 168 if let Some(ref resize_mode) = self.resize_mode { 169 properties.push(("resize-mode", resize_mode)); 170 } 171 if let Some(ref app_paintable) = self.app_paintable { 172 properties.push(("app-paintable", app_paintable)); 173 } 174 if let Some(ref can_default) = self.can_default { 175 properties.push(("can-default", can_default)); 176 } 177 if let Some(ref can_focus) = self.can_focus { 178 properties.push(("can-focus", can_focus)); 179 } 180 if let Some(ref events) = self.events { 181 properties.push(("events", events)); 182 } 183 if let Some(ref expand) = self.expand { 184 properties.push(("expand", expand)); 185 } 186 #[cfg(any(feature = "v3_20", feature = "dox"))] 187 if let Some(ref focus_on_click) = self.focus_on_click { 188 properties.push(("focus-on-click", focus_on_click)); 189 } 190 if let Some(ref halign) = self.halign { 191 properties.push(("halign", halign)); 192 } 193 if let Some(ref has_default) = self.has_default { 194 properties.push(("has-default", has_default)); 195 } 196 if let Some(ref has_focus) = self.has_focus { 197 properties.push(("has-focus", has_focus)); 198 } 199 if let Some(ref has_tooltip) = self.has_tooltip { 200 properties.push(("has-tooltip", has_tooltip)); 201 } 202 if let Some(ref height_request) = self.height_request { 203 properties.push(("height-request", height_request)); 204 } 205 if let Some(ref hexpand) = self.hexpand { 206 properties.push(("hexpand", hexpand)); 207 } 208 if let Some(ref hexpand_set) = self.hexpand_set { 209 properties.push(("hexpand-set", hexpand_set)); 210 } 211 if let Some(ref is_focus) = self.is_focus { 212 properties.push(("is-focus", is_focus)); 213 } 214 if let Some(ref margin) = self.margin { 215 properties.push(("margin", margin)); 216 } 217 if let Some(ref margin_bottom) = self.margin_bottom { 218 properties.push(("margin-bottom", margin_bottom)); 219 } 220 if let Some(ref margin_end) = self.margin_end { 221 properties.push(("margin-end", margin_end)); 222 } 223 if let Some(ref margin_start) = self.margin_start { 224 properties.push(("margin-start", margin_start)); 225 } 226 if let Some(ref margin_top) = self.margin_top { 227 properties.push(("margin-top", margin_top)); 228 } 229 if let Some(ref name) = self.name { 230 properties.push(("name", name)); 231 } 232 if let Some(ref no_show_all) = self.no_show_all { 233 properties.push(("no-show-all", no_show_all)); 234 } 235 if let Some(ref opacity) = self.opacity { 236 properties.push(("opacity", opacity)); 237 } 238 if let Some(ref parent) = self.parent { 239 properties.push(("parent", parent)); 240 } 241 if let Some(ref receives_default) = self.receives_default { 242 properties.push(("receives-default", receives_default)); 243 } 244 if let Some(ref sensitive) = self.sensitive { 245 properties.push(("sensitive", sensitive)); 246 } 247 if let Some(ref tooltip_markup) = self.tooltip_markup { 248 properties.push(("tooltip-markup", tooltip_markup)); 249 } 250 if let Some(ref tooltip_text) = self.tooltip_text { 251 properties.push(("tooltip-text", tooltip_text)); 252 } 253 if let Some(ref valign) = self.valign { 254 properties.push(("valign", valign)); 255 } 256 if let Some(ref vexpand) = self.vexpand { 257 properties.push(("vexpand", vexpand)); 258 } 259 if let Some(ref vexpand_set) = self.vexpand_set { 260 properties.push(("vexpand-set", vexpand_set)); 261 } 262 if let Some(ref visible) = self.visible { 263 properties.push(("visible", visible)); 264 } 265 if let Some(ref width_request) = self.width_request { 266 properties.push(("width-request", width_request)); 267 } 268 if let Some(ref action_name) = self.action_name { 269 properties.push(("action-name", action_name)); 270 } 271 if let Some(ref action_target) = self.action_target { 272 properties.push(("action-target", action_target)); 273 } 274 glib::Object::new::<LockButton>(&properties) 275 .expect("Failed to create an instance of LockButton") 276 } 277 permission<P: IsA<gio::Permission>>(mut self, permission: &P) -> Self278 pub fn permission<P: IsA<gio::Permission>>(mut self, permission: &P) -> Self { 279 self.permission = Some(permission.clone().upcast()); 280 self 281 } 282 text_lock(mut self, text_lock: &str) -> Self283 pub fn text_lock(mut self, text_lock: &str) -> Self { 284 self.text_lock = Some(text_lock.to_string()); 285 self 286 } 287 text_unlock(mut self, text_unlock: &str) -> Self288 pub fn text_unlock(mut self, text_unlock: &str) -> Self { 289 self.text_unlock = Some(text_unlock.to_string()); 290 self 291 } 292 tooltip_lock(mut self, tooltip_lock: &str) -> Self293 pub fn tooltip_lock(mut self, tooltip_lock: &str) -> Self { 294 self.tooltip_lock = Some(tooltip_lock.to_string()); 295 self 296 } 297 tooltip_not_authorized(mut self, tooltip_not_authorized: &str) -> Self298 pub fn tooltip_not_authorized(mut self, tooltip_not_authorized: &str) -> Self { 299 self.tooltip_not_authorized = Some(tooltip_not_authorized.to_string()); 300 self 301 } 302 tooltip_unlock(mut self, tooltip_unlock: &str) -> Self303 pub fn tooltip_unlock(mut self, tooltip_unlock: &str) -> Self { 304 self.tooltip_unlock = Some(tooltip_unlock.to_string()); 305 self 306 } 307 always_show_image(mut self, always_show_image: bool) -> Self308 pub fn always_show_image(mut self, always_show_image: bool) -> Self { 309 self.always_show_image = Some(always_show_image); 310 self 311 } 312 image<P: IsA<Widget>>(mut self, image: &P) -> Self313 pub fn image<P: IsA<Widget>>(mut self, image: &P) -> Self { 314 self.image = Some(image.clone().upcast()); 315 self 316 } 317 image_position(mut self, image_position: PositionType) -> Self318 pub fn image_position(mut self, image_position: PositionType) -> Self { 319 self.image_position = Some(image_position); 320 self 321 } 322 label(mut self, label: &str) -> Self323 pub fn label(mut self, label: &str) -> Self { 324 self.label = Some(label.to_string()); 325 self 326 } 327 relief(mut self, relief: ReliefStyle) -> Self328 pub fn relief(mut self, relief: ReliefStyle) -> Self { 329 self.relief = Some(relief); 330 self 331 } 332 use_underline(mut self, use_underline: bool) -> Self333 pub fn use_underline(mut self, use_underline: bool) -> Self { 334 self.use_underline = Some(use_underline); 335 self 336 } 337 border_width(mut self, border_width: u32) -> Self338 pub fn border_width(mut self, border_width: u32) -> Self { 339 self.border_width = Some(border_width); 340 self 341 } 342 child<P: IsA<Widget>>(mut self, child: &P) -> Self343 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 344 self.child = Some(child.clone().upcast()); 345 self 346 } 347 resize_mode(mut self, resize_mode: ResizeMode) -> Self348 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 349 self.resize_mode = Some(resize_mode); 350 self 351 } 352 app_paintable(mut self, app_paintable: bool) -> Self353 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 354 self.app_paintable = Some(app_paintable); 355 self 356 } 357 can_default(mut self, can_default: bool) -> Self358 pub fn can_default(mut self, can_default: bool) -> Self { 359 self.can_default = Some(can_default); 360 self 361 } 362 can_focus(mut self, can_focus: bool) -> Self363 pub fn can_focus(mut self, can_focus: bool) -> Self { 364 self.can_focus = Some(can_focus); 365 self 366 } 367 events(mut self, events: gdk::EventMask) -> Self368 pub fn events(mut self, events: gdk::EventMask) -> Self { 369 self.events = Some(events); 370 self 371 } 372 expand(mut self, expand: bool) -> Self373 pub fn expand(mut self, expand: bool) -> Self { 374 self.expand = Some(expand); 375 self 376 } 377 378 #[cfg(any(feature = "v3_20", feature = "dox"))] 379 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] focus_on_click(mut self, focus_on_click: bool) -> Self380 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 381 self.focus_on_click = Some(focus_on_click); 382 self 383 } 384 halign(mut self, halign: Align) -> Self385 pub fn halign(mut self, halign: Align) -> Self { 386 self.halign = Some(halign); 387 self 388 } 389 has_default(mut self, has_default: bool) -> Self390 pub fn has_default(mut self, has_default: bool) -> Self { 391 self.has_default = Some(has_default); 392 self 393 } 394 has_focus(mut self, has_focus: bool) -> Self395 pub fn has_focus(mut self, has_focus: bool) -> Self { 396 self.has_focus = Some(has_focus); 397 self 398 } 399 has_tooltip(mut self, has_tooltip: bool) -> Self400 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 401 self.has_tooltip = Some(has_tooltip); 402 self 403 } 404 height_request(mut self, height_request: i32) -> Self405 pub fn height_request(mut self, height_request: i32) -> Self { 406 self.height_request = Some(height_request); 407 self 408 } 409 hexpand(mut self, hexpand: bool) -> Self410 pub fn hexpand(mut self, hexpand: bool) -> Self { 411 self.hexpand = Some(hexpand); 412 self 413 } 414 hexpand_set(mut self, hexpand_set: bool) -> Self415 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 416 self.hexpand_set = Some(hexpand_set); 417 self 418 } 419 is_focus(mut self, is_focus: bool) -> Self420 pub fn is_focus(mut self, is_focus: bool) -> Self { 421 self.is_focus = Some(is_focus); 422 self 423 } 424 margin(mut self, margin: i32) -> Self425 pub fn margin(mut self, margin: i32) -> Self { 426 self.margin = Some(margin); 427 self 428 } 429 margin_bottom(mut self, margin_bottom: i32) -> Self430 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 431 self.margin_bottom = Some(margin_bottom); 432 self 433 } 434 margin_end(mut self, margin_end: i32) -> Self435 pub fn margin_end(mut self, margin_end: i32) -> Self { 436 self.margin_end = Some(margin_end); 437 self 438 } 439 margin_start(mut self, margin_start: i32) -> Self440 pub fn margin_start(mut self, margin_start: i32) -> Self { 441 self.margin_start = Some(margin_start); 442 self 443 } 444 margin_top(mut self, margin_top: i32) -> Self445 pub fn margin_top(mut self, margin_top: i32) -> Self { 446 self.margin_top = Some(margin_top); 447 self 448 } 449 name(mut self, name: &str) -> Self450 pub fn name(mut self, name: &str) -> Self { 451 self.name = Some(name.to_string()); 452 self 453 } 454 no_show_all(mut self, no_show_all: bool) -> Self455 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 456 self.no_show_all = Some(no_show_all); 457 self 458 } 459 opacity(mut self, opacity: f64) -> Self460 pub fn opacity(mut self, opacity: f64) -> Self { 461 self.opacity = Some(opacity); 462 self 463 } 464 parent<P: IsA<Container>>(mut self, parent: &P) -> Self465 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 466 self.parent = Some(parent.clone().upcast()); 467 self 468 } 469 receives_default(mut self, receives_default: bool) -> Self470 pub fn receives_default(mut self, receives_default: bool) -> Self { 471 self.receives_default = Some(receives_default); 472 self 473 } 474 sensitive(mut self, sensitive: bool) -> Self475 pub fn sensitive(mut self, sensitive: bool) -> Self { 476 self.sensitive = Some(sensitive); 477 self 478 } 479 tooltip_markup(mut self, tooltip_markup: &str) -> Self480 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 481 self.tooltip_markup = Some(tooltip_markup.to_string()); 482 self 483 } 484 tooltip_text(mut self, tooltip_text: &str) -> Self485 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 486 self.tooltip_text = Some(tooltip_text.to_string()); 487 self 488 } 489 valign(mut self, valign: Align) -> Self490 pub fn valign(mut self, valign: Align) -> Self { 491 self.valign = Some(valign); 492 self 493 } 494 vexpand(mut self, vexpand: bool) -> Self495 pub fn vexpand(mut self, vexpand: bool) -> Self { 496 self.vexpand = Some(vexpand); 497 self 498 } 499 vexpand_set(mut self, vexpand_set: bool) -> Self500 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 501 self.vexpand_set = Some(vexpand_set); 502 self 503 } 504 visible(mut self, visible: bool) -> Self505 pub fn visible(mut self, visible: bool) -> Self { 506 self.visible = Some(visible); 507 self 508 } 509 width_request(mut self, width_request: i32) -> Self510 pub fn width_request(mut self, width_request: i32) -> Self { 511 self.width_request = Some(width_request); 512 self 513 } 514 action_name(mut self, action_name: &str) -> Self515 pub fn action_name(mut self, action_name: &str) -> Self { 516 self.action_name = Some(action_name.to_string()); 517 self 518 } 519 action_target(mut self, action_target: &glib::Variant) -> Self520 pub fn action_target(mut self, action_target: &glib::Variant) -> Self { 521 self.action_target = Some(action_target.clone()); 522 self 523 } 524 } 525 526 pub const NONE_LOCK_BUTTON: Option<&LockButton> = None; 527 528 pub trait LockButtonExt: 'static { 529 #[doc(alias = "gtk_lock_button_get_permission")] 530 #[doc(alias = "get_permission")] permission(&self) -> Option<gio::Permission>531 fn permission(&self) -> Option<gio::Permission>; 532 533 #[doc(alias = "gtk_lock_button_set_permission")] set_permission<P: IsA<gio::Permission>>(&self, permission: Option<&P>)534 fn set_permission<P: IsA<gio::Permission>>(&self, permission: Option<&P>); 535 536 #[doc(alias = "text-lock")] text_lock(&self) -> Option<glib::GString>537 fn text_lock(&self) -> Option<glib::GString>; 538 539 #[doc(alias = "text-lock")] set_text_lock(&self, text_lock: Option<&str>)540 fn set_text_lock(&self, text_lock: Option<&str>); 541 542 #[doc(alias = "text-unlock")] text_unlock(&self) -> Option<glib::GString>543 fn text_unlock(&self) -> Option<glib::GString>; 544 545 #[doc(alias = "text-unlock")] set_text_unlock(&self, text_unlock: Option<&str>)546 fn set_text_unlock(&self, text_unlock: Option<&str>); 547 548 #[doc(alias = "tooltip-lock")] tooltip_lock(&self) -> Option<glib::GString>549 fn tooltip_lock(&self) -> Option<glib::GString>; 550 551 #[doc(alias = "tooltip-lock")] set_tooltip_lock(&self, tooltip_lock: Option<&str>)552 fn set_tooltip_lock(&self, tooltip_lock: Option<&str>); 553 554 #[doc(alias = "tooltip-not-authorized")] tooltip_not_authorized(&self) -> Option<glib::GString>555 fn tooltip_not_authorized(&self) -> Option<glib::GString>; 556 557 #[doc(alias = "tooltip-not-authorized")] set_tooltip_not_authorized(&self, tooltip_not_authorized: Option<&str>)558 fn set_tooltip_not_authorized(&self, tooltip_not_authorized: Option<&str>); 559 560 #[doc(alias = "tooltip-unlock")] tooltip_unlock(&self) -> Option<glib::GString>561 fn tooltip_unlock(&self) -> Option<glib::GString>; 562 563 #[doc(alias = "tooltip-unlock")] set_tooltip_unlock(&self, tooltip_unlock: Option<&str>)564 fn set_tooltip_unlock(&self, tooltip_unlock: Option<&str>); 565 566 #[doc(alias = "permission")] connect_permission_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId567 fn connect_permission_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 568 569 #[doc(alias = "text-lock")] connect_text_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId570 fn connect_text_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 571 572 #[doc(alias = "text-unlock")] connect_text_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId573 fn connect_text_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 574 575 #[doc(alias = "tooltip-lock")] connect_tooltip_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId576 fn connect_tooltip_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 577 578 #[doc(alias = "tooltip-not-authorized")] connect_tooltip_not_authorized_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId579 fn connect_tooltip_not_authorized_notify<F: Fn(&Self) + 'static>( 580 &self, 581 f: F, 582 ) -> SignalHandlerId; 583 584 #[doc(alias = "tooltip-unlock")] connect_tooltip_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId585 fn connect_tooltip_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 586 } 587 588 impl<O: IsA<LockButton>> LockButtonExt for O { permission(&self) -> Option<gio::Permission>589 fn permission(&self) -> Option<gio::Permission> { 590 unsafe { 591 from_glib_none(ffi::gtk_lock_button_get_permission( 592 self.as_ref().to_glib_none().0, 593 )) 594 } 595 } 596 set_permission<P: IsA<gio::Permission>>(&self, permission: Option<&P>)597 fn set_permission<P: IsA<gio::Permission>>(&self, permission: Option<&P>) { 598 unsafe { 599 ffi::gtk_lock_button_set_permission( 600 self.as_ref().to_glib_none().0, 601 permission.map(|p| p.as_ref()).to_glib_none().0, 602 ); 603 } 604 } 605 text_lock(&self) -> Option<glib::GString>606 fn text_lock(&self) -> Option<glib::GString> { 607 unsafe { 608 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 609 glib::gobject_ffi::g_object_get_property( 610 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 611 b"text-lock\0".as_ptr() as *const _, 612 value.to_glib_none_mut().0, 613 ); 614 value 615 .get() 616 .expect("Return Value for property `text-lock` getter") 617 } 618 } 619 set_text_lock(&self, text_lock: Option<&str>)620 fn set_text_lock(&self, text_lock: Option<&str>) { 621 unsafe { 622 glib::gobject_ffi::g_object_set_property( 623 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 624 b"text-lock\0".as_ptr() as *const _, 625 text_lock.to_value().to_glib_none().0, 626 ); 627 } 628 } 629 text_unlock(&self) -> Option<glib::GString>630 fn text_unlock(&self) -> Option<glib::GString> { 631 unsafe { 632 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 633 glib::gobject_ffi::g_object_get_property( 634 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 635 b"text-unlock\0".as_ptr() as *const _, 636 value.to_glib_none_mut().0, 637 ); 638 value 639 .get() 640 .expect("Return Value for property `text-unlock` getter") 641 } 642 } 643 set_text_unlock(&self, text_unlock: Option<&str>)644 fn set_text_unlock(&self, text_unlock: Option<&str>) { 645 unsafe { 646 glib::gobject_ffi::g_object_set_property( 647 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 648 b"text-unlock\0".as_ptr() as *const _, 649 text_unlock.to_value().to_glib_none().0, 650 ); 651 } 652 } 653 tooltip_lock(&self) -> Option<glib::GString>654 fn tooltip_lock(&self) -> Option<glib::GString> { 655 unsafe { 656 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 657 glib::gobject_ffi::g_object_get_property( 658 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 659 b"tooltip-lock\0".as_ptr() as *const _, 660 value.to_glib_none_mut().0, 661 ); 662 value 663 .get() 664 .expect("Return Value for property `tooltip-lock` getter") 665 } 666 } 667 set_tooltip_lock(&self, tooltip_lock: Option<&str>)668 fn set_tooltip_lock(&self, tooltip_lock: Option<&str>) { 669 unsafe { 670 glib::gobject_ffi::g_object_set_property( 671 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 672 b"tooltip-lock\0".as_ptr() as *const _, 673 tooltip_lock.to_value().to_glib_none().0, 674 ); 675 } 676 } 677 tooltip_not_authorized(&self) -> Option<glib::GString>678 fn tooltip_not_authorized(&self) -> Option<glib::GString> { 679 unsafe { 680 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 681 glib::gobject_ffi::g_object_get_property( 682 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 683 b"tooltip-not-authorized\0".as_ptr() as *const _, 684 value.to_glib_none_mut().0, 685 ); 686 value 687 .get() 688 .expect("Return Value for property `tooltip-not-authorized` getter") 689 } 690 } 691 set_tooltip_not_authorized(&self, tooltip_not_authorized: Option<&str>)692 fn set_tooltip_not_authorized(&self, tooltip_not_authorized: Option<&str>) { 693 unsafe { 694 glib::gobject_ffi::g_object_set_property( 695 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 696 b"tooltip-not-authorized\0".as_ptr() as *const _, 697 tooltip_not_authorized.to_value().to_glib_none().0, 698 ); 699 } 700 } 701 tooltip_unlock(&self) -> Option<glib::GString>702 fn tooltip_unlock(&self) -> Option<glib::GString> { 703 unsafe { 704 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 705 glib::gobject_ffi::g_object_get_property( 706 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 707 b"tooltip-unlock\0".as_ptr() as *const _, 708 value.to_glib_none_mut().0, 709 ); 710 value 711 .get() 712 .expect("Return Value for property `tooltip-unlock` getter") 713 } 714 } 715 set_tooltip_unlock(&self, tooltip_unlock: Option<&str>)716 fn set_tooltip_unlock(&self, tooltip_unlock: Option<&str>) { 717 unsafe { 718 glib::gobject_ffi::g_object_set_property( 719 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 720 b"tooltip-unlock\0".as_ptr() as *const _, 721 tooltip_unlock.to_value().to_glib_none().0, 722 ); 723 } 724 } 725 connect_permission_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId726 fn connect_permission_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 727 unsafe extern "C" fn notify_permission_trampoline< 728 P: IsA<LockButton>, 729 F: Fn(&P) + 'static, 730 >( 731 this: *mut ffi::GtkLockButton, 732 _param_spec: glib::ffi::gpointer, 733 f: glib::ffi::gpointer, 734 ) { 735 let f: &F = &*(f as *const F); 736 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 737 } 738 unsafe { 739 let f: Box_<F> = Box_::new(f); 740 connect_raw( 741 self.as_ptr() as *mut _, 742 b"notify::permission\0".as_ptr() as *const _, 743 Some(transmute::<_, unsafe extern "C" fn()>( 744 notify_permission_trampoline::<Self, F> as *const (), 745 )), 746 Box_::into_raw(f), 747 ) 748 } 749 } 750 connect_text_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId751 fn connect_text_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 752 unsafe extern "C" fn notify_text_lock_trampoline< 753 P: IsA<LockButton>, 754 F: Fn(&P) + 'static, 755 >( 756 this: *mut ffi::GtkLockButton, 757 _param_spec: glib::ffi::gpointer, 758 f: glib::ffi::gpointer, 759 ) { 760 let f: &F = &*(f as *const F); 761 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 762 } 763 unsafe { 764 let f: Box_<F> = Box_::new(f); 765 connect_raw( 766 self.as_ptr() as *mut _, 767 b"notify::text-lock\0".as_ptr() as *const _, 768 Some(transmute::<_, unsafe extern "C" fn()>( 769 notify_text_lock_trampoline::<Self, F> as *const (), 770 )), 771 Box_::into_raw(f), 772 ) 773 } 774 } 775 connect_text_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId776 fn connect_text_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 777 unsafe extern "C" fn notify_text_unlock_trampoline< 778 P: IsA<LockButton>, 779 F: Fn(&P) + 'static, 780 >( 781 this: *mut ffi::GtkLockButton, 782 _param_spec: glib::ffi::gpointer, 783 f: glib::ffi::gpointer, 784 ) { 785 let f: &F = &*(f as *const F); 786 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 787 } 788 unsafe { 789 let f: Box_<F> = Box_::new(f); 790 connect_raw( 791 self.as_ptr() as *mut _, 792 b"notify::text-unlock\0".as_ptr() as *const _, 793 Some(transmute::<_, unsafe extern "C" fn()>( 794 notify_text_unlock_trampoline::<Self, F> as *const (), 795 )), 796 Box_::into_raw(f), 797 ) 798 } 799 } 800 connect_tooltip_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId801 fn connect_tooltip_lock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 802 unsafe extern "C" fn notify_tooltip_lock_trampoline< 803 P: IsA<LockButton>, 804 F: Fn(&P) + 'static, 805 >( 806 this: *mut ffi::GtkLockButton, 807 _param_spec: glib::ffi::gpointer, 808 f: glib::ffi::gpointer, 809 ) { 810 let f: &F = &*(f as *const F); 811 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 812 } 813 unsafe { 814 let f: Box_<F> = Box_::new(f); 815 connect_raw( 816 self.as_ptr() as *mut _, 817 b"notify::tooltip-lock\0".as_ptr() as *const _, 818 Some(transmute::<_, unsafe extern "C" fn()>( 819 notify_tooltip_lock_trampoline::<Self, F> as *const (), 820 )), 821 Box_::into_raw(f), 822 ) 823 } 824 } 825 connect_tooltip_not_authorized_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId826 fn connect_tooltip_not_authorized_notify<F: Fn(&Self) + 'static>( 827 &self, 828 f: F, 829 ) -> SignalHandlerId { 830 unsafe extern "C" fn notify_tooltip_not_authorized_trampoline< 831 P: IsA<LockButton>, 832 F: Fn(&P) + 'static, 833 >( 834 this: *mut ffi::GtkLockButton, 835 _param_spec: glib::ffi::gpointer, 836 f: glib::ffi::gpointer, 837 ) { 838 let f: &F = &*(f as *const F); 839 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 840 } 841 unsafe { 842 let f: Box_<F> = Box_::new(f); 843 connect_raw( 844 self.as_ptr() as *mut _, 845 b"notify::tooltip-not-authorized\0".as_ptr() as *const _, 846 Some(transmute::<_, unsafe extern "C" fn()>( 847 notify_tooltip_not_authorized_trampoline::<Self, F> as *const (), 848 )), 849 Box_::into_raw(f), 850 ) 851 } 852 } 853 connect_tooltip_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId854 fn connect_tooltip_unlock_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 855 unsafe extern "C" fn notify_tooltip_unlock_trampoline< 856 P: IsA<LockButton>, 857 F: Fn(&P) + 'static, 858 >( 859 this: *mut ffi::GtkLockButton, 860 _param_spec: glib::ffi::gpointer, 861 f: glib::ffi::gpointer, 862 ) { 863 let f: &F = &*(f as *const F); 864 f(LockButton::from_glib_borrow(this).unsafe_cast_ref()) 865 } 866 unsafe { 867 let f: Box_<F> = Box_::new(f); 868 connect_raw( 869 self.as_ptr() as *mut _, 870 b"notify::tooltip-unlock\0".as_ptr() as *const _, 871 Some(transmute::<_, unsafe extern "C" fn()>( 872 notify_tooltip_unlock_trampoline::<Self, F> as *const (), 873 )), 874 Box_::into_raw(f), 875 ) 876 } 877 } 878 } 879 880 impl fmt::Display for LockButton { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result881 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 882 f.write_str("LockButton") 883 } 884 } 885