use binrw::BinRead;
use resource_fork::Resource;
use crate::common::Rect;
#[derive(Resource, BinRead, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[resource(code = "DLOG")]
#[br(big)]
pub struct Dialog {
pub bounds: Rect,
proc_id: u16,
#[br(map(|v: u16| v != 0))]
pub visible: bool,
#[br(map(|v: u16| v != 0))]
pub closable: bool,
ref_con: u32,
pub item_list: u16,
#[br(map(macintosh_utils::string))]
pub title: String,
#[br(try, align_before = 2)]
pub alignment: Option<u16>,
}
#[derive(Resource, BinRead, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[resource(code = "DLGX")]
#[br(big)]
pub struct ExtendedDialog {
version: u16,
flags: u32,
}