{-# LINE 2 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- -*-haskell-*-
-- GIMP Toolkit (GTK) Widget Widget
--
-- Author : Axel Simon
--
-- Created: 27 April 2001
--
-- Copyright (C) 2001-2008 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.
--
--
-- |
-- Maintainer : gtk2hs-users@lists.sourceforge.net
-- Stability : provisional
-- Portability : portable (depends on GHC)
--
-- The base class for all widgets.
--
module Graphics.UI.Gtk.Abstract.Widget (

-- * Detail
--
-- | The base class for all widgets. While a widget cannot be created directly,
-- this module contains many useful methods common to all widgets. In
-- particular, these functions are needed to add functionality to
-- blank widgets such as 'DrawingArea' or 'Layout'.
--
-- 'Widget' introduces style properties - these are basically object
-- properties that are stored not on the object, but in the style object
-- associated to the widget. Style properties are set in resource files. This
-- mechanism is used for configuring such things as the location of the
-- scrollbar arrows through the theme, giving theme authors more control over
-- the look of applications without the need to write a theme engine in C.
--
-- Widgets receive events, that is, signals that indicate some low-level
-- user iteraction. The signal handlers for all these events have to
-- return @True@ if the signal has been dealt with and @False@ if other
-- signal handlers should be run.

-- * Class Hierarchy
--
-- |
-- @
-- | 'GObject'
-- | +----'Object'
-- | +----Widget
-- | +----/too many to list/
-- @

-- * Types
  Widget,
  WidgetClass,
  castToWidget, gTypeWidget,
  toWidget,
  EventMask(..),



  GType,
  KeyVal,




  Requisition(..),
  Rectangle(..),
  Color,
  IconSize(..),
  StateType(..),
  TextDirection(..),
  AccelFlags(..),
  DirectionType(..),
  StockId,
  WidgetHelpType(..),
  Allocation,

-- * Methods
  widgetShow,
  widgetShowNow,
  widgetHide,
  widgetShowAll,



  widgetDestroy,

  widgetDraw,

  widgetQueueDraw,
  widgetQueueResize,

  widgetQueueResizeNoRedraw,


  widgetGetFrameClock,


  widgetGetScaleFactor,

  widgetSizeRequest,
  widgetGetChildRequisition,
  widgetSizeAllocate,

  widgetSizeAllocateWithBaseline,

  widgetAddAccelerator,
  widgetRemoveAccelerator,
  widgetSetAccelPath,

  widgetCanActivateAccel,

  widgetActivate,
  widgetIntersect,
  widgetHasIntersection,
  widgetGetIsFocus,
  widgetGrabFocus,
  widgetGrabDefault,
  widgetSetName,
  widgetGetName,
  widgetSetSensitive,
  widgetSetSensitivity,
  widgetGetParentWindow,



  widgetDelEvents,
  widgetAddEvents,
  widgetGetEvents,
  widgetSetEvents,




  widgetGetToplevel,
  widgetGetAncestor,




  widgetGetPointer,
  widgetIsAncestor,
  widgetTranslateCoordinates,
  widgetSetStyle,
  widgetGetStyle,






  widgetGetDefaultStyle,
  widgetSetDirection,
  widgetGetDirection,
  widgetSetDefaultDirection,
  widgetGetDefaultDirection,







  widgetShapeCombineRegion,
  widgetInputShapeCombineRegion,






  widgetPath,
  widgetClassPath,
  widgetGetCompositeName,

  widgetOverrideBackgroundColor,
  widgetOverrideColor,
  widgetOverrideFont,
  widgetOverrideSymbolicColor,
  widgetOverrideCursor,

  widgetModifyStyle,
  widgetGetModifierStyle,
  widgetModifyFg,
  widgetModifyBg,
  widgetModifyText,
  widgetModifyBase,
  widgetModifyFont,
  widgetRestoreFg,
  widgetRestoreBg,
  widgetRestoreText,
  widgetRestoreBase,
  widgetCreatePangoContext,
  widgetGetPangoContext,
  widgetCreateLayout,
  widgetRenderIcon,
  widgetQueueDrawArea,

  widgetQueueDrawRegion,




  widgetSetAppPaintable,
  widgetSetDoubleBuffered,
  widgetSetRedrawOnAllocate,
  widgetSetCompositeName,
  widgetMnemonicActivate,




  widgetGetAccessible,
  widgetChildFocus,
  widgetGetChildVisible,
  widgetGetParent,
  widgetGetSettings,

  widgetGetClipboard,
  widgetGetDisplay,
  widgetGetRootWindow,
  widgetGetScreen,
  widgetHasScreen,

  widgetGetSizeRequest,

  widgetGetPreferredSize,

  widgetSetChildVisible,
  widgetSetSizeRequest,

  widgetSetNoShowAll,
  widgetGetNoShowAll,
  widgetListMnemonicLabels,
  widgetAddMnemonicLabel,
  widgetRemoveMnemonicLabel,




  widgetIsComposited,



  widgetErrorBell,
  widgetKeynavFailed,
  widgetGetTooltipMarkup,
  widgetSetTooltipMarkup,
  widgetGetTooltipText,
  widgetSetTooltipText,
  widgetGetTooltipWindow,
  widgetSetTooltipWindow,
  widgetGetHasTooltip,
  widgetSetHasTooltip,
  widgetTriggerTooltipQuery,


  widgetGetWindow,


  widgetRegisterWindow,
  widgetUnregisterWindow,


  cairoShouldDrawWindow,
  cairoTransformToWindow,

  widgetReparent,

  widgetGetCanFocus,
  widgetSetCanFocus,
  widgetGetAllocation,


  widgetGetAllocatedWidth,
  widgetGetAllocatedHeight,


  widgetGetAllocatedBaseline,


  widgetGetClip,
  widgetSetClip,


  widgetGetAppPaintable,
  widgetGetCanDefault,
  widgetSetCanDefault,
  widgetGetHasWindow,
  widgetSetHasWindow,
  widgetGetSensitive,
  widgetIsSensitive,
  widgetGetState,
  widgetGetVisible,


  widgetIsVisible,


  widgetSetStateFlags,
  widgetUnsetStateFlags,
  widgetGetStateFlags,


  widgetGetHasDefault,
  widgetGetHasFocus,


  widgetHasVisibleFocus,


  widgetHasGrab,
  widgetIsDrawable,
  widgetIsToplevel,
  widgetSetWindow,
  widgetSetReceivesDefault,
  widgetGetReceivesDefault,


  widgetDeviceIsShadowed,


  widgetGetModifierMask,


  widgetSetSupportMultidevice,
  widgetGetSupportMultidevice,

  widgetSetState,




  widgetEvent,

  widgetGetHAlign,
  widgetSetHAlign,
  widgetGetVAlign,

  widgetGetVAlignWithBaseline,

  widgetSetVAlign,


-- * Attributes
  widgetName,
  widgetParent,
  widgetWidthRequest,
  widgetHeightRequest,
  widgetMarginLeft,
  widgetMarginRight,

  widgetMarginStart,
  widgetMarginEnd,

  widgetMarginTop,
  widgetMarginBottom,
  widgetVisible,
  widgetOpacity,
  widgetSensitive,
  widgetAppPaintable,
  widgetCanFocus,
  widgetHasFocus,
  widgetIsFocus,
  widgetCanDefault,
  widgetHasDefault,
  widgetReceivesDefault,
  widgetCompositeChild,
  widgetStyle,
  widgetState,
  widgetEvents,



  widgetExpand,
  widgetHExpand,
  widgetHExpandSet,
  widgetVExpand,
  widgetVExpandSet,
  widgetNoShowAll,
  widgetChildVisible,



  widgetCompositeName,
  widgetDirection,
  widgetTooltipMarkup,
  widgetTooltipText,
  widgetHasTooltip,

  widgetHasRcStyle,
  widgetGetRealized,
  widgetGetMapped,
  widgetSetRealized,
  widgetSetMapped,


  widgetGetStyleContext,


-- * Signals
  realize,
  unrealize,
  mapSignal,
  unmapSignal,
  sizeRequest,
  sizeAllocate,
  showSignal,
  hideSignal,
  focus,
  stateChanged,

  stateFlagsChanged,

  parentSet,
  hierarchyChanged,
  styleSet,
  directionChanged,
  grabNotify,
  popupMenuSignal,
  showHelp,
  accelClosuresChanged,
  screenChanged,
  queryTooltip,

  draw,


-- * Events
  buttonPressEvent,
  buttonReleaseEvent,
  configureEvent,
  deleteEvent,
  destroyEvent,
  enterNotifyEvent,
  exposeEvent,
  focusInEvent,
  focusOutEvent,

  grabBrokenEvent,

  keyPressEvent,
  keyReleaseEvent,
  leaveNotifyEvent,
  mapEvent,
  motionNotifyEvent,
  noExposeEvent,
  proximityInEvent,
  proximityOutEvent,
  scrollEvent,
  unmapEvent,
  visibilityNotifyEvent,
  windowStateEvent,

-- * Deprecated
{-# LINE 539 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
  ) where

import Control.Monad (liftM, unless)
import Data.Maybe (fromMaybe)
import Control.Monad.Reader (ask)
import Control.Monad.Trans (liftIO)
import System.Glib.FFI
import System.Glib.Flags (fromFlags, toFlags)

import System.Glib.GError (failOnGError)
import System.Glib.Flags (Flags)

import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import System.Glib.GType (GType)
import System.Glib.GList (fromGList)
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.General.DNDTypes (Atom (Atom), SelectionTag)
import Graphics.UI.Gtk.Types
{-# LINE 559 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 560 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
import Graphics.UI.Gtk.Gdk.Enums (EventMask(..)



    )
import Graphics.UI.Gtk.Gdk.Keys (KeyVal)




import Graphics.UI.Gtk.General.Structs (Allocation, Rectangle(..)
                                        ,Requisition(..), Color, IconSize(..)
                                        ,Point







                                        )



import Graphics.UI.Gtk.Gdk.EventM (EventM,
  EventM,
  EAny,
  EKey,
  EButton,
  EScroll,
  EMotion,
  EExpose,
  EVisibility,
  ECrossing,
  EFocus,
  EConfigure,
  EProperty,
  EProximity,
  EWindowState,

  EGrabBroken,

  )
import Graphics.UI.Gtk.General.Enums (StateType(..), TextDirection(..),
                                         AccelFlags(..), DirectionType(..), Modifier

                                        ,StateFlags(..), Align(..)


                                        ,ModifierIntent(..)

                                        )
import Graphics.Rendering.Pango.Types
{-# LINE 613 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
import Graphics.Rendering.Pango.BasicTypes (FontDescription(FontDescription),
                                         PangoLayout(PangoLayout), makeNewPangoString )
import Graphics.UI.Gtk.General.StockItems (StockId)
import Data.IORef ( newIORef )
import Control.Monad.Reader ( runReaderT )

import Graphics.Rendering.Cairo.Types (Cairo(..), unCairo, Region(..), withRegion)
import Graphics.Rendering.Cairo.Internal (Render(..))



{-# LINE 624 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}

--------------------
-- Methods

-- | Flags a widget to be displayed. Any widget that isn't shown will not
-- appear on the screen. If you want to show all the widgets in a container,
-- it's easier to call 'widgetShowAll' on the container, instead of
-- individually showing the widgets.
--
-- Remember that you have to show the containers containing a widget, in
-- addition to the widget itself, before it will appear onscreen.
--
-- When a toplevel container is shown, it is immediately realized and
-- mapped; other shown widgets are realized and mapped when their toplevel
-- container is realized and mapped.
--
widgetShow :: WidgetClass self => self -> IO ()
widgetShow :: forall self. WidgetClass self => self -> IO ()
widgetShow self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_show Ptr Widget
argPtr1)
{-# LINE 643 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Shows a widget. If the widget is an unmapped toplevel widget (i.e. a
-- 'Window' that has not yet been shown), enter the main loop and wait for the
-- window to actually be mapped. Be careful; because the main loop is running,
-- anything can happen during this function.
--
widgetShowNow :: WidgetClass self => self -> IO ()
widgetShowNow :: forall self. WidgetClass self => self -> IO ()
widgetShowNow self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_show_now Ptr Widget
argPtr1)
{-# LINE 653 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Reverses the effects of 'widgetShow', causing the widget to be hidden
-- (invisible to the user).
--
widgetHide :: WidgetClass self => self -> IO ()
widgetHide :: forall self. WidgetClass self => self -> IO ()
widgetHide self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_hide Ptr Widget
argPtr1)
{-# LINE 661 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Recursively shows a widget, and any child widgets (if the widget is a
-- container).
--
widgetShowAll :: WidgetClass self => self -> IO ()
widgetShowAll :: forall self. WidgetClass self => self -> IO ()
widgetShowAll self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_show_all Ptr Widget
argPtr1)
{-# LINE 669 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
{-# LINE 681 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- | Destroys a widget. Equivalent to
-- 'Graphics.UI.Gtk.Abstract.Object.objectDestroy'.
--
-- When a widget is destroyed it will be removed from the screen and
-- unrealized. When a widget is destroyed, it will break any references it
-- holds to other objects.If the widget is inside a container, the widget will
-- be removed from the container. The widget will be garbage collected
-- (finalized) time after your last reference to the widget dissapears.
--
-- In most cases, only toplevel widgets (windows) require explicit
-- destruction, because when you destroy a toplevel its children will be
-- destroyed as well.
--
widgetDestroy :: WidgetClass self => self -> IO ()
widgetDestroy :: forall self. WidgetClass self => self -> IO ()
widgetDestroy self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_destroy Ptr Widget
argPtr1)
{-# LINE 697 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- | Draws widget to @cr@. The top left corner of the widget will be drawn
-- to the currently set origin point of @cr@.
--
-- You should pass a cairo context as cr argument that is in an original
-- state. Otherwise the resulting drawing is undefined. For example changing
-- the operator using 'Graphics.Rendering.Cairo.setOperator' or the line
-- width using 'Graphics.Rendering.Cairo.setLineWidth' might have unwanted
-- side effects. You may however change the context’s transform matrix - like
-- with 'Graphics.Rendering.Cairo.scale', 'Graphics.Rendering.Cairo.translate'
-- or 'Graphics.Rendering.Cairo.setMatrix' and clip region with
-- 'Graphics.Rendering.Cairo.clip' prior to calling this function. Also, it
-- is fine to modify the context with 'Graphics.Rendering.Cairo.save' and
-- 'Graphics.Rendering.Cairo.pushGroup' prior to calling this function.
--
-- Note that special-purpose widgets may contain special code for rendering
-- to the screen and might appear differently on screen and when rendered
-- using 'widgetDraw'.
--
widgetDraw :: WidgetClass self
 => self -- ^ the widget to draw. It must be drawable (see 'widgetIsDrawable')
          -- and a size must have been allocated.
 -> Cairo -- ^ a cairo context to draw to
 -> IO ()
widgetDraw :: forall self. WidgetClass self => self -> Cairo -> IO ()
widgetDraw self
self Cairo
cr =
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_draw Ptr Widget
argPtr1 Ptr ()
arg2)
{-# LINE 725 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Cairo -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (Ptr Cairo -> Ptr ()) -> Ptr Cairo -> Ptr ()
forall a b. (a -> b) -> a -> b
$ Cairo -> Ptr Cairo
unCairo Cairo
cr)


-- * Functions to be used with 'Graphics.UI.Gtk.Misc.DrawingArea' or
-- container implementations.

-- | Send a redraw request to a widget. Equivalent to calling
-- 'widgetQueueDrawArea' for the entire area of a widget.
--
widgetQueueDraw :: WidgetClass self => self -> IO ()
widgetQueueDraw :: forall self. WidgetClass self => self -> IO ()
widgetQueueDraw self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_queue_draw Ptr Widget
argPtr1)
{-# LINE 738 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | This function is only for use in widget implementations. Flags a widget
-- to have its size renegotiated; should be called when a widget for some
-- reason has a new size request. For example, when you change the text in a
-- 'Graphics.UI.Gtk.Display.Label.Label',
-- 'Graphics.UI.Gtk.Display.Label.Label' queues a resize to ensure there's
-- enough space for the new text.
--
widgetQueueResize :: WidgetClass self => self -> IO ()
widgetQueueResize :: forall self. WidgetClass self => self -> IO ()
widgetQueueResize self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_queue_resize Ptr Widget
argPtr1)
{-# LINE 750 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- | This function works like 'widgetQueueResize', except that the widget is
-- not invalidated.
--
-- * Available since Gtk+ version 2.4
--
widgetQueueResizeNoRedraw :: WidgetClass self => self -> IO ()
widgetQueueResizeNoRedraw :: forall self. WidgetClass self => self -> IO ()
widgetQueueResizeNoRedraw self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_queue_resize_no_redraw Ptr Widget
argPtr1)
{-# LINE 761 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)



-- | Obtains the frame clock for a widget. The frame clock is a global “ticker”
-- that can be used to drive animations and repaints. The most common reason to
-- get the frame clock is to call 'frameClockGetFrameTime', in order to get a
-- time to use for animating. For example you might record the start of the
-- animation with an initial value from 'frameClockGetFrameTime', and then
-- update the animation by calling 'frameClockGetFrameTime' again during each
-- repaint.
--
-- 'frameClockRequestPhase' will result in a new frame on the clock, but won’t
-- necessarily repaint any widgets. To repaint a widget, you have to use
-- 'widgetQueueDraw' which invalidates the widget (thus scheduling it to
-- receive a draw on the next frame). 'widgetQueueDraw' will also end up
-- requesting a frame on the appropriate frame clock.
--
-- A widget’s frame clock will not change while the widget is mapped.
-- Reparenting a widget (which implies a temporary unmap) can change the
-- widget’s frame clock.
--
-- Unrealized widgets do not have a frame clock.
--
widgetGetFrameClock :: WidgetClass self => self -> IO FrameClock
widgetGetFrameClock :: forall self. WidgetClass self => self -> IO FrameClock
widgetGetFrameClock self
self =
  (ForeignPtr FrameClock -> FrameClock, FinalizerPtr FrameClock)
-> IO (Ptr FrameClock) -> IO FrameClock
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr FrameClock -> FrameClock, FinalizerPtr FrameClock)
forall {a}. (ForeignPtr FrameClock -> FrameClock, FinalizerPtr a)
mkFrameClock (IO (Ptr FrameClock) -> IO FrameClock)
-> IO (Ptr FrameClock) -> IO FrameClock
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr FrameClock)) -> IO (Ptr FrameClock)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr FrameClock)) -> IO (Ptr FrameClock))
-> (Ptr Widget -> IO (Ptr FrameClock)) -> IO (Ptr FrameClock)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr FrameClock)
gtk_widget_get_frame_clock Ptr Widget
argPtr1)
{-# LINE 789 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)



-- | Retrieves the internal scale factor that maps from window coordinates to
-- the actual device pixels. On traditional systems this is 1, on high density
-- outputs, it can be a higher value (typically 2).
--
-- See 'drawWindowGetScaleFactor'.
--
widgetGetScaleFactor :: WidgetClass self => self -> IO Int
widgetGetScaleFactor :: forall self. WidgetClass self => self -> IO Int
widgetGetScaleFactor self
self =
  (CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_scale_factor Ptr Widget
argPtr1)
{-# LINE 803 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- | This function is typically used when implementing a
-- 'Graphics.UI.Gtk.Abstract.Container.Container' subclass. Obtains the preferred size
-- of a widget. The container uses this information to arrange its child
-- widgets and decide what size allocations to give them with
-- 'widgetSizeAllocate'.
--
-- You can also call this function from an application, with some caveats.
-- Most notably, getting a size request requires the widget to be associated
-- with a screen, because font information may be needed. Multihead-aware
-- applications should keep this in mind.
--
-- Also remember that the size request is not necessarily the size a widget
-- will actually be allocated.
--
widgetSizeRequest :: WidgetClass self => self -> IO Requisition
widgetSizeRequest :: forall self. WidgetClass self => self -> IO Requisition
widgetSizeRequest self
self = (Ptr Requisition -> IO Requisition) -> IO Requisition
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Requisition -> IO Requisition) -> IO Requisition)
-> (Ptr Requisition -> IO Requisition) -> IO Requisition
forall a b. (a -> b) -> a -> b
$ \Ptr Requisition
reqPtr -> do
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_size_request Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Requisition -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Requisition
reqPtr)
  Ptr Requisition -> IO Requisition
forall a. Storable a => Ptr a -> IO a
peek Ptr Requisition
reqPtr

-- | This function is only for use in widget implementations. Obtains the
-- chached requisition information in the widget, unless someone has forced a
-- particular geometry on the widget (e.g. with 'widgetSetSizeRequest'), in which
-- case it returns that geometry instead of the widget's requisition.
--
-- This function differs from 'widgetSizeRequest' in that it retrieves the
-- last size request value stored in the widget, while 'widgetSizeRequest'
-- actually emits the 'sizeRequest' signal on the widget to compute the size
-- request (which updates the widget's requisition information).
--
-- Since this function does not emit the 'sizeRequest' signal, it can only be
-- used when you know that the widget's requisition is up-to-date, that is,
-- 'widgetSizeRequest' has been called since the last time a resize was
-- queued. In general, only container implementations have this information;
-- applications should use 'widgetSizeRequest'.
--
widgetGetChildRequisition :: WidgetClass self => self -> IO Requisition
widgetGetChildRequisition :: forall self. WidgetClass self => self -> IO Requisition
widgetGetChildRequisition self
self = (Ptr Requisition -> IO Requisition) -> IO Requisition
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Requisition -> IO Requisition) -> IO Requisition)
-> (Ptr Requisition -> IO Requisition) -> IO Requisition
forall a b. (a -> b) -> a -> b
$ \Ptr Requisition
reqPtr -> do
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_get_child_requisition Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Requisition -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Requisition
reqPtr)
  Ptr Requisition -> IO Requisition
forall a. Storable a => Ptr a -> IO a
peek Ptr Requisition
reqPtr

-- | This function is only used by
-- 'Graphics.UI.Gtk.Abstract.Container.Container' subclasses, to assign a
-- size and position to their child widgets.
--
widgetSizeAllocate :: WidgetClass self => self
  -> Allocation -- ^ The @x@ and @y@ values of the rectangle determine the
                -- the position of the widget's area relative to its parent
                -- allocation.
  -> IO ()
widgetSizeAllocate :: forall self. WidgetClass self => self -> Allocation -> IO ()
widgetSizeAllocate self
self Allocation
rect = Allocation -> (Ptr Allocation -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Allocation
rect ((Ptr Allocation -> IO ()) -> IO ())
-> (Ptr Allocation -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
rectPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_size_allocate Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
rectPtr)


-- | This function is only used by
-- 'Graphics.UI.Gtk.Abstract.Container.Container' subclasses, to assign a
-- size, position and (optionally) baseline to their child widgets.
--
-- In this function, the allocation and baseline may be adjusted. It will
-- be forced to a 1x1 minimum size, and the adjust_size_allocation virtual
-- and adjust_baseline_allocation methods on the child will be used to adjust
-- the allocation and baseline. Standard adjustments include removing the
-- widget's margins, and applying the widget’s 'widgetHAlign' and
-- 'widgetVAlign' properties.
--
-- If the child widget does not have a valign of AlignBaseline the baseline
-- argument is ignored and -1 is used instead.
--
widgetSizeAllocateWithBaseline :: WidgetClass self => self
  -> Allocation -- ^ The @x@ and @y@ values of the rectangle determine the
                -- the position of the widget's area relative to its parent
                -- allocation.
  -> Int -- ^ The baseline of the child, or -1
  -> IO ()
widgetSizeAllocateWithBaseline :: forall self. WidgetClass self => self -> Allocation -> Int -> IO ()
widgetSizeAllocateWithBaseline self
self Allocation
rect Int
baseline = Allocation -> (Ptr Allocation -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Allocation
rect ((Ptr Allocation -> IO ()) -> IO ())
-> (Ptr Allocation -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
rectPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 CInt
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> CInt -> IO ()
gtk_widget_size_allocate_with_baseline Ptr Widget
argPtr1 Ptr ()
arg2 CInt
arg3) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
rectPtr) (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
baseline)


-- %hash c:1e14 d:53c5
-- | Installs an accelerator for this @widget@ in @accelGroup@ that causes
-- @accelSignal@ to be emitted if the accelerator is activated. The
-- @accelGroup@ needs to be added to the widget's toplevel via
-- 'windowAddAccelGroup', and the signal must be of type @G_RUN_ACTION@.
-- Accelerators added through this function are not user changeable during
-- runtime. If you want to support accelerators that can be changed by the
-- user, use 'accelMapAddEntry' and 'widgetSetAccelPath' or
-- 'menuItemSetAccelPath' instead.
--
widgetAddAccelerator :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @accelSignal@ - widget signal to emit on accelerator
                   -- activation
 -> AccelGroup -- ^ @accelGroup@ - accel group for this widget, added to
                   -- its toplevel
 -> KeyVal -- ^ @accelKey@ - the key of the accelerator
 -> [Modifier] -- ^ @accelMods@ - modifier key combination of the
                   -- accelerator
 -> [AccelFlags] -- ^ @accelFlags@ - flag accelerators, e.g. 'AccelVisible'
 -> IO ()
widgetAddAccelerator :: forall self string.
(WidgetClass self, GlibString string) =>
self
-> string
-> AccelGroup
-> KeyVal
-> [Modifier]
-> [AccelFlags]
-> IO ()
widgetAddAccelerator self
self string
accelSignal AccelGroup
accelGroup KeyVal
accelKey [Modifier]
accelMods [AccelFlags]
accelFlags =
  string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
accelSignal ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
accelSignalPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 (AccelGroup ForeignPtr AccelGroup
arg3) CUInt
arg4 CInt
arg5 CInt
arg6 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr AccelGroup -> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr AccelGroup
arg3 ((Ptr AccelGroup -> IO ()) -> IO ())
-> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr AccelGroup
argPtr3 ->Ptr Widget
-> CString -> Ptr AccelGroup -> CUInt -> CInt -> CInt -> IO ()
gtk_widget_add_accelerator Ptr Widget
argPtr1 CString
arg2 Ptr AccelGroup
argPtr3 CUInt
arg4 CInt
arg5 CInt
arg6)
{-# LINE 906 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
accelSignalPtr
    AccelGroup
accelGroup
    (KeyVal -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral KeyVal
accelKey)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> ([Modifier] -> Int) -> [Modifier] -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Modifier] -> Int
forall a. Flags a => [a] -> Int
fromFlags) [Modifier]
accelMods)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> ([AccelFlags] -> Int) -> [AccelFlags] -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [AccelFlags] -> Int
forall a. Flags a => [a] -> Int
fromFlags) [AccelFlags]
accelFlags)

-- %hash c:3442 d:dfe8
-- | Removes an accelerator from @widget@, previously installed with
-- 'widgetAddAccelerator'.
--
widgetRemoveAccelerator :: WidgetClass self => self
 -> AccelGroup -- ^ @accelGroup@ - accel group for this widget
 -> KeyVal -- ^ @accelKey@ - the key of the accelerator
 -> [Modifier] -- ^ @accelMods@ - modifier key combination of the
                   -- accelerator
 -> IO Bool -- ^ returns whether an accelerator was installed and could
                   -- be removed
widgetRemoveAccelerator :: forall self.
WidgetClass self =>
self -> AccelGroup -> KeyVal -> [Modifier] -> IO Bool
widgetRemoveAccelerator self
self AccelGroup
accelGroup KeyVal
accelKey [Modifier]
accelMods =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) (AccelGroup ForeignPtr AccelGroup
arg2) CUInt
arg3 CInt
arg4 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr AccelGroup -> (Ptr AccelGroup -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr AccelGroup
arg2 ((Ptr AccelGroup -> IO CInt) -> IO CInt)
-> (Ptr AccelGroup -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr AccelGroup
argPtr2 ->Ptr Widget -> Ptr AccelGroup -> CUInt -> CInt -> IO CInt
gtk_widget_remove_accelerator Ptr Widget
argPtr1 Ptr AccelGroup
argPtr2 CUInt
arg3 CInt
arg4)
{-# LINE 927 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    AccelGroup
accelGroup
    (KeyVal -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral KeyVal
accelKey)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> ([Modifier] -> Int) -> [Modifier] -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Modifier] -> Int
forall a. Flags a => [a] -> Int
fromFlags) [Modifier]
accelMods)

