Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding the basics

  • Loading branch information...
commit d8769671b48d5b67910fdcd40ea8fc711f12e9d5 1 parent 1de9e31
Fernando 'Brujo' Benavides authored
View
10 .gitignore
@@ -0,0 +1,10 @@
+.DS_Store
+.directory
+.project
+out
+bin
+bin/hPage.app/Contents/MacOS/hPage
+dist
+src/Paths_hpage.hs
+src/HPage/Stub
+.dist-scion
View
31 LICENSE
@@ -0,0 +1,31 @@
+Copyright Fernando Brujo Benavides 2009
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of Fernando Brujo Benavides nor the names of other
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
View
72 Setup.hs
@@ -0,0 +1,72 @@
+{-# LANGUAGE CPP #-}
+
+import Control.Monad (foldM_, forM_)
+import System.Cmd
+import System.Exit
+import System.Info (os)
+import System.FilePath
+import System.Directory ( doesFileExist, copyFile, removeFile, createDirectoryIfMissing )
+
+import Distribution.PackageDescription
+import Distribution.Simple.Setup
+import Distribution.Simple
+import Distribution.Simple.LocalBuildInfo
+
+main :: IO ()
+main = do
+ putStrLn $ "Setting up wxhnotepad for " ++ os
+ defaultMainWithHooks $ addMacHook simpleUserHooks
+ where
+ addMacHook h =
+ case os of
+ "darwin" -> h { postInst = appBundleHook }
+ _ -> h
+
+appBundleHook :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
+appBundleHook _ _ pkg localb =
+ forM_ exes $ \app ->
+ do createAppBundle theBindir (buildDir localb </> app </> app)
+ removeFile (theBindir </> app)
+ createAppBundleWrapper theBindir app
+ return ()
+ where
+ theBindir = bindir $ absoluteInstallDirs pkg localb NoCopyDest
+ exes = map exeName $ executables pkg
+
+-- ----------------------------------------------------------------------
+-- helper code for application bundles
+-- ----------------------------------------------------------------------
+
+-- | 'createAppBundle' @d p@ - creates an application bundle in @d@
+-- for program @p@, assuming that @d@ already exists and is a directory.
+-- Note that only the filename part of @p@ is used.
+createAppBundle :: FilePath -> FilePath -> IO ()
+createAppBundle dir p =
+ do createDirectoryIfMissing False $ bundle
+ createDirectoryIfMissing True $ bundleBin
+ createDirectoryIfMissing True $ bundleRsrc
+ copyFile p (bundleBin </> takeFileName p)
+ where
+ bundle = appBundlePath dir p
+ bundleBin = bundle </> "Contents/MacOS"
+ bundleRsrc = bundle </> "Contents/Resources"
+
+-- | 'createAppBundleWrapper' @d p@ - creates a script in @d@ that calls
+-- @p@ from the application bundle @d </> takeFileName p <.> "app"@
+createAppBundleWrapper :: FilePath -> FilePath -> IO ExitCode
+createAppBundleWrapper bindir p =
+ do writeFile scriptFile scriptTxt
+ makeExecutable scriptFile
+ where
+ scriptFile = bindir </> takeFileName p
+ scriptTxt = "`dirname $0`" </> appBundlePath "." p </> "Contents/MacOS" </> takeFileName p ++ " \"$@\""
+
+appBundlePath :: FilePath -> FilePath -> FilePath
+appBundlePath dir p = dir </> takeFileName p <.> "app"
+
+-- ----------------------------------------------------------------------
+-- utilities
+-- ----------------------------------------------------------------------
+
+makeExecutable :: FilePath -> IO ExitCode
+makeExecutable f = system $ "chmod a+x " ++ f
View
0  src/Main.hs
No changes.
View
53 wxhaskell.cabal
@@ -0,0 +1,53 @@
+name: wxhnotepad
+version: 0.5.4
+cabal-version: >=1.6
+build-type: Custom
+license: BSD3
+license-file: LICENSE
+copyright: 2009 Fernando "Brujo" Benavides
+maintainer: greenmellon@gmail.com
+stability: provisional
+homepage: http://haskell.hpage.com
+package-url: http://code.haskell.org/hpage
+bug-reports: http://github.com/elbrujohalcon/hPage/issues
+synopsis: A scrapbook for Haskell developers
+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
+data-files: LICENSE README
+ res/images/*.png
+ res/images/*.ico
+ res/images/icon/hPage.icns
+ res/images/icon/hpage.tif
+ res/help/helpPage.hs
+ res/test/*.hs
+data-dir: ""
+extra-source-files: Setup.hs
+extra-tmp-files:
+
+source-repository head
+ type: git
+ location: git://github.com/elbrujohalcon/hPage.git
+
+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.2,
+ bytestring >=0.9.1, bytestring <0.10,
+ MonadCatchIO-mtl >= 0.1.0, MonadCatchIO-mtl < 0.3,
+ containers >=0.2.0, containers < 0.3,
+ directory >=1.0.0, directory < 1.1,
+ wxcore >=0.11.1, wxcore < 0.12,
+ wx >=0.11.1, wx < 0.12,
+ 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
+ main-is: Main.hs
+ buildable: True
+ hs-source-dirs: src
+ other-modules: HPage.GUI.IDs, HPage.GUI.FreeTextWindow, HPage.GUI.Dialogs, HPage.Control, HPage.Server, HPage.Utils.Log, HPage.GUI.Constants
+ ghc-options: -fwarn-unused-imports -fwarn-missing-fields -fwarn-incomplete-patterns
View
BIN  wxhnotepad.smultronProject
Binary file not shown
View
35 wxnotepad.cabal
@@ -0,0 +1,35 @@
+name: wxhnotepad
+version: 0.0.1
+cabal-version: >=1.6
+build-type: Custom
+license: BSD3
+license-file: LICENSE
+copyright: 2010 Fernando "Brujo" Benavides
+maintainer: greenmellon@gmail.com
+stability: educational
+homepage: http://github.com/elbrujohalcon/wxhnotepad
+package-url: http://code.haskell.org/wxhnotepad
+bug-reports: http://github.com/elbrujohalcon/wxhnotepad/issues
+synopsis: An example of how to implement a basic notepad with wxHaskell
+description: A program to learn how to implement basic text editing functionality with wxHaskell. It's not useful itself, the point is to read the code and learn from it ;)
+category: Development, Education, IDE, Editor
+author: Fernando "Brujo" Benavides
+tested-with: GHC ==6.10.3, GHC ==6.10.4
+data-files: LICENSE README
+data-dir: ""
+extra-source-files: Setup.hs
+extra-tmp-files:
+
+source-repository head
+ type: git
+ location: git://github.com/elbrujohalcon/wxhnotepad.git
+
+Executable wxhnotepad
+ build-depends: base >= 4, base < 5,
+ wxcore >=0.11.1, wxcore < 0.12,
+ wx >=0.11.1, wx < 0.12
+ main-is: Main.hs
+ buildable: True
+ hs-source-dirs: src
+ other-modules:
+ ghc-options: -fwarn-unused-imports -fwarn-missing-fields -fwarn-incomplete-patterns
Please sign in to comment.
Something went wrong with that request. Please try again.