1{-# LANGUAGE CPP #-}
2-- -*-haskell-*-
3--  GIMP Toolkit (GTK) Widget VolumeButton
4--
5--  Author : Andy Stewart
6--
7--  Created: 22 Mar 2010
8--
9--  Copyright (C) 2010 Andy Stewart
10--
11--  This library is free software; you can redistribute it and/or
12--  modify it under the terms of the GNU Lesser General Public
13--  License as published by the Free Software Foundation; either
14--  version 2.1 of the License, or (at your option) any later version.
15--
16--  This library is distributed in the hope that it will be useful,
17--  but WITHOUT ANY WARRANTY; without even the implied warranty of
18--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19--  Lesser General Public License for more details.
20--
21-- |
22-- Maintainer  : gtk2hs-users@lists.sourceforge.net
23-- Stability   : provisional
24-- Portability : portable (depends on GHC)
25--
26-- A button which pops up a volume control
27--
28-- * Module available since Gtk+ version 2.12
29--
30module Graphics.UI.Gtk.Buttons.VolumeButton (
31
32-- * Detail
33--
34-- | 'VolumeButton' is a subclass of 'ScaleButton' that has been tailored for
35-- use as a volume control widget with suitable icons, tooltips and accessible
36-- labels.
37
38-- * Class Hierarchy
39--
40-- |
41-- @
42-- |  'GObject'
43-- |   +----'Object'
44-- |         +----'Widget'
45-- |               +----'Container'
46-- |                     +----'Bin'
47-- |                           +----'Button'
48-- |                                 +----'ScaleButton'
49-- |                                       +----VolumeButton
50-- @
51
52#if GTK_CHECK_VERSION(2,12,0)
53-- * Types
54  VolumeButton,
55  VolumeButtonClass,
56  castToVolumeButton,
57  toVolumeButton,
58
59-- * Constructors
60  volumeButtonNew,
61#endif
62  ) where
63
64import Control.Monad    (liftM)
65
66import System.Glib.FFI
67import Graphics.UI.Gtk.Abstract.Object  (makeNewObject)
68{#import Graphics.UI.Gtk.Types#}
69
70{# context lib="gtk" prefix="gtk" #}
71
72#if GTK_CHECK_VERSION(2,12,0)
73--------------------
74-- Constructors
75
76-- | Creates a 'VolumeButton', with a range between 0.0 and 1.0, with a
77-- stepping of 0.02. Volume values can be obtained and modified using the
78-- functions from 'ScaleButton'.
79--
80volumeButtonNew :: IO VolumeButton
81volumeButtonNew =
82  makeNewObject mkVolumeButton $
83  liftM (castPtr :: Ptr Widget -> Ptr VolumeButton) $
84  {# call gtk_volume_button_new #}
85#endif
86