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
[submodule "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.Structs
DearImGui.Enums
DearImGui.Context
DearImGui.Raw.Context
hs-source-dirs:
src
default-language:
@ -65,7 +65,7 @@ library
implot/implot_demo.cpp
implot/implot_items.cpp
cxx-options:
-std=c++11
-std=c++11 -DIMGUI_DEFINE_MATH_OPERATORS
extra-libraries:
stdc++
include-dirs:
@ -83,7 +83,7 @@ library
build-depends: base
, StateVar
, containers
, dear-imgui == 2.1.0
, dear-imgui == 2.1.3
, inline-c
, inline-c-cpp
, 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 )
import Foreign.Storable
( Storable )
import Data.Coerce
( coerce )
-- containers
import Data.Map.Strict
@ -165,7 +167,7 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
pure ( finiteEnumInst : )
else pure id
synonyms <- for patterns \ ( patternName, patternValue, CommentText _patDoc ) -> do
synonyms <- for patterns \ ( patternName, patternValue, CommentText patDoc ) -> do
let
patNameStr :: String
patNameStr = Text.unpack patternName
@ -173,7 +175,7 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
patSynSig <- TH.patSynSigD patName ( TH.conT tyName )
pat <-
#if MIN_VERSION_template_haskell(2,18,0)
( if Text.null _patDoc
( if Text.null patDoc
then TH.patSynD
else
\ nm args dir pat ->

View File

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