mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2025-07-07 13:35:50 +02:00
Parse enums from headers & generate code (#19)
This commit is contained in:
@ -122,13 +122,8 @@ module DearImGui
|
||||
, isItemHovered
|
||||
|
||||
-- * Types
|
||||
, ImGuiDir
|
||||
, pattern ImGuiDirLeft
|
||||
, pattern ImGuiDirRight
|
||||
, pattern ImGuiDirUp
|
||||
, pattern ImGuiDirDown
|
||||
, ImVec3(..)
|
||||
, ImVec4(..)
|
||||
, module DearImGui.Enums
|
||||
, module DearImGui.Structs
|
||||
)
|
||||
where
|
||||
|
||||
@ -139,6 +134,9 @@ import Foreign.C
|
||||
|
||||
-- dear-imgui
|
||||
import DearImGui.Context
|
||||
( imguiContext )
|
||||
import DearImGui.Enums
|
||||
import DearImGui.Structs
|
||||
|
||||
-- inline-c
|
||||
import qualified Language.C.Inline as C
|
||||
@ -777,17 +775,6 @@ isItemHovered = liftIO do
|
||||
(0 /=) <$> [C.exp| bool { IsItemHovered() } |]
|
||||
|
||||
|
||||
-- | A cardinal direction.
|
||||
newtype ImGuiDir = ImGuiDir CInt
|
||||
|
||||
|
||||
pattern ImGuiDirLeft, ImGuiDirRight, ImGuiDirUp, ImGuiDirDown :: ImGuiDir
|
||||
pattern ImGuiDirLeft = ImGuiDir 0
|
||||
pattern ImGuiDirRight = ImGuiDir 1
|
||||
pattern ImGuiDirUp = ImGuiDir 2
|
||||
pattern ImGuiDirDown = ImGuiDir 3
|
||||
|
||||
|
||||
withCStringOrNull :: Maybe String -> (Ptr CChar -> IO a) -> IO a
|
||||
withCStringOrNull Nothing k = k nullPtr
|
||||
withCStringOrNull (Just s) k = withCString s k
|
||||
|
Reference in New Issue
Block a user