arcdps_imgui\window/
content_region.rs

1use crate::sys;
2use crate::Ui;
3
4/// # Content region
5impl<'ui> Ui<'ui> {
6    /// Returns the current content boundaries (in *window coordinates*)
7    #[doc(alias = "GetContentRegionMax")]
8    pub fn content_region_max(&self) -> [f32; 2] {
9        let mut out = sys::ImVec2::zero();
10        unsafe { sys::igGetContentRegionMax(&mut out) };
11        out.into()
12    }
13    /// Equal to `ui.content_region_max()` - `ui.cursor_pos()`
14    #[doc(alias = "GetContentRegionAvail")]
15    pub fn content_region_avail(&self) -> [f32; 2] {
16        let mut out = sys::ImVec2::zero();
17        unsafe { sys::igGetContentRegionAvail(&mut out) };
18        out.into()
19    }
20    /// Content boundaries min (in *window coordinates*).
21    ///
22    /// Roughly equal to [0.0, 0.0] - scroll.
23    #[doc(alias = "GetContentRegionMin")]
24    pub fn window_content_region_min(&self) -> [f32; 2] {
25        let mut out = sys::ImVec2::zero();
26        unsafe { sys::igGetWindowContentRegionMin(&mut out) };
27        out.into()
28    }
29    /// Content boundaries max (in *window coordinates*).
30    ///
31    /// Roughly equal to [0.0, 0.0] + size - scroll.
32    #[doc(alias = "GetContentRegionMax")]
33    pub fn window_content_region_max(&self) -> [f32; 2] {
34        let mut out = sys::ImVec2::zero();
35        unsafe { sys::igGetWindowContentRegionMax(&mut out) };
36        out.into()
37    }
38    #[doc(alias = "GetContentRegionWidth")]
39    pub fn window_content_region_width(&self) -> f32 {
40        unsafe { sys::igGetWindowContentRegionWidth() }
41    }
42}