-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A binding for the OpenGL Utility Toolkit
--   
--   A Haskell binding for the OpenGL Utility Toolkit, a window system
--   independent toolkit for writing OpenGL programs. For more information
--   about the C library on which this binding is based, please see:
--   <a>http://www.opengl.org/resources/libraries/glut/</a>.
@package GLUT
@version 2.7.0.16


-- | This module contains a simple utility routine to report any pending GL
--   errors.
module Graphics.UI.GLUT.Debugging

-- | Report any pending GL errors to stderr (which is typically the
--   console). If there are no pending errors, this routine does nothing.
--   Note that the error flags are reset after this action, i.e. there are
--   no pending errors left afterwards.
reportErrors :: MonadIO m => m ()


-- | GLUT includes a number of routines for generating easily recognizable
--   3D geometric objects. These routines reflect functionality available
--   in the <tt>aux</tt> toolkit described in the <i>OpenGL Programmer's
--   Guide</i> and are included in GLUT to allow the construction of simple
--   GLUT programs that render recognizable objects. These routines can be
--   implemented as pure OpenGL rendering routines. The routines do not
--   generate display lists for the objects they create. The routines
--   generate normals appropriate for lighting but do not generate texture
--   coordinates (except for the solid teapot, teacup and teaspoon). If
--   VBOs should be used instead of the fixed function pipeline, specify at
--   least one of the attribute locations <a>vertexAttribCoord3</a> or
--   <a>vertexAttribNormal</a>.
module Graphics.UI.GLUT.Objects

-- | Flavour of object rendering
data Flavour

-- | Object is rendered as a solid with shading and surface normals.
Solid :: Flavour

-- | Object is rendered as a wireframe without surface normals.
Wireframe :: Flavour

-- | GLUT offers five types of objects:
--   
--   <ul>
--   <li>The five Platonic solids, see
--   <a>http://mathworld.wolfram.com/PlatonicSolid.html</a>.</li>
--   <li>A rhombic dodecahedron, see
--   <a>http://mathworld.wolfram.com/RhombicDodecahedron.html</a>.</li>
--   <li>Approximations to rounded objects.</li>
--   <li>The classic teaset modeled by Martin Newell in 1975. Both surface
--   normals and texture coordinates for the teaset are generated.</li>
--   <li>A Sierpinski sponge, see
--   <a>http://mathworld.wolfram.com/Tetrix.html</a>.</li>
--   </ul>
data Object

-- | A cube centered at the modeling coordinates origin with sides of the
--   given length.
Cube :: Height -> Object

-- | A dodecahedron (12-sided regular solid) centered at the modeling
--   coordinates origin with a radius of <tt>sqrt 3</tt>.
Dodecahedron :: Object

-- | A icosahedron (20-sided regular solid) centered at the modeling
--   coordinates origin with a radius of 1.0.
Icosahedron :: Object

-- | Render a solid octahedron (8-sided regular solid) centered at the
--   modeling coordinates origin with a radius of 1.0.
Octahedron :: Object

-- | Render a solid tetrahedron (4-sided regular solid) centered at the
--   modeling coordinates origin with a radius of <tt>sqrt 3</tt>.
Tetrahedron :: Object

-- | (<i>freeglut only</i>) A rhombic dodecahedron whose corners are at
--   most a distance of one from the origin. The rhombic dodecahedron has
--   faces which are identical rhombi, but which have some vertices at
--   which three faces meet and some vertices at which four faces meet. The
--   length of each side is <tt>(sqrt 3)/2</tt>. Vertices at which four
--   faces meet are found at <tt>(0, 0, +/-1)</tt> and <tt>(+/-(sqrt 2)/2,
--   +/-(sqrt 2)/2, 0)</tt>.
RhombicDodecahedron :: Object

-- | A sphere centered at the modeling coordinates origin of the specified
--   radius. The sphere is subdivided around the Z axis into slices
--   (similar to lines of longitude) and along the Z axis into stacks
--   (similar to lines of latitude).
Sphere' :: Radius -> Slices -> Stacks -> Object

-- | A cone oriented along the Z axis. The base of the cone is placed at Z
--   = 0, and the top at Z = the given height. The cone is subdivided
--   around the Z axis into slices, and along the Z axis into stacks.
Cone :: Radius -> Height -> Slices -> Stacks -> Object

-- | (<i>freeglut only</i>) A cylinder oriented along the Z axis. The base
--   of the cylinder is placed at Z = 0, and the top at Z = the given
--   height. The cylinder is subdivided around the Z axis into slices, and
--   along the Z axis into stacks.
Cylinder' :: Radius -> Height -> Slices -> Stacks -> Object

-- | A torus (doughnut) centered at the modeling coordinates origin whose
--   axis is aligned with the Z axis. The torus is described by its inner
--   and outer radius, the number of sides for each radial section, and the
--   number of radial divisions (rings).
Torus :: Radius -> Radius -> Sides -> Rings -> Object

-- | A teapot with a given relative size.
Teapot :: Height -> Object

-- | (<i>freeglut only</i>) A teacup with a given relative size.
Teacup :: Height -> Object

-- | (<i>freeglut only</i>) A teaspoon with a given relative size.
Teaspoon :: Height -> Object

-- | (<i>freeglut only</i>) A Sierpinski sponge of a given level, where a
--   level 0 sponge is the same as a <a>Tetrahedron</a>.
SierpinskiSponge :: NumLevels -> Object
type Sides = GLint
type Rings = GLint
type NumLevels = GLint

-- | Render an object in the given flavour.
renderObject :: MonadIO m => Flavour -> Object -> m ()
instance GHC.Show.Show Graphics.UI.GLUT.Objects.Flavour
instance GHC.Classes.Ord Graphics.UI.GLUT.Objects.Flavour
instance GHC.Classes.Eq Graphics.UI.GLUT.Objects.Flavour
instance GHC.Show.Show Graphics.UI.GLUT.Objects.Object
instance GHC.Classes.Ord Graphics.UI.GLUT.Objects.Object
instance GHC.Classes.Eq Graphics.UI.GLUT.Objects.Object


-- | GLUT supports two types of font rendering: stroke fonts, meaning each
--   character is rendered as a set of line segments; and bitmap fonts,
--   where each character is a bitmap generated with <a>bitmap</a>. Stroke
--   fonts have the advantage that because they are geometry, they can be
--   arbitrarily scale and rendered. Bitmap fonts are less flexible since
--   they are rendered as bitmaps but are usually faster than stroke fonts.
module Graphics.UI.GLUT.Fonts
class Font a

-- | Render the string in the named font, without using any display lists.
--   Rendering a nonexistent character has no effect.
--   
--   If the font is a bitmap font, <a>renderString</a> automatically sets
--   the OpenGL unpack pixel storage modes it needs appropriately and saves
--   and restores the previous modes before returning. The generated call
--   to <a>bitmap</a> will adjust the current raster position based on the
--   width of the string. If the font is a stroke font, <a>translate</a> is
--   used to translate the current model view matrix to advance the width
--   of the string.
renderString :: (Font a, MonadIO m) => a -> String -> m ()

-- | For a bitmap font, return the width in pixels of a string. For a
--   stroke font, return the width in units. While the width of characters
--   in a font may vary (though fixed width fonts do not vary), the maximum
--   height characteristics of a particular font are fixed.
stringWidth :: (Font a, MonadIO m) => a -> String -> m GLint

-- | (<i>freeglut only</i>) For a bitmap font, return the maximum height of
--   the characters in the given font measured in pixels. For a stroke
--   font, return the height in units.
fontHeight :: (Font a, MonadIO m) => a -> m GLfloat

-- | The bitmap fonts available in GLUT. The exact bitmap to be used is
--   defined by the standard X glyph bitmaps for the X font with the given
--   name.
data BitmapFont

-- | A fixed width font with every character fitting in an 8 by 13 pixel
--   rectangle.
--   (<tt>-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1</tt>)
Fixed8By13 :: BitmapFont

-- | A fixed width font with every character fitting in an 9 by 15 pixel
--   rectangle.
--   (<tt>-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1</tt>)
Fixed9By15 :: BitmapFont

-- | A 10-point proportional spaced Times Roman font.
--   (<tt>-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1</tt>)
TimesRoman10 :: BitmapFont

-- | A 24-point proportional spaced Times Roman font.
--   (<tt>-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1</tt>)
TimesRoman24 :: BitmapFont

-- | A 10-point proportional spaced Helvetica font.
--   (<tt>-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1</tt>)
Helvetica10 :: BitmapFont

-- | A 12-point proportional spaced Helvetica font.
--   (<tt>-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1</tt>)
Helvetica12 :: BitmapFont

-- | A 18-point proportional spaced Helvetica font.
--   (<tt>-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1</tt>)
Helvetica18 :: BitmapFont

-- | The stroke fonts available in GLUT.
data StrokeFont

-- | A proportionally spaced Roman Simplex font for ASCII characters 32
--   through 127. The maximum top character in the font is 119.05 units;
--   the bottom descends 33.33 units.
Roman :: StrokeFont

-- | A mono-spaced spaced Roman Simplex font (same characters as
--   <a>Roman</a>) for ASCII characters 32 through 127. The maximum top
--   character in the font is 119.05 units; the bottom descends 33.33
--   units. Each character is 104.76 units wide.
MonoRoman :: StrokeFont
instance Graphics.UI.GLUT.Fonts.Font Graphics.UI.GLUT.Raw.Fonts.BitmapFont
instance Graphics.UI.GLUT.Fonts.Font Graphics.UI.GLUT.Raw.Fonts.StrokeFont


-- | GLUT offers some routines for controlling the key repeat and polling
--   the joystick.
module Graphics.UI.GLUT.DeviceControl

-- | The state of the global key repeat
data GlobalKeyRepeat
GlobalKeyRepeatOff :: GlobalKeyRepeat
GlobalKeyRepeatOn :: GlobalKeyRepeat
GlobalKeyRepeatDefault :: GlobalKeyRepeat

-- | Controls the key repeat mode for the window system on a global basis
--   if possible. If supported by the window system, the key repeat can
--   either be disabled, enabled, or set to the window system's default key
--   repeat state.
--   
--   <i>X Implementation Notes:</i> X11 sends <tt>KeyPress</tt> events
--   repeatedly when the window system's global auto repeat is enabled.
--   <a>perWindowKeyRepeat</a> can prevent these auto repeated keystrokes
--   from being reported as keyboard or special callbacks, but there is
--   still some minimal overhead by the X server to continually stream
--   <tt>KeyPress</tt> events to the GLUT application. The
--   <a>globalKeyRepeat</a> state variable can be used to actually disable
--   the global sending of auto repeated <tt>KeyPress</tt> events. Note
--   that <a>globalKeyRepeat</a> affects the global window system auto
--   repeat state so other applications will not auto repeat if you disable
--   auto repeat globally through <a>globalKeyRepeat</a>. GLUT applications
--   using the X11 GLUT implementation should disable key repeat with
--   <a>globalKeyRepeat</a> to disable key repeats most efficiently, but
--   are responsible for explicitly restoring the default key repeat state
--   on exit.
--   
--   <i>Win32 Implementation Notes:</i> The Win32 implementation of
--   <a>globalKeyRepeat</a> does nothing. The <a>perWindowKeyRepeat</a> can
--   be used in the Win32 GLUT implementation to ignore repeated keys on a
--   per-window basis without changing the global window system key repeat.
globalKeyRepeat :: StateVar GlobalKeyRepeat

-- | The state of the per-window key repeat
data PerWindowKeyRepeat
PerWindowKeyRepeatOff :: PerWindowKeyRepeat
PerWindowKeyRepeatOn :: PerWindowKeyRepeat

-- | Controls if auto repeat keystrokes are reported to the <i>current
--   window.</i> Ignoring auto repeated keystrokes is generally done in
--   conjunction with using the <a>keyboardMouseCallback</a>. If you do not
--   ignore auto repeated keystrokes, your GLUT application will experience
--   repeated release/press callbacks. Games using the keyboard will
--   typically want to ignore key repeat.
perWindowKeyRepeat :: StateVar PerWindowKeyRepeat

-- | Execute the joystick callback set by <a>joystickCallback</a> once (if
--   one exists). This is done in a synchronous fashion within the current
--   context, i.e. when <a>forceJoystickCallback</a> returns, the callback
--   will have already happened.
forceJoystickCallback :: MonadIO m => m ()
instance GHC.Show.Show Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat
instance GHC.Classes.Ord Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat
instance GHC.Classes.Eq Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat
instance GHC.Show.Show Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat
instance GHC.Classes.Ord Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat
instance GHC.Classes.Eq Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat


-- | After a GLUT program has done initial setup such as creating windows
--   and menus, GLUT programs enter the GLUT event processing loop by
--   calling <a>mainLoop</a> or handle events iteratively with
--   <a>mainLoopEvent</a>.
module Graphics.UI.GLUT.Begin

-- | Enter the GLUT event processing loop; it will call as necessary any
--   callbacks that have been registered. This routine should be called at
--   most once in a GLUT program.
mainLoop :: MonadIO m => m ()

-- | (<i>freeglut only</i>) Process one iteration's worth of events in its
--   event loop. This allows the application to control its own event loop
--   and still use the GLUT package.
mainLoopEvent :: MonadIO m => m ()

-- | (<i>freeglut only</i>) Stop the event loop. If
--   <a>actionOnWindowClose</a> contains <a>Exit</a>, the application will
--   exit; otherwise control will return to the function which called
--   <a>mainLoop</a>.
--   
--   If the application has two nested calls to <a>mainLoop</a> and calls
--   <a>leaveMainLoop</a>, the behaviour is undefined. It may leave only
--   the inner nested loop or it may leave both loops. If the reader has a
--   strong preference for one behaviour over the other he should contact
--   the freeglut Programming Consortium and ask for the code to be fixed.
leaveMainLoop :: MonadIO m => m ()

-- | The behaviour when the user closes a window.
data ActionOnWindowClose

-- | Exit the whole program when any window is closed or
--   <a>leaveMainLoop</a> is called (default).
Exit :: ActionOnWindowClose

-- | Return from mainLoop when any window is closed.
MainLoopReturns :: ActionOnWindowClose

-- | Return from mainLoop after the last window is closed.
ContinueExecution :: ActionOnWindowClose

-- | (<i>freeglut only</i>) Controls the behaviour when the user closes a
--   window.
actionOnWindowClose :: StateVar ActionOnWindowClose
instance GHC.Show.Show Graphics.UI.GLUT.Begin.ActionOnWindowClose
instance GHC.Classes.Ord Graphics.UI.GLUT.Begin.ActionOnWindowClose
instance GHC.Classes.Eq Graphics.UI.GLUT.Begin.ActionOnWindowClose


-- | When overlay hardware is available, GLUT provides a set of routines
--   for establishing, using, and removing an overlay for GLUT windows.
--   When an overlay is established, a separate OpenGL context is also
--   established. A window's overlay OpenGL state is kept distinct from the
--   normal planes' OpenGL state.
module Graphics.UI.GLUT.Overlay

-- | Controls the overlay for the <i>current window</i>. The requested
--   display mode for the overlay is determined by the <i>initial display
--   mode</i>. <a>overlayPossible</a> can be used to determine if an
--   overlay is possible for the <i>current window</i> with the current
--   <i>initial display mode</i>. Do not attempt to establish an overlay
--   when one is not possible; GLUT will terminate the program.
--   
--   When <a>hasOverlay</a> is set to <a>True</a> when an overlay already
--   exists, the existing overlay is first removed, and then a new overlay
--   is established. The state of the old overlay's OpenGL context is
--   discarded. Implicitly, the window's <i>layer in use</i> changes to the
--   overlay immediately after the overlay is established.
--   
--   The initial display state of an overlay is shown, however the overlay
--   is only actually shown if the overlay's window is shown.
--   
--   Setting <a>hasOverlay</a> to <a>False</a> is safe even if no overlay
--   is currently established, nothing happens in this case. Implicitly,
--   the window's /layer in use/ changes to the normal plane immediately
--   once the overlay is removed.
--   
--   If the program intends to re-establish the overlay later, it is
--   typically faster and less resource intensive to use
--   <a>overlayVisible</a> to simply change the display status of the
--   overlay.
--   
--   <i>X Implementation Notes:</i> GLUT for X uses the
--   <tt>SERVER_OVERLAY_VISUALS</tt> convention to determine if overlay
--   visuals are available. While the convention allows for opaque overlays
--   (no transparency) and overlays with the transparency specified as a
--   bitmask, GLUT overlay management only provides access to transparent
--   pixel overlays.
--   
--   Until RGBA overlays are better understood, GLUT only supports color
--   index overlays.
hasOverlay :: StateVar Bool

-- | Contains <a>True</a> if an overlay could be established for the
--   <i>current window</i> given the current <i>initial display mode</i>.
--   If it contains <a>False</a>, setting <a>hasOverlay</a> will fail with
--   a fatal error.
overlayPossible :: GettableStateVar Bool

-- | Controls the visibility of the overlay of the <i>current window</i>.
--   
--   The effect of showing or hiding an overlay takes place immediately.
--   Note that setting <a>overlayVisible</a> to <a>True</a> will not
--   actually display the overlay unless the window is also shown (and even
--   a shown window may be obscured by other windows, thereby obscuring the
--   overlay). It is typically faster and less resource intensive to use
--   the routines below to control the display status of an overlay as
--   opposed to removing and re-establishing the overlay.
overlayVisible :: SettableStateVar Bool

-- | The <i>layer in use</i>.
data Layer

-- | The normal plane.
Normal :: Layer

-- | The overlay.
Overlay :: Layer

-- | Controls the per-window <i>layer in use</i> for the <i>current
--   window</i>, which can either be the normal plane or the overlay.
--   Selecting the overlay should only be done if an overlay exists,
--   however windows without an overlay may still set the <i>layer in
--   use</i> to <a>Normal</a>. OpenGL commands for the window are directed
--   to the current <i>layer in use</i>.
layerInUse :: StateVar Layer

-- | Mark the overlay of the given window (or the <i>current window</i>, if
--   none is supplied) as needing to be redisplayed. The next iteration
--   through <a>mainLoop</a>, the window's overlay display call                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  