on master help sign in
Port to WAI
commitf42afefa94d89596434a4aa9689f599ca2b59cd7 authorMichael Snoyman <michael@snoyman.com> dateThu 24 Jun 2010, 09:35 (16 years ago) parentff3e633
6 files changed+39−49
Hack/Handler/Webkit.hs−11 Network/Wai/Handler/Webkit.hs+14 Webkit.hs−6 hack-handler-webkit.cabal−31 wai-handler-webkit.cabal+24 webkit.cpp+1−1
Hack/Handler/Webkit.hsdeleted−11
@@ -1,11 +0,0 @@
1−module Hack.Handler.Webkit (run) where
2−
3−import Webkit (startBrowser)
4−import Hack (Application)
5−import qualified Hack.Handler.SimpleServer as S
6−import Control.Concurrent (forkIO)
7−
8−run :: Application -> IO ()
9−run app = do
10− forkIO $ S.run 3000 app
11− startBrowser
Network/Wai/Handler/Webkit.hsnew file+14
@@ -0,0 +1,14 @@
1+{-# LANGUAGE ForeignFunctionInterface #-}
2+module Network.Wai.Handler.Webkit (run) where
3+
4+import Network.Wai (Application)
5+import qualified Network.Wai.Handler.SimpleServer as S
6+import Control.Concurrent (forkIO)
7+
8+run :: Application -> IO ()
9+run app = do
10+ forkIO $ S.run 3000 app
11+ startBrowser
12+
13+foreign import ccall "start_browser"
14+ startBrowser :: IO ()
Webkit.hsdeleted−6
@@ -1,6 +0,0 @@
1−{-# LANGUAGE ForeignFunctionInterface #-}
2−{-# CFILES webkit.c #-}
3−module Webkit(startBrowser) where
4−
5−foreign import ccall "start_browser"
6− startBrowser :: IO ()
hack-handler-webkit.cabaldeleted−31
@@ -1,31 +0,0 @@
1−name: hack-handler-webkit
2−version: 0.0.0
3−license: BSD3
4−license-file: LICENSE
5−author: Michael Snoyman <michael@snoyman.com>
6−maintainer: Michael Snoyman <michael@snoyman.com>
7−synopsis: Turn Hack applications into standalone GUIs using Webkit.
8−description: Currently using GtkWebkit. Runs any Hack application using
9− the simpleserver handler and then pops up a Webkit browser
10− to view it.
11−
12− Note: only tested on Ubuntu Jaunty. Help appreciated for
13− other platforms. Ideally, Windows and Mac would use their
14− own native WebKit ports (and maybe even offer a QtWebKit
15− option as well for Linux).
16−category: Web
17−stability: unstable
18−cabal-version: >= 1.2
19−build-type: Simple
20−homepage: http://github.com/snoyberg/hack-handler-webkit/tree/master
21−
22−library
23− build-depends: base >= 4 && < 5,
24− hack >= 2009.5.19,
25− hack-handler-simpleserver >= 0.0.1,
26− bytestring-class
27− ghc-options: -Wall -threaded
28− exposed-modules: Hack.Handler.Webkit
29− other-modules: Webkit
30− c-sources: webkit.cpp
31− pkgconfig-depends: QtWebKit
wai-handler-webkit.cabalnew file+24
@@ -0,0 +1,24 @@
1+name: wai-handler-webkit
2+version: 0.0.0
3+license: BSD3
4+license-file: LICENSE
5+author: Michael Snoyman <michael@snoyman.com>
6+maintainer: Michael Snoyman <michael@snoyman.com>
7+synopsis: Turn WAI applications into standalone GUIs using QtWebkit.
8+description: Runs any WAI application using
9+ the simpleserver handler and then pops up a Webkit browser
10+ to view it.
11+category: Web
12+stability: unstable
13+cabal-version: >= 1.2
14+build-type: Simple
15+homepage: http://github.com/snoyberg/hack-handler-webkit/tree/master
16+
17+library
18+ build-depends: base >= 4 && < 5,
19+ wai >= 0.1.0 && < 0.2,
20+ wai-extra >= 0.1.2.1 && < 0.2
21+ ghc-options: -Wall -threaded
22+ exposed-modules: Network.Wai.Handler.Webkit
23+ c-sources: webkit.cpp
24+ pkgconfig-depends: QtWebKit
webkit.cpp+1−1
@@ -3,7 +3,7 @@
33#include <QtWebKit>
44
55extern "C" {
6− int startBrowser()
6+ int start_browser()
77 {
88 char title[80] = "My Application";
99 char *argv[1];