Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SetTextAlign stub #66

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified win32/dll/gdi32.dll
Binary file not shown.
13 changes: 12 additions & 1 deletion win32/src/winapi/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,12 @@ pub mod gdi32 {
let rop2 = <Result<R2, u32>>::from_stack(mem, esp + 8u32);
winapi::gdi32::SetROP2(machine, hdc, rop2).to_raw()
}
pub unsafe fn SetTextAlign(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let hdc = <HDC>::from_stack(mem, esp + 4u32);
let fMode = <u32>::from_stack(mem, esp + 8u32);
winapi::gdi32::SetTextAlign(machine, hdc, fMode).to_raw()
}
pub unsafe fn SetTextColor(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let hdc = <HDC>::from_stack(mem, esp + 4u32);
Expand Down Expand Up @@ -1728,6 +1734,10 @@ pub mod gdi32 {
name: "SetROP2",
func: crate::shims::Handler::Sync(impls::SetROP2),
};
pub const SetTextAlign: Shim = Shim {
name: "SetTextAlign",
func: crate::shims::Handler::Sync(impls::SetTextAlign),
};
pub const SetTextColor: Shim = Shim {
name: "SetTextColor",
func: crate::shims::Handler::Sync(impls::SetTextColor),
Expand All @@ -1749,7 +1759,7 @@ pub mod gdi32 {
func: crate::shims::Handler::Sync(impls::TextOutW),
};
}
const SHIMS: [Shim; 37usize] = [
const SHIMS: [Shim; 38usize] = [
shims::BitBlt,
shims::CreateBitmap,
shims::CreateCompatibleBitmap,
Expand Down Expand Up @@ -1782,6 +1792,7 @@ pub mod gdi32 {
shims::SetDIBitsToDevice,
shims::SetPixel,
shims::SetROP2,
shims::SetTextAlign,
shims::SetTextColor,
shims::StretchBlt,
shims::StretchDIBits,
Expand Down
5 changes: 5 additions & 0 deletions win32/src/winapi/gdi32/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ pub fn CreateFontA(
HFONT::null()
}

#[win32_derive::dllexport]
pub fn SetTextAlign(_machine: &mut Machine, hdc: HDC, fMode: u32) -> u32 {
0 // TA_LEFT | TA_TOP | TA_NOUPDATECP
}

#[win32_derive::dllexport]
pub fn SetTextColor(_machine: &mut Machine, hdc: HDC, color: COLORREF) -> COLORREF {
CLR_INVALID // fail
Expand Down