summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/xmonad-tv/Util/XUtils.hs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-14 01:50:39 +0100
committermakefu <github@syntax-fehler.de>2015-11-14 01:50:39 +0100
commita0fbe917ac45cda4de0f16bced3ce3ebfc556fe8 (patch)
tree44b66f4c43eeec674dcd763eb50141dd567c35e7 /tv/5pkgs/xmonad-tv/Util/XUtils.hs
parent79b890670100d08c3640fffade2caf3eced192d8 (diff)
parentebba531273715c1a9c124007b97f3547d16e780f (diff)
Merge remote-tracking branch 'cd/master' into pre-merge
Diffstat (limited to 'tv/5pkgs/xmonad-tv/Util/XUtils.hs')
-rw-r--r--tv/5pkgs/xmonad-tv/Util/XUtils.hs47
1 files changed, 0 insertions, 47 deletions
diff --git a/tv/5pkgs/xmonad-tv/Util/XUtils.hs b/tv/5pkgs/xmonad-tv/Util/XUtils.hs
deleted file mode 100644
index de1d8247c..000000000
--- a/tv/5pkgs/xmonad-tv/Util/XUtils.hs
+++ /dev/null
@@ -1,47 +0,0 @@
-module Util.XUtils
- ( shapeWindow
- , withGC
- , withPixmap
- , withPixmapAndGC
- ) where
-
-import Control.Exception ( bracket )
-import Foreign.C.Types ( CInt )
-import Graphics.X11.Xlib
-import Graphics.X11.Xlib.Extras
-import Graphics.X11.Xshape
-
-
-shapeWindow :: Display -> Window -> (Pixmap -> GC -> IO ()) -> IO ()
-shapeWindow d w f = do
- wa <- getWindowAttributes d w
-
- let width = fromIntegral $ wa_width wa
- height = fromIntegral $ wa_height wa
-
- withPixmapAndGC d w width height 1 $ \ p g -> do
-
- setForeground d g 0
- fillRectangle d p g 0 0 width height
-
- setForeground d g 1
-
- f p g
-
- xshapeCombineMask d w shapeBounding 0 0 p shapeSet
-
-
-withGC :: Display -> Drawable -> (GC -> IO ()) -> IO ()
-withGC d p =
- bracket (createGC d p) (freeGC d)
-
-
-withPixmap :: Display -> Drawable -> Dimension -> Dimension -> CInt -> (Pixmap -> IO ()) -> IO ()
-withPixmap d p w h depth =
- bracket (createPixmap d p w h depth) (freePixmap d)
-
-
-withPixmapAndGC :: Display -> Drawable -> Dimension -> Dimension -> CInt -> (Pixmap -> GC -> IO ()) -> IO ()
-withPixmapAndGC d w width height depth f =
- withPixmap d w width height depth $ \ p ->
- withGC d p $ \ g -> f p g