From 21d85afee05278b4fbd66af2bba90b7633a1720c Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Sun, 12 Aug 2018 20:25:43 +0300 Subject: [PATCH] Remove deprecated things --- CHANGELOG.markdown | 4 ++ imgui-examples/examples/test_window_impl.rs | 1 - imgui-sys/src/lib.rs | 60 --------------------- src/lib.rs | 4 -- src/style.rs | 8 --- src/window.rs | 17 +----- 6 files changed, 5 insertions(+), 89 deletions(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 800cfe8..e980c5d 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -2,6 +2,10 @@ ## [Unreleased] +### Removed + +- Various things that were deprecated in imgui-rs 0.0.18 + ## [0.0.19] - 2018-08-12 ### Added diff --git a/imgui-examples/examples/test_window_impl.rs b/imgui-examples/examples/test_window_impl.rs index 0cd760a..cbbeb21 100644 --- a/imgui-examples/examples/test_window_impl.rs +++ b/imgui-examples/examples/test_window_impl.rs @@ -748,7 +748,6 @@ output your content because that would create a feedback loop.", }) } -#[allow(deprecated)] fn show_example_app_fixed_overlay(ui: &Ui, opened: &mut bool) { const DISTANCE: f32 = 10.0; let window_pos = (DISTANCE, DISTANCE); diff --git a/imgui-sys/src/lib.rs b/imgui-sys/src/lib.rs index 0c6c73a..dc5f848 100644 --- a/imgui-sys/src/lib.rs +++ b/imgui-sys/src/lib.rs @@ -86,13 +86,6 @@ pub enum ImGuiCol { DragDropTarget, } impl ImGuiCol { - #[deprecated( - since = "0.0.19", note = "ComboBg has been merged with PopupBg. Please use PopupBg instead" - )] - pub const ComboBg: ImGuiCol = ImGuiCol::PopupBg; - #[deprecated(since = "0.0.19", note = "please use ChildBg instead")] - pub const ChildWindowBg: ImGuiCol = ImGuiCol::ChildBg; - pub fn values() -> &'static [ImGuiCol] { use ImGuiCol::*; static values: &'static [ImGuiCol] = &[ @@ -169,11 +162,6 @@ pub enum ImGuiStyleVar { } pub const ImGuiStyleVar_COUNT: usize = 17; -impl ImGuiStyleVar { - #[deprecated(since = "0.0.19", note = "please use ChildRounding instead")] - pub const ChildWindowRounding: ImGuiStyleVar = ImGuiStyleVar::ChildRounding; -} - /// A key identifier (ImGui-side enum) #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -316,8 +304,6 @@ bitflags!( pub struct ImGuiTreeNodeFlags: c_int { const Selected = 1; const Framed = 1 << 1; - #[deprecated(since = "0.0.19", note = "please use AllowItemOverlap instead")] - const AllowOverlapMode = 1 << 2; const AllowItemOverlap = 1 << 2; const NoTreePushOnOpen = 1 << 3; const NoAutoOpenOnLog = 1 << 4; @@ -1015,12 +1001,6 @@ extern "C" { pub fn igShowUserGuide(); } -#[allow(non_snake_case)] -#[deprecated(since = "0.0.19", note = "please use igShowDemoWindow instead")] -pub unsafe fn igShowTestWindow(opened: *mut bool) { - igShowDemoWindow(opened) -} - // Window extern "C" { pub fn igBegin(name: *const c_char, open: *mut bool, flags: ImGuiWindowFlags) -> bool; @@ -1085,16 +1065,6 @@ extern "C" { pub fn igGetStateStorage() -> *mut ImGuiStorage; } -/// Set next window content's width. -/// -/// Original non-deprecated version preserved last Y value set by -/// [`igSetNextWindowContentSize`]. -#[allow(non_snake_case)] -#[deprecated(since = "0.0.19", note = "please use igSetNextWindowContentSize instead")] -pub unsafe fn igSetNextWindowContentWidth(width: c_float) { - igSetNextWindowContentSize(ImVec2 { x: width, y: 0.0 }) -} - // Parameter stack (shared) extern "C" { pub fn igPushFont(font: *mut ImFont); @@ -1154,12 +1124,6 @@ extern "C" { pub fn igGetFrameHeightWithSpacing() -> c_float; } -#[allow(non_snake_case)] -#[deprecated(since = "0.0.19", note = "please use igGetFrameHeightWithSpacing instead")] -pub unsafe fn igGetItemsLineHeightWithSpacing() -> c_float { - igGetFrameHeightWithSpacing() -} - // Columns extern "C" { pub fn igColumns(count: c_int, id: *const c_char, border: bool); @@ -1843,30 +1807,6 @@ extern "C" { ); } -#[allow(non_snake_case)] -#[deprecated( - since = "0.0.19", note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootWindow) instead" -)] -pub unsafe fn igIsRootWindowFocused() -> bool { - igIsWindowFocused(ImGuiFocusedFlags::RootWindow) -} -#[allow(non_snake_case)] -#[deprecated( - since = "0.0.19", - note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) instead" -)] -pub unsafe fn igIsRootWindowOrAnyChildFocused() -> bool { - igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) -} -#[allow(non_snake_case)] -#[deprecated( - since = "0.0.19", - note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) instead" -)] -pub unsafe fn igIsRootWindowOrAnyChildHovered(_flags: ImGuiHoveredFlags) -> bool { - igIsWindowHovered(ImGuiHoveredFlags::RootAndChildWindows) -} - // DrawList extern "C" { pub fn igGetOverlayDrawList() -> *mut ImDrawList; diff --git a/src/lib.rs b/src/lib.rs index 4f2be64..6e7757a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -556,10 +556,6 @@ impl<'ui> Ui<'ui> { sys::igShowStyleEditor(style as *mut ImGuiStyle); } } - #[deprecated(since = "0.0.19", note = "please use show_demo_window instead")] - pub fn show_test_window(&self, opened: &mut bool) { - self.show_demo_window(opened) - } pub fn show_demo_window(&self, opened: &mut bool) { unsafe { sys::igShowDemoWindow(opened); diff --git a/src/style.rs b/src/style.rs index 5e3039b..19218d7 100644 --- a/src/style.rs +++ b/src/style.rs @@ -20,11 +20,3 @@ pub enum StyleVar { GrabMinSize(f32), ButtonTextAlign(ImVec2), } - -impl StyleVar { - #[allow(non_snake_case)] - #[deprecated(since = "0.0.19", note = "please use ChildRounding instead")] - pub fn ChildWindowRounding(value: f32) -> Self { - StyleVar::ChildRounding(value) - } -} diff --git a/src/window.rs b/src/window.rs index d25b699..8926552 100644 --- a/src/window.rs +++ b/src/window.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use std::ptr; use sys; -use super::{ImGuiCond, ImGuiStyleVar, ImGuiWindowFlags, ImStr, ImVec2, Ui}; +use super::{ImGuiCond, ImGuiWindowFlags, ImStr, ImVec2, Ui}; #[must_use] pub struct Window<'ui, 'p> { @@ -13,8 +13,6 @@ pub struct Window<'ui, 'p> { name: &'p ImStr, opened: Option<&'p mut bool>, flags: ImGuiWindowFlags, - // Deprecated. Should be removed along with Window::show_borders - border: bool, _phantom: PhantomData<&'ui Ui<'ui>>, } @@ -28,7 +26,6 @@ impl<'ui, 'p> Window<'ui, 'p> { name, opened: None, flags: ImGuiWindowFlags::empty(), - border: false, _phantom: PhantomData, } } @@ -90,12 +87,6 @@ impl<'ui, 'p> Window<'ui, 'p> { self } #[inline] - #[deprecated(since = "0.0.19", note = "please use StyleVar instead")] - pub fn show_borders(mut self, value: bool) -> Self { - self.border = value; - self - } - #[inline] pub fn save_settings(mut self, value: bool) -> Self { self.flags.set(ImGuiWindowFlags::NoSavedSettings, !value); self @@ -152,9 +143,6 @@ impl<'ui, 'p> Window<'ui, 'p> { if !self.size_cond.is_empty() { sys::igSetNextWindowSize(self.size.into(), self.size_cond); } - if self.border { - sys::igPushStyleVar(ImGuiStyleVar::WindowBorderSize, 1.0); - } sys::igBegin( self.name.as_ptr(), self.opened @@ -168,9 +156,6 @@ impl<'ui, 'p> Window<'ui, 'p> { } unsafe { sys::igEnd(); - if self.border { - sys::igPopStyleVar(1); - } }; } }