mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-12-25 23:04:06 +00:00
54 lines
1.2 KiB
Plaintext
54 lines
1.2 KiB
Plaintext
|
{-# LANGUAGE DataKinds #-}
|
||
|
{-# LANGUAGE PolyKinds #-}
|
||
|
{-# LANGUAGE RoleAnnotations #-}
|
||
|
{-# LANGUAGE TypeFamilies #-}
|
||
|
|
||
|
module MetaBrush.UI.Menu
|
||
|
( ResourceType(..), MenuItem
|
||
|
, Menu
|
||
|
, FileMenu, EditMenu, ViewMenu, HelpMenu
|
||
|
, newMenuBar, createMenuBar
|
||
|
) where
|
||
|
|
||
|
-- base
|
||
|
import Data.Kind
|
||
|
( Type )
|
||
|
|
||
|
-- gi-gtk
|
||
|
import qualified GI.Gtk as GTK
|
||
|
|
||
|
-- transformers
|
||
|
import Control.Monad.IO.Class
|
||
|
( MonadIO )
|
||
|
import MetaBrush.Asset.Colours
|
||
|
( Colours )
|
||
|
import {-# SOURCE #-} MetaBrush.Context
|
||
|
( UIElements, Variables )
|
||
|
|
||
|
--------------------------------------------------------------------------------
|
||
|
|
||
|
data ResourceType
|
||
|
= Description
|
||
|
| Object
|
||
|
|
||
|
data family MenuItem ( action :: Type ) ( submenu :: ResourceType -> Type ) ( r :: ResourceType )
|
||
|
|
||
|
data Menu ( rt :: ResourceType )
|
||
|
type role Menu nominal
|
||
|
|
||
|
data FileMenu ( rt :: ResourceType )
|
||
|
type role FileMenu nominal
|
||
|
|
||
|
data EditMenu ( rt :: ResourceType )
|
||
|
type role EditMenu nominal
|
||
|
|
||
|
data ViewMenu ( rt :: ResourceType )
|
||
|
type role ViewMenu nominal
|
||
|
|
||
|
data HelpMenu ( rt :: ResourceType )
|
||
|
type role HelpMenu nominal
|
||
|
|
||
|
newMenuBar :: MonadIO m => UIElements -> Variables -> GTK.AccelGroup -> m ( GTK.MenuBar, Menu Object )
|
||
|
|
||
|
createMenuBar :: UIElements -> Variables -> Colours -> IO ( Menu Object )
|