From: <kr_...@us...> - 2003-05-01 19:35:39
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv12134/port/src/Port Modified Files: Process.hs Log Message: Added proper initialization for libgnome. Unfortunately the initialization requires that the application name should be constant during program execution. That means that the modified 'start' function should have two additional arguments: the application name and the application version (the latest is also required from libgnome for proper initialization). Index: Process.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Process.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Process.hs 30 Mar 2003 18:49:07 -0000 1.1 --- Process.hs 1 May 2003 19:35:35 -0000 1.2 *************** *** 12,16 **** module Graphics.UI.Port.Process ( start, quit, halt - , getProcessTitle, setProcessTitle ) where --- 12,15 ---- *************** *** 24,35 **** -- | Start the event loop. Runs until 'quit' is called. ! start :: DocumentInterface -> IO a -> IO a ! start di io = do ! osInit (toCDocumentInterface di) setProcessDismissHandler (quit >> return ()) r <- io osStart return r ! -- | 'quit' exits the main event loop, closes any windows and menus, destroys all timers -- and unregisters any event handlers. This function is automatically called when all --- 23,40 ---- -- | Start the event loop. Runs until 'quit' is called. ! start :: String -- ^ Application name ! -> String -- ^ Application version ! -> DocumentInterface -- ^ Document interface type for application ! -> IO a -- ^ Startup action ! -> IO a ! start name version di io = do ! (withCString name $ \cname -> ! withCString version $ \cversion -> ! osInit cname cversion (toCDocumentInterface di)) setProcessDismissHandler (quit >> return ()) r <- io osStart return r ! -- | 'quit' exits the main event loop, closes any windows and menus, destroys all timers -- and unregisters any event handlers. This function is automatically called when all *************** *** 43,47 **** performGC -- to release any foreign objects return r ! -- | 'quit' exits the main event loop, closes any windows and menus, destroys all timers -- and unregisters any event handlers. This function is automatically called when all --- 48,52 ---- performGC -- to release any foreign objects return r ! -- | 'quit' exits the main event loop, closes any windows and menus, destroys all timers -- and unregisters any event handlers. This function is automatically called when all *************** *** 54,64 **** performGC -- to release any foreign objects ! foreign import ccall "osInit" osInit :: CInt -> IO () foreign import ccall "osStart" osStart :: IO () foreign import ccall osQuit :: IO () - - getProcessTitle = osGetProcessTitle >>= peekCString - foreign import ccall osGetProcessTitle :: IO CString - - setProcessTitle appName = withCString appName osSetProcessTitle - foreign import ccall osSetProcessTitle :: CString -> IO () --- 59,63 ---- performGC -- to release any foreign objects ! foreign import ccall "osInit" osInit :: CString -> CString -> CInt -> IO () foreign import ccall "osStart" osStart :: IO () foreign import ccall osQuit :: IO () |