summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlexander Polakov <plhk@sdf.org>2013-02-25 03:30:53 +0400
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-02-25 07:23:06 +0100
commitc9d6896cbd7e03af344f5d053c267174ccd10a11 (patch)
tree2dbd6a0c0399f0f112688b8059c0f84638c77327
parent4a2df063a22228274fca1bee69fa73989995be47 (diff)
downloadxmobar-c9d6896cbd7e03af344f5d053c267174ccd10a11.tar.gz
xmobar-c9d6896cbd7e03af344f5d053c267174ccd10a11.tar.bz2
readBitmapFile was included into X11 package
-rw-r--r--src/Bitmap.hs1
-rw-r--r--src/XGraphic.hs52
-rw-r--r--xmobar.cabal4
3 files changed, 2 insertions, 55 deletions
diff --git a/src/Bitmap.hs b/src/Bitmap.hs
index dfc1d04..b073c9b 100644
--- a/src/Bitmap.hs
+++ b/src/Bitmap.hs
@@ -20,7 +20,6 @@ import Data.Map hiding (foldr, map, filter)
import Graphics.X11.Xlib
import System.Directory (doesFileExist)
import System.Mem.Weak ( addFinalizer )
-import XGraphic
import ColorCache
import Parsers (Widget(..))
diff --git a/src/XGraphic.hs b/src/XGraphic.hs
deleted file mode 100644
index 416177f..0000000
--- a/src/XGraphic.hs
+++ /dev/null
@@ -1,52 +0,0 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
------------------------------------------------------------------------------
--- |
--- Module : XGraphic
--- Copyright : Copyright © 2013 Edward O'Callaghan. All Rights Reserved.
--- License : BSD3
---
--- Maintainer : Edward O'Callaghan - <victoredwardocallaghan@gmail.com>
--- Stability : unstable
--- Portability : unportable
---
------------------------------------------------------------------------------
-
-module XGraphic
- ( readBitmapFile
- ) where
-
-import Graphics.X11.Xlib
---import Graphics.X11.Xlib.Misc
-import Foreign
-import Foreign.C
-
--- | interface to the X11 library function @XWriteBitmapFile@.
-readBitmapFile :: Display -> Drawable -> String
- -> IO (Either String (Dimension, Dimension, Pixmap, Maybe CInt, Maybe CInt))
-readBitmapFile display d filename =
- withCString filename $ \ c_filename ->
- alloca $ \ width_return ->
- alloca $ \ height_return ->
- alloca $ \ bitmap_return ->
- alloca $ \ x_hot_return ->
- alloca $ \ y_hot_return -> do
- rv <- xReadBitmapFile display d c_filename width_return height_return
- bitmap_return x_hot_return y_hot_return
- width <- peek width_return
- height <- peek height_return
- bitmap <- peek bitmap_return
- x_hot <- peek x_hot_return
- y_hot <- peek y_hot_return
- let m_x_hot | x_hot == -1 = Nothing
- | otherwise = Just x_hot
- m_y_hot | y_hot == -1 = Nothing
- | otherwise = Just y_hot
- case rv of
- 0 -> return $ Right (fromIntegral width, fromIntegral height, bitmap, m_x_hot, m_y_hot)
- 1 -> return $ Left "readBitmapFile: BitmapOpenFailed"
- 2 -> return $ Left "readBitmapFile: BitmapFileInvalid"
- 3 -> return $ Left "readBitmapFile: BitmapNoMemory"
- _ -> return $ Left "readBitmapFile: BitmapUnknownError"
-foreign import ccall unsafe "X11/Xlib.h XReadBitmapFile"
- xReadBitmapFile :: Display -> Drawable -> CString -> Ptr CInt -> Ptr CInt
- -> Ptr Pixmap -> Ptr CInt -> Ptr CInt -> IO CInt
diff --git a/xmobar.cabal b/xmobar.cabal
index 6a1cbb8..49ad9ff 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -74,7 +74,7 @@ executable xmobar
hs-source-dirs: src
main-is: Main.hs
other-modules:
- Xmobar, Bitmap, Config, Parsers, Commands, Localize, XGraphic,
+ Xmobar, Bitmap, Config, Parsers, Commands, Localize,
XUtil, StatFS, Runnable, ColorCache, Window, Signal,
Plugins, Plugins.BufferedPipeReader,
Plugins.CommandReader, Plugins.Date, Plugins.EWMH,
@@ -104,7 +104,7 @@ executable xmobar
unix,
time,
filepath,
- X11 == 1.6.*,
+ X11 >= 1.6.1,
mtl >= 2.0 && < 2.2,
parsec == 3.1.*,
stm >= 2.3 && < 2.5