module Graphics.UI.Gtk.WebKit.HitTestResult (
HitTestResult,
HitTestResultClass,
HitTestResultContext(..),
) where
import System.Glib.FFI
import System.Glib.GList
import System.Glib.GError
import Graphics.UI.Gtk.Gdk.Events
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GObject
data HitTestResultContext = HitTestResultContextDocument
| HitTestResultContextLink
| HitTestResultContextImage
| HitTestResultContextMedia
| HitTestResultContextSelection
| HitTestResultContextEditable
instance Enum HitTestResultContext where
fromEnum HitTestResultContextDocument = 2
fromEnum HitTestResultContextLink = 4
fromEnum HitTestResultContextImage = 8
fromEnum HitTestResultContextMedia = 16
fromEnum HitTestResultContextSelection = 32
fromEnum HitTestResultContextEditable = 64
toEnum 2 = HitTestResultContextDocument
toEnum 4 = HitTestResultContextLink
toEnum 8 = HitTestResultContextImage
toEnum 16 = HitTestResultContextMedia
toEnum 32 = HitTestResultContextSelection
toEnum 64 = HitTestResultContextEditable
toEnum unmatched = error ("HitTestResultContext.toEnum: Cannot match " ++ show unmatched)
succ HitTestResultContextDocument = HitTestResultContextLink
succ HitTestResultContextLink = HitTestResultContextImage
succ HitTestResultContextImage = HitTestResultContextMedia
succ HitTestResultContextMedia = HitTestResultContextSelection
succ HitTestResultContextSelection = HitTestResultContextEditable
succ _ = undefined
pred HitTestResultContextLink = HitTestResultContextDocument
pred HitTestResultContextImage = HitTestResultContextLink
pred HitTestResultContextMedia = HitTestResultContextImage
pred HitTestResultContextSelection = HitTestResultContextMedia
pred HitTestResultContextEditable = HitTestResultContextSelection
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x HitTestResultContextEditable
enumFromThen _ _ = error "Enum HitTestResultContext: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum HitTestResultContext: enumFromThenTo not implemented"