Skip to content

Commit 28070ff

Browse files
committed
Fix whitespace issues (tabs and trailing spaces)
1 parent af90fbe commit 28070ff

File tree

11 files changed

+94
-97
lines changed

11 files changed

+94
-97
lines changed

Graphics/X11.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- Module : Graphics.X11
44
-- Copyright : (c) Alastair Reid, 1999-2003
55
-- License : BSD-style (see the file libraries/base/LICENSE)
6-
--
6+
--
77
-- Maintainer : [email protected]
88
-- Stability : provisional
99
-- Portability : portable
@@ -12,11 +12,11 @@
1212
--
1313
-----------------------------------------------------------------------------
1414

15-
module Graphics.X11
15+
module Graphics.X11
1616
( module Graphics.X11.Xlib
1717
) where
1818

19-
import Graphics.X11.Xlib
19+
import Graphics.X11.Xlib
2020

2121
----------------------------------------------------------------
2222
-- End

Graphics/X11/ExtraTypes.hs

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- Module : Graphics.X11.ExtraTypes
44
-- Copyright : (c) Alastair Reid, 1999-2003
55
-- License : BSD-style (see the file libraries/base/LICENSE)
6-
--
6+
--
77
-- Maintainer : [email protected]
88
-- Stability : unstable
99
-- Portability : unportable
@@ -13,24 +13,24 @@
1313
-----------------------------------------------------------------------------
1414

1515
module Graphics.X11.ExtraTypes
16-
(
17-
-- * Types
18-
module Graphics.X11.ExtraTypes.AP,
19-
module Graphics.X11.ExtraTypes.DEC,
20-
module Graphics.X11.ExtraTypes.HP,
21-
module Graphics.X11.ExtraTypes.Sun,
22-
module Graphics.X11.ExtraTypes.XF86,
23-
module Graphics.X11.ExtraTypes.XorgDefault,
24-
25-
) where
16+
(
17+
-- * Types
18+
module Graphics.X11.ExtraTypes.AP,
19+
module Graphics.X11.ExtraTypes.DEC,
20+
module Graphics.X11.ExtraTypes.HP,
21+
module Graphics.X11.ExtraTypes.Sun,
22+
module Graphics.X11.ExtraTypes.XF86,
23+
module Graphics.X11.ExtraTypes.XorgDefault,
24+
25+
) where
2626

2727
import Graphics.X11.ExtraTypes.AP
2828
import Graphics.X11.ExtraTypes.DEC
2929
import Graphics.X11.ExtraTypes.HP
3030
import Graphics.X11.ExtraTypes.Sun
3131
import Graphics.X11.ExtraTypes.XF86
3232
import Graphics.X11.ExtraTypes.XorgDefault
33-
33+
3434
----------------------------------------------------------------
3535
-- End
3636
----------------------------------------------------------------

Graphics/X11/ExtraTypes/HP.hsc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-----------------------------------------------------------------------------
2-
--
2+
--
33
-- Module : Graphics.X11.ExtraTypes.HP
44
-- Copyright : (c) Open Group 1987,1998, DEC 1987
55
-- License : X11 (see below) due to X headers

Graphics/X11/Types.hsc

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module Graphics.X11.Types
5858
xK_Delete,
5959
xK_Multi_key,
6060

61-
-- SunOS does not define these.
61+
-- SunOS does not define these.
6262
#ifdef XK_Codeinput
6363
xK_Codeinput,
6464
#endif

Graphics/X11/Xinerama.hsc

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ xineramaQueryVersion dpy = wrapPtr2 (cXineramaQueryVersion dpy) go
104104
go True major minor = Just (fromIntegral major, fromIntegral minor)
105105

106106
xineramaQueryScreens :: Display -> IO (Maybe [XineramaScreenInfo])
107-
xineramaQueryScreens dpy =
107+
xineramaQueryScreens dpy =
108108
withPool $ \pool -> do intp <- pooledMalloc pool
109109
p <- cXineramaQueryScreens dpy intp
110-
if p == nullPtr
110+
if p == nullPtr
111111
then return Nothing
112112
else do nscreens <- peek intp
113113
screens <- peekArray (fromIntegral nscreens) p

Graphics/X11/Xlib.hs

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- Module : Graphics.X11.Xlib
44
-- Copyright : (c) Alastair Reid, 1999-2003
55
-- License : BSD-style (see the file libraries/base/LICENSE)
6-
--
6+
--
77
-- Maintainer : [email protected]
88
-- Stability : provisional
99
-- Portability : portable
@@ -19,18 +19,18 @@
1919
--
2020
-----------------------------------------------------------------------------
2121

