Gtk2HsContentsIndex
Graphics.UI.Gtk.Gdk.GC
Description

Graphics contexts.

  • This module Graphics.UI.Gtk.Gdk.supplies graphics contexts (GCs) which are a convenient way to pass attributes to drawing functions.
Synopsis
data GC
class GObjectClass o => GCClass o
castToGC :: GObjectClass obj => obj -> GC
gcNew :: DrawableClass d => d -> IO GC
data GCValues = GCValues {
foreground :: Color
background :: Color
function :: Function
fill :: Fill
tile :: (Maybe Pixmap)
stipple :: (Maybe Pixmap)
clipMask :: (Maybe Pixmap)
subwindowMode :: SubwindowMode
tsXOrigin :: Int
tsYOrigin :: Int
clipXOrigin :: Int
clipYOrigin :: Int
graphicsExposure :: Bool
lineWidth :: Int
lineStyle :: LineStyle
capStyle :: CapStyle
joinStyle :: JoinStyle
}
newGCValues :: GCValues
data Color = Color Word16 Word16 Word16
foreground :: GCValues -> Color
background :: GCValues -> Color
data Function
= Copy
| Invert
| Xor
| Clear
| And
| AndReverse
| AndInvert
| Noop
| Or
| Equiv
| OrReverse
| CopyInvert
| OrInvert
| Nand
| Nor
| Set
function :: GCValues -> Function
data Fill
= Solid
| Tiled
| Stippled
| OpaqueStippled
fill :: GCValues -> Fill
tile :: GCValues -> Maybe Pixmap
stipple :: GCValues -> Maybe Pixmap
clipMask :: GCValues -> Maybe Pixmap
data SubwindowMode
= ClipByChildren
| IncludeInferiors
subwindowMode :: GCValues -> SubwindowMode
tsXOrigin :: GCValues -> Int
tsYOrigin :: GCValues -> Int
clipXOrigin :: GCValues -> Int
clipYOrigin :: GCValues -> Int
graphicsExposure :: GCValues -> Bool
lineWidth :: GCValues -> Int
data LineStyle
= LineSolid
| LineOnOffDash
| LineDoubleDash
lineStyle :: GCValues -> LineStyle
data CapStyle
= CapNotLast
| CapButt
| CapRound
| CapProjecting
capStyle :: GCValues -> CapStyle
data JoinStyle
= JoinMiter
| JoinRound
| JoinBevel
joinStyle :: GCValues -> JoinStyle
gcNewWithValues :: DrawableClass d => d -> GCValues -> IO GC
gcSetValues :: GC -> GCValues -> IO ()
gcGetValues :: GC -> IO GCValues
gcSetClipRectangle :: GC -> Rectangle -> IO ()
gcSetClipRegion :: GC -> Region -> IO ()
gcSetDashes :: GC -> Int -> [(Int, Int)] -> IO ()
Documentation
data GC
Instances
GCClass GC
GObjectClass GC
class GObjectClass o => GCClass o
Instances
GCClass GC
castToGC :: GObjectClass obj => obj -> GC
gcNew :: DrawableClass d => d -> IO GC
Create an empty graphics context.
data GCValues

Intermediate data structure for GCs.

  • If graphicsExposure is set then copying portions into a drawable will generate an "exposure" event, even if the destination area is not currently visible.
Constructors
GCValues
foreground :: Color
background :: Color
function :: Function
fill :: Fill
tile :: (Maybe Pixmap)
stipple :: (Maybe Pixmap)
clipMask :: (Maybe Pixmap)
subwindowMode :: SubwindowMode
tsXOrigin :: Int
tsYOrigin :: Int
clipXOrigin :: Int
clipYOrigin :: Int
graphicsExposure :: Bool
lineWidth :: Int
lineStyle :: LineStyle
capStyle :: CapStyle
joinStyle :: JoinStyle
Instances
Storable GCValues
newGCValues :: GCValues
data Color

Color

  • Specifies a color with three integer values for red, green and blue. All values range from 0 (least intense) to 65535 (highest intensity).
Constructors
Color Word16 Word16 Word16
Instances
Storable Color
foreground :: GCValues -> Color
background :: GCValues -> Color
data Function
Determine how bitmap operations are carried out.
Constructors
Copy
Invert
Xor
Clear
And
AndReverse
AndInvert
Noop
Or
Equiv
OrReverse
CopyInvert
OrInvert
Nand
Nor
Set
Instances
Enum Function
function :: GCValues -> Function
data Fill
How objects are filled.
Constructors
Solid
Tiled
Stippled
OpaqueStippled
Instances
Enum Fill
fill :: GCValues -> Fill
tile :: GCValues -> Maybe Pixmap
stipple :: GCValues -> Maybe Pixmap
clipMask :: GCValues -> Maybe Pixmap
data SubwindowMode
Determine if child widget may be overdrawn.
Constructors
ClipByChildren
IncludeInferiors
Instances
Enum SubwindowMode
subwindowMode :: GCValues -> SubwindowMode
tsXOrigin :: GCValues -> Int
tsYOrigin :: GCValues -> Int
clipXOrigin :: GCValues -> Int
clipYOrigin :: GCValues -> Int
graphicsExposure :: GCValues -> Bool
lineWidth :: GCValues -> Int
data LineStyle
Determines if a line is solid or dashed.
Constructors
LineSolid
LineOnOffDash
LineDoubleDash
Instances
Enum LineStyle
lineStyle :: GCValues -> LineStyle
data CapStyle
Specify the how the ends of a line is drawn.
Constructors
CapNotLast
CapButt
CapRound
CapProjecting
Instances
Enum CapStyle
capStyle :: GCValues -> CapStyle
data JoinStyle
Determines how adjacent line ends are drawn.
Constructors
JoinMiter
JoinRound
JoinBevel
Instances
Enum JoinStyle
joinStyle :: GCValues -> JoinStyle
gcNewWithValues :: DrawableClass d => d -> GCValues -> IO GC
Creates a graphics context with specific values.
gcSetValues :: GC -> GCValues -> IO ()
Change some of the values of a graphics context.
gcGetValues :: GC -> IO GCValues
Retrieve the values in a graphics context.
gcSetClipRectangle :: GC -> Rectangle -> IO ()

Set a clipping rectangle.

  • All drawing operations are restricted to this rectangle. This rectangle is interpreted relative to the clip origin.
gcSetClipRegion :: GC -> Region -> IO ()

Set a clipping region.

  • All drawing operations are restricted to this region. This region is interpreted relative to the clip origin.
gcSetDashes :: GC -> Int -> [(Int, Int)] -> IO ()

Specify the pattern with which lines are drawn.

  • Every tuple in the list contains an even and an odd segment. Even segments are drawn normally, whereby the lineStyle member of the graphics context defines if odd segements are drawn or not. A phase argument greater than 0 will drop phase pixels before starting to draw.
Produced by Haddock version 0.6