module Window ( Window(..), TextWindow(..), GlyphWindow(..) ) where import Util.Grid import Color import Glyph class Window w where new_window :: Position -> Position -> IO w window_size :: w -> Position refresh_window :: w -> IO () destroy_window :: w -> IO () touch_window :: w -> IO () clear_window :: w -> IO () move_cursor :: w -> Position -> IO () get_cursor_position :: w -> IO Position window_bounds :: w -> (Position, Position) window_bounds w = case window_size w of (hsize, vsize) -> ((0, 0), (hsize - 1, vsize - 1)) class (Window w) => TextWindow w where write_string :: w -> Color -> String -> IO () class (Window w) => GlyphWindow w where write_glyph :: w -> Position -> Glyph -> IO ()