From f337b63f1eeb7554c60921a5cc46916f871a2eb0 Mon Sep 17 00:00:00 2001 From: daa84 Date: Wed, 22 Mar 2017 18:37:34 +0300 Subject: [PATCH] Thoughts --- src/cursor.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/cursor.rs b/src/cursor.rs index 1dbbcc9..f011eb4 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -2,6 +2,9 @@ use cairo; use ui_model::Color; use shell::{Shell, NvimMode}; +use glib; + +// display, 2 sec -> hiding 1 sec -> not visible 1 sec -> showing 1 sec pub struct Cursor { } @@ -29,3 +32,29 @@ impl Cursor { ctx.fill(); } } + + +pub struct Animation { + state_stream: Vec>, + state: Option>, + timer: Option, +} + +impl Animation { + pub fn new() -> Animation { + Animation { + state_stream: vec![], + state: None, + timer: None, + } + } +} + +trait AnimationState { + fn clone(&self) -> AnimationState; + + // [TODO]: Description - repaint rect here + fn next(&mut self) -> Option; + + fn paint(&self, ctx: &cairo::Context, shell: &Shell); +}