{-# LANGUAGE CPP #-}
module InputEditorF(
    EditorF,
    inputEditorF,inputEditorF',
    editorF,editorF')
  where
import Editor(oldEditorF,loadEditor)
import Edit(EditEvt(..))
--import InputMsg(InputMsg(..))
import CompOps
import SpEither(mapFilterSP)
import Spops(concatMapSP)
import ResourceIds() -- synonym FontName, for hbc
import GCAttrs --(FontSpec,fontSpec)
import Defaults(defaultFont)
import FDefaults

#include "defaults.h"

inputEditorF :: F String (InputMsg String)
inputEditorF = Customiser EditorF -> F String (InputMsg String)
inputEditorF' forall a. Customiser a
standard

inputEditorF' :: Customiser EditorF -> F String (InputMsg String)
inputEditorF' Customiser EditorF
pm =
    forall {t} {b}. (t -> Maybe b) -> SP t b
mapFilterSP EditEvt -> Maybe (InputMsg String)
change forall a b e. SP a b -> F e a -> F e b
>^^=< Customiser EditorF -> F EditCmd EditEvt
editorF' Customiser EditorF
pm forall c d e. F c d -> SP e c -> F e d
>=^^< forall {t} {b}. (t -> [b]) -> SP t b
concatMapSP String -> [EditCmd]
loadEditor
  where
    change :: EditEvt -> Maybe (InputMsg String)
change (EditChange InputMsg String
inputmsg) = forall a. a -> Maybe a
Just InputMsg String
inputmsg
    change EditEvt
_ = forall a. Maybe a
Nothing

editorF :: F EditCmd EditEvt
editorF = Customiser EditorF -> F EditCmd EditEvt
editorF' forall a. Customiser a
standard

editorF' :: Customiser EditorF -> F EditCmd EditEvt
editorF' Customiser EditorF
customiser = FontSpec -> F EditCmd EditEvt
oldEditorF FontSpec
font
  where
    font :: FontSpec
font = forall a. a -> Maybe a -> a
fromMaybe (forall {a}. (Show a, FontGen a) => a -> FontSpec
fontSpec String
defaultFont) forall a b. (a -> b) -> a -> b
$ forall xxx. HasFontSpec xxx => xxx -> Maybe FontSpec
getFontSpecMaybe EditorF
ps
    ps :: EditorF
ps = (Customiser EditorF
customiser::(Customiser EditorF))  ([Pars] -> EditorF
Pars [])

newtype EditorF = Pars [Pars]

data Pars
  = FontSpec FontSpec

parameter_instance(FontSpec,EditorF)