Move func "settings_(get|set)_gap_for_single_window" to Rust
This commit is contained in:
parent
911f65e750
commit
1bf97dab72
|
@ -81,6 +81,16 @@ unsafe extern "C" fn settings_set_focus_on_wheel(value: bool) {
|
||||||
SETTINGS.unwrap().focus_on_wheel_set(value);
|
SETTINGS.unwrap().focus_on_wheel_set(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
unsafe extern "C" fn settings_get_gap_for_single_window() -> c_uchar {
|
||||||
|
SETTINGS.unwrap().gap_for_single_window().into()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
unsafe extern "C" fn settings_set_gap_for_single_window(value: c_uchar) {
|
||||||
|
SETTINGS.unwrap().gap_for_single_window_set(value.into());
|
||||||
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
unsafe extern "C" fn settings_get_gap_size() -> c_int {
|
unsafe extern "C" fn settings_get_gap_size() -> c_int {
|
||||||
SETTINGS.unwrap().gap_size()
|
SETTINGS.unwrap().gap_size()
|
||||||
|
|
|
@ -2,21 +2,9 @@
|
||||||
|
|
||||||
#include "constraints.h"
|
#include "constraints.h"
|
||||||
|
|
||||||
static SettingsForSingleWindow gap_for_single_window = SETTINGS_FOR_SINGLE_WINDOW_NOBODY_IS_FULLSCREEN;
|
|
||||||
static UnitKind master_area_factor_per_unit = UNIT_MONITOR;
|
static UnitKind master_area_factor_per_unit = UNIT_MONITOR;
|
||||||
static UnitKind show_bar_per_unit = UNIT_MONITOR;
|
static UnitKind show_bar_per_unit = UNIT_MONITOR;
|
||||||
|
|
||||||
SettingsForSingleWindow settings_get_gap_for_single_window()
|
|
||||||
{
|
|
||||||
return gap_for_single_window;
|
|
||||||
}
|
|
||||||
|
|
||||||
void settings_set_gap_for_single_window(const SettingsForSingleWindow new_gap_for_single_window)
|
|
||||||
{
|
|
||||||
gap_for_single_window = new_gap_for_single_window;
|
|
||||||
// TODO: notify WM to rearrange clients
|
|
||||||
}
|
|
||||||
|
|
||||||
UnitKind settings_get_master_area_factor_per_unit()
|
UnitKind settings_get_master_area_factor_per_unit()
|
||||||
{
|
{
|
||||||
return master_area_factor_per_unit;
|
return master_area_factor_per_unit;
|
||||||
|
|
|
@ -11,6 +11,7 @@ pub struct Settings {
|
||||||
default_master_area_factor: c_float,
|
default_master_area_factor: c_float,
|
||||||
enable_swallowing: bool,
|
enable_swallowing: bool,
|
||||||
focus_on_wheel: bool,
|
focus_on_wheel: bool,
|
||||||
|
gap_for_single_window: ForSingleWindow,
|
||||||
gap_size: c_int,
|
gap_size: c_int,
|
||||||
max_clients_in_master: Option<c_int>,
|
max_clients_in_master: Option<c_int>,
|
||||||
respect_resize_hints_in_floating_layout: bool,
|
respect_resize_hints_in_floating_layout: bool,
|
||||||
|
@ -37,6 +38,7 @@ impl Default for Settings {
|
||||||
default_master_area_factor: 0.6,
|
default_master_area_factor: 0.6,
|
||||||
enable_swallowing: true,
|
enable_swallowing: true,
|
||||||
focus_on_wheel: true,
|
focus_on_wheel: true,
|
||||||
|
gap_for_single_window: Default::default(),
|
||||||
gap_size: 10,
|
gap_size: 10,
|
||||||
max_clients_in_master: None,
|
max_clients_in_master: None,
|
||||||
respect_resize_hints_in_floating_layout: false,
|
respect_resize_hints_in_floating_layout: false,
|
||||||
|
@ -137,6 +139,15 @@ impl Settings {
|
||||||
self.focus_on_wheel = value;
|
self.focus_on_wheel = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn gap_for_single_window(&self) -> ForSingleWindow {
|
||||||
|
self.gap_for_single_window
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: notify WM to rearrange clients
|
||||||
|
pub fn gap_for_single_window_set(&mut self, value: ForSingleWindow) {
|
||||||
|
self.gap_for_single_window = value;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn gap_size(&self) -> c_int {
|
pub fn gap_size(&self) -> c_int {
|
||||||
self.gap_size
|
self.gap_size
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue