update plugin.

- sync PyBMap work. use different library name in different OS.
- add BMap encoding default value according to different OS (Windows and non-Windows) because non-Windows OS, we use libiconv as encoding converter.
- move all pointer properties to a single module and give corresponding visitor.
- add shared importer exporter parameters module thus bmfile import/export also can ref it.
This commit is contained in:
2023-11-16 22:41:03 +08:00
parent 59a1275f68
commit 1a2dd08092
8 changed files with 273 additions and 48 deletions

View File

@ -1,4 +1,4 @@
import ctypes, os
import ctypes, os, sys
#region Type Defines
@ -67,10 +67,21 @@ bm_VxMatrix_p = ctypes.POINTER(bm_VxMatrix)
#region BMap Loader
_g_BMapLibName: str
if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
_g_BMapLibName = "BMap.dll"
elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
_g_BMapLibName = "BMap.so"
elif sys.platform.startswith('darwin'):
_g_BMapLibName = "BMap.dylib"
else:
_g_BMapLibName = "BMap.bin"
_g_BMapModule: ctypes.CDLL = None
try:
_g_BMapModule = ctypes.cdll.LoadLibrary(
os.path.join(os.path.dirname(__file__), "BMap.dll")
os.path.join(os.path.dirname(__file__), _g_BMapLibName)
)
except:
_g_BMapModule = None