Skip to content

Commit

Permalink
add SetTextAlign stub
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU authored and evmar committed Sep 23, 2024
1 parent faba6df commit efc8698
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
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

0 comments on commit efc8698

Please sign in to comment.