From ad0e569537f0103323bbdb6d9bd500230a226418 Mon Sep 17 00:00:00 2001 From: tpajenka Date: Sat, 3 May 2014 14:51:24 +0200 Subject: [PATCH] renamed modules after restructuring UI data --- src/Types.hs | 2 +- src/UI/Callbacks.hs | 7 +++---- src/UI/{UIBaseData.hs => UIBase.hs} | 6 +++--- src/UI/UIOperations.hs | 2 +- src/UI/{UIClasses.hs => UIWidgets.hs} | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) rename src/UI/{UIBaseData.hs => UIBase.hs} (98%) rename src/UI/{UIClasses.hs => UIWidgets.hs} (96%) diff --git a/src/Types.hs b/src/Types.hs index f5e88a4..87726b7 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -12,7 +12,7 @@ import Control.Monad.RWS.Strict (RWST) import Control.Lens import Graphics.Rendering.OpenGL.GL.Texturing.Objects (TextureObject) import Render.Types -import UI.UIBaseData +import UI.UIBase --Static Read-Only-State diff --git a/src/UI/Callbacks.hs b/src/UI/Callbacks.hs index d2805c3..7d71021 100644 --- a/src/UI/Callbacks.hs +++ b/src/UI/Callbacks.hs @@ -12,12 +12,11 @@ import Data.Maybe import Foreign.Marshal.Array (pokeArray) import Foreign.Marshal.Alloc (allocaBytes) import qualified Graphics.UI.SDL as SDL -import Render.Misc (genColorData) + +import Render.Misc (curb,genColorData) import Types -import Render.Misc (curb) -- TODO: necessary import ? -import UI.UIBaseData -import UI.UIClasses +import UI.UIWidgets import UI.UIOperations diff --git a/src/UI/UIBaseData.hs b/src/UI/UIBase.hs similarity index 98% rename from src/UI/UIBaseData.hs rename to src/UI/UIBase.hs index 8e05170..0ba8094 100644 --- a/src/UI/UIBaseData.hs +++ b/src/UI/UIBase.hs @@ -1,7 +1,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell, DeriveGeneric #-} --- data and classes are separated into several modules to avoid cyclic dependencies with the Type module --- TODO: exclude UIMouseState constructor -module UI.UIBaseData where +-- widget data is separated into several modules to avoid cyclic dependencies with the Type module +-- TODO: exclude UIMouseState constructor from export? +module UI.UIBase where import Control.Lens ((^.), (.~), (%~), (&), ix, to, mapped, traverse, makeLenses) import Control.Monad (liftM) diff --git a/src/UI/UIOperations.hs b/src/UI/UIOperations.hs index d9492e0..940c3e9 100644 --- a/src/UI/UIOperations.hs +++ b/src/UI/UIOperations.hs @@ -6,7 +6,7 @@ import qualified Data.HashMap.Strict as Map import Data.Maybe import Types -import UI.UIBaseData +import UI.UIBase toGUIAny :: Map.HashMap UIId (GUIWidget m) -> UIId -> GUIWidget m toGUIAny m uid = fromMaybe (error "map does not contain requested key") (Map.lookup uid m) diff --git a/src/UI/UIClasses.hs b/src/UI/UIWidgets.hs similarity index 96% rename from src/UI/UIClasses.hs rename to src/UI/UIWidgets.hs index b9eab18..a2ae296 100644 --- a/src/UI/UIClasses.hs +++ b/src/UI/UIWidgets.hs @@ -1,6 +1,6 @@ {-# LANGUAGE InstanceSigs, MultiParamTypeClasses, FlexibleInstances #-} -module UI.UIClasses (module UI.UIClasses, module UI.UIBaseData) where +module UI.UIWidgets (module UI.UIWidgets, module UI.UIBase) where import Control.Lens ((^.), (.~), (&)) import Control.Monad @@ -11,7 +11,7 @@ import Data.Maybe import qualified Data.HashMap.Strict as Map import Types -import UI.UIBaseData +import UI.UIBase createContainer :: (Monad m) => (ScreenUnit, ScreenUnit, ScreenUnit, ScreenUnit) -> [UIId] -> Int -> GUIWidget m