22-
module Graphics.X11.Xlib
23-
( -- * Conventions
24-
-- $conventions
22+
module Graphics.X11.Xlib
23+
( -- * Conventions
24+
-- $conventions
2525

26-
-- * Types
27-
module Graphics.X11.Types,
26+
-- * Types
27+
module Graphics.X11.Types,
2828
-- module Graphics.X11.Xlib.Types,
29-
Display(..), Screen, Visual, GC, SetWindowAttributes, VisualInfo(..),
30-
Point(..), Rectangle(..), Arc(..), Segment(..), Color(..),
31-
Pixel, Position, Dimension, Angle, ScreenNumber, Buffer,
29+
Display(..), Screen, Visual, GC, SetWindowAttributes, VisualInfo(..),
30+
Point(..), Rectangle(..), Arc(..), Segment(..), Color(..),
31+
Pixel, Position, Dimension, Angle, ScreenNumber, Buffer,
3232

33-
-- * X11 library functions
33+
-- * X11 library functions
3434
module Graphics.X11.Xlib.Event,
3535
module Graphics.X11.Xlib.Display,
3636
module Graphics.X11.Xlib.Screen,
@@ -43,8 +43,8 @@ module Graphics.X11.Xlib
4343
module Graphics.X11.Xlib.Region,
4444
module Graphics.X11.Xlib.Image,
4545
module Graphics.X11.Xlib.Misc,
46-
47-
) where
46+
47+
) where
4848

4949
import Graphics.X11.Types
5050
import Graphics.X11.Xlib.Types

Graphics/X11/Xlib/Font.hsc

