lifted to imgui 1.89.7 & implot master (1.89.7 fixes)

This commit is contained in:
Nicole Dresselhaus 2023-07-18 00:47:16 +02:00
parent da2b394f82
commit 2998707915
9 changed files with 16 additions and 12 deletions

2
.gitmodules vendored
View File

@ -4,4 +4,4 @@
branch = v0.13 branch = v0.13
[submodule "dear-imgui.hs"] [submodule "dear-imgui.hs"]
path = dear-imgui.hs path = dear-imgui.hs
url = https://github.com/drezil/dear-imgui.hs url = https://github.com/haskell-game/dear-imgui.hs

@ -1 +1 @@
Subproject commit cf166acda9c207f59e57799875570b6529cf42fc Subproject commit 6ccb09a7daa915d41ee0d751eb49b0653435a207

View File

@ -46,7 +46,7 @@ library
DearImGui.Generator.Types DearImGui.Generator.Types
DearImGui.Structs DearImGui.Structs
DearImGui.Enums DearImGui.Enums
DearImGui.Context DearImGui.Raw.Context
hs-source-dirs: hs-source-dirs:
src src
default-language: default-language:
@ -65,7 +65,7 @@ library
implot/implot_demo.cpp implot/implot_demo.cpp
implot/implot_items.cpp implot/implot_items.cpp
cxx-options: cxx-options:
-std=c++11 -std=c++11 -DIMGUI_DEFINE_MATH_OPERATORS
extra-libraries: extra-libraries:
stdc++ stdc++
include-dirs: include-dirs:
@ -83,7 +83,7 @@ library
build-depends: base build-depends: base
, StateVar , StateVar
, containers , containers
, dear-imgui == 2.1.0 , dear-imgui == 2.1.3
, inline-c , inline-c
, inline-c-cpp , inline-c-cpp
, managed , managed

2
implot

@ -1 +1 @@
Subproject commit e80e42e8b4136ddb84ccfe04fa28d0c745828952 Subproject commit cc5e1daa5c7f2335a9460ae79c829011dc5cef2d

View File

@ -1 +0,0 @@
../../dear-imgui.hs/src/DearImGui/Context.hs

View File

@ -24,6 +24,8 @@ import Data.Traversable
( for ) ( for )
import Foreign.Storable import Foreign.Storable
( Storable ) ( Storable )
import Data.Coerce
( coerce )
-- containers -- containers
import Data.Map.Strict import Data.Map.Strict
@ -165,7 +167,7 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
pure ( finiteEnumInst : ) pure ( finiteEnumInst : )
else pure id else pure id
synonyms <- for patterns \ ( patternName, patternValue, CommentText _patDoc ) -> do synonyms <- for patterns \ ( patternName, patternValue, CommentText patDoc ) -> do
let let
patNameStr :: String patNameStr :: String
patNameStr = Text.unpack patternName patNameStr = Text.unpack patternName
@ -173,7 +175,7 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
patSynSig <- TH.patSynSigD patName ( TH.conT tyName ) patSynSig <- TH.patSynSigD patName ( TH.conT tyName )
pat <- pat <-
#if MIN_VERSION_template_haskell(2,18,0) #if MIN_VERSION_template_haskell(2,18,0)
( if Text.null _patDoc ( if Text.null patDoc
then TH.patSynD then TH.patSynD
else else
\ nm args dir pat -> \ nm args dir pat ->

View File

@ -98,7 +98,7 @@ plotHeaders = do
manyTill manyTill
( ( Left <$> try ignoreDefine) ( ( Left <$> try ignoreDefine)
<|> ( Right <$> enumeration enumNamesAndTypes) <|> ( Right <$> enumeration enumNamesAndTypes)
<|> ( Left <$> ignoreStruct) <|> ( Left <$> try ignoreStruct)
<|> ( Left <$> cppConditionalIgnore) <|> ( Left <$> cppConditionalIgnore)
) )
( namedSection "Callbacks" ) ( namedSection "Callbacks" )
@ -210,7 +210,7 @@ enumeration enumNamesAndTypes = do
enumTypeName = () enumTypeName = ()
( underlyingType, forwardDoc ) <- case HashMap.lookup enumName enumNamesAndTypes of ( underlyingType, forwardDoc ) <- case HashMap.lookup enumName enumNamesAndTypes of
Just res -> pure res Just res -> pure res
Nothing -> customFailure ( MissingForwardDeclaration { enumName } ) Nothing -> customFailure ( MissingForwardDeclaration { enumName, library = enumNamesAndTypes } )
let let
docs :: [Comment] docs :: [Comment]
docs = forwardDoc : CommentText "" : inlineDocs docs = forwardDoc : CommentText "" : inlineDocs
@ -438,6 +438,7 @@ cppDirective f = token ( \case { BeginCPP a -> f a; _ -> Nothing } ) mempty
cppConditional :: MonadParsec e [Tok] m => m () cppConditional :: MonadParsec e [Tok] m => m ()
cppConditional = do cppConditional = do
void $ many comment
void $ cppDirective ( \case { "ifdef" -> Just True; "ifndef" -> Just False; _ -> Nothing } ) void $ cppDirective ( \case { "ifdef" -> Just True; "ifndef" -> Just False; _ -> Nothing } )
-- assumes no nesting -- assumes no nesting
void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) ) void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) )
@ -445,6 +446,7 @@ cppConditional = do
cppConditionalIgnore :: MonadParsec e [Tok] m => m () cppConditionalIgnore :: MonadParsec e [Tok] m => m ()
cppConditionalIgnore = do cppConditionalIgnore = do
void $ many comment
void $ cppDirective ( \case { "ifdef" -> Just (); "ifndef" -> Just (); "if" -> Just (); _ -> Nothing } ) void $ cppDirective ( \case { "ifdef" -> Just (); "ifndef" -> Just (); "if" -> Just (); _ -> Nothing } )
-- assumes no nesting -- assumes no nesting
void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) ) void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) )

View File

@ -0,0 +1 @@
../../../dear-imgui.hs/src/DearImGui/Raw/Context.hs

View File

@ -40,7 +40,7 @@ import System.IO.Unsafe
-- dear-imgui -- dear-imgui
import DearImGui import DearImGui
import DearImGui.Context import DearImGui.Raw.Context
import DearImGui.Plot.Context import DearImGui.Plot.Context
( implotContext ) ( implotContext )
import DearImGui.Plot.Enums import DearImGui.Plot.Enums