 
 -- | Render the selection specified by selection for page to the given cairo context. The selection will
 -- be rendered, using @glyphColor@ for the glyphs and @backgroundColor@ for the selection background.
--- 
+--
 -- If non-'Nothing', @oldSelection@ specifies the selection that is already rendered to cairo, in which case
 -- this function will (some day) only render the changed part of the selection.
-pageRenderSelection :: PageClass page => page 
- -> PopplerRectangle -- ^ @selection@        start and end point of selection as a rectangle 
- -> PopplerRectangle -- ^ @oldSelection@    previous selection                              
- -> SelectionStyle -- ^ @style@            a 'SelectionStyle'                         
- -> PopplerColor -- ^ @glyphColor@      color to use for drawing glyphs                 
- -> PopplerColor -- ^ @backgroundColor@ color to use for the selection background       
+pageRenderSelection :: PageClass page => page
+ -> PopplerRectangle -- ^ @selection@        start and end point of selection as a rectangle
+ -> PopplerRectangle -- ^ @oldSelection@    previous selection
+ -> SelectionStyle -- ^ @style@            a 'SelectionStyle'
+ -> PopplerColor -- ^ @glyphColor@      color to use for drawing glyphs
+ -> PopplerColor -- ^ @backgroundColor@ color to use for the selection background
  -> Render ()
 pageRenderSelection page selection oldSelection style glyphColor backgroundColor = do
   cairo <- ask
-  liftIO $ 
-         with selection $ \ selectionPtr -> 
-         with oldSelection $ \ oldSelectionPtr -> 
-         with glyphColor $ \ glyphColorPtr -> 
-         with backgroundColor $ \ backgroundColorPtr -> 
+  liftIO $
+         with selection $ \ selectionPtr ->
+         with oldSelection $ \ oldSelectionPtr ->
+         with glyphColor $ \ glyphColorPtr ->
+         with backgroundColor $ \ backgroundColorPtr ->
               {#call poppler_page_render_selection #}
                   (toPage page)
                   cairo

-- | Returns a region containing the area that would be rendered by 'pageRenderSelection' or
-- 'pageRenderSelectionToPixbuf' as a GList of PopplerRectangle.
pageGetSelectionRegion :: PageClass page => page
 -> Double -- ^ @scale@     scale specified as pixels per point             
 -> SelectionStyle -- ^ @style@     a 'SelectionStyle'                         
 -> PopplerRectangle -- ^ @selection@ start and end point of selection as a rectangle 
 -> IO [PopplerRectangle]
pageGetSelectionRegion page scale style selection = 
  with selection $ \ selectionPtr -> do
    glistPtr <- {#call poppler_page_get_selection_region #} 
                 (toPage page)
                 (realToFrac scale)
                 ((fromIntegral . fromEnum) style)

      width <- peek widthPtr
      height <- peek heightPtr
      return (realToFrac width, realToFrac height)

-- | Returns the index of page
pageGetIndex :: PageClass page => page
 -> IO Int  -- ^ returns index value of page
pageGetIndex page =
  liftM fromIntegral $
  {#call poppler_page_get_index #} (toPage page)

-- | Get the embedded thumbnail for the specified page. If the document doesn't have an embedded
-- thumbnail for the page, this function returns 'Nothing'.
pageGetThumbnail :: PageClass page => page
