-- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell) -- Edit the ORIGNAL .chs file instead! {-# LINE 1 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE TypeSynonymInstances #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html -- -- (c) 2011, 2012 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- ClassLogManager.chs -- module HGamer3D.Bindings.Ogre.ClassLogManager where import C2HS import Foreign import Foreign.Ptr import Foreign.C import Monad (liftM, liftM2) import HGamer3D.Data.HG3DClass import HGamer3D.Data.Vector import HGamer3D.Data.Colour import HGamer3D.Data.Angle import HGamer3D.Bindings.Ogre.Utils {-# LINE 42 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} import HGamer3D.Bindings.Ogre.ClassPtr {-# LINE 43 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} import HGamer3D.Bindings.Ogre.StructHG3DClass {-# LINE 44 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} import HGamer3D.Bindings.Ogre.EnumLogMessageLevel {-# LINE 45 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} import HGamer3D.Bindings.Ogre.EnumLoggingLevel {-# LINE 46 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | delete :: HG3DClass -- ^ classpointer - pointer of Class instance which is going to be deleted. -> IO () -- ^ delete a1 = withHG3DClass a1 $ \a1' -> delete'_ a1' >>= \res -> return () {-# LINE 51 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Creates a new log with the given name. createLog :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> String -- ^ name - The name to give the log e.g. 'Ogre.log' -> Bool -- ^ defaultLog - If true, this is the default log output will be sent to if the generic logging methods on this class are used. The first log created is always the default log unless this parameter is set. -> Bool -- ^ debuggerOutput - If true, output to this log will also be routed to the debugger's output window. -> Bool -- ^ suppressFileOutput - If true, this is a logical rather than a physical log and no file output will be written. If you do this you should register a LogListener so log output is not lost. -> IO (HG3DClass) -- ^ createLog a1 a2 a3 a4 a5 = withHG3DClass a1 $ \a1' -> withCString a2 $ \a2' -> let {a3' = fromBool a3} in let {a4' = fromBool a4} in let {a5' = fromBool a5} in alloca $ \a6' -> createLog'_ a1' a2' a3' a4' a5' a6' >>= \res -> peek a6'>>= \a6'' -> return (a6'') {-# LINE 60 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Retrieves a log managed by this class. getLog :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> String -- ^ name -> IO (HG3DClass) -- ^ getLog a1 a2 = withHG3DClass a1 $ \a1' -> withCString a2 $ \a2' -> alloca $ \a3' -> getLog'_ a1' a2' a3' >>= \res -> peek a3'>>= \a3'' -> return (a3'') {-# LINE 66 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Returns a pointer to the default log. getDefaultLog :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (HG3DClass) -- ^ getDefaultLog a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getDefaultLog'_ a1' a2' >>= \res -> peek a2'>>= \a2'' -> return (a2'') {-# LINE 71 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Closes and removes a named log. destroyLog :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> String -- ^ name -> IO () -- ^ destroyLog a1 a2 = withHG3DClass a1 $ \a1' -> withCString a2 $ \a2' -> destroyLog'_ a1' a2' >>= \res -> return () {-# LINE 76 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Closes and removes a log. destroyLog2 :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ log -> IO () -- ^ destroyLog2 a1 a2 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> destroyLog2'_ a1' a2' >>= \res -> return () {-# LINE 81 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Sets the passed in log as the default log. setDefaultLog :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ newLog -> IO (HG3DClass) -- ^ return value - The previous default log. setDefaultLog a1 a2 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> alloca $ \a3' -> setDefaultLog'_ a1' a2' a3' >>= \res -> peek a3'>>= \a3'' -> return (a3'') {-# LINE 87 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Log logMessage :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> String -- ^ message -> EnumLogMessageLevel -- ^ lml -> Bool -- ^ maskDebug -> IO () -- ^ logMessage a1 a2 a3 a4 = withHG3DClass a1 $ \a1' -> withCString a2 $ \a2' -> let {a3' = cIntFromEnum a3} in let {a4' = fromBool a4} in logMessage'_ a1' a2' a3' a4' >>= \res -> return () {-# LINE 94 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Log logMessage2 :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> EnumLogMessageLevel -- ^ lml -> String -- ^ message -> Bool -- ^ maskDebug -> IO () -- ^ logMessage2 a1 a2 a3 a4 = withHG3DClass a1 $ \a1' -> let {a2' = cIntFromEnum a2} in withCString a3 $ \a3' -> let {a4' = fromBool a4} in logMessage2'_ a1' a2' a3' a4' >>= \res -> return () {-# LINE 101 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Sets the level of detail of the default log. setLogDetail :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> EnumLoggingLevel -- ^ ll -> IO () -- ^ setLogDetail a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = cIntFromEnum a2} in setLogDetail'_ a1' a2' >>= \res -> return () {-# LINE 106 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} -- | Override standard Singleton retrieval. Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll. This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors. getSingletonPtr :: IO (HG3DClass) -- ^ getSingletonPtr = alloca $ \a1' -> getSingletonPtr'_ a1' >>= \res -> peek a1'>>= \a1'' -> return (a1'') {-# LINE 110 ".\\HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs" #-} foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_destruct" delete'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_createLog" createLog'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (CInt -> (CInt -> (CInt -> ((HG3DClassPtr) -> (IO ()))))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_getLog" getLog'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> ((HG3DClassPtr) -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_getDefaultLog" getDefaultLog'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_destroyLog" destroyLog'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_destroyLog2" destroyLog2'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_setDefaultLog" setDefaultLog'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_logMessage" logMessage'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (CInt -> (CInt -> (IO ()))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_logMessage2" logMessage2'_ :: ((HG3DClassPtr) -> (CInt -> ((Ptr CChar) -> (CInt -> (IO ()))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_setLogDetail" setLogDetail'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassLogManager.chs.h ogre_lmgr_getSingletonPtr" getSingletonPtr'_ :: ((HG3DClassPtr) -> (IO ()))