Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Showing with 33 additions and 13 deletions.
  1. +28 −9 OVERVIEW.md
  2. +5 −0 mkModmap.sh
  3. BIN mod.png
  4. +0 −3 src/Graphics/Blobs/NetworkUI.hs
  5. +0 −1 src/Graphics/Blobs/Operations.hs
View
37 OVERVIEW.md
@@ -1,21 +1,21 @@
-Investigation of the existing code
+Investigation of the existing code modules.
GUI
---
-ContextMenu - context menus for canvas, edge, node, via (control point)
+NetworkUI - main GUI scaffolding stuff, menus, etc
+ GUIEvent - handles mouse and kbd events
+ ContextMenu - context menus for canvas, edge, node, via (control point)
+ NetworkView - handles the main pane
+ State - current GUI state
+PDDefaults - manages save/load/modification of the document, as the GUI stuff
Colors - what it says
Constants - what it says
DisplayOptions - which of global info, node labels, node info, edge info to show.
-GUIEvent - handles mouse and kbd events
-NetworkUI - main GUI scaffolding stuff, menus, etc
-NetworkView - handles the main pane
Palette - shapes for rendering the network items
Shape - manages/renders items from the palette
-State - current GUI state
StateUtil - ?
-PDDefaults - manages save/load/modification of the document, as the GUI stuff
Util
----
@@ -29,13 +29,32 @@ XTC - not used.
Model
-----
Document - is a network and a selection, and some ops on it
-InfoKind - need to clarify
+ Network - the main data structure. Has Nodes, Edges, a Palette, Canvas size and extra Info
+ InfoKind - need to clarify
NetworkControl - modifies network in reaction to GUI events
NetworkFile - reads and writes network file in XML format.
-Network - the main data structure. Has Nodes, Edges, a Palette, Canvas size and extra Info
Operations - user defined operations on the network.
PersistentDocument - Handles the document over time, including undo/redo
+-------------------------
+
+Everything works around the Network, which has three type placeholders
+g - The global state type
+n - The type applied to a node
+e - The type applied to an edge.
+
+The InfoKind class is used to trigger type checking when needed.
+
+class (Eq a, Show a, Parse a, XmlContent a) => InfoKind a g | a -> g where
+ blank :: a
+ check :: String -> g -> a -> [String] -- returns warnings
+ -- ^ first arg is container label for error reporting.
+ -- second arg is global value
+
+blank provides an empty item which will pass the check function.
+
+Require an instance of InfoKind n g for the node constructor
+Require an instance of InfoKind e g for the edge constructor
View
5 mkModmap.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Use graphmod (from hackage) to generate a diagram of the module interrelationships
+
+graphmod src/*.hs src/*/*/*.hs | dot -Tpng > mod.png
View
BIN mod.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
3 src/Graphics/Blobs/NetworkUI.hs
@@ -15,18 +15,15 @@ import Graphics.Blobs.Common
import Graphics.Blobs.CommonIO
import qualified Graphics.Blobs.PersistentDocument as PD
import qualified Graphics.Blobs.PDDefaults as PD
---import Graphics.Blobs.Palette
import Graphics.Blobs.InfoKind
import Graphics.Blobs.DisplayOptions
---import Text.XML.HaXml.XmlContent (XmlContent)
import Text.XML.HaXml.XmlContent.Haskell (XmlContent)
import Text.Parse
import Graphics.Blobs.Operations
import Graphics.Blobs.NetworkControl (changeGlobalInfo)
import Graphics.UI.WX hiding (Child, upKey, downKey)
import Graphics.UI.WXCore
--- import Maybe
data Config = NFC
{ nfcWinDimensions :: (Int, Int, Int, Int) -- x, y, width, height
View
1 src/Graphics/Blobs/Operations.hs
@@ -1,6 +1,5 @@
module Graphics.Blobs.Operations where
--- import Graphics.Blobs.InfoKind
import Graphics.Blobs.Network
import Graphics.Blobs.State
import Graphics.Blobs.Document

No commit comments for this range

Something went wrong with that request. Please try again.