use crate::{
evtc::{Agent, Event},
imgui,
util::abi,
};
use std::os::raw::c_char;
use windows::Win32::Foundation::{HWND, LPARAM, WPARAM};
#[repr(C)]
pub struct ArcDpsExport {
pub size: usize,
pub sig: u32,
pub imgui_version: u32,
pub out_name: *const c_char,
pub out_build: *const c_char,
pub wnd_nofilter: Option<RawWndProcCallback>,
pub combat: Option<RawCombatCallback>,
pub imgui: Option<RawImguiCallback>,
pub options_end: Option<RawOptionsCallback>,
pub combat_local: Option<RawCombatCallback>,
pub wnd_filter: Option<RawWndProcCallback>,
pub options_windows: Option<RawOptionsWindowsCallback>,
}
unsafe impl Sync for ArcDpsExport {}
pub type InitFunc = fn() -> Result<(), String>;
pub type ReleaseFunc = fn();
pub type UpdateUrlFunc = fn() -> Option<String>;
pub type WndProcCallback = fn(key: usize, key_down: bool, prev_key_down: bool) -> bool;
pub type CombatCallback = fn(
event: Option<&Event>,
src: Option<&Agent>,
dst: Option<&Agent>,
skill_name: Option<&'static str>,
id: u64,
revision: u64,
);
pub type ImguiCallback = fn(ui: &imgui::Ui, not_character_select_or_loading: bool);
pub type OptionsCallback = fn(ui: &imgui::Ui);
pub type OptionsWindowsCallback = fn(ui: &imgui::Ui, window_name: Option<&str>) -> bool;
abi! {
pub type RawWndProcCallback =
unsafe extern fn(h_wnd: HWND, u_msg: u32, w_param: WPARAM, l_param: LPARAM) -> u32;
pub type RawCombatCallback = unsafe extern fn(
event: *const Event,
src: *const Agent,
dst: *const Agent,
skill_name: *const c_char,
id: u64,
revision: u64,
);
pub type RawImguiCallback = unsafe extern fn(not_character_select_or_loading: u32);
pub type RawOptionsCallback = unsafe extern fn();
pub type RawOptionsWindowsCallback = unsafe extern fn(window_name: *const c_char) -> bool;
}