File: appendix.tex

package info (click to toggle)
ghc-cvs 20040725-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 68,484 kB
  • ctags: 19,658
  • sloc: haskell: 251,945; ansic: 109,709; asm: 24,961; sh: 12,825; perl: 5,786; makefile: 5,334; xml: 3,884; python: 682; yacc: 650; lisp: 477; cpp: 337; ml: 76; fortran: 24; csh: 18
file content (67 lines) | stat: -rw-r--r-- 2,139 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
\modName{GraphicsColor}

\begin{verbatim}
> data Color 
>   = Black
>   | Blue
>   | Green 
>   | Cyan
>   | Red 
>   | Magenta
>   | Yellow
>   | White
>  deriving (Eq, Ord, Bounded, Enum, Ix, Show, Read)
> colorList  :: [(Color, RGB)]
> colorTable :: Array Color RGB
> withColor  :: Color -> Graphic -> Graphic -- SOE, p51
\end{verbatim}

\modName{GraphicsEvent}

\begin{verbatim}
> data Event 
>   = Key       { char :: Char, isDown :: Bool }
>   | Button    { pt :: Point, isLeft, isDown :: Bool }
>   | MouseMove { pt :: Point }
>   | Resize
>   | Closed
>  deriving Show 
\end{verbatim}

\modName{GraphicsFont}

\begin{verbatim}
> createFont :: Point -> Angle -> Bool -> Bool -> String -> IO Font
> deleteFont :: Font -> IO ()
\end{verbatim}

\modName{GraphicsUtils}

\begin{verbatim}
> openWindow        :: Title -> Size -> IO Window
> clearWindow       :: Window -> IO ()
> drawInWindow      :: Window -> Graphic -> IO ()
> getWindowSize     :: Window -> IO Size
> getLBP            :: Window -> IO Point
> getRBP            :: Window -> IO Point
> getButton         :: Window -> Bool -> Bool -> IO Point
> getKey            :: Window -> IO Char
> getKeyEx          :: Window -> Bool -> IO Char
> withFont          :: Font      -> Graphic -> Graphic
> withTextColor     :: RGB       -> Graphic -> Graphic
> withTextAlignment :: Alignment -> Graphic -> Graphic
> withBkColor       :: RGB       -> Graphic -> Graphic
> withBkMode        :: BkMode    -> Graphic -> Graphic
> withPen           :: Pen       -> Graphic -> Graphic
> withRGB           :: RGB       -> Graphic -> Graphic
> withBrush         :: Brush     -> Graphic -> Graphic
> mkBrush           :: RGB                 -> (Brush -> Graphic) -> Graphic
> mkPen             :: Style -> Int -> RGB -> (Pen   -> Graphic) -> Graphic
> emptyGraphic      :: Graphic
> overGraphic       :: Graphic -> Graphic -> Graphic
> overGraphics      :: [Graphic] -> Graphic
> par               :: IO a -> IO b -> IO (a,b)
> par_              :: IO a -> IO b -> IO ()
> parMany           :: [IO ()] -> IO ()
\end{verbatim}