{-# LANGUAGE CPP #-}
#if defined(mingw32_HOST_OS)
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-orphans #-}
#endif
module TextShow.System.Win32 () where
#if defined(mingw32_HOST_OS)
import System.Win32.DebugApi (DebugEventInfo, Exception)
import System.Win32.File (BY_HANDLE_FILE_INFORMATION, WIN32_FILE_ATTRIBUTE_DATA)
import System.Win32.Info (ProcessorArchitecture, SYSTEM_INFO)
import System.Win32.Time (FILETIME, SYSTEMTIME, TIME_ZONE_INFORMATION, TimeZoneId)
# if MIN_VERSION_Win32(2,5,0)
import Prelude ()
import Prelude.Compat
import Graphics.Win32.GDI.AlphaBlend (BLENDFUNCTION)
import System.Win32.Automation.Input (HARDWAREINPUT, INPUT)
import System.Win32.Automation.Input.Key (KEYBDINPUT)
import System.Win32.Automation.Input.Mouse (MOUSEINPUT)
import System.Win32.Exception.Unsupported (Unsupported(..))
import System.Win32.Info.Version (ProductType, OSVERSIONINFOEX)
import System.Win32.Mem (MEMORY_BASIC_INFORMATION)
import System.Win32.SimpleMAPI (RecipientClass, Recipient, FileTag, Attachment, Message)
import TextShow (TextShow(..), fromString)
# endif
import TextShow.TH (deriveTextShow)
$(deriveTextShow ''Exception)
$(deriveTextShow ''DebugEventInfo)
$(deriveTextShow ''FILETIME)
$(deriveTextShow ''BY_HANDLE_FILE_INFORMATION)
$(deriveTextShow ''WIN32_FILE_ATTRIBUTE_DATA)
$(deriveTextShow ''ProcessorArchitecture)
$(deriveTextShow ''SYSTEM_INFO)
$(deriveTextShow ''SYSTEMTIME)
$(deriveTextShow ''TIME_ZONE_INFORMATION)
$(deriveTextShow ''TimeZoneId)
# if MIN_VERSION_Win32(2,5,0)
$(deriveTextShow ''BLENDFUNCTION)
$(deriveTextShow ''KEYBDINPUT)
$(deriveTextShow ''MOUSEINPUT)
$(deriveTextShow ''HARDWAREINPUT)
$(deriveTextShow ''INPUT)
$(deriveTextShow ''ProductType)
$(deriveTextShow ''OSVERSIONINFOEX)
$(deriveTextShow ''MEMORY_BASIC_INFORMATION)
$(deriveTextShow ''RecipientClass)
$(deriveTextShow ''Recipient)
$(deriveTextShow ''FileTag)
$(deriveTextShow ''Attachment)
$(deriveTextShow ''Message)
instance TextShow Unsupported where
showb (MissingLibrary name reason)
= "Can't load library \"" <> fromString name <> "\". " <> fromString reason
showb (MissingFunction name reason)
= "Can't find \"" <> fromString name <> "\" function. " <> fromString reason
showb (MissingValue name reason)
= "Can't use \"" <> fromString name <> "\" value. " <> fromString reason
# endif
#endif