-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40d705b
commit c8b40e9
Showing
5 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
termbox2-bindings-hs/src/Termbox2/Bindings/Hs/Internal/OutputMode.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module Termbox2.Bindings.Hs.Internal.OutputMode | ||
( Tb_output_mode | ||
( Tb_output_mode, | ||
TB_OUTPUT_216, | ||
TB_OUTPUT_256, | ||
TB_OUTPUT_GRAYSCALE, | ||
TB_OUTPUT_NORMAL, | ||
TB_OUTPUT_TRUECOLOR | ||
), | ||
) | ||
where | ||
|
||
import Foreign.C.Types (CInt) | ||
import Termbox2.Bindings.C | ||
|
||
-- | The output mode. | ||
newtype Tb_output_mode | ||
= Tb_output_mode CInt | ||
deriving stock (Eq) | ||
|
||
instance Show Tb_output_mode where | ||
show = \case | ||
TB_OUTPUT_216 -> "TB_OUTPUT_216" | ||
TB_OUTPUT_256 -> "TB_OUTPUT_256" | ||
TB_OUTPUT_GRAYSCALE -> "TB_OUTPUT_GRAYSCALE" | ||
TB_OUTPUT_NORMAL -> "TB_OUTPUT_NORMAL" | ||
TB_OUTPUT_TRUECOLOR -> "TB_OUTPUT_TRUECOLOR" | ||
Tb_output_mode mode -> show ("Tb_output_mode " ++ show mode) | ||
|
||
pattern TB_OUTPUT_216 :: Tb_output_mode | ||
pattern TB_OUTPUT_216 <- | ||
((== Tb_output_mode _TB_OUTPUT_216) -> True) | ||
where | ||
TB_OUTPUT_216 = Tb_output_mode _TB_OUTPUT_216 | ||
|
||
pattern TB_OUTPUT_256 :: Tb_output_mode | ||
pattern TB_OUTPUT_256 <- | ||
((== Tb_output_mode _TB_OUTPUT_256) -> True) | ||
where | ||
TB_OUTPUT_256 = Tb_output_mode _TB_OUTPUT_256 | ||
|
||
pattern TB_OUTPUT_GRAYSCALE :: Tb_output_mode | ||
pattern TB_OUTPUT_GRAYSCALE <- | ||
((== Tb_output_mode _TB_OUTPUT_GRAYSCALE) -> True) | ||
where | ||
TB_OUTPUT_GRAYSCALE = Tb_output_mode _TB_OUTPUT_GRAYSCALE | ||
|
||
pattern TB_OUTPUT_NORMAL :: Tb_output_mode | ||
pattern TB_OUTPUT_NORMAL <- | ||
((== Tb_output_mode _TB_OUTPUT_NORMAL) -> True) | ||
where | ||
TB_OUTPUT_NORMAL = Tb_output_mode _TB_OUTPUT_NORMAL | ||
|
||
pattern TB_OUTPUT_TRUECOLOR :: Tb_output_mode | ||
pattern TB_OUTPUT_TRUECOLOR <- | ||
((== Tb_output_mode _TB_OUTPUT_TRUECOLOR) -> True) | ||
where | ||
TB_OUTPUT_TRUECOLOR = Tb_output_mode _TB_OUTPUT_TRUECOLOR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters