use crate::co;
use crate::comctl::privs::*;
use crate::decl::*;
use crate::msg::*;
use crate::ole::privs::*;
use crate::prelude::*;
use crate::user::privs::*;
pub struct TvmCreateDragImage<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmCreateDragImage<'a> {
type RetType = SysResult<HIMAGELIST>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::CREATEDRAGIMAGE.into(),
wparam: 0,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmDeleteItem<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmDeleteItem<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::DELETEITEM.into(),
wparam: 0,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmEditLabel<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmEditLabel<'a> {
type RetType = SysResult<HWND>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|p| unsafe { HWND::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::EDITLABEL.into(),
wparam: 0,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmEndEditLabelNow {
pub save: bool,
}
impl MsgSend for TvmEndEditLabelNow {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::ENDEDITLABELNOW.into(),
wparam: !self.save as _,
lparam: 0,
}
}
}
pub struct TvmEnsureVisible<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmEnsureVisible<'a> {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::ENSUREVISIBLE.into(),
wparam: 0,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmExpand<'a> {
pub action: co::TVE,
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmExpand<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::EXPAND.into(),
wparam: self.action.raw() as _,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmGetBkColor {}
impl MsgSend for TvmGetBkColor {
type RetType = Option<COLORREF>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
minus1_as_none(v).map(|v| unsafe { COLORREF::from_raw(v as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETBKCOLOR.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetCount {}
impl MsgSend for TvmGetCount {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETCOUNT.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetEditControl {}
impl MsgSend for TvmGetEditControl {
type RetType = SysResult<HWND>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|p| unsafe { HWND::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETEDITCONTROL.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetExtendedStyle {}
impl MsgSend for TvmGetExtendedStyle {
type RetType = co::TVS_EX;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
unsafe { co::TVS_EX::from_raw(v as _) }
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETEXTENDEDSTYLE.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetImageList {
pub kind: co::TVSIL,
}
impl MsgSend for TvmGetImageList {
type RetType = Option<HIMAGELIST>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETIMAGELIST.into(),
wparam: self.kind.raw() as _,
lparam: 0,
}
}
}
pub struct TvmGetIndent {}
impl MsgSend for TvmGetIndent {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETINDENT.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetInsertMarkColor {}
impl MsgSend for TvmGetInsertMarkColor {
type RetType = COLORREF;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
unsafe { COLORREF::from_raw(v as _) }
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETINSERTMARKCOLOR.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetISearchString<'a> {
pub buf: &'a mut WString,
}
impl<'a> MsgSend for TvmGetISearchString<'a> {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETISEARCHSTRING.into(),
wparam: 0,
lparam: unsafe { self.buf.as_mut_ptr() } as _,
}
}
}
pub struct TvmGetItem<'a, 'b> {
pub tvitem: &'b mut TVITEMEX<'a>,
}
impl<'a, 'b> MsgSend for TvmGetItem<'a, 'b> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETITEM.into(),
wparam: 0,
lparam: self.tvitem as *mut _ as _,
}
}
}
pub struct TvmGetItemHeight {}
impl MsgSend for TvmGetItemHeight {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETITEMHEIGHT.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetItemRect<'a> {
pub text_only: bool,
pub rect: &'a mut RECT,
}
impl<'a> MsgSend for TvmGetItemRect<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETITEMRECT.into(),
wparam: self.text_only as _,
lparam: self.rect as *mut _ as _,
}
}
}
pub struct TvmGetItemState<'a> {
pub hitem: &'a HTREEITEM,
pub mask: co::TVIS,
}
impl<'a> MsgSend for TvmGetItemState<'a> {
type RetType = co::TVIS;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
unsafe { co::TVIS::from_raw(v as _) }
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETITEMSTATE.into(),
wparam: self.hitem.ptr() as _,
lparam: self.mask.raw() as _,
}
}
}
pub struct TvmGetLineColor {}
impl MsgSend for TvmGetLineColor {
type RetType = Option<COLORREF>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
match v as u32 {
CLR_DEFAULT => None,
c => Some(unsafe { COLORREF::from_raw(c) }),
}
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETLINECOLOR.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetNextItem<'a> {
pub relationship: co::TVGN,
pub hitem: Option<&'a HTREEITEM>,
}
impl<'a> MsgSend for TvmGetNextItem<'a> {
type RetType = Option<HTREEITEM>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HTREEITEM::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETNEXTITEM.into(),
wparam: self.relationship.raw() as _,
lparam: self.hitem.map_or(0, |h| h.ptr() as _),
}
}
}
pub struct TvmGetScrollTime {}
impl MsgSend for TvmGetScrollTime {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETSCROLLTIME.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetTextColor {}
impl MsgSend for TvmGetTextColor {
type RetType = Option<COLORREF>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
minus1_as_none(v).map(|v| unsafe { COLORREF::from_raw(v as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETTEXTCOLOR.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetTooltips {}
impl MsgSend for TvmGetTooltips {
type RetType = Option<HWND>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HWND::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETTOOLTIPS.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetUnicodeFormat {}
impl MsgSend for TvmGetUnicodeFormat {
type RetType = bool;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v != 0
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETUNICODEFORMAT.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmGetVisibleCount {}
impl MsgSend for TvmGetVisibleCount {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::GETVISIBLECOUNT.into(),
wparam: 0,
lparam: 0,
}
}
}
pub struct TvmHitTest<'a> {
pub info: &'a TVHITTESTINFO,
}
impl<'a> MsgSend for TvmHitTest<'a> {
type RetType = Option<HTREEITEM>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HTREEITEM::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::HITTEST.into(),
wparam: 0,
lparam: &mut self.info as *mut _ as _,
}
}
}
pub struct TvmInsertItem<'a, 'b> {
pub item: &'b TVINSERTSTRUCT<'a>,
}
impl<'a, 'b> MsgSend for TvmInsertItem<'a, 'b> {
type RetType = SysResult<HTREEITEM>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|p| unsafe { HTREEITEM::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::INSERTITEM.into(),
wparam: 0,
lparam: self.item as *const _ as _,
}
}
}
pub struct TvmMapAccIdToHtreeitem {
pub acc_id: u32,
}
impl MsgSend for TvmMapAccIdToHtreeitem {
type RetType = SysResult<HTREEITEM>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|p| unsafe { HTREEITEM::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::MAPACCIDTOHTREEITEM.into(),
wparam: self.acc_id as _,
lparam: 0,
}
}
}
pub struct TvmMapHtreeitemToAccId<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmMapHtreeitemToAccId<'a> {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::MAPHTREEITEMTOACCID.into(),
wparam: self.hitem.ptr() as _,
lparam: 0,
}
}
}
pub struct TvmSelectItem<'a> {
pub action: co::TVGN,
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmSelectItem<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SELECTITEM.into(),
wparam: self.action.raw() as _,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmSetAutoScrollInfo {
pub pixels_per_second: u32,
pub redraw_interval: u32,
}
impl MsgSend for TvmSetAutoScrollInfo {
type RetType = ();
unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
()
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETAUTOSCROLLINFO.into(),
wparam: self.pixels_per_second as _,
lparam: self.redraw_interval as _,
}
}
}
pub struct TvmSetBkColor {
pub color: Option<COLORREF>,
}
impl MsgSend for TvmSetBkColor {
type RetType = Option<COLORREF>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
match v {
-1 => None,
v => Some(unsafe { COLORREF::from_raw(v as _) }),
}
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETBKCOLOR.into(),
wparam: 0,
lparam: self.color.map_or(-1, |color| u32::from(color) as _),
}
}
}
pub struct TvmSetBorder {
pub action: co::TVSBF,
pub left: u16,
pub top: u16,
}
impl MsgSend for TvmSetBorder {
type RetType = (u16, u16);
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
(LOWORD(v as _), HIWORD(v as _))
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETBORDER.into(),
wparam: self.action.raw() as _,
lparam: MAKEDWORD(self.left, self.top) as _,
}
}
}
pub struct TvmSetExtendedStyle {
pub style: co::TVS_EX,
pub mask: co::TVS_EX,
}
impl MsgSend for TvmSetExtendedStyle {
type RetType = HrResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
HrRet(v as _).to_hrresult()
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETEXTENDEDSTYLE.into(),
wparam: self.style.raw() as _,
lparam: self.mask.raw() as _,
}
}
}
pub struct TvmSetHot<'a> {
pub hitem: Option<&'a HTREEITEM>,
}
impl<'a> MsgSend for TvmSetHot<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETHOT.into(),
wparam: 0,
lparam: self.hitem.map_or(0, |h| h.ptr() as _),
}
}
}
pub struct TvmSetImageList {
pub kind: co::TVSIL,
pub himagelist: Option<HIMAGELIST>,
}
impl MsgSend for TvmSetImageList {
type RetType = Option<HIMAGELIST>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETIMAGELIST.into(),
wparam: self.kind.raw() as _,
lparam: self.himagelist.as_ref().map_or(0, |h| h.ptr() as _),
}
}
}
pub struct TvmSetIndent {
pub width: u32,
}
impl MsgSend for TvmSetIndent {
type RetType = ();
unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
()
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETINDENT.into(),
wparam: self.width as _,
lparam: 0,
}
}
}
pub struct TvmSetInsertMark<'a> {
pub insert_after: bool,
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmSetInsertMark<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETINSERTMARK.into(),
wparam: self.insert_after as _,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmSetInsertMarkColor {
pub color: COLORREF,
}
impl MsgSend for TvmSetInsertMarkColor {
type RetType = COLORREF;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
unsafe { COLORREF::from_raw(v as _) }
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETINSERTMARKCOLOR.into(),
wparam: 0,
lparam: u32::from(self.color) as _,
}
}
}
pub struct TvmSetItem<'a, 'b> {
pub tvitem: &'b TVITEMEX<'a>,
}
impl<'a, 'b> MsgSend for TvmSetItem<'a, 'b> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETITEM.into(),
wparam: 0,
lparam: self.tvitem as *const _ as _,
}
}
}
pub struct TvmSetItemHeight {
pub height: Option<u32>,
}
impl MsgSend for TvmSetItemHeight {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETITEMHEIGHT.into(),
wparam: self.height.map_or(-1, |h| h as _) as _,
lparam: 0,
}
}
}
pub struct TvmSetLineColor {
pub color: Option<COLORREF>,
}
impl MsgSend for TvmSetLineColor {
type RetType = COLORREF;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
unsafe { COLORREF::from_raw(v as _) }
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETLINECOLOR.into(),
wparam: 0,
lparam: self.color.map_or(CLR_DEFAULT, |c| c.into()) as _,
}
}
}
pub struct TvmSetScrollTime {
pub time_ms: u32,
}
impl MsgSend for TvmSetScrollTime {
type RetType = u32;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v as _
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETSCROLLTIME.into(),
wparam: self.time_ms as _,
lparam: 0,
}
}
}
pub struct TvmSetTextColor {
pub color: Option<COLORREF>,
}
impl MsgSend for TvmSetTextColor {
type RetType = Option<COLORREF>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
match v {
-1 => None,
v => Some(unsafe { COLORREF::from_raw(v as _) }),
}
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETTEXTCOLOR.into(),
wparam: 0,
lparam: self.color.map_or(-1, |color| u32::from(color) as _),
}
}
}
pub struct TvmSetTooltips<'a> {
pub htooltips: Option<&'a HWND>,
}
impl<'a> MsgSend for TvmSetTooltips<'a> {
type RetType = Option<HWND>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_none(v).map(|p| unsafe { HWND::from_ptr(p as _) })
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETTOOLTIPS.into(),
wparam: self.htooltips.map_or(0, |h| h.ptr() as _),
lparam: 0,
}
}
}
pub struct TvmSetUnicodeFormat {
pub use_unicode: bool,
}
impl MsgSend for TvmSetUnicodeFormat {
type RetType = bool;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
v != 0
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SETUNICODEFORMAT.into(),
wparam: self.use_unicode as _,
lparam: 0,
}
}
}
pub struct TvmShowInfoTip<'a> {
pub hitem: &'a HTREEITEM,
}
impl<'a> MsgSend for TvmShowInfoTip<'a> {
type RetType = ();
unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
()
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SHOWINFOTIP.into(),
wparam: 0,
lparam: self.hitem.ptr() as _,
}
}
}
pub struct TvmSortChildren {
pub recursive: bool,
}
impl MsgSend for TvmSortChildren {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SORTCHILDREN.into(),
wparam: self.recursive as _,
lparam: 0,
}
}
}
pub struct TvmSortChildrenCb<'a> {
pub info: &'a TVSORTCB,
}
impl<'a> MsgSend for TvmSortChildrenCb<'a> {
type RetType = SysResult<()>;
unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
zero_as_badargs(v).map(|_| ())
}
fn as_generic_wm(&mut self) -> Wm {
Wm {
msg_id: co::TVM::SORTCHILDRENCB.into(),
wparam: 0,
lparam: self.info as *const _ as _,
}
}
}