{-# OPTIONS_HADDOCK hide #-}
module Graphics.UI.GLUT.Raw.Fonts (
BitmapFont(..), GLUTbitmapFont, marshalBitmapFont,
StrokeFont(..), GLUTstrokeFont, marshalStrokeFont
) where
import Control.Monad.IO.Class ( MonadIO(..) )
import Foreign.C.Types
import Foreign.Ptr ( Ptr )
data BitmapFont
= Fixed8By13
| Fixed9By15
| TimesRoman10
| TimesRoman24
| Helvetica10
| Helvetica12
| Helvetica18
deriving ( BitmapFont -> BitmapFont -> Bool
(BitmapFont -> BitmapFont -> Bool)
-> (BitmapFont -> BitmapFont -> Bool) -> Eq BitmapFont
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BitmapFont -> BitmapFont -> Bool
$c/= :: BitmapFont -> BitmapFont -> Bool
== :: BitmapFont -> BitmapFont -> Bool
$c== :: BitmapFont -> BitmapFont -> Bool
Eq, Eq BitmapFont
Eq BitmapFont
-> (BitmapFont -> BitmapFont -> Ordering)
-> (BitmapFont -> BitmapFont -> Bool)
-> (BitmapFont -> BitmapFont -> Bool)
-> (BitmapFont -> BitmapFont -> Bool)
-> (BitmapFont -> BitmapFont -> Bool)
-> (BitmapFont -> BitmapFont -> BitmapFont)
-> (BitmapFont -> BitmapFont -> BitmapFont)
-> Ord BitmapFont
BitmapFont -> BitmapFont -> Bool
BitmapFont -> BitmapFont -> Ordering
BitmapFont -> BitmapFont -> BitmapFont
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BitmapFont -> BitmapFont -> BitmapFont
$cmin :: BitmapFont -> BitmapFont -> BitmapFont
max :: BitmapFont -> BitmapFont -> BitmapFont
$cmax :: BitmapFont -> BitmapFont -> BitmapFont
>= :: BitmapFont -> BitmapFont -> Bool
$c>= :: BitmapFont -> BitmapFont -> Bool
> :: BitmapFont -> BitmapFont -> Bool
$c> :: BitmapFont -> BitmapFont -> Bool
<= :: BitmapFont -> BitmapFont -> Bool
$c<= :: BitmapFont -> BitmapFont -> Bool
< :: BitmapFont -> BitmapFont -> Bool
$c< :: BitmapFont -> BitmapFont -> Bool
compare :: BitmapFont -> BitmapFont -> Ordering
$ccompare :: BitmapFont -> BitmapFont -> Ordering
$cp1Ord :: Eq BitmapFont
Ord, Int -> BitmapFont -> ShowS
[BitmapFont] -> ShowS
BitmapFont -> String
(Int -> BitmapFont -> ShowS)
-> (BitmapFont -> String)
-> ([BitmapFont] -> ShowS)
-> Show BitmapFont
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BitmapFont] -> ShowS
$cshowList :: [BitmapFont] -> ShowS
show :: BitmapFont -> String
$cshow :: BitmapFont -> String
showsPrec :: Int -> BitmapFont -> ShowS
$cshowsPrec :: Int -> BitmapFont -> ShowS
Show )
type GLUTbitmapFont = Ptr ()
marshalBitmapFont :: MonadIO m => BitmapFont -> m GLUTbitmapFont
marshalBitmapFont :: BitmapFont -> m GLUTbitmapFont
marshalBitmapFont BitmapFont
x = IO GLUTbitmapFont -> m GLUTbitmapFont
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLUTbitmapFont -> m GLUTbitmapFont)
-> IO GLUTbitmapFont -> m GLUTbitmapFont
forall a b. (a -> b) -> a -> b
$ case BitmapFont
x of
BitmapFont
Fixed8By13 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
0
BitmapFont
Fixed9By15 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
1
BitmapFont
TimesRoman10 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
2
BitmapFont
TimesRoman24 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
3
BitmapFont
Helvetica10 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
4
BitmapFont
Helvetica12 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
5
BitmapFont
Helvetica18 -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalBitmapFont CInt
6
foreign import ccall unsafe "hs_GLUT_marshalBitmapFont"
hs_GLUT_marshalBitmapFont :: CInt -> IO (Ptr a)
data StrokeFont
= Roman
| MonoRoman
deriving ( StrokeFont -> StrokeFont -> Bool
(StrokeFont -> StrokeFont -> Bool)
-> (StrokeFont -> StrokeFont -> Bool) -> Eq StrokeFont
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StrokeFont -> StrokeFont -> Bool
$c/= :: StrokeFont -> StrokeFont -> Bool
== :: StrokeFont -> StrokeFont -> Bool
$c== :: StrokeFont -> StrokeFont -> Bool
Eq, Eq StrokeFont
Eq StrokeFont
-> (StrokeFont -> StrokeFont -> Ordering)
-> (StrokeFont -> StrokeFont -> Bool)
-> (StrokeFont -> StrokeFont -> Bool)
-> (StrokeFont -> StrokeFont -> Bool)
-> (StrokeFont -> StrokeFont -> Bool)
-> (StrokeFont -> StrokeFont -> StrokeFont)
-> (StrokeFont -> StrokeFont -> StrokeFont)
-> Ord StrokeFont
StrokeFont -> StrokeFont -> Bool
StrokeFont -> StrokeFont -> Ordering
StrokeFont -> StrokeFont -> StrokeFont
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: StrokeFont -> StrokeFont -> StrokeFont
$cmin :: StrokeFont -> StrokeFont -> StrokeFont
max :: StrokeFont -> StrokeFont -> StrokeFont
$cmax :: StrokeFont -> StrokeFont -> StrokeFont
>= :: StrokeFont -> StrokeFont -> Bool
$c>= :: StrokeFont -> StrokeFont -> Bool
> :: StrokeFont -> StrokeFont -> Bool
$c> :: StrokeFont -> StrokeFont -> Bool
<= :: StrokeFont -> StrokeFont -> Bool
$c<= :: StrokeFont -> StrokeFont -> Bool
< :: StrokeFont -> StrokeFont -> Bool
$c< :: StrokeFont -> StrokeFont -> Bool
compare :: StrokeFont -> StrokeFont -> Ordering
$ccompare :: StrokeFont -> StrokeFont -> Ordering
$cp1Ord :: Eq StrokeFont
Ord, Int -> StrokeFont -> ShowS
[StrokeFont] -> ShowS
StrokeFont -> String
(Int -> StrokeFont -> ShowS)
-> (StrokeFont -> String)
-> ([StrokeFont] -> ShowS)
-> Show StrokeFont
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StrokeFont] -> ShowS
$cshowList :: [StrokeFont] -> ShowS
show :: StrokeFont -> String
$cshow :: StrokeFont -> String
showsPrec :: Int -> StrokeFont -> ShowS
$cshowsPrec :: Int -> StrokeFont -> ShowS
Show )
type GLUTstrokeFont = Ptr ()
marshalStrokeFont :: MonadIO m => StrokeFont -> m GLUTstrokeFont
marshalStrokeFont :: StrokeFont -> m GLUTbitmapFont
marshalStrokeFont StrokeFont
x = IO GLUTbitmapFont -> m GLUTbitmapFont
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLUTbitmapFont -> m GLUTbitmapFont)
-> IO GLUTbitmapFont -> m GLUTbitmapFont
forall a b. (a -> b) -> a -> b
$ case StrokeFont
x of
StrokeFont
Roman -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalStrokeFont CInt
0
StrokeFont
MonoRoman -> CInt -> IO GLUTbitmapFont
forall a. CInt -> IO (Ptr a)
hs_GLUT_marshalStrokeFont CInt
1
foreign import ccall unsafe "hs_GLUT_marshalStrokeFont"
hs_GLUT_marshalStrokeFont :: CInt -> IO (Ptr a)