hpage 0.9.0 → 0.10.0
raw patch · 5 files changed
+67/−60 lines, 5 filesdep −ghc-pathsdep ~Cabaldep ~MonadCatchIO-mtldep ~containers
Dependencies removed: ghc-paths
Dependency ranges changed: Cabal, MonadCatchIO-mtl, containers, directory, eprocess, filepath, haskell-src-exts, hint-server, mtl, process, wx, wxcore
Files
- hpage.cabal +17/−18
- src/HPage/Control.hs +14/−5
- src/HPage/GUI/Dialogs.hs +3/−3
- src/HPage/GUI/FreeTextWindow.hs +30/−30
- src/HPage/GUI/SplashScreen.hs +3/−4
hpage.cabal view
@@ -1,5 +1,5 @@ name: hpage-version: 0.9.0+version: 0.10.0 cabal-version: >=1.6 build-type: Custom license: BSD3@@ -14,7 +14,7 @@ description: λPage is targeted at those haskell developers which also like to work with dynamic GUIs and wish to have something like Smalltalk's Workspace or jPage for Java. Using λPage developers can write haskell expressions, evaluate and test them, load, unload and (of course) reload modules and then, re-evaluate the same expressions. Developed over wxWidgets, λPage is multi-platform by nature and works in every scenario where ghc and wxWidgets work. category: Development, IDE, Editor author: Fernando "Brujo" Benavides-tested-with: GHC ==6.10.3, GHC ==6.10.4+tested-with: GHC ==6.12.1 data-files: LICENSE README res/images/*.png res/images/*.ico@@ -34,25 +34,24 @@ Executable hpage build-depends: base >= 4, base < 5,- mtl >=1.1.0, mtl < 1.2,- monad-loops >=0.3.0, monad-loops < 0.4,- haskell-src-exts >=1.1.3, haskell-src-exts < 1.8,+ mtl >= 1.1.0.2, mtl < 2, bytestring >= 0.9.1, bytestring < 0.10,- MonadCatchIO-mtl >= 0.1.0, MonadCatchIO-mtl < 0.3,- containers >=0.2.0, containers < 0.4,- directory >=1.0.0, directory < 1.1,- wxcore >=0.11.1, wxcore < 0.13,- wx >=0.11.1, wx < 0.13,- filepath >=1.1.0, filepath < 1.2,- Cabal >= 1.6, Cabal < 1.7,- hint >= 0.3.2, hint < 0.4,- eprocess >= 1.1.0, eprocess < 2,- hint-server >= 1.1.0, hint-server < 2,- time >= 1.1.4, time < 2,+ Cabal >= 1.8.0.2, Cabal < 1.9, cabal-macosx >= 0.1.0, cabal-macosx < 0.2, FindBin >= 0.0.2, FindBin < 0.1,- ghc-paths >= 0.1.0.6, ghc-paths < 0.2,- process >= 1.0.1.1, process < 1.1+ time >= 1.1.4, time < 2,+ hint >= 0.3.2, hint < 0.4,+ eprocess >= 1.1.2, eprocess < 2,+ hint-server >= 1.2.0, hint-server < 2,+ wxcore >= 0.12.1.4, wxcore < 0.13,+ wx >= 0.12.1.4, wx < 0.13,+ haskell-src-exts >= 1.9.0, haskell-src-exts < 2,+ monad-loops >= 0.3.0, monad-loops < 0.4,+ containers >= 0.3.0.0, containers < 0.4,+ filepath >= 1.1.0.3, filepath < 1.2,+ directory >= 1.0.1, directory < 1.1,+ process >= 1.0.1.2, process < 1.1,+ MonadCatchIO-mtl >= 0.1.0, MonadCatchIO-mtl < 0.4 main-is: Main.hs buildable: True hs-source-dirs: src
src/HPage/Control.hs view
@@ -521,7 +521,7 @@ getLoadedModules :: HPage (Either Hint.InterpreterError [ModuleDescription]) getLoadedModules = do- confirmRunning+ confirmRunning_ syncRun $ do mns <- Hint.getLoadedModules mis <- mapM Hint.isModuleInterpreted mns@@ -535,7 +535,7 @@ getModuleExports :: Hint.ModuleName -> HPage (Either Hint.InterpreterError [ModuleElemDesc]) getModuleExports mn = do- confirmRunning+ confirmRunning_ let action = do exs <- Hint.getModuleExports mn mapM moduleElemDesc exs@@ -598,7 +598,13 @@ dirs = ("dist" </> "build" </> "autogen") : (uniq $ concatMap hsSourceDirs bldinfos) exts = uniq . map (read . show) $ concatMap extensions bldinfos opts = uniq $ concatMap (hcOptions GHC) bldinfos- mods = uniq . map (joinWith "." . components) $ exeModules pkgdesc ++ (libModules pkgdesc)+ libmods = case library pkgdesc of+ Nothing ->+ []+ Just l ->+ libModules l+ exemods = concat (map exeModules $ executables pkgdesc)+ mods = uniq . map (joinWith "." . components) $ exemods ++ libmods action = do liftTraceIO $ "loading package: " ++ show pkgname Hint.unsafeSetGhcOption "-i"@@ -675,7 +681,7 @@ getLoadedModules' :: HPage (MVar (Either Hint.InterpreterError [ModuleDescription])) getLoadedModules' = do- confirmRunning+ confirmRunning_ asyncRun $ do mns <- Hint.getLoadedModules mis <- mapM Hint.isModuleInterpreted mns@@ -738,7 +744,7 @@ liftIO $ HPIO.stop $ ioServer ctx hs <- liftIO $ HS.start hpios <- liftIO $ HPIO.start- liftIO $ HS.runIn hs $ recoveryLog ctx+ _ <- liftIO $ HS.runIn hs $ recoveryLog ctx modify (\c -> c{server = hs, ioServer = hpios, running = Nothing})@@ -826,6 +832,9 @@ ctx <- confirmRunning liftIO $ HS.asyncRunIn (server ctx) action +confirmRunning_ :: HPage ()+confirmRunning_ = confirmRunning >> return ()+ confirmRunning :: HPage Context confirmRunning = modify (\ctx -> apply (running ctx) ctx) >> get
src/HPage/GUI/Dialogs.hs view
@@ -27,7 +27,7 @@ dlg <- dialog win [text := caption] htmlw <- htmlWindowCreate dlg idAny (rect (point 0 0) winsize) 0 "" debugIO ("url:", url)- htmlWindowLoadPage htmlw url+ True <- htmlWindowLoadPage htmlw url set dlg [layout := fill $ widget htmlw, visible := True, clientSize := winsize]@@ -71,8 +71,8 @@ buttonOnCommand btnnok $ stopFun Nothing where getCurrentPrefs e d g = do let availExts = sort HP.availableExtensions- les_ <- get e selections- let les = map (availExts !!) les_+ les' <- get e selections+ let les = map (availExts !!) les' sds <- get d items gos <- get g text return $ Prefs les sds gos
src/HPage/GUI/FreeTextWindow.hs view
@@ -224,7 +224,7 @@ menuAppend mnuPage wxId_SAVE "&Save\tCtrl-s" "Save Page" False menuAppend mnuPage wxId_SAVEAS "&Save as...\tCtrl-Shift-s" "Save Page as" False menuAppendSeparator mnuPage- menuQuit mnuPage [on command := wxcAppExit]+ _menuQuit <- menuQuit mnuPage [on command := wxcAppExit] mnuEdit <- menuPane [text := "Edit"] menuAppend mnuEdit wxId_UNDO "&Undo\tCtrl-z" "Undo" False@@ -255,7 +255,7 @@ mnuHelp <- menuHelp [] menuAppend mnuHelp wxId_HELP "&Help page\tCtrl-h" "Open the Help Page" False about <- aboutFile- menuAbout mnuHelp [on command := aboutDialog win about]+ _menuAbout <- menuAbout mnuHelp [on command := aboutDialog win about] set win [menuBar := [mnuPage, mnuEdit, mnuHask, mnuHelp]] evtHandlerOnMenuCommand win wxId_NEW $ onCmd "runHP' addPage" $ runHP' HP.addPage@@ -305,17 +305,17 @@ copyPath <- imageFile "copy.png" pastePath <- imageFile "paste.png" reloadPath <- imageFile "reload.png"- toolMenu tbMain mitLoadPkg "Load Package" loadPath [tooltip := "Load Cabal Package"]+ _loadPackage <- toolMenu tbMain mitLoadPkg "Load Package" loadPath [tooltip := "Load Cabal Package"] toolBarAddSeparator tbMain- toolMenu tbMain mitNew "New" newPath [tooltip := "New Page"]- toolMenu tbMain mitOpen "Open" openPath [tooltip := "Open Page"]- toolMenu tbMain mitSave "Save" savePath [tooltip := "Save Page"]+ _new <- toolMenu tbMain mitNew "New" newPath [tooltip := "New Page"]+ _open <- toolMenu tbMain mitOpen "Open" openPath [tooltip := "Open Page"]+ _save <- toolMenu tbMain mitSave "Save" savePath [tooltip := "Save Page"] toolBarAddSeparator tbMain- toolMenu tbMain mitCut "Cut" cutPath [tooltip := "Cut"]- toolMenu tbMain mitCopy "Copy" copyPath [tooltip := "Copy"]- toolMenu tbMain mitPaste "Paste" pastePath [tooltip := "Paste"]+ _cut <- toolMenu tbMain mitCut "Cut" cutPath [tooltip := "Cut"]+ _copy <- toolMenu tbMain mitCopy "Copy" copyPath [tooltip := "Copy"]+ _paste <- toolMenu tbMain mitPaste "Paste" pastePath [tooltip := "Paste"] toolBarAddSeparator tbMain- toolMenu tbMain mitReload "Reload" reloadPath [tooltip := "Reload Modules"]+ _reload <- toolMenu tbMain mitReload "Reload" reloadPath [tooltip := "Reload Modules"] toolBarSetToolBitmapSize tbMain $ sz 32 32 -- Layout settings@@ -331,11 +331,11 @@ -- That's because the main C loop of wx only calls wxHaskell callbacks when something happens -- and we try to make things happen in this side but they're not reflected there until some- -- thing happens there- timer win [interval := 50, on command := return ()]+ _tickingTimer <- timer win [interval := 50, on command := return ()] -- test the server... SS.step ssh 40 "Preparing model..."- runTxtHPSelection "1" model HP.interpret+ Right _ <- runTxtHPSelection "1" model HP.interpret SS.step ssh 60 "Loading first page..." -- ...and RUN!@@ -387,7 +387,7 @@ errorDialog win "Error" "Seems like you don't have Cabal installed.\nPlease install the Haskelll Platform from http://hackage.haskell.org/platform/" wxcAppExit exitWith errRes]- timerStart shutdownTimer 50 True+ True <- timerStart shutdownTimer 50 True return () -- PROCESSES -------------------------------------------------------------------@@ -469,9 +469,9 @@ guiChrFiller = chfv} val = do debugIO "valueFill starting..."- tryTakeMVar chv --NOTE: empty the var+ _ <- tryTakeMVar chv --NOTE: empty the var debugIO "timer starting..."- timerStart charTimer charTimeout True+ True <- timerStart charTimer charTimeout True debugIO "sending msg to charFiller..." readMVar chfv >>= flip sendTo val debugIO "waiting for value toAdd..."@@ -486,7 +486,7 @@ return txt Nothing -> --NOTE: Means "Timed Out" do- varUpdate varErrors (++ [GUIBtm "Timed Out" val])+ _newVal <- varUpdate varErrors (++ [GUIBtm "Timed Out" val]) debugIO $ "timed out" return bottomChar @@ -544,10 +544,10 @@ menuAppend browseMenu idAny err "Error" False Right mes -> flip mapM_ mes $ createMenuItem browseMenu- menuItem contextMenu [text := "To Clipboard",- on command := addToClipboard mn]- menuItem contextMenu [text := "Search on Hayoo!",- on command := hayooDialog win mn]+ _copy <- menuItem contextMenu [text := "To Clipboard",+ on command := addToClipboard mn]+ _search <- menuItem contextMenu [text := "Search on Hayoo!",+ on command := hayooDialog win mn] menuAppendSeparator contextMenu menuAppendSub contextMenu wxId_HASK_BROWSE "&Browse" browseMenu "" addToClipboard txt =@@ -591,10 +591,10 @@ createBasicMenuItem name = do itemMenu <- menuPane []- menuItem itemMenu [text := "To Clipboard",- on command := addToClipboard name]- menuItem itemMenu [text := "Search on Hayoo!",- on command := hayooDialog win name]+ _copy <- menuItem itemMenu [text := "To Clipboard",+ on command := addToClipboard name]+ _search <- menuItem itemMenu [text := "Search on Hayoo!",+ on command := hayooDialog win name] return itemMenu @@ -826,8 +826,8 @@ do set status [text := "setting..."] runHP (do- HP.setLanguageExtensions $ languageExtensions newps- HP.setSourceDirs $ sourceDirs newps+ Right () <- HP.setLanguageExtensions $ languageExtensions newps+ Right () <- HP.setSourceDirs $ sourceDirs newps case ghcOptions newps of "" -> return $ Right () newopts -> HP.setGhcOpts newopts@@ -867,7 +867,7 @@ do -- Refresh the pages list itemsDelete lstPages- (flip mapM) ps $ \pd ->+ (flip mapM_) ps $ \pd -> let prefix = if HP.pIsModified pd then "*" else ""@@ -888,7 +888,7 @@ flip filter pms $ \pm -> all (\xm -> HP.modName xm /= pm) ms allms = zip [0..] (ims' ++ ms' ++ pms') itemsDelete lstModules- (flip mapM) allms $ \(idx, (img, m@(mn:_))) ->+ (flip mapM_) allms $ \(idx, (img, m@(mn:_))) -> listCtrlInsertItemWithLabel lstModules idx mn img >> set lstModules [item idx := m] varSet varModsSel $ -1@@ -985,7 +985,7 @@ poc <- liftIO $ get btnInterpret $ on command let revert = do debugIO "Cancelling..."- tryTakeMVar chv --NOTE: empty the var+ _ <- tryTakeMVar chv --NOTE: empty the var debugIO "Killing the char filler..." newchf <- spawn $ charFiller guiCtx swapMVar chfv newchf >>= kill@@ -1023,7 +1023,7 @@ Right cp -> cp newacc = HP.setPageText s (length s) >> hpacc res <- tryIn model newacc- tryIn' model $ HP.closePage >> HP.setPageIndex cpi + Right () <- tryIn' model $ HP.closePage >> HP.setPageIndex cpi return res refreshExpr :: HPS.ServerHandle -> GUIContext -> IO ()
src/HPage/GUI/SplashScreen.hs view
@@ -7,7 +7,6 @@ import Data.Bits import Graphics.UI.WX hiding (start) import Graphics.UI.WXCore hiding (kill)-import Graphics.UI.WXCore.WxcDefs import System.FilePath import System.Environment.FindBin import Paths_hpage@@ -36,14 +35,14 @@ do debugIO "closing the window" set win [visible := False]- windowDestroy win+ True <- windowDestroy win kill myself _ -> do debugIO ("progress", percent, lbl) set caption [text := lbl] set progress [selection := percent]- wxcAppSafeYield win+ _int <- wxcAppSafeYield win return () step :: SplashHandle -> Int -> String -> IO ()@@ -62,7 +61,7 @@ wxCLOSE_BOX .|. wxCAPTION) win <- frameEx frameStyle [] topWin- timer win [interval := 5, on command := putStr ":"]+ _timer <- timer win [interval := 5, on command := putStr ":"] img <- imageFile htmlw <- htmlWindowCreate win idAny (rect (point 0 0) (sz 870 176)) wxHW_SCROLLBAR_NEVER ""