diff --git a/lib/Application/HXournal/Device.hsc b/lib/Application/HXournal/Device.hsc index 089a2dc..534599c 100644 --- a/lib/Application/HXournal/Device.hsc +++ b/lib/Application/HXournal/Device.hsc @@ -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 @@ -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) diff --git a/lib/Application/HXournal/Script.hs b/lib/Application/HXournal/Script.hs new file mode 100644 index 0000000..31e66e2 --- /dev/null +++ b/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 +-- 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 + + \ No newline at end of file