1use crate::co;
2use crate::decl::*;
3use crate::kernel::privs::*;
4
5pub enum CurObj {
12 Bitmap(HBITMAP),
13 Brush(HBRUSH),
14 Font(HFONT),
15 Pal(HPALETTE),
16 Pen(HPEN),
17}
18
19#[derive(Clone)]
23pub enum IdObmStr {
24 Id(u16),
26 Obm(co::OBM),
28 Str(WString),
30}
31
32impl IdObmStr {
33 #[must_use]
35 pub fn from_str(v: &str) -> Self {
36 Self::Str(WString::from_str(v))
37 }
38
39 #[must_use]
41 pub fn as_ptr(&self) -> *const u16 {
42 match self {
43 Self::Id(id) => MAKEINTRESOURCE(*id as _),
44 Self::Obm(obm) => MAKEINTRESOURCE(obm.raw() as _),
45 Self::Str(ws) => ws.as_ptr(),
46 }
47 }
48}
49
50#[derive(Clone)]
54pub enum IdOcrStr {
55 Id(u16),
57 Ocr(co::OCR),
59 Str(WString),
61}
62
63impl IdOcrStr {
64 #[must_use]
66 pub fn from_str(v: &str) -> Self {
67 Self::Str(WString::from_str(v))
68 }
69
70 #[must_use]
72 pub fn as_ptr(&self) -> *const u16 {
73 match self {
74 Self::Id(id) => MAKEINTRESOURCE(*id as _),
75 Self::Ocr(ocr) => MAKEINTRESOURCE(ocr.raw() as _),
76 Self::Str(ws) => ws.as_ptr(),
77 }
78 }
79}
80
81#[derive(Clone)]
85pub enum IdOicStr {
86 Id(u16),
88 Oic(co::OIC),
90 Str(WString),
92}
93
94impl IdOicStr {
95 #[must_use]
97 pub fn from_str(v: &str) -> Self {
98 Self::Str(WString::from_str(v))
99 }
100
101 #[must_use]
103 pub fn as_ptr(&self) -> *const u16 {
104 match self {
105 Self::Id(id) => MAKEINTRESOURCE(*id as _),
106 Self::Oic(oic) => MAKEINTRESOURCE(oic.raw() as _),
107 Self::Str(ws) => ws.as_ptr(),
108 }
109 }
110}