gtk-0.15.7: Binding to the Gtk+ graphical user interface library.
Maintainergtk2hs-users@lists.sourceforge.net
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Gdk.GC

Contents

Description

Graphics contexts - objects to encapsulate drawing properties

Synopsis

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.

data GC Source #

Instances

Instances details
Eq GC Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

Methods

(==) :: GC -> GC -> Bool

(/=) :: GC -> GC -> Bool

Ord GC Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: GC -> GC -> Ordering

(<) :: GC -> GC -> Bool

(<=) :: GC -> GC -> Bool

(>) :: GC -> GC -> Bool

(>=) :: GC -> GC -> Bool

max :: GC -> GC -> GC

min :: GC -> GC -> GC

GObjectClass GC Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

GCClass GC Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

class GObjectClass o => GCClass o Source #

Instances

Instances details
GCClass GC Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

castToGC :: GObjectClass obj => obj -> GC Source #

gcNew :: DrawableClass d => d -> IO GC Source #

Create an empty graphics context.

data GCValues Source #

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.

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

Instances details
Storable GCValues Source # 
Instance details

Defined in Graphics.UI.Gtk.General.Structs

Methods

sizeOf :: GCValues -> Int

alignment :: GCValues -> Int

peekElemOff :: Ptr GCValues -> Int -> IO GCValues

pokeElemOff :: Ptr GCValues -> Int -> GCValues -> IO ()

peekByteOff :: Ptr b -> Int -> IO GCValues

pokeByteOff :: Ptr b -> Int -> GCValues -> IO ()

peek :: Ptr GCValues -> IO GCValues

poke :: Ptr GCValues -> GCValues -> IO ()

data Color #

Constructors

Color Word16 Word16 Word16 

Instances

Instances details
Eq Color 
Instance details

Defined in Graphics.Rendering.Pango.Structs

Methods

(==) :: Color -> Color -> Bool

(/=) :: Color -> Color -> Bool

Show Color 
Instance details

Defined in Graphics.Rendering.Pango.Structs

Methods

showsPrec :: Int -> Color -> ShowS

show :: Color -> String

showList :: [Color] -> ShowS

Storable Color 
Instance details

Defined in Graphics.UI.Gtk.General.Structs

Methods

sizeOf :: Color -> Int

alignment :: Color -> Int

peekElemOff :: Ptr Color -> Int -> IO Color

pokeElemOff :: Ptr Color -> Int -> Color -> IO ()

peekByteOff :: Ptr b -> Int -> IO Color

pokeByteOff :: Ptr b -> Int -> Color -> IO ()

peek :: Ptr Color -> IO Color

poke :: Ptr Color -> Color -> IO ()

data Function Source #

Determine how bitmap operations are carried out.

Removed in Gtk3.

Instances

Instances details
Enum Function Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Eq Function Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

(==) :: Function -> Function -> Bool

(/=) :: Function -> Function -> Bool

Show Function Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

showsPrec :: Int -> Function -> ShowS

show :: Function -> String

showList :: [Function] -> ShowS

data Fill Source #

How objects are filled.

Removed in Gtk3.

Instances

Instances details
Enum Fill Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: Fill -> Fill

pred :: Fill -> Fill

toEnum :: Int -> Fill

fromEnum :: Fill -> Int

enumFrom :: Fill -> [Fill]

enumFromThen :: Fill -> Fill -> [Fill]

enumFromTo :: Fill -> Fill -> [Fill]

enumFromThenTo :: Fill -> Fill -> Fill -> [Fill]

Eq Fill Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

(==) :: Fill -> Fill -> Bool

(/=) :: Fill -> Fill -> Bool

Show Fill Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

showsPrec :: Int -> Fill -> ShowS

show :: Fill -> String

showList :: [Fill] -> ShowS

data SubwindowMode Source #

Determine if child widget may be overdrawn.

Removed in Gtk3.

data LineStyle Source #

Determines if a line is solid or dashed.

Removed in Gtk3.

Instances

Instances details
Enum LineStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Eq LineStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

(==) :: LineStyle -> LineStyle -> Bool

(/=) :: LineStyle -> LineStyle -> Bool

Show LineStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

showsPrec :: Int -> LineStyle -> ShowS

show :: LineStyle -> String

showList :: [LineStyle] -> ShowS

data CapStyle Source #

Specify the how the ends of a line is drawn.

Removed in Gtk3.

Instances

Instances details
Enum CapStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Eq CapStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

(==) :: CapStyle -> CapStyle -> Bool

(/=) :: CapStyle -> CapStyle -> Bool

Show CapStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

showsPrec :: Int -> CapStyle -> ShowS

show :: CapStyle -> String

showList :: [CapStyle] -> ShowS

data JoinStyle Source #

Constructors

JoinMiter 
JoinRound 
JoinBevel 

Instances

Instances details
Enum JoinStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Eq JoinStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

(==) :: JoinStyle -> JoinStyle -> Bool

(/=) :: JoinStyle -> JoinStyle -> Bool

Show JoinStyle Source # 
Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

showsPrec :: Int -> JoinStyle -> ShowS

show :: JoinStyle -> String

showList :: [JoinStyle] -> ShowS

gcNewWithValues :: DrawableClass d => d -> GCValues -> IO GC Source #

Creates a graphics context with specific values.

gcSetValues :: GC -> GCValues -> IO () Source #

Change some of the values of a graphics context.

gcGetValues :: GC -> IO GCValues Source #

Retrieve the values in a graphics context.

gcSetClipRectangle :: GC -> Rectangle -> IO () Source #

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 () Source #

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 () Source #

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.