From 1f5bb7c449e9f6f13dfd84640c426e7cdd91be49 Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Tue, 2 Jul 2019 00:12:08 +0300 Subject: [PATCH] Add more deprecations --- src/legacy.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/legacy.rs b/src/legacy.rs index cc7f6af..cc33891 100644 --- a/src/legacy.rs +++ b/src/legacy.rs @@ -5,15 +5,15 @@ use std::os::raw::c_int; use std::str; use crate::fonts::atlas::{FontAtlas, FontAtlasTexture, FontConfig}; -use crate::fonts::glyph_ranges::FontGlyphRanges; use crate::fonts::font::Font; +use crate::fonts::glyph_ranges::FontGlyphRanges; use crate::input::keyboard::Key; use crate::input::mouse::{MouseButton, MouseCursor}; +use crate::internal::RawCast; use crate::render::draw_data::{DrawIdx, DrawVert}; use crate::render::renderer::TextureId; -use crate::internal::RawCast; -use crate::style::{StyleColor, StyleVar, Style}; -use crate::{Context, Ui, Condition}; +use crate::style::{Style, StyleColor, StyleVar}; +use crate::{Condition, Context, Ui}; #[deprecated(since = "0.1.0", note = "use Font instead")] pub type ImFont = Font; @@ -409,6 +409,10 @@ bitflags!( ); impl Context { + #[deprecated(since = "0.1.0", note = "Use Context::create instead")] + pub fn init() -> Context { + Context::create() + } #[deprecated(since = "0.1.0", note = "Access Io::ini_saving_rate directly instead")] pub fn set_ini_saving_rate(&mut self, value: f32) { let io = self.io_mut(); @@ -653,6 +657,14 @@ impl Context { pub fn get_frame_rate(&self) -> f32 { self.io().framerate } + #[deprecated(since = "0.1.0", note = "Use Context::time instead")] + pub fn get_time(&self) -> f64 { + self.time() + } + #[deprecated(since = "0.1.0", note = "Use Context::frame_count instead")] + pub fn get_frame_count(&self) -> i32 { + self.frame_count() + } } impl<'ui> Ui<'ui> {