+52-52
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Graphics.X11.Xlib.Font(
2020
fontFromGC,
2121
loadQueryFont,
2222
freeFont,
23-
FontStruct,
23+
FontStruct,
2424
fontFromFontStruct,
2525
ascentFromFontStruct,
2626
descentFromFontStruct,
@@ -55,9 +55,9 @@ type Glyph = Word16
5555
-- | pointer to an X11 @XFontStruct@ structure
5656
newtype FontStruct = FontStruct (Ptr FontStruct)
5757
#if __GLASGOW_HASKELL__
58-
deriving (Eq, Ord, Show, Typeable, Data)
58+
deriving (Eq, Ord, Show, Typeable, Data)
5959
#else
60-
deriving (Eq, Ord, Show)
60+
deriving (Eq, Ord, Show)
6161
#endif
6262

6363
-- Disnae exist: %fun LoadFont :: Display -> String -> IO Font
@@ -70,7 +70,7 @@ newtype FontStruct = FontStruct (Ptr FontStruct)
7070

7171
-- | interface to the X11 library function @XQueryFont()@.
7272
foreign import ccall unsafe "HsXlib.h XQueryFont"
73-
queryFont :: Display -> Font -> IO FontStruct
73+
queryFont :: Display -> Font -> IO FontStruct
7474

7575
-- Note that this _WILL NOT WORK_ unless you have explicitly set the font.
7676
-- I'm slowly but surely coming to the conclusion that Xlib is a pile of
@@ -79,40 +79,40 @@ foreign import ccall unsafe "HsXlib.h XQueryFont"
7979
-- | interface to the X11 library function @XGetGCValues()@.
8080
fontFromGC :: Display -> GC -> IO Font
8181
fontFromGC display gc =
82-
allocaBytes #{size XGCValues} $ \ values -> do
83-
throwIfZero "fontFromGC" $
84-
xGetGCValues display gc #{const GCFont} values
85-
#{peek XGCValues,font} values
82+
allocaBytes #{size XGCValues} $ \ values -> do
83+
throwIfZero "fontFromGC" $
84+
xGetGCValues display gc #{const GCFont} values
85+
#{peek XGCValues,font} values
8686
foreign import ccall unsafe "HsXlib.h XGetGCValues"
87-
xGetGCValues :: Display -> GC -> ValueMask -> Ptr GCValues -> IO CInt
87+
xGetGCValues :: Display -> GC -> ValueMask -> Ptr GCValues -> IO CInt
8888

8989
type ValueMask = #{type unsigned long}
9090

9191
-- | interface to the X11 library function @XLoadQueryFont()@.
9292
loadQueryFont :: Display -> String -> IO FontStruct
9393
loadQueryFont display name =
94-
withCString name $ \ c_name -> do
95-
fs <- throwIfNull "loadQueryFont" $ xLoadQueryFont display c_name
96-
return (FontStruct fs)
94+
withCString name $ \ c_name -> do
95+
fs <- throwIfNull "loadQueryFont" $ xLoadQueryFont display c_name
96+
return (FontStruct fs)
9797
foreign import ccall unsafe "HsXlib.h XLoadQueryFont"
98-
xLoadQueryFont :: Display -> CString -> IO (Ptr FontStruct)
98+
xLoadQueryFont :: Display -> CString -> IO (Ptr FontStruct)
9999

100100
-- | interface to the X11 library function @XFreeFont()@.
101101
foreign import ccall unsafe "HsXlib.h XFreeFont"
102-
freeFont :: Display -> FontStruct -> IO ()
102+
freeFont :: Display -> FontStruct -> IO ()
103103
-- %fun XSetFontPath :: Display -> ListString -> IO () using XSetFontPath(arg1,arg2,arg2_size)
104104

105105
fontFromFontStruct :: FontStruct -> Font
106106
fontFromFontStruct (FontStruct fs) = unsafePerformIO $
107-
#{peek XFontStruct,fid} fs
107+
#{peek XFontStruct,fid} fs
108108

109109
ascentFromFontStruct :: FontStruct -> Int32
110110
ascentFromFontStruct (FontStruct fs) = unsafePerformIO $
111-
#{peek XFontStruct,ascent} fs
111+
#{peek XFontStruct,ascent} fs
112112

113113
descentFromFontStruct :: FontStruct -> Int32
114114
descentFromFontStruct (FontStruct fs) = unsafePerformIO $
115-
#{peek XFontStruct,descent} fs
115+
#{peek XFontStruct,descent} fs
116116

117117
-- %prim XGetFontPath :: Display -> IO ListString
118118
--Int r_size;
@@ -135,58 +135,58 @@ descentFromFontStruct (FontStruct fs) = unsafePerformIO $
135135

136136
-- We marshall this across right away because it's usually one-off info
137137
type CharStruct =
138-
( CInt -- lbearing (origin to left edge of raster)
139-
, CInt -- rbearing (origin to right edge of raster)
140-
, CInt -- width (advance to next char's origin)
141-
, CInt -- ascent (baseline to top edge of raster)
142-
, CInt -- descent (baseline to bottom edge of raster)
143-
-- attributes omitted
144-
)
138+
( CInt -- lbearing (origin to left edge of raster)
139+
, CInt -- rbearing (origin to right edge of raster)
140+
, CInt -- width (advance to next char's origin)
141+
, CInt -- ascent (baseline to top edge of raster)
142+
, CInt -- descent (baseline to bottom edge of raster)
143+
-- attributes omitted
144+
)
145145

146146
peekCharStruct :: Ptr CharStruct -> IO CharStruct
147147
peekCharStruct p = do
148-
lbearing <- #{peek XCharStruct,lbearing} p
149-
rbearing <- #{peek XCharStruct,rbearing} p
150-
width <- #{peek XCharStruct,width} p
151-
ascent <- #{peek XCharStruct,ascent} p
152-
descent <- #{peek XCharStruct,descent} p
153-
return (fromIntegral (lbearing::CShort),
154-
fromIntegral (rbearing::CShort),
155-
fromIntegral (width::CShort),
156-
fromIntegral (ascent::CShort),
157-
fromIntegral (descent::CShort))
148+
lbearing <- #{peek XCharStruct,lbearing} p
149+
rbearing <- #{peek XCharStruct,rbearing} p
150+
width <- #{peek XCharStruct,width} p
151+
ascent <- #{peek XCharStruct,ascent} p
152+
descent <- #{peek XCharStruct,descent} p
153+
return (fromIntegral (lbearing::CShort),
154+
fromIntegral (rbearing::CShort),
155+
fromIntegral (width::CShort),
156+
fromIntegral (ascent::CShort),
157+
fromIntegral (descent::CShort))
158158

159159
-- No need to put this in the IO monad - this info is essentially constant
160160

161161
-- | interface to the X11 library function @XTextExtents()@.
162162
textExtents :: FontStruct -> String -> (FontDirection, Int32, Int32, CharStruct)
163163
textExtents font_struct string = unsafePerformIO $
164-
withCStringLen string $ \ (c_string, nchars) ->
165-
alloca $ \ direction_return ->
166-
alloca $ \ font_ascent_return ->
167-
alloca $ \ font_descent_return ->
168-
allocaBytes #{size XCharStruct} $ \ overall_return -> do
169-
_ <- xTextExtents font_struct c_string (fromIntegral nchars) direction_return
170-
font_ascent_return font_descent_return overall_return
171-
direction <- peek direction_return
172-
ascent <- peek font_ascent_return
173-
descent <- peek font_descent_return
174-
cs <- peekCharStruct overall_return
175-
return (direction, ascent, descent, cs)
164+
withCStringLen string $ \ (c_string, nchars) ->
165+
alloca $ \ direction_return ->
166+
alloca $ \ font_ascent_return ->
167+
alloca $ \ font_descent_return ->
168+
allocaBytes #{size XCharStruct} $ \ overall_return -> do
169+
_ <- xTextExtents font_struct c_string (fromIntegral nchars) direction_return
170+
font_ascent_return font_descent_return overall_return
171+
direction <- peek direction_return
172+
ascent <- peek font_ascent_return
173+
descent <- peek font_descent_return
174+
cs <- peekCharStruct overall_return
175+
return (direction, ascent, descent, cs)
176176
foreign import ccall unsafe "HsXlib.h XTextExtents"
177-
xTextExtents :: FontStruct -> CString -> CInt ->
178-
Ptr FontDirection -> Ptr Int32 -> Ptr Int32 ->
179-
Ptr CharStruct -> IO CInt
177+
xTextExtents :: FontStruct -> CString -> CInt ->
178+
Ptr FontDirection -> Ptr Int32 -> Ptr Int32 ->
179+
Ptr CharStruct -> IO CInt
180180

181181
-- No need to put ths in the IO monad - this info is essentially constant
182182

183183
-- | interface to the X11 library function @XTextWidth()@.
184184
textWidth :: FontStruct -> String -> Int32
185185
textWidth font_struct string = unsafePerformIO $
186-
withCStringLen string $ \ (c_string, len) ->
187-
xTextWidth font_struct c_string (fromIntegral len)
186+
withCStringLen string $ \ (c_string, len) ->
187+
xTextWidth font_struct c_string (fromIntegral len)
188188
foreign import ccall unsafe "HsXlib.h XTextWidth"
189-
xTextWidth :: FontStruct -> CString -> CInt -> IO Int32
189+
xTextWidth :: FontStruct -> CString -> CInt -> IO Int32
190190

191191
-- XTextExtents16 omitted
192192
-- XTextWidth16 omitted

X11.cabal

-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,5 @@ library
8282
include-dirs: include
8383
ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-binds
8484

85-
if impl(ghc >= 7.10)
86-
ghc-options: -fno-warn-tabs
87-
8885
if flag(pedantic)
8986
ghc-options: -Werror

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else
99
# Safety check: Ensure that we are in the correct source directory.
1010
AC_CONFIG_SRCDIR([include/HsXlib.h])
1111

12-
AC_CONFIG_HEADERS([include/HsX11Config.h include/X11_extras_config.h])
12+
AC_CONFIG_HEADERS([include/HsX11Config.h include/X11_extras_config.h])
1313

1414
# Check for X11 include paths and libraries
1515
AC_PATH_XTRA

doc/HSX11.xml

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<!-- Table of contents -->
2525
<toc></toc>
26-
26+
2727
<chapter id="introduction">
2828
<title>Introduction</title>
2929

@@ -67,7 +67,7 @@
6767

6868
<para>In addition, we chose to take advantage of Haskell's
6969
module system to allow us to drop common prefixes
70-
(<literal>X</literal>, <literal>XA_</literal>, etc.)
70+
(<literal>X</literal>, <literal>XA_</literal>, etc.)
7171
attached to X11 identifiers. For example, we translate
7272
some C functions, constants and types as follows:</para>
7373

@@ -175,7 +175,7 @@
175175
<entry><function>Arc</function></entry>
176176
<entry><function>(Position,Position,Dimension,Dimension,Int,Int)</function></entry>
177177
</row>
178-
178+
179179
<row>
180180
<entry><function>XColor</function></entry>
181181
<entry><function>Color</function></entry>
@@ -222,7 +222,7 @@ lookupColor
222222
openDisplay
223223
parseColor
224224
queryBestCursor
225-
queryBestSize
225+
queryBestSize
226226
queryBestStipple
227227
queryBestTile
228228
rotateBuffers
@@ -270,11 +270,11 @@ XDrawPoints(Display *display,
270270
<para>is given the Haskell type:</para>
271271

272272
<programlisting>
273-
drawPoints :: Display
274-
-> Drawable
275-
-> GC
276-
-> [Point]
277-
-> CoordinateMode
273+
drawPoints :: Display
274+
-> Drawable
275+
-> GC
276+
-> [Point]
277+
-> CoordinateMode
278278
-> IO ()
279279
</programlisting>
280280

0 commit comments

Comments
 (0)