    {-# LINE 1 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    {-# LANGUAGE ScopedTypeVariables, TypeSynonymInstances, FlexibleInstances #-}
    {-# OPTIONS_HADDOCK hide #-}
    {-# OPTIONS_GHC -fno-warn-unused-imports #-}
    -- -*-haskell-*-

    {-# LINE 10 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 12 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    --  GIMP Toolkit (GTK) Structures
    --
    --  Author : Axel Simon
    --
    --  Created: 2 May 2001
    --
    --  Copyright (C) 1999-2005 Axel Simon
    --
    --  This library is free software; you can redistribute it and/or
    --  modify it under the terms of the GNU Lesser General Public
    --  License as published by the Free Software Foundation; either
    --  version 2.1 of the License, or (at your option) any later version.
    --
    --  This library is distributed in the hope that it will be useful,
    --  but WITHOUT ANY WARRANTY; without even the implied warranty of
    --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    --  Lesser General Public License for more details.
    --
    -- #hide

    -- |
    -- Maintainer  : gtk2hs-users@lists.sourceforge.net
    -- Stability   : provisional
    -- Portability : portable (depends on GHC)
    --
    module Graphics.UI.Gtk.General.Structs (
      Point,
      Rectangle(..),
      Color(..),

    {-# LINE 42 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      RGBA(..),

    {-# LINE 44 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 51 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      Allocation,
      Requisition(..),
      treeIterSize,
      textIterSize,
      inputError,

    {-# LINE 61 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      ResponseId(..),
      fromResponse,
      toResponse,

    {-# LINE 65 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      NativeWindowId,
      toNativeWindowId,
      fromNativeWindowId,
      nativeWindowIdNone,

    {-# LINE 70 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      drawableGetID,

    {-# LINE 78 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      IconSize(..),

    {-# LINE 87 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      styleGetForeground,
      styleGetBackground,
      styleGetLight,
      styleGetMiddle,
      styleGetDark,
      styleGetText,
      styleGetBase,
      styleGetAntiAliasing,

    {-# LINE 107 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      SortColumnId,
      treeSortableDefaultSortColumnId,
      tagInvalid,
      selectionPrimary,
      selectionSecondary,
      selectionClipboard,
      targetString,
      selectionTypeAtom,
      selectionTypeInteger,
      selectionTypeString,

    {-# LINE 120 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      withTargetEntries,
      KeymapKey (..)
      ) where

    import Control.Monad            (liftM)
    import Data.IORef
    import Control.Exception (handle, ErrorCall(..))

    import System.Glib.FFI
    import System.Glib.UTFString ( UTFCorrection, ofsToUTF )
    import Graphics.UI.Gtk.Abstract.Object  (makeNewObject)
    import System.Glib.GObject              (makeNewGObject)
    import Graphics.UI.Gtk.Types

    {-# LINE 137 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    import Graphics.UI.Gtk.General.Enums    (StateType)
    import Graphics.UI.Gtk.General.DNDTypes (InfoId, Atom(Atom) , SelectionTag,
                                             TargetTag, SelectionTypeTag)
    import Graphics.Rendering.Pango.Structs ( Color(..), Rectangle(..) )

    {-# LINE 142 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 145 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    -- | Represents the x and y coordinate of a point.
    --
    type Point = (Int, Int)

    instance Storable Point where
      sizeOf :: Point -> SortColumnId
    sizeOf Point
    _ = SortColumnId
    8
    {-# LINE 151 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined:: Int32)
    {-# LINE 152 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        (x_      ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
    {-# LINE 154 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (y_      ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
    {-# LINE 155 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ (fromIntegral x_, fromIntegral y_)
      poke :: Ptr Point -> Point -> IO ()
    poke Ptr Point
    ptr (SortColumnId
    x, SortColumnId
    y) = do
        (\Ptr Point
    hsc_ptr -> Ptr Point -> SortColumnId -> Int32 -> IO ()
    forall b. Ptr b -> SortColumnId -> Int32 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr Point
    hsc_ptr SortColumnId
    0) Ptr Point
    ptr ((SortColumnId -> Int32
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral SortColumnId
    x)::Int32)
    {-# LINE 158 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr ((fromIntegral y)::Int32)
    {-# LINE 159 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    instance Storable Rectangle where
      sizeOf :: Rectangle -> SortColumnId
    sizeOf Rectangle
    _ = SortColumnId
    16
    {-# LINE 162 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined:: Int32)
    {-# LINE 163 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        (x_      ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
    {-# LINE 165 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (y_      ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
    {-# LINE 166 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (width_  ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
    {-# LINE 167 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (height_ ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 12) ptr
    {-# LINE 168 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ Rectangle (fromIntegral x_) (fromIntegral y_)
                           (fromIntegral width_) (fromIntegral height_)
      poke :: Ptr Rectangle -> Rectangle -> IO ()
    poke Ptr Rectangle
    ptr (Rectangle SortColumnId
    x SortColumnId
    y SortColumnId
    width SortColumnId
    height) = do
        (\Ptr Rectangle
    hsc_ptr -> Ptr Rectangle -> SortColumnId -> Int32 -> IO ()
    forall b. Ptr b -> SortColumnId -> Int32 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr Rectangle
    hsc_ptr SortColumnId
    0) Ptr Rectangle
    ptr ((SortColumnId -> Int32
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral SortColumnId
    x)::Int32)
    {-# LINE 172 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr ((fromIntegral y)::Int32)
    {-# LINE 173 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr ((fromIntegral width)::Int32)
    {-# LINE 174 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 12) ptr ((fromIntegral height)::Int32)
    {-# LINE 175 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    instance Storable Color where
      sizeOf :: Color -> SortColumnId
    sizeOf Color
    _ = SortColumnId
    12
    {-# LINE 178 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined::Word32)
    {-# LINE 179 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        red    <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
    {-# LINE 181 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        green  <- (\hsc_ptr -> peekByteOff hsc_ptr 6) ptr
    {-# LINE 182 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        blue   <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
    {-# LINE 183 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ Color red green blue
      poke :: Ptr Color -> Color -> IO ()
    poke Ptr Color
    ptr (Color Word16
    red Word16
    green Word16
    blue) = do
        (\Ptr Color
    hsc_ptr -> Ptr Color -> SortColumnId -> Int32 -> IO ()
    forall b. Ptr b -> SortColumnId -> Int32 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr Color
    hsc_ptr SortColumnId
    0) Ptr Color
    ptr (Int32
    0::Int32)
    {-# LINE 186 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 4)   ptr red
    {-# LINE 187 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 6) ptr green
    {-# LINE 188 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 8)  ptr blue
    {-# LINE 189 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 193 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    {-# LINE 196 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    data RGBA = RGBA Double Double Double Double

    instance Storable RGBA where
      sizeOf :: RGBA -> SortColumnId
    sizeOf RGBA
    _ = SortColumnId
    32
    {-# LINE 200 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined::Word32)
    {-# LINE 201 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        red    <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
    {-# LINE 203 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        green  <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
    {-# LINE 204 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        blue   <- (\hsc_ptr -> peekByteOff hsc_ptr 16) ptr
    {-# LINE 205 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        alpha  <- (\hsc_ptr -> peekByteOff hsc_ptr 24) ptr
    {-# LINE 206 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ RGBA red green blue alpha
      poke :: Ptr RGBA -> RGBA -> IO ()
    poke Ptr RGBA
    ptr (RGBA Double
    red Double
    green Double
    blue Double
    alpha) = do
        (\Ptr RGBA
    hsc_ptr -> Ptr RGBA -> SortColumnId -> Double -> IO ()
    forall b. Ptr b -> SortColumnId -> Double -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr RGBA
    hsc_ptr SortColumnId
    0)   Ptr RGBA
    ptr Double
    red
    {-# LINE 209 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr green
    {-# LINE 210 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 16)  ptr blue
    {-# LINE 211 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 24) ptr alpha
    {-# LINE 212 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return ()

    {-# LINE 214 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 438 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- Widget related methods

    {-# LINE 463 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Allocation
    --
    -- * For Widget's 'Graphics.UI.Gtk.Abstract.Widget.sizeAllocate' signal.
    --   The @x@ and @y@ values of the rectangle refer to the widgets position
    --   relative to its parent window.
    --
    type Allocation = Rectangle

    -- | Requisition
    --
    -- * For 'Graphics.UI.Gtk.Abstract.Widget.widgetSizeRequest'. The values
    --   represent the desired width and height of the widget.
    --
    data Requisition = Requisition Int Int deriving (Requisition -> Requisition -> Bool
    (Requisition -> Requisition -> Bool)
    -> (Requisition -> Requisition -> Bool) -> Eq Requisition
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Requisition -> Requisition -> Bool
    == :: Requisition -> Requisition -> Bool
    $c/= :: Requisition -> Requisition -> Bool
    /= :: Requisition -> Requisition -> Bool
    Eq,SortColumnId -> Requisition -> ShowS
    [Requisition] -> ShowS
    Requisition -> String
    (SortColumnId -> Requisition -> ShowS)
    -> (Requisition -> String)
    -> ([Requisition] -> ShowS)
    -> Show Requisition
    forall a.
    (SortColumnId -> a -> ShowS)
    -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: SortColumnId -> Requisition -> ShowS
    showsPrec :: SortColumnId -> Requisition -> ShowS
    $cshow :: Requisition -> String
    show :: Requisition -> String
    $cshowList :: [Requisition] -> ShowS
    showList :: [Requisition] -> ShowS
    Show)

    instance Storable Requisition where
      sizeOf :: Requisition -> SortColumnId
    sizeOf Requisition
    _ = SortColumnId
    8
    {-# LINE 482 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined::Int32)
    {-# LINE 483 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        (width_  ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
    {-# LINE 485 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (height_ ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
    {-# LINE 486 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ Requisition (fromIntegral width_) (fromIntegral height_)
      poke :: Ptr Requisition -> Requisition -> IO ()
    poke Ptr Requisition
    ptr (Requisition SortColumnId
    width SortColumnId
    height) = do
        (\Ptr Requisition
    hsc_ptr -> Ptr Requisition -> SortColumnId -> Int32 -> IO ()
    forall b. Ptr b -> SortColumnId -> Int32 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr Requisition
    hsc_ptr SortColumnId
    0) Ptr Requisition
    ptr ((SortColumnId -> Int32
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral SortColumnId
    width)::Int32)
    {-# LINE 489 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr ((fromIntegral height)::Int32)
    {-# LINE 490 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- SpinButton related mothods

    -- If an invalid input has been put into a SpinButton the input function may
    -- reject this value by returning this value.
    inputError :: Int32
    {-# LINE 497 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    inputError = -1
    {-# LINE 498 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- The TreeIter struct is not used by itself. But we have to allocate space
    -- for it in module TreeModel.
    treeIterSize :: Int
    treeIterSize :: SortColumnId
    treeIterSize = SortColumnId
    32
    {-# LINE 504 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- The TextIter struct can be a local variable in a C program. We have to
    -- store it on the heap.
    --
    textIterSize :: Int
    textIterSize :: SortColumnId
    textIterSize = SortColumnId
    80
    {-# LINE 511 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- Dialog related methods

    {-# LINE 533 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Some constructors that can be used as response
    -- numbers for dialogs.
    --
    data ResponseId

      -- | GTK returns this if a response widget has no @response_id@,
      --   or if the dialog gets programmatically hidden or destroyed.
      = ResponseNone

      -- | GTK won't return these unless you pass them in as
      --   the response for an action widget. They are for your convenience.
      | ResponseReject
      | ResponseAccept -- ^ (as above)

      -- | If the dialog is deleted.
      | ResponseDeleteEvent

      -- | \"Ok\" was pressed.
      --
      -- * This value is returned from the \"Ok\" stock dialog button.
      | ResponseOk

      -- | \"Cancel\" was pressed.
      --
      -- * These value is returned from the \"Cancel\" stock dialog button.
      | ResponseCancel

      -- | \"Close\" was pressed.
      --
      -- * This value is returned from the \"Close\" stock dialog button.
            | ResponseClose

      -- | \"Yes\" was pressed.
      --
      -- * This value is returned from the \"Yes\" stock dialog button.
      | ResponseYes

      -- | \"No\" was pressed.
      --
      -- * This value is returned from the \"No\" stock dialog button.
      | ResponseNo

      -- | \"Apply\" was pressed.
      --
      -- * This value is returned from the \"Apply\" stock dialog button.
            | ResponseApply

      -- |  \"Help\" was pressed.
      --
      -- * This value is returned from the \"Help\" stock dialog button.
      | ResponseHelp

      -- | A user-defined response
      --
      -- * This value is returned from a user defined button
      | ResponseUser Int
      deriving (SortColumnId -> ResponseId -> ShowS
    [ResponseId] -> ShowS
    ResponseId -> String
    (SortColumnId -> ResponseId -> ShowS)
    -> (ResponseId -> String)
    -> ([ResponseId] -> ShowS)
    -> Show ResponseId
    forall a.
    (SortColumnId -> a -> ShowS)
    -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: SortColumnId -> ResponseId -> ShowS
    showsPrec :: SortColumnId -> ResponseId -> ShowS
    $cshow :: ResponseId -> String
    show :: ResponseId -> String
    $cshowList :: [ResponseId] -> ShowS
    showList :: [ResponseId] -> ShowS
    Show, ResponseId -> ResponseId -> Bool
    (ResponseId -> ResponseId -> Bool)
    -> (ResponseId -> ResponseId -> Bool) -> Eq ResponseId
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ResponseId -> ResponseId -> Bool
    == :: ResponseId -> ResponseId -> Bool
    $c/= :: ResponseId -> ResponseId -> Bool
    /= :: ResponseId -> ResponseId -> Bool
    Eq)

    fromResponse :: Integral a => ResponseId -> a
    fromResponse :: forall a. Integral a => ResponseId -> a
    fromResponse ResponseId
    ResponseNone = -a
    1
    fromResponse ResponseId
    ResponseReject = -a
    2
    fromResponse ResponseId
    ResponseAccept = -a
    3
    fromResponse ResponseId
    ResponseDeleteEvent = -a
    4
    fromResponse ResponseId
    ResponseOk = -a
    5
    fromResponse ResponseId
    ResponseCancel = -a
    6
    fromResponse ResponseId
    ResponseClose = -a
    7
    fromResponse ResponseId
    ResponseYes = -a
    8
    fromResponse ResponseId
    ResponseNo = -a
    9
    fromResponse ResponseId
    ResponseApply = -a
    10
    fromResponse ResponseId
    ResponseHelp = -a
    11
    fromResponse (ResponseUser SortColumnId
    i) = SortColumnId -> a
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral SortColumnId
    i

    toResponse :: Integral a => a -> ResponseId
    toResponse :: forall a. Integral a => a -> ResponseId
    toResponse (-1) = ResponseId
    ResponseNone
    toResponse (-2) = ResponseId
    ResponseReject
    toResponse (-3) = ResponseId
    ResponseAccept
    toResponse (-4) = ResponseId
    ResponseDeleteEvent
    toResponse (-5) = ResponseId
    ResponseOk
    toResponse (-6) = ResponseId
    ResponseCancel
    toResponse (-7) = ResponseId
    ResponseClose
    toResponse (-8) = ResponseId
    ResponseYes
    toResponse (-9) = ResponseId
    ResponseNo
    toResponse (-10) = ResponseId
    ResponseApply
    toResponse (-11) = ResponseId
    ResponseHelp
    toResponse a
    i = SortColumnId -> ResponseId
    ResponseUser (SortColumnId -> ResponseId) -> SortColumnId -> ResponseId
    forall a b. (a -> b) -> a -> b
    $ a -> SortColumnId
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral a
    i

    {-# LINE 621 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    -- | The identifier of a window of the underlying windowing system.
    --

    {-# LINE 645 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 648 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    newtype NativeWindowId = NativeWindowId Word64 deriving (NativeWindowId -> NativeWindowId -> Bool
    (NativeWindowId -> NativeWindowId -> Bool)
    -> (NativeWindowId -> NativeWindowId -> Bool) -> Eq NativeWindowId
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NativeWindowId -> NativeWindowId -> Bool
    == :: NativeWindowId -> NativeWindowId -> Bool
    $c/= :: NativeWindowId -> NativeWindowId -> Bool
    /= :: NativeWindowId -> NativeWindowId -> Bool
    Eq, SortColumnId -> NativeWindowId -> ShowS
    [NativeWindowId] -> ShowS
    NativeWindowId -> String
    (SortColumnId -> NativeWindowId -> ShowS)
    -> (NativeWindowId -> String)
    -> ([NativeWindowId] -> ShowS)
    -> Show NativeWindowId
    forall a.
    (SortColumnId -> a -> ShowS)
    -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: SortColumnId -> NativeWindowId -> ShowS
    showsPrec :: SortColumnId -> NativeWindowId -> ShowS
    $cshow :: NativeWindowId -> String
    show :: NativeWindowId -> String
    $cshowList :: [NativeWindowId] -> ShowS
    showList :: [NativeWindowId] -> ShowS
    Show)
    {-# LINE 649 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 650 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    unNativeWindowId :: Integral a => NativeWindowId -> a
    unNativeWindowId :: forall a. Integral a => NativeWindowId -> a
    unNativeWindowId (NativeWindowId Word64
    id) = Word64 -> a
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word64
    id
    toNativeWindowId :: Integral a => a -> NativeWindowId
    toNativeWindowId :: forall a. Integral a => a -> NativeWindowId
    toNativeWindowId = Word64 -> NativeWindowId
    NativeWindowId (Word64 -> NativeWindowId) -> (a -> Word64) -> a -> NativeWindowId
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Word64
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral
    fromNativeWindowId :: Integral a => NativeWindowId -> a
    fromNativeWindowId :: forall a. Integral a => NativeWindowId -> a
    fromNativeWindowId = Integer -> a
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Integer -> a)
    -> (NativeWindowId -> Integer) -> NativeWindowId -> a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . NativeWindowId -> Integer
    forall a. Integral a => NativeWindowId -> a
    unNativeWindowId
    nativeWindowIdNone :: NativeWindowId
    nativeWindowIdNone :: NativeWindowId
    nativeWindowIdNone = Word64 -> NativeWindowId
    NativeWindowId Word64
    0

    {-# LINE 659 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 660 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 670 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 671 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    foreign import ccall unsafe "gdk_x11_window_get_xid"
      gdk_x11_drawable_get_xid :: (Ptr DrawWindow) -> IO CInt

    {-# LINE 674 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 675 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Get 'NativeWindowId' of 'Drawable'.

    {-# LINE 680 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    drawableGetID :: DrawWindowClass d => d -> IO NativeWindowId

    {-# LINE 682 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    drawableGetID d =
      liftM toNativeWindowId $

    {-# LINE 687 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      (\(DrawWindow drawable) ->

    {-# LINE 689 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 698 "Graphics/UI/Gtk/General/Structs.hsc" #-}
         withForeignPtr drawable gdk_x11_drawable_get_xid

    {-# LINE 702 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 705 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      ) (toDrawWindow d)

    {-# LINE 707 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 723 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The size of an icon in pixels.
    --
    -- * This enumeration contains one case that is not exported and which
    --   is used when new sizes are registered using
    --   'Graphics.UI.Gtk.General.IconFactory.iconSizeRegister'.
    --
    -- * Applying 'show' to this type will reveal the name of the size
    --   that is registered with Gtk+.
    --
    data IconSize
      -- | Don't scale but use any of the available sizes.
      = IconSizeInvalid

      -- | Icon size to use in next to menu items in drop-down menus.
      | IconSizeMenu

      -- | Icon size for small toolbars.
      | IconSizeSmallToolbar

      -- | Icon size for larger toolbars.
      | IconSizeLargeToolbar

      -- | Icon size for icons in buttons, next to the label.
      | IconSizeButton

      -- | Icon size for icons in drag-and-drop.
      | IconSizeDnd

      -- | Icon size for icons next to dialog text.
      | IconSizeDialog

      | IconSizeUser Int
      deriving (IconSize -> IconSize -> Bool
    (IconSize -> IconSize -> Bool)
    -> (IconSize -> IconSize -> Bool) -> Eq IconSize
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: IconSize -> IconSize -> Bool
    == :: IconSize -> IconSize -> Bool
    $c/= :: IconSize -> IconSize -> Bool
    /= :: IconSize -> IconSize -> Bool
    Eq)

    instance Enum IconSize where
      toEnum :: SortColumnId -> IconSize
    toEnum SortColumnId
    0 = IconSize
    IconSizeInvalid
    {-# LINE 760 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 1    = IconSizeMenu
    {-# LINE 761 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 2 = IconSizeSmallToolbar
    {-# LINE 762 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 3 = IconSizeLargeToolbar
    {-# LINE 763 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 4 = IconSizeButton
    {-# LINE 764 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 5 = IconSizeDnd
    {-# LINE 765 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum 6 = IconSizeDialog
    {-# LINE 766 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      toEnum n = IconSizeUser n
      fromEnum :: IconSize -> SortColumnId
    fromEnum IconSize
    IconSizeInvalid = SortColumnId
    0
    {-# LINE 768 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeMenu = 1
    {-# LINE 769 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeSmallToolbar = 2
    {-# LINE 770 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeLargeToolbar = 3
    {-# LINE 771 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeButton = 4
    {-# LINE 772 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeDnd = 5
    {-# LINE 773 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum IconSizeDialog = 6
    {-# LINE 774 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      fromEnum (IconSizeUser n) = n

    -- entry Widget Combo

    {-# LINE 787 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- FileSelection related methods

    {-# LINE 803 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 851 "Graphics/UI/Gtk/General/Structs.hsc" #-}
    -- Styles related methods

    -- | Retrieve the the foreground color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetForeground :: Style -> StateType -> IO Color
    styleGetForeground :: Style -> StateType -> IO Color
    styleGetForeground Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr -> do
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    24) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 864 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve the background color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetBackground :: Style -> StateType -> IO Color
    styleGetBackground :: Style -> StateType -> IO Color
    styleGetBackground Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    84) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 876 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve a light color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetLight :: Style -> StateType -> IO Color
    styleGetLight :: Style -> StateType -> IO Color
    styleGetLight Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    144) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 888 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve a middle color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetMiddle :: Style -> StateType -> IO Color
    styleGetMiddle :: Style -> StateType -> IO Color
    styleGetMiddle Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    264) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 900 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve a dark color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetDark :: Style -> StateType -> IO Color
    styleGetDark :: Style -> StateType -> IO Color
    styleGetDark Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    204) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 912 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve the text color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetText :: Style -> StateType -> IO Color
    styleGetText :: Style -> StateType -> IO Color
    styleGetText Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    324) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 924 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve the base color.
    --
    -- * The base color is the standard text background of a widget.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetBase :: Style -> StateType -> IO Color
    styleGetBase :: Style -> StateType -> IO Color
    styleGetBase Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    384) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 938 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | Retrieve the color for drawing anti-aliased text.
    --
    -- * The anti-aliasing color is the color which is used when the rendering
    --   of a character does not make it clear if a certain pixel should be set
    --   or not. This color is between the text and the base color.
    --
    -- * The parameter @state@ determines for which widget
    --   state (one of 'StateType') the 'Color' should be retrieved.
    --   Use 'widgetGetState' to determine the current state of the
    --   widget.
    --
    styleGetAntiAliasing :: Style -> StateType -> IO Color
    styleGetAntiAliasing :: Style -> StateType -> IO Color
    styleGetAntiAliasing Style
    st StateType
    ty =
      ForeignPtr Style -> (Ptr Style -> IO Color) -> IO Color
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr (Style -> ForeignPtr Style
    unStyle Style
    st) ((Ptr Style -> IO Color) -> IO Color)
    -> (Ptr Style -> IO Color) -> IO Color
    forall a b. (a -> b) -> a -> b
    $ \Ptr Style
    stPtr ->
        Ptr Color -> SortColumnId -> IO Color
    forall a. Storable a => Ptr a -> SortColumnId -> IO a
    peekElemOff ((\Ptr Style
    hsc_ptr -> Ptr Style
    hsc_ptr Ptr Style -> SortColumnId -> Ptr Color
    forall a b. Ptr a -> SortColumnId -> Ptr b
    `plusPtr` SortColumnId
    444) Ptr Style
    stPtr) (StateType -> SortColumnId
    forall a. Enum a => a -> SortColumnId
    fromEnum StateType
    ty)
    {-# LINE 954 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 1016 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | ID number of a sort column.
    --
    -- * A 'SortColumnId' is a logical number to which a sorting function can
    --   be associated. The number does not have to coincide with any column
    --   number.
    type SortColumnId = Int

    -- | A special 'SortColumnId' to indicated that the default sorting function is used.
    --
    treeSortableDefaultSortColumnId :: SortColumnId
    treeSortableDefaultSortColumnId :: SortColumnId
    treeSortableDefaultSortColumnId = -SortColumnId
    1
    {-# LINE 1028 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    intToAtom :: Int -> Atom
    intToAtom :: SortColumnId -> Atom
    intToAtom = Ptr () -> Atom
    Atom (Ptr () -> Atom)
    -> (SortColumnId -> Ptr ()) -> SortColumnId -> Atom
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (ZonkAny 0) -> SortColumnId -> Ptr ()
    forall a b. Ptr a -> SortColumnId -> Ptr b
    plusPtr Ptr (ZonkAny 0)
    forall a. Ptr a
    nullPtr

    -- | An invalid 'TargetTag', 'SelectionTag', 'SelectionTypeTag' or 'PropertyTag'.
    --
    tagInvalid :: Atom
    tagInvalid :: Atom
    tagInvalid = SortColumnId -> Atom
    intToAtom SortColumnId
    0
    {-# LINE 1036 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The primary selection (the currently highlighted text in X11 that can
    --   in many applications be pasted using the middle button).
    selectionPrimary :: SelectionTag
    selectionPrimary :: Atom
    selectionPrimary = SortColumnId -> Atom
    intToAtom SortColumnId
    1
    {-# LINE 1041 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The secondary selection. Rarely used.
    selectionSecondary :: SelectionTag
    selectionSecondary :: Atom
    selectionSecondary = SortColumnId -> Atom
    intToAtom SortColumnId
    2
    {-# LINE 1045 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The modern clipboard that is filled by copy or cut commands.
    selectionClipboard :: SelectionTag
    selectionClipboard :: Atom
    selectionClipboard = SortColumnId -> Atom
    intToAtom SortColumnId
    69
    {-# LINE 1049 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | If this target is provided by a selection, then the data is a string.
    targetString :: TargetTag
    targetString :: Atom
    targetString = SortColumnId -> Atom
    intToAtom SortColumnId
    31
    {-# LINE 1053 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The type indicating that the associated data is itself a (list of)
    -- 'Graphics.UI.Gtk.General.Selection.Atom's.
    selectionTypeAtom :: SelectionTypeTag
    selectionTypeAtom :: Atom
    selectionTypeAtom = SortColumnId -> Atom
    intToAtom SortColumnId
    4
    {-# LINE 1058 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The type indicating that the associated data consists of integers.
    selectionTypeInteger :: SelectionTypeTag
    selectionTypeInteger :: Atom
    selectionTypeInteger = SortColumnId -> Atom
    intToAtom SortColumnId
    19
    {-# LINE 1062 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | The type indicating that the associated data is a string without further
    -- information on its encoding.
    selectionTypeString :: SelectionTypeTag
    selectionTypeString :: Atom
    selectionTypeString = SortColumnId -> Atom
    intToAtom SortColumnId
    31
    {-# LINE 1067 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    {-# LINE 1075 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- A type that identifies a target. This is needed to marshal arrays of
    -- GtkTargetEntries.
    data TargetEntry = TargetEntry (Ptr Int8) InfoId
    {-# LINE 1079 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- brain damaged API: the whole selection API doesn't need GtkTargetEntry
    -- structure, but stupid Clipboard has two functions that only provide this
    -- interface. Thus, convert the efficient Atoms back into strings, have
    -- the clipboard functions convert them back to string before we get a
    -- chance to free the freshly allocated strings.

    withTargetEntries :: [(TargetTag, InfoId)] -> (Int -> Ptr () -> IO a) -> IO a
    withTargetEntries :: forall a.
    [(Atom, InfoId)] -> (SortColumnId -> Ptr () -> IO a) -> IO a
    withTargetEntries [(Atom, InfoId)]
    tags SortColumnId -> Ptr () -> IO a
    fun = do
      ptrsInfo <- ((Atom, InfoId) -> IO TargetEntry)
    -> [(Atom, InfoId)] -> IO [TargetEntry]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
    mapM (\(Atom Ptr ()
    tag, InfoId
    info) -> Ptr () -> IO (Ptr Int8)
    gdk_atom_name Ptr ()
    tag IO (Ptr Int8) -> (Ptr Int8 -> IO TargetEntry) -> IO TargetEntry
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= \Ptr Int8
    strPtr ->
                         TargetEntry -> IO TargetEntry
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Ptr Int8 -> InfoId -> TargetEntry
    TargetEntry Ptr Int8
    strPtr InfoId
    info)) [(Atom, InfoId)]
    tags
      res <- withArrayLen ptrsInfo (\SortColumnId
    len Ptr TargetEntry
    ptr -> SortColumnId -> Ptr () -> IO a
    fun SortColumnId
    len (Ptr TargetEntry -> Ptr ()
    forall a b. Ptr a -> Ptr b
    castPtr Ptr TargetEntry
    ptr))
      mapM_ (\(TargetEntry Ptr Int8
    ptr InfoId
    _) -> Ptr Int8 -> IO ()
    g_free Ptr Int8
    ptr) ptrsInfo
      return res

    foreign import ccall unsafe "gdk_atom_name"
      gdk_atom_name :: Ptr () -> IO (Ptr Int8)
    {-# LINE 1096 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    foreign import ccall unsafe "g_free"
      g_free :: Ptr Int8 -> IO ()
    {-# LINE 1099 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    instance Storable TargetEntry where
      sizeOf :: TargetEntry -> SortColumnId
    sizeOf TargetEntry
    _ = SortColumnId
    16
    {-# LINE 1102 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined::Word32)
    {-# LINE 1103 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = undefined
      poke :: Ptr TargetEntry -> TargetEntry -> IO ()
    poke Ptr TargetEntry
    ptr (TargetEntry Ptr Int8
    cPtr InfoId
    info) = do
        (\Ptr TargetEntry
    hsc_ptr -> Ptr TargetEntry -> SortColumnId -> Ptr Int8 -> IO ()
    forall b. Ptr b -> SortColumnId -> Ptr Int8 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr TargetEntry
    hsc_ptr SortColumnId
    0) Ptr TargetEntry
    ptr Ptr Int8
    cPtr
    {-# LINE 1106 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr (0::Word32)
    {-# LINE 1107 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 12) ptr info
    {-# LINE 1108 "Graphics/UI/Gtk/General/Structs.hsc" #-}

    -- | A 'KeymapKey' is a hardware key that can be mapped to a keyval.
    data KeymapKey = KeymapKey {
           KeymapKey -> SortColumnId
    keycode   :: Int -- ^ @keycode@ the hardware keycode. This is an identifying number for a physical key.
          ,KeymapKey -> SortColumnId
    group     :: Int -- ^ @group@ indicates movement in a horizontal direction.
                          -- Usually groups are used for two different languages.
                          -- In group  0, a key might have two English characters,
                          -- and in group 1 it might have two Hebrew characters.
                          -- The Hebrew characters will be printed on the key next to the English characters.
                          -- indicates which symbol on the key will be used,
                          -- in a vertical direction. So on a standard US keyboard, the
          ,KeymapKey -> SortColumnId
    level     :: Int -- ^ @level@ key with the number "1" on it also has the exclamation
                          -- point ("!") character on it. The level
                          -- indicates whether to use the "1" or the "!" symbol. The letter keys are considered to
                          -- have a lowercase letter at level 0, and an uppercase letter at level 1, though only
                          -- the uppercase letter is printed.
        } deriving (KeymapKey -> KeymapKey -> Bool
    (KeymapKey -> KeymapKey -> Bool)
    -> (KeymapKey -> KeymapKey -> Bool) -> Eq KeymapKey
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: KeymapKey -> KeymapKey -> Bool
    == :: KeymapKey -> KeymapKey -> Bool
    $c/= :: KeymapKey -> KeymapKey -> Bool
    /= :: KeymapKey -> KeymapKey -> Bool
    Eq, SortColumnId -> KeymapKey -> ShowS
    [KeymapKey] -> ShowS
    KeymapKey -> String
    (SortColumnId -> KeymapKey -> ShowS)
    -> (KeymapKey -> String)
    -> ([KeymapKey] -> ShowS)
    -> Show KeymapKey
    forall a.
    (SortColumnId -> a -> ShowS)
    -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: SortColumnId -> KeymapKey -> ShowS
    showsPrec :: SortColumnId -> KeymapKey -> ShowS
    $cshow :: KeymapKey -> String
    show :: KeymapKey -> String
    $cshowList :: [KeymapKey] -> ShowS
    showList :: [KeymapKey] -> ShowS
    Show)

    instance Storable KeymapKey where
      sizeOf :: KeymapKey -> SortColumnId
    sizeOf KeymapKey
    _ = SortColumnId
    12
    {-# LINE 1128 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      alignment _ = alignment (undefined::Int32)
    {-# LINE 1129 "Graphics/UI/Gtk/General/Structs.hsc" #-}
      peek ptr = do
        (keycode_  ::Word32)    <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
    {-# LINE 1131 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (group_  ::Int32)       <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
    {-# LINE 1132 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (level_ ::Int32)        <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
    {-# LINE 1133 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        return $ KeymapKey (fromIntegral keycode_) (fromIntegral group_) (fromIntegral level_)
      poke :: Ptr KeymapKey -> KeymapKey -> IO ()
    poke Ptr KeymapKey
    ptr (KeymapKey SortColumnId
    keycode SortColumnId
    group SortColumnId
    level) = do
        (\Ptr KeymapKey
    hsc_ptr -> Ptr KeymapKey -> SortColumnId -> Word32 -> IO ()
    forall b. Ptr b -> SortColumnId -> Word32 -> IO ()
    forall a b. Storable a => Ptr b -> SortColumnId -> a -> IO ()
    pokeByteOff Ptr KeymapKey
    hsc_ptr SortColumnId
    0) Ptr KeymapKey
    ptr ((SortColumnId -> Word32
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral SortColumnId
    keycode)::Word32)
    {-# LINE 1136 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr ((fromIntegral group)::Int32)
    {-# LINE 1137 "Graphics/UI/Gtk/General/Structs.hsc" #-}
        (\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr ((fromIntegral level)::Int32)
    {-# LINE 1138 "Graphics/UI/Gtk/General/Structs.hsc" #-}