| Maintainer | gtk2hs-users@lists.sourceforge.net |
|---|---|
| Stability | provisional |
| Portability | portable (depends on GHC) |
| Safe Haskell | None |
| Language | Haskell98 |
Graphics.UI.Gtk.Gdk.GC
Contents
Description
Graphics contexts - objects to encapsulate drawing properties
Synopsis
- data GC
- class GObjectClass o => GCClass o
- castToGC :: GObjectClass obj => obj -> GC
- gTypeGC :: GType
- gcNew :: DrawableClass d => d -> IO GC
- data GCValues = GCValues Color Color Function Fill (Maybe Pixmap) (Maybe Pixmap) (Maybe Pixmap) SubwindowMode Int Int Int Int Bool Int LineStyle CapStyle JoinStyle
- newGCValues :: GCValues
- data Color = Color Word16 Word16 Word16
- foreground :: GCValues -> Color
- background :: GCValues -> Color
- data Function
- 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
- subwindowMode :: GCValues -> SubwindowMode
- tsXOrigin :: GCValues -> Int
- tsYOrigin :: GCValues -> Int
- clipXOrigin :: GCValues -> Int
- clipYOrigin :: GCValues -> Int
- graphicsExposure :: GCValues -> Bool
- lineWidth :: GCValues -> Int
- data LineStyle
- lineStyle :: GCValues -> LineStyle
- data CapStyle
- capStyle :: GCValues -> CapStyle
- data JoinStyle
- 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 ()
Detail
All drawing operations in Gdk take a graphics context (GC) argument. A graphics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics contexts, the number of arguments to each drawing call is greatly reduced, and communication overhead is minimized, since identical arguments do not need to be passed repeatedly.
Most values of a graphics context can be set at creation time by using
gcNewWithValues. A few of the values in the GC, such as the dash
pattern, can only be set by the latter method.
Graphics Contexts are removed in Gtk3, so this module is empty.
Instances
| Eq GC # | |
| Ord GC # | |
| GObjectClass GC # | |
Defined in Graphics.UI.Gtk.Types | |
| GCClass GC # | |
Defined in Graphics.UI.Gtk.Types | |
class GObjectClass o => GCClass o #
Instances
| GCClass GC # | |
Defined in Graphics.UI.Gtk.Types | |
castToGC :: GObjectClass obj => obj -> GC #
gcNew :: DrawableClass d => d -> IO GC #
Create an empty graphics context.
Intermediate data structure for GCs.
- If
graphicsExposureis set then copying portions into a drawable will generate an"exposure"event, even if the destination area is not currently visible.
Removed in Gtk3.
Constructors
| GCValues Color Color Function Fill (Maybe Pixmap) (Maybe Pixmap) (Maybe Pixmap) SubwindowMode Int Int Int Int Bool Int LineStyle CapStyle JoinStyle |
Instances
| Storable GCValues # | |
Defined in Graphics.UI.Gtk.General.Structs | |
newGCValues :: GCValues #
Color
- Specifies a color with three integer values for red, green and blue. All values range from 0 (least intense) to 65535 (highest intensity).
Instances
| Eq Color | |
| Show Color | |
| Storable Color # | |
foreground :: GCValues -> Color #
background :: GCValues -> Color #
Determine how bitmap operations are carried out.
Removed in Gtk3.
Constructors
| Copy | |
| Invert | |
| Xor | |
| Clear | |
| And | |
| AndReverse | |
| AndInvert | |
| Noop | |
| Or | |
| Equiv | |
| OrReverse | |
| CopyInvert | |
| OrInvert | |
| Nand | |
| Nor | |
| Set |
Instances
| Enum Function # | |
Defined in Graphics.UI.Gtk.Gdk.Enums | |
| Eq Function # | |
| Show Function # | |
How objects are filled.
Removed in Gtk3.
Constructors
| Solid | |
| Tiled | |
| Stippled | |
| OpaqueStippled |
data SubwindowMode #
Determine if child widget may be overdrawn.
Removed in Gtk3.
Constructors
| ClipByChildren | |
| IncludeInferiors |
Instances
| Enum SubwindowMode # | visibility of a window |
Defined in Graphics.UI.Gtk.Gdk.Enums Methods succ :: SubwindowMode -> SubwindowMode # pred :: SubwindowMode -> SubwindowMode # toEnum :: Int -> SubwindowMode # fromEnum :: SubwindowMode -> Int # enumFrom :: SubwindowMode -> [SubwindowMode] # enumFromThen :: SubwindowMode -> SubwindowMode -> [SubwindowMode] # enumFromTo :: SubwindowMode -> SubwindowMode -> [SubwindowMode] # enumFromThenTo :: SubwindowMode -> SubwindowMode -> SubwindowMode -> [SubwindowMode] # | |
| Eq SubwindowMode # | |
Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: SubwindowMode -> SubwindowMode -> Bool # (/=) :: SubwindowMode -> SubwindowMode -> Bool # | |
| Show SubwindowMode # | |
Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> SubwindowMode -> ShowS # show :: SubwindowMode -> String # showList :: [SubwindowMode] -> ShowS # | |
subwindowMode :: GCValues -> SubwindowMode #
clipXOrigin :: GCValues -> Int #
clipYOrigin :: GCValues -> Int #
graphicsExposure :: GCValues -> Bool #
Determines if a line is solid or dashed.
Removed in Gtk3.
Constructors
| LineSolid | |
| LineOnOffDash | |
| LineDoubleDash |
Instances
| Enum LineStyle # | |
Defined in Graphics.UI.Gtk.Gdk.Enums Methods succ :: LineStyle -> LineStyle # pred :: LineStyle -> LineStyle # fromEnum :: LineStyle -> Int # enumFrom :: LineStyle -> [LineStyle] # enumFromThen :: LineStyle -> LineStyle -> [LineStyle] # enumFromTo :: LineStyle -> LineStyle -> [LineStyle] # enumFromThenTo :: LineStyle -> LineStyle -> LineStyle -> [LineStyle] # | |
| Eq LineStyle # | |
| Show LineStyle # | |
Specify the how the ends of a line is drawn.
Removed in Gtk3.
Constructors
| CapNotLast | |
| CapButt | |
| CapRound | |
| CapProjecting |
Instances
| Enum CapStyle # | |
Defined in Graphics.UI.Gtk.Gdk.Enums | |
| Eq CapStyle # | |
| Show CapStyle # | |
Instances
| Enum JoinStyle # | |
Defined in Graphics.UI.Gtk.Gdk.Enums Methods succ :: JoinStyle -> JoinStyle # pred :: JoinStyle -> JoinStyle # fromEnum :: JoinStyle -> Int # enumFrom :: JoinStyle -> [JoinStyle] # enumFromThen :: JoinStyle -> JoinStyle -> [JoinStyle] # enumFromTo :: JoinStyle -> JoinStyle -> [JoinStyle] # enumFromThenTo :: JoinStyle -> JoinStyle -> JoinStyle -> [JoinStyle] # | |
| Eq JoinStyle # | |
| Show 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
lineStylemember of the graphics context defines if odd segements are drawn or not. Aphaseargument greater than 0 will dropphasepixels before starting to draw.