@@ -14,21 +14,6 @@ import Data.Semigroup ((<>))
15import Graphics.Vty.UnicodeWidthTable.Types
15import Graphics.Vty.UnicodeWidthTable.Types
17−foreign import ccall unsafe "vty_init_custom_table"
18− initCustomTable :: Int -> IO Int
20−foreign import ccall unsafe "vty_set_custom_table_range"
21− setCustomTableRange :: Word32 -> Word32 -> Word8 -> IO Int
23−foreign import ccall unsafe "vty_activate_custom_table"
24− activateCustomTable :: IO Int
26−foreign import ccall unsafe "vty_custom_table_ready"
27− c_isCustomTableReady :: IO Int
29−foreign import ccall unsafe "vty_deallocate_custom_table"
30− deallocateCustomTable :: IO ()
32-- | Returns True if and only if a custom table has been allocated and
17-- | Returns True if and only if a custom table has been allocated and
33-- marked as ready for use. Returns False otherwise.
18-- marked as ready for use. Returns False otherwise.
34isCustomTableReady :: IO Bool
19isCustomTableReady :: IO Bool
@@ -91,3 +76,21 @@ installUnicodeWidthTable table = do
91 when (actResult /= 0) $
76 when (actResult /= 0) $
92 error $ "installUnicodeWidthTable: error activating custom " <>
77 error $ "installUnicodeWidthTable: error activating custom " <>
93 "table, status " <> show actResult
78 "table, status " <> show actResult
80+------------------------------------------------------------------------
83+foreign import ccall unsafe "vty_init_custom_table"
84+ initCustomTable :: Int -> IO Int
86+foreign import ccall unsafe "vty_set_custom_table_range"
87+ setCustomTableRange :: Word32 -> Word32 -> Word8 -> IO Int
89+foreign import ccall unsafe "vty_activate_custom_table"
90+ activateCustomTable :: IO Int
92+foreign import ccall unsafe "vty_custom_table_ready"
93+ c_isCustomTableReady :: IO Int
95+foreign import ccall unsafe "vty_deallocate_custom_table"
96+ deallocateCustomTable :: IO ()