use crate::co;
use crate::decl::*;
use crate::kernel::privs::*;
pub enum CurObj {
Bitmap(HBITMAP),
Brush(HBRUSH),
Font(HFONT),
Pal(HPALETTE),
Pen(HPEN),
}
#[derive(Clone)]
pub enum IdObmStr {
Id(u16),
Obm(co::OBM),
Str(WString),
}
impl IdObmStr {
#[must_use]
pub fn from_str(v: &str) -> Self {
Self::Str(WString::from_str(v))
}
#[must_use]
pub fn as_ptr(&self) -> *const u16 {
use IdObmStr::*;
match self {
Id(id) => MAKEINTRESOURCE(*id as _),
Obm(obm) => MAKEINTRESOURCE(obm.raw() as _),
Str(ws) => ws.as_ptr(),
}
}
}
#[derive(Clone)]
pub enum IdOcrStr {
Id(u16),
Ocr(co::OCR),
Str(WString),
}
impl IdOcrStr {
#[must_use]
pub fn from_str(v: &str) -> Self {
Self::Str(WString::from_str(v))
}
#[must_use]
pub fn as_ptr(&self) -> *const u16 {
use IdOcrStr::*;
match self {
Id(id) => MAKEINTRESOURCE(*id as _),
Ocr(ocr) => MAKEINTRESOURCE(ocr.raw() as _),
Str(ws) => ws.as_ptr(),
}
}
}
#[derive(Clone)]
pub enum IdOicStr {
Id(u16),
Oic(co::OIC),
Str(WString),
}
impl IdOicStr {
#[must_use]
pub fn from_str(v: &str) -> Self {
Self::Str(WString::from_str(v))
}
#[must_use]
pub fn as_ptr(&self) -> *const u16 {
use IdOicStr::*;
match self {
Id(id) => MAKEINTRESOURCE(*id as _),
Oic(oic) => MAKEINTRESOURCE(oic.raw() as _),
Str(ws) => ws.as_ptr(),
}
}
}