| 1 | /* |
| 2 | * Copyright 2020-2024 Andrey Kutejko <[email protected]> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General pub License as published by |
| 6 | * the Free Software Foundation; either version 3 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General pub License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General pub License |
| 15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * For more details see the file COPYING. |
| 18 | */ |
| 19 | |
| 20 | use craterust-analyzer cargo gnome-robots 50.0.0 crate/::{ |
| 21 | controlsrust-analyzer cargo gnome-robots 50.0.0 controls/::{key_from_i32rust-analyzer cargo gnome-robots 50.0.0 controls/key_from_i32()., key_into_i32rust-analyzer cargo gnome-robots 50.0.0 controls/key_into_i32().}, |
| 22 | gamerust-analyzer cargo gnome-robots 50.0.0 game/::{MoveSafetyrust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#, PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#}, |
| 23 | utilsrust-analyzer cargo gnome-robots 50.0.0 utils/::SettingsWarnExtrust-analyzer cargo gnome-robots 50.0.0 utils/SettingsWarnExt#, |
| 24 | }; |
| 25 | use gtkrust-analyzer cargo gtk4 0.11.1 crate/::{gdkrust-analyzer cargo gdk4 0.11.1 crate/, giorust-analyzer cargo gio 0.22.2 crate/, giorust-analyzer cargo gio 0.22.2 crate/::preluderust-analyzer cargo gio 0.22.2 prelude/::*}; |
| 26 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#; |
| 27 | |
| 28 | const BACKGROUND_COLORrust-analyzer cargo gnome-robots 50.0.0 properties/BACKGROUND_COLOR.: &str = "background-color"; |
| 29 | const GAME_CONFIGURATIONrust-analyzer cargo gnome-robots 50.0.0 properties/GAME_CONFIGURATION.: &str = "configuration"; |
| 30 | const ENABLE_SOUNDrust-analyzer cargo gnome-robots 50.0.0 properties/ENABLE_SOUND.: &str = "enable-sound"; |
| 31 | const SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SAFE_MOVES.: &str = "use-safe-moves"; |
| 32 | const SUPER_SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SUPER_SAFE_MOVES.: &str = "use-super-safe-moves"; |
| 33 | const THEMErust-analyzer cargo gnome-robots 50.0.0 properties/THEME.: &str = "theme"; |
| 34 | |
| 35 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 36 | pub struct ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# { |
| 37 | pub settings_keyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#settings_key.: &'static str, |
| 38 | pub commandrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#command.: PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#, |
| 39 | _sealrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#_seal.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<()>, |
| 40 | } |
| 41 | |
| 42 | impl ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# { |
| 43 | const fn newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().(settings_key: &'static str, command: PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#) -> Selfrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey] { |
| 44 | Selfrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey] { |
| 45 | settings_keyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#settings_key., |
| 46 | commandrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#command., |
| 47 | _sealrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#_seal.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | pub const CONTROL_KEY_NWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NW.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key00", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::NWrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#NW#); |
| 53 | pub const CONTROL_KEY_Nrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_N.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key01", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::Nrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#N#); |
| 54 | pub const CONTROL_KEY_NErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NE.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key02", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::NErust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#NE#); |
| 55 | pub const CONTROL_KEY_Wrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_W.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key03", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::Wrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#W#); |
| 56 | pub const CONTROL_KEY_HOLDrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_HOLD.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key04", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::Stayrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#Stay#); |
| 57 | pub const CONTROL_KEY_Erust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_E.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key05", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::Erust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#E#); |
| 58 | pub const CONTROL_KEY_SWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SW.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key06", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::SWrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#SW#); |
| 59 | pub const CONTROL_KEY_Srust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_S.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key07", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::Srust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#S#); |
| 60 | pub const CONTROL_KEY_SErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SE.: ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey# = ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#::newrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[ControlKey]new().("key08", PlayerCommandrust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#::SErust-analyzer cargo gnome-robots 50.0.0 game/PlayerCommand#SE#); |
| 61 | |
| 62 | pub const CONTROL_KEYSrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEYS.: &[&ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#] = &[ |
| 63 | &CONTROL_KEY_NWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NW., |
| 64 | &CONTROL_KEY_Nrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_N., |
| 65 | &CONTROL_KEY_NErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NE., |
| 66 | &CONTROL_KEY_Wrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_W., |
| 67 | &CONTROL_KEY_HOLDrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_HOLD., |
| 68 | &CONTROL_KEY_Erust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_E., |
| 69 | &CONTROL_KEY_SWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SW., |
| 70 | &CONTROL_KEY_Srust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_S., |
| 71 | &CONTROL_KEY_SErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SE., |
| 72 | ]; |
| 73 | |
| 74 | pub trait Propertiesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties# { |
| 75 | fn safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#safe_moves().(&self) -> bool; |
| 76 | fn set_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_safe_moves().(&self, value: bool); |
| 77 | fn super_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#super_safe_moves().(&self) -> bool; |
| 78 | fn set_super_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_super_safe_moves().(&self, value: bool); |
| 79 | fn soundrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#sound().(&self) -> bool; |
| 80 | fn set_soundrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_sound().(&self, value: bool); |
| 81 | fn bgcolourrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#bgcolour().(&self) -> gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA#; |
| 82 | fn set_bgcolourrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_bgcolour().(&self, value: gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA#); |
| 83 | fn selected_configrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#selected_config().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#; |
| 84 | fn set_selected_configrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_selected_config().(&self, value: &str); |
| 85 | fn themerust-analyzer cargo gnome-robots 50.0.0 properties/Properties#theme().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#; |
| 86 | fn set_themerust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_theme().(&self, value: &str); |
| 87 | |
| 88 | fn get_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#get_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#) -> gdkrust-analyzer cargo gdk4 0.11.1 crate/::Keyrust-analyzer cargo gdk4 0.11.1 keys/Key#; |
| 89 | fn set_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#set_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#, key: gdkrust-analyzer cargo gdk4 0.11.1 crate/::Keyrust-analyzer cargo gdk4 0.11.1 keys/Key#); |
| 90 | fn reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#); |
| 91 | fn reset_all_control_keysrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_all_control_keys().(&self) { |
| 92 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_NWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NW.); |
| 93 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_Nrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_N.); |
| 94 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_NErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_NE.); |
| 95 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_Wrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_W.); |
| 96 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_HOLDrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_HOLD.); |
| 97 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_Erust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_E.); |
| 98 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_SWrust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SW.); |
| 99 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_Srust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_S.); |
| 100 | self.reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#reset_control_key().(&CONTROL_KEY_SErust-analyzer cargo gnome-robots 50.0.0 properties/CONTROL_KEY_SE.); |
| 101 | } |
| 102 | |
| 103 | fn move_safetyrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#move_safety().(&self) -> MoveSafetyrust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety# { |
| 104 | match (self.safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#safe_moves().(), self.super_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties#super_safe_moves().()) { |
| 105 | (_, true) => MoveSafetyrust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#::SuperSaferust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#SuperSafe#, |
| 106 | (true, false) => MoveSafetyrust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#::Saferust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#Safe#, |
| 107 | _ => MoveSafetyrust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#::Unsaferust-analyzer cargo gnome-robots 50.0.0 game/MoveSafety#Unsafe#, |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | impl Propertiesrust-analyzer cargo gnome-robots 50.0.0 properties/Properties# for giorust-analyzer cargo gio 0.22.2 crate/::Settingsrust-analyzer cargo gio 0.22.2 auto/settings/Settings# { |
| 113 | fn safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]safe_moves().(&self) -> bool { |
| 114 | self.booleanrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#boolean().(SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SAFE_MOVES.) |
| 115 | } |
| 116 | |
| 117 | fn set_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_safe_moves().(&self, value: bool) { |
| 118 | self.set_boolean_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_boolean_or_warn().(SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SAFE_MOVES., value); |
| 119 | } |
| 120 | |
| 121 | fn super_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]super_safe_moves().(&self) -> bool { |
| 122 | self.booleanrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#boolean().(SUPER_SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SUPER_SAFE_MOVES.) |
| 123 | } |
| 124 | |
| 125 | fn set_super_safe_movesrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_super_safe_moves().(&self, value: bool) { |
| 126 | self.set_boolean_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_boolean_or_warn().(SUPER_SAFE_MOVESrust-analyzer cargo gnome-robots 50.0.0 properties/SUPER_SAFE_MOVES., value); |
| 127 | } |
| 128 | |
| 129 | fn soundrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]sound().(&self) -> bool { |
| 130 | self.booleanrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#boolean().(ENABLE_SOUNDrust-analyzer cargo gnome-robots 50.0.0 properties/ENABLE_SOUND.) |
| 131 | } |
| 132 | |
| 133 | fn set_soundrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_sound().(&self, value: bool) { |
| 134 | self.set_boolean_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_boolean_or_warn().(ENABLE_SOUNDrust-analyzer cargo gnome-robots 50.0.0 properties/ENABLE_SOUND., value); |
| 135 | } |
| 136 | |
| 137 | fn bgcolourrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]bgcolour().(&self) -> gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA# { |
| 138 | gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA#::parserust-analyzer cargo gdk4 0.11.1 rgba/impl#[RGBA]parse().(self.stringrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#string().(BACKGROUND_COLORrust-analyzer cargo gnome-robots 50.0.0 properties/BACKGROUND_COLOR.)).unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or().(gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA#::BLACKrust-analyzer cargo gdk4 0.11.1 rgba/impl#[RGBA]BLACK.) |
| 139 | } |
| 140 | |
| 141 | fn set_bgcolourrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_bgcolour().(&self, value: gdkrust-analyzer cargo gdk4 0.11.1 crate/::RGBArust-analyzer cargo gdk4 0.11.1 auto/rgba/RGBA#) { |
| 142 | self.set_string_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_string_or_warn().(BACKGROUND_COLORrust-analyzer cargo gnome-robots 50.0.0 properties/BACKGROUND_COLOR., &value.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 143 | } |
| 144 | |
| 145 | fn selected_configrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]selected_config().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 146 | self.stringrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#string().(GAME_CONFIGURATIONrust-analyzer cargo gnome-robots 50.0.0 properties/GAME_CONFIGURATION.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 147 | } |
| 148 | |
| 149 | fn set_selected_configrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_selected_config().(&self, value: &str) { |
| 150 | self.set_string_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_string_or_warn().(GAME_CONFIGURATIONrust-analyzer cargo gnome-robots 50.0.0 properties/GAME_CONFIGURATION., value); |
| 151 | } |
| 152 | |
| 153 | fn themerust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]theme().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 154 | self.stringrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#string().(THEMErust-analyzer cargo gnome-robots 50.0.0 properties/THEME.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 155 | } |
| 156 | |
| 157 | fn set_themerust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_theme().(&self, value: &str) { |
| 158 | self.set_string_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_string_or_warn().(THEMErust-analyzer cargo gnome-robots 50.0.0 properties/THEME., value); |
| 159 | } |
| 160 | |
| 161 | fn get_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]get_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#) -> gdkrust-analyzer cargo gdk4 0.11.1 crate/::Keyrust-analyzer cargo gdk4 0.11.1 keys/Key# { |
| 162 | key_from_i32rust-analyzer cargo gnome-robots 50.0.0 controls/key_from_i32().(self.intrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#int().(k.settings_keyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#settings_key.)) |
| 163 | } |
| 164 | |
| 165 | fn set_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]set_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#, key: gdkrust-analyzer cargo gdk4 0.11.1 crate/::Keyrust-analyzer cargo gdk4 0.11.1 keys/Key#) { |
| 166 | self.set_int_or_warnrust-analyzer cargo gnome-robots 50.0.0 utils/impl#[`gio::Settings`][SettingsWarnExt]set_int_or_warn().(k.settings_keyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#settings_key., key_into_i32rust-analyzer cargo gnome-robots 50.0.0 controls/key_into_i32().(key)); |
| 167 | } |
| 168 | |
| 169 | fn reset_control_keyrust-analyzer cargo gnome-robots 50.0.0 properties/impl#[`gio::Settings`][Properties]reset_control_key().(&self, k: &ControlKeyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#) { |
| 170 | self.resetrust-analyzer cargo gio 0.22.2 auto/settings/SettingsExt#reset().(k.settings_keyrust-analyzer cargo gnome-robots 50.0.0 properties/ControlKey#settings_key.); |
| 171 | } |
| 172 | } |