Skip to content

Commit

Permalink
add missing Script.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
wavewave committed Apr 23, 2012
1 parent 02ea3f9 commit 6e083a3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Application/HXournal/Device.hsc
Expand Up @@ -66,6 +66,7 @@ initDevice :: Config -> IO DeviceList
initDevice cfg = do
(mcore,mstylus,meraser) <- getPenDevConfig cfg
putStrLn $ show mstylus
putStrLn $ show meraser
with 0 $ \pcore ->
with 0 $ \pstylus ->
with 0 $ \peraser -> do
Expand Down Expand Up @@ -101,7 +102,10 @@ getPointer devlst = do
Nothing -> return (rbtn,PointerCoord Core x y 1.0)
Just dev -> case maxf of
Nothing -> return (rbtn,PointerCoord Core x y 1.0)
Just axf -> (,) rbtn <$> (liftIO $ coord ptr x y dev axf)
Just axf -> do
tst <- (,) rbtn <$> (liftIO $ coord ptr x y dev axf)
liftIO $ print tst
return tst
where
getInfo ptr = do
(ty :: #{gtk2hs_type GdkEventType}) <- peek (castPtr ptr)
Expand Down
43 changes: 43 additions & 0 deletions lib/Application/HXournal/Script.hs
@@ -0,0 +1,43 @@
-----------------------------------------------------------------------------
-- |
-- Module : Application.HXournal.Script
-- Copyright : (c) 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
-----------------------------------------------------------------------------

module Application.HXournal.Script where

import Application.HXournal.Script.Hook
import Config.Dyre.Relaunch

-- |

data ScriptConfig = ScriptConfig { message :: Maybe String
, hook :: Maybe Hook
, errorMsg :: Maybe String
}

-- |

defaultScriptConfig :: ScriptConfig
defaultScriptConfig = ScriptConfig Nothing Nothing Nothing

-- |

showError :: ScriptConfig -> String -> ScriptConfig
showError cfg msg = cfg { errorMsg = Just msg }


-- |

relaunchApplication :: IO ()
relaunchApplication = do
putStrLn "relaunching hxournal!"
relaunchMaster Nothing


0 comments on commit 6e083a3

Please sign in to comment.