-- %hash c:f8d4 d:bd7f
-- | Given an accelerator group, @accelGroup@, and an accelerator path,
-- @accelPath@, sets up an accelerator in @accelGroup@ so whenever the key
-- binding that is defined for @accelPath@ is pressed, @widget@ will be
-- activated. This removes any accelerators (for any accelerator group)
-- installed by previous calls to 'widgetSetAccelPath'. Associating
-- accelerators with paths allows them to be modified by the user and the
-- modifications to be saved for future use. (See 'accelMapSave'.)
--
-- This function is a low level function that would most likely be used by a
-- menu creation system like 'ItemFactory'. If you use 'ItemFactory', setting
-- up accelerator paths will be done automatically.
--
-- Even when you you aren't using 'ItemFactory', if you only want to set up
-- accelerators on menu items 'menuItemSetAccelPath' provides a somewhat more
-- convenient interface.
--
widgetSetAccelPath :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @accelPath@ - path used to look up the accelerator
 -> AccelGroup -- ^ @accelGroup@ - a 'AccelGroup'.
 -> IO ()
widgetSetAccelPath :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> AccelGroup -> IO ()
widgetSetAccelPath self
self string
accelPath AccelGroup
accelGroup =
  string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
accelPath ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
accelPathPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 (AccelGroup ForeignPtr AccelGroup
arg3) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr AccelGroup -> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr AccelGroup
arg3 ((Ptr AccelGroup -> IO ()) -> IO ())
-> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr AccelGroup
argPtr3 ->Ptr Widget -> CString -> Ptr AccelGroup -> IO ()
gtk_widget_set_accel_path Ptr Widget
argPtr1 CString
arg2 Ptr AccelGroup
argPtr3)
{-# LINE 956 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
accelPathPtr
    AccelGroup
accelGroup


-- %hash c:157e d:82ae
-- | Determines whether an accelerator that activates the signal identified by
-- @signalId@ can currently be activated. This is done by emitting the
-- 'canActivateAccel' signal on the widget the signal is attached to; if the
-- signal isn't overridden by a handler or in a derived widget, then the
-- default check is that the widget must be sensitive, and the widget and all
-- its ancestors mapped.
--
-- * Available since Gtk+ version 2.4
--
widgetCanActivateAccel :: WidgetClass self =>
 (ConnectId self) -- ^ @signalId@ - the ID of a signal installed on @widget@
 -> IO Bool -- ^ returns @True@ if the accelerator can be activated.
widgetCanActivateAccel :: forall self. WidgetClass self => ConnectId self -> IO Bool
widgetCanActivateAccel (ConnectId CULong
signalId self
self) =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) CUInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CUInt -> IO CInt
gtk_widget_can_activate_accel Ptr Widget
argPtr1 CUInt
arg2)
{-# LINE 977 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (CULong -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral CULong
signalId)


-- | For widgets that can be \"activated\" (buttons, menu items, etc.) this
-- function activates them. Activation is what happens when you press Enter on
-- a widget during key navigation. If @widget@ isn't activatable, the function
-- returns @False@.
--
widgetActivate :: WidgetClass self => self
 -> IO Bool -- ^ returns @True@ if the widget was activatable
widgetActivate :: forall self. WidgetClass self => self -> IO Bool
widgetActivate self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_activate Ptr Widget
argPtr1)
{-# LINE 991 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Computes the intersection of a widget's area and @area@, returning the
-- intersection, and returns @Nothing@ if there was no intersection.
--
widgetIntersect :: WidgetClass self => self
 -> Rectangle -- ^ @area@ - a rectangle
 -> IO (Maybe Rectangle) -- ^ returns the intersection or @Nothing@
widgetIntersect :: forall self.
WidgetClass self =>
self -> Allocation -> IO (Maybe Allocation)
widgetIntersect self
self Allocation
area =
  Allocation
-> (Ptr Allocation -> IO (Maybe Allocation))
-> IO (Maybe Allocation)
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Allocation
area ((Ptr Allocation -> IO (Maybe Allocation))
 -> IO (Maybe Allocation))
-> (Ptr Allocation -> IO (Maybe Allocation))
-> IO (Maybe Allocation)
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
areaPtr ->
  (Ptr Allocation -> IO (Maybe Allocation)) -> IO (Maybe Allocation)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Allocation -> IO (Maybe Allocation))
 -> IO (Maybe Allocation))
-> (Ptr Allocation -> IO (Maybe Allocation))
-> IO (Maybe Allocation)
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
intersectionPtr -> do
  CInt
hasIntersection <- (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> Ptr () -> IO CInt
gtk_widget_intersect Ptr Widget
argPtr1 Ptr ()
arg2 Ptr ()
arg3)
{-# LINE 1003 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
areaPtr)
    (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
intersectionPtr)
  if (CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool CInt
hasIntersection)
    then (Allocation -> Maybe Allocation)
-> IO Allocation -> IO (Maybe Allocation)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Allocation -> Maybe Allocation
forall a. a -> Maybe a
Just (IO Allocation -> IO (Maybe Allocation))
-> IO Allocation -> IO (Maybe Allocation)
forall a b. (a -> b) -> a -> b
$ Ptr Allocation -> IO Allocation
forall a. Storable a => Ptr a -> IO a
peek Ptr Allocation
intersectionPtr
    else Maybe Allocation -> IO (Maybe Allocation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Allocation
forall a. Maybe a
Nothing

-- | Check if the widget intersects with a given area.
--
widgetHasIntersection :: WidgetClass self => self
 -> Rectangle -- ^ @area@ - a rectangle
 -> IO Bool -- ^ returns @True@ if there was an intersection
widgetHasIntersection :: forall self. WidgetClass self => self -> Allocation -> IO Bool
widgetHasIntersection self
self Allocation
area =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  Allocation -> (Ptr Allocation -> IO CInt) -> IO CInt
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Allocation
area ((Ptr Allocation -> IO CInt) -> IO CInt)
-> (Ptr Allocation -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
areaPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> Ptr () -> IO CInt
gtk_widget_intersect Ptr Widget
argPtr1 Ptr ()
arg2 Ptr ()
arg3)
{-# LINE 1019 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
areaPtr)
    (Ptr Any -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Any
forall a. Ptr a
nullPtr)

-- %hash d:1cab
-- | Determines if the widget is the focus widget within its toplevel. (This
-- does not mean that the 'widgetHasFocus' attribute is necessarily set;
-- 'widgetHasFocus' will only be set if the toplevel widget additionally has
-- the global input focus.)
--
widgetGetIsFocus :: WidgetClass self => self
 -> IO Bool -- ^ returns @True@ if the widget is the focus widget.
widgetGetIsFocus :: forall self. WidgetClass self => self -> IO Bool
widgetGetIsFocus self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_focus Ptr Widget
argPtr1)
{-# LINE 1034 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash d:e1e
-- | Causes @widget@ to have the keyboard focus for the 'Window' it's inside.
-- @widget@ must be a focusable widget, such as a
-- 'Graphics.UI.Gtk.Entry.Entry'; something like
-- 'Graphics.UI.Gtk.Ornaments.Frame' won't work. (More precisely, it must have
-- the 'widgetCanFocus' flag set.)
--
widgetGrabFocus :: WidgetClass self => self -> IO ()
widgetGrabFocus :: forall self. WidgetClass self => self -> IO ()
widgetGrabFocus self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_grab_focus Ptr Widget
argPtr1)
{-# LINE 1046 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:e5e9 d:412a
-- | Causes @widget@ to become the default widget. @widget@ must have the
-- 'canDefault' flag set. The default widget is
-- activated when the user presses Enter in a window. Default widgets must be
-- activatable, that is, 'widgetActivate' should affect them.
--
widgetGrabDefault :: WidgetClass self => self -> IO ()
widgetGrabDefault :: forall self. WidgetClass self => self -> IO ()
widgetGrabDefault self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_grab_default Ptr Widget
argPtr1)
{-# LINE 1057 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:4f62 d:d05a
-- | Widgets can be named, which allows you to refer to them from a gtkrc
-- file. You can apply a style to widgets with a particular name in the gtkrc
-- file. See the documentation for gtkrc files.
--
-- Note that widget names are separated by periods in paths (see
-- 'widgetPath'), so names with embedded periods may cause confusion.
--
widgetSetName :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @name@ - name for the widget
 -> IO ()
widgetSetName :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> IO ()
widgetSetName self
self string
name =
  string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
name ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
namePtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> IO ()
gtk_widget_set_name Ptr Widget
argPtr1 CString
arg2)
{-# LINE 1073 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
namePtr

-- | Retrieves the name of a widget. See 'widgetSetName' for the significance
-- of widget names.
--
widgetGetName :: (WidgetClass self, GlibString string) => self -> IO string
widgetGetName :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO string
widgetGetName self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CString) -> IO CString)
-> (Ptr Widget -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CString
gtk_widget_get_name Ptr Widget
argPtr1)
{-# LINE 1082 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
  IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString

-- %hash c:25b1 d:f898
-- | Sets the sensitivity of a widget. A widget is sensitive if the user can
-- interact with it. Insensitive widgets are \"grayed out\" and the user can't
-- interact with them. Insensitive widgets are known as \"inactive\",
-- \"disabled\", or \"ghosted\" in some other toolkits.
--
widgetSetSensitive :: WidgetClass self => self
 -> Bool -- ^ @sensitive@ - @True@ to make the widget sensitive
 -> IO ()
widgetSetSensitive :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetSensitive self
self Bool
sensitive =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_sensitive Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 1096 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
sensitive)

-- bad spelling backwards compatability definition
widgetSetSensitivity :: WidgetClass self => self -> Bool -> IO ()
widgetSetSensitivity :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetSensitivity = self -> Bool -> IO ()
forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetSensitive

-- | Gets the widget's parent window.
--
widgetGetParentWindow :: WidgetClass self => self -> IO DrawWindow
widgetGetParentWindow :: forall self. WidgetClass self => self -> IO DrawWindow
widgetGetParentWindow self
self =
  (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
-> IO (Ptr DrawWindow) -> IO DrawWindow
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
forall {a}. (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr a)
mkDrawWindow (IO (Ptr DrawWindow) -> IO DrawWindow)
-> IO (Ptr DrawWindow) -> IO DrawWindow
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow))
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr DrawWindow)
gtk_widget_get_parent_window Ptr Widget
argPtr1)
{-# LINE 1109 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Disable event signals.
--
-- * Remove events from the 'EventMask' of this widget. The event mask
-- determines which events a widget will receive. Events are signals
-- that return an 'Event' data type. On connecting to a such a signal,
-- the event mask is automatically adjusted so that he signal is emitted.
-- This function is useful to disable the reception of the signal. It
-- should be called whenever all signals receiving an 'Event'
-- have been disconnected.
--
widgetDelEvents :: WidgetClass self => self -> [EventMask] -> IO ()
widgetDelEvents :: forall self. WidgetClass self => self -> [EventMask] -> IO ()
widgetDelEvents self
self [EventMask]
events = do
  CInt
mask <- (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_events Ptr Widget
argPtr1) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self)
  let mask' :: CInt
mask' = CInt
mask CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.&. (CInt -> CInt
forall a. Bits a => a -> a
complement (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ [EventMask] -> Int
forall a. Flags a => [a] -> Int
fromFlags [EventMask]
events))
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_events Ptr Widget
argPtr1 CInt
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) CInt
mask'

-- | Enable event signals.
--
-- * See 'widgetDelEvents'.
--
widgetAddEvents :: WidgetClass self => self -> [EventMask] -> IO ()
widgetAddEvents :: forall self. WidgetClass self => self -> [EventMask] -> IO ()
widgetAddEvents self
self [] = () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
 -- special [] case to work around a GTK+ bug, see:
 -- http:
widgetAddEvents self
self [EventMask]
events =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_add_events Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 1137 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ [EventMask] -> Int
forall a. Flags a => [a] -> Int
fromFlags [EventMask]
events)

-- | Get enabled event signals.
--
-- * See 'widgetDelEvents'.
--
widgetGetEvents :: WidgetClass self => self -> IO [EventMask]
widgetGetEvents :: forall self. WidgetClass self => self -> IO [EventMask]
widgetGetEvents self
self =
  (CInt -> [EventMask]) -> IO CInt -> IO [EventMask]
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> [EventMask]
forall a. Flags a => Int -> [a]
toFlags (Int -> [EventMask]) -> (CInt -> Int) -> CInt -> [EventMask]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO [EventMask]) -> IO CInt -> IO [EventMask]
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_events Ptr Widget
argPtr1)
{-# LINE 1148 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:468a d:49a0
-- | Sets the event mask (see 'EventMask') for a widget. The event mask
-- determines which events a widget will receive. Keep in mind that different
-- widgets have different default event masks, and by changing the event mask
-- you may disrupt a widget's functionality, so be careful. This function must
-- be called while a widget is unrealized. Consider 'widgetAddEvents' for
-- widgets that are already realized, or if you want to preserve the existing
-- event mask. This function can't be used with 'NoWindow' widgets; to get
-- events on those widgets, place them inside a
-- 'Graphics.UI.Gtk.Misc.EventBox' and receive events on the event box.
--
widgetSetEvents :: WidgetClass self => self
 -> [EventMask] -- ^ @events@ - event mask
 -> IO ()
widgetSetEvents :: forall self. WidgetClass self => self -> [EventMask] -> IO ()
widgetSetEvents self
self [EventMask]
events =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_events Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 1166 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ [EventMask] -> Int
forall a. Flags a => [a] -> Int
fromFlags [EventMask]
events)
{-# LINE 1194 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:270b d:8877
-- | This function returns the topmost widget in the container hierarchy
-- @widget@ is a part of. If @widget@ has no parent widgets, it will be
-- returned as the topmost widget.
--
widgetGetToplevel :: WidgetClass self =>
    self -- ^ @widget@ - the widget in question
 -> IO Widget -- ^ returns the topmost ancestor of @widget@, or @widget@
              -- itself if there's no ancestor.
widgetGetToplevel :: forall self. WidgetClass self => self -> IO Widget
widgetGetToplevel self
self =
  (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Widget)
gtk_widget_get_toplevel Ptr Widget
argPtr1)
{-# LINE 1206 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:17bc d:f8f9
-- | Gets the first ancestor of @widget@ with type @widgetType@. For example,
-- @widgetGetAncestor widget gTypeBox@ gets the first 'Box' that's
-- an ancestor of @widget@. See note about checking for a toplevel
-- 'Window' in the docs for 'widgetGetToplevel'.
--
-- Note that unlike 'widgetIsAncestor', 'widgetGetAncestor' considers
-- @widget@ to be an ancestor of itself.
--
widgetGetAncestor :: WidgetClass self => self
 -> GType -- ^ @widgetType@ - ancestor type
 -> IO (Maybe Widget) -- ^ returns the ancestor widget, or @Nothing@ if not found
widgetGetAncestor :: forall self. WidgetClass self => self -> CUInt -> IO (Maybe Widget)
widgetGetAncestor self
self CUInt
widgetType = do
  Ptr Widget
ptr <- (\(Widget ForeignPtr Widget
arg1) CUInt
arg2 -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CUInt -> IO (Ptr Widget)
gtk_widget_get_ancestor Ptr Widget
argPtr1 CUInt
arg2)
{-# LINE 1222 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CUInt
widgetType
  if Ptr Widget
ptrPtr Widget -> Ptr Widget -> Bool
forall a. Eq a => a -> a -> Bool
==Ptr Widget
forall a. Ptr a
nullPtr then Maybe Widget -> IO (Maybe Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Widget
forall a. Maybe a
Nothing else
    (Widget -> Maybe Widget) -> IO Widget -> IO (Maybe Widget)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Widget -> Maybe Widget
forall a. a -> Maybe a
Just (IO Widget -> IO (Maybe Widget)) -> IO Widget -> IO (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (Ptr Widget -> IO (Ptr Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
ptr)
{-# LINE 1252 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:3522 d:5637
-- | Obtains the location of the mouse pointer in widget coordinates. Widget
-- coordinates are a bit odd; for historical reasons, they are defined as
-- 'widgetGetParentWindow' coordinates for widgets that are not 'NoWindow' widgets,
-- and are relative to the widget's allocation's (x,y) for
-- widgets that are 'NoWindow' widgets.
--
widgetGetPointer :: WidgetClass self => self
 -> IO (Int, Int) -- ^ @(x, y)@ - X Y coordinate
widgetGetPointer :: forall self. WidgetClass self => self -> IO (Int, Int)
widgetGetPointer self
self =
  (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Int, Int)) -> IO (Int, Int))
-> (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
xPtr ->
  (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Int, Int)) -> IO (Int, Int))
-> (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
yPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr CInt
arg2 Ptr CInt
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr CInt -> Ptr CInt -> IO ()
gtk_widget_get_pointer Ptr Widget
argPtr1 Ptr CInt
arg2 Ptr CInt
arg3)
{-# LINE 1265 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    Ptr CInt
xPtr
    Ptr CInt
yPtr
  IO () -> IO CInt -> IO CInt
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
xPtr IO CInt -> (CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
x ->
  Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
yPtr IO CInt -> (CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
y ->
  (Int, Int) -> IO (Int, Int)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
x, CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
y)

-- %hash c:499d
-- | Determines whether @widget@ is somewhere inside @ancestor@, possibly with
-- intermediate containers.
--
widgetIsAncestor :: (WidgetClass self, WidgetClass ancestor) =>
    self -- ^ @widget@ - the widget in question
 -> ancestor -- ^ @ancestor@ - another 'Widget'
 -> IO Bool -- ^ returns @True@ if @ancestor@ contains @widget@ as a child,
             -- grandchild, great grandchild, etc.
widgetIsAncestor :: forall self ancestor.
(WidgetClass self, WidgetClass ancestor) =>
self -> ancestor -> IO Bool
widgetIsAncestor self
self ancestor
ancestor =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr Widget -> Ptr Widget -> IO CInt
gtk_widget_is_ancestor Ptr Widget
argPtr1 Ptr Widget
argPtr2)
{-# LINE 1285 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (ancestor -> Widget
forall o. WidgetClass o => o -> Widget
toWidget ancestor
ancestor)

-- %hash c:8661
-- | Translate coordinates relative to @srcWidget@'s allocation to coordinates
-- relative to @destWidget@'s allocations. In order to perform this operation,
-- both widgets must be realized, and must share a common toplevel.
--
widgetTranslateCoordinates :: (WidgetClass self, WidgetClass destWidget) =>
    self -- ^ @srcWidget@ - a 'Widget'
 -> destWidget -- ^ @destWidget@ - a 'Widget'
 -> Int -- ^ @srcX@ - X position relative to @srcWidget@
 -> Int -- ^ @srcY@ - Y position relative to @srcWidget@
 -> IO (Maybe (Int, Int)) -- ^ @Just (destX, destY)@ - X and Y position
                        -- relative to @destWidget@. Returns @Nothing@ if
                        -- either widget was not realized, or there was no
                        -- common ancestor.
widgetTranslateCoordinates :: forall self destWidget.
(WidgetClass self, WidgetClass destWidget) =>
self -> destWidget -> Int -> Int -> IO (Maybe (Int, Int))
widgetTranslateCoordinates self
self destWidget
destWidget Int
srcX Int
srcY =
  (Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int)))
-> (Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int))
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
destXPtr ->
  (Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int)))
-> (Ptr CInt -> IO (Maybe (Int, Int))) -> IO (Maybe (Int, Int))
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
destYPtr -> do
  CInt
worked <- (\(Widget ForeignPtr Widget
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 CInt
arg4 Ptr CInt
arg5 Ptr CInt
arg6 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr Widget
-> Ptr Widget -> CInt -> CInt -> Ptr CInt -> Ptr CInt -> IO CInt
gtk_widget_translate_coordinates Ptr Widget
argPtr1 Ptr Widget
argPtr2 CInt
arg3 CInt
arg4 Ptr CInt
arg5 Ptr CInt
arg6)
{-# LINE 1306 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (destWidget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget destWidget
destWidget)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
srcX)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
srcY)
    Ptr CInt
destXPtr
    Ptr CInt
destYPtr
  if (CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool CInt
worked)
    then do CInt
destX <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
destXPtr
            CInt
destY <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
destYPtr
            Maybe (Int, Int) -> IO (Maybe (Int, Int))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ((Int, Int) -> Maybe (Int, Int)
forall a. a -> Maybe a
Just (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
destX, CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
destY))
    else Maybe (Int, Int) -> IO (Maybe (Int, Int))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe (Int, Int)
forall a. Maybe a
Nothing

-- %hash c:596c d:b7e5
-- | Sets the 'Style' for a widget. You probably don't want
-- to use this function; it interacts badly with themes, because themes work by
-- replacing the 'Style'. Instead, use 'widgetModifyStyle'.
--
widgetSetStyle :: WidgetClass self => self
 -> Maybe Style -- ^ @style@ - a 'Style', or @Nothing@ to remove the effect of a previous
           -- 'widgetSetStyle' and go back to the default style
 -> IO ()
widgetSetStyle :: forall self. WidgetClass self => self -> Maybe Style -> IO ()
widgetSetStyle self
self Maybe Style
style =
  (\(Widget ForeignPtr Widget
arg1) (Style ForeignPtr Style
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Style -> (Ptr Style -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Style
arg2 ((Ptr Style -> IO ()) -> IO ()) -> (Ptr Style -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Style
argPtr2 ->Ptr Widget -> Ptr Style -> IO ()
gtk_widget_set_style Ptr Widget
argPtr1 Ptr Style
argPtr2)
{-# LINE 1329 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Style -> Maybe Style -> Style
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr Style -> Style
Style ForeignPtr Style
forall a. ForeignPtr a
nullForeignPtr) Maybe Style
style)

-- | Retrieve the 'Style' associated with the widget.
--
widgetGetStyle :: WidgetClass widget => widget -> IO Style
widgetGetStyle :: forall widget. WidgetClass widget => widget -> IO Style
widgetGetStyle widget
widget = do
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_ensure_style Ptr Widget
argPtr1) (widget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget widget
widget)
  (ForeignPtr Style -> Style, FinalizerPtr Style)
-> IO (Ptr Style) -> IO Style
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Style -> Style, FinalizerPtr Style)
forall {a}. (ForeignPtr Style -> Style, FinalizerPtr a)
mkStyle (IO (Ptr Style) -> IO Style) -> IO (Ptr Style) -> IO Style
forall a b. (a -> b) -> a -> b
$ (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Style)) -> IO (Ptr Style)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Style)) -> IO (Ptr Style))
-> (Ptr Widget -> IO (Ptr Style)) -> IO (Ptr Style)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Style)
gtk_widget_get_style Ptr Widget
argPtr1) (widget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget widget
widget)
{-# LINE 1372 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:e71b d:72c2
-- | Returns the default style used by all widgets initially.
--
widgetGetDefaultStyle ::
    IO Style -- ^ returns the default style. This 'Style' object is owned by
             -- Gtk and should not be modified.
widgetGetDefaultStyle :: IO Style
widgetGetDefaultStyle =
  (ForeignPtr Style -> Style, FinalizerPtr Style)
-> IO (Ptr Style) -> IO Style
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Style -> Style, FinalizerPtr Style)
forall {a}. (ForeignPtr Style -> Style, FinalizerPtr a)
mkStyle (IO (Ptr Style) -> IO Style) -> IO (Ptr Style) -> IO Style
forall a b. (a -> b) -> a -> b
$
  IO (Ptr Style)
gtk_widget_get_default_style
{-# LINE 1393 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- | Sets the reading direction on a particular widget. This direction
-- controls the primary direction for widgets containing text, and also the
-- direction in which the children of a container are packed. The ability to
-- set the direction is present in order so that correct localization into
-- languages with right-to-left reading directions can be done. Generally,
-- applications will let the default reading direction present, except for
-- containers where the containers are arranged in an order that is explicitely
-- visual rather than logical (such as buttons for text justification).
--
-- If the direction is set to 'TextDirNone', then the value set by
-- 'widgetSetDefaultDirection' will be used.
--
widgetSetDirection :: WidgetClass self => self -> TextDirection -> IO ()
widgetSetDirection :: forall self. WidgetClass self => self -> TextDirection -> IO ()
widgetSetDirection self
self TextDirection
dir =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_direction Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 1408 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (TextDirection -> Int) -> TextDirection -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextDirection -> Int
forall a. Enum a => a -> Int
fromEnum) TextDirection
dir)

-- | Gets the reading direction for a particular widget. See
-- 'widgetSetDirection'.
--
widgetGetDirection :: WidgetClass self => self -> IO TextDirection
widgetGetDirection :: forall self. WidgetClass self => self -> IO TextDirection
widgetGetDirection self
self =
  (CInt -> TextDirection) -> IO CInt -> IO TextDirection
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> TextDirection
forall a. Enum a => Int -> a
toEnum (Int -> TextDirection) -> (CInt -> Int) -> CInt -> TextDirection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO TextDirection) -> IO CInt -> IO TextDirection
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_direction Ptr Widget
argPtr1)
{-# LINE 1418 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:ff9a
-- | Sets the default reading direction for widgets where the direction has
-- not been explicitly set by 'widgetSetDirection'.
--
widgetSetDefaultDirection ::
    TextDirection -- ^ @dir@ - the new default direction. This cannot be
                  -- 'TextDirNone'.
 -> IO ()
widgetSetDefaultDirection :: TextDirection -> IO ()
widgetSetDefaultDirection TextDirection
dir =
  CInt -> IO ()
gtk_widget_set_default_direction
{-# LINE 1430 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    ((fromIntegral . fromEnum) dir)

-- | Obtains the current default reading direction. See
-- 'widgetSetDefaultDirection'.
--
widgetGetDefaultDirection :: IO TextDirection
widgetGetDefaultDirection :: IO TextDirection
widgetGetDefaultDirection =
  (CInt -> TextDirection) -> IO CInt -> IO TextDirection
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> TextDirection
forall a. Enum a => Int -> a
toEnum (Int -> TextDirection) -> (CInt -> Int) -> CInt -> TextDirection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO TextDirection) -> IO CInt -> IO TextDirection
forall a b. (a -> b) -> a -> b
$
  IO CInt
gtk_widget_get_default_direction
{-# LINE 1488 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- | Sets a shape for this widget’s GDK window. This allows for transparent
-- windows etc., see 'drawWindowShapeCombineRegion' for more information.
widgetShapeCombineRegion :: WidgetClass self => self
 -> Maybe Region
 -> IO ()
widgetShapeCombineRegion :: forall self. WidgetClass self => self -> Maybe Region -> IO ()
widgetShapeCombineRegion self
self Maybe Region
region =
  Region -> (Ptr Region -> IO ()) -> IO ()
forall {b}. Region -> (Ptr Region -> IO b) -> IO b
withRegion (Region -> Maybe Region -> Region
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr Region -> Region
Region ForeignPtr Region
forall a. ForeignPtr a
nullForeignPtr) Maybe Region
region) ((Ptr Region -> IO ()) -> IO ()) -> (Ptr Region -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Region
ptrRegion ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_shape_combine_region Ptr Widget
argPtr1 Ptr ()
arg2)
{-# LINE 1496 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Region -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Region
ptrRegion)

-- | Sets an input shape for this widget’s GDK window. This allows for windows
-- which react to mouse click in a nonrectangular region,
-- see 'drawWindowInputShapeCombineRegion' for more information.
widgetInputShapeCombineRegion :: WidgetClass self => self
 -> Maybe Region
 -> IO ()
widgetInputShapeCombineRegion :: forall self. WidgetClass self => self -> Maybe Region -> IO ()
widgetInputShapeCombineRegion self
self Maybe Region
region =
  Region -> (Ptr Region -> IO ()) -> IO ()
forall {b}. Region -> (Ptr Region -> IO b) -> IO b
withRegion (Region -> Maybe Region -> Region
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr Region -> Region
Region ForeignPtr Region
forall a. ForeignPtr a
nullForeignPtr) Maybe Region
region) ((Ptr Region -> IO ()) -> IO ()) -> (Ptr Region -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Region
ptrRegion ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_input_shape_combine_region Ptr Widget
argPtr1 Ptr ()
arg2)
{-# LINE 1508 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Region -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Region
ptrRegion)
{-# LINE 1546 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:7e36 d:616f
-- | Obtains the full path to @widget@. The path is simply the name of a
-- widget and all its parents in the container hierarchy, separated by periods.
-- The name of a widget comes from 'widgetGetName'. Paths are used to apply
-- styles to a widget in gtkrc configuration files. Widget names are the type
-- of the widget by default (e.g. \"GtkButton\") or can be set to an
-- application-specific value with 'widgetSetName'. By setting the name of a
-- widget, you allow users or theme authors to apply styles to that specific
-- widget in their gtkrc file. Also returns the path in reverse
-- order, i.e. starting with the widget's name instead of starting with the
-- name of the widget's outermost ancestor.
--
widgetPath :: (WidgetClass self, GlibString string) => self
 -> IO (Int, string, string) -- ^ @(pathLength, path, pathReversed)@ - length
                             -- of the path, path string and reverse path
                             -- string
widgetPath :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Int, string, string)
widgetPath self
self =
  (Ptr CUInt -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CUInt -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
pathLengthPtr ->
  (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CString -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CString
pathPtr ->
  (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CString -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CString
pathReversedPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr CUInt
arg2 Ptr CString
arg3 Ptr CString
arg4 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr CUInt -> Ptr CString -> Ptr CString -> IO ()
gtk_widget_path Ptr Widget
argPtr1 Ptr CUInt
arg2 Ptr CString
arg3 Ptr CString
arg4)
{-# LINE 1567 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    Ptr CUInt
pathLengthPtr
    Ptr CString
pathPtr
    Ptr CString
pathReversedPtr
  IO () -> IO CUInt -> IO CUInt
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
pathLengthPtr IO CUInt
-> (CUInt -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CUInt
pathLength ->
  Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
pathPtr IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString IO string
-> (string -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
path ->
  Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
pathReversedPtr IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString IO string
-> (string -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
pathReversed ->
  (Int, string, string) -> IO (Int, string, string)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
pathLength, string
path, string
pathReversed)

-- %hash c:d4a6
-- | Same as 'widgetPath', but always uses the name of a widget's type, never
-- uses a custom name set with 'widgetSetName'.
--
widgetClassPath :: (WidgetClass self, GlibString string) => self
 -> IO (Int, string, string) -- ^ @(pathLength, path, pathReversed)@ - length
                             -- of the path, path string and reverse path
                             -- string
widgetClassPath :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Int, string, string)
widgetClassPath self
self =
  (Ptr CUInt -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CUInt -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
pathLengthPtr ->
  (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CString -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CString
pathPtr ->
  (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CString -> IO (Int, string, string))
 -> IO (Int, string, string))
-> (Ptr CString -> IO (Int, string, string))
-> IO (Int, string, string)
forall a b. (a -> b) -> a -> b
$ \Ptr CString
pathReversedPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr CUInt
arg2 Ptr CString
arg3 Ptr CString
arg4 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr CUInt -> Ptr CString -> Ptr CString -> IO ()
gtk_widget_class_path Ptr Widget
argPtr1 Ptr CUInt
arg2 Ptr CString
arg3 Ptr CString
arg4)
{-# LINE 1590 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    Ptr CUInt
pathLengthPtr
    Ptr CString
pathPtr
    Ptr CString
pathReversedPtr
  IO () -> IO CUInt -> IO CUInt
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
pathLengthPtr IO CUInt
-> (CUInt -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CUInt
pathLength ->
  Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
pathPtr IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString IO string
-> (string -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
path ->
  Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
pathReversedPtr IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString IO string
-> (string -> IO (Int, string, string)) -> IO (Int, string, string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
pathReversed ->
  (Int, string, string) -> IO (Int, string, string)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
pathLength, string
path, string
pathReversed)

-- %hash c:769e
-- | Obtains the composite name of a widget.
--
widgetGetCompositeName :: (WidgetClass self, GlibString string) => self
 -> IO (Maybe string) -- ^ returns the composite name of @widget@, or
                      -- @Nothing@ if @widget@ is not a composite child.
widgetGetCompositeName :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Maybe string)
widgetGetCompositeName self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CString) -> IO CString)
-> (Ptr Widget -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CString
gtk_widget_get_composite_name Ptr Widget
argPtr1)
{-# LINE 1608 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
  IO CString -> (CString -> IO (Maybe string)) -> IO (Maybe string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CString -> IO string) -> CString -> IO (Maybe string)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString


-- | Sets the background color to use for a widget.
--
-- All other style values are left untouched. See 'widgetOverrideColor'.
widgetOverrideBackgroundColor :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the background color.
 -> Maybe Color -- ^ @color@ - the color to assign, or Nothing to undo the
                -- effect of previous calls to 'widgetOverrideBackgroundColor'
 -> IO ()
widgetOverrideBackgroundColor :: forall self.
WidgetClass self =>
self -> StateType -> Maybe Color -> IO ()
widgetOverrideBackgroundColor self
self StateType
state Maybe Color
color =
  (Color -> (Ptr Color -> IO ()) -> IO ())
-> Maybe Color -> (Ptr Color -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Maybe Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_override_background_color Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1623 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Sets the color to use for a widget.
--
-- All other style values are left untouched.
--
-- This function does not act recursively. Setting the color of a container
-- does not affect its children. Note that some widgets that you may not think
-- of as containers, for instance 'Button's, are actually containers.
--
-- This API is mostly meant as a quick way for applications to change a
-- widget appearance. If you are developing a widgets library and intend this
-- change to be themeable, it is better done by setting meaningful CSS classes
-- and regions in your widget/container implementation through
-- 'styleContextAddClass' and 'styleContextAddRegion'.
--
-- This way, your widget library can install a 'CssProvider' with the
-- 1 priority in order to provide a default
-- styling for those widgets that need so, and this theming may fully overridden
-- by the user’s theme.
--
-- Note that for complex widgets this may bring in undesired results (such as
-- uniform background color everywhere), in these cases it is better to fully
-- style such widgets through a CssProvider with the
-- 600 priority.
widgetOverrideColor :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the color.
 -> Maybe Color -- ^ @color@ - the color to assign, or @Nothing@ to undo the
                -- effect of previous calls to 'widgetOverrideColor'
 -> IO ()
widgetOverrideColor :: forall self.
WidgetClass self =>
self -> StateType -> Maybe Color -> IO ()
widgetOverrideColor self
self StateType
state Maybe Color
color =
  (Color -> (Ptr Color -> IO ()) -> IO ())
-> Maybe Color -> (Ptr Color -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Maybe Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_override_color Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1658 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Sets the font to use for a widget. All other style values are left untouched.
-- See 'widgetOverrideColor'.
widgetOverrideFont :: WidgetClass self => self
 -> Maybe FontDescription -- ^ @fontDesc@ - the font description to use, or
                          -- @Nothing@ to undo the effect of previous calls to
                          -- 'widgetOverrideFont'.
 -> IO ()
widgetOverrideFont :: forall self.
WidgetClass self =>
self -> Maybe FontDescription -> IO ()
widgetOverrideFont self
self Maybe FontDescription
fontDesc =
  (\(Widget ForeignPtr Widget
arg1) (FontDescription ForeignPtr FontDescription
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr FontDescription
-> (Ptr FontDescription -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontDescription
arg2 ((Ptr FontDescription -> IO ()) -> IO ())
-> (Ptr FontDescription -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FontDescription
argPtr2 ->Ptr Widget -> Ptr FontDescription -> IO ()
gtk_widget_override_font Ptr Widget
argPtr1 Ptr FontDescription
argPtr2)
{-# LINE 1671 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (FontDescription -> Maybe FontDescription -> FontDescription
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr FontDescription -> FontDescription
FontDescription ForeignPtr FontDescription
forall a. ForeignPtr a
nullForeignPtr) Maybe FontDescription
fontDesc)

-- | Sets the symbolic color to use for a widget.
--
-- All other style values are left untouched. See 'widgetOverrideColor'.
widgetOverrideSymbolicColor :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @name@ - the name of the symbolic color to modify.
 -> Maybe Color -- ^ @color@ - the color to assign, or @Nothing@ to undo the
                -- effect of previous calls to 'widgetOverrideSymbolicColor'
 -> IO ()
widgetOverrideSymbolicColor :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> Maybe Color -> IO ()
widgetOverrideSymbolicColor self
self string
name Maybe Color
color =
  string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
name ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
namePtr ->
  (Color -> (Ptr Color -> IO ()) -> IO ())
-> Maybe Color -> (Ptr Color -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Maybe Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> Ptr () -> IO ()
gtk_widget_override_symbolic_color Ptr Widget
argPtr1 CString
arg2 Ptr ()
arg3)
{-# LINE 1686 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
namePtr
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Sets the cursor color to use in a widget, overriding the cursor-color
-- and secondary-cursor-color style properties. All other style values are
-- left untouched. See also 'widgetModifyStyle'.
--
-- Note that the alpha values will be ignored.
widgetOverrideCursor :: WidgetClass self => self
 -> Maybe Color -- ^ @cursor@ - the color to use for primary cursor, or @Nothing@
                -- to undo the effect of previous calls to of 'widgetOverrideCursor'.
 -> Maybe Color -- ^ @secondaryCursor@ - the color to use for secondary cursor, or @Nothing@
                -- to undo the effect of previous calls to of 'widgetOverrideCursor'.
 -> IO ()
widgetOverrideCursor :: forall self.
WidgetClass self =>
self -> Maybe Color -> Maybe Color -> IO ()
widgetOverrideCursor self
self Maybe Color
cursor Maybe Color
secondaryCursor =
  (Color -> (Ptr Color -> IO ()) -> IO ())
-> Maybe Color -> (Ptr Color -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Maybe Color
cursor ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
cursorPtr ->
  (Color -> (Ptr Color -> IO ()) -> IO ())
-> Maybe Color -> (Ptr Color -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Maybe Color
secondaryCursor ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
secondaryCursorPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> Ptr () -> IO ()
gtk_widget_override_cursor Ptr Widget
argPtr1 Ptr ()
arg2 Ptr ()
arg3)
{-# LINE 1705 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
cursorPtr)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
secondaryCursorPtr)


-- | Modifies style values on the widget. Modifications made using this
-- technique take precedence over style values set via an RC file, however,
-- they will be overriden if a style is explicitely set on the widget using
-- 'widgetSetStyle'. The 'RcStyle' structure is designed so each field can
-- either be set or unset, so it is possible, using this function, to modify
-- some style values and leave the others unchanged.
--
-- Note that modifications made with this function are not cumulative with
-- previous calls to 'widgetModifyStyle' or with such functions as
-- 'widgetModifyFg'. If you wish to retain previous values, you must first call
-- 'widgetGetModifierStyle', make your modifications to the returned style,
-- then call 'widgetModifyStyle' with that style. On the other hand, if you
-- first call 'widgetModifyStyle', subsequent calls to such functions
-- 'widgetModifyFg' will have a cumulative effect with the initial
-- modifications.
--
widgetModifyStyle :: (WidgetClass self, RcStyleClass style) => self
 -> style -- ^ @style@ - the 'RcStyle' holding the style modifications
 -> IO ()
widgetModifyStyle :: forall self style.
(WidgetClass self, RcStyleClass style) =>
self -> style -> IO ()
widgetModifyStyle self
self style
style =
  (\(Widget ForeignPtr Widget
arg1) (RcStyle ForeignPtr RcStyle
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr RcStyle -> (Ptr RcStyle -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RcStyle
arg2 ((Ptr RcStyle -> IO ()) -> IO ())
-> (Ptr RcStyle -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RcStyle
argPtr2 ->Ptr Widget -> Ptr RcStyle -> IO ()
gtk_widget_modify_style Ptr Widget
argPtr1 Ptr RcStyle
argPtr2)
{-# LINE 1731 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (style -> RcStyle
forall o. RcStyleClass o => o -> RcStyle
toRcStyle style
style)

-- | Returns the current modifier style for the widget. (As set by
-- 'widgetModifyStyle'.) If no style has previously set, a new 'RcStyle' will
-- be created with all values unset, and set as the modifier style for the
-- widget. If you make changes to this rc style, you must call
-- 'widgetModifyStyle', passing in the returned rc style, to make sure that
-- your changes take effect.
--
-- Caution: passing the style back to 'widgetModifyStyle' will normally end
-- up destroying it, because 'widgetModifyStyle' copies the passed-in style and
-- sets the copy as the new modifier style, thus dropping any reference to the
-- old modifier styl e. Add a reference to the modifier style if you want to
-- keep it alive.
--
widgetGetModifierStyle :: WidgetClass self => self -> IO RcStyle
widgetGetModifierStyle :: forall self. WidgetClass self => self -> IO RcStyle
widgetGetModifierStyle self
self =
  (ForeignPtr RcStyle -> RcStyle, FinalizerPtr RcStyle)
-> IO (Ptr RcStyle) -> IO RcStyle
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr RcStyle -> RcStyle, FinalizerPtr RcStyle)
forall {a}. (ForeignPtr RcStyle -> RcStyle, FinalizerPtr a)
mkRcStyle (IO (Ptr RcStyle) -> IO RcStyle) -> IO (Ptr RcStyle) -> IO RcStyle
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr RcStyle)) -> IO (Ptr RcStyle)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr RcStyle)) -> IO (Ptr RcStyle))
-> (Ptr Widget -> IO (Ptr RcStyle)) -> IO (Ptr RcStyle)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr RcStyle)
gtk_widget_get_modifier_style Ptr Widget
argPtr1)
{-# LINE 1751 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:5550
-- | Sets the foreground color for a widget in a particular state. All other
-- style values are left untouched. See also 'widgetModifyStyle'.
--
widgetModifyFg :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the foreground color.
 -> Color -- ^ @color@ - the color to assign (does not need to be
              -- allocated)
 -> IO ()
widgetModifyFg :: forall self.
WidgetClass self =>
self -> StateType -> Color -> IO ()
widgetModifyFg self
self StateType
state Color
color =
  Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_fg Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1765 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Restores the foreground color for a widget in a particular state. This
-- undoes the effects of previous calls to `widgetModifyFg'.
--
widgetRestoreFg :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to restore the foreground color.
 -> IO ()
widgetRestoreFg :: forall self. WidgetClass self => self -> StateType -> IO ()
widgetRestoreFg self
self StateType
state =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_fg Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1777 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    Ptr ()
forall a. Ptr a
nullPtr

-- %hash c:2c5
-- | Sets the background color for a widget in a particular state. All other
-- style values are left untouched. See also 'widgetModifyStyle'.
--
-- Note that \"no window\" widgets (which have the 'NoWindow' flag set) draw
-- on their parent container's window and thus may not draw any background
-- themselves. This is the case for e.g. 'Label'. To modify the background of
-- such widgets, you have to set the background color on their parent; if you
-- want to set the background of a rectangular area around a label, try placing
-- the label in a 'EventBox' widget and setting the background color on that.
--
widgetModifyBg :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the background color.
 -> Color -- ^ @color@ - the color to assign (does not need to be
              -- allocated).
 -> IO ()
widgetModifyBg :: forall self.
WidgetClass self =>
self -> StateType -> Color -> IO ()
widgetModifyBg self
self StateType
state Color
color =
  Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_bg Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1800 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Restores the background color for a widget in a particular state. This
-- undoes the effects of previous calls to `widgetModifyBg'.
--
widgetRestoreBg :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to restore the background color.
 -> IO ()
widgetRestoreBg :: forall self. WidgetClass self => self -> StateType -> IO ()
widgetRestoreBg self
self StateType
state =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_bg Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1812 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    Ptr ()
forall a. Ptr a
nullPtr

-- %hash c:d2ba
-- | Sets the text color for a widget in a particular state. All other style
-- values are left untouched. The text color is the foreground color used along
-- with the base color (see 'widgetModifyBase') for widgets such as 'Entry' and
-- 'TextView'. See also 'widgetModifyStyle'.
--
widgetModifyText :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the text color.
 -> Color -- ^ @color@ - the color to assign (does not need to be
              -- allocated).
 -> IO ()
widgetModifyText :: forall self.
WidgetClass self =>
self -> StateType -> Color -> IO ()
widgetModifyText self
self StateType
state Color
color =
  Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_text Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1830 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Restores the text color for a widget in a particular state. This
-- undoes the effects of previous calls to `widgetModifyText'.
--
widgetRestoreText :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to restore the text color.
 -> IO ()
widgetRestoreText :: forall self. WidgetClass self => self -> StateType -> IO ()
widgetRestoreText self
self StateType
state =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_text Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1842 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    Ptr ()
forall a. Ptr a
nullPtr

-- %hash c:ac08
-- | Sets the base color for a widget in a particular state. All other style
-- values are left untouched. The base color is the background color used along
-- with the text color (see 'widgetModifyText') for widgets such as 'Entry' and
-- 'TextView'. See also 'widgetModifyStyle'.
--
-- Note that \"no window\" widgets (which have the 'NoWindow' flag set) draw
-- on their parent container's window and thus may not draw any background
-- themselves. This is the case for e.g. 'Label'. To modify the background of
-- such widgets, you have to set the base color on their parent; if you want to
-- set the background of a rectangular area around a label, try placing the
-- label in a 'EventBox' widget and setting the base color on that.
--
widgetModifyBase :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to set the base color.
 -> Color -- ^ @color@ - the color to assign (does not need to be
              -- allocated).
 -> IO ()
widgetModifyBase :: forall self.
WidgetClass self =>
self -> StateType -> Color -> IO ()
widgetModifyBase self
self StateType
state Color
color =
  Color -> (Ptr Color -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Color
color ((Ptr Color -> IO ()) -> IO ()) -> (Ptr Color -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Color
colorPtr ->
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_base Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1867 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    (Ptr Color -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Color
colorPtr)

-- | Restores the base color for a widget in a particular state. This undoes
-- the effects of previous calls to widgetModifyBase.
--
widgetRestoreBase :: WidgetClass self => self
 -> StateType -- ^ @state@ - the state for which to restore the base color.
 -> IO ()
widgetRestoreBase :: forall self. WidgetClass self => self -> StateType -> IO ()
widgetRestoreBase self
self StateType
state =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> Ptr () -> IO ()
gtk_widget_modify_base Ptr Widget
argPtr1 CInt
arg2 Ptr ()
arg3)
{-# LINE 1879 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)
    Ptr ()
forall a. Ptr a
nullPtr


-- %hash c:38d7
-- | Sets the font to use for a widget. All other style values are left
-- untouched. See also 'widgetModifyStyle'.
--
widgetModifyFont :: WidgetClass self => self
 -> Maybe FontDescription -- ^ @fontDesc@ - the font description to use, or
                          -- @Nothing@ to undo the effect of previous calls to
                          -- 'widgetModifyFont'.
 -> IO ()
widgetModifyFont :: forall self.
WidgetClass self =>
self -> Maybe FontDescription -> IO ()
widgetModifyFont self
self Maybe FontDescription
fontDesc =
  (\(Widget ForeignPtr Widget
arg1) (FontDescription ForeignPtr FontDescription
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr FontDescription
-> (Ptr FontDescription -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontDescription
arg2 ((Ptr FontDescription -> IO ()) -> IO ())
-> (Ptr FontDescription -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FontDescription
argPtr2 ->Ptr Widget -> Ptr FontDescription -> IO ()
gtk_widget_modify_font Ptr Widget
argPtr1 Ptr FontDescription
argPtr2)
{-# LINE 1895 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (FontDescription -> Maybe FontDescription -> FontDescription
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr FontDescription -> FontDescription
FontDescription ForeignPtr FontDescription
forall a. ForeignPtr a
nullForeignPtr) Maybe FontDescription
fontDesc)

-- | Creates a new 'PangoContext' with the appropriate colormap, font description,
-- and base direction for drawing text for this widget. See also
-- 'widgetGetPangoContext'.
--
widgetCreatePangoContext :: WidgetClass self => self
 -> IO PangoContext -- ^ returns the new 'PangoContext'
widgetCreatePangoContext :: forall self. WidgetClass self => self -> IO PangoContext
widgetCreatePangoContext self
self =
  (ForeignPtr PangoContext -> PangoContext,
 FinalizerPtr PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr PangoContext -> PangoContext,
 FinalizerPtr PangoContext)
forall {a}.
(ForeignPtr PangoContext -> PangoContext, FinalizerPtr a)
mkPangoContext (IO (Ptr PangoContext) -> IO PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext))
-> (Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr PangoContext)
gtk_widget_create_pango_context Ptr Widget
argPtr1)
{-# LINE 1907 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Gets a 'PangoContext' with the appropriate font description and base
-- direction for this widget. Unlike the context returned by
-- 'widgetCreatePangoContext', this context is owned by the widget (it can be
-- used until the screen for the widget changes or the widget is removed from
-- its toplevel), and will be updated to match any changes to the widget's
-- attributes.
--
-- If you create and keep a 'PangoLayout' using this context, you must deal
-- with changes to the context by calling
-- 'layoutContextChanged' on the layout
-- in response to the 'onStyleChanged' and 'onDirectionChanged' signals for the
-- widget.
--
widgetGetPangoContext :: WidgetClass self => self
 -> IO PangoContext -- ^ returns the 'PangoContext' for the widget.
widgetGetPangoContext :: forall self. WidgetClass self => self -> IO PangoContext
widgetGetPangoContext self
self =
  (ForeignPtr PangoContext -> PangoContext,
 FinalizerPtr PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr PangoContext -> PangoContext,
 FinalizerPtr PangoContext)
forall {a}.
(ForeignPtr PangoContext -> PangoContext, FinalizerPtr a)
mkPangoContext (IO (Ptr PangoContext) -> IO PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext))
-> (Ptr Widget -> IO (Ptr PangoContext)) -> IO (Ptr PangoContext)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr PangoContext)
gtk_widget_get_pango_context Ptr Widget
argPtr1)
{-# LINE 1927 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Prepare text for display.
--
-- The 'PangoLayout' represents the rendered text. It can be shown on screen
-- by calling 'drawLayout'.
--
-- The returned 'PangoLayout' shares the same font information ('PangoContext') as this
-- widget. If this information changes, the 'PangoLayout' should change. The
-- following code ensures that the displayed text always reflects the widget's
-- settings:
--
-- > l <- widgetCreateLayout w "My Text."
-- > let update = do
-- > layoutContextChanged l
-- > -- update the Drawables which show this layout
-- > w `onDirectionChanged` update
-- > w `onStyleChanged` update
--
widgetCreateLayout :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @text@ - text to set on the layout
 -> IO PangoLayout
widgetCreateLayout :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> IO PangoLayout
widgetCreateLayout self
self string
text = do
  PangoLayoutRaw
pl <- (ForeignPtr PangoLayoutRaw -> PangoLayoutRaw,
 FinalizerPtr PangoLayoutRaw)
-> IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr PangoLayoutRaw -> PangoLayoutRaw,
 FinalizerPtr PangoLayoutRaw)
forall {a}.
(ForeignPtr PangoLayoutRaw -> PangoLayoutRaw, FinalizerPtr a)
mkPangoLayoutRaw (IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw)
-> IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw
forall a b. (a -> b) -> a -> b
$
    string
-> (CString -> IO (Ptr PangoLayoutRaw)) -> IO (Ptr PangoLayoutRaw)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
text ((CString -> IO (Ptr PangoLayoutRaw)) -> IO (Ptr PangoLayoutRaw))
-> (CString -> IO (Ptr PangoLayoutRaw)) -> IO (Ptr PangoLayoutRaw)
forall a b. (a -> b) -> a -> b
$ \CString
textPtr ->
    (\(Widget ForeignPtr Widget
arg1) CString
arg2 -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr PangoLayoutRaw))
-> IO (Ptr PangoLayoutRaw)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr PangoLayoutRaw))
 -> IO (Ptr PangoLayoutRaw))
-> (Ptr Widget -> IO (Ptr PangoLayoutRaw))
-> IO (Ptr PangoLayoutRaw)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> IO (Ptr PangoLayoutRaw)
gtk_widget_create_pango_layout Ptr Widget
argPtr1 CString
arg2)
{-# LINE 1953 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
      (toWidget self)
      CString
textPtr
  PangoString
ps <- string -> IO PangoString
forall string. GlibString string => string -> IO PangoString
makeNewPangoString string
text
  IORef PangoString
psRef <- PangoString -> IO (IORef PangoString)
forall a. a -> IO (IORef a)
newIORef PangoString
ps
  PangoLayout -> IO PangoLayout
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (IORef PangoString -> PangoLayoutRaw -> PangoLayout
PangoLayout IORef PangoString
psRef PangoLayoutRaw
pl)

-- %hash c:cee d:1d29
-- | A convenience function that uses the theme engine and RC file settings
-- for @widget@ to look up the stock icon and render it to a
-- 'Graphics.UI.Gtk.Gdk.Pixbuf.Pixbuf'.
-- The icon should be one of the stock id constants such as
-- 'Graphics.UI.Gtk.General.StockItems.stockOpen'. @size@ should be a
-- size such as 'Graphics.UI.Gtk.General.IconFactory.IconSizeMenu'.
-- @detail@ should be a string that identifies the
-- widget or code doing the rendering, so that theme engines can special-case
-- rendering for that widget or code.
--
-- The pixels in the returned 'Graphics.UI.Gtk.Gdk.Pixbuf.Pixbuf' are
-- shared with the rest of the
-- application and should not be modified.
--
widgetRenderIcon :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @stockId@ - a stock ID
 -> IconSize -- ^ @size@ - a stock size
 -> string -- ^ @detail@ - render detail to pass to theme engine
 -> IO (Maybe Pixbuf) -- ^ returns a new pixbuf, or @Nothing@ if the stock ID
                      -- wasn't known
widgetRenderIcon :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> IconSize -> string -> IO (Maybe Pixbuf)
widgetRenderIcon self
self string
stockId IconSize
size string
detail =
  (IO (Ptr Pixbuf) -> IO Pixbuf)
-> IO (Ptr Pixbuf) -> IO (Maybe Pixbuf)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
-> IO (Ptr Pixbuf) -> IO Pixbuf
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
forall {a}. (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr a)
mkPixbuf) (IO (Ptr Pixbuf) -> IO (Maybe Pixbuf))
-> IO (Ptr Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$
  string -> (CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
detail ((CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ \CString
detailPtr ->
  string -> (CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
stockId ((CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (CString -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ \CString
stockIdPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 CInt
arg3 CString
arg4 -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr Widget -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> CInt -> CString -> IO (Ptr Pixbuf)
gtk_widget_render_icon Ptr Widget
argPtr1 CString
arg2 CInt
arg3 CString
arg4)
{-# LINE 1985 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
stockIdPtr
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (IconSize -> Int) -> IconSize -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IconSize -> Int
forall a. Enum a => a -> Int
fromEnum) IconSize
size)
    CString
detailPtr

-- %hash c:62f d:1863
-- | Invalidates the rectangular area of @widget@ defined by @x@, @y@, @width@
-- and @height@ by calling
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowInvalidateRect' on the widget's
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.DrawWindow' and all its child windows. Once
-- the main loop becomes idle (after the current batch of events has been
-- processed, roughly), the window will receive expose events for the union of
-- all regions that have been invalidated.
--
-- Normally you would only use this function in widget implementations. In
-- particular, you might use it, or
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowInvalidateRect' directly, to
-- schedule a redraw of a 'Graphics.UI.Gtk.Gdk.DrawWindow.DrawingArea' or some
-- portion thereof.
--
-- Frequently you can just call
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.windowInvalidateRect' or
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.windowInvalidateRegion' instead of this
-- function. Those functions will invalidate only a single window, instead of
-- the widget and all its children.
--
-- The advantage of adding to the invalidated region compared to simply
-- drawing immediately is efficiency; using an invalid region ensures that you
-- only have to redraw one time.
--
widgetQueueDrawArea :: WidgetClass self => self
 -> Int -- ^ @x@ - x coordinate of upper-left corner of rectangle to redraw
 -> Int -- ^ @y@ - y coordinate of upper-left corner of rectangle to redraw
 -> Int -- ^ @width@ - width of region to draw
 -> Int -- ^ @height@ - height of region to draw
 -> IO ()
widgetQueueDrawArea :: forall self.
WidgetClass self =>
self -> Int -> Int -> Int -> Int -> IO ()
widgetQueueDrawArea self
self Int
x Int
y Int
width Int
height =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 CInt
arg3 CInt
arg4 CInt
arg5 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> CInt -> CInt -> CInt -> IO ()
gtk_widget_queue_draw_area Ptr Widget
argPtr1 CInt
arg2 CInt
arg3 CInt
arg4 CInt
arg5)
{-# LINE 2023 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
y)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
width)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
height)


-- | Invalidates the area of widget defined by @region@ by calling
-- 'drawWindowInvalidateRegion' on the widget’s window and all its child
-- windows. Once the main loop becomes idle (after the current batch of
-- events has been processed, roughly), the window will receive expose events
-- for the union of all regions that have been invalidated.
--
-- Normally you would only use this function in widget implementations. You
-- might also use it to schedule a redraw of a DrawingArea or some portion
-- thereof.
widgetQueueDrawRegion :: WidgetClass self => self
 -> Region
 -> IO ()
widgetQueueDrawRegion :: forall self. WidgetClass self => self -> Region -> IO ()
widgetQueueDrawRegion self
self Region
region =
  Region -> (Ptr Region -> IO ()) -> IO ()
forall {b}. Region -> (Ptr Region -> IO b) -> IO b
withRegion Region
region ((Ptr Region -> IO ()) -> IO ()) -> (Ptr Region -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Region
regionPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_queue_draw_region Ptr Widget
argPtr1 Ptr ()
arg2)
{-# LINE 2045 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Ptr Region -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Region
regionPtr)
{-# LINE 2059 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- | Sets whether the application intends to draw on the widget in response
-- to an 'onExpose' signal.
--
-- * This is a hint to the widget and does not affect the behavior of the
-- GTK+ core; many widgets ignore this flag entirely. For widgets that do
-- pay attention to the flag, such as 'EventBox' and 'Window', the effect
-- is to suppress default themed drawing of the widget's background.
-- (Children of the widget will still be drawn.) The application is then
-- entirely responsible for drawing the widget background.
--
widgetSetAppPaintable :: WidgetClass self => self
 -> Bool -- ^ @appPaintable@ - @True@ if the application will paint on the
          -- widget
 -> IO ()
widgetSetAppPaintable :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetAppPaintable self
self Bool
appPaintable =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_app_paintable Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2075 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
appPaintable)

-- %hash c:89b2 d:e14d
-- | Widgets are double buffered by default; you can use this function to turn
-- off the buffering. \"Double buffered\" simply means that
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowBeginPaintRegion' and
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowEndPaint' are called automatically
-- around expose events sent to the widget.
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowBeginPaintRegion' diverts all
-- drawing to a widget's window to an offscreen buffer, and
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowEndPaint'
-- draws the buffer to the screen. The result is that users see the window
-- update in one smooth step, and don't see individual graphics primitives
-- being rendered.
--
-- In very simple terms, double buffered widgets don't flicker, so you would
-- only use this function to turn off double buffering if you had special needs
-- and really knew what you were doing.
--
-- Note: if you turn off double-buffering, you have to handle expose events,
-- since even the clearing to the background color or pixmap will not happen
-- automatically (as it is done in
-- 'Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowBeginPaint').
--
widgetSetDoubleBuffered :: WidgetClass self => self
 -> Bool -- ^ @doubleBuffered@ - @True@ to double-buffer a widget
 -> IO ()
widgetSetDoubleBuffered :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetDoubleBuffered self
self Bool
doubleBuffered =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_double_buffered Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2105 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
doubleBuffered)

-- %hash c:d61 d:ac24
-- | Sets whether the entire widget is queued for drawing when its size
-- allocation changes. By default, this setting is @True@ and the entire widget
-- is redrawn on every size change. If your widget leaves the upper left
-- unchanged when made bigger, turning this setting on will improve
-- performance.
--
-- Note that for \"no window\" widgets setting this flag to @False@ turns off
-- all allocation on resizing: the widget will not even redraw if its position
-- changes; this is to allow containers that don't draw anything to avoid
-- excess invalidations. If you set this flag on a \"no window\" widget that
-- /does/ draw its window, you are responsible for invalidating both
-- the old and new allocation of the widget when the widget is moved and
-- responsible for invalidating regions newly when the widget increases size.
--
widgetSetRedrawOnAllocate :: WidgetClass self => self
 -> Bool -- ^ @redrawOnAllocate@ - if @True@, the entire widget will be
          -- redrawn when it is allocated to a new size. Otherwise, only the
          -- new portion of the widget will be redrawn.
 -> IO ()
widgetSetRedrawOnAllocate :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetRedrawOnAllocate self
self Bool
redrawOnAllocate =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_redraw_on_allocate Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2130 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
redrawOnAllocate)

-- | Sets a widgets composite name. A child widget of a container is
-- composite if it serves as an internal widget and, thus, is not
-- added by the user.
--
widgetSetCompositeName :: (WidgetClass self, GlibString string) => self
 -> string -- ^ @name@ - the name to set.
 -> IO ()
widgetSetCompositeName :: forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> IO ()
widgetSetCompositeName self
self string
name =
  string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
name ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
namePtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> IO ()
gtk_widget_set_composite_name Ptr Widget
argPtr1 CString
arg2)
{-# LINE 2143 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
namePtr

-- | Emits the “mnemonic-activate” signal.
--
-- The default handler for this signal activates the widget if groupCycling
-- is @False@, and just grabs the focus if @groupCycling@ is @True@.
widgetMnemonicActivate :: WidgetClass self => self
 -> Bool
 -> IO Bool
widgetMnemonicActivate :: forall self. WidgetClass self => self -> Bool -> IO Bool
widgetMnemonicActivate self
self Bool
groupCycling =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO CInt
gtk_widget_mnemonic_activate Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2156 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
groupCycling)
{-# LINE 2204 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:3c94 d:cdb6
-- | Returns the accessible object that describes the widget to an assistive
-- technology.
--
-- If no accessibility library is loaded (i.e. no ATK implementation library
-- is loaded via GTK_MODULES or via another application library, such as
-- libgnome), then this 'Object' instance may be a no-op. Likewise, if no
-- class-specific 'Object' implementation is available for the widget instance
-- in question, it will inherit an 'Object' implementation from the first
-- ancestor class for which such an implementation is defined.
--
-- The documentation of the ATK library contains more information about
-- accessible objects and their uses.
--
-- Returns a GObject in Gtk3.
widgetGetAccessible :: WidgetClass self => self



 -> IO GObject -- ^ returns the 'GObject' associated with @widget@

widgetGetAccessible :: forall self. WidgetClass self => self -> IO GObject
widgetGetAccessible self
self =



  (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
forall {a}. (ForeignPtr GObject -> GObject, FinalizerPtr a)
mkGObject (IO (Ptr GObject) -> IO GObject) -> IO (Ptr GObject) -> IO GObject
forall a b. (a -> b) -> a -> b
$

  (Ptr AtkObject -> Ptr GObject)
-> IO (Ptr AtkObject) -> IO (Ptr GObject)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Ptr AtkObject -> Ptr GObject
forall a b. Ptr a -> Ptr b
castPtr (IO (Ptr AtkObject) -> IO (Ptr GObject))
-> IO (Ptr AtkObject) -> IO (Ptr GObject)
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr AtkObject)) -> IO (Ptr AtkObject)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr AtkObject)) -> IO (Ptr AtkObject))
-> (Ptr Widget -> IO (Ptr AtkObject)) -> IO (Ptr AtkObject)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr AtkObject)
gtk_widget_get_accessible Ptr Widget
argPtr1)
{-# LINE 2233 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:713d d:c4fc
-- | This function is used by custom widget implementations; if you\'re
-- writing an app, you\'d use 'widgetGrabFocus' to move the focus to a
-- particular widget, and 'containerSetFocusChain' to change the focus tab
-- order. So you may want to investigate those functions instead.
--
-- The \"focus\" default handler for a widget should return @True@ if moving
-- in @direction@ left the focus on a focusable location inside that widget,
-- and @False@ if moving in @direction@ moved the focus outside the widget. If
-- returning @True@, widgets normally call 'widgetGrabFocus' to place the focus
-- accordingly; if returning @False@, they don't modify the current focus
-- location.
--
widgetChildFocus :: WidgetClass self => self
 -> DirectionType -- ^ @direction@ - direction of focus movement
 -> IO Bool -- ^ returns @True@ if focus ended up inside @widget@
widgetChildFocus :: forall self. WidgetClass self => self -> DirectionType -> IO Bool
widgetChildFocus self
self DirectionType
direction =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO CInt
gtk_widget_child_focus Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2254 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (DirectionType -> Int) -> DirectionType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionType -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionType
direction)

-- %hash c:de20 d:5300
-- | Gets the value set with 'widgetSetChildVisible'. If you feel a need to
-- use this function, your code probably needs reorganization.
--
-- This function is only useful for container implementations and never
-- should be called by an application.
--
widgetGetChildVisible :: WidgetClass self => self
 -> IO Bool -- ^ returns @True@ if the widget is mapped with the parent.
widgetGetChildVisible :: forall self. WidgetClass self => self -> IO Bool
widgetGetChildVisible self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_child_visible Ptr Widget
argPtr1)
{-# LINE 2269 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:9320 d:367
-- | Returns the parent container of @widget@.
--
-- * Returns the parent container of @widget@ if it has one.
--
widgetGetParent :: WidgetClass self => self
 -> IO (Maybe Widget)
widgetGetParent :: forall self. WidgetClass self => self -> IO (Maybe Widget)
widgetGetParent self
self = do
  Ptr Widget
parentPtr <- (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Widget)
gtk_widget_get_parent Ptr Widget
argPtr1) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self)
  if Ptr Widget
parentPtrPtr Widget -> Ptr Widget -> Bool
forall a. Eq a => a -> a -> Bool
==Ptr Widget
forall a. Ptr a
nullPtr then Maybe Widget -> IO (Maybe Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Widget
forall a. Maybe a
Nothing else
    (Widget -> Maybe Widget) -> IO Widget -> IO (Maybe Widget)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Widget -> Maybe Widget
forall a. a -> Maybe a
Just (IO Widget -> IO (Maybe Widget)) -> IO Widget -> IO (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (Ptr Widget -> IO (Ptr Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
parentPtr)

-- %hash c:85e3 d:a962
-- | Gets the settings object holding the settings (global property settings,
-- RC file information, etc) used for this widget.
--
-- Note that this function can only be called when the 'Widget' is attached
-- to a toplevel, since the settings object is specific to a particular
-- 'Screen'.
--
widgetGetSettings :: WidgetClass self => self
 -> IO Settings -- ^ returns the relevant 'Settings' object
widgetGetSettings :: forall self. WidgetClass self => self -> IO Settings
widgetGetSettings self
self =
  (ForeignPtr Settings -> Settings, FinalizerPtr Settings)
-> IO (Ptr Settings) -> IO Settings
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Settings -> Settings, FinalizerPtr Settings)
forall {a}. (ForeignPtr Settings -> Settings, FinalizerPtr a)
mkSettings (IO (Ptr Settings) -> IO Settings)
-> IO (Ptr Settings) -> IO Settings
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Settings)) -> IO (Ptr Settings)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Settings)) -> IO (Ptr Settings))
-> (Ptr Widget -> IO (Ptr Settings)) -> IO (Ptr Settings)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Settings)
gtk_widget_get_settings Ptr Widget
argPtr1)
{-# LINE 2296 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)



-- | Returns the clipboard object for the given selection to
-- be used with widget. widget must have a 'Display'
-- associated with it, so must be attached to a toplevel
-- window.
widgetGetClipboard :: WidgetClass self => self
                   -> SelectionTag -- ^ @selection@ a 'Atom' which identifies the clipboard
                                       -- to use. 'selectionClipboard' gives the
                                       -- default clipboard. Another common value
                                       -- is 'selectionPrimary', which gives
                                       -- the primary X selection.
                   -> IO Clipboard -- ^ returns the appropriate clipboard object. If no
                                   -- clipboard already exists, a new one will
                                   -- be created.
widgetGetClipboard :: forall self.
WidgetClass self =>
self -> SelectionTag -> IO Clipboard
widgetGetClipboard self
self (Atom Ptr ()
tagPtr) =
  (ForeignPtr Clipboard -> Clipboard, FinalizerPtr Clipboard)
-> IO (Ptr Clipboard) -> IO Clipboard
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Clipboard -> Clipboard, FinalizerPtr Clipboard)
forall {a}. (ForeignPtr Clipboard -> Clipboard, FinalizerPtr a)
mkClipboard (IO (Ptr Clipboard) -> IO Clipboard)
-> IO (Ptr Clipboard) -> IO Clipboard
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Clipboard)) -> IO (Ptr Clipboard)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Clipboard)) -> IO (Ptr Clipboard))
-> (Ptr Widget -> IO (Ptr Clipboard)) -> IO (Ptr Clipboard)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO (Ptr Clipboard)
gtk_widget_get_clipboard Ptr Widget
argPtr1 Ptr ()
arg2)
{-# LINE 2316 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    Ptr ()
tagPtr

-- %hash c:45ed d:52ef
-- | Get the 'Display' for the toplevel window associated with this widget.
-- This function can only be called after the widget has been added to a widget
-- hierarchy with a 'Window' at the top.
--
-- In general, you should only create display specific resources when a
-- widget has been realized, and you should free those resources when the
-- widget is unrealized.
--
-- * Available since Gtk+ version 2.2
--
widgetGetDisplay :: WidgetClass self => self
 -> IO Display -- ^ returns the 'Display' for the toplevel for this widget.
widgetGetDisplay :: forall self. WidgetClass self => self -> IO Display
widgetGetDisplay self
self =
  (ForeignPtr Display -> Display, FinalizerPtr Display)
-> IO (Ptr Display) -> IO Display
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Display -> Display, FinalizerPtr Display)
forall {a}. (ForeignPtr Display -> Display, FinalizerPtr a)
mkDisplay (IO (Ptr Display) -> IO Display) -> IO (Ptr Display) -> IO Display
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Display)) -> IO (Ptr Display)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Display)) -> IO (Ptr Display))
-> (Ptr Widget -> IO (Ptr Display)) -> IO (Ptr Display)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Display)
gtk_widget_get_display Ptr Widget
argPtr1)
{-# LINE 2335 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:8e4e d:252b
-- | Get the root window where this widget is located. This function can only
-- be called after the widget has been added to a widget heirarchy with
-- 'Window' at the top.
--
-- The root window is useful for such purposes as creating a popup
-- 'DrawWindow' associated with the window. In general, you should only create
-- display specific resources when a widget has been realized, and you should
-- free those resources when the widget is unrealized.
--
-- * Available since Gtk+ version 2.2
--
widgetGetRootWindow :: WidgetClass self => self
 -> IO DrawWindow -- ^ returns the 'DrawWindow' root window for the toplevel
                  -- for this widget.
widgetGetRootWindow :: forall self. WidgetClass self => self -> IO DrawWindow
widgetGetRootWindow self
self =
  (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
-> IO (Ptr DrawWindow) -> IO DrawWindow
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
forall {a}. (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr a)
mkDrawWindow (IO (Ptr DrawWindow) -> IO DrawWindow)
-> IO (Ptr DrawWindow) -> IO DrawWindow
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow))
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr DrawWindow)
gtk_widget_get_root_window Ptr Widget
argPtr1)
{-# LINE 2355 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:b929 d:67f0
-- | Get the 'Screen' from the toplevel window associated with this widget.
-- This function can only be called after the widget has been added to a widget
-- hierarchy with a 'Window' at the top.
--
-- In general, you should only create screen specific resources when a
-- widget has been realized, and you should free those resources when the
-- widget is unrealized.
--
-- * Available since Gtk+ version 2.2
--
widgetGetScreen :: WidgetClass self => self
 -> IO Screen -- ^ returns the 'Screen' for the toplevel for this widget.
widgetGetScreen :: forall self. WidgetClass self => self -> IO Screen
widgetGetScreen self
self =
  (ForeignPtr Screen -> Screen, FinalizerPtr Screen)
-> IO (Ptr Screen) -> IO Screen
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Screen -> Screen, FinalizerPtr Screen)
forall {a}. (ForeignPtr Screen -> Screen, FinalizerPtr a)
mkScreen (IO (Ptr Screen) -> IO Screen) -> IO (Ptr Screen) -> IO Screen
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Screen)) -> IO (Ptr Screen)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Screen)) -> IO (Ptr Screen))
-> (Ptr Widget -> IO (Ptr Screen)) -> IO (Ptr Screen)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Screen)
gtk_widget_get_screen Ptr Widget
argPtr1)
{-# LINE 2373 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:4fab d:aae2
-- | Checks whether there is a 'Screen' is associated with this widget. All
-- toplevel widgets have an associated screen, and all widgets added into a
-- heirarchy with a toplevel window at the top.
--
-- * Available since Gtk+ version 2.2
--
widgetHasScreen :: WidgetClass self => self
 -> IO Bool -- ^ returns @True@ if there is a 'Screen' associcated with the
            -- widget.
widgetHasScreen :: forall self. WidgetClass self => self -> IO Bool
widgetHasScreen self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_screen Ptr Widget
argPtr1)
{-# LINE 2388 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- %hash c:dabc d:8275
-- | Gets the size request that was explicitly set for the widget using
-- 'widgetSetSizeRequest'. A value of -1 for @width@ or @height@
-- indicates that that dimension has not been set explicitly and the natural
-- requisition of the widget will be used intead. See 'widgetSetSizeRequest'.
-- To get the size a widget will actually use, call 'widgetSizeRequest' instead
-- of this function.
--
widgetGetSizeRequest :: WidgetClass self => self
 -> IO (Int, Int) -- ^ @(width, height)@
widgetGetSizeRequest :: forall self. WidgetClass self => self -> IO (Int, Int)
widgetGetSizeRequest self
self =
  (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Int, Int)) -> IO (Int, Int))
-> (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
widthPtr ->
  (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Int, Int)) -> IO (Int, Int))
-> (Ptr CInt -> IO (Int, Int)) -> IO (Int, Int)
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
heightPtr -> do
  (\(Widget ForeignPtr Widget
arg1) Ptr CInt
arg2 Ptr CInt
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr CInt -> Ptr CInt -> IO ()
gtk_widget_get_size_request Ptr Widget
argPtr1 Ptr CInt
arg2 Ptr CInt
arg3)
{-# LINE 2405 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    Ptr CInt
widthPtr
    Ptr CInt
heightPtr
  CInt
width <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
widthPtr
  CInt
height <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
heightPtr
  (Int, Int) -> IO (Int, Int)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
width, CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
height)


-- | Retrieves the minimum and natural size of a widget, taking into account the
-- widget’s preference for height-for-width management.
--
-- This is used to retrieve a suitable size by container widgets which do not
-- impose any restrictions on the child placement. It can be used to deduce
-- toplevel window and menu sizes as well as child widgets in free-form containers
-- such as GtkLayout.
--
-- Handle with care. Note that the natural height of a height-for-width widget
-- will generally be a smaller size than the minimum height, since the required
-- height for the natural width is generally smaller than the required height for
-- the minimum width.
--
-- Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want
-- to support baseline alignment.
--
-- * Available since Gtk+ version 3.0
--

widgetGetPreferredSize :: WidgetClass self => self
 -> IO (Requisition, Requisition) -- ^ @(minimumSize, naturalSize)@
widgetGetPreferredSize :: forall self.
WidgetClass self =>
self -> IO (Requisition, Requisition)
widgetGetPreferredSize self
self =
  (Ptr Requisition -> IO (Requisition, Requisition))
-> IO (Requisition, Requisition)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Requisition -> IO (Requisition, Requisition))
 -> IO (Requisition, Requisition))
-> (Ptr Requisition -> IO (Requisition, Requisition))
-> IO (Requisition, Requisition)
forall a b. (a -> b) -> a -> b
$ \Ptr Requisition
minReqPtr ->
  (Ptr Requisition -> IO (Requisition, Requisition))
-> IO (Requisition, Requisition)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Requisition -> IO (Requisition, Requisition))
 -> IO (Requisition, Requisition))
-> (Ptr Requisition -> IO (Requisition, Requisition))
-> IO (Requisition, Requisition)
forall a b. (a -> b) -> a -> b
$ \Ptr Requisition
natReqPtr -> do
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 Ptr ()
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> Ptr () -> IO ()
gtk_widget_get_preferred_size Ptr Widget
argPtr1 Ptr ()
arg2 Ptr ()
arg3) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Requisition -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Requisition
minReqPtr) (Ptr Requisition -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Requisition
natReqPtr)
  Requisition
min <- Ptr Requisition -> IO Requisition
forall a. Storable a => Ptr a -> IO a
peek Ptr Requisition
minReqPtr
  Requisition
nat <- Ptr Requisition -> IO Requisition
forall a. Storable a => Ptr a -> IO a
peek Ptr Requisition
natReqPtr
  (Requisition, Requisition) -> IO (Requisition, Requisition)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Requisition
min, Requisition
nat)


-- %hash c:546d d:3c7f
-- | Sets whether @widget@ should be mapped along with its when its parent is
-- mapped and @widget@ has been shown with 'widgetShow'.
--
-- The child visibility can be set for widget before it is added to a
-- container with 'widgetSetParent', to avoid mapping children unnecessary
-- before immediately unmapping them. However it will be reset to its default
-- state of @True@ when the widget is removed from a container.
--
-- Note that changing the child visibility of a widget does not queue a
-- resize on the widget. Most of the time, the size of a widget is computed
-- from all visible children, whether or not they are mapped. If this is not
-- the case, the container can queue a resize itself.
--
-- This function is only useful for container implementations and never
-- should be called by an application.
--
widgetSetChildVisible :: WidgetClass self => self
 -> Bool -- ^ @isVisible@ - if @True@, @widget@ should be mapped along with
         -- its parent.
 -> IO ()
widgetSetChildVisible :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetChildVisible self
self Bool
isVisible =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_child_visible Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2466 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
isVisible)

-- | Sets the minimum size of a widget; that is, the widget's size request
-- will be @width@ by @height@. You can use this function to force a widget to
-- be either larger or smaller than it normally would be.
--
-- In most cases, 'Graphics.UI.Gtk.Windows.Window.windowSetDefaultSize'
-- is a better choice for toplevel
-- windows than this function; setting the default size will still allow users
-- to shrink the window. Setting the size request will force them to leave the
-- window at least as large as the size request. When dealing with window
-- sizes, 'Graphics.UI.Gtk.Windows.Window.windowSetGeometryHints' can be a
-- useful function as well.
--
-- Note the inherent danger of setting any fixed size - themes, translations
-- into other languages, different fonts, and user action can all change the
-- appropriate size for a given widget. So, it's basically impossible to
-- hardcode a size that will always be correct.
--
-- The size request of a widget is the smallest size a widget can accept
-- while still functioning well and drawing itself correctly. However in some
-- strange cases a widget may be allocated less than its requested size, and in
-- many cases a widget may be allocated more space than it requested.
--
-- If the size request in a given direction is -1 (unset), then the
-- \"natural\" size request of the widget will be used instead.
--
-- Widgets can't actually be allocated a size less than 1 by 1, but you can
-- pass 0,0 to this function to mean \"as small as possible.\"
--
widgetSetSizeRequest :: WidgetClass self => self
 -> Int -- ^ @width@ - width @widget@ should request, or -1 to unset
 -> Int -- ^ @height@ - height @widget@ should request, or -1 to unset
 -> IO ()
widgetSetSizeRequest :: forall self. WidgetClass self => self -> Int -> Int -> IO ()
widgetSetSizeRequest self
self Int
width Int
height =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 CInt
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> CInt -> IO ()
gtk_widget_set_size_request Ptr Widget
argPtr1 CInt
arg2 CInt
arg3)
{-# LINE 2503 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
width)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
height)


-- %hash c:83c3 d:e6f1
-- | Sets the 'noShowAll' property, which determines whether calls to
-- 'widgetShowAll' and 'widgetHideAll' will affect this widget.
--
-- This is mostly for use in constructing widget hierarchies with externally
-- controlled visibility, see 'UIManager'.
--
-- * Available since Gtk+ version 2.4
--
widgetSetNoShowAll :: WidgetClass self => self
 -> Bool -- ^ @noShowAll@ - the new value for the 'noShowAll' property
 -> IO ()
widgetSetNoShowAll :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetNoShowAll self
self Bool
noShowAll =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_no_show_all Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2522 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
noShowAll)

-- %hash c:218d d:e07e
-- | Returns the current value of the 'noShowAll' property, which
-- determines whether calls to 'widgetShowAll' and 'widgetHideAll' will affect
-- this widget.
--
-- * Available since Gtk+ version 2.4
--
widgetGetNoShowAll :: WidgetClass self => self
 -> IO Bool -- ^ returns the current value of the \"no_show_all\" property.
widgetGetNoShowAll :: forall self. WidgetClass self => self -> IO Bool
widgetGetNoShowAll self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_no_show_all Ptr Widget
argPtr1)
{-# LINE 2537 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- %hash c:205b d:c518
-- | Returns a list of the widgets, normally labels, for which
-- this widget is a the target of a mnemonic (see for example,
-- 'labelSetMnemonicWidget').
--
-- * Available since Gtk+ version 2.4
--
widgetListMnemonicLabels :: WidgetClass self => self
 -> IO [Widget] -- ^ returns the list of mnemonic labels
widgetListMnemonicLabels :: forall self. WidgetClass self => self -> IO [Widget]
widgetListMnemonicLabels self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr Widget -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr ())
gtk_widget_list_mnemonic_labels Ptr Widget
argPtr1)
{-# LINE 2550 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
  IO (Ptr ()) -> (Ptr () -> IO [Ptr Widget]) -> IO [Ptr Widget]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr () -> IO [Ptr Widget]
forall a. Ptr () -> IO [Ptr a]
fromGList
  IO [Ptr Widget] -> ([Ptr Widget] -> IO [Widget]) -> IO [Widget]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Ptr Widget -> IO Widget) -> [Ptr Widget] -> IO [Widget]
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 ((ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget)
-> (Ptr Widget -> IO (Ptr Widget)) -> Ptr Widget -> IO Widget
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr Widget -> IO (Ptr Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- %hash c:eb76 d:28a2
-- | Adds a widget to the list of mnemonic labels for this widget. (See
-- 'widgetListMnemonicLabels'). Note the list of mnemonic labels for the widget
-- is cleared when the widget is destroyed, so the caller must make sure to
-- update its internal state at this point as well, by using a connection to
-- the 'destroy' signal or a weak notifier.
--
-- * Available since Gtk+ version 2.4
--
widgetAddMnemonicLabel :: (WidgetClass self, WidgetClass label) => self
 -> label -- ^ @label@ - a 'Widget' that acts as a mnemonic label for
          -- @widget@.
 -> IO ()
widgetAddMnemonicLabel :: forall self label.
(WidgetClass self, WidgetClass label) =>
self -> label -> IO ()
widgetAddMnemonicLabel self
self label
label =
  (\(Widget ForeignPtr Widget
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr Widget -> Ptr Widget -> IO ()
gtk_widget_add_mnemonic_label Ptr Widget
argPtr1 Ptr Widget
argPtr2)
{-# LINE 2569 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (label -> Widget
forall o. WidgetClass o => o -> Widget
toWidget label
label)

-- %hash c:7831 d:d10b
-- | Removes a widget from the list of mnemonic labels for this widget. (See
-- 'widgetListMnemonicLabels'). The widget must have previously been added to
-- the list with 'widgetAddMnemonicLabel'.
--
-- * Available since Gtk+ version 2.4
--
widgetRemoveMnemonicLabel :: (WidgetClass self, WidgetClass label) => self
 -> label -- ^ @label@ - a 'Widget' that was previously set as a mnemnic label
          -- for @widget@ with 'widgetAddMnemonicLabel'.
 -> IO ()
widgetRemoveMnemonicLabel :: forall self label.
(WidgetClass self, WidgetClass label) =>
self -> label -> IO ()
widgetRemoveMnemonicLabel self
self label
label =
  (\(Widget ForeignPtr Widget
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr Widget -> Ptr Widget -> IO ()
gtk_widget_remove_mnemonic_label Ptr Widget
argPtr1 Ptr Widget
argPtr2)
{-# LINE 2585 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (label -> Widget
forall o. WidgetClass o => o -> Widget
toWidget label
label)
{-# LINE 2607 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:7ea0 d:2560
-- | Whether @widget@ can rely on having its alpha channel drawn correctly. On
-- X11 this function returns whether a compositing manager is running for
-- @widget@'s screen
--
-- * Available since Gtk+ version 2.10
--
widgetIsComposited :: WidgetClass self => self
 -> IO Bool -- ^ returns @True@ if the widget can rely on its alpha channel
            -- being drawn correctly.
widgetIsComposited :: forall self. WidgetClass self => self -> IO Bool
widgetIsComposited self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_composited Ptr Widget
argPtr1)
{-# LINE 2620 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)




-- | Notifies the user about an input-related error on this widget.
-- If the "gtk-error-bell" setting is @True@, it calls 'drawWindowBeep',
-- otherwise it does nothing.
--
-- Note that the effect of 'drawWindow_beep' can be configured in many
-- ways, depending on the windowing backend and the desktop environment
-- or window manager that is used.
widgetErrorBell :: WidgetClass self => self
 -> IO ()
widgetErrorBell :: forall self. WidgetClass self => self -> IO ()
widgetErrorBell self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_error_bell Ptr Widget
argPtr1)
{-# LINE 2636 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | This function should be called whenever keyboard navigation within
-- a single widget hits a boundary. The function emits the "keynav-failed"
-- signal on the widget and its return value should be interpreted in a
-- way similar to the return value of 'widgetChildFocus':
--
-- When @True@ is returned, stay in the widget, the failed keyboard
-- navigation is Ok and/or there is nowhere we can/should move the
-- focus to.
--
-- When @False@ is returned, the caller should continue with keyboard
-- navigation outside the widget, e.g. by calling 'widgetChildFocus' on
-- the widget’s toplevel.
--
-- The default ::keynav-failed handler returns @True@ for 'DirTabForward'
-- and 'DirTabBackward'. For the other values of 'DirectionType' it
-- returns @False@.
--
-- Whenever the default handler returns @True@, it also calls
-- 'widgetErrorBell' to notify the user of the failed keyboard
-- navigation.
--
-- A use case for providing an own implementation of ::keynav-failed
-- (either by connecting to it or by overriding it) would be a row of
-- 'Entry' widgets where the user should be able to navigate the entire
-- row with the cursor keys, as e.g. known from user interfaces that
-- require entering license keys.
widgetKeynavFailed :: WidgetClass self => self
 -> DirectionType -- ^ @direction@ - direction of focus movement
 -> IO Bool -- ^ returns @True@ if stopping keyboard navigation is
                  -- fine, @False@ if the emitting widget should try to handle
                  -- the keyboard navigation attempt in its parent container(s).
widgetKeynavFailed :: forall self. WidgetClass self => self -> DirectionType -> IO Bool
widgetKeynavFailed self
self DirectionType
direction =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO CInt
gtk_widget_keynav_failed Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2672 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (DirectionType -> Int) -> DirectionType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionType -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionType
direction)

-- | Gets the contents of the tooltip for widget.
widgetGetTooltipMarkup :: (WidgetClass self, GlibString markup) => self
 -> IO (Maybe markup) -- Returns the tooltip text, or Nothing.
widgetGetTooltipMarkup :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Maybe string)
widgetGetTooltipMarkup self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CString) -> IO CString)
-> (Ptr Widget -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CString
gtk_widget_get_tooltip_markup Ptr Widget
argPtr1)
{-# LINE 2680 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
  IO CString -> (CString -> IO (Maybe markup)) -> IO (Maybe markup)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CString -> IO markup) -> CString -> IO (Maybe markup)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek CString -> IO markup
forall s. GlibString s => CString -> IO s
peekUTFString

-- | Sets @markup@ as the contents of the tooltip, which is marked up with the
-- Pango text markup language.
--
-- This function will take care of setting "has-tooltip" to True and of the
-- default handler for the "query-tooltip" signal.
--
-- See also the "tooltip-markup" property and 'tooltipSetMarkup'.
widgetSetTooltipMarkup :: (WidgetClass self, GlibString markup) => self
  -> Maybe markup -- ^ the contents of the tooltip for widget, or @Nothing@.
  -> IO ()
widgetSetTooltipMarkup :: forall self markup.
(WidgetClass self, GlibString markup) =>
self -> Maybe markup -> IO ()
widgetSetTooltipMarkup self
self Maybe markup
markup =
  (markup -> (CString -> IO ()) -> IO ())
-> Maybe markup -> (CString -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith markup -> (CString -> IO ()) -> IO ()
forall a. markup -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString Maybe markup
markup ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ CString
markupPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> IO ()
gtk_widget_set_tooltip_markup Ptr Widget
argPtr1 CString
arg2)
{-# LINE 2696 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    CString
markupPtr

-- | Gets the contents of the tooltip for widget.
widgetGetTooltipText :: (WidgetClass self, GlibString text) => self
 -> IO (Maybe text) -- Returns the tooltip text, or Nothing.
widgetGetTooltipText :: forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Maybe string)
widgetGetTooltipText self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CString) -> IO CString)
-> (Ptr Widget -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CString
gtk_widget_get_tooltip_text Ptr Widget
argPtr1)
{-# LINE 2704 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
  IO CString -> (CString -> IO (Maybe text)) -> IO (Maybe text)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CString -> IO text) -> CString -> IO (Maybe text)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek CString -> IO text
forall s. GlibString s => CString -> IO s
peekUTFString

-- | Sets @text@ as the contents of the tooltip. This function will take care
-- of setting "has-tooltip" to @True@ and of the default handler for the
-- "query-tooltip" signal.
--
-- See also the "tooltip-text" property and 'tooltipSetText'.
widgetSetTooltipText :: (WidgetClass widget, GlibString text) => widget
  -> Maybe text -- ^ the contents of the tooltip for widget, or @Nothing@.
  -> IO ()
widgetSetTooltipText :: forall self markup.
(WidgetClass self, GlibString markup) =>
self -> Maybe markup -> IO ()
widgetSetTooltipText widget
widget Maybe text
text =
  (text -> (CString -> IO ()) -> IO ())
-> Maybe text -> (CString -> IO ()) -> IO ()
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith text -> (CString -> IO ()) -> IO ()
forall a. text -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString Maybe text
text ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ CString
textPtr ->
  (\(Widget ForeignPtr Widget
arg1) CString
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CString -> IO ()
gtk_widget_set_tooltip_text Ptr Widget
argPtr1 CString
arg2)
{-# LINE 2718 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    CString
textPtr

-- | Returns the 'Window' of the current tooltip. This can be the 'Window' created by default, or the
-- custom tooltip window set using 'widgetSetTooltipWindow'.
--
-- * Available since Gtk+ version 2.12
--
widgetGetTooltipWindow :: WidgetClass self => self
 -> IO Window -- ^ returns The 'Window' of the current tooltip
widgetGetTooltipWindow :: forall self. WidgetClass self => self -> IO Window
widgetGetTooltipWindow self
self =
  (ForeignPtr Window -> Window, FinalizerPtr Window)
-> IO (Ptr Window) -> IO Window
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Window -> Window, FinalizerPtr Window)
forall {a}. (ForeignPtr Window -> Window, FinalizerPtr a)
mkWindow (IO (Ptr Window) -> IO Window) -> IO (Ptr Window) -> IO Window
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Window)) -> IO (Ptr Window)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Window)) -> IO (Ptr Window))
-> (Ptr Widget -> IO (Ptr Window)) -> IO (Ptr Window)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Window)
gtk_widget_get_tooltip_window Ptr Widget
argPtr1)
{-# LINE 2731 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Replaces the default, usually yellow, window used for displaying tooltips with @customWindow@. GTK+
-- will take care of showing and hiding @customWindow@ at the right moment, to behave likewise as the
-- default tooltip window. If @customWindow@ is 'Nothing', the default tooltip window will be used.
--
-- If the custom window should have the default theming it needs to have the name 'gtk-tooltip', see
-- 'widgetSetName'.
--
-- * Available since Gtk+ version 2.12
--
widgetSetTooltipWindow :: (WidgetClass self, WindowClass customWindow) => self
 -> Maybe customWindow -- ^ @customWindow@ a 'Window', or 'Nothing'. allow-none.
 -> IO ()
widgetSetTooltipWindow :: forall self customWindow.
(WidgetClass self, WindowClass customWindow) =>
self -> Maybe customWindow -> IO ()
widgetSetTooltipWindow self
self Maybe customWindow
customWindow =
  (\(Widget ForeignPtr Widget
arg1) (Window ForeignPtr Window
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Window -> (Ptr Window -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Window
arg2 ((Ptr Window -> IO ()) -> IO ()) -> (Ptr Window -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Window
argPtr2 ->Ptr Widget -> Ptr Window -> IO ()
gtk_widget_set_tooltip_window Ptr Widget
argPtr1 Ptr Window
argPtr2)
{-# LINE 2747 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Window -> (customWindow -> Window) -> Maybe customWindow -> Window
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (ForeignPtr Window -> Window
Window ForeignPtr Window
forall a. ForeignPtr a
nullForeignPtr) customWindow -> Window
forall o. WindowClass o => o -> Window
toWindow Maybe customWindow
customWindow)

-- | Returns the current value of the has-tooltip property.
-- See 'widgetHasTooltip' for more information.
widgetGetHasTooltip :: WidgetClass widget => widget
 -> IO Bool -- ^ current value of 'widgetHasTooltip' on @widget@.
widgetGetHasTooltip :: forall self. WidgetClass self => self -> IO Bool
widgetGetHasTooltip widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_has_tooltip Ptr Widget
argPtr1)
{-# LINE 2757 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Sets the has-tooltip property on @widget@ to @hasTooltip@.
-- See 'widgetHasTooltip' for more information.
widgetSetHasTooltip :: WidgetClass widget => widget
 -> Bool -- ^ @hasTooltip@ whether or not @widget@ has a tooltip.
 -> IO ()
widgetSetHasTooltip :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetHasTooltip widget
widget Bool
hasTooltip =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_has_tooltip Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2766 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
hasTooltip)

-- | Triggers a tooltip query on the display where the toplevel of @widget@ is
-- located. See 'tooltipTriggerTooltipQuery' for more information.
--
-- * Available since Gtk+ version 2.12
--
widgetTriggerTooltipQuery :: WidgetClass self => self -> IO ()
widgetTriggerTooltipQuery :: forall self. WidgetClass self => self -> IO ()
widgetTriggerTooltipQuery self
self =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO ()
gtk_widget_trigger_tooltip_query Ptr Widget
argPtr1)
{-# LINE 2777 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)



-- | Returns the widget's window if it is realized, Nothing otherwise
--
-- * Available since Gtk+ version 2.14
--
widgetGetWindow :: WidgetClass self => self -> IO (Maybe DrawWindow)
widgetGetWindow :: forall self. WidgetClass self => self -> IO (Maybe DrawWindow)
widgetGetWindow self
self =
  (IO (Ptr DrawWindow) -> IO DrawWindow)
-> IO (Ptr DrawWindow) -> IO (Maybe DrawWindow)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
-> IO (Ptr DrawWindow) -> IO DrawWindow
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr DrawWindow)
forall {a}. (ForeignPtr DrawWindow -> DrawWindow, FinalizerPtr a)
mkDrawWindow) (IO (Ptr DrawWindow) -> IO (Maybe DrawWindow))
-> IO (Ptr DrawWindow) -> IO (Maybe DrawWindow)
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow))
-> (Ptr Widget -> IO (Ptr DrawWindow)) -> IO (Ptr DrawWindow)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr DrawWindow)
gtk_widget_get_window Ptr Widget
argPtr1)
{-# LINE 2789 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)



-- | Registers a 'DrawWindow' with the widget and sets it up so that the
-- widget receives events for it. Call 'widgetUnregisterWindow' when
-- destroying the window.
widgetRegisterWindow :: (WidgetClass widget, DrawWindowClass window) => widget
 -> window
 -> IO ()
widgetRegisterWindow :: forall widget window.
(WidgetClass widget, DrawWindowClass window) =>
widget -> window -> IO ()
widgetRegisterWindow widget
widget window
window =
  (\(Widget ForeignPtr Widget
arg1) (DrawWindow ForeignPtr DrawWindow
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg2 ((Ptr DrawWindow -> IO ()) -> IO ())
-> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr2 ->Ptr Widget -> Ptr DrawWindow -> IO ()
gtk_widget_register_window Ptr Widget
argPtr1 Ptr DrawWindow
argPtr2)
{-# LINE 2801 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (window -> DrawWindow
forall o. DrawWindowClass o => o -> DrawWindow
toDrawWindow window
window)

-- | Unregisters a 'DrawWindow' from the widget that was previously set up
-- with 'widgetRegisterWindow'. You need to call this when the window is no
-- longer used by the widget, such as when you destroy it.
widgetUnregisterWindow :: (WidgetClass widget, DrawWindowClass window) => widget
 -> window
 -> IO ()
widgetUnregisterWindow :: forall widget window.
(WidgetClass widget, DrawWindowClass window) =>
widget -> window -> IO ()
widgetUnregisterWindow widget
widget window
window =
  (\(Widget ForeignPtr Widget
arg1) (DrawWindow ForeignPtr DrawWindow
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg2 ((Ptr DrawWindow -> IO ()) -> IO ())
-> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr2 ->Ptr Widget -> Ptr DrawWindow -> IO ()
gtk_widget_unregister_window Ptr Widget
argPtr1 Ptr DrawWindow
argPtr2)
{-# LINE 2812 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (window -> DrawWindow
forall o. DrawWindowClass o => o -> DrawWindow
toDrawWindow window
window)



-- | This function is supposed to be called in "draw" implementations for
-- widgets that support multiple windows. @cr@ must be untransformed from
-- invoking of the draw function. This function will return @True@ if the
-- contents of the given @window@ are supposed to be drawn and @False@
-- otherwise. Note that when the drawing was not initiated by the windowing
-- system this function will return @True@ for all windows, so you need to
-- draw the bottommost window first. Also, do not use “else if” statements to
-- check which window should be drawn.
cairoShouldDrawWindow :: DrawWindowClass window
 => Cairo -- ^ @cr@ a cairo context
 -> window -- ^ @window@ the window to check. @window@ may not be an input-only window.
 -> IO Bool
cairoShouldDrawWindow :: forall window. DrawWindowClass window => Cairo -> window -> IO Bool
cairoShouldDrawWindow Cairo
cr window
window =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\Ptr ()
arg1 (DrawWindow ForeignPtr DrawWindow
arg2) -> ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg2 ((Ptr DrawWindow -> IO CInt) -> IO CInt)
-> (Ptr DrawWindow -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr2 ->Ptr () -> Ptr DrawWindow -> IO CInt
gtk_cairo_should_draw_window Ptr ()
arg1 Ptr DrawWindow
argPtr2)
{-# LINE 2832 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (castPtr $ unCairo cr)
    (window -> DrawWindow
forall o. DrawWindowClass o => o -> DrawWindow
toDrawWindow window
window)

-- | Transforms the given cairo context @cr@ that from @widget@-relative
-- coordinates to @window@-relative coordinates. If the @widget@’s window is
-- not an ancestor of @window@, no modification will be applied.
--
-- This is the inverse to the transformation GTK applies when preparing an
-- expose event to be emitted with the “draw” signal. It is intended to help
-- porting multiwindow widgets from GTK+ 2 to the rendering architecture of
-- GTK+ 3.
cairoTransformToWindow :: (WidgetClass widget, DrawWindowClass window)
 => Cairo -- ^ @cr@ the cairo context to transform
 -> widget -- ^ @widget@ the widget the context is currently centered for
 -> window -- ^ @window@ the window to transform the context to
 -> IO ()
cairoTransformToWindow :: forall widget window.
(WidgetClass widget, DrawWindowClass window) =>
Cairo -> widget -> window -> IO ()
cairoTransformToWindow Cairo
cr widget
widget window
window =
  (\Ptr ()
arg1 (Widget ForeignPtr Widget
arg2) (DrawWindow ForeignPtr DrawWindow
arg3) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg3 ((Ptr DrawWindow -> IO ()) -> IO ())
-> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr3 ->Ptr () -> Ptr Widget -> Ptr DrawWindow -> IO ()
gtk_cairo_transform_to_window Ptr ()
arg1 Ptr Widget
argPtr2 Ptr DrawWindow
argPtr3)
{-# LINE 2850 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (castPtr $ unCairo cr)
    (widget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget widget
widget)
    (window -> DrawWindow
forall o. DrawWindowClass o => o -> DrawWindow
toDrawWindow window
window)


-- | Moves a widget from one 'Container' to another.
--
widgetReparent :: (WidgetClass self, WidgetClass newParent) => self
 -> newParent -- ^ @newParent@ - a 'Container' to move the widget into
 -> IO ()
widgetReparent :: forall self label.
(WidgetClass self, WidgetClass label) =>
self -> label -> IO ()
widgetReparent self
self newParent
newParent =
  (\(Widget ForeignPtr Widget
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr Widget -> Ptr Widget -> IO ()
gtk_widget_reparent Ptr Widget
argPtr1 Ptr Widget
argPtr2)
{-# LINE 2862 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (newParent -> Widget
forall o. WidgetClass o => o -> Widget
toWidget newParent
newParent)


-- | Set if this widget can receive keyboard input.
--
-- * To use the 'keyPress' event, the widget must be allowed
-- to get the input focus. Once it has the input focus all keyboard
-- input is directed to this widget.
--
widgetSetCanFocus :: WidgetClass self => self -> Bool -> IO ()
widgetSetCanFocus :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetCanFocus = String -> self -> Bool -> IO ()
forall gobj. GObjectClass gobj => String -> gobj -> Bool -> IO ()
objectSetPropertyBool String
"can_focus"

-- | Check if this widget can receive keyboard input.
--
widgetGetCanFocus :: WidgetClass self => self -> IO Bool
widgetGetCanFocus :: forall self. WidgetClass self => self -> IO Bool
widgetGetCanFocus = String -> self -> IO Bool
forall gobj. GObjectClass gobj => String -> gobj -> IO Bool
objectGetPropertyBool String
"can_focus"

-- | Retrieves the widget's allocation.
--
-- * Available since Gtk+ version 2.18
--
widgetGetAllocation :: WidgetClass self => self -> IO Allocation
widgetGetAllocation :: forall self. WidgetClass self => self -> IO Allocation
widgetGetAllocation self
widget =
  (Ptr Allocation -> IO Allocation) -> IO Allocation
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Allocation -> IO Allocation) -> IO Allocation)
-> (Ptr Allocation -> IO Allocation) -> IO Allocation
forall a b. (a -> b) -> a -> b
$ \ Ptr Allocation
allocationPtr -> do
     (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_get_allocation Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget) (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
allocationPtr)
     Ptr Allocation -> IO Allocation
forall a. Storable a => Ptr a -> IO a
peek Ptr Allocation
allocationPtr



-- | Returns the width that has currently been allocated to widget. This function is intended
-- | to be used when implementing handlers for the "draw" function.
widgetGetAllocatedWidth :: WidgetClass self => self -> IO Int
widgetGetAllocatedWidth :: forall self. WidgetClass self => self -> IO Int
widgetGetAllocatedWidth self
widget =
     (CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_allocated_width Ptr Widget
argPtr1) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget)

-- | Returns the height that has currently been allocated to widget. This function is intended
-- | to be used when implementing handlers for the "draw" function.
widgetGetAllocatedHeight :: WidgetClass self => self -> IO Int
widgetGetAllocatedHeight :: forall self. WidgetClass self => self -> IO Int
widgetGetAllocatedHeight self
widget =
     (CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_allocated_height Ptr Widget
argPtr1) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget)



-- | Returns the baseline that has currently been allocated to widget . This function is intended
-- to be used when implementing handlers for the “draw” function, and when allocating child
-- widgets in “size_allocate”.
widgetGetAllocatedBaseline :: WidgetClass self => self -> IO Int
widgetGetAllocatedBaseline :: forall self. WidgetClass self => self -> IO Int
widgetGetAllocatedBaseline self
widget =
     (CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_allocated_baseline Ptr Widget
argPtr1) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget)



-- | Retrieves the widget’s clip area.
--
-- The clip area is the area in which all of widget's drawing will happen. Other
-- toolkits call it the bounding box.
--
-- Historically, in GTK+ the clip area has been equal to the allocation retrieved
-- via widgetGetAllocation.
widgetGetClip :: WidgetClass self => self -> IO Allocation
widgetGetClip :: forall self. WidgetClass self => self -> IO Allocation
widgetGetClip self
widget =
  (Ptr Allocation -> IO Allocation) -> IO Allocation
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Allocation -> IO Allocation) -> IO Allocation)
-> (Ptr Allocation -> IO Allocation) -> IO Allocation
forall a b. (a -> b) -> a -> b
$ \ Ptr Allocation
allocationPtr -> do
     (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_get_clip Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget) (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
allocationPtr)
     Ptr Allocation -> IO Allocation
forall a. Storable a => Ptr a -> IO a
peek Ptr Allocation
allocationPtr

-- | Sets the widget’s clip. This must not be used directly, but from within a widget’s 'sizeAllocate' method.
--
-- The clip set should be the area that widget draws on. If widget is a GtkContainer, the area
-- must contain all children's clips.
--
-- If this function is not called by widget during a 'sizeAllocate' handler, it is assumed to be
-- equal to the allocation. However, if the function is not called, certain features that might extend
-- a widget's allocation will not be available:
--
-- * The “draw” signal will be clipped to the widget's allocation to avoid overdraw.
--
-- * Calling gtk_render_background() will not draw outset shadows.
--
-- It is therefore suggested that you always call widgetSetClip during a 'sizeAllocate' handler.
widgetSetClip :: WidgetClass self => self
  -> Allocation
  -> IO ()
widgetSetClip :: forall self. WidgetClass self => self -> Allocation -> IO ()
widgetSetClip self
self Allocation
clip = Allocation -> (Ptr Allocation -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Allocation
clip ((Ptr Allocation -> IO ()) -> IO ())
-> (Ptr Allocation -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Allocation
clipPtr ->
  (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO ()
gtk_widget_set_clip Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
self) (Ptr Allocation -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Allocation
clipPtr)



-- | Determines whether the application intends to draw on the widget in an
-- "draw" handler.
-- See 'widgetSetAppPaintable'.
widgetGetAppPaintable :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the @widget@ is app paintable.
widgetGetAppPaintable :: forall self. WidgetClass self => self -> IO Bool
widgetGetAppPaintable widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_app_paintable Ptr Widget
argPtr1)
{-# LINE 2958 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Determines whether @widget@ can be a default widget.
-- See 'widgetSetCanDefault'.
widgetGetCanDefault :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ can be a default widget, @False@ otherwise.
widgetGetCanDefault :: forall self. WidgetClass self => self -> IO Bool
widgetGetCanDefault widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_can_default Ptr Widget
argPtr1)
{-# LINE 2967 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Specifies whether @widget@ can be a default widget.
-- See 'widgetGrabDefault' for details about the meaning of "default".
widgetSetCanDefault :: WidgetClass widget => widget
 -> Bool -- ^ @canDefault@ whether or not @widget@ can be a default widget.
 -> IO ()
widgetSetCanDefault :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetCanDefault widget
widget Bool
canDefault =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_can_default Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 2976 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
canDefault)

-- | Determines whether @widget@ has a 'DrawWindow' of its own. See 'widgetSetHasWindow'.
widgetGetHasWindow :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ has a window, @False@ otherwise.
widgetGetHasWindow :: forall self. WidgetClass self => self -> IO Bool
widgetGetHasWindow widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_has_window Ptr Widget
argPtr1)
{-# LINE 2985 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Specifies whether @widget@ has a 'DrawWindow' of its own. Note that all
-- realized widgets have a non-NULL "window" pointer ('widgetGetWindow' never
-- returns a NULL window when a widget is realized), but for many of them it's
-- actually the 'DrawWindow' of one of its parent widgets. Widgets that do not
-- create a window for themselves in "realize" must announce this by calling
-- this function with @hasWindow@ = @False@.
--
-- This function should only be called by widget implementations, and they
-- should call it in their @init()@ function.
widgetSetHasWindow :: WidgetClass widget => widget
 -> Bool -- ^ @hasWindow@ whether or not @widget@ has a window.
 -> IO ()
widgetSetHasWindow :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetHasWindow widget
widget Bool
hasWindow =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_has_window Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3001 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
hasWindow)

-- | Returns the @widget@’s sensitivity (in the sense of returning the value
-- that has been set using 'widgetSetSensitive').
--
-- The effective sensitivity of a widget is however determined by both its own
-- and its parent widget’s sensitivity. See 'widgetIsSensitive'.
widgetGetSensitive :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget is sensitive.
widgetGetSensitive :: forall self. WidgetClass self => self -> IO Bool
widgetGetSensitive widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_sensitive Ptr Widget
argPtr1)
{-# LINE 3014 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Returns the widget’s effective sensitivity, which means it is sensitive
-- itself and also its parent widget is sensitive.
widgetIsSensitive :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget is effectively sensitive.
widgetIsSensitive :: forall self. WidgetClass self => self -> IO Bool
widgetIsSensitive widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_sensitive Ptr Widget
argPtr1)
{-# LINE 3023 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Retrieve the current state of the widget.
--
-- * The state refers to different modes of user interaction, see
-- 'StateType' for more information.
--
widgetGetState :: WidgetClass self => self -> IO StateType
widgetGetState :: forall self. WidgetClass self => self -> IO StateType
widgetGetState self
widget =
  (CInt -> StateType) -> IO CInt -> IO StateType
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> StateType
forall a. Enum a => Int -> a
toEnum (Int -> StateType) -> (CInt -> Int) -> CInt -> StateType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO StateType) -> IO CInt -> IO StateType
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_state Ptr Widget
argPtr1)
{-# LINE 3034 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Determines whether the widget is visible. If you want to take into
-- account whether the widget’s parent is also marked as visible, use
-- 'widgetIsVisible' instead.
--
-- This function does not check if the widget is obscured in any way.
-- See 'widgetSetVisible'.
widgetGetVisible :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget is visible.
widgetGetVisible :: forall self. WidgetClass self => self -> IO Bool
widgetGetVisible widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_visible Ptr Widget
argPtr1)
{-# LINE 3047 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | Determines whether the widget and all its parents are marked as visible.
--
-- This function does not check if the widget is obscured in any way.
--
-- See also 'widgetGetVisible' and 'widgetSetVisible'
widgetIsVisible :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget and all its parents are visible.
widgetIsVisible :: forall self. WidgetClass self => self -> IO Bool
widgetIsVisible widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_visible Ptr Widget
argPtr1)
{-# LINE 3061 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | This function is for use in widget implementations. Turns on flag values
-- in the current widget state (insensitive, prelighted, etc.).
--
-- This function accepts the values 'StateFlagDirLtr' and 'StateFlagDirRtl'
-- but ignores them. If you want to set the widget's direction, use
-- 'widgetSetDirection'.
--
-- It is worth mentioning that any other state than StateFlagInsensitive',
-- will be propagated down to all non-internal children if @widget@ is a
-- 'Container', while 'StateFlagInsensitive' itself will be propagated down
-- to all 'Container' children by different means than turning on the state
-- flag down the hierarchy, both 'widgetGetStateFlags' and
-- 'widgetIsSensitive' will make use of these.
widgetSetStateFlags :: WidgetClass widget => widget
 -> [StateFlags] -- ^ @flags@ State flags to turn on
 -> Bool -- ^ @clear@ Whether to clear state before turning on @flags@
 -> IO ()
widgetSetStateFlags :: forall widget.
WidgetClass widget =>
widget -> [StateFlags] -> Bool -> IO ()
widgetSetStateFlags widget
widget [StateFlags]
flags Bool
clear =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 CInt
arg3 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> CInt -> IO ()
gtk_widget_set_state_flags Ptr Widget
argPtr1 CInt
arg2 CInt
arg3)
{-# LINE 3084 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ [StateFlags] -> Int
forall a. Flags a => [a] -> Int
fromFlags [StateFlags]
flags)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
clear)

-- | This function is for use in widget implementations. Turns off flag
-- values for the current widget state (insensitive, prelighted, etc.).
-- See 'widgetSetStateFlags'.
widgetUnsetStateFlags :: WidgetClass widget => widget
 -> [StateFlags] -- ^ @flags@ State flags to turn off
 -> IO ()
widgetUnsetStateFlags :: forall widget.
WidgetClass widget =>
widget -> [StateFlags] -> IO ()
widgetUnsetStateFlags widget
widget [StateFlags]
flags =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_unset_state_flags Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3096 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ [StateFlags] -> Int
forall a. Flags a => [a] -> Int
fromFlags [StateFlags]
flags)

-- | Returns the widget state as a flag set. It is worth mentioning that the
-- effective StateFlagInsensitive state will be returned, that is, also based
-- on parent insensitivity, even if @widget@ itself is sensitive.
widgetGetStateFlags :: WidgetClass widget => widget
 -> IO [StateFlags] -- ^ Returns the state flags for @widget@
widgetGetStateFlags :: forall widget. WidgetClass widget => widget -> IO [StateFlags]
widgetGetStateFlags widget
widget =
  (CInt -> [StateFlags]) -> IO CInt -> IO [StateFlags]
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> [StateFlags]
forall a. Flags a => Int -> [a]
toFlags (Int -> [StateFlags]) -> (CInt -> Int) -> CInt -> [StateFlags]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO [StateFlags]) -> IO CInt -> IO [StateFlags]
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_state_flags Ptr Widget
argPtr1)
{-# LINE 3107 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | Determines whether @widget@ is the current default widget within its
-- toplevel. See 'widgetSetCanDefault'.
widgetGetHasDefault :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ is the current default widget within its toplevel, @False@ otherwise.
widgetGetHasDefault :: forall self. WidgetClass self => self -> IO Bool
widgetGetHasDefault widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_default Ptr Widget
argPtr1)
{-# LINE 3118 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Determines if the @widget@ has the global input focus.
-- See 'widgetIsFocus' for the difference between having the global input
-- focus, and only having the focus within a toplevel.
widgetGetHasFocus :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ has the global input focus.
widgetGetHasFocus :: forall self. WidgetClass self => self -> IO Bool
widgetGetHasFocus widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_focus Ptr Widget
argPtr1)
{-# LINE 3128 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | Determines if the widget should show a visible indication that it has the
-- global input focus. This is a convenience function for use in ::draw
-- handlers that takes into account whether focus indication should currently
-- be shown in the toplevel window of @widget@. See 'windowGetFocusVisible'
-- for more information about focus indication.
--
-- To find out if the widget has the global input focus, use 'widgetHasFocus'.
widgetHasVisibleFocus :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget should display a “focus rectangle”
widgetHasVisibleFocus :: forall self. WidgetClass self => self -> IO Bool
widgetHasVisibleFocus widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_visible_focus Ptr Widget
argPtr1)
{-# LINE 3144 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | Determines whether the widget is currently grabbing events, so it is the
-- only widget receiving input events (keyboard and mouse).
--
-- See also 'grabAdd'.
widgetHasGrab :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if the widget is in the grab_widgets stack
widgetHasGrab :: forall self. WidgetClass self => self -> IO Bool
widgetHasGrab widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_grab Ptr Widget
argPtr1)
{-# LINE 3157 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Determines whether @widget@ can be drawn to. A widget can be drawn to if
-- it is mapped and visible.
widgetIsDrawable :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ is drawable, @False@ otherwise
widgetIsDrawable :: forall self. WidgetClass self => self -> IO Bool
widgetIsDrawable widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_drawable Ptr Widget
argPtr1)
{-# LINE 3166 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Determines whether @widget@ is a toplevel widget.
--
-- Currently only 'Window' and 'Invisible' (and out-of-process 'Plugs') are
-- toplevel widgets. Toplevel widgets have no parent widget.
widgetIsToplevel :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ is a toplevel, @False@ otherwise
widgetIsToplevel :: forall self. WidgetClass self => self -> IO Bool
widgetIsToplevel widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_is_toplevel Ptr Widget
argPtr1)
{-# LINE 3177 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)

-- | Sets a widget’s window. This function should only be used in a widget’s
-- “realize” implementation. The window passed is usually either new window
-- created with 'drawWindowNew', or the window of its parent widget as
-- returned by 'widgetGetParentWindow'.
--
-- Widgets must indicate whether they will create their own 'DrawWindow' by
-- calling 'widgetSetHasWindow'. This is usually done in the widget’s init()
-- function.
--
-- Note that this function does not add any reference to window.
widgetSetWindow :: (WidgetClass widget, DrawWindowClass window) => widget
 -> window
 -> IO ()
widgetSetWindow :: forall widget window.
(WidgetClass widget, DrawWindowClass window) =>
widget -> window -> IO ()
widgetSetWindow widget
widget window
window =
  (\(Widget ForeignPtr Widget
arg1) (DrawWindow ForeignPtr DrawWindow
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg2 ((Ptr DrawWindow -> IO ()) -> IO ())
-> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr2 ->Ptr Widget -> Ptr DrawWindow -> IO ()
gtk_widget_set_window Ptr Widget
argPtr1 Ptr DrawWindow
argPtr2)
{-# LINE 3194 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (window -> DrawWindow
forall o. DrawWindowClass o => o -> DrawWindow
toDrawWindow window
window)

-- | Specifies whether @widget@ will be treated as the default widget within
-- its toplevel when it has the focus, even if another widget is the default.
--
-- See 'widgetGrabDefault' for details about the meaning of “default”.
widgetSetReceivesDefault :: WidgetClass widget => widget
 -> Bool -- ^ @receivesDefault@ whether or not widget can be a default widget.
 -> IO ()
widgetSetReceivesDefault :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetReceivesDefault widget
widget Bool
receivesDefault =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_receives_default Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3206 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
receivesDefault)

-- | Determines whether @widget@ is always treated as the default widget
-- within its toplevel when it has the focus, even if another widget is the
-- default.
--
-- See 'widgetSetReceivesDefault'.
widgetGetReceivesDefault :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ acts as the default widget when focussed, @False@ otherwise
widgetGetReceivesDefault :: forall self. WidgetClass self => self -> IO Bool
widgetGetReceivesDefault widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_receives_default Ptr Widget
argPtr1)
{-# LINE 3219 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)



-- | Returns @True@ if device has been shadowed by a GTK+ device grab on
-- another widget, so it would stop sending events to widget. This may be
-- used in the “grab-notify” signal to check for specific devices.
-- See 'deviceGrabAdd'.
widgetDeviceIsShadowed :: (WidgetClass widget, DeviceClass device) => widget
 -> device
 -> IO Bool -- ^ Returns @True@ if there is an ongoing grab on device by another 'Widget' than widget.
widgetDeviceIsShadowed :: forall widget device.
(WidgetClass widget, DeviceClass device) =>
widget -> device -> IO Bool
widgetDeviceIsShadowed widget
widget device
device =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) (Device ForeignPtr Device
arg2) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->ForeignPtr Device -> (Ptr Device -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Device
arg2 ((Ptr Device -> IO CInt) -> IO CInt)
-> (Ptr Device -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Device
argPtr2 ->Ptr Widget -> Ptr Device -> IO CInt
gtk_widget_device_is_shadowed Ptr Widget
argPtr1 Ptr Device
argPtr2)
{-# LINE 3233 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (device -> Device
forall o. DeviceClass o => o -> Device
toDevice device
device)



-- | Returns the modifier mask the @widget@’s windowing system backend uses
-- for a particular purpose.
--
-- See 'keymapGetModifierMask'.
widgetGetModifierMask :: WidgetClass widget => widget
 -> ModifierIntent -- ^ @intent@ the use case for the modifier mask
 -> IO [Modifier] -- ^ Returns the modifier mask used for @intent@.
widgetGetModifierMask :: forall widget.
WidgetClass widget =>
widget -> ModifierIntent -> IO [Modifier]
widgetGetModifierMask widget
widget ModifierIntent
intent =
  (CInt -> [Modifier]) -> IO CInt -> IO [Modifier]
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> [Modifier]
forall a. Flags a => Int -> [a]
toFlags (Int -> [Modifier]) -> (CInt -> Int) -> CInt -> [Modifier]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO [Modifier]) -> IO CInt -> IO [Modifier]
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO CInt
gtk_widget_get_modifier_mask Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3248 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ModifierIntent -> Int) -> ModifierIntent -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModifierIntent -> Int
forall a. Enum a => a -> Int
fromEnum) ModifierIntent
intent)



-- | Enables or disables multiple pointer awareness. If this setting is
-- @True@, widget will start receiving multiple, per device enter/leave
-- events. Note that if custom 'DrawWindows' are created in “realize”,
-- 'windowSetSupportMultidevice' will have to be called manually on them.
widgetSetSupportMultidevice :: WidgetClass widget => widget
 -> Bool -- ^ @supportMultidevice@ @True@ to support input from multiple devices.
 -> IO ()
widgetSetSupportMultidevice :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetSupportMultidevice widget
widget Bool
supportMultidevice =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_support_multidevice Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3262 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
supportMultidevice)

-- | Returns @True@ if @widget@ is multiple pointer aware.
-- See 'widgetSetSupportMultidevice' for more information.
widgetGetSupportMultidevice :: WidgetClass widget => widget
 -> IO Bool -- ^ Returns @True@ if @widget@ is multidevice aware.
widgetGetSupportMultidevice :: forall self. WidgetClass self => self -> IO Bool
widgetGetSupportMultidevice widget
widget =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_support_multidevice Ptr Widget
argPtr1)
{-# LINE 3272 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)


-- | This function is for use in widget implementations. Sets the state of a
-- widget (insensitive, prelighted, etc.) Usually you should set the state
-- using wrapper functions such as 'widgetSetSensitive'.
--
widgetSetState :: WidgetClass self => self -> StateType -> IO ()
widgetSetState :: forall self. WidgetClass self => self -> StateType -> IO ()
widgetSetState self
widget StateType
state =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_state Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3282 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    ((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (StateType -> Int) -> StateType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateType -> Int
forall a. Enum a => a -> Int
fromEnum) StateType
state)

-- | Rarely-used function. This function is used to emit the event signals on a widget (those signals
-- should never be emitted without using this function to do so). If you want to synthesize an event
-- though, don't use this function; instead, use 'mainDoEvent' so the event will behave as if it
-- were in the event queue. Don't synthesize expose events; instead, use 'windowInvalidateRect'
-- to invalidate a region of the window.
widgetEvent :: WidgetClass self => self -> EventM t Bool
widgetEvent :: forall self t. WidgetClass self => self -> EventM t Bool
widgetEvent self
widget = do
  Ptr t
ptr <- ReaderT (Ptr t) IO (Ptr t)
forall r (m :: * -> *). MonadReader r m => m r
ask
  IO Bool -> EventM t Bool
forall a. IO a -> ReaderT (Ptr t) IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> EventM t Bool) -> IO Bool -> EventM t Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$ (\(Widget ForeignPtr Widget
arg1) Ptr ()
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> Ptr () -> IO CInt
gtk_widget_event Ptr Widget
argPtr1 Ptr ()
arg2) (self -> Widget
forall o. WidgetClass o => o -> Widget
toWidget self
widget) (Ptr t -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr t
ptr)

--------------------
-- Attributes

-- %hash c:6f7f d:9384
-- | The name of the widget.
--
-- Default value: @Nothing@
--
widgetName :: (WidgetClass self, GlibString string) => Attr self (Maybe string)
widgetName :: forall self string.
(WidgetClass self, GlibString string) =>
Attr self (Maybe string)
widgetName = String -> Attr self (Maybe string)
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj (Maybe string)
newAttrFromMaybeStringProperty String
"name"

widgetMarginLeft :: WidgetClass self => Attr self Int
widgetMarginLeft :: forall self. WidgetClass self => Attr self Int
widgetMarginLeft = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-left"

widgetMarginRight :: WidgetClass self => Attr self Int
widgetMarginRight :: forall self. WidgetClass self => Attr self Int
widgetMarginRight = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-right"


widgetMarginStart :: WidgetClass self => Attr self Int
widgetMarginStart :: forall self. WidgetClass self => Attr self Int
widgetMarginStart = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-start"

widgetMarginEnd :: WidgetClass self => Attr self Int
widgetMarginEnd :: forall self. WidgetClass self => Attr self Int
widgetMarginEnd = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-end"


widgetMarginTop :: WidgetClass self => Attr self Int
widgetMarginTop :: forall self. WidgetClass self => Attr self Int
widgetMarginTop = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-top"

widgetMarginBottom :: WidgetClass self => Attr self Int
widgetMarginBottom :: forall self. WidgetClass self => Attr self Int
widgetMarginBottom = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"margin-bottom"

-- %hash c:1533 d:3213
-- | The parent widget of this widget. Must be a Container widget.
--
widgetParent :: (WidgetClass self, ContainerClass container) => ReadWriteAttr self (Maybe Container) (Maybe container)
widgetParent :: forall self container.
(WidgetClass self, ContainerClass container) =>
ReadWriteAttr self (Maybe Container) (Maybe container)
widgetParent = String
-> CUInt -> ReadWriteAttr self (Maybe Container) (Maybe container)
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> CUInt -> ReadWriteAttr gobj (Maybe gobj') (Maybe gobj'')
newAttrFromMaybeObjectProperty String
"parent" CUInt
gTypeContainer

-- %hash c:2b4c d:3c31
-- | Override for width request of the widget, or -1 if natural request should
-- be used.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
widgetWidthRequest :: WidgetClass self => Attr self Int
widgetWidthRequest :: forall self. WidgetClass self => Attr self Int
widgetWidthRequest = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"width-request"

-- %hash c:fa97 d:172a
-- | Override for height request of the widget, or -1 if natural request
-- should be used.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
widgetHeightRequest :: WidgetClass self => Attr self Int
widgetHeightRequest :: forall self. WidgetClass self => Attr self Int
widgetHeightRequest = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"height-request"

-- %hash c:70d0 d:e8e2
-- | Whether the widget is visible.
--
-- Default value: @False@
--
widgetVisible :: WidgetClass self => Attr self Bool
widgetVisible :: forall self. WidgetClass self => Attr self Bool
widgetVisible = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"visible"

-- | The opacity of the widget
--
-- Default value: @1.0@
--
widgetOpacity :: WidgetClass self => Attr self Double
widgetOpacity :: forall self. WidgetClass self => Attr self Double
widgetOpacity = String -> Attr self Double
forall gobj. GObjectClass gobj => String -> Attr gobj Double
newAttrFromDoubleProperty String
"opacity"

-- %hash c:4dd4 d:594e
-- | Whether the widget responds to input.
--
-- Default value: @True@
--
widgetSensitive :: WidgetClass self => Attr self Bool
widgetSensitive :: forall self. WidgetClass self => Attr self Bool
widgetSensitive = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"sensitive"

-- %hash c:7506 d:1dde
-- | Whether the application will paint directly on the widget.
--
-- Default value: @False@
--
widgetAppPaintable :: WidgetClass self => Attr self Bool
widgetAppPaintable :: forall self. WidgetClass self => Attr self Bool
widgetAppPaintable = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"app-paintable"

-- %hash c:6289 d:72ab
-- | Whether the widget can accept the input focus.
--
-- Default value: @False@
--
widgetCanFocus :: WidgetClass self => Attr self Bool
widgetCanFocus :: forall self. WidgetClass self => Attr self Bool
widgetCanFocus = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"can-focus"

-- %hash c:8e7 d:2645
-- | Whether the widget has the input focus.
--
-- Default value: @False@
--
widgetHasFocus :: WidgetClass self => Attr self Bool
widgetHasFocus :: forall self. WidgetClass self => Attr self Bool
widgetHasFocus = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"has-focus"

-- %hash c:7547 d:1d78
-- | Whether the widget is the focus widget within the toplevel.
--
-- Default value: @False@
--
widgetIsFocus :: WidgetClass self => Attr self Bool
widgetIsFocus :: forall self. WidgetClass self => Attr self Bool
widgetIsFocus = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"is-focus"

-- %hash c:f2d8 d:1cbb
-- | Whether the widget can be the default widget.
--
-- Default value: @False@
--
widgetCanDefault :: WidgetClass self => Attr self Bool
widgetCanDefault :: forall self. WidgetClass self => Attr self Bool
widgetCanDefault = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"can-default"

-- %hash c:836 d:4cbe
-- | Whether the widget is the default widget.
--
-- Default value: @False@
--
widgetHasDefault :: WidgetClass self => Attr self Bool
widgetHasDefault :: forall self. WidgetClass self => Attr self Bool
widgetHasDefault = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"has-default"

-- %hash c:f964 d:b62f
-- | If @True@, the widget will receive the default action when it is focused.
--
-- Default value: @False@
--
widgetReceivesDefault :: WidgetClass self => Attr self Bool
widgetReceivesDefault :: forall self. WidgetClass self => Attr self Bool
widgetReceivesDefault = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"receives-default"

-- %hash c:2ca6 d:cad8
-- | Whether the widget is part of a composite widget.
--
-- Default value: @False@
--
widgetCompositeChild :: WidgetClass self => ReadAttr self Bool
widgetCompositeChild :: forall self. WidgetClass self => ReadAttr self Bool
widgetCompositeChild = String -> ReadAttr self Bool
forall gobj. GObjectClass gobj => String -> ReadAttr gobj Bool
readAttrFromBoolProperty String
"composite-child"

-- %hash c:4f01 d:bd3
-- | The style of the widget, which contains information about how it will
-- look (colors etc).
--
widgetStyle :: WidgetClass self => Attr self Style
widgetStyle :: forall self. WidgetClass self => Attr self Style
widgetStyle = String -> CUInt -> ReadWriteAttr self Style Style
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> CUInt -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"style" CUInt
gTypeStyle

-- | The current visual user interaction state of the widget (insensitive,
-- prelighted, selected etc). See 'StateType' for more information.
--
widgetState :: WidgetClass self => Attr self StateType
widgetState :: forall self. WidgetClass self => Attr self StateType
widgetState = (self -> IO StateType)
-> (self -> StateType -> IO ())
-> ReadWriteAttr self StateType StateType
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO StateType
forall self. WidgetClass self => self -> IO StateType
widgetGetState
  self -> StateType -> IO ()
forall self. WidgetClass self => self -> StateType -> IO ()
widgetSetState

-- %hash c:e2a4 d:9296
-- | The event mask that decides what kind of GdkEvents this widget gets.
--
-- Default value: 'StructureMask'
--
widgetEvents :: WidgetClass self => Attr self [EventMask]
widgetEvents :: forall self. WidgetClass self => Attr self [EventMask]
widgetEvents = String -> CUInt -> Attr self [EventMask]
forall gobj flag.
(GObjectClass gobj, Flags flag) =>
String -> CUInt -> Attr gobj [flag]
newAttrFromFlagsProperty String
"events"
                 CUInt
gdk_event_mask_get_type
{-# LINE 3478 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- | Whether to expand in both directions. Setting this sets both 'widgetHExpand' and 'widgetVExpand'
--
-- Default value: @False@
--
widgetExpand :: WidgetClass self => Attr self Bool
widgetExpand :: forall self. WidgetClass self => Attr self Bool
widgetExpand = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"expand"

-- | Whether to expand horizontally. See 'widgetSetHExpand'
--
-- Default value: @False@
--
widgetHExpand :: WidgetClass self => Attr self Bool
widgetHExpand :: forall self. WidgetClass self => Attr self Bool
widgetHExpand = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"hexpand"

-- | Whether to use the “hexpand” property. See 'widgetGetHExpandSet'.
--
-- Default value: @False@
--
widgetHExpandSet :: WidgetClass self => Attr self Bool
widgetHExpandSet :: forall self. WidgetClass self => Attr self Bool
widgetHExpandSet = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"hexpand-set"

-- | Whether to expand vertically. See 'widgetSetVExpand'.
--
-- Default value: @False@
--
widgetVExpand :: WidgetClass self => Attr self Bool
widgetVExpand :: forall self. WidgetClass self => Attr self Bool
widgetVExpand = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"vexpand"

-- | Whether to use the “vexpand” property. See 'widgetGetVExpandSet'.
--
-- Default value: @False@
--
widgetVExpandSet :: WidgetClass self => Attr self Bool
widgetVExpandSet :: forall self. WidgetClass self => Attr self Bool
widgetVExpandSet = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"vexpand-set"

-- %hash c:1605 d:48ea
-- | Whether 'widgetShowAll' should not affect this widget.
--
-- Default value: @False@
--
widgetNoShowAll :: WidgetClass self => Attr self Bool
widgetNoShowAll :: forall self. WidgetClass self => Attr self Bool
widgetNoShowAll = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"no-show-all"

-- %hash c:cd8d d:59b2
-- | \'childVisible\' property. See 'widgetGetChildVisible' and
-- 'widgetSetChildVisible'
--
widgetChildVisible :: WidgetClass self => Attr self Bool
widgetChildVisible :: forall self. WidgetClass self => Attr self Bool
widgetChildVisible = (self -> IO Bool)
-> (self -> Bool -> IO ()) -> ReadWriteAttr self Bool Bool
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO Bool
forall self. WidgetClass self => self -> IO Bool
widgetGetChildVisible
  self -> Bool -> IO ()
forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetChildVisible
{-# LINE 3541 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
-- %hash c:a7fd d:55b8
-- | \'compositeName\' property. See 'widgetGetCompositeName' and
-- 'widgetSetCompositeName'
--
widgetCompositeName :: (WidgetClass self, GlibString string) => ReadWriteAttr self (Maybe string) string
widgetCompositeName :: forall self string.
(WidgetClass self, GlibString string) =>
ReadWriteAttr self (Maybe string) string
widgetCompositeName = (self -> IO (Maybe string))
-> (self -> string -> IO ())
-> ReadWriteAttr self (Maybe string) string
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO (Maybe string)
forall self string.
(WidgetClass self, GlibString string) =>
self -> IO (Maybe string)
widgetGetCompositeName
  self -> string -> IO ()
forall self string.
(WidgetClass self, GlibString string) =>
self -> string -> IO ()
widgetSetCompositeName

-- %hash c:6c03 d:ce3b
-- | \'direction\' property. See 'widgetGetDirection' and 'widgetSetDirection'
--
widgetDirection :: WidgetClass self => Attr self TextDirection
widgetDirection :: forall self. WidgetClass self => Attr self TextDirection
widgetDirection = (self -> IO TextDirection)
-> (self -> TextDirection -> IO ())
-> ReadWriteAttr self TextDirection TextDirection
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO TextDirection
forall self. WidgetClass self => self -> IO TextDirection
widgetGetDirection
  self -> TextDirection -> IO ()
forall self. WidgetClass self => self -> TextDirection -> IO ()
widgetSetDirection

-- | Sets the text of tooltip to be the given string, which is marked up with the Pango text markup
-- language. Also see 'tooltipSetMarkup'.
--
-- This is a convenience property which will take care of getting the tooltip shown if the given string
-- is not \"\": 'hasTooltip' will automatically be set to 'True' and there will be taken care of
-- 'queryTooltip' in the default signal handler.
--
-- Default value: \"\"
--
-- * Available since Gtk+ version 2.12
--
widgetTooltipMarkup :: (WidgetClass self, GlibString markup) => Attr self (Maybe markup)
widgetTooltipMarkup :: forall self string.
(WidgetClass self, GlibString string) =>
Attr self (Maybe string)
widgetTooltipMarkup = String -> Attr self (Maybe markup)
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj (Maybe string)
newAttrFromMaybeStringProperty String
"tooltip-markup"

-- | Sets the text of tooltip to be the given string.
--
-- Also see 'tooltipSetText'.
--
-- This is a convenience property which will take care of getting the tooltip shown if the given string
-- is not \"\": 'hasTooltip' will automatically be set to 'True' and there will be taken care of
-- 'queryTooltip' in the default signal handler.
--
-- Default value: \"\"
--
-- * Available since Gtk+ version 2.12
--
widgetTooltipText :: (WidgetClass self, GlibString string) => Attr self (Maybe string)
widgetTooltipText :: forall self string.
(WidgetClass self, GlibString string) =>
Attr self (Maybe string)
widgetTooltipText = String -> Attr self (Maybe string)
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj (Maybe string)
newAttrFromMaybeStringProperty String
"tooltip-text"

-- | Enables or disables the emission of 'queryTooltip' on widget. A value of 'True' indicates that widget
-- can have a tooltip, in this case the widget will be queried using 'queryTooltip' to determine
-- whether it will provide a tooltip or not.
--
-- Note that setting this property to 'True' for the first time will change the event masks of the
-- 'Windows' of this widget to include leave-notify and motion-notify events. This cannot and will not
-- be undone when the property is set to 'False' again.
--
-- Default value: 'False'
--
-- * Available since Gtk+ version 2.12
--
widgetHasTooltip :: WidgetClass self => Attr self Bool
widgetHasTooltip :: forall self. WidgetClass self => Attr self Bool
widgetHasTooltip = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"has-tooltip"


-- | Determines if the widget style has been looked up through the rc mechanism.
widgetHasRcStyle :: WidgetClass self => self
                 -> IO Bool -- ^ returns 'True' if the widget has been looked up through the rc mechanism, 'False' otherwise.
widgetHasRcStyle :: forall self. WidgetClass self => self -> IO Bool
widgetHasRcStyle self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_has_rc_style Ptr Widget
argPtr1)
{-# LINE 3609 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Determines whether widget is realized.
widgetGetRealized :: WidgetClass self => self
                  -> IO Bool -- ^ returns 'True' if widget is realized, 'False' otherwise
widgetGetRealized :: forall self. WidgetClass self => self -> IO Bool
widgetGetRealized self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_realized Ptr Widget
argPtr1)
{-# LINE 3617 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Whether the widget is mapped.
widgetGetMapped :: WidgetClass self => self
                -> IO Bool -- ^ returns 'True' if the widget is mapped, 'False' otherwise.
widgetGetMapped :: forall self. WidgetClass self => self -> IO Bool
widgetGetMapped self
self =
  (CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_mapped Ptr Widget
argPtr1)
{-# LINE 3625 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Marks the @widget@ as being realized. This function must only be called
-- after all 'DrawWindows' for the widget have been created and registered.
--
-- This function should only ever be called in a derived widget's “realize”
-- or “unrealize” implementation.
widgetSetRealized :: WidgetClass widget => widget
 -> Bool -- ^ @realized@ @True@ to mark the widget realized.
 -> IO ()
widgetSetRealized :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetRealized widget
widget Bool
realized =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_realized Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3637 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
realized)

-- | Marks the @widget@ as being realized.
--
-- This function should only ever be called in a derived widget's “map” or
-- “unmap” implementation.
widgetSetMapped :: WidgetClass widget => widget
 -> Bool -- ^ @mapped@ @True@ to mark the widget as mapped.
 -> IO ()
widgetSetMapped :: forall self. WidgetClass self => self -> Bool -> IO ()
widgetSetMapped widget
widget Bool
mapped =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_mapped Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3649 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget widget)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
mapped)



-- | Returns the style context associated to @widget@.
widgetGetStyleContext :: WidgetClass widget
                      => widget -- ^ @widget@ : a @Widget@
                      -> IO StyleContext -- ^ a @StyleContext@
widgetGetStyleContext :: forall widget. WidgetClass widget => widget -> IO StyleContext
widgetGetStyleContext widget
widget =
  (ForeignPtr StyleContext -> StyleContext,
 FinalizerPtr StyleContext)
-> IO (Ptr StyleContext) -> IO StyleContext
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr StyleContext -> StyleContext,
 FinalizerPtr StyleContext)
forall {a}.
(ForeignPtr StyleContext -> StyleContext, FinalizerPtr a)
mkStyleContext (IO (Ptr StyleContext) -> IO StyleContext)
-> IO (Ptr StyleContext) -> IO StyleContext
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr StyleContext)) -> IO (Ptr StyleContext)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr StyleContext)) -> IO (Ptr StyleContext))
-> (Ptr Widget -> IO (Ptr StyleContext)) -> IO (Ptr StyleContext)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr StyleContext)
gtk_widget_get_style_context Ptr Widget
argPtr1)
{-# LINE 3661 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
  (toWidget widget)

-- | Gets the value of the `widgetHAlign` property.
--
-- For backwards compatibility reasons this method will never return AlignBaseline,
-- but instead it will convert it to AlignFill. Baselines are not supported for
-- horizontal alignment.
--
widgetGetHAlign :: WidgetClass self => self -> IO Align
widgetGetHAlign :: forall self. WidgetClass self => self -> IO Align
widgetGetHAlign self
self =
  (CInt -> Align) -> IO CInt -> IO Align
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> Align
forall a. Enum a => Int -> a
toEnum (Int -> Align) -> (CInt -> Int) -> CInt -> Align
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO Align) -> IO CInt -> IO Align
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_halign Ptr Widget
argPtr1)
{-# LINE 3673 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)

-- | Sets the horizontal alignment of widget. See the 'widgetHAlign' property.
--
widgetSetHAlign :: WidgetClass self => self -> Align -> IO ()
widgetSetHAlign :: forall self. WidgetClass self => self -> Align -> IO ()
widgetSetHAlign self
self Align
align =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_halign Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3680 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ Align -> Int
forall a. Enum a => a -> Int
fromEnum Align
align)

-- | Gets the value of the 'widgetVAlign' property.
--
-- For backwards compatibility reasons this method will never return AlignBaseline,
-- but instead it will convert it to AlignFill. If your widget want to support
-- baseline aligned children it must use 'widgetGetVAlignWithBaseline', or
-- 'widgetVAlign', which will also report the true value.
widgetGetVAlign :: WidgetClass self => self -> IO Align
widgetGetVAlign :: forall self. WidgetClass self => self -> IO Align
widgetGetVAlign self
self =
  (CInt -> Align) -> IO CInt -> IO Align
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> Align
forall a. Enum a => Int -> a
toEnum (Int -> Align) -> (CInt -> Int) -> CInt -> Align
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO Align) -> IO CInt -> IO Align
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_valign Ptr Widget
argPtr1)
{-# LINE 3693 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- | Gets the value of the 'widgetVAlign' property, including AlignBaseline.
widgetGetVAlignWithBaseline :: WidgetClass self => self -> IO Align
widgetGetVAlignWithBaseline :: forall self. WidgetClass self => self -> IO Align
widgetGetVAlignWithBaseline self
self =
  (CInt -> Align) -> IO CInt -> IO Align
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> Align
forall a. Enum a => Int -> a
toEnum (Int -> Align) -> (CInt -> Int) -> CInt -> Align
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO Align) -> IO CInt -> IO Align
forall a b. (a -> b) -> a -> b
$
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO CInt
gtk_widget_get_valign_with_baseline Ptr Widget
argPtr1)
{-# LINE 3701 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)


-- | Sets the vertical alignment of widget . See the 'widgetVAlign' property.
widgetSetVAlign :: WidgetClass self => self -> Align -> IO ()
widgetSetVAlign :: forall self. WidgetClass self => self -> Align -> IO ()
widgetSetVAlign self
self Align
align =
  (\(Widget ForeignPtr Widget
arg1) CInt
arg2 -> ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> CInt -> IO ()
gtk_widget_set_valign Ptr Widget
argPtr1 CInt
arg2)
{-# LINE 3708 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}
    (toWidget self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ Align -> Int
forall a. Enum a => a -> Int
fromEnum Align
align)


--------------------
-- Signals


-- %hash c:4cf5 d:af3f
-- | The widget appears on screen.
--
mapSignal :: WidgetClass self => Signal self (IO ())
mapSignal :: forall self. WidgetClass self => Signal self (IO ())
mapSignal = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"map")

-- %hash c:e33e d:af3f
-- | The widget disappears from the screen.
--
unmapSignal :: WidgetClass self => Signal self (IO ())
unmapSignal :: forall self. WidgetClass self => Signal self (IO ())
unmapSignal = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"unmap")

-- %hash c:1f7f d:af3f
-- | The widget should allocate any resources needed, in particular, the
-- widget's 'DrawWindow' is created. If you connect to this signal and
-- you rely on some of these resources to be present, you have to use
-- 'System.Glib.Signals.after'.
--
realize :: WidgetClass self => Signal self (IO ())
realize :: forall self. WidgetClass self => Signal self (IO ())
realize = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"realize")

-- %hash c:7948 d:af3f
-- | The widget should deallocate any resources. This signal is emitted before
-- the widget is destroyed.
--
unrealize :: WidgetClass self => Signal self (IO ())
unrealize :: forall self. WidgetClass self => Signal self (IO ())
unrealize = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"unrealize")

-- %hash c:9f6f d:af3f
-- | Query the widget for the size it likes to
-- have.
--
-- * A parent container emits this signal to its child to query the needed
-- height and width of the child. There is not guarantee that the widget
-- will actually get this area.
--
sizeRequest :: WidgetClass self => Signal self (IO Requisition)
sizeRequest :: forall self. WidgetClass self => Signal self (IO Requisition)
sizeRequest = (Bool -> self -> IO Requisition -> IO (ConnectId self))
-> Signal self (IO Requisition)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (\Bool
after self
w IO Requisition
fun ->
  String
-> Bool
-> self
-> (Ptr Requisition -> IO ())
-> IO (ConnectId self)
forall obj a.
GObjectClass obj =>
String -> Bool -> obj -> (Ptr a -> IO ()) -> IO (ConnectId obj)
connect_PTR__NONE String
"size-request" Bool
after self
w
    (\Ptr Requisition
rqPtr -> IO Requisition
fun IO Requisition -> (Requisition -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Requisition
req -> Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Ptr Requisition
rqPtrPtr Requisition -> Ptr Requisition -> Bool
forall a. Eq a => a -> a -> Bool
==Ptr Requisition
forall a. Ptr a
nullPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Requisition -> Requisition -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Requisition
rqPtr Requisition
req))

-- %hash c:8ec5 d:af3f
-- | Inform widget about the size it has.
--
-- * After querying a widget for the size it wants to have (through emitting
-- the @\"sizeRequest\"@ signal) a container will emit this signal to
-- inform the widget about the real size it should occupy.
--
sizeAllocate :: WidgetClass self => Signal self (Allocation -> IO ())
sizeAllocate :: forall self. WidgetClass self => Signal self (Allocation -> IO ())
sizeAllocate = (Bool -> self -> (Allocation -> IO ()) -> IO (ConnectId self))
-> Signal self (Allocation -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> (Ptr Allocation -> IO Allocation)
-> Bool
-> self
-> (Allocation -> IO ())
-> IO (ConnectId self)
forall obj a' a.
GObjectClass obj =>
String
-> (Ptr a' -> IO a)
-> Bool
-> obj
-> (a -> IO ())
-> IO (ConnectId obj)
connect_BOXED__NONE String
"size-allocate" Ptr Allocation -> IO Allocation
forall a. Storable a => Ptr a -> IO a
peek)

-- %hash c:ae3e d:af3f
-- | The widget is shown.
--
showSignal :: WidgetClass self => Signal self (IO ())
showSignal :: forall self. WidgetClass self => Signal self (IO ())
showSignal = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"show")

-- %hash c:f589 d:af3f
-- | The widget is hidden.
--
hideSignal :: WidgetClass self => Signal self (IO ())
hideSignal :: forall self. WidgetClass self => Signal self (IO ())
hideSignal = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"hide")

-- %hash c:a285 d:af3f
-- | The widget gains focus via the given user action.
--
focus :: WidgetClass self => Signal self (DirectionType -> IO Bool)
focus :: forall self.
WidgetClass self =>
Signal self (DirectionType -> IO Bool)
focus = (Bool -> self -> (DirectionType -> IO Bool) -> IO (ConnectId self))
-> Signal self (DirectionType -> IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool
-> self
-> (DirectionType -> IO Bool)
-> IO (ConnectId self)
forall a obj.
(Enum a, GObjectClass obj) =>
String -> Bool -> obj -> (a -> IO Bool) -> IO (ConnectId obj)
connect_ENUM__BOOL String
"focus")

-- %hash c:78ae d:af3f
-- | The state of the widget (input focus, insensitive, etc.) has changed.
--
stateChanged :: WidgetClass self => Signal self (StateType -> IO ())
stateChanged :: forall self. WidgetClass self => Signal self (StateType -> IO ())
stateChanged = (Bool -> self -> (StateType -> IO ()) -> IO (ConnectId self))
-> Signal self (StateType -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool -> self -> (StateType -> IO ()) -> IO (ConnectId self)
forall a obj.
(Enum a, GObjectClass obj) =>
String -> Bool -> obj -> (a -> IO ()) -> IO (ConnectId obj)
connect_ENUM__NONE String
"state-changed")


connect_FLAGS__NONE ::
  (Flags a, GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  ([a] -> IO ()) ->
  IO (ConnectId obj)
connect_FLAGS__NONE :: forall a obj.
(Flags a, GObjectClass obj) =>
String -> Bool -> obj -> ([a] -> IO ()) -> IO (ConnectId obj)
connect_FLAGS__NONE String
signal Bool
after obj
obj [a] -> IO ()
user =
  String
-> Bool
-> obj
-> (Ptr GObject -> Int -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
String -> Bool -> obj -> handler -> IO (ConnectId obj)
connectGeneric String
signal Bool
after obj
obj Ptr GObject -> Int -> IO ()
action
  where action :: Ptr GObject -> Int -> IO ()
        action :: Ptr GObject -> Int -> IO ()
action Ptr GObject
_ Int
flags1 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          [a] -> IO ()
user (Int -> [a]
forall a. Flags a => Int -> [a]
toFlags Int
flags1)

-- | The state of the widget (input focus, insensitive, etc.) has changed.
--
stateFlagsChanged :: WidgetClass self => Signal self ([StateFlags] -> IO ())
stateFlagsChanged :: forall self.
WidgetClass self =>
Signal self ([StateFlags] -> IO ())
stateFlagsChanged = (Bool -> self -> ([StateFlags] -> IO ()) -> IO (ConnectId self))
-> Signal self ([StateFlags] -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool -> self -> ([StateFlags] -> IO ()) -> IO (ConnectId self)
forall a obj.
(Flags a, GObjectClass obj) =>
String -> Bool -> obj -> ([a] -> IO ()) -> IO (ConnectId obj)
connect_FLAGS__NONE String
"state-flags-changed")


-- %hash c:bef2 d:1d66
-- | The 'parentSet' signal is emitted when a new parent has been set on a
-- widget. The parameter is the new parent.
--
parentSet :: WidgetClass self => Signal self (Maybe Widget -> IO ())
parentSet :: forall self.
WidgetClass self =>
Signal self (Maybe Widget -> IO ())
parentSet = (Bool -> self -> (Maybe Widget -> IO ()) -> IO (ConnectId self))
-> Signal self (Maybe Widget -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool -> self -> (Maybe Widget -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GObjectClass a', GObjectClass obj) =>
String -> Bool -> obj -> (Maybe a' -> IO ()) -> IO (ConnectId obj)
connect_MOBJECT__NONE String
"parent-set")

-- %hash c:7e2b d:4049
-- | Emitted when there is a change in the hierarchy to which a widget belong.
-- More precisely, a widget is anchored when its toplevel ancestor is a
-- 'Window'. This signal is emitted when a widget changes from un-anchored to
-- anchored or vice-versa.
--
hierarchyChanged :: WidgetClass self => Signal self (Maybe Widget -> IO ())
hierarchyChanged :: forall self.
WidgetClass self =>
Signal self (Maybe Widget -> IO ())
hierarchyChanged = (Bool -> self -> (Maybe Widget -> IO ()) -> IO (ConnectId self))
-> Signal self (Maybe Widget -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool -> self -> (Maybe Widget -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GObjectClass a', GObjectClass obj) =>
String -> Bool -> obj -> (Maybe a' -> IO ()) -> IO (ConnectId obj)
connect_MOBJECT__NONE String
"hierarchy-changed")

-- %hash c:5894 d:ba10
-- | The 'styleSet' signal is emitted when a new style has been set on a
-- widget. Note that style-modifying functions like 'widgetModifyBase' also
-- cause this signal to be emitted.
--
styleSet :: WidgetClass self => Signal self (Style -> IO ())
styleSet :: forall self. WidgetClass self => Signal self (Style -> IO ())
styleSet = (Bool -> self -> (Style -> IO ()) -> IO (ConnectId self))
-> Signal self (Style -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> (Style -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GObjectClass a', GObjectClass obj) =>
String -> Bool -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
connect_OBJECT__NONE String
"style-set")

-- %hash c:6bb1 d:af3f
-- | The default direction of text writing has changed.
--
directionChanged :: WidgetClass self => Signal self (TextDirection -> IO ())
directionChanged :: forall self.
WidgetClass self =>
Signal self (TextDirection -> IO ())
directionChanged = (Bool -> self -> (TextDirection -> IO ()) -> IO (ConnectId self))
-> Signal self (TextDirection -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool -> self -> (TextDirection -> IO ()) -> IO (ConnectId self)
forall a obj.
(Enum a, GObjectClass obj) =>
String -> Bool -> obj -> (a -> IO ()) -> IO (ConnectId obj)
connect_ENUM__NONE String
"direction-changed")

-- %hash c:c28c d:d116
-- | The 'grabNotify' signal is emitted when a widget becomes shadowed by a
-- Gtk+ grab (not a pointer or keyboard grab) on another widget, or when it
-- becomes unshadowed due to a grab being removed.
--
-- A widget is shadowed by a 'grabAdd' when the topmost grab widget in the
-- grab stack of its window group is not its ancestor.
--
grabNotify :: WidgetClass self => Signal self (Bool -> IO ())
grabNotify :: forall self. WidgetClass self => Signal self (Bool -> IO ())
grabNotify = (Bool -> self -> (Bool -> IO ()) -> IO (ConnectId self))
-> Signal self (Bool -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> (Bool -> IO ()) -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> (Bool -> IO ()) -> IO (ConnectId obj)
connect_BOOL__NONE String
"grab-notify")

-- %hash c:e06c d:a681
-- | This signal gets emitted whenever a widget should pop up a
-- context-sensitive menu. This usually happens through the standard key
-- binding mechanism; by pressing a certain key while a widget is focused, the
-- user can cause the widget to pop up a menu. For example, the 'Entry' widget
-- creates a menu with clipboard commands.
--
popupMenuSignal :: WidgetClass self => Signal self (IO Bool)
popupMenuSignal :: forall self. WidgetClass self => Signal self (IO Bool)
popupMenuSignal = (Bool -> self -> IO Bool -> IO (ConnectId self))
-> Signal self (IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO Bool -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO Bool -> IO (ConnectId obj)
connect_NONE__BOOL String
"popup-menu")

-- | Specify what kind of help the user wants.
data WidgetHelpType = WidgetHelpTooltip
                    | WidgetHelpWhatsThis
                    deriving (Int -> WidgetHelpType
WidgetHelpType -> Int
WidgetHelpType -> [WidgetHelpType]
WidgetHelpType -> WidgetHelpType
WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
WidgetHelpType
-> WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
(WidgetHelpType -> WidgetHelpType)
-> (WidgetHelpType -> WidgetHelpType)
-> (Int -> WidgetHelpType)
-> (WidgetHelpType -> Int)
-> (WidgetHelpType -> [WidgetHelpType])
-> (WidgetHelpType -> WidgetHelpType -> [WidgetHelpType])
-> (WidgetHelpType -> WidgetHelpType -> [WidgetHelpType])
-> (WidgetHelpType
    -> WidgetHelpType -> WidgetHelpType -> [WidgetHelpType])
-> Enum WidgetHelpType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: WidgetHelpType -> WidgetHelpType
succ :: WidgetHelpType -> WidgetHelpType
$cpred :: WidgetHelpType -> WidgetHelpType
pred :: WidgetHelpType -> WidgetHelpType
$ctoEnum :: Int -> WidgetHelpType
toEnum :: Int -> WidgetHelpType
$cfromEnum :: WidgetHelpType -> Int
fromEnum :: WidgetHelpType -> Int
$cenumFrom :: WidgetHelpType -> [WidgetHelpType]
enumFrom :: WidgetHelpType -> [WidgetHelpType]
$cenumFromThen :: WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
enumFromThen :: WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
$cenumFromTo :: WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
enumFromTo :: WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
$cenumFromThenTo :: WidgetHelpType
-> WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
enumFromThenTo :: WidgetHelpType
-> WidgetHelpType -> WidgetHelpType -> [WidgetHelpType]
Enum,WidgetHelpType -> WidgetHelpType -> Bool
(WidgetHelpType -> WidgetHelpType -> Bool)
-> (WidgetHelpType -> WidgetHelpType -> Bool) -> Eq WidgetHelpType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WidgetHelpType -> WidgetHelpType -> Bool
== :: WidgetHelpType -> WidgetHelpType -> Bool
$c/= :: WidgetHelpType -> WidgetHelpType -> Bool
/= :: WidgetHelpType -> WidgetHelpType -> Bool
Eq,Int -> WidgetHelpType -> ShowS
[WidgetHelpType] -> ShowS
WidgetHelpType -> String
(Int -> WidgetHelpType -> ShowS)
-> (WidgetHelpType -> String)
-> ([WidgetHelpType] -> ShowS)
-> Show WidgetHelpType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WidgetHelpType -> ShowS
showsPrec :: Int -> WidgetHelpType -> ShowS
$cshow :: WidgetHelpType -> String
show :: WidgetHelpType -> String
$cshowList :: [WidgetHelpType] -> ShowS
showList :: [WidgetHelpType] -> ShowS
Show)

{-# LINE 3863 "./Graphics/UI/Gtk/Abstract/Widget.chs" #-}

-- %hash c:b18e d:af3f
-- | Tell the widget to show an explanatory help text. Should return @True@
-- if help has been shown.
--
showHelp :: WidgetClass self => Signal self (WidgetHelpType -> IO Bool)
showHelp :: forall self.
WidgetClass self =>
Signal self (WidgetHelpType -> IO Bool)
showHelp = (Bool
 -> self -> (WidgetHelpType -> IO Bool) -> IO (ConnectId self))
-> Signal self (WidgetHelpType -> IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool
-> self
-> (WidgetHelpType -> IO Bool)
-> IO (ConnectId self)
forall a obj.
(Enum a, GObjectClass obj) =>
String -> Bool -> obj -> (a -> IO Bool) -> IO (ConnectId obj)
connect_ENUM__BOOL String
"show-help")

-- %hash c:6a8f d:af3f
-- | The set of keyboard accelerators has changed.
--
accelClosuresChanged :: WidgetClass self => Signal self (IO ())
accelClosuresChanged :: forall self. WidgetClass self => Signal self (IO ())
accelClosuresChanged = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"accel-closures-changed")

-- %hash c:5ca d:af3f
-- | The widget moved to a new screen.
--
screenChanged :: WidgetClass self => Signal self (Screen -> IO ())
screenChanged :: forall self. WidgetClass self => Signal self (Screen -> IO ())
screenChanged = (Bool -> self -> (Screen -> IO ()) -> IO (ConnectId self))
-> Signal self (Screen -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> (Screen -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GObjectClass a', GObjectClass obj) =>
String -> Bool -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
connect_OBJECT__NONE String
"screen-changed")

-- | Emitted when 'hasTooltip' is 'True' and the 'gtkTooltipTimeout' has expired with the cursor
-- hovering "above" widget; or emitted when widget got focus in keyboard mode.
--
-- Using the given coordinates, the signal handler should determine whether a tooltip should be shown
-- for widget. If this is the case 'True' should be returned, 'False' otherwise.
-- Note if widget got focus in keyboard mode, 'Point' is 'Nothing'.
--
-- The signal handler is free to manipulate tooltip with the therefore destined function calls.
--
-- * Available since Gtk+ version 2.12
--
queryTooltip :: WidgetClass self => Signal self (Widget -> Maybe Point -> Tooltip -> IO Bool)
queryTooltip :: forall self.
WidgetClass self =>
Signal self (Widget -> Maybe (Int, Int) -> Tooltip -> IO Bool)
queryTooltip =
  (Bool
 -> self
 -> (Widget -> Maybe (Int, Int) -> Tooltip -> IO Bool)
 -> IO (ConnectId self))
-> Signal self (Widget -> Maybe (Int, Int) -> Tooltip -> IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (\Bool
after self
model Widget -> Maybe (Int, Int) -> Tooltip -> IO Bool
user ->
           String
-> Bool
-> self
-> (Widget -> Int -> Int -> Bool -> Tooltip -> IO Bool)
-> IO (ConnectId self)
forall a' e' obj.
(GObjectClass a', GObjectClass e', GObjectClass obj) =>
String
-> Bool
-> obj
-> (a' -> Int -> Int -> Bool -> e' -> IO Bool)
-> IO (ConnectId obj)
connect_OBJECT_INT_INT_BOOL_OBJECT__BOOL String
"query-tooltip"
             Bool
after self
model (\Widget
widget Int
x Int
y Bool
keyb Tooltip
tooltip ->
                              Widget -> Maybe (Int, Int) -> Tooltip -> IO Bool
user Widget
widget (if Bool
keyb then Maybe (Int, Int)
forall a. Maybe a
Nothing else (Int, Int) -> Maybe (Int, Int)
forall a. a -> Maybe a
Just (Int
x, Int
y)) Tooltip
tooltip))


draw :: WidgetClass self => Signal self (Render ())
draw :: forall self. WidgetClass self => Signal self (Render ())
draw =
  (Bool -> self -> Render () -> IO (ConnectId self))
-> Signal self (Render ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (\Bool
after self
model (Render ReaderT Cairo IO ()
user) ->
           String
-> Bool -> self -> (Ptr Cairo -> IO ()) -> IO (ConnectId self)
forall obj a.
GObjectClass obj =>
String -> Bool -> obj -> (Ptr a -> IO ()) -> IO (ConnectId obj)
connect_PTR__NONE String
"draw" Bool
after self
model (\Ptr Cairo
ptr -> ReaderT Cairo IO () -> Cairo -> IO ()
forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT ReaderT Cairo IO ()
user (Ptr Cairo -> Cairo
Cairo Ptr Cairo
ptr)))


-- * Events
--
-- An event is a signal that indicates that some low-level interaction like a
-- button or key press, mouse movement, etc. has occurred. In particular,
-- events relate to operations on 'DrawWindow's which are a concept of the
-- underlying OS rather than the logical widget concept. Some widgets have no
-- window and use their parent to receive these events. Widgets normally
-- synthesize more sophistiacted signals from events. For instance, the
-- 'focusIn' and a 'focusOut' signal indicate that the widget gains or looses
-- the input focus. From these events a 'focus' signal is synthesized that
-- indicates what maneuver lead to the input focus change (i.e. a tab or
-- shift-tab key press).
--
-- For applications it is often sufficient to connect to the high-level
-- signals rather than the low-level events. Only in cases where a custom
-- widget is built based on the 'DarwingArea' skeleton, the functionality of
-- such an application-specific widget needs to be implemented using events.
--
-- Every event is passed an 'Event' structure that contains the data of the
-- event. The return value should be @True@ if the handler has dealt with the
-- event and @False@ if the event should be propagated further. For instance,
-- if a key press event that isn't meaningful in the widget, the handler can
-- return @False@ such that the key is handled by the other widgets (the main
-- menu, for instance).
--


-- Because there are so many similar signals (those that take an Event and
-- return a Bool) we will abstract out the skeleton. As some of these events
-- are emitted at a high rate often a bit has to be set to enable emission.


eventM :: WidgetClass w => SignalName -> [EventMask] ->
  ConnectAfter -> w -> (EventM t Bool) -> IO (ConnectId w)
eventM :: forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
name [EventMask]
eMask Bool
after w
obj EventM t Bool
fun = do
  ConnectId w
id <- String -> Bool -> w -> (Ptr t -> IO Bool) -> IO (ConnectId w)
forall obj a.
GObjectClass obj =>
String -> Bool -> obj -> (Ptr a -> IO Bool) -> IO (ConnectId obj)
connect_PTR__BOOL String
name Bool
after w
obj (EventM t Bool -> Ptr t -> IO Bool
forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT EventM t Bool
fun)
  w -> [EventMask] -> IO ()
forall self. WidgetClass self => self -> [EventMask] -> IO ()
widgetAddEvents w
obj [EventMask]
eMask
  ConnectId w -> IO (ConnectId w)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ConnectId w
id

-- %hash c:6cc d:af3f
-- | A mouse button has been depressed while the mouse pointer was within the
-- widget area. Sets the widget's 'ButtonPressMask' flag.
--
buttonPressEvent :: WidgetClass self => Signal self (EventM EButton Bool)
buttonPressEvent :: forall self. WidgetClass self => Signal self (EventM EButton Bool)
buttonPressEvent = (Bool -> self -> EventM EButton Bool -> IO (ConnectId self))
-> Signal self (EventM EButton Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EButton Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"button_press_event" [EventMask
ButtonPressMask])

-- %hash c:62e8 d:af3f
-- | A mouse button has been released. Sets the widget's 'ButtonReleaseMask'
-- flag.
--
buttonReleaseEvent :: WidgetClass self => Signal self (EventM EButton Bool)
buttonReleaseEvent :: forall self. WidgetClass self => Signal self (EventM EButton Bool)
buttonReleaseEvent = (Bool -> self -> EventM EButton Bool -> IO (ConnectId self))
-> Signal self (EventM EButton Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EButton Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"button_release_event" [EventMask
ButtonReleaseMask])

-- %hash c:23e5 d:af3f
-- | The scroll wheel of the mouse has been used. Sets the widget's
-- 'ScrollMask' flag.
--
scrollEvent :: WidgetClass self => Signal self (EventM EScroll Bool)
scrollEvent :: forall self. WidgetClass self => Signal self (EventM EScroll Bool)
scrollEvent = (Bool -> self -> EventM EScroll Bool -> IO (ConnectId self))
-> Signal self (EventM EScroll Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EScroll Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"scroll_event" [EventMask
ScrollMask])

-- %hash c:ee92 d:af3f
-- | The mouse pointer has moved. Since receiving all mouse movements is
-- expensive, it is necessary to specify exactly what mouse motions are
-- required by calling 'widgetAddEvents' on this widget with one or more of
-- the following flags:
--
-- * 'PointerMotionMask': Track all movements.
--
-- * 'ButtonMotionMask': Only track movements if a button is depressed.
--
-- * 'Button1MotionMask': Only track movements if the left button is depressed.
--
-- * 'Button2MotionMask': Only track movements if the middle button is depressed.
--
-- * 'Button3MotionMask': Only track movements if the right button is depressed.
-- 'PointerMotionHintMask' is a special flag which can be used in
-- combination with any of the above and is used to reduce the number of
-- 'motionNotifyEvent's received. Normally a 'motionNotifyEvent' event is
-- received each time the mouse moves. However, if the application spends a
-- lot of time processing the event (updating the display, for example), it
-- can lag behind the position of the mouse. When using
-- 'PointerMotionHintMask', fewer 'motionNotifyEvent's will be sent, some of
-- which are marked as a hint. To receive more motion events after a motion
-- hint event, the application needs to asks for more, by calling
-- 'Graphics.UI.Gtk.Gdk.EventM.eventRequestMotions'. This effectively limits
-- the rate at which new motion events are received. (Note that you don't
-- need to check if the hint is set as
-- 'Graphics.UI.Gtk.Gdk.EventM.eventRequestMotions' does so automatically.)
--
motionNotifyEvent :: WidgetClass self => Signal self (EventM EMotion Bool)
motionNotifyEvent :: forall self. WidgetClass self => Signal self (EventM EMotion Bool)
motionNotifyEvent = (Bool -> self -> EventM EMotion Bool -> IO (ConnectId self))
-> Signal self (EventM EMotion Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EMotion Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"motion_notify_event" [])

-- %hash c:8783 d:3e27
-- | The 'deleteEvent' signal is emitted if a user requests that a toplevel
-- window is closed. The default handler for this signal destroys the window.
-- Calling 'widgetHide' and returning @True@ on reception of this signal will
-- cause the window to be hidden instead, so that it can later be shown again
-- without reconstructing it.
--
deleteEvent :: WidgetClass self => Signal self (EventM EAny Bool)
deleteEvent :: forall self. WidgetClass self => Signal self (EventM EAny Bool)
deleteEvent = (Bool -> self -> EventM EAny Bool -> IO (ConnectId self))
-> Signal self (EventM EAny Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EAny Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"delete_event" [])

-- %hash c:c408 d:5514
-- | The 'destroyEvent' signal is emitted when a 'DrawWindow' is destroyed.
-- You rarely get this signal, because most widgets disconnect themselves from
-- their window before they destroy it, so no widget owns the window at
-- destroy time. However, you might want to connect to the 'objectDestroy'
-- signal of 'Object'.
--
destroyEvent :: WidgetClass self => Signal self (EventM EAny Bool)
destroyEvent :: forall self. WidgetClass self => Signal self (EventM EAny Bool)
destroyEvent = (Bool -> self -> EventM EAny Bool -> IO (ConnectId self))
-> Signal self (EventM EAny Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EAny Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"destroy_event" [])

-- %hash c:c79e d:af3f

-- | Instructs the widget to redraw.
--
-- * The 'DrawWindow' that needs to be redrawn is available via
-- 'eventWindow'.
--
-- * The part that needs to be redrawn is available via 'eventArea' and
-- 'eventRegion'. The options are, in order of efficiency: (a) redraw the
-- entire window, (b) ask for the 'eventArea' and redraw that rectangle, (c)
-- ask for the 'eventRegion' and redraw each of those rectangles.
--
-- Only the exposed region will be updated; see also
-- 'drawWindowBeginPaintRegion'.

exposeEvent :: WidgetClass self => Signal self (EventM EExpose Bool)
exposeEvent :: forall self. WidgetClass self => Signal self (EventM EExpose Bool)
exposeEvent = (Bool -> self -> EventM EExpose Bool -> IO (ConnectId self))
-> Signal self (EventM EExpose Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EExpose Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"expose_event" [])

-- %hash c:5ccd d:af3f
-- | A key has been depressed. Sets the widget's 'KeyPressMask' flag.
--
keyPressEvent :: WidgetClass self => Signal self (EventM EKey Bool)
keyPressEvent :: forall self. WidgetClass self => Signal self (EventM EKey Bool)
keyPressEvent = (Bool -> self -> EventM EKey Bool -> IO (ConnectId self))
-> Signal self (EventM EKey Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EKey Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"key_press_event" [EventMask
KeyPressMask])

-- %hash c:bd29 d:af3f
-- | A key has been released. Sets the widget's 'KeyReleaseMask' flag.
--
keyReleaseEvent :: WidgetClass self => Signal self (EventM EKey Bool)
keyReleaseEvent :: forall self. WidgetClass self => Signal self (EventM EKey Bool)
keyReleaseEvent = (Bool -> self -> EventM EKey Bool -> IO (ConnectId self))
-> Signal self (EventM EKey Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EKey Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"key_release_event" [EventMask
KeyReleaseMask])

-- %hash c:602e d:af3f
-- | The mouse pointer has entered the widget. Sets the widget's
-- 'EnterNotifyMask' flag.
--
enterNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
enterNotifyEvent :: forall self.
WidgetClass self =>
Signal self (EventM ECrossing Bool)
enterNotifyEvent = (Bool -> self -> EventM ECrossing Bool -> IO (ConnectId self))
-> Signal self (EventM ECrossing Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM ECrossing Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"enter_notify_event" [EventMask
EnterNotifyMask])

-- %hash c:3bfb d:af3f
-- | The mouse pointer has left the widget. Sets the widget's
-- 'LeaveNotifyMask' flag.
--
leaveNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
leaveNotifyEvent :: forall self.
WidgetClass self =>
Signal self (EventM ECrossing Bool)
leaveNotifyEvent = (Bool -> self -> EventM ECrossing Bool -> IO (ConnectId self))
-> Signal self (EventM ECrossing Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM ECrossing Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"leave_notify_event" [EventMask
LeaveNotifyMask])

-- %hash c:2b64 d:af3f
-- | The size of the window has changed.
--
configureEvent :: WidgetClass self => Signal self (EventM EConfigure Bool)
configureEvent :: forall self.
WidgetClass self =>
Signal self (EventM EConfigure Bool)
configureEvent = (Bool -> self -> EventM EConfigure Bool -> IO (ConnectId self))
-> Signal self (EventM EConfigure Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EConfigure Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"configure_event" [])

-- %hash c:427e d:af3f
-- | The widget gets the input focus. Sets the widget's 'FocusChangeMask' flag.
--
focusInEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
focusInEvent :: forall self. WidgetClass self => Signal self (EventM EFocus Bool)
focusInEvent = (Bool -> self -> EventM EFocus Bool -> IO (ConnectId self))
-> Signal self (EventM EFocus Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EFocus Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"focus_in_event" [EventMask
FocusChangeMask])

-- %hash c:5281 d:af3f
-- | The widget lost the input focus. Sets the widget's 'FocusChangeMask' flag.
--
focusOutEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
focusOutEvent :: forall self. WidgetClass self => Signal self (EventM EFocus Bool)
focusOutEvent = (Bool -> self -> EventM EFocus Bool -> IO (ConnectId self))
-> Signal self (EventM EFocus Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EFocus Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"focus_out_event" [EventMask
FocusChangeMask])

-- %hash c:63c4 d:af3f
-- | The window is put onto the screen.
--
mapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
mapEvent :: forall self. WidgetClass self => Signal self (EventM EAny Bool)
mapEvent = (Bool -> self -> EventM EAny Bool -> IO (ConnectId self))
-> Signal self (EventM EAny Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EAny Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"map_event" [])

-- %hash c:342d d:af3f
-- | The window is taken off the screen.
--
unmapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
unmapEvent :: forall self. WidgetClass self => Signal self (EventM EAny Bool)
unmapEvent = (Bool -> self -> EventM EAny Bool -> IO (ConnectId self))
-> Signal self (EventM EAny Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EAny Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"unmap_event" [])

-- %hash c:a1dd d:af3f
-- | A 'DrawWindow' may be associated with a set of properties that are
-- identified by a 'PropertyTag'. This event is triggered if a property is
-- changed or deleted. Sets the widget's 'PropertyChangeMask' flag.
--
_propertyNotifyEvent :: WidgetClass self => Signal self (EventM EProperty Bool)
_propertyNotifyEvent :: forall self.
WidgetClass self =>
Signal self (EventM EProperty Bool)
_propertyNotifyEvent = (Bool -> self -> EventM EProperty Bool -> IO (ConnectId self))
-> Signal self (EventM EProperty Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EProperty Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"property_notify_event" [EventMask
PropertyChangeMask])

{- not sure if these are useful
-- %hash c:58cc d:af3f
-- |
--
selectionClearEvent :: WidgetClass self => Signal self ({-GdkEventSelection*-} Bool)
selectionClearEvent = Signal (connect_{-GdkEventSelection*-}__BOOL "selection_clear_event")

-- %hash c:4f92 d:af3f
-- |
--
selectionRequestEvent :: WidgetClass self => Signal self ({-GdkEventSelection*-} Bool)
selectionRequestEvent = Signal (connect_{-GdkEventSelection*-}__BOOL "selection_request_event")

-- %hash c:b842 d:af3f
-- |
--
selectionNotifyEvent :: WidgetClass self => Signal self ({-GdkEventSelection*-} Bool)
selectionNotifyEvent = Signal (connect_{-GdkEventSelection*-}__BOOL "selection_notify_event")
-}

-- %hash c:b027 d:af3f
-- | The pen of a graphics tablet was put down. Sets the widget's
-- 'ProximityInMask' flag.
--
proximityInEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
proximityInEvent :: forall self.
WidgetClass self =>
Signal self (EventM EProximity Bool)
proximityInEvent = (Bool -> self -> EventM EProximity Bool -> IO (ConnectId self))
-> Signal self (EventM EProximity Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EProximity Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"proximity_in_event" [EventMask
ProximityInMask])

-- %hash c:faca d:af3f
-- | The pen of a graphics tablet was lifted off the tablet. Sets the widget's
-- 'ProximityOutMask' flag.
--
proximityOutEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
proximityOutEvent :: forall self.
WidgetClass self =>
Signal self (EventM EProximity Bool)
proximityOutEvent = (Bool -> self -> EventM EProximity Bool -> IO (ConnectId self))
-> Signal self (EventM EProximity Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EProximity Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"proximity_out_event" [EventMask
ProximityOutMask])

-- %hash c:db2c d:af3f
-- | Emitted when the window visibility status has changed. Sets the widget's
-- 'VisibilityNotifyMask' flag.
--
visibilityNotifyEvent :: WidgetClass self => Signal self (EventM EVisibility Bool)
visibilityNotifyEvent :: forall self.
WidgetClass self =>
Signal self (EventM EVisibility Bool)
visibilityNotifyEvent = (Bool -> self -> EventM EVisibility Bool -> IO (ConnectId self))
-> Signal self (EventM EVisibility Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EVisibility Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"visibility_notify_event" [EventMask
VisibilityNotifyMask])
{-
-- %hash c:3f5 d:af3f
-- |
--
clientEvent :: WidgetClass self => Signal self ({-GdkEventClient*-} Bool)
clientEvent = Signal (connect_{-GdkEventClient*-}__BOOL "client_event")
-}

-- %hash c:643c d:af3f
-- | Generated when the area of a 'Drawable' being copied using, e.g.
-- 'Graphics.UI.Gtk.Gdk.Drawable.drawDrawable', is completely available.
--
noExposeEvent :: WidgetClass self => Signal self (EventM EAny Bool)
noExposeEvent :: forall self. WidgetClass self => Signal self (EventM EAny Bool)
noExposeEvent = (Bool -> self -> EventM EAny Bool -> IO (ConnectId self))
-> Signal self (EventM EAny Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EAny Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"no_expose_event" [])

-- %hash c:63b6 d:af3f
-- | Emitted when the state of the window changes, i.e. when it is minimized,
-- moved to the top, etc.
--
windowStateEvent :: WidgetClass self => Signal self (EventM EWindowState Bool)
windowStateEvent :: forall self.
WidgetClass self =>
Signal self (EventM EWindowState Bool)
windowStateEvent = (Bool -> self -> EventM EWindowState Bool -> IO (ConnectId self))
-> Signal self (EventM EWindowState Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EWindowState Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"window_state_event" [])


-- %hash c:502a d:e47a
-- | Emitted when a pointer or keyboard grab on a window belonging to @widget@
-- gets broken.
--
-- On X11, this happens when the grab window becomes unviewable (i.e. it or
-- one of its ancestors is unmapped), or if the same application grabs the
-- pointer or keyboard again.
--
-- * Available since Gtk+ version 2.8
--
grabBrokenEvent :: WidgetClass self => Signal self (EventM EGrabBroken Bool)
grabBrokenEvent :: forall self.
WidgetClass self =>
Signal self (EventM EGrabBroken Bool)
grabBrokenEvent = (Bool -> self -> EventM EGrabBroken Bool -> IO (ConnectId self))
-> Signal self (EventM EGrabBroken Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> [EventMask]
-> Bool
-> self
-> EventM EGrabBroken Bool
-> IO (ConnectId self)
forall w t.
WidgetClass w =>
String
-> [EventMask] -> Bool -> w -> EventM t Bool -> IO (ConnectId w)
eventM String
"grab_broken_event" [])


--------------------
-- Deprecated Signals and Events

foreign import ccall safe "gtk_widget_show"
  gtk_widget_show :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_show_now"
  gtk_widget_show_now :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_hide"
  gtk_widget_hide :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_show_all"
  gtk_widget_show_all :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_destroy"
  gtk_widget_destroy :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_draw"
  gtk_widget_draw :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_queue_draw"
  gtk_widget_queue_draw :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_queue_resize"
  gtk_widget_queue_resize :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_queue_resize_no_redraw"
  gtk_widget_queue_resize_no_redraw :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_get_frame_clock"
  gtk_widget_get_frame_clock :: ((Ptr Widget) -> (IO (Ptr FrameClock)))

foreign import ccall safe "gtk_widget_get_scale_factor"
  gtk_widget_get_scale_factor :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_size_request"
  gtk_widget_size_request :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_get_child_requisition"
  gtk_widget_get_child_requisition :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_size_allocate"
  gtk_widget_size_allocate :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_size_allocate_with_baseline"
  gtk_widget_size_allocate_with_baseline :: ((Ptr Widget) -> ((Ptr ()) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_widget_add_accelerator"
  gtk_widget_add_accelerator :: ((Ptr Widget) -> ((Ptr CChar) -> ((Ptr AccelGroup) -> (CUInt -> (CInt -> (CInt -> (IO ())))))))

foreign import ccall safe "gtk_widget_remove_accelerator"
  gtk_widget_remove_accelerator :: ((Ptr Widget) -> ((Ptr AccelGroup) -> (CUInt -> (CInt -> (IO CInt)))))

foreign import ccall safe "gtk_widget_set_accel_path"
  gtk_widget_set_accel_path :: ((Ptr Widget) -> ((Ptr CChar) -> ((Ptr AccelGroup) -> (IO ()))))

foreign import ccall safe "gtk_widget_can_activate_accel"
  gtk_widget_can_activate_accel :: ((Ptr Widget) -> (CUInt -> (IO CInt)))

foreign import ccall safe "gtk_widget_activate"
  gtk_widget_activate :: ((Ptr Widget) -> (IO CInt))

foreign import ccall unsafe "gtk_widget_intersect"
  gtk_widget_intersect :: ((Ptr Widget) -> ((Ptr ()) -> ((Ptr ()) -> (IO CInt))))

foreign import ccall unsafe "gtk_widget_is_focus"
  gtk_widget_is_focus :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_grab_focus"
  gtk_widget_grab_focus :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_grab_default"
  gtk_widget_grab_default :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_set_name"
  gtk_widget_set_name :: ((Ptr Widget) -> ((Ptr CChar) -> (IO ())))

foreign import ccall unsafe "gtk_widget_get_name"
  gtk_widget_get_name :: ((Ptr Widget) -> (IO (Ptr CChar)))

foreign import ccall safe "gtk_widget_set_sensitive"
  gtk_widget_set_sensitive :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_parent_window"
  gtk_widget_get_parent_window :: ((Ptr Widget) -> (IO (Ptr DrawWindow)))

foreign import ccall unsafe "gtk_widget_get_events"
  gtk_widget_get_events :: ((Ptr Widget) -> (IO CInt))

foreign import ccall unsafe "gtk_widget_set_events"
  gtk_widget_set_events :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_widget_add_events"
  gtk_widget_add_events :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_widget_get_toplevel"
  gtk_widget_get_toplevel :: ((Ptr Widget) -> (IO (Ptr Widget)))

foreign import ccall safe "gtk_widget_get_ancestor"
  gtk_widget_get_ancestor :: ((Ptr Widget) -> (CUInt -> (IO (Ptr Widget))))

foreign import ccall safe "gtk_widget_get_pointer"
  gtk_widget_get_pointer :: ((Ptr Widget) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO ()))))

foreign import ccall unsafe "gtk_widget_is_ancestor"
  gtk_widget_is_ancestor :: ((Ptr Widget) -> ((Ptr Widget) -> (IO CInt)))

foreign import ccall safe "gtk_widget_translate_coordinates"
  gtk_widget_translate_coordinates :: ((Ptr Widget) -> ((Ptr Widget) -> (CInt -> (CInt -> ((Ptr CInt) -> ((Ptr CInt) -> (IO CInt)))))))

foreign import ccall safe "gtk_widget_set_style"
  gtk_widget_set_style :: ((Ptr Widget) -> ((Ptr Style) -> (IO ())))

foreign import ccall safe "gtk_widget_ensure_style"
  gtk_widget_ensure_style :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_get_style"
  gtk_widget_get_style :: ((Ptr Widget) -> (IO (Ptr Style)))

foreign import ccall safe "gtk_widget_get_default_style"
  gtk_widget_get_default_style :: (IO (Ptr Style))

foreign import ccall safe "gtk_widget_set_direction"
  gtk_widget_set_direction :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_direction"
  gtk_widget_get_direction :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_default_direction"
  gtk_widget_set_default_direction :: (CInt -> (IO ()))

foreign import ccall safe "gtk_widget_get_default_direction"
  gtk_widget_get_default_direction :: (IO CInt)

foreign import ccall safe "gtk_widget_shape_combine_region"
  gtk_widget_shape_combine_region :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_input_shape_combine_region"
  gtk_widget_input_shape_combine_region :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_path"
  gtk_widget_path :: ((Ptr Widget) -> ((Ptr CUInt) -> ((Ptr (Ptr CChar)) -> ((Ptr (Ptr CChar)) -> (IO ())))))

foreign import ccall safe "gtk_widget_class_path"
  gtk_widget_class_path :: ((Ptr Widget) -> ((Ptr CUInt) -> ((Ptr (Ptr CChar)) -> ((Ptr (Ptr CChar)) -> (IO ())))))

foreign import ccall safe "gtk_widget_get_composite_name"
  gtk_widget_get_composite_name :: ((Ptr Widget) -> (IO (Ptr CChar)))

foreign import ccall safe "gtk_widget_override_background_color"
  gtk_widget_override_background_color :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_override_color"
  gtk_widget_override_color :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_override_font"
  gtk_widget_override_font :: ((Ptr Widget) -> ((Ptr FontDescription) -> (IO ())))

foreign import ccall safe "gtk_widget_override_symbolic_color"
  gtk_widget_override_symbolic_color :: ((Ptr Widget) -> ((Ptr CChar) -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_override_cursor"
  gtk_widget_override_cursor :: ((Ptr Widget) -> ((Ptr ()) -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_modify_style"
  gtk_widget_modify_style :: ((Ptr Widget) -> ((Ptr RcStyle) -> (IO ())))

foreign import ccall safe "gtk_widget_get_modifier_style"
  gtk_widget_get_modifier_style :: ((Ptr Widget) -> (IO (Ptr RcStyle)))

foreign import ccall safe "gtk_widget_modify_fg"
  gtk_widget_modify_fg :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_modify_bg"
  gtk_widget_modify_bg :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_modify_text"
  gtk_widget_modify_text :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_modify_base"
  gtk_widget_modify_base :: ((Ptr Widget) -> (CInt -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_modify_font"
  gtk_widget_modify_font :: ((Ptr Widget) -> ((Ptr FontDescription) -> (IO ())))

foreign import ccall safe "gtk_widget_create_pango_context"
  gtk_widget_create_pango_context :: ((Ptr Widget) -> (IO (Ptr PangoContext)))

foreign import ccall safe "gtk_widget_get_pango_context"
  gtk_widget_get_pango_context :: ((Ptr Widget) -> (IO (Ptr PangoContext)))

foreign import ccall unsafe "gtk_widget_create_pango_layout"
  gtk_widget_create_pango_layout :: ((Ptr Widget) -> ((Ptr CChar) -> (IO (Ptr PangoLayoutRaw))))

foreign import ccall safe "gtk_widget_render_icon"
  gtk_widget_render_icon :: ((Ptr Widget) -> ((Ptr CChar) -> (CInt -> ((Ptr CChar) -> (IO (Ptr Pixbuf))))))

foreign import ccall safe "gtk_widget_queue_draw_area"
  gtk_widget_queue_draw_area :: ((Ptr Widget) -> (CInt -> (CInt -> (CInt -> (CInt -> (IO ()))))))

foreign import ccall safe "gtk_widget_queue_draw_region"
  gtk_widget_queue_draw_region :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_set_app_paintable"
  gtk_widget_set_app_paintable :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_set_double_buffered"
  gtk_widget_set_double_buffered :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_set_redraw_on_allocate"
  gtk_widget_set_redraw_on_allocate :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_set_composite_name"
  gtk_widget_set_composite_name :: ((Ptr Widget) -> ((Ptr CChar) -> (IO ())))

foreign import ccall safe "gtk_widget_mnemonic_activate"
  gtk_widget_mnemonic_activate :: ((Ptr Widget) -> (CInt -> (IO CInt)))

foreign import ccall safe "gtk_widget_get_accessible"
  gtk_widget_get_accessible :: ((Ptr Widget) -> (IO (Ptr AtkObject)))

foreign import ccall safe "gtk_widget_child_focus"
  gtk_widget_child_focus :: ((Ptr Widget) -> (CInt -> (IO CInt)))

foreign import ccall safe "gtk_widget_get_child_visible"
  gtk_widget_get_child_visible :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_parent"
  gtk_widget_get_parent :: ((Ptr Widget) -> (IO (Ptr Widget)))

foreign import ccall safe "gtk_widget_get_settings"
  gtk_widget_get_settings :: ((Ptr Widget) -> (IO (Ptr Settings)))

foreign import ccall safe "gtk_widget_get_clipboard"
  gtk_widget_get_clipboard :: ((Ptr Widget) -> ((Ptr ()) -> (IO (Ptr Clipboard))))

foreign import ccall safe "gtk_widget_get_display"
  gtk_widget_get_display :: ((Ptr Widget) -> (IO (Ptr Display)))

foreign import ccall safe "gtk_widget_get_root_window"
  gtk_widget_get_root_window :: ((Ptr Widget) -> (IO (Ptr DrawWindow)))

foreign import ccall safe "gtk_widget_get_screen"
  gtk_widget_get_screen :: ((Ptr Widget) -> (IO (Ptr Screen)))

foreign import ccall safe "gtk_widget_has_screen"
  gtk_widget_has_screen :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_size_request"
  gtk_widget_get_size_request :: ((Ptr Widget) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO ()))))

foreign import ccall safe "gtk_widget_get_preferred_size"
  gtk_widget_get_preferred_size :: ((Ptr Widget) -> ((Ptr ()) -> ((Ptr ()) -> (IO ()))))

foreign import ccall safe "gtk_widget_set_child_visible"
  gtk_widget_set_child_visible :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_set_size_request"
  gtk_widget_set_size_request :: ((Ptr Widget) -> (CInt -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_widget_set_no_show_all"
  gtk_widget_set_no_show_all :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_no_show_all"
  gtk_widget_get_no_show_all :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_list_mnemonic_labels"
  gtk_widget_list_mnemonic_labels :: ((Ptr Widget) -> (IO (Ptr ())))

foreign import ccall safe "gtk_widget_add_mnemonic_label"
  gtk_widget_add_mnemonic_label :: ((Ptr Widget) -> ((Ptr Widget) -> (IO ())))

foreign import ccall safe "gtk_widget_remove_mnemonic_label"
  gtk_widget_remove_mnemonic_label :: ((Ptr Widget) -> ((Ptr Widget) -> (IO ())))

foreign import ccall safe "gtk_widget_is_composited"
  gtk_widget_is_composited :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_error_bell"
  gtk_widget_error_bell :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_keynav_failed"
  gtk_widget_keynav_failed :: ((Ptr Widget) -> (CInt -> (IO CInt)))

foreign import ccall safe "gtk_widget_get_tooltip_markup"
  gtk_widget_get_tooltip_markup :: ((Ptr Widget) -> (IO (Ptr CChar)))

foreign import ccall safe "gtk_widget_set_tooltip_markup"
  gtk_widget_set_tooltip_markup :: ((Ptr Widget) -> ((Ptr CChar) -> (IO ())))

foreign import ccall safe "gtk_widget_get_tooltip_text"
  gtk_widget_get_tooltip_text :: ((Ptr Widget) -> (IO (Ptr CChar)))

foreign import ccall safe "gtk_widget_set_tooltip_text"
  gtk_widget_set_tooltip_text :: ((Ptr Widget) -> ((Ptr CChar) -> (IO ())))

foreign import ccall safe "gtk_widget_get_tooltip_window"
  gtk_widget_get_tooltip_window :: ((Ptr Widget) -> (IO (Ptr Window)))

foreign import ccall safe "gtk_widget_set_tooltip_window"
  gtk_widget_set_tooltip_window :: ((Ptr Widget) -> ((Ptr Window) -> (IO ())))

foreign import ccall safe "gtk_widget_get_has_tooltip"
  gtk_widget_get_has_tooltip :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_has_tooltip"
  gtk_widget_set_has_tooltip :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_trigger_tooltip_query"
  gtk_widget_trigger_tooltip_query :: ((Ptr Widget) -> (IO ()))

foreign import ccall safe "gtk_widget_get_window"
  gtk_widget_get_window :: ((Ptr Widget) -> (IO (Ptr DrawWindow)))

foreign import ccall safe "gtk_widget_register_window"
  gtk_widget_register_window :: ((Ptr Widget) -> ((Ptr DrawWindow) -> (IO ())))

foreign import ccall safe "gtk_widget_unregister_window"
  gtk_widget_unregister_window :: ((Ptr Widget) -> ((Ptr DrawWindow) -> (IO ())))

foreign import ccall safe "gtk_cairo_should_draw_window"
  gtk_cairo_should_draw_window :: ((Ptr ()) -> ((Ptr DrawWindow) -> (IO CInt)))

foreign import ccall safe "gtk_cairo_transform_to_window"
  gtk_cairo_transform_to_window :: ((Ptr ()) -> ((Ptr Widget) -> ((Ptr DrawWindow) -> (IO ()))))

foreign import ccall safe "gtk_widget_reparent"
  gtk_widget_reparent :: ((Ptr Widget) -> ((Ptr Widget) -> (IO ())))

foreign import ccall safe "gtk_widget_get_allocation"
  gtk_widget_get_allocation :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_get_allocated_width"
  gtk_widget_get_allocated_width :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_allocated_height"
  gtk_widget_get_allocated_height :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_allocated_baseline"
  gtk_widget_get_allocated_baseline :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_clip"
  gtk_widget_get_clip :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_set_clip"
  gtk_widget_set_clip :: ((Ptr Widget) -> ((Ptr ()) -> (IO ())))

foreign import ccall safe "gtk_widget_get_app_paintable"
  gtk_widget_get_app_paintable :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_can_default"
  gtk_widget_get_can_default :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_can_default"
  gtk_widget_set_can_default :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_has_window"
  gtk_widget_get_has_window :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_has_window"
  gtk_widget_set_has_window :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_sensitive"
  gtk_widget_get_sensitive :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_is_sensitive"
  gtk_widget_is_sensitive :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_state"
  gtk_widget_get_state :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_visible"
  gtk_widget_get_visible :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_is_visible"
  gtk_widget_is_visible :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_state_flags"
  gtk_widget_set_state_flags :: ((Ptr Widget) -> (CInt -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_widget_unset_state_flags"
  gtk_widget_unset_state_flags :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_state_flags"
  gtk_widget_get_state_flags :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_has_default"
  gtk_widget_has_default :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_has_focus"
  gtk_widget_has_focus :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_has_visible_focus"
  gtk_widget_has_visible_focus :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_has_grab"
  gtk_widget_has_grab :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_is_drawable"
  gtk_widget_is_drawable :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_is_toplevel"
  gtk_widget_is_toplevel :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_window"
  gtk_widget_set_window :: ((Ptr Widget) -> ((Ptr DrawWindow) -> (IO ())))

foreign import ccall safe "gtk_widget_set_receives_default"
  gtk_widget_set_receives_default :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_receives_default"
  gtk_widget_get_receives_default :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_device_is_shadowed"
  gtk_widget_device_is_shadowed :: ((Ptr Widget) -> ((Ptr Device) -> (IO CInt)))

foreign import ccall safe "gtk_widget_get_modifier_mask"
  gtk_widget_get_modifier_mask :: ((Ptr Widget) -> (CInt -> (IO CInt)))

foreign import ccall safe "gtk_widget_set_support_multidevice"
  gtk_widget_set_support_multidevice :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_support_multidevice"
  gtk_widget_get_support_multidevice :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_state"
  gtk_widget_set_state :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_event"
  gtk_widget_event :: ((Ptr Widget) -> ((Ptr ()) -> (IO CInt)))

foreign import ccall unsafe "gdk_event_mask_get_type"
  gdk_event_mask_get_type :: CUInt

foreign import ccall safe "gtk_widget_has_rc_style"
  gtk_widget_has_rc_style :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_realized"
  gtk_widget_get_realized :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_mapped"
  gtk_widget_get_mapped :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_realized"
  gtk_widget_set_realized :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_set_mapped"
  gtk_widget_set_mapped :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_style_context"
  gtk_widget_get_style_context :: ((Ptr Widget) -> (IO (Ptr StyleContext)))

foreign import ccall safe "gtk_widget_get_halign"
  gtk_widget_get_halign :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_halign"
  gtk_widget_set_halign :: ((Ptr Widget) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_widget_get_valign"
  gtk_widget_get_valign :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_get_valign_with_baseline"
  gtk_widget_get_valign_with_baseline :: ((Ptr Widget) -> (IO CInt))

foreign import ccall safe "gtk_widget_set_valign"
  gtk_widget_set_valign :: ((Ptr Widget) -> (CInt -> (IO ())))