#pragma once

#include <Windows.h>
#include <si.h>
#include <siapp.h>

extern "C" {

	/// <summary>
	/// 3D鼠标设备数据
	/// </summary>
	__declspec(dllimport) typedef struct
	{
		/// <summary>
		/// 设备编号
		/// </summary>
		int id;

		/// <summary>
		/// 3D鼠标设备
		/// </summary>
		SiHdl device;

		/// <summary>
		/// 3D鼠标消息
		/// </summary>
		int WM_3DMOUSE;

	} ThreeDDeviceData;

	/// <summary>
	/// 3D鼠标数据
	/// </summary>
	__declspec(dllimport) typedef struct
	{
		/// <summary>
		/// 返回值为1时成功获取到3D鼠标数据
		/// </summary>
		long result;

		/// <summary>
		/// TX 值
		/// </summary>
		long tx;

		/// <summary>
		/// TY 值
		/// </summary>
		long ty;

		/// <summary>
		/// TZ 值
		/// </summary>
		long tz;

		/// <summary>
		/// RX 值
		/// </summary>
		long rx;

		/// <summary>
		/// RY 值
		/// </summary>
		long ry;

		/// <summary>
		/// RZ 值
		/// </summary>
		long rz;

		/// <summary>
		/// 事件
		/// </summary>
		long si_event;

	} ThreeDMouseData;

	/// <summary>
	/// 设备数据信息
	/// </summary>
	ThreeDDeviceData* device_datas[20];

	/// <summary>
	/// 全局初始化3D鼠标
	/// </summary>
	__declspec(dllimport) void three_mouse_global_init();

	/// <summary>
	/// 全局销毁3D鼠标
	/// </summary>
	__declspec(dllimport) void three_mouse_global_dispose();

	/// <summary>
	/// 获取3D鼠标个数
	/// </summary>
	/// <returns>3D鼠标个数</returns>
	__declspec(dllimport) int three_mouse_get_device_number();

	/// <summary>
	/// 打开3D鼠标设备
	/// </summary>
	/// <param name="hWnd">窗口句柄</param>
	/// <param name="id">编号</param>
	/// <returns>3D鼠标数据</returns>
	__declspec(dllimport) ThreeDDeviceData* three_mouse_open_device(HWND hWnd, int id);

	/// <summary>
	/// 处理3D鼠标消息
	/// </summary>
	/// <param name="id">设备编号</param>
	/// <param name="wParam">窗口消息</param>
	/// <param name="lParam">窗口消息</param>
	/// <returns>3D鼠标数据</returns>
	__declspec(dllimport) ThreeDMouseData* three_mouse_on_message(int id, WPARAM wParam, LPARAM lParam);

	/// <summary>
	/// 销毁3D鼠标指针
	/// </summary>
	/// <param name="ptr">指针</param>
	__declspec(dllimport) void three_mouse_dispose_ptr(void* ptr);
}