module Convgc(convGCattrsK,convGCattrs) where import Control.Applicative import Color import LoadFont import Xtypes import StateMonads(Mk(..)) convGCattrsK attrs = unMk (mapM gcattrK attrs) gcattrK attr = convGCattr convColor (Mk . loadFont) attr where convColor = Mk . allocNamedColorPixel defaultColormap convGCattrs convColor convFont = mapM (convGCattr convColor convFont) convGCattr convColor convFont attr = case attr of GCForeground colname -> GCForeground <$> convColor colname GCBackground colname -> GCBackground <$> convColor colname GCFont fname -> GCFont <$> convFont fname GCFunction f -> return (GCFunction f) GCLineWidth w -> return (GCLineWidth w) GCLineStyle s -> return (GCLineStyle s) GCCapStyle s -> return (GCCapStyle s) GCJoinStyle s -> return (GCJoinStyle s) GCSubwindowMode m -> return (GCSubwindowMode m) GCGraphicsExposures b -> return (GCGraphicsExposures b) GCArcMode m -> return (GCArcMode m)