-- Generated code. {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE ForeignFunctionInterface, ConstraintKinds, TypeFamilies, MultiParamTypeClasses, KindSignatures, FlexibleInstances, UndecidableInstances, DataKinds, OverloadedStrings, NegativeLiterals, FlexibleContexts #-} module GI.Cairo where import Prelude () import Data.GI.Base.ShortPrelude import Data.Char import Data.Int import Data.Word import qualified Data.ByteString.Char8 as B import Data.ByteString.Char8 (ByteString) import qualified Data.Map as Map import Foreign.C import Foreign.Ptr import Foreign.ForeignPtr import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr) import Foreign.Storable (peek, poke, sizeOf) import Control.Applicative ((<$>)) import Control.Exception (onException) import Control.Monad.IO.Class import qualified Data.Text as T import Data.GI.Base.Attributes hiding (get, set) import Data.GI.Base.BasicTypes import Data.GI.Base.BasicConversions import Data.GI.Base.Closure import Data.GI.Base.GError import Data.GI.Base.GHashTable import Data.GI.Base.GParamSpec import Data.GI.Base.GVariant import Data.GI.Base.GValue import Data.GI.Base.ManagedPtr import Data.GI.Base.Overloading import Data.GI.Base.Properties hiding (new) import Data.GI.Base.Signals (SignalConnectMode(..), connectSignalFunPtr, SignalHandlerId) import Data.GI.Base.Utils -- Enum Content data Content = ContentCOLOR | ContentALPHA | ContentCOLORALPHA | AnotherContent Int deriving (Show, Eq) instance Enum Content where fromEnum ContentCOLOR = 4096 fromEnum ContentALPHA = 8192 fromEnum ContentCOLORALPHA = 12288 fromEnum (AnotherContent k) = k toEnum 4096 = ContentCOLOR toEnum 8192 = ContentALPHA toEnum 12288 = ContentCOLORALPHA toEnum k = AnotherContent k foreign import ccall "cairo_gobject_content_get_type" c_cairo_gobject_content_get_type :: IO GType instance BoxedEnum Content where boxedEnumType _ = c_cairo_gobject_content_get_type -- struct Context newtype Context = Context (ForeignPtr Context) noContext :: Maybe Context noContext = Nothing foreign import ccall "cairo_gobject_context_get_type" c_cairo_gobject_context_get_type :: IO GType instance BoxedObject Context where boxedType _ = c_cairo_gobject_context_get_type -- struct FontFace newtype FontFace = FontFace (ForeignPtr FontFace) noFontFace :: Maybe FontFace noFontFace = Nothing foreign import ccall "cairo_gobject_font_face_get_type" c_cairo_gobject_font_face_get_type :: IO GType instance BoxedObject FontFace where boxedType _ = c_cairo_gobject_font_face_get_type -- struct FontOptions newtype FontOptions = FontOptions (ForeignPtr FontOptions) noFontOptions :: Maybe FontOptions noFontOptions = Nothing -- struct FontType newtype FontType = FontType (ForeignPtr FontType) noFontType :: Maybe FontType noFontType = Nothing -- struct Matrix newtype Matrix = Matrix (ForeignPtr Matrix) noMatrix :: Maybe Matrix noMatrix = Nothing -- struct Path newtype Path = Path (ForeignPtr Path) noPath :: Maybe Path noPath = Nothing -- struct Pattern newtype Pattern = Pattern (ForeignPtr Pattern) noPattern :: Maybe Pattern noPattern = Nothing foreign import ccall "cairo_gobject_pattern_get_type" c_cairo_gobject_pattern_get_type :: IO GType instance BoxedObject Pattern where boxedType _ = c_cairo_gobject_pattern_get_type -- struct RectangleInt newtype RectangleInt = RectangleInt (ForeignPtr RectangleInt) noRectangleInt :: Maybe RectangleInt noRectangleInt = Nothing foreign import ccall "cairo_gobject_rectangle_int_get_type" c_cairo_gobject_rectangle_int_get_type :: IO GType instance BoxedObject RectangleInt where boxedType _ = c_cairo_gobject_rectangle_int_get_type rectangleIntReadX :: RectangleInt -> IO Int32 rectangleIntReadX s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO Int32 return val rectangleIntReadY :: RectangleInt -> IO Int32 rectangleIntReadY s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 4) :: IO Int32 return val rectangleIntReadWidth :: RectangleInt -> IO Int32 rectangleIntReadWidth s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO Int32 return val rectangleIntReadHeight :: RectangleInt -> IO Int32 rectangleIntReadHeight s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 12) :: IO Int32 return val -- struct Region newtype Region = Region (ForeignPtr Region) noRegion :: Maybe Region noRegion = Nothing foreign import ccall "cairo_gobject_region_get_type" c_cairo_gobject_region_get_type :: IO GType instance BoxedObject Region where boxedType _ = c_cairo_gobject_region_get_type -- struct ScaledFont newtype ScaledFont = ScaledFont (ForeignPtr ScaledFont) noScaledFont :: Maybe ScaledFont noScaledFont = Nothing foreign import ccall "cairo_gobject_scaled_font_get_type" c_cairo_gobject_scaled_font_get_type :: IO GType instance BoxedObject ScaledFont where boxedType _ = c_cairo_gobject_scaled_font_get_type -- struct Surface newtype Surface = Surface (ForeignPtr Surface) noSurface :: Maybe Surface noSurface = Nothing foreign import ccall "cairo_gobject_surface_get_type" c_cairo_gobject_surface_get_type :: IO GType instance BoxedObject Surface where boxedType _ = c_cairo_gobject_surface_get_type -- function cairo_image_surface_create -- Args : [] -- Lengths : [] -- hInArgs : [] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "cairo_image_surface_create" cairo_image_surface_create :: IO () imageSurfaceCreate :: (MonadIO m) => m () imageSurfaceCreate = liftIO $ do cairo_image_surface_create return ()