Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Apr 19, 2023
1 parent d77fef6 commit 6c791a0
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
7 changes: 7 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ members = [
"input_processor",
"itf_components",
"numberkey_windows",
"ruststringrange"
"ruststringrange",
"window_classes",
]
20 changes: 20 additions & 0 deletions rust/window_classes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "window_classes"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "window_classes"
crate-type = ["staticlib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
[dependencies.windows]
version = "0.38.0"
features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
]
18 changes: 18 additions & 0 deletions rust/window_classes/src/base_window.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use windows::Win32::Foundation::{HWND, RECT};

use crate::window_trait::Window;

pub struct BaseWindow {
handle: HWND,

// TODO: use Box<>
parent_window: *mut dyn Window,
ui_window: *mut dyn Window,

timer_ui_obj: *mut dyn Window,
ui_obj_capture: *mut dyn Window,

enable_virtual_window: bool,
visible_virtual_window: bool,
virtual_window_rect: RECT,
}
2 changes: 2 additions & 0 deletions rust/window_classes/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod base_window;
mod window_trait;
20 changes: 20 additions & 0 deletions rust/window_classes/src/window_trait.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use windows::Win32::Foundation::HWND;

use crate::base_window::BaseWindow;

pub trait Window {
fn create(
atom: u16,
ex_style: u32,
style: u32,
parent_window: *mut dyn Window,
window_width: u16,
window_height: u16,
parent_window_handle: HWND,
) where
Self: Sized;

fn get_window() -> HWND
where
Self: Sized;
}

0 comments on commit 6c791a0

Please sign in to comment.