Skip to content

Commit

Permalink
Remove deprecated things
Browse files Browse the repository at this point in the history
  • Loading branch information
Gekkio committed Aug 12, 2018
1 parent 2677cb0 commit 21d85af
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 89 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Removed

- Various things that were deprecated in imgui-rs 0.0.18

## [0.0.19] - 2018-08-12

### Added
Expand Down
1 change: 0 additions & 1 deletion imgui-examples/examples/test_window_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
60 changes: 0 additions & 60 deletions imgui-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] = &[
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
17 changes: 1 addition & 16 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand All @@ -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>>,
}

Expand All @@ -28,7 +26,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
name,
opened: None,
flags: ImGuiWindowFlags::empty(),
border: false,
_phantom: PhantomData,
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -168,9 +156,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
}
unsafe {
sys::igEnd();
if self.border {
sys::igPopStyleVar(1);
}
};
}
}

0 comments on commit 21d85af

Please sign in to comment.