dx_core/
lib.rs

1/*
2 * Copyright 2015 Joshua R. Rodgers
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#![macro_use]
18
19#[macro_export]
20#[doc(hidden)]
21macro_rules! wrap_result(
22    ($hresult:ident => $result:expr) => {
23        if $hresult >= 0 { Ok($result) } else { Err($hresult) }
24    }
25);
26
27pub mod com {
28    pub type HResult<T> = Result<T, i32>;
29
30    pub use super::com_ref::ComRef;
31    pub use super::com_object::ComObject;
32    pub use super::iid::IID;
33    pub use super::iid::HasIID;
34    pub use super::unknown::Unknown;
35    pub use super::unknown::UnknownVtable;
36    pub use super::unknown::IUnknown;
37}
38
39pub mod win {
40    pub type HWnd = *mut ();
41    pub type HModule = *mut ();
42}
43
44pub mod util {
45    pub use super::enum_flags::EnumFlags;
46}
47
48mod com_ref;
49mod com_object;
50mod iid;
51mod unknown;
52mod enum_flags;