{-# LINE 2 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}-- -*-haskell-*--- GIMP Toolkit (GTK) Widget ColorSelection---- Author : Duncan Coutts---- Created: 2 August 2004---- Copyright (C) 2004-2005 Duncan Coutts---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2.1 of the License, or (at your option) any later version.---- This library is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU-- Lesser General Public License for more details.---- |-- Maintainer : gtk2hs-users@lists.sourceforge.net-- Stability : provisional-- Portability : portable (depends on GHC)---- A widget used to select a color--moduleGraphics.UI.Gtk.Selectors.ColorSelection(-- * Detail---- | The 'ColorSelection' is a widget that is used to select a color. It-- consists of a color wheel and number of sliders and entry boxes for color-- parameters such as hue, saturation, value, red, green, blue, and opacity. It-- is found on the standard color selection dialog box 'ColorSelectionDialog'.-- * Class Hierarchy-- |-- @-- | 'GObject'-- | +----'Object'-- | +----'Widget'-- | +----'Container'-- | +----'Box'-- | +----'VBox'-- | +----ColorSelection-- @-- * TypesColorSelection,ColorSelectionClass,castToColorSelection,gTypeColorSelection,toColorSelection,-- * ConstructorscolorSelectionNew,-- * MethodscolorSelectionGetCurrentAlpha,colorSelectionSetCurrentAlpha,colorSelectionGetCurrentColor,colorSelectionSetCurrentColor,colorSelectionGetHasOpacityControl,colorSelectionSetHasOpacityControl,colorSelectionGetHasPalette,colorSelectionSetHasPalette,colorSelectionGetPreviousAlpha,colorSelectionSetPreviousAlpha,colorSelectionGetPreviousColor,colorSelectionSetPreviousColor,colorSelectionIsAdjusting,-- * AttributescolorSelectionHasOpacityControl,colorSelectionHasPalette,colorSelectionCurrentAlpha,colorSelectionPreviousAlpha,)whereimportControl.Monad(liftM)importSystem.Glib.FFIimportSystem.Glib.AttributesimportGraphics.UI.Gtk.Abstract.Object(makeNewObject)importGraphics.UI.Gtk.Types{-# LINE 85 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}importGraphics.UI.Gtk.General.Structs(Color){-# LINE 88 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}---------------------- Constructors-- | Creates a new 'ColorSelection'.--colorSelectionNew::IOColorSelectioncolorSelectionNew=makeNewObjectmkColorSelection$liftM(castPtr::PtrWidget->PtrColorSelection)$gtk_color_selection_new{-# LINE 99 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}---------------------- Methods-- | Returns the current alpha value.--colorSelectionGetCurrentAlpha::ColorSelectionClassself=>self->IOInt-- ^ returns an integer between 0 and 65535.colorSelectionGetCurrentAlphaself=liftMfromIntegral$(\(ColorSelectionarg1)->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_current_alphaargPtr1){-# LINE 110 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)-- | Sets the current opacity to be @alpha@. The first time this is called, it-- will also set the original opacity to be @alpha@ too.--colorSelectionSetCurrentAlpha::ColorSelectionClassself=>self->Int-- ^ @alpha@ - an integer between 0 and 65535.->IO()colorSelectionSetCurrentAlphaselfalpha=(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_current_alphaargPtr1arg2){-# LINE 120 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(fromIntegralalpha)-- | Gets the current color in the 'ColorSelection' widget.--colorSelectionGetCurrentColor::ColorSelectionClassself=>self->IOColorcolorSelectionGetCurrentColorself=alloca$\colorPtr->do(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_current_colorargPtr1arg2){-# LINE 129 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(castPtrcolorPtr)peekcolorPtr-- | Sets the current color to be @color@. The first time this is called, it-- will also set the original color to be @color@ too.--colorSelectionSetCurrentColor::ColorSelectionClassself=>self->Color-- ^ @color@ - A 'Color' to set the current color with.->IO()colorSelectionSetCurrentColorselfcolor=withcolor$\colorPtr->(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_current_colorargPtr1arg2){-# LINE 142 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(castPtrcolorPtr)-- | Determines whether the 'ColorSelection' widget has an opacity control.--colorSelectionGetHasOpacityControl::ColorSelectionClassself=>self->IOBool-- ^ returns @True@ if the color selector has an opacity control.-- @False@ if it does't.colorSelectionGetHasOpacityControlself=liftMtoBool$(\(ColorSelectionarg1)->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_has_opacity_controlargPtr1){-# LINE 153 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)-- | Sets the 'ColorSelection' widget to use or not use opacity.--colorSelectionSetHasOpacityControl::ColorSelectionClassself=>self->Bool-- ^ @hasOpacity@ - @True@ if color selector can set the opacity,-- @False@ otherwise.->IO()colorSelectionSetHasOpacityControlselfhasOpacity=(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_has_opacity_controlargPtr1arg2){-# LINE 163 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(fromBoolhasOpacity)-- | Determines whether the color selector has a color palette.--colorSelectionGetHasPalette::ColorSelectionClassself=>self->IOBool-- ^ returns @True@ if the selector has a palette. @False@ if it-- hasn't.colorSelectionGetHasPaletteself=liftMtoBool$(\(ColorSelectionarg1)->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_has_paletteargPtr1){-# LINE 174 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)-- | Sets whether to show or hide the palette.--colorSelectionSetHasPalette::ColorSelectionClassself=>self->Bool-- ^ @hasPalette@ - @True@ if palette is to be visible, @False@-- otherwise.->IO()colorSelectionSetHasPaletteselfhasPalette=(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_has_paletteargPtr1arg2){-# LINE 184 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(fromBoolhasPalette)-- | Returns the previous alpha value.--colorSelectionGetPreviousAlpha::ColorSelectionClassself=>self->IOInt-- ^ returns an integer between 0 and 65535.colorSelectionGetPreviousAlphaself=liftMfromIntegral$(\(ColorSelectionarg1)->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_previous_alphaargPtr1){-# LINE 194 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)-- | Sets the \'previous\' alpha to be @alpha@. This function should be called-- with some hesitations, as it might seem confusing to have that alpha change.--colorSelectionSetPreviousAlpha::ColorSelectionClassself=>self->Int-- ^ @alpha@ - an integer between 0 and 65535.->IO()colorSelectionSetPreviousAlphaselfalpha=(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_previous_alphaargPtr1arg2){-# LINE 204 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(fromIntegralalpha)-- | Returns the original color value.--colorSelectionGetPreviousColor::ColorSelectionClassself=>self->IOColorcolorSelectionGetPreviousColorself=alloca$\colorPtr->do(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_get_previous_colorargPtr1arg2){-# LINE 213 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(castPtrcolorPtr)peekcolorPtr-- | Sets the \'previous\' color to be @color@. This function should be called-- with some hesitations, as it might seem confusing to have that color change.-- Calling 'colorSelectionSetCurrentColor' will also set this color the first-- time it is called.--colorSelectionSetPreviousColor::ColorSelectionClassself=>self->Color->IO()colorSelectionSetPreviousColorselfcolor=withcolor$\colorPtr->(\(ColorSelectionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_color_selection_set_previous_colorargPtr1arg2){-# LINE 227 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)(castPtrcolorPtr)-- | Gets the current state of the widget. Returns True if the user is currently-- dragging a color around, and False if the selection has stopped.--colorSelectionIsAdjusting::ColorSelectionClassself=>self->IOBoolcolorSelectionIsAdjustingself=liftMtoBool$(\(ColorSelectionarg1)->withForeignPtrarg1$\argPtr1->gtk_color_selection_is_adjustingargPtr1){-# LINE 237 "./Graphics/UI/Gtk/Selectors/ColorSelection.chs" #-}(toColorSelectionself)---------------------- Attributes-- | Whether the color selector should allow setting opacity.---- Default value: @False@--colorSelectionHasOpacityControl::ColorSelectionClassself=>AttrselfBoolcolorSelectionHasOpacityControl=newAttrcolorSelectionGetHasOpacityControlcolorSelectionSetHasOpacityControl-- | Whether a palette should be used.---- Default value: @False@--colorSelectionHasPalette::ColorSelectionClassself=>AttrselfBoolcolorSelectionHasPalette=newAttrcolorSelectionGetHasPalettecolorSelectionSetHasPalette-- | The current opacity value (0 fully transparent, 65535 fully opaque).---- Allowed values: \<= 65535---- Default value: 65535--colorSelectionCurrentAlpha::ColorSelectionClassself=>AttrselfIntcolorSelectionCurrentAlpha=newAttrcolorSelectionGetCurrentAlphacolorSelectionSetCurrentAlpha-- | \'previousAlpha\' property. See 'colorSelectionGetPreviousAlpha' and-- 'colorSelectionSetPreviousAlpha'--colorSelectionPreviousAlpha::ColorSelectionClassself=>AttrselfIntcolorSelectionPreviousAlpha=newAttrcolorSelectionGetPreviousAlphacolorSelectionSetPreviousAlphaforeignimportccallunsafe"gtk_color_selection_new"gtk_color_selection_new::(IO(PtrWidget))foreignimportccallunsafe"gtk_color_selection_get_current_alpha"gtk_color_selection_get_current_alpha::((PtrColorSelection)->(IOCUShort))foreignimportccallsafe"gtk_color_selection_set_current_alpha"gtk_color_selection_set_current_alpha::((PtrColorSelection)->(CUShort->(IO())))foreignimportccallunsafe"gtk_color_selection_get_current_color"gtk_color_selection_get_current_color::((PtrColorSelection)->((Ptr())->(IO())))foreignimportccallsafe"gtk_color_selection_set_current_color"gtk_color_selection_set_current_color::((PtrColorSelection)->((Ptr())->(IO())))foreignimportccallunsafe"gtk_color_selection_get_has_opacity_control"gtk_color_selection_get_has_opacity_control::((PtrColorSelection)->(IOCInt))foreignimportccallsafe"gtk_color_selection_set_has_opacity_control"gtk_color_selection_set_has_opacity_control::((PtrColorSelection)->(CInt->(IO())))foreignimportccallunsafe"gtk_color_selection_get_has_palette"gtk_color_selection_get_has_palette::((PtrColorSelection)->(IOCInt))foreignimportccallsafe"gtk_color_selection_set_has_palette"gtk_color_selection_set_has_palette::((PtrColorSelection)->(CInt->(IO())))foreignimportccallunsafe"gtk_color_selection_get_previous_alpha"gtk_color_selection_get_previous_alpha::((PtrColorSelection)->(IOCUShort))foreignimportccallsafe"gtk_color_selection_set_previous_alpha"gtk_color_selection_set_previous_alpha::((PtrColorSelection)->(CUShort->(IO())))foreignimportccallunsafe"gtk_color_selection_get_previous_color"gtk_color_selection_get_previous_color::((PtrColorSelection)->((Ptr())->(IO())))foreignimportccallsafe"gtk_color_selection_set_previous_color"gtk_color_selection_set_previous_color::((PtrColorSelection)->((Ptr())->(IO())))foreignimportccallunsafe"gtk_color_selection_is_adjusting"gtk_color_selection_is_adjusting::((PtrColorSelection)->(IOCInt))