fltkhs-0.2.0.0: FLTK bindings

Safe HaskellNone
LanguageHaskell2010

Graphics.UI.FLTK.LowLevel.Dispatch

Contents

Synopsis

FindOp

class FindOp a b c | a b -> c Source

FindOp searches a class hierarchy for a member function (an Op-eration) and returns the first class in the hierarchy that support it.

Given a class hierarchy starting at a and member function b find c, the closest ancestor to a (possibly a) that has that function.

If found r is Match c, if not found r is NoFunction b.

Instances

FindOp Base f (NoFunction f) Source 
(Functions (a as) fs, Contains fs f match, FindOp' (a as) f match r) => FindOp (a as) f r Source 

Functions

Match

data Match a Source

See FindOp for more details.

NoFunction

data NoFunction a Source

See FindOp for more details.

Instances

Op

class Op op obj origObj impl where Source

Implementations of methods on various types of objects.

  • op - name of the function
  • obj - the class that implements op
  • origObj - the class in the hierarchy where the search for op started. Kept around in case the type in needed. The best example is setCallback whose implementation is usually found much lower in the hierarchy but where we also want to enforce that the implementation take the type of the widget calling it.
  • impl - a function that takes the a Ref origobj, casted down to Ref obj and whatever other parameters the instance specifies.

Methods

runOp :: op -> origObj -> Ref obj -> impl Source

dispatch

dispatch :: forall op obj origObj impl. (FindOp origObj op (Match obj), Op op obj origObj impl) => op -> Ref origObj -> impl Source

Given some member function op and a Ref to some class origObj return the implementation of op. See Op for more details.

Every FLTK function called on some Ref uses this function to figure out what arguments it needs.

runOp

castTo

castTo :: Ref a -> Ref r Source

Cast any reference to any other reference. Unsafe, intended to be used by Op.

safeCast

safeCast :: Parent a r => Ref a -> Ref r Source

Cast any reference to one of its ancestors.

Parent

class Parent a b Source

A class with a single instance that is found only if b is an ancestor of a.

Used by some Op implementations to enforce that certain parameters have to be at least a b.

Instances

FindInHierarchy a a b InHierarchy => Parent a b Source