module Graphics.XHB.Requests.Internal.Instances.XPrint () where
import Graphics.XHB.Gen.XPrint
import Graphics.XHB.Requests.Internal.Classes
import Prelude (fmap)
import Data.Bifunctor (second)
import Graphics.XHB (getReply)
instance RequestWithReply PrintQueryVersion PrintQueryVersionReply
where
requestWithReplyIO (MkPrintQueryVersion) conn
= fmap getReply (printQueryVersion conn)
instance RequestWithReply PrintGetPrinterList
PrintGetPrinterListReply where
requestWithReplyIO req conn
= fmap getReply (printGetPrinterList conn req)
instance Request PrintRehashPrinterList where
requestIO (MkPrintRehashPrinterList) conn
= printRehashPrinterList conn
instance Request CreateContext where
requestIO req conn = createContext conn req
instance Request PrintSetContext where
requestIO (MkPrintSetContext a) conn = printSetContext conn a
instance RequestWithReply PrintGetContext PrintGetContextReply
where
requestWithReplyIO (MkPrintGetContext) conn
= fmap (fmap (second MkPrintGetContextReply))
(fmap getReply (printGetContext conn))
instance Request PrintDestroyContext where
requestIO (MkPrintDestroyContext a) conn
= printDestroyContext conn a
instance RequestWithReply PrintGetScreenOfContext
PrintGetScreenOfContextReply where
requestWithReplyIO (MkPrintGetScreenOfContext) conn
= fmap (fmap (second MkPrintGetScreenOfContextReply))
(fmap getReply (printGetScreenOfContext conn))
instance Request PrintStartJob where
requestIO (MkPrintStartJob a) conn = printStartJob conn a
instance Request PrintEndJob where
requestIO (MkPrintEndJob a) conn = printEndJob conn a
instance Request PrintStartDoc where
requestIO (MkPrintStartDoc a) conn = printStartDoc conn a
instance Request PrintEndDoc where
requestIO (MkPrintEndDoc a) conn = printEndDoc conn a
instance Request PrintPutDocumentData where
requestIO req conn = printPutDocumentData conn req
instance RequestWithReply PrintGetDocumentData
PrintGetDocumentDataReply where
requestWithReplyIO (MkPrintGetDocumentData a b) conn
= fmap getReply (printGetDocumentData conn a b)
instance Request PrintStartPage where
requestIO (MkPrintStartPage a) conn = printStartPage conn a
instance Request PrintEndPage where
requestIO (MkPrintEndPage a) conn = printEndPage conn a
instance Request PrintSelectInput where
requestIO (MkPrintSelectInput a b) conn = printSelectInput conn a b
instance RequestWithReply PrintInputSelected
PrintInputSelectedReply where
requestWithReplyIO (MkPrintInputSelected a) conn
= fmap getReply (printInputSelected conn a)
instance RequestWithReply PrintGetAttributes
PrintGetAttributesReply where
requestWithReplyIO (MkPrintGetAttributes a b) conn
= fmap getReply (printGetAttributes conn a b)
instance RequestWithReply PrintGetOneAttributes
PrintGetOneAttributesReply where
requestWithReplyIO req conn
= fmap getReply (printGetOneAttributes conn req)
instance Request PrintSetAttributes where
requestIO req conn = printSetAttributes conn req
instance RequestWithReply PrintGetPageDimensions
PrintGetPageDimensionsReply where
requestWithReplyIO (MkPrintGetPageDimensions a) conn
= fmap getReply (printGetPageDimensions conn a)
instance RequestWithReply PrintQueryScreens PrintQueryScreensReply
where
requestWithReplyIO (MkPrintQueryScreens) conn
= fmap getReply (printQueryScreens conn)
instance RequestWithReply PrintSetImageResolution
PrintSetImageResolutionReply where
requestWithReplyIO (MkPrintSetImageResolution a b) conn
= fmap getReply (printSetImageResolution conn a b)
instance RequestWithReply PrintGetImageResolution
PrintGetImageResolutionReply where
requestWithReplyIO (MkPrintGetImageResolution a) conn
= fmap (fmap (second MkPrintGetImageResolutionReply))
(fmap getReply (printGetImageResolution conn a))