wxcore 0.92.2.0 → 0.92.3.0
raw patch · 10 files changed
+52/−26 lines, 10 filessetup-changed
Files
- Setup.hs +24/−9
- src/haskell/Graphics/UI/WXCore/Draw.hs +2/−0
- src/haskell/Graphics/UI/WXCore/Layout.hs +2/−0
- src/haskell/Graphics/UI/WXCore/Types.hs +1/−0
- src/haskell/Graphics/UI/WXCore/WxcClassInfo.hs +1/−0
- src/haskell/Graphics/UI/WXCore/WxcClassesAL.hs +1/−0
- src/haskell/Graphics/UI/WXCore/WxcClassesMZ.hs +1/−0
- src/haskell/Graphics/UI/WXCore/WxcDefs.hs +3/−0
- src/haskell/Graphics/UI/WXCore/WxcTypes.hs +3/−15
- wxcore.cabal +14/−2
Setup.hs view
@@ -1,7 +1,12 @@+ +{-# LANGUAGE CPP #-} + +import qualified Control.Exception as E import Control.Monad (when, filterM) import Data.List (foldl', intersperse, intercalate, nub, lookup, isPrefixOf, isInfixOf, find) import Data.Maybe (fromJust) import Distribution.PackageDescription hiding (includeDirs) +import qualified Distribution.PackageDescription as PD (includeDirs) import Distribution.InstalledPackageInfo(installedPackageId, sourcePackageId, includeDirs) import Distribution.Simple import Distribution.Simple.LocalBuildInfo (LocalBuildInfo, localPkgDescr, installedPkgs, withPrograms, buildDir) @@ -26,10 +31,10 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- wxcoreDirectory :: FilePath -wxcoreDirectory = "src" </> "haskell" </> "Graphics" </> "UI" </> "WXCore"-+wxcoreDirectory = "src" </> "haskell" </> "Graphics" </> "UI" </> "WXCore" + wxcoreDirectoryQuoted :: FilePath -wxcoreDirectoryQuoted = "\"" ++ wxcoreDirectory ++ "\""+wxcoreDirectoryQuoted = "\"" ++ wxcoreDirectory ++ "\"" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -55,19 +60,26 @@ -- Comment out type signature because of a Cabal API change from 1.6 to 1.7 myConfHook (pkg0, pbi) flags = do createDirectoryIfMissing True wxcoreDirectory + +#if defined(freebsd_HOST_OS) || defined (netbsd_HOST_OS) + -- Find GL/glx.h include path using pkg-config + glIncludeDirs <- readProcess "pkg-config" ["--cflags", "gl"] "" `E.onException` return "" +#else + let glIncludeDirs = "" +#endif lbi <- confHook simpleUserHooks (pkg0, pbi) flags wxcDirectory <- wxcInstallDir lbi let wxcoreIncludeFile = "\"" ++ wxcDirectory </> "include" </> "wxc.h\"" - let wxcDirectoryQuoted = "\"" ++ wxcDirectory ++ "\""+ let wxcDirectoryQuoted = "\"" ++ wxcDirectory ++ "\"" let system' command = putStrLn command >> system command putStrLn "Generating class type definitions from .h files" system' $ "wxdirect -t --wxc " ++ wxcDirectoryQuoted ++ " -o " ++ wxcoreDirectoryQuoted ++ " " ++ wxcoreIncludeFile -+ putStrLn "Generating class info definitions" system' $ "wxdirect -i --wxc " ++ wxcDirectoryQuoted ++ " -o " ++ wxcoreDirectoryQuoted ++ " " ++ wxcoreIncludeFile -+ putStrLn "Generating class method definitions from .h files" system' $ "wxdirect -c --wxc " ++ wxcDirectoryQuoted ++ " -o " ++ wxcoreDirectoryQuoted ++ " " ++ wxcoreIncludeFile @@ -77,9 +89,12 @@ let custom_bi = customFieldsBI libbi let libbi' = libbi - { extraLibDirs = extraLibDirs libbi ++ [wxcDirectory] - , extraLibs = extraLibs libbi ++ ["wxc"] - , ldOptions = ldOptions libbi ++ ["-Wl,-rpath," ++ wxcDirectory] } + { extraLibDirs = extraLibDirs libbi ++ [wxcDirectory] + , extraLibs = extraLibs libbi ++ ["wxc"] + , PD.includeDirs = PD.includeDirs libbi ++ case glIncludeDirs of + ('-':'I':v) -> [v]; + _ -> [] + , ldOptions = ldOptions libbi ++ ["-Wl,-rpath," ++ wxcDirectory] } let lib' = lib { libBuildInfo = libbi' } let lpd' = lpd { library = Just lib' }
src/haskell/Graphics/UI/WXCore/Draw.hs view
@@ -70,11 +70,13 @@ io -- | Use a 'PaintDC'. +-- Draw on a window within an 'on paint' event. withPaintDC :: Window a -> (PaintDC () -> IO b) -> IO b withPaintDC window draw = bracket (paintDCCreate window) (paintDCDelete) (\dc -> dcDraw dc (draw dc)) -- | Use a 'ClientDC'. +-- Draw on a window from outside an 'on paint' event. withClientDC :: Window a -> (ClientDC () -> IO b) -> IO b withClientDC window draw = bracket (clientDCCreate window) (clientDCDelete) (\dc -> dcDraw dc (draw dc))
src/haskell/Graphics/UI/WXCore/Layout.hs view
@@ -650,6 +650,8 @@ = Spacer optionsDefault (Size w h) -- | (primitive) A line with a given width and height +-- Not all ports (notably not wxGTK) support specifying the transversal +-- direction of the line (e.g. height for a horizontal line) rule :: Int -> Int -> Layout rule w h = Line optionsDefault (Size w h)
src/haskell/Graphics/UI/WXCore/Types.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} +{-# OPTIONS_HADDOCK prune #-} ----------------------------------------------------------------------------------------- {-| Module : Types
src/haskell/Graphics/UI/WXCore/WxcClassInfo.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_HADDOCK prune #-} -------------------------------------------------------------------------------- {-| Module : WxcClassInfo
src/haskell/Graphics/UI/WXCore/WxcClassesAL.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_HADDOCK prune #-} {-# LANGUAGE ForeignFunctionInterface #-} -------------------------------------------------------------------------------- {-|
src/haskell/Graphics/UI/WXCore/WxcClassesMZ.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_HADDOCK prune #-} {-# LANGUAGE ForeignFunctionInterface #-} -------------------------------------------------------------------------------- {-|
src/haskell/Graphics/UI/WXCore/WxcDefs.hs view
@@ -1,3 +1,6 @@+ +{-# OPTIONS_HADDOCK prune #-} + -------------------------------------------------------------------------------- {-| Module : WxcDefs
src/haskell/Graphics/UI/WXCore/WxcTypes.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP, ForeignFunctionInterface, DeriveDataTypeable, FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# OPTIONS_HADDOCK prune #-} ----------------------------------------------------------------------------------------- {-| Module : WxcTypes @@ -914,7 +915,7 @@ toCChar = castCharToCChar -- generalised to work with Char and CChar -withCharResult :: (Num a, Integral a, Show a) => IO a -> IO Char +withCharResult :: (Integral a, Show a) => IO a -> IO Char withCharResult io = do x <- io if (x < 0) @@ -946,7 +947,7 @@ toCWchar = fromIntegral . fromEnum -fromCWchar :: (Num a, Integral a) => a -> Char +fromCWchar :: Integral a => a -> Char fromCWchar = toEnum . fromIntegral @@ -1300,19 +1301,6 @@ Color -----------------------------------------------------------------------------------------} -- | An abstract data type to define colors. --- --- Note: Haddock 0.8 and 0.9 doesn't support GeneralizedNewtypeDeriving. So, This class --- doesn't have 'IArray' class's unboxed array instance now. If you want to use this type --- with unboxed array, you must write code like this. --- --- > {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving, MultiParamTypeClasses #-} --- > import Graphics.UI.WXCore.WxcTypes --- > ... --- > deriving instance IArray UArray Color --- --- We can't derive 'MArray' class's unboxed array instance this way. This is a bad point --- of current 'MArray' class definition. --- newtype Color = Color Word deriving (Eq, Typeable) -- , IArray UArray)
wxcore.cabal view
@@ -1,5 +1,5 @@ name: wxcore -version: 0.92.2.0 +version: 0.92.3.0 license: OtherLicense license-file: LICENSE author: Daan Leijen @@ -19,7 +19,7 @@ homepage: https://wiki.haskell.org/WxHaskell bug-reports: http://sourceforge.net/p/wxhaskell/bugs/ -cabal-version: >= 1.2 +cabal-version: >= 1.23 build-type: Custom extra-tmp-files: @@ -34,6 +34,9 @@ default: True library + default-language: + Haskell2010 + hs-source-dirs: src/haskell @@ -89,3 +92,12 @@ containers >= 0.1 && < 0.3 ghc-options: -Wall + + +custom-setup + setup-depends: + base, + Cabal, + process, + directory, + filepath