diff --git a/Changelog b/Changelog
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,34 @@
-commit db325b51d98a127e48b6323df4e91b9f34e4e0d0
+commit 98cd6ba239381b1ec64855631f8082a0bce3a71c
+Author: Magicloud <1886157+Magicloud@users.noreply.github.com>
+Date:   Sun Feb 10 18:47:28 2019 +0800
+
+    Add more surfaces. Add warnings for non-exist functions/types.
+    
+    - All surfaces without extra backends (X11, Windows, MacOS) are done.
+    
+    - All functions/types depends on HAS flag or Cairo version are wrapped
+    with WARNING pragma if they do not exist in Cairo of user environment.
+    
+    - Corrected `withArrayLen` usage.
+
+commit cb64d583bb961b3062c672c3f17a5dafad9b0da7
+Author: Magicloud <1886157+Magicloud@users.noreply.github.com>
+Date:   Wed Feb 6 14:46:24 2019 +0800
+
+    Fix bug in .cabal.
+    
+    Bug was made when making sdist, causes 1.16.4 unbuildable.
+
+commit 0aef99978ed5937c5716d1a90209019fba859830
+Author: Magicloud <1886157+Magicloud@users.noreply.github.com>
+Date:   Sun Feb 3 14:31:09 2019 +0800
+
+    Remove "\n" in one `p` to fix haddock bug.
+    
+    Due to haddock bug, when a link is at the beginning of a line, it is not
+    recognized. Some cases excluded.
+
+commit 547703b7ae8f002e4624cbc4fb2fbfc4231f6863
 Author: Magicloud <1886157+Magicloud@users.noreply.github.com>
 Date:   Sat Feb 2 14:59:48 2019 +0800
 
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE LambdaCase          #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 import           Control.Exception
+import           Control.Monad
 import qualified Data.ByteString.Lazy as LBS
 import           Data.Char
 import           Data.List
@@ -31,6 +32,7 @@
   { hookedPreProcessors = [ ("chs", \bi lbi clbi ->
     PreProcessor False $ \(iD, iF) (oD, oF) verbosity -> do
       catch (do
+        require (iD </> iF) (oD </> iF)
         (runPreProcessor $ ppC2hs bi lbi clbi) (iD, iF) (oD, oF) verbosity
         rmLINE (oD </> oF)
         bindingDoc (oD </> oF)
@@ -45,6 +47,33 @@
       bindingDoc (oD </> oF)
       render bi oD (oD </> oF))]}
 
+require :: FilePath -> FilePath -> IO ()
+require fp target = do
+  readFile fp >>=
+    writeFile (fp ++ ".fuck") .unlines . map (\line -> if " -- λ require " `isInfixOf` line
+      then
+        let (code, conds') = splitAt (fromJust (position "-- λ" line) - 1) line
+            conds = words $ drop (length "-- λ require ") conds'
+            name' = words code !! 3
+            name'' = if name' == "^"
+              then c2hsName $ words code !! 1
+              else name'
+            name = if "{#fun " `isPrefixOf` code
+              then unCapital name''
+              else name''
+            argc = length $ breakOn ',' $ takeWhile ('}' /=) $ dropWhile ('{' /=) code
+        in foldl (\i (ob, oa) -> intercalate "\n" [ob, i, oa]) code $ map (\cond -> ("#if " ++ cond, intercalate "\n"
+          [ "#else"
+          , "{-# WARNING " ++ name ++ " \"" ++ cond ++ " unmet\" #-}"
+          , if "{#enum " `isPrefixOf` code
+              then "data " ++ name
+              else if "{#fun " `isPrefixOf` code
+              then name ++ " " ++ intercalate " " (map ((:) 'v' . show) [1..argc]) ++ " = undefined"
+              else error code
+          , "#endif" ])) conds
+      else line) . lines
+  renameFile (fp ++ ".fuck") target
+
 rmLINE :: FilePath -> IO ()
 rmLINE fp = do
   readFile fp >>=
@@ -503,3 +532,25 @@
 declComments (MinimalPragma (_, c) _) = c
 declComments (RoleAnnotDecl (_, c) _ _) = c
 declComments (CompletePragma (_, c) _ _) = c
+
+position :: (Eq a) => [a] -> [a] -> Maybe Int
+position sub ful =
+  case filter (sub `isPrefixOf`) $ ful : tails ful of
+    [] -> Nothing
+    i : _ -> Just (length ful - length i)
+
+breakOn :: (Eq a) => a -> [a] -> [[a]]
+breakOn x = unfoldr (\xs -> case break (x ==) xs of
+  ([], _ : _) -> Just (tail xs, [])
+  (_ : _, []) -> Just (xs, [])
+  ([], []) -> Nothing
+  (xs1, xs2) -> Just (xs1, tail xs2))
+
+c2hsName :: String -> String
+c2hsName =
+  concatMap (\(c : s) ->
+    toUpper c : s) . breakOn '_'
+
+unCapital :: String -> String
+unCapital (c : s) = toLower c : s
+unCapital [] = []
diff --git a/cairo-core.cabal b/cairo-core.cabal
--- a/cairo-core.cabal
+++ b/cairo-core.cabal
@@ -1,7 +1,7 @@
 name:                cairo-core
-version:             1.16.5
-synopsis:            Cairo Haskell binding (core functions)
-description:         Cairo Haskell binding (core functions). Please checkout cairo-opts for other functions.
+version:             1.16.6
+synopsis:            Cairo Haskell binding (partial)
+description:         For using Cairo in Haskell. Functions/Types for X11, Windows, MacOS are not included.
 homepage:            https://github.com/magicloud/cairo-core#readme
 license:             BSD3
 license-file:        LICENSE
@@ -45,6 +45,13 @@
                        Graphics.Cairo.Drawing.Patterns
                        Graphics.Cairo.Drawing.Paths
                        Graphics.Cairo.Drawing.Cairo
+                       Graphics.Cairo.Surfaces.PostScript
+                       Graphics.Cairo.Surfaces.PNG
+                       Graphics.Cairo.Surfaces.PDF
+                       Graphics.Cairo.Surfaces.Image
+                       Graphics.Cairo.Surfaces.Recording
+                       Graphics.Cairo.Surfaces.Script
+                       Graphics.Cairo.Surfaces.SVG
                        Graphics.Cairo.Render
   build-depends:       base >= 4.7 && < 5
                      , monad-extras
diff --git a/include/cairo-core.h b/include/cairo-core.h
--- a/include/cairo-core.h
+++ b/include/cairo-core.h
@@ -1,4 +1,4 @@
-#include<cairo.h>
+#include <cairo.h>
 
 #define CAIRO_CHECK_VERSION(major, minor, micro)                    \
         (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(major, minor, micro))
diff --git a/src/Graphics/Cairo/Drawing/Cairo.chs b/src/Graphics/Cairo/Drawing/Cairo.chs
--- a/src/Graphics/Cairo/Drawing/Cairo.chs
+++ b/src/Graphics/Cairo/Drawing/Cairo.chs
@@ -105,27 +105,30 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-show-page
 {#fun show_page as ^ { `Context' } -> `()'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-push-group
-{#fun push_group as ^ { `Context' } -> `()'#}
+{#fun push_group as ^ { `Context' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-push-group-with-content
-{#fun push_group_with_content as ^ { `Context', `Content' } -> `()'#}
+{#fun push_group_with_content as ^ { `Context', `Content' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-pop-group
-{#fun pop_group as ^ { `Context' } -> `Pattern' outPattern*#}
+{#fun pop_group as ^ { `Context' } -> `Pattern' outPattern*#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-pop-group-to-source
-{#fun pop_group_to_source as ^ { `Context' } -> `()'#}
+{#fun pop_group_to_source as ^ { `Context' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-get-group-target
-{#fun get_group_target as ^ { `Context' } -> `Surface' outSurfaceRef*#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun get_group_target as ^ { `Context' } -> `Surface' outSurfaceRef*#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-dash
+#if CAIRO_CHECK_VERSION(1,4,0)
 setDash :: Context -> [Double] -> Offset -> IO ()
 setDash context dashes offset =
-  withArrayLen (map (CDouble) dashes) $ \len ptr -> setDash' context ptr len offset
-  where {#fun set_dash as setDash' { `Context', id `Ptr CDouble', `Int', CDouble `Offset' } -> `()'#}
+  setDash' context (map CDouble dashes) offset
+  where {#fun set_dash as setDash' { `Context', withArrayLen_* `[CDouble]'&, CDouble `Offset' } -> `()'#}
+#else
+{-# WARNING setDash "CAIRO_CHECK_VERSION(1,4,0) unmet" #-}
+setDash = undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-get-dash
+#if CAIRO_CHECK_VERSION(1,4,0)
 getDash :: Context -> IO ([Double], Offset)
 getDash context = do
   len <- getDashCount context
@@ -134,18 +137,19 @@
     dashes <- (map (\(CDouble x) -> x)) <$> peekArray len ptr
     return (dashes, offset)
   where {#fun get_dash as getDash' { `Context', id `Ptr CDouble', alloca- `Offset' peekDouble* } -> `()'#}
+#else
+{-# WARNING getDash "CAIRO_CHECK_VERSION(1,4,0) unmet" #-}
+getDash = undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-get-dash-count
-{#fun get_dash_count as ^ { `Context' } -> `Int'#}
+{#fun get_dash_count as ^ { `Context' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-clip-extents
-{#fun clip_extents as ^ { `Context', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()'#}
+{#fun clip_extents as ^ { `Context', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-copy-clip-rectangle-list
-{#fun copy_clip_rectangle_list as ^ { `Context' } -> `RectangleList Double' peek*#}
+{#fun copy_clip_rectangle_list as ^ { `Context' } -> `RectangleList Double' peek*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-get-reference-count
-{#fun get_reference_count as ^ { `Context' } -> `Int'#}
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+{#fun get_reference_count as ^ { `Context' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 
-#if CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-in-clip
-{#fun in_clip as ^ { `Context', CDouble `X', CDouble `Y' } -> `Bool'#}
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+{#fun in_clip as ^ { `Context', CDouble `X', CDouble `Y' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
diff --git a/src/Graphics/Cairo/Drawing/Paths.chs b/src/Graphics/Cairo/Drawing/Paths.chs
--- a/src/Graphics/Cairo/Drawing/Paths.chs
+++ b/src/Graphics/Cairo/Drawing/Paths.chs
@@ -47,19 +47,12 @@
 {#fun rel_move_to as ^ { `Context', CDouble `X', CDouble `Y' } -> `()'#}
 
 -- λ https://www.cairographics.org/manual/cairo-Paths.html#cairo-glyph-path
-glyphPath :: Context -> [Glyph] -> IO ()
-glyphPath context glyphs =
-  withArrayLen glyphs $ \len ptr -> glyphPath' context ptr len
-  where {#fun glyph_path as glyphPath' { `Context', `GlyphPtr', `Int' } -> `()'#}
+{#fun glyph_path as ^ { `Context', withArrayLen_* `[Glyph]'& } -> `()'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-Paths.html#cairo-new-sub-path
-{#fun new_sub_path as ^ { `Context' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun new_sub_path as ^ { `Context' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,6,0)
 -- λ https://www.cairographics.org/manual/cairo-Paths.html#cairo-has-current-point
-{#fun has_current_point as ^ { `Context' } -> `Bool'#}
+{#fun has_current_point as ^ { `Context' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,6,0)
 -- λ https://www.cairographics.org/manual/cairo-Paths.html#cairo-path-extents
-{#fun path_extents as ^ { `Context', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,6,0)
+{#fun path_extents as ^ { `Context', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,6,0)
diff --git a/src/Graphics/Cairo/Drawing/Patterns.chs b/src/Graphics/Cairo/Drawing/Patterns.chs
--- a/src/Graphics/Cairo/Drawing/Patterns.chs
+++ b/src/Graphics/Cairo/Drawing/Patterns.chs
@@ -49,33 +49,29 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-matrix
 {#fun pattern_get_matrix as ^ { `Pattern', alloca- `Matrix Double' peek*} -> `()'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-type
-{#fun pattern_get_type as ^ { `Pattern' } -> `PatternType'#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun pattern_get_type as ^ { `Pattern' } -> `PatternType'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-color-stop-count
-{#fun pattern_get_color_stop_count as ^ { withPattern* `GradientPattern', alloca- `Int' peekInt* } -> `()' failStatusRaw*#}
+{#fun pattern_get_color_stop_count as ^ { withPattern* `GradientPattern', alloca- `Int' peekInt* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-color-stop-rgba
-{#fun pattern_get_color_stop_rgba as ^ { withPattern* `GradientPattern', fromIntegral `Index', alloca- `Double' peekDouble*, alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#}
+{#fun pattern_get_color_stop_rgba as ^ { withPattern* `GradientPattern', fromIntegral `Index', alloca- `Double' peekDouble*, alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-rgba
-{#fun pattern_get_rgba as ^ { withPattern* `SolidPattern', alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#}
+{#fun pattern_get_rgba as ^ { withPattern* `SolidPattern', alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-surface
-{#fun pattern_get_surface as ^ { withPattern* `SurfacePattern', alloca- `Surface' outSurfacePtrRef* } -> `()' failStatusRaw*#}
+{#fun pattern_get_surface as ^ { withPattern* `SurfacePattern', alloca- `Surface' outSurfacePtrRef* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-linear-points
-{#fun pattern_get_linear_points as ^ { withPattern* `LinearGradientPattern', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()' failStatusRaw*#}
+{#fun pattern_get_linear_points as ^ { withPattern* `LinearGradientPattern', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-radial-circles
-{#fun pattern_get_radial_circles as ^ { withPattern* `RadialGradientPattern', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `Radius' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `Radius' peekDouble* } -> `()' failStatusRaw*#}
+{#fun pattern_get_radial_circles as ^ { withPattern* `RadialGradientPattern', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `Radius' peekDouble*, alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `Radius' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-reference-count
-{#fun pattern_get_reference_count as ^ { `Pattern' } -> `Int'#}
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+{#fun pattern_get_reference_count as ^ { `Pattern' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 
-#if CAIRO_CHECK_VERSION(1,12,0)
 {- |
 λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-begin-patch
 λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-end-patch
 -}
+#if CAIRO_CHECK_VERSION(1,12,0)
 meshPatternPatch :: Mesh -> (Mesh -> IO c) -> IO c
 meshPatternPatch mesh f =
   bracket (meshPatternBeginPatch mesh) (const $ do
@@ -84,27 +80,30 @@
   where
     {#fun mesh_pattern_begin_patch as ^ { withPattern* `Mesh' } -> `()'#}
     {#fun mesh_pattern_end_patch as ^ { withPattern* `Mesh' } -> `()'#}
+#else
+{-# WARNING meshPatternPatch "CAIRO_CHECK_VERSION(1,12,0) unmet" #-}
+meshPatternPatch = undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-mesh
-{#fun pattern_create_mesh as ^ {} -> `Mesh' outPattern*#}
+{#fun pattern_create_mesh as ^ {} -> `Mesh' outPattern*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-move-to
-{#fun mesh_pattern_move_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y' } -> `()'#}
+{#fun mesh_pattern_move_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-line-to
-{#fun mesh_pattern_line_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y' } -> `()'#}
+{#fun mesh_pattern_line_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-curve-to
-{#fun mesh_pattern_curve_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y', CDouble `X', CDouble `Y', CDouble `X', CDouble `Y' } -> `()'#}
+{#fun mesh_pattern_curve_to as ^ { withPattern* `Mesh', CDouble `X', CDouble `Y', CDouble `X', CDouble `Y', CDouble `X', CDouble `Y' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-control-point
-{#fun mesh_pattern_set_control_point as ^ { withPattern* `Mesh', cFromEnum `MeshPointNum', CDouble `X', CDouble `Y' } -> `()'#}
+{#fun mesh_pattern_set_control_point as ^ { withPattern* `Mesh', cFromEnum `MeshPointNum', CDouble `X', CDouble `Y' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-corner-color-rgb
-{#fun mesh_pattern_set_corner_color_rgb as ^ { withPattern* `Mesh', cFromEnum `MeshCornerNum', CDouble `Red', CDouble `Green', CDouble `Blue' } -> `()'#}
+{#fun mesh_pattern_set_corner_color_rgb as ^ { withPattern* `Mesh', cFromEnum `MeshCornerNum', CDouble `Red', CDouble `Green', CDouble `Blue' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-corner-color-rgba
-{#fun mesh_pattern_set_corner_color_rgba as ^ { withPattern* `Mesh', cFromEnum `MeshCornerNum', CDouble `Red', CDouble `Green', CDouble `Blue', CDouble `Alpha' } -> `()'#}
+{#fun mesh_pattern_set_corner_color_rgba as ^ { withPattern* `Mesh', cFromEnum `MeshCornerNum', CDouble `Red', CDouble `Green', CDouble `Blue', CDouble `Alpha' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-get-patch-count
-{#fun mesh_pattern_get_patch_count as ^ { withPattern* `Mesh', alloca- `Int' peekInt*} -> `()' failStatusRaw*#}
+{#fun mesh_pattern_get_patch_count as ^ { withPattern* `Mesh', alloca- `Int' peekInt*} -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-get-path
-{#fun mesh_pattern_get_path as ^ { withPattern* `Mesh', `Int' } -> `Path' peek*#}
+{#fun mesh_pattern_get_path as ^ { withPattern* `Mesh', `Int' } -> `Path' peek*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-get-control-point
-{#fun mesh_pattern_get_control_point as ^ { withPattern* `Mesh', `Int', cFromEnum `MeshPointNum', alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()' failStatusRaw*#}
+{#fun mesh_pattern_get_control_point as ^ { withPattern* `Mesh', `Int', cFromEnum `MeshPointNum', alloca- `X' peekDouble*, alloca- `Y' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-get-corner-color-rgba
-{#fun mesh_pattern_get_corner_color_rgba as ^ { withPattern* `Mesh', `Int', cFromEnum `MeshCornerNum', alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#}
-#endif -- CAIRO_CHECK_VERSION(1,12,0)
+{#fun mesh_pattern_get_corner_color_rgba as ^ { withPattern* `Mesh', `Int', cFromEnum `MeshCornerNum', alloca- `Red' peekDouble*, alloca- `Green' peekDouble*, alloca- `Blue' peekDouble*, alloca- `Alpha' peekDouble* } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
diff --git a/src/Graphics/Cairo/Drawing/Region.chs b/src/Graphics/Cairo/Drawing/Region.chs
--- a/src/Graphics/Cairo/Drawing/Region.chs
+++ b/src/Graphics/Cairo/Drawing/Region.chs
@@ -18,47 +18,47 @@
 #if CAIRO_CHECK_VERSION(1,10,0)
 instance HasStatus Region where
   status = regionStatus
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-create
-{#fun region_create as ^ {} -> `Region' outRegion*#}
+{#fun region_create as ^ {} -> `Region' outRegion*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-create-rectangle
-{#fun region_create_rectangle as ^ { with* `Rectangle Int' } -> `Region' outRegion*#}
+{#fun region_create_rectangle as ^ { with* `Rectangle Int' } -> `Region' outRegion*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-create-rectangles
-{#fun region_create_rectangles as ^ {`RectangleIntPtr', `Int' } -> `Region' outRegion*#}
+{#fun region_create_rectangles as ^ {`RectangleIntPtr', `Int' } -> `Region' outRegion*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-copy
-{#fun region_copy as ^ { `Region' } -> `Region' outRegion*#}
+{#fun region_copy as ^ { `Region' } -> `Region' outRegion*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-status
-{#fun region_status as ^ { `Region' } -> `Status'#}
+{#fun region_status as ^ { `Region' } -> `Status'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-get-extents
-{#fun region_get_extents as ^ { `Region', alloca- `Rectangle Int' peek* } -> `()'#}
+{#fun region_get_extents as ^ { `Region', alloca- `Rectangle Int' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-num-rectangles
-{#fun region_num_rectangles as ^ { `Region' } -> `Int'#}
+{#fun region_num_rectangles as ^ { `Region' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-get-rectangle
-{#fun region_get_rectangle as ^ { `Region', fromIntegral `Index', alloca- `Rectangle Int' peek* } -> `()'#}
+{#fun region_get_rectangle as ^ { `Region', fromIntegral `Index', alloca- `Rectangle Int' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-is-empty
-{#fun region_is_empty as ^ { `Region' } -> `Bool'#}
+{#fun region_is_empty as ^ { `Region' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-contains-point
-{#fun region_contains_point as ^ { `Region', fromIntegral `XInt', fromIntegral `YInt' } -> `Bool'#}
+{#fun region_contains_point as ^ { `Region', fromIntegral `XInt', fromIntegral `YInt' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-contains-rectangle
-{#fun region_contains_rectangle as ^ { `Region', with* `Rectangle Int' } -> `RegionOverlap'#}
+{#fun region_contains_rectangle as ^ { `Region', with* `Rectangle Int' } -> `RegionOverlap'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-equal
-{#fun region_equal as ^ { `Region', `Region' } -> `Bool'#}
+{#fun region_equal as ^ { `Region', `Region' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-translate
-{#fun region_translate as ^ { `Region', fromIntegral `XInt', fromIntegral `YInt' } -> `()'#}
+{#fun region_translate as ^ { `Region', fromIntegral `XInt', fromIntegral `YInt' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-intersect
-{#fun region_intersect as ^ { `Region', `Region' } -> `()' failStatusRaw*#}
+{#fun region_intersect as ^ { `Region', `Region' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-intersect-rectangle
-{#fun region_intersect_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#}
+{#fun region_intersect_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-subtract
-{#fun region_subtract as ^ { `Region', `Region' } -> `()' failStatusRaw*#}
+{#fun region_subtract as ^ { `Region', `Region' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-subtract-rectangle
-{#fun region_subtract_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#}
+{#fun region_subtract_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-union
-{#fun region_union as ^ { `Region', `Region' } -> `()' failStatusRaw*#}
+{#fun region_union as ^ { `Region', `Region' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-union-rectangle
-{#fun region_union_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#}
+{#fun region_union_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-xor
-{#fun region_xor as ^ { `Region', `Region' } -> `()' failStatusRaw*#}
+{#fun region_xor as ^ { `Region', `Region' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-xor-rectangle
-{#fun region_xor_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#}
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+{#fun region_xor_rectangle as ^ { `Region', with* `Rectangle Int' } -> `()' failStatusRaw*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
diff --git a/src/Graphics/Cairo/Drawing/TagsLinks.chs b/src/Graphics/Cairo/Drawing/TagsLinks.chs
--- a/src/Graphics/Cairo/Drawing/TagsLinks.chs
+++ b/src/Graphics/Cairo/Drawing/TagsLinks.chs
@@ -10,9 +10,7 @@
 
 {#context lib="cairo" prefix="cairo"#}
 
-#if CAIRO_CHECK_VERSION(1,16,0)
 -- λ https://www.cairographics.org/manual/cairo-Tags-and-Links.html#cairo-tag-begin
-{#fun tag_begin as ^ { `Context', `String', `String' } -> `()'#}
+{#fun tag_begin as ^ { `Context', `String', `String' } -> `()'#}-- λ require CAIRO_CHECK_VERSION(1,16,0)
 -- λ https://www.cairographics.org/manual/cairo-Tags-and-Links.html#cairo-tag-end
-{#fun tag_end as ^ { `Context', `String' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,16,0)
+{#fun tag_end as ^ { `Context', `String' } -> `()'#}-- λ require CAIRO_CHECK_VERSION(1,16,0)
diff --git a/src/Graphics/Cairo/Drawing/Text.chs b/src/Graphics/Cairo/Drawing/Text.chs
--- a/src/Graphics/Cairo/Drawing/Text.chs
+++ b/src/Graphics/Cairo/Drawing/Text.chs
@@ -33,6 +33,10 @@
 {#fun font_extents as ^ { `Context', alloca- `FontExtents' peek* } -> `()'#}
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-text-extents
 {#fun text_extents as ^ { `Context', withUTF8String* `String', alloca- `TextExtents' peek* } -> `()'#}
+-- λ https://www.cairographics.org/manual/cairo-text.html#cairo-glyph-extents
+{#fun glyph_extents as ^ { `Context', withArrayLen_* `[Glyph]'&, alloca- `TextExtents' peek* } -> `()'#}
+-- λ https://www.cairographics.org/manual/cairo-text.html#cairo-show-glyphs
+{#fun show_glyphs as ^ { `Context', withArrayLen_* `[Glyph]'& } -> `()'#}
 
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-get-font-options
 getFontOptions :: Context -> IO FontOptions
@@ -42,48 +46,33 @@
   return fo
   where {#fun get_font_options as getFontOptions' { `Context', `FontOptions' outFontOptions* } -> `()'#}
 
--- λ https://www.cairographics.org/manual/cairo-text.html#cairo-glyph-extents
-glyphExtents :: Context -> [Glyph] -> IO TextExtents
-glyphExtents context glyphs =
-  withArrayLen glyphs $ \len ptr -> glyphExtents' context ptr len
-  where {#fun glyph_extents as glyphExtents' { `Context', `GlyphPtr', `Int', alloca- `TextExtents' peek* } -> `()'#}
-
--- λ https://www.cairographics.org/manual/cairo-text.html#cairo-show-glyphs
-showGlyphs :: Context -> [Glyph] -> IO ()
-showGlyphs context glyphs =
-  withArrayLen glyphs $ \len glyphPtr -> showGlyphs' context glyphPtr len
-  where {#fun show_glyphs as showGlyphs' { `Context', `GlyphPtr', `Int' } -> `()'#}
-
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-set-scaled-font
-{#fun set_scaled_font as ^ { `Context', `ScaledFont' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun set_scaled_font as ^ { `Context', `ScaledFont' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-get-scaled-font
-{#fun get_scaled_font as ^ { `Context' } -> `ScaledFont' outScaledFontRef*#}
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+{#fun get_scaled_font as ^ { `Context' } -> `ScaledFont' outScaledFontRef*#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 
-#if CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-show-text-glyphs
+#if CAIRO_CHECK_VERSION(1,8,0)
 showTextGlyphs :: Context
                   -> String -> [Glyph] -> [TextCluster] -> TextClusterFlags -> IO ()
 showTextGlyphs context utf8 glyphs textClusters textClusterFlags =
-  withArrayLen glyphs $ \glyphLen glyphPtr ->
-    withArrayLen textClusters $ \tcLen tcPtr ->
-        showTextGlyphs' context utf8 (-1) glyphPtr glyphLen tcPtr tcLen textClusterFlags
-  where {#fun show_text_glyphs as showTextGlyphs' { `Context', withUTF8String* `String', `Int', `GlyphPtr', `Int', `TextClusterPtr', `Int', `TextClusterFlags' } -> `()'#}
+  showTextGlyphs' context utf8 (-1) glyphs textClusters textClusterFlags
+  where {#fun show_text_glyphs as showTextGlyphs' { `Context', withUTF8String* `String', `Int', withArrayLen_* `[Glyph]'&,withArrayLen_* `[TextCluster]'&, `TextClusterFlags' } -> `()'#}
+#else
+{-# WARNING showTextGlyphs "CAIRO_CHECK_VERSION(1,8,0) unmet" #-}
+showTextGlyphs= undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-text-cluster-free
-{#fun text_cluster_free as ^ { `TextClusterPtr' } -> `()'#}
+{#fun text_cluster_free as ^ { `TextClusterPtr' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-glyph-free
-{#fun glyph_free as ^ { `GlyphPtr' } -> `()'#}
+{#fun glyph_free as ^ { `GlyphPtr' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-toy-font-face-create
-{#fun toy_font_face_create as ^ { withUTF8String* `String', `FontSlant', `FontWeight' } -> `FontFace'#}
+{#fun toy_font_face_create as ^ { withUTF8String* `String', `FontSlant', `FontWeight' } -> `FontFace'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-family
-{#fun toy_font_face_get_family as ^ { `FontFace' } -> `String'#}
+{#fun toy_font_face_get_family as ^ { `FontFace' } -> `String'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-slant
-{#fun toy_font_face_get_slant as ^ { `FontFace' } -> `FontSlant'#}
+{#fun toy_font_face_get_slant as ^ { `FontFace' } -> `FontSlant'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-weight
-{#fun toy_font_face_get_weight as ^ { `FontFace' } -> `FontWeight'#}
-#endif -- CAIRO_CHECK_VERSION(1,8,0)
+{#fun toy_font_face_get_weight as ^ { `FontFace' } -> `FontWeight'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
diff --git a/src/Graphics/Cairo/Fonts/FontFace.chs b/src/Graphics/Cairo/Fonts/FontFace.chs
--- a/src/Graphics/Cairo/Fonts/FontFace.chs
+++ b/src/Graphics/Cairo/Fonts/FontFace.chs
@@ -18,12 +18,8 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-face-status
 {#fun font_face_status as ^ { `FontFace' } -> `Status'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-face-get-type
-{#fun font_face_get_type as ^ { `FontFace' } -> `FontType'#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun font_face_get_type as ^ { `FontFace' } -> `FontType'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-face-get-reference-count
-{#fun font_face_get_reference_count as ^ { `FontFace' } -> `Int'#}
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+{#fun font_face_get_reference_count as ^ { `FontFace' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
diff --git a/src/Graphics/Cairo/Fonts/FontOptions.chs b/src/Graphics/Cairo/Fonts/FontOptions.chs
--- a/src/Graphics/Cairo/Fonts/FontOptions.chs
+++ b/src/Graphics/Cairo/Fonts/FontOptions.chs
@@ -43,9 +43,7 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-hint-metrics
 {#fun font_options_get_hint_metrics as ^ { `FontOptions' } -> `HintMetrics'#}
 
-#if CAIRO_CHECK_VERSION(1,16,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-variations
-{#fun font_options_get_variations as ^ { `FontOptions' } -> `String'#}
+{#fun font_options_get_variations as ^ { `FontOptions' } -> `String'#} -- λ require CAIRO_CHECK_VERSION(1,16,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-set-variations
-{#fun font_options_set_variations as ^ { `FontOptions', `String' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,16,0)
+{#fun font_options_set_variations as ^ { `FontOptions', `String' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,16,0)
diff --git a/src/Graphics/Cairo/Fonts/ScaledFont.chs b/src/Graphics/Cairo/Fonts/ScaledFont.chs
--- a/src/Graphics/Cairo/Fonts/ScaledFont.chs
+++ b/src/Graphics/Cairo/Fonts/ScaledFont.chs
@@ -26,11 +26,7 @@
   status = scaledFontStatus
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-glyph-extents
-scaledFontGlyphExtents :: ScaledFont -> [Glyph] -> IO TextExtents
-scaledFontGlyphExtents scaledFont glyphs =
-  withArrayLen glyphs $ \len glyphPtr -> scaledFontGlyphExtents' scaledFont glyphPtr len
-  where {#fun scaled_font_glyph_extents as scaledFontGlyphExtents' { `ScaledFont', `GlyphPtr', `Int', alloca- `TextExtents' peek* } -> `()'#}
-
+{#fun scaled_font_glyph_extents as ^ { `ScaledFont', withArrayLen_* `[Glyph]'&, alloca- `TextExtents' peek* } -> `()'#}
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-create
 {#fun scaled_font_create as ^ { `FontFace', with* `Matrix Double', with* `Matrix Double', `FontOptions' } -> `ScaledFont' outScaledFont*#}
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-status
@@ -38,40 +34,45 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-extents
 {#fun scaled_font_extents as ^ { `ScaledFont', alloca- `FontExtents' peek* } -> `()'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-face
+#if CAIRO_CHECK_VERSION(1,2,0)
 scaledFontGetFontFace :: ScaledFont -> IO FontFace
 scaledFontGetFontFace sf = do
   ff <- scaledFontGetFontFace' sf
   fontFaceStatus ff >>= failStatus
   return ff
   where {#fun scaled_font_get_font_face as scaledFontGetFontFace' { `ScaledFont' } -> `FontFace' outFontFaceRef*#}
-
+#else
+{-# WARNING scaledFontGetFontFace "CAIRO_CHECK_VERSION(1,2,0) unmet" #-}
+scaledFontGetFontFace = undefined
+#endif
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-options
+#if CAIRO_CHECK_VERSION(1,2,0)
 scaledFontGetFontOptions :: ScaledFont -> IO FontOptions
 scaledFontGetFontOptions sf = do
   fo <- (fontOptionsCreate >>= scaledFontGetFontOptions' sf)
   fontOptionsStatus fo >>= failStatus
   return fo
   where {#fun scaled_font_get_font_options as scaledFontGetFontOptions' { `ScaledFont', `FontOptions' outFontOptions* } -> `()'#}
+#else
+{-# WARNING scaledFontGetFontOptions "CAIRO_CHECK_VERSION(1,2,0) unmet" #-}
+scaledFontGetFontOptions = undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-text-extents
-{#fun scaled_font_text_extents as ^ { `ScaledFont', withUTF8String* `String', alloca- `TextExtents' peek* } -> `()'#}
+{#fun scaled_font_text_extents as ^ { `ScaledFont', withUTF8String* `String', alloca- `TextExtents' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-matrix
-{#fun scaled_font_get_font_matrix as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#}
+{#fun scaled_font_get_font_matrix as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-ctm
-{#fun scaled_font_get_ctm as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#}
+{#fun scaled_font_get_ctm as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-type
-{#fun scaled_font_get_type as ^ { `ScaledFont' } -> `FontType'#}
-#endif
+{#fun scaled_font_get_type as ^ { `ScaledFont' } -> `FontType'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-reference-count
-{#fun scaled_font_get_reference_count as ^ { `ScaledFont' } -> `Int'#}
-#endif
+{#fun scaled_font_get_reference_count as ^ { `ScaledFont' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 
-#if CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-text-to-glyphs
+#if CAIRO_CHECK_VERSION(1,8,0)
 scaledFontTextToGlyphs :: ScaledFont
                           -> X
                           -> Y
@@ -94,7 +95,10 @@
         return (glyphs, tcs, tcf))
   where
     {#fun scaled_font_text_to_glyphs as scaledFontTextToGlyphs' { `ScaledFont', CDouble `X', CDouble `Y', withUTF8String* `String', `Int', id `Ptr GlyphPtr', alloca- `Int' peekInt*, id `Ptr TextClusterPtr', alloca- `Int' peekInt*, alloca- `TextClusterFlags' peekEnum* } -> `Status'#}
+#else
+{-# WARNING scaledFontTextToGlyphs "CAIRO_CHECK_VERSION(1,8,0) unmet" #-}
+scaledFontTextToGlyphs = undefined
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-scale-matrix
-{#fun scaled_font_get_scale_matrix as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#}
-#endif
+{#fun scaled_font_get_scale_matrix as ^ { `ScaledFont', alloca- `Matrix Double' peek* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
diff --git a/src/Graphics/Cairo/Surfaces/Device.chs b/src/Graphics/Cairo/Surfaces/Device.chs
--- a/src/Graphics/Cairo/Surfaces/Device.chs
+++ b/src/Graphics/Cairo/Surfaces/Device.chs
@@ -18,39 +18,43 @@
 #if CAIRO_CHECK_VERSION(1,10,0)
 instance HasStatus Device where
   status = deviceStatus
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-status
-{#fun device_status as ^ { `Device' } -> `Status'#}
+{#fun device_status as ^ { `Device' } -> `Status'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-finish
-{#fun device_finish as ^ { `Device' } -> `()'#}
+{#fun device_finish as ^ { `Device' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-flush
-{#fun device_flush as ^ { `Device' } -> `()'#}
+{#fun device_flush as ^ { `Device' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-get-type
-{#fun device_get_type as ^ { `Device' } -> `DeviceType'#}
+{#fun device_get_type as ^ { `Device' } -> `DeviceType'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-get-reference-count
-{#fun device_get_reference_count as ^ { `Device' } -> `Int'#}
+{#fun device_get_reference_count as ^ { `Device' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-elapsed
+{#fun device_observer_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-fill-elapsed
+{#fun device_observer_fill_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-glyphs-elapsed
+{#fun device_observer_glyphs_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-mask-elapsed
+{#fun device_observer_mask_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-paint-elapsed
+{#fun device_observer_paint_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-stroke-elapsed
+{#fun device_observer_stroke_elapsed as ^ { `Device' } -> `Double'#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 
 {-|
 λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-acquire
 λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-release
 -}
+#if CAIRO_CHECK_VERSION(1,10,0)
 acquireDevice :: Device -> (Device -> IO c) -> IO c
 acquireDevice d f =
   bracket (deviceAcquire d) (const (deviceRelease d) <=< failStatus) (const $ f d)
   where
     {#fun device_acquire as ^ { `Device' } -> `Status'#}
     {#fun device_release as ^ { `Device' } -> `()'#}
-
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-elapsed
-{#fun device_observer_elapsed as ^ { `Device' } -> `Double'#}
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-fill-elapsed
-{#fun device_observer_fill_elapsed as ^ { `Device' } -> `Double'#}
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-glyphs-elapsed
-{#fun device_observer_glyphs_elapsed as ^ { `Device' } -> `Double'#}
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-mask-elapsed
-{#fun device_observer_mask_elapsed as ^ { `Device' } -> `Double'#}
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-paint-elapsed
-{#fun device_observer_paint_elapsed as ^ { `Device' } -> `Double'#}
--- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-stroke-elapsed
-{#fun device_observer_stroke_elapsed as ^ { `Device' } -> `Double'#}
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+#else
+{-# WARNING acquireDevice "CAIRO_CHECK_VERSION(1,10,0) unmet" #-}
+acquireDevice = undefined
+#endif
diff --git a/src/Graphics/Cairo/Surfaces/Image.chs b/src/Graphics/Cairo/Surfaces/Image.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/Image.chs
@@ -0,0 +1,25 @@
+#include "cairo-core.h"
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-Image-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.Image where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.Ptr as C2HSImp
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-stride-for-width
+{#fun format_stride_for_width as ^ { `Format', fromIntegral `WidthInt' } -> `Stride' fromIntegral#} -- λ require CAIRO_CHECK_VERSION(1,6,0)
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-create
+{#fun image_surface_create as ^ { `Format', fromIntegral `WidthInt', fromIntegral `HeightInt' } -> `ImageSurface' outSurface*#}
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-format
+{#fun image_surface_get_format as ^ { withSurface* `ImageSurface' } -> `Format'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-width
+{#fun image_surface_get_width as ^ { withSurface* `ImageSurface' } -> `WidthInt' fromIntegral#}
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-height
+{#fun image_surface_get_height as ^ { withSurface* `ImageSurface' } -> `HeightInt' fromIntegral#}
+-- λ https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-stride
+{#fun image_surface_get_stride as ^ { withSurface* `ImageSurface' } -> `Stride' fromIntegral#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
diff --git a/src/Graphics/Cairo/Surfaces/PDF.chs b/src/Graphics/Cairo/Surfaces/PDF.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/PDF.chs
@@ -0,0 +1,45 @@
+#include "cairo-core.h"
+#include <cairo-pdf.h>
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-PDF-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.PDF where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.C
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-create
+{#fun pdf_surface_create as ^ { withCString* `FilePath', CDouble `WidthPoints', CDouble `HeightPoints' } -> `PdfSurface' outSurface* #} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-set-size
+{#fun pdf_surface_set_size as ^ { withSurface* `PdfSurface', CDouble `WidthPoints', CDouble `HeightPoints' } -> `()'#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-restrict-to-version
+{#fun pdf_surface_restrict_to_version as ^ { withSurface* `PdfSurface', `PdfVersion' } -> `()' #} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-version-to-string
+{#fun pure pdf_version_to_string as ^ { `PdfVersion' } -> `String'#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,10,0)
+
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-get-versions
+#if CAIRO_CHECK_VERSION(1,10,0)
+#if CAIRO_HAS_PDF_SURFACE
+pdfGetVersions :: [PdfVersion]
+pdfGetVersions = [minBound..maxBound]
+#else
+{-# WARNING pdfGetVersions "CAIRO_HAS_PDF_SURFACE unmet" #-}
+pdfGetVersions = undefined
+#endif
+#else
+{-# WARNING pdfGetVersions "CAIRO_CHECK_VERSION(1,10,0) unmet" #-}
+pdfGetVersions = undefined
+#endif
+
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-add-outline
+{#fun pdf_surface_add_outline as ^ { withSurface* `PdfSurface', fromIntegral `OutlineId', withUTF8String* `String', `String', `PdfOutlineFlags'} -> `OutlineId' fromIntegral#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-set-metadata
+{#fun pdf_surface_set_metadata as ^ { withSurface* `PdfSurface', `PdfMetadata', withUTF8String* `String'} -> `()'#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-set-page-label
+{#fun pdf_surface_set_page_label as ^ { withSurface* `PdfSurface', withUTF8String* `String' } -> `()'#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-set-thumbnail-size
+{#fun pdf_surface_set_thumbnail_size as ^ { withSurface* `PdfSurface', fromIntegral `WidthInt', fromIntegral `HeightInt' } -> `()'#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
diff --git a/src/Graphics/Cairo/Surfaces/PNG.chs b/src/Graphics/Cairo/Surfaces/PNG.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/PNG.chs
@@ -0,0 +1,17 @@
+#include "cairo-core.h"
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-PNG-Support.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-PNG-Support.html#cairo-PNG-Support.description
+-}
+module Graphics.Cairo.Surfaces.PNG where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.C.String
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-PNG-Support.html#cairo-image-surface-create-from-png
+{#fun image_surface_create_from_png as ^ { withCString* `FilePath' } -> `PngSurface' outSurface*#} -- λ require CAIRO_HAS_PNG_FUNCTIONS
+-- λ https://www.cairographics.org/manual/cairo-PNG-Support.html#cairo-surface-write-to-png
+{#fun surface_write_to_png as ^ { withSurface* `PngSurface', withCString* `FilePath' } -> `Status'#} -- λ require CAIRO_HAS_PNG_FUNCTIONS
diff --git a/src/Graphics/Cairo/Surfaces/PostScript.chs b/src/Graphics/Cairo/Surfaces/PostScript.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/PostScript.chs
@@ -0,0 +1,46 @@
+#include "cairo-core.h"
+#include <cairo-ps.h>
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-PostScript-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.PostScript where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.C
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-create
+{#fun ps_surface_create as ^ { withCString* `FilePath', CDouble `WidthPoints', CDouble `HeightPoints' } -> `PsSurface' outSurface*#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-set-size
+{#fun ps_surface_set_size as ^ { withSurface* `PsSurface', CDouble `WidthPoints', CDouble `HeightPoints' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-dsc-begin-setup
+{#fun ps_surface_dsc_begin_setup as ^ { withSurface* `PsSurface' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-dsc-begin-page-setup
+{#fun ps_surface_dsc_begin_page_setup as ^ { withSurface* `PsSurface' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-dsc-comment
+{#fun ps_surface_dsc_comment as ^ { withSurface* `PsSurface', `String' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-restrict-to-level
+{#fun ps_surface_restrict_to_level as ^ { withSurface* `PsSurface', `PsLevel' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,6,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-level-to-string
+{#fun pure ps_level_to_string as ^ { `PsLevel' } -> `String'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,6,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-set-eps
+{#fun ps_surface_set_eps as ^ { withSurface* `PsSurface', `Bool' } -> `()'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,6,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-surface-get-eps
+{#fun ps_surface_get_eps as ^ { withSurface* `PsSurface' } -> `Bool'#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,6,0)
+
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-get-levels
+#if CAIRO_CHECK_VERSION(1,6,0)
+#if CAIRO_HAS_PS_SURFACE
+psGetLevels :: [PsLevel]
+psGetLevels = [minBound..maxBound]
+#else
+{-# WARNING psGetLevels "CAIRO_HAS_PS_SURFACE unmet" #-}
+psGetLevels = undefined
+#endif
+#else
+{-# WARNING psGetLevels "CAIRO_CHECK_VERSION(1,6,0) unmet" #-}
+psGetLevels = undefined
+#endif
diff --git a/src/Graphics/Cairo/Surfaces/Recording.chs b/src/Graphics/Cairo/Surfaces/Recording.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/Recording.chs
@@ -0,0 +1,21 @@
+#include "cairo-core.h"
+#include <cairo-features.h>
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-Recording-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-Recording-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.Recording where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.Marshal
+import Foreign.Storable
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-create
+{#fun recording_surface_create as ^ { `Content', with* `Rectangle Double' } -> `RecordingSurface' outSurface*#} -- λ require CAIRO_HAS_RECORDING_SURFACE CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-ink-extents
+{#fun recording_surface_ink_extents as ^ { withSurface* `RecordingSurface', alloca- `X' peekDouble*, alloca- `Y' peekDouble*, alloca- `Width' peekDouble*, alloca- `Height' peekDouble* } -> `()'#} -- λ require CAIRO_HAS_RECORDING_SURFACE CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-get-extents
+{#fun recording_surface_get_extents as ^ { withSurface* `RecordingSurface', alloca- `Rectangle Double' peek* } -> `Bool'#} -- λ require CAIRO_HAS_RECORDING_SURFACE CAIRO_CHECK_VERSION(1,12,0)
diff --git a/src/Graphics/Cairo/Surfaces/SVG.chs b/src/Graphics/Cairo/Surfaces/SVG.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/SVG.chs
@@ -0,0 +1,39 @@
+#include "cairo-core.h"
+#include <cairo-svg.h>
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-SVG-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.SVG where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.C
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-create
+{#fun svg_surface_create as ^ { withCString* `FilePath', CDouble `WidthPoints', CDouble `HeightPoints' } -> `SvgSurface' outSurface* #} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version
+{#fun svg_surface_restrict_to_version as ^ { withSurface* `SvgSurface', `SvgVersion' } -> `()'#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-version-to-string
+{#fun pure svg_version_to_string as ^ { `SvgVersion' } -> `String'#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-get-versions
+#if CAIRO_CHECK_VERSION(1,2,0)
+#if CAIRO_HAS_SVG_SURFACE
+svgGetVersions :: [SvgVersion]
+svgGetVersions = [minBound..maxBound]
+#else
+{-# WARNING svgGetVersions "CAIRO_HAS_PDF_SURFACE unmet" #-}
+svgGetVersions = undefined
+#endif
+#else
+{-# WARNING svgGetVersions "CAIRO_CHECK_VERSION(1,2,0) unmet" #-}
+svgGetVersions = undefined
+#endif
+
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-get-document-unit
+{#fun svg_surface_get_document_unit as ^ { withSurface* `SvgSurface' } -> `SvgUnit'#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-set-document-unit
+{#fun svg_surface_set_document_unit as ^ { withSurface* `SvgSurface', `SvgUnit' } -> `()'#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,16,0)
diff --git a/src/Graphics/Cairo/Surfaces/Script.chs b/src/Graphics/Cairo/Surfaces/Script.chs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Cairo/Surfaces/Script.chs
@@ -0,0 +1,28 @@
+#include "cairo-core.h"
+#include <cairo-script.h>
+{-|
+Description : λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html //div[@class="refnamediv"]/table/tr/td/p/text()
+
+λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-Script-Surfaces.description
+-}
+module Graphics.Cairo.Surfaces.Script where
+
+{#import Graphics.Cairo.Types#}
+import Foreign.C
+
+{#context lib="cairo" prefix="cairo"#}
+
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-create
+{#fun script_create as ^ { withCString* `FilePath' } -> `ScriptDevice' outDevice*#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-from-recording-surface
+{#fun script_from_recording_surface as ^ { withDevice* `ScriptDevice', withSurface* `RecordingSurface' } -> `Status'#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-get-mode
+{#fun script_get_mode as ^ { withDevice* `ScriptDevice' } -> `ScriptMode'#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-set-mode
+{#fun script_set_mode as ^ { withDevice* `ScriptDevice', `ScriptMode' } -> `()'#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-surface-create
+{#fun script_surface_create as ^ { withDevice* `ScriptDevice', `Content', CDouble `Width', CDouble `Height' } -> `ScriptSurface' outSurface*#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-surface-create-for-target
+{#fun script_surface_create_for_target as ^ { withDevice* `ScriptDevice', `Surface' } -> `ScriptSurface' outSurface*#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-write-comment
+{#fun script_write_comment as ^ { withDevice* `ScriptDevice', `String'& } -> `()' #} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
diff --git a/src/Graphics/Cairo/Surfaces/Surface.chs b/src/Graphics/Cairo/Surfaces/Surface.chs
--- a/src/Graphics/Cairo/Surfaces/Surface.chs
+++ b/src/Graphics/Cairo/Surfaces/Surface.chs
@@ -35,51 +35,43 @@
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-device-offset
 {#fun surface_set_device_offset as ^ { `Surface', CDouble `XOffset', CDouble `YOffset' } -> `()'#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-content
-{#fun surface_get_content as ^ { `Surface' } -> `Content'#}
+{#fun surface_get_content as ^ { `Surface' } -> `Content'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device-offset
-{#fun surface_get_device_offset as ^ { `Surface', alloca- `XOffset' peekDouble*, alloca- `YOffset' peekDouble* } -> `()'#}
+{#fun surface_get_device_offset as ^ { `Surface', alloca- `XOffset' peekDouble*, alloca- `YOffset' peekDouble* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-fallback-resolution
-{#fun surface_set_fallback_resolution as ^ { `Surface', CDouble `XResolution', CDouble `YResolution' } -> `()'#}
+{#fun surface_set_fallback_resolution as ^ { `Surface', CDouble `XResolution', CDouble `YResolution' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-type
-{#fun surface_get_type as ^ { `Surface' } -> `SurfaceType'#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#fun surface_get_type as ^ { `Surface' } -> `SurfaceType'#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-reference-count
-{#fun surface_get_reference_count as ^ { `Surface' } -> `Int'#}
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+{#fun surface_get_reference_count as ^ { `Surface' } -> `Int'#} -- λ require CAIRO_CHECK_VERSION(1,4,0)
 
-#if CAIRO_CHECK_VERSION(1,6,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-copy-page
-{#fun surface_copy_page as ^ { `Surface' } -> `()'#}
+{#fun surface_copy_page as ^ { `Surface' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,6,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-show-page
-{#fun surface_show_page as ^ { `Surface' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,6,0)
+{#fun surface_show_page as ^ { `Surface' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,6,0)
 
-#if CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-has-show-text-glyphs
-{#fun surface_has_show_text_glyphs as ^ { `Surface' } -> `Bool'#}
+{#fun surface_has_show_text_glyphs as ^ { `Surface' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-fallback-resolution
-{#fun surface_get_fallback_resolution as ^ { `Surface', alloca- `XResolution' peekDouble*, alloca- `YResolution' peekDouble* } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,8,0)
+{#fun surface_get_fallback_resolution as ^ { `Surface', alloca- `XResolution' peekDouble*, alloca- `YResolution' peekDouble* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 
-#if CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-for-rectangle
-{#fun surface_create_for_rectangle as ^ { `Surface', CDouble `X', CDouble `Y', CDouble `Width', CDouble `Height'} -> `Surface' outSurface*#}
+{#fun surface_create_for_rectangle as ^ { `Surface', CDouble `X', CDouble `Y', CDouble `Width', CDouble `Height'} -> `Surface' outSurface*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device
-{#fun surface_get_device as ^ { `Surface' } -> `Maybe Device' outMaybeDevice*#}
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+{#fun surface_get_device as ^ { `Surface' } -> `Maybe Device' outMaybeDevice*#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 
-#if CAIRO_CHECK_VERSION(1,12,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-similar-image
-{#fun surface_create_similar_image as ^ { `Surface', `Format', fromIntegral `WidthInt', fromIntegral `HeightInt' } -> `Surface' outSurface*#}
+{#fun surface_create_similar_image as ^ { `Surface', `Format', fromIntegral `WidthInt', fromIntegral `HeightInt' } -> `Surface' outSurface*#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
+-- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-supports-mime-type
+{#fun surface_supports_mime_type as ^ { `Surface', `String' } -> `Bool'#} -- λ require CAIRO_CHECK_VERSION(1,12,0)
 
 {-|
 λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-map-to-image
 λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-unmap-image
 -}
+#if CAIRO_CHECK_VERSION(1,12,0)
 useSurfaceMapImage :: Surface
                       -> Maybe (Rectangle Int) -> (Surface -> IO c) -> IO c
 useSurfaceMapImage s mr f =
@@ -90,14 +82,12 @@
   where
     {#fun surface_map_to_image as ^ { `Surface', withMaybe* `Maybe (Rectangle Int)' } -> `Surface' outSurface*#}
     {#fun surface_unmap_image as ^ { `Surface', `Surface' } -> `()'#}
-
--- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-supports-mime-type
-{#fun surface_supports_mime_type as ^ { `Surface', `String' } -> `Bool'#}
-#endif -- CAIRO_CHECK_VERSION(1,12,0)
+#else
+{-# WARNING useSurfaceMapImage "CAIRO_CHECK_VERSION(1,12,0) unmet" #-}
+useSurfaceMapImage = undefined
+#endif
 
-#if CAIRO_CHECK_VERSION(1,14,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device-scale
-{#fun surface_get_device_scale as ^ { `Surface', alloca- `XScale' peekDouble*, alloca- `YScale' peekDouble* } -> `()'#}
+{#fun surface_get_device_scale as ^ { `Surface', alloca- `XScale' peekDouble*, alloca- `YScale' peekDouble* } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,14,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-device-scale
-{#fun surface_set_device_scale as ^ { `Surface', CDouble `XScale', CDouble `YScale' } -> `()'#}
-#endif -- CAIRO_CHECK_VERSION(1,14,0)
+{#fun surface_set_device_scale as ^ { `Surface', CDouble `XScale', CDouble `YScale' } -> `()'#} -- λ require CAIRO_CHECK_VERSION(1,14,0)
diff --git a/src/Graphics/Cairo/Types.chs b/src/Graphics/Cairo/Types.chs
--- a/src/Graphics/Cairo/Types.chs
+++ b/src/Graphics/Cairo/Types.chs
@@ -2,6 +2,10 @@
 {-# LANGUAGE FlexibleInstances    #-}
 {-# LANGUAGE TypeSynonymInstances #-}
 #include "cairo-core.h"
+#include <cairo-ps.h>
+#include <cairo-pdf.h>
+#include <cairo-svg.h>
+#include <cairo-script.h>
 
 module Graphics.Cairo.Types where
 
@@ -86,6 +90,18 @@
 type LinearGradientPattern = GradientPattern
 type RadialGradientPattern = GradientPattern
 type Mesh = Pattern
+type Stride = Int
+type OutlineId = Int
+type WidthPoints = Double
+type HeightPoints = Double
+type ImageSurface = Surface
+type PdfSurface = Surface
+type PngSurface = Surface
+type PsSurface = Surface
+type RecordingSurface = Surface
+type SvgSurface = Surface
+type ScriptDevice = Device
+type ScriptSurface = Surface
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-t
 {#pointer *t as Context foreign finalizer destroy newtype#}
@@ -356,11 +372,11 @@
     {#set text_extents_t->x_advance#} p (CDouble xa)
     {#set text_extents_t->y_advance#} p (CDouble ya)
 
-#if CAIRO_CHECK_VERSION(1,4,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-rectangle-list-t
 data RectangleList a = RectangleList { rlStatus     :: Status
                                      , rlRectangles :: [Rectangle a] }
                      deriving (Show, Eq)
+#if CAIRO_CHECK_VERSION(1,4,0)
 {#pointer *rectangle_list_t as RectangleListPtr -> RectangleList Double#}
 instance Storable (RectangleList Double) where
   sizeOf _ = {#sizeof rectangle_list_t#}
@@ -376,10 +392,12 @@
       {#set rectangle_list_t->status#}         p (fromIntegral $ fromEnum s)
       {#set rectangle_list_t->rectangles#}     p ptr'
       {#set rectangle_list_t->num_rectangles#} p (fromIntegral len)
-#endif -- CAIRO_CHECK_VERSION(1,4,0)
+#else
+{-# WARNING RectangleList Double "CAIRO_CHECK_VERSION(1,4,0) unmet" #-}
+#endif
 
-#if CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://www.cairographics.org/manual/cairo-text.html#cairo-text-cluster-t
+#if CAIRO_CHECK_VERSION(1,8,0)
 data TextCluster = TextCluster { textClusterNumBytes  :: Int
                                , textClusterNumGlyphs :: Int }
                  deriving (Show, Eq)
@@ -394,10 +412,13 @@
   poke p (TextCluster b g)= do
     {#set text_cluster_t->num_bytes#}  p (fromIntegral b)
     {#set text_cluster_t->num_glyphs#} p (fromIntegral g)
-#endif -- CAIRO_CHECK_VERSION(1,8,0)
+#else
+{-# WARNING TextCluster "CAIRO_CHECK_VERSION(1,8,0) unmet" #-}
+data TextCluster
+#endif
 
-#if CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-t
+#if CAIRO_CHECK_VERSION(1,10,0)
 {#pointer *device_t as Device foreign finalizer device_destroy newtype#}
 outDevice :: Ptr Device -> IO Device
 outDevice = fmap Device . newForeignPtr cairo_device_destroy
@@ -405,13 +426,21 @@
 outMaybeDevice p = if p == nullPtr
   then return Nothing
   else Just <$> outDevice p
-
+#else
+{-# WARNING Device "CAIRO_CHECK_VERSION(1,10,0) unmet" #-}
+data Device
+#endif
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-t
+#if CAIRO_CHECK_VERSION(1,10,0)
 {#pointer *region_t as Region foreign finalizer region_destroy newtype#}
 outRegion :: Ptr Region -> IO Region
 outRegion = fmap Region . newForeignPtr cairo_region_destroy
-
+#else
+{-# WARNING Region "CAIRO_CHECK_VERSION(1,10,0) unmet" #-}
+data Region
+#endif
 -- λ https://www.cairographics.org/manual/cairo-Types.html#cairo-rectangle-int-t
+#if CAIRO_CHECK_VERSION(1,10,0)
 {#pointer *rectangle_int_t as RectangleIntPtr -> Rectangle Int#}
 instance Storable (Rectangle Int) where
   sizeOf _ = {#sizeof rectangle_int_t#}
@@ -430,7 +459,9 @@
     {#set rectangle_int_t->y#}      p (fromIntegral y)
     {#set rectangle_int_t->width#}  p (fromIntegral w)
     {#set rectangle_int_t->height#} p (fromIntegral h)
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+#else
+{-# WARNING Rectangle Int "CAIRO_CHECK_VERSION(1,10,0) unmet" #-}
+#endif
 
 -- λ https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t
 {#enum antialias_t as Antialias {underscoreToCase} deriving(Eq, Show)#}
@@ -465,26 +496,20 @@
 -- λ https://www.cairographics.org/manual/cairo-Error-handling.html#cairo-status-t
 {#enum status_t as Status {underscoreToCase} deriving(Eq, Show)#}
 
-#if CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-type-t
-{#enum font_type_t as FontType {underscoreToCase} deriving(Eq, Show)#}
+{#enum font_type_t as FontType {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-type-t
-{#enum pattern_type_t as PatternType {underscoreToCase} deriving(Eq, Show)#}
+{#enum pattern_type_t as PatternType {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 -- λ https://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-type-t
-{#enum surface_type_t as SurfaceType {underscoreToCase} deriving(Eq, Show)#}
-#endif -- CAIRO_CHECK_VERSION(1,2,0)
+{#enum surface_type_t as SurfaceType {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,2,0)
 
-#if CAIRO_CHECK_VERSION(1,8,0)
 -- λ https://cairographics.org/manual/cairo-text.html#cairo-text-cluster-flags-t
-{#enum text_cluster_flags_t as TextClusterFlags {underscoreToCase} deriving(Eq, Show)#}
-#endif -- CAIRO_CHECK_VERSION(1,8,0)
+{#enum text_cluster_flags_t as TextClusterFlags {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,8,0)
 
-#if CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-type-t
-{#enum device_type_t as DeviceType {underscoreToCase} deriving(Eq, Show)#}
+{#enum device_type_t as DeviceType {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 -- λ https://www.cairographics.org/manual/cairo-Regions.html#cairo-region-overlap-t
-{#enum region_overlap_t as RegionOverlap {underscoreToCase} deriving(Eq, Show)#}
-#endif -- CAIRO_CHECK_VERSION(1,10,0)
+{#enum region_overlap_t as RegionOverlap {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_CHECK_VERSION(1,10,0)
 
 #if CAIRO_CHECK_VERSION(1,12,0)
 data MeshPointNum = MP0
@@ -497,8 +522,23 @@
                    | MC2
                    | MC3
                    deriving (Show, Eq, Enum)
-#endif -- CAIRO_CHECK_VERSION(1,12,0)
+#endif
 
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-outline-flags-t
+{#enum pdf_outline_flags_t as PdfOutlineFlags {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-metadata-t
+{#enum pdf_metadata_t as PdfMetadata {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-version-t
+{#enum pdf_version_t as PdfVersion {underscoreToCase} deriving(Bounded, Eq, Show)#} -- λ require CAIRO_HAS_PDF_SURFACE CAIRO_CHECK_VERSION(1,10,0)
+-- λ https://www.cairographics.org/manual/cairo-PostScript-Surfaces.html#cairo-ps-level-t
+{#enum ps_level_t as PsLevel {underscoreToCase} deriving(Bounded, Eq, Show)#} -- λ require CAIRO_HAS_PS_SURFACE CAIRO_CHECK_VERSION(1,6,0)
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-version-t
+{#enum svg_version_t as SvgVersion {underscoreToCase} deriving(Bounded, Eq, Show)#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,2,0)
+-- λ https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-unit-t
+{#enum svg_unit_t as SvgUnit {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_HAS_SVG_SURFACE CAIRO_CHECK_VERSION(1,16,0)
+-- λ https://www.cairographics.org/manual/cairo-Script-Surfaces.html#cairo-script-mode-t
+{#enum script_mode_t as ScriptMode {underscoreToCase} deriving(Eq, Show)#} -- λ require CAIRO_HAS_SCRIPT_SURFACE CAIRO_CHECK_VERSION(1,12,0)
+
 -- Marshallers
 
 cFromEnum :: (Enum a, Integral b) => a -> b
@@ -523,6 +563,9 @@
 withMaybe m f = case m of
   Nothing -> f nullPtr
   Just p -> with p f
+
+withArrayLen_ :: Storable a => [a] -> ((Ptr a, CInt) -> IO b) -> IO b
+withArrayLen_ xs f = withArrayLen xs $ \i p -> f (p, fromIntegral i)
 
 -- Referencer